@cartanova/qgrid-cli 2.11.0 → 2.11.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.
- package/bundle/web-dist/client/assets/index-C96h3feE.js +32 -0
- package/bundle/web-dist/client/assets/logs-DBM6U0QD.js +1 -0
- package/bundle/web-dist/client/assets/monit-BBjXa7vB.js +1 -0
- package/bundle/web-dist/client/assets/plus-BsQdY7PS.js +1 -0
- package/bundle/web-dist/client/assets/refresh-cw-D9IUmT23.js +1 -0
- package/bundle/web-dist/client/assets/request-model-Bpp_rkK8.js +1 -0
- package/bundle/web-dist/client/assets/routes-Crz_PQzi.js +5 -0
- package/bundle/web-dist/client/assets/{services.generated-CefiDXEv.js → services.generated-B5lc3aIC.js} +1 -1
- package/bundle/web-dist/client/assets/settings-Cdwm3OBB.js +1 -0
- package/bundle/web-dist/client/assets/show-DBUhALT1.js +2 -0
- package/bundle/web-dist/client/assets/tokens-CVQAVJTo.js +1 -0
- package/bundle/web-dist/client/assets/use-oauth-login-flow-BfxYI4Oh.js +1 -0
- package/bundle/web-dist/client/assets/use-update-token-mutation-qKBC2sn7.js +1 -0
- package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +9 -0
- package/bundle/web-dist/client/assets/vendor-tanstack-DRPs09ai.js +1 -0
- package/bundle/web-dist/client/index.html +4 -4
- package/bundle/web-dist/server/assets/{lazyRouteComponent-D8iTIHyn.js → lazyRouteComponent-AKiHfZWp.js} +2 -2
- package/bundle/web-dist/server/assets/logs-B7QmGJq3.js +513 -0
- package/bundle/web-dist/server/assets/{monit-B2hqorPe.js → monit-DFt7x3bh.js} +117 -375
- package/bundle/web-dist/server/assets/plus-DaYQRpBt.js +19 -0
- package/bundle/web-dist/server/assets/{react-dom-BIYQzBqG.js → react-dom-Cv23mm1K.js} +1 -1
- package/bundle/web-dist/server/assets/refresh-cw-BpXNsAy-.js +23 -0
- package/bundle/web-dist/server/assets/{request-model-I6OdODSH.js → request-model-eHE6YbaF.js} +6 -15
- package/bundle/web-dist/server/assets/{routes-B95YlUv2.js → routes-_Y-PJfgO.js} +203 -679
- package/bundle/web-dist/server/assets/{services.generated-DQATJ6qf.js → services.generated-CMJ8AHbO.js} +3796 -4012
- package/bundle/web-dist/server/assets/settings-JwJKxn2e.js +461 -0
- package/bundle/web-dist/server/assets/{show-Bxaj3rhH.js → show-BEv6z1v_.js} +368 -1270
- package/bundle/web-dist/server/assets/tokens-CNT4mI-f.js +560 -0
- package/bundle/web-dist/server/assets/{use-oauth-login-flow-CKDHgc3U.js → use-oauth-login-flow-jkAkT3X6.js} +16 -50
- package/bundle/web-dist/server/assets/{use-update-token-mutation-BEbgOzaa.js → use-update-token-mutation-Sm6kh02m.js} +1 -1
- package/bundle/web-dist/server/entry-server.generated.js +1130 -2626
- package/package.json +1 -1
- package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +0 -31
- package/bundle/web-dist/client/assets/logs-C47OJGEI.js +0 -1
- package/bundle/web-dist/client/assets/monit-BS9no0dU.js +0 -4
- package/bundle/web-dist/client/assets/plus-sdACTfH0.js +0 -1
- package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +0 -1
- package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +0 -1
- package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +0 -5
- package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +0 -1
- package/bundle/web-dist/client/assets/show-u8Np69q3.js +0 -2
- package/bundle/web-dist/client/assets/tokens-QvP410NW.js +0 -1
- package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +0 -1
- package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +0 -1
- package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +0 -244
- package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +0 -1
- package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +0 -825
- package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +0 -28
- package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +0 -44
- package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +0 -830
- package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +0 -1038
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Dw2cE7zH.js";import{l as e,u as t}from"./vendor-tanstack-DRPs09ai.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{E as i,T as a,n as o,o as ee,r as s}from"./services.generated-B5lc3aIC.js";import{i as c,n as l,r as u}from"./index-C96h3feE.js";import{i as d,r as f,t as p}from"./cost-DB3HbU7T.js";import{n as m,t as h}from"./total-cost-MnfKU8IN.js";import{t as g}from"./refresh-cw-D9IUmT23.js";import{n as _,t as v}from"./request-model-Bpp_rkK8.js";n();var y=r(),b=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m15 18l-6-6l6-6`})}),x=e=>(0,y.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m9 18l6-6l-6-6`})}),S=50,C=`__unassigned__`;function w(e){let t=new Date(e);return`${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)} ${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function T(e){return e.toLocaleString()}function E(e){let t=Math.round(e/1e3),n=Math.floor(t/60),r=t%60;return n>0?`${n}m ${r}s`:`${r}s`}function D({status:e,requestedModel:t,servedModel:n,imageCostMethod:r,fallbackCount:i}){if(e===`running`)return(0,y.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded-full bg-blue-100 text-blue-600 font-medium whitespace-nowrap`,children:`실행 중`});let a=v({status:e,requestedModel:t,servedModel:n,imageCostMethod:r}),o=t!==null&&n===null;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`text-xs text-sand-500`,children:a.label}),o&&(0,y.jsx)(`span`,{className:`ml-1 text-[9px] text-sand-400`,children:`요청`}),(i??0)>0&&(0,y.jsxs)(`span`,{className:`ml-1 text-[9px] text-caution-500`,children:[`×`,i]})]})}function O(e){return e<=0?`—`:e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}var k=[{label:`ID`,align:`left`,width:`w-12`,sortKey:`id`},{label:`Date`,align:`left`,width:`w-20`,sortKey:`created_at`},{label:`Project`,align:`left`,width:`w-20`},{label:`Token`,align:`left`,width:`w-24`},{label:`Model`,align:`left`,width:`w-20`},{label:`Fmt`,align:`left`,width:`w-12`},{label:`TTFT`,align:`right`,width:`w-16`,sortKey:`ttft_ms`},{label:`Duration`,align:`right`,width:`w-20`,sortKey:`duration_ms`},{label:`In`,align:`right`,width:`w-16`,sortKey:`input_tokens`},{label:`Out`,align:`right`,width:`w-20`,sortKey:`output_tokens`},{label:`C.Read`,align:`right`,width:`w-20`,sortKey:`cache_read_tokens`},{label:`C.Write`,align:`right`,width:`w-20`,sortKey:`cache_creation_tokens`},{label:`Hit`,align:`right`,width:`w-14`},{label:`Tools`,align:`right`,width:`w-14`},{label:`$`,align:`right`,width:`w-20`,sortKey:`cost_usd`}];function A({search:n,onSearchChange:r}){let i=t(),a=n.page??1,l=n.token??``,u=n.project??``,v=n.model??``,{data:A}=ee.useTokens(`A`),j=(A?.rows??[]).map(e=>e.name).filter(Boolean),{data:M}=o.useProjectNames(),N=M?.names??[],{data:P}=o.useModelNames(),F=P?.names??[],I=u===C?{project_name_is_null:!0}:u?{project_name:u}:{},L={};l&&(L.token_name=l),Object.assign(L,I),v&&(L.model_name=v);let R=n.sort??`id-desc`,z=R.lastIndexOf(`-`),B=R.slice(0,z),V=R.slice(z+1)===`asc`?`asc`:`desc`,{data:H,isLoading:U,isError:W,refresh:G,isRefreshing:K}=s.useRequestLogs(`P`,{num:S,page:a,orderBy:R,...L}),{data:q,isError:J,refresh:Y}=o.useTotalCost({num:0,page:1,...L}),X=H?.rows??[],Z=H?.total??0,Q=Math.ceil(Z/S),$=e=>{r({...n,...e,page:1})};return(0,y.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`panel-header flex items-center gap-2 px-3 py-2.5 flex-wrap sm:gap-3 sm:px-5`,children:[(0,y.jsxs)(`select`,{value:l,onChange:e=>$({token:e.target.value||void 0}),disabled:j.length===0,className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300 disabled:text-sand-300 disabled:cursor-not-allowed`,children:[(0,y.jsx)(`option`,{value:``,children:j.length>0?`All Tokens`:`Tokens —`}),j.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))]}),(0,y.jsxs)(`select`,{value:u,onChange:e=>$({project:e.target.value||void 0}),className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300`,children:[(0,y.jsx)(`option`,{value:``,children:`All Projects`}),(0,y.jsx)(`option`,{value:C,children:`(unassigned)`}),N.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))]}),(0,y.jsxs)(`select`,{value:v,onChange:e=>$({model:e.target.value||void 0}),disabled:F.length===0,className:`border border-sand-200/80 rounded-lg px-2.5 py-1.5 text-[11px] text-sand-700 bg-sand-50/50 focus:outline-none focus:border-sienna-300 disabled:text-sand-300 disabled:cursor-not-allowed`,children:[(0,y.jsx)(`option`,{value:``,children:F.length>0?`All Models`:`Models —`}),F.map(e=>(0,y.jsx)(`option`,{value:e,children:e},e))]}),(0,y.jsx)(`button`,{type:`button`,onClick:()=>void Promise.all([G(),Y()]),disabled:K,"aria-label":`Reload`,title:`Reload`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,children:(0,y.jsx)(g,{className:K?`size-3.5 animate-spin`:`size-3.5`})}),(0,y.jsx)(`div`,{className:`flex-1`}),(0,y.jsxs)(`span`,{className:`text-[11px] text-sand-400`,children:[W||!H?`—`:Z,` results`]}),J?(0,y.jsx)(`span`,{role:`alert`,className:`text-[11px] text-danger-500`,children:`Failed to load total cost.`}):(0,y.jsxs)(`span`,{className:`text-[11px] tabular-nums font-medium text-sienna-600`,children:[q?d(q.usd):`—`,q&&h(q)?(0,y.jsx)(`span`,{className:`ml-1 font-normal text-sand-400`,title:m(q)??void 0,children:h(q)}):null]})]}),W?(0,y.jsx)(`div`,{role:`alert`,className:`text-danger-500 text-center py-12 text-sm`,children:`Failed to load request logs.`}):U?(0,y.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5}).map((e,t)=>(0,y.jsx)(`div`,{className:`h-8 bg-sand-100 rounded animate-pulse`},`skel-${t}`))}):X.length===0?(0,y.jsx)(`div`,{className:`text-sand-400 text-center py-12 text-sm`,children:`No requests yet.`}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`overflow-x-auto px-3 py-3 sm:px-5`,children:(0,y.jsxs)(`table`,{className:`w-full min-w-[900px] text-[13px]`,children:[(0,y.jsx)(`thead`,{children:(0,y.jsxs)(`tr`,{className:`border-b border-sand-100/60`,children:[k.map(e=>{let t=e.label===`Duration`?`pl-5 pr-3`:e.width?`px-4`:`px-3`,n=e.sortKey===B;return(0,y.jsx)(`th`,{className:`${e.align===`right`?`text-right`:`text-left`} ${e.width??``} ${e.width?`whitespace-nowrap`:``} ${t} py-1.5 text-[10px] uppercase font-medium ${n?`text-sienna-600`:`text-sand-400`}`,children:e.sortKey?(0,y.jsxs)(`button`,{type:`button`,onClick:()=>$({sort:c.parse(`${e.sortKey}-${n&&V===`desc`?`asc`:`desc`}`)}),className:`inline-flex items-center gap-0.5 text-[10px] uppercase font-medium hover:text-sienna-500 transition-colors duration-150 ${e.align===`right`?`justify-end w-full`:``}`,children:[e.label,(0,y.jsx)(`span`,{className:n?``:`text-sand-300`,children:n?V===`desc`?`↓`:`↑`:`↕`})]}):e.label},e.label)}),(0,y.jsx)(`th`,{className:`w-8`})]})}),(0,y.jsx)(`tbody`,{className:`divide-y divide-sand-100/60`,children:X.map(t=>(0,y.jsxs)(`tr`,{className:`transition-colors duration-150 hover:bg-sand-100/60 cursor-pointer`,onClick:e=>{if(e.metaKey||e.ctrlKey){window.open(`/requests/show?id=${t.id}`,`_blank`);return}i({to:`/requests/show`,search:{id:t.id}})},children:[(0,y.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,y.jsx)(e,{to:`/requests/show`,search:{id:t.id},onClick:e=>e.stopPropagation(),className:`text-xs text-sand-500 tabular-nums hover:text-sienna-500`,children:t.id})}),(0,y.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,y.jsx)(`span`,{className:`text-xs text-sand-400 tabular-nums`,children:w(t.created_at)})}),(0,y.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,y.jsx)(`span`,{className:`text-xs text-sand-600`,children:t.project_name??`—`})}),(0,y.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:(0,y.jsx)(`span`,{className:`text-xs text-sand-500`,children:t.token_name})}),(0,y.jsxs)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:[(0,y.jsx)(D,{status:t.status,requestedModel:t.requested_model_name,servedModel:t.model_name,imageCostMethod:t.image_cost_method,fallbackCount:t.fallback_count}),t.service_tier===`fast`&&(0,y.jsx)(`span`,{title:`Fast 모드`,className:`ml-1 inline-flex align-middle`,children:(0,y.jsx)(_,{"aria-label":`Fast 모드`,className:`size-3 text-[#1877F2] [&_path]:fill-current`})}),t.response_json_ok===!1&&(0,y.jsx)(`span`,{title:`structured 요청의 응답이 JSON 파싱에 실패했습니다`,className:`ml-1.5 rounded-full bg-caution-400/15 px-1.5 py-0.5 text-[9px] font-semibold text-caution-500`,children:`broken`})]}),(0,y.jsx)(`td`,{className:`px-4 py-1.5 whitespace-nowrap`,children:t.is_image_generation?(0,y.jsx)(`span`,{className:`rounded bg-sage-100 px-1.5 py-0.5 font-mono text-[10px] text-sage-700`,children:`img`}):t.is_structured?(0,y.jsx)(`span`,{className:`rounded bg-sienna-100 px-1.5 py-0.5 font-mono text-[10px] text-sienna-700`,children:`json`}):(0,y.jsx)(`span`,{className:`font-mono text-[10px] text-sand-400`,children:`text`})}),(0,y.jsx)(`td`,{className:`px-4 py-1.5 text-right tabular-nums text-sand-500 whitespace-nowrap`,children:O(t.ttft_ms)}),(0,y.jsx)(`td`,{className:`pl-5 pr-3 py-1.5 text-right tabular-nums text-sand-500 whitespace-nowrap`,children:E(t.duration_ms)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:T(t.input_tokens)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:T(t.output_tokens)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:T(t.cache_read_tokens)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:T(t.cache_creation_tokens)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700`,children:p(t)}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-500`,children:t.tool_call_count>0?t.tool_call_count:`—`}),(0,y.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums text-sand-700 whitespace-nowrap`,children:f(t)}),(0,y.jsx)(`td`,{className:`px-2 py-1.5`,children:(0,y.jsx)(x,{className:`size-4 text-sand-400`})})]},t.id))})]})}),Q>1&&(0,y.jsxs)(`div`,{className:`flex items-center justify-center gap-3 px-5 py-2.5 border-t border-sand-100/60`,children:[(0,y.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,disabled:a===1,onClick:()=>r({...n,page:a-1}),children:(0,y.jsx)(b,{className:`size-4`})}),(0,y.jsxs)(`span`,{className:`text-[11px] text-sand-400 tabular-nums`,children:[a,` / `,Q]}),(0,y.jsx)(`button`,{type:`button`,className:`p-1 rounded text-sand-400 hover:text-sand-600 disabled:opacity-30 transition-colors`,disabled:a===Q,onClick:()=>r({...n,page:a+1}),children:(0,y.jsx)(x,{className:`size-4`})})]})]})]})}a({token:i().optional(),project:i().optional(),model:i().optional(),sort:c.optional(),page:u.shape.page.default(1)});function j(){let e=l.useSearch(),t=l.useNavigate();return(0,y.jsx)(`div`,{className:`max-w-[100rem] mx-auto`,children:(0,y.jsx)(A,{search:e,onSearchChange:e=>t({search:e})})})}export{j as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{g as t}from"./vendor-tanstack-DRPs09ai.js";import{i as n,n as r,r as i}from"./vendor-react-DH4kUfK2.js";import{T as a,h as o,t as s}from"./services.generated-B5lc3aIC.js";import{t as c}from"./clsx-5XM_pHvN.js";import{a as l}from"./index-C96h3feE.js";import{t as u}from"./cost-DB3HbU7T.js";import{t as d}from"./refresh-cw-D9IUmT23.js";var f=e(n(),1),p=e(r(),1);function m(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function h(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function g(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var _=(e,t)=>Math.abs(e-t)<1.01,v=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},y,b=()=>{if(y!==void 0)return y;if(typeof navigator>`u`)return y=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return y=!0;let e=navigator.maxTouchPoints;return y=navigator.platform===`MacIntel`&&e!==void 0&&e>0},x=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},S=e=>e,C=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},w=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(x(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(x(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},T={passive:!0},E=typeof window>`u`?!0:`onscrollend`in window,D=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&E,o=0,s=a?null:v(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,T),a&&r.addEventListener(`scrollend`,u,T),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},O=(e,t)=>D(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),k=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},A=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},j=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:S,rangeExtractor:C,onChange:()=>{},measureElement:k,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=e>0?s[0]?.key??n.getItemKey(0):null,l=e>0?s[e-1]?.key??n.getItemKey(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==c||t.getItemKey(o-1)!==l)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>e&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==l)&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:i,getItemKey:a}=this.options,c=0;for(;c<i&&a(c)!==e;)c++;if(c<i){let e=n[c];if(e){let n=e.start+t;n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=h(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!b()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,T),e.addEventListener(`touchend`,n,T),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(b()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=h(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.getMeasurements=h(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._flatMeasurements;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e,this._flatMeasurements=a}let o;if(u===0)o=t+n;else{let e=u-1;o=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t),n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=o,a[t*2+1]=i,o+=i+s}let c=m(e,a,r);return this.measurementsCache=c,c}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),h=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&h++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,m,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];m=r?r.end+s:t+n}else if(h===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,m=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,m=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=m+v;d[i]={index:i,start:m,size:v,end:y,key:e,lane:u},f[u]===void 0&&h++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=h(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=P(e,t,n,r,r===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=h(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);if(o!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,s=a?this.getTotalSize():0,c=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(i)||this.scrollDirection!==`backward`):this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,a?this.applyScrollAdjustment(this.getTotalSize()-s):c&&this.applyScrollAdjustment(o),this.notify(!1)}},this.getVirtualItems=h(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return g(t[M(0,t.length-1,r?e=>n[e*2]:e=>g(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t);this.scrollState={index:null,align:t,behavior:n,startedAt:this.now(),lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e;this.scrollState={index:null,align:`start`,behavior:t,startedAt:this.now(),lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){e!==0&&(b()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&_(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},M=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function N(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function P(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=N(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=M(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var F=typeof document<`u`?f.useLayoutEffect:f.useEffect;function I({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n=`transform`,...r}){let i=f.useReducer(e=>e+1,0)[1],a=f.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});a.current.enabled=t,a.current.mode=n;let o=e=>{let t=a.current;if(!t.enabled||!t.container)return;let n=e.getTotalSize();if(n!==t.lastSize){t.lastSize=n;let r=e.options.horizontal?`width`:`height`;t.container.style[r]=`${n}px`}let r=!!e.options.horizontal,i=t.mode===`transform`,o=r?`left`:`top`,s=e.options.scrollMargin,c=e.getVirtualItems();for(let n of c){let a=n.start-s,c=e.elementsCache.get(n.key);c&&t.lastPositions.get(c)!==a&&(t.lastPositions.set(c,a),i?c.style.transform=r?`translate3d(${a}px, 0, 0)`:`translate3d(0, ${a}px, 0)`:c.style[o]=`${a}px`)}},s={...r,onChange:(t,n)=>{var s;let c=a.current,l=!0;if(c.enabled){o(t);let e=t.range,n=c.prevRange;l=!n||n.isScrolling!==t.isScrolling||n.startIndex!==e?.startIndex||n.endIndex!==e?.endIndex,l&&(c.prevRange=e?{startIndex:e.startIndex,endIndex:e.endIndex,isScrolling:t.isScrolling}:null)}l&&(e&&n?(0,p.flushSync)(i):i()),(s=r.onChange)==null||s.call(r,t,n)}},[c]=f.useState(()=>{let e=new j(s);return Object.assign(e,{containerRef:t=>{let n=a.current;if(n.container=t,n.lastSize=null,t&&n.enabled){let r=e.getTotalSize();n.lastSize=r;let i=e.options.horizontal?`width`:`height`;t.style[i]=`${r}px`}}})});return c.setOptions(s),F(()=>c._didMount(),[]),F(()=>c._willUpdate()),F(()=>{o(c)}),c}function L(e){return I({observeElementRect:w,observeElementOffset:O,scrollToFn:A,...e})}var R=i(),z=1e3,B=5e3,V=4e3,H=new Map(Object.entries({trace:0,debug:1,info:2,warning:3,error:4,fatal:5})),U=new Map(Object.entries({trace:`TRC`,debug:`DBG`,info:`INF`,warning:`WRN`,error:`ERR`,fatal:`FTL`})),W=new Intl.DateTimeFormat(`en-GB`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1});function G(e){return W.format(new Date(e))}function K(e){return e.join(`·`)}var q=120;function J(e,t){e.push(t),e.length>q&&e.shift()}var Y=56,X=14;function Z({values:e}){if(e.length<2)return null;let t=Y,n=X,r=Math.max(...e,1),i=t/(q-1),a=t-(e.length-1)*i,o=e.map((e,t)=>{let o=a+t*i,s=n-1-e/r*(n-2);return`${o.toFixed(1)},${s.toFixed(1)}`}).join(` `);return(0,R.jsx)(`svg`,{width:t,height:n,viewBox:`0 0 ${t} ${n}`,className:`shrink-0`,"aria-hidden":`true`,children:(0,R.jsx)(`polyline`,{points:o,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinejoin:`round`,strokeLinecap:`round`,className:`text-sand-300`})})}function Q({usedPercent:e,threshold:t,blocked:n}){if(e===null)return null;let r=Math.max(0,Math.min(e,100)),i=n||t!==null&&e>=t;return(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsxs)(`span`,{className:`relative inline-block h-[4px] w-9 overflow-hidden rounded-full bg-sand-100`,children:[(0,R.jsx)(`span`,{className:c(`absolute inset-y-0 left-0 rounded-full`,i?`bg-caution-500`:`bg-sand-400`),style:{width:`${r}%`}}),t!==null&&(0,R.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-sand-500`,style:{left:`${Math.min(t,100)}%`}})]}),(0,R.jsxs)(`span`,{className:c(`font-mono text-[10px] tabular-nums`,i?`font-semibold text-caution-500`:`text-sand-500`),children:[Math.round(e),`%`]})]})}function $({search:e,onSearchChange:n}){let[r,i]=(0,f.useState)([]),a=(0,f.useRef)(void 0),o=(0,f.useRef)(void 0),l=(0,f.useRef)(0),[p,m]=(0,f.useState)(()=>Date.now()),h=t({queryKey:[`Monit`,`monitLogs`],queryFn:()=>s.monitLogs(a.current),refetchInterval:z,retry:!1}),g=t({...s.monitInfoQueryOptions(),staleTime:1/0}).data,_=h.data?.vitals,v=t({...s.monitStatsQueryOptions(),refetchInterval:3e4,retry:!1}).data,y=(0,f.useRef)([]);(0,f.useEffect)(()=>{_&&J(y.current,_.openaiInFlight)},[_]),(0,f.useEffect)(()=>{let e=h.data;e&&b(e)},[h.data]);function b(e){let t=()=>++l.current;i(n=>{let r=n,i=[];o.current!==void 0&&e.processStartedAt!==o.current?(r=[],i.push({kind:`restart`,key:t(),processStartedAt:e.processStartedAt})):e.dropped>0&&i.push({kind:`dropped`,key:t(),count:e.dropped}),o.current=e.processStartedAt,a.current=e.nextCursor;let s=r.findLast(e=>e.kind===`log`)?.entry.seq;for(let n of e.entries)s!==void 0&&n.seq<=s||i.push({kind:`log`,key:t(),entry:n});if(i.length===0)return n;let c=[...r,...i];return c.length>V?c.slice(-V):c})}(0,f.useEffect)(()=>{let e=window.setInterval(()=>m(Date.now()),2e3);return()=>window.clearInterval(e)},[]);let x=r.length>0&&(h.isRefetchError||h.dataUpdatedAt>0&&p-h.dataUpdatedAt>B),S=(0,f.useMemo)(()=>r.filter(t=>{if(t.kind!==`log`)return!0;switch(e.level){case`warn`:return(H.get(t.entry.level)??2)>=3;case`error`:return(H.get(t.entry.level)??2)>=4;default:return!0}}),[r,e.level]),C=(0,f.useRef)(null),w=L({count:S.length,getScrollElement:()=>C.current,estimateSize:()=>20,getItemKey:e=>S[e].key,anchorTo:`end`,followOnAppend:!0,scrollEndThreshold:80,overscan:12}),T=w.isAtEnd(),E=h.dataUpdatedAt>0,D=!E&&h.isError;return(0,R.jsxs)(`section`,{className:`panel overflow-hidden`,children:[(0,R.jsxs)(`header`,{className:`panel-header flex min-h-11 flex-wrap items-center gap-x-3 gap-y-2 px-4 py-2 sm:px-5`,children:[(0,R.jsx)(`h2`,{className:`text-[13px] font-semibold tracking-[-0.01em] text-sand-800`,children:`Server logs`}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-sand-700`,children:[(0,R.jsx)(`span`,{className:c(`size-1.5 rounded-full`,x||D?`bg-danger-400`:`bg-sienna-500 motion-safe:animate-pulse`)}),D?`Disconnected`:x?`Stale`:E?`Live`:`…`]}),o.current!==void 0&&(0,R.jsxs)(`span`,{className:`text-[11px] text-sand-500`,children:[`ephemeral · resets on restart · since `,G(o.current)]}),(0,R.jsx)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2`,children:(0,R.jsx)(`div`,{className:`segmented-control inline-flex`,role:`tablist`,"aria-label":`Log filter`,children:[{value:`all`,label:`All`},{value:`warn`,label:`Warn+`},{value:`error`,label:`Err+`}].map(t=>(0,R.jsx)(`button`,{type:`button`,"data-active":e.level===t.value,onClick:()=>n({...e,level:t.value}),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium text-sand-500 transition-colors hover:text-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-300 data-[active=true]:text-sand-900`,children:t.label},t.value))})})]}),g&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-1 border-b border-sand-100 bg-sand-50/60 px-4 py-2 text-[11px] text-sand-600 sm:px-5`,children:[(0,R.jsxs)(`span`,{children:[`server `,(0,R.jsx)(`span`,{className:`font-mono text-sand-800`,children:g.serverUrl})]}),(0,R.jsxs)(`span`,{children:[`db`,` `,(0,R.jsxs)(`span`,{className:`font-mono text-sand-800`,children:[g.dbHost,`/`,g.dbName]})]}),(0,R.jsxs)(`span`,{children:[`openai transport`,` `,(0,R.jsx)(`span`,{className:`font-mono text-sand-800`,children:g.openai.transport})]}),_&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[`openai in-flight`,` `,(0,R.jsx)(`span`,{className:`font-mono text-sand-800`,children:_.openaiInFlight}),(0,R.jsx)(Z,{values:y.current})]}),_.anthropicTokenCount>0&&(0,R.jsxs)(`span`,{children:[`anthropic running`,` `,(0,R.jsx)(`span`,{className:`font-mono text-sand-800`,children:_.anthropicInFlight})]})]}),v?.providers.map(e=>(0,R.jsxs)(`span`,{className:`text-sand-500`,children:[`1h `,e.provider,` `,(0,R.jsx)(`span`,{className:`font-mono text-sand-700`,children:e.requests}),` req`,e.errors>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,(0,R.jsx)(`span`,{className:`font-mono font-semibold text-caution-500`,children:e.errors}),` err`]}),` · hit `,(0,R.jsx)(`span`,{className:`font-mono text-sand-700`,children:u({input_tokens:e.inputTokens,cache_read_tokens:e.cacheReadTokens})})]},e.provider))]}),_&&(_.openaiQuotaByToken.length>0||_.anthropicTokenNames.length>0)&&(0,R.jsxs)(`div`,{className:`space-y-1.5 border-b border-sand-100 px-4 py-2.5 sm:px-5`,children:[_.openaiQuotaByToken.length>0&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400`,children:`openai`}),_.openaiQuotaByToken.map(e=>{let t=e.usedPercent===null?`quota not sampled yet`:`quota ${Math.round(e.usedPercent)}%${e.threshold===null?``:` / threshold ${e.threshold}%`}${e.resetsAt?` · resets ${G(e.resetsAt)}`:``}`;return(0,R.jsxs)(`span`,{title:`${e.name} · ${t}`,className:`inline-flex items-center gap-1.5 rounded-md border border-sand-200 bg-white px-2 py-1`,children:[(0,R.jsx)(`span`,{className:`font-mono text-[11px] text-sand-600`,children:e.name.split(`/`).pop()}),(0,R.jsx)(Q,{usedPercent:e.usedPercent,threshold:e.threshold,blocked:e.blocked}),e.blocked&&(0,R.jsx)(`span`,{className:`rounded-full bg-caution-500/10 px-1.5 py-0.5 text-[9px] font-semibold text-caution-500`,children:`quota`})]},e.name)})]}),_.anthropicTokenNames.length>0&&(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`w-[4.5rem] shrink-0 text-[10px] font-medium uppercase tracking-[0.08em] text-sand-400`,children:`anthropic`}),_.anthropicTokenNames.map(e=>(0,R.jsx)(`span`,{title:e,className:`inline-flex items-baseline rounded-md border border-sand-200 bg-white px-2 py-1 font-mono text-[11px] text-sand-600`,children:e.split(`/`).pop()},e))]})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(`div`,{ref:C,role:`log`,"aria-label":`Server process logs`,tabIndex:0,className:`main-scroll h-[calc(100vh-232px)] min-h-[320px] overflow-y-auto bg-sand-900 px-4 py-3 font-mono text-[12px] leading-[1.6] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sienna-400`,children:D?(0,R.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sand-400`,children:[(0,R.jsxs)(`p`,{className:`text-[12px]`,children:[`Could not reach the qgrid server — is it running?`,h.error instanceof Error&&(0,R.jsx)(`span`,{className:`block text-center text-[11px] text-sand-500`,children:h.error.message})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void h.refetch(),className:`inline-flex items-center gap-1.5 rounded-md border border-sand-600 px-2.5 py-1.5 text-[11px] font-medium text-sand-300 transition-colors hover:bg-sand-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400`,children:[(0,R.jsx)(d,{className:`size-3`}),`Retry now`]})]}):E?S.length===0?(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-sand-500`,children:r.length===0?`No log lines yet — waiting for activity since ${o.current===void 0?`startup`:G(o.current)}.`:`No lines match the current filters.`}):(0,R.jsx)(`div`,{className:`relative w-full`,style:{height:`${w.getTotalSize()}px`},children:w.getVirtualItems().map(e=>{let t=S[e.index];return(0,R.jsx)(`div`,{ref:w.measureElement,"data-index":e.index,className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${e.start}px)`},children:(0,R.jsx)(ee,{item:t})},e.key)})}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-sand-500`,children:`Connecting to server logs…`})}),E&&!D&&!T&&(0,R.jsx)(`button`,{type:`button`,onClick:()=>w.scrollToEnd(),className:`absolute bottom-4 right-5 inline-flex items-center gap-1.5 rounded-full border border-sand-600 bg-sand-800/90 px-3 py-1.5 text-[11px] font-medium text-sand-200 shadow-lg backdrop-blur transition-colors hover:bg-sand-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sienna-400`,children:`↓ Jump to live`})]})]})}function ee({item:e}){if(e.kind===`restart`)return(0,R.jsxs)(`div`,{className:`py-1 text-center text-[11px] text-caution-400`,children:[`── process restarted · `,G(e.processStartedAt),` ──`]});if(e.kind===`dropped`)return(0,R.jsxs)(`div`,{className:`py-1 text-center text-[11px] italic text-sand-500`,children:[`── `,e.count,` lines dropped (buffer overflow) ──`]});let{entry:t}=e;return(0,R.jsxs)(`div`,{className:`whitespace-pre-wrap break-words text-sand-200`,children:[(0,R.jsx)(`span`,{className:`text-sand-500`,children:G(t.timestamp)}),` `,(0,R.jsx)(`span`,{className:c(`font-semibold`,t.level===`fatal`||t.level===`error`?`text-danger-400`:t.level===`warning`?`text-caution-400`:`text-sand-400`),children:U.get(t.level)??t.level.slice(0,3).toUpperCase()}),` `,(0,R.jsx)(`span`,{className:`text-sienna-300`,children:K(t.category)}),` `,(0,R.jsx)(`span`,{children:t.text})]})}a({level:o([`all`,`warn`,`error`]).optional().default(`all`).catch(()=>`all`)});function te(){let e=l.useSearch(),t=l.useNavigate();return(0,R.jsx)(`div`,{className:`max-w-[100rem] mx-auto`,children:(0,R.jsx)($,{search:e,onSearchChange:e=>t({search:e,replace:!0})})})}export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Dw2cE7zH.js";import{i as e,r as t}from"./vendor-react-DH4kUfK2.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,n.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14m-7-7v14`})});export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Dw2cE7zH.js";import{i as e,r as t}from"./vendor-react-DH4kUfK2.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,n.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,n.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9a9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,n.jsx)(`path`,{d:`M21 3v5h-5m5 4a9 9 0 0 1-9 9a9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,n.jsx)(`path`,{d:`M8 16H3v5`})]})});export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-Dw2cE7zH.js";import{i as e,r as t}from"./vendor-react-DH4kUfK2.js";e();var n=t(),r=e=>(0,n.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,n.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`})});function i({status:e,requestedModel:t,servedModel:n,imageCostMethod:r}){if(e===`running`)return{label:`실행 중`};let i=/^(?:assumed|estimated):(gpt-image-[^:]+):/.exec(r??``)?.[1],a=n?.startsWith(`openai/gpt-image-`)?n:i?`openai/${i}`:null;if(a){let e=t??n;return{label:e&&e!==a?`${e} → ${a}`:a}}return{label:t&&n&&t!==n?`${t} → ${n}`:n??t??`—`}}export{r as n,i as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{v as t}from"./vendor-tanstack-DRPs09ai.js";import{i as n,n as r,r as i}from"./vendor-react-DH4kUfK2.js";import{n as a,o}from"./services.generated-B5lc3aIC.js";import{i as s,n as c,r as l,t as u}from"./use-oauth-login-flow-BfxYI4Oh.js";import{i as d}from"./cost-DB3HbU7T.js";import{t as f}from"./use-update-token-mutation-qKBC2sn7.js";import{n as p,t as m}from"./total-cost-MnfKU8IN.js";var h=e(r()),g=e(n());function _(){var e=[...arguments];return(0,g.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var v=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function y(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function b(e){return`nodeType`in e}function x(e){return e?y(e)?e:b(e)?e.ownerDocument?.defaultView??window:window:window}function S(e){let{Document:t}=x(e);return e instanceof t}function C(e){return y(e)?!1:e instanceof x(e).HTMLElement}function w(e){return e instanceof x(e).SVGElement}function T(e){return e?y(e)?e.document:b(e)?S(e)?e:C(e)||w(e)?e.ownerDocument:document:document:document}var E=v?g.useLayoutEffect:g.useEffect;function ee(e){let t=(0,g.useRef)(e);return E(()=>{t.current=e}),(0,g.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function te(){let e=(0,g.useRef)(null);return[(0,g.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,g.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function D(e,t){let n=(0,g.useRef)();return(0,g.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function O(e){let t=ee(e),n=(0,g.useRef)(null);return[n,(0,g.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}var k={};function A(e,t){return(0,g.useMemo)(()=>{if(t)return t;let n=k[e]==null?0:k[e]+1;return k[e]=n,e+`-`+n},[e,t])}function j(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var M=j(1),N=j(-1);function P(e){return`clientX`in e&&`clientY`in e}function ne(e){if(!e)return!1;let{KeyboardEvent:t}=x(e.target);return t&&e instanceof t}function F(e){if(!e)return!1;let{TouchEvent:t}=x(e.target);return t&&e instanceof t}function I(e){if(F(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return P(e)?{x:e.clientX,y:e.clientY}:null}var L=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[L.Translate.toString(e),L.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),re={display:`none`};function R(e){let{id:t,value:n}=e;return g.createElement(`div`,{id:t,style:re},n)}function z(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return g.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function B(){let[e,t]=(0,g.useState)(``);return{announce:(0,g.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ie={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},ae={onDragStart(e){return`Picked up draggable item ${e}.`},onDragOver(e,t){return t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`},onDragEnd(e,t){return t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`},onDragCancel(e){return`Dragging was cancelled. Draggable item ${e} was dropped.`}},V;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(V||={});function H(...e){}var U=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:e})=>!e)}getNodeFor(e){return this.get(e)?.node.current??void 0}},oe=(0,g.createContext)({activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,activeNodeClientRect:null,activators:[],ariaDescribedById:{draggable:``},containerNodeRect:null,dispatch:H,draggableNodes:{},droppableRects:new Map,droppableContainers:new U,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:H},scrollableAncestors:[],scrollableAncestorRects:[],recomputeLayouts:H,windowRect:null,willRecomputeLayouts:!1});function se(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new U}}}function ce(e,t){switch(t.type){case V.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case V.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case V.DragEnd:case V.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new U(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case V.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new U(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case V.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new U(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}var le=(0,g.createContext)({type:null,event:null});function ue({onDragStart:e,onDragMove:t,onDragOver:n,onDragEnd:r,onDragCancel:i}){let a=(0,g.useContext)(le),o=(0,g.useRef)(a);(0,g.useEffect)(()=>{if(a!==o.current){let{type:s,event:c}=a;switch(s){case V.DragStart:e?.(c);break;case V.DragMove:t?.(c);break;case V.DragOver:n?.(c);break;case V.DragCancel:i?.(c);break;case V.DragEnd:r?.(c);break}o.current=a}},[a,e,t,n,r,i])}function de({announcements:e=ae,hiddenTextDescribedById:t,screenReaderInstructions:n}){let{announce:r,announcement:i}=B(),a=A(`DndLiveRegion`),[o,s]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{s(!0)},[]),ue((0,g.useMemo)(()=>({onDragStart({active:t}){r(e.onDragStart(t.id))},onDragMove({active:t,over:n}){e.onDragMove&&r(e.onDragMove(t.id,n?.id))},onDragOver({active:t,over:n}){r(e.onDragOver(t.id,n?.id))},onDragEnd({active:t,over:n}){r(e.onDragEnd(t.id,n?.id))},onDragCancel({active:t}){r(e.onDragCancel(t.id))}}),[r,e])),o?(0,h.createPortal)(g.createElement(g.Fragment,null,g.createElement(R,{id:t,value:n.draggable}),g.createElement(z,{id:a,announcement:i})),document.body):null}var W=Object.freeze({x:0,y:0});function fe(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function G(e,t=e.offsetLeft,n=e.offsetTop){return{x:t+e.width*.5,y:n+e.height*.5}}var pe=({collisionRect:e,droppableContainers:t})=>{let n=G(e,e.left,e.top),r=1/0,i=null;for(let e of t){let{rect:{current:t}}=e;if(t){let a=fe(G(t),n);a<r&&(r=a,i=e.id)}}return i};function me(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function he(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:W}function ge(e){return function(t,...n){return n.reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x,offsetLeft:t.offsetLeft+e*n.x,offsetTop:t.offsetTop+e*n.y}),{...t})}}var _e=ge(1);function K(e,t=window.getComputedStyle(e)){return t.position===`fixed`}function ve(e,t=window.getComputedStyle(e)){let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].find(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})!=null}function ye(e){let t=[];function n(e){if(!e)return t;if(S(e)&&e.scrollingElement!=null&&!t.includes(e.scrollingElement))return t.push(e.scrollingElement),t;if(!C(e)||w(e)||t.includes(e))return t;let r=window.getComputedStyle(e);return ve(e,r)&&t.push(e),K(e,r)?t:n(e.parentNode)}return e?n(e.parentNode):t}function be(e){return!v||!e?null:y(e)?e:b(e)?S(e)||e===T(e).scrollingElement?window:C(e)?e:null:null}function xe(e){return y(e)?{x:e.scrollX,y:e.scrollY}:{x:e.scrollLeft,y:e.scrollTop}}var q;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(q||={});function J(e){let t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}function Se(e){return!v||!e?!1:e===document.scrollingElement}var Ce={x:.2,y:.2};function Y(e,t,{top:n,left:r,right:i,bottom:a},o=10,s=Ce){let{clientHeight:c,clientWidth:l}=e,u=Se(e)?{top:0,left:0,right:l,bottom:c,width:l,height:c}:t,{isTop:d,isBottom:f,isLeft:p,isRight:m}=J(e),h={x:0,y:0},g={x:0,y:0},_={height:u.height*s.y,width:u.width*s.x};return!d&&n<=u.top+_.height?(h.y=q.Backward,g.y=o*Math.abs((u.top+_.height-n)/_.height)):!f&&a>=u.bottom-_.height&&(h.y=q.Forward,g.y=o*Math.abs((u.bottom-_.height-a)/_.height)),!m&&i>=u.right-_.width?(h.x=q.Forward,g.x=o*Math.abs((u.right-_.width-i)/_.width)):!p&&r<=u.left+_.width&&(h.x=q.Backward,g.x=o*Math.abs((u.left+_.width-r)/_.width)),{direction:h,speed:g}}function we(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Te(e){return e.reduce((e,t)=>M(e,xe(t)),W)}function Ee(e,t,n=W){if(!e||!C(e))return n;let r={x:n.x+e.offsetLeft,y:n.y+e.offsetTop};return e.offsetParent===t?r:Ee(e.offsetParent,t,r)}function X(e){let{offsetWidth:t,offsetHeight:n}=e,{x:r,y:i}=Ee(e,null);return{width:t,height:n,offsetTop:i,offsetLeft:r}}function De(e){if(y(e)){let e=window.innerWidth,t=window.innerHeight;return{top:0,left:0,right:e,bottom:t,width:e,height:t,offsetTop:0,offsetLeft:0}}let{offsetTop:t,offsetLeft:n}=X(e),{width:r,height:i,top:a,bottom:o,left:s,right:c}=e.getBoundingClientRect();return{width:r,height:i,top:a,bottom:o,right:c,left:s,offsetTop:t,offsetLeft:n}}function Oe(e){let{width:t,height:n,offsetTop:r,offsetLeft:i}=X(e),a=Te(ye(e)),o=r-a.y,s=i-a.x;return{width:t,height:n,top:o,bottom:o+n,right:s+t,left:s,offsetTop:r,offsetLeft:i}}function ke(e,t){let n=Math.max(t.top,e.offsetTop),r=Math.max(t.left,e.offsetLeft),i=Math.min(t.left+t.width,e.offsetLeft+e.width),a=Math.min(t.top+t.height,e.offsetTop+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var Ae=({collisionRect:e,droppableContainers:t})=>{let n=0,r=null;for(let i of t){let{rect:{current:t}}=i;if(t){let a=ke(t,e);a>n&&(n=a,r=i.id)}}return r},je;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(je||={});var Me;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(Me||={});function Ne({acceleration:e,activator:t=je.Pointer,canScroll:n,draggingRect:r,enabled:i,interval:a=5,order:o=Me.TreeOrder,pointerCoordinates:s,scrollableAncestors:c,scrollableAncestorRects:l,threshold:u}){let[d,f]=te(),p=(0,g.useRef)({x:1,y:1}),m=(0,g.useMemo)(()=>{switch(t){case je.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case je.DraggableRect:return r}return null},[t,r,s]),h=(0,g.useRef)(W),_=(0,g.useRef)(null),v=(0,g.useCallback)(()=>{let e=_.current;if(!e)return;let t=p.current.x*h.current.x,n=p.current.y*h.current.y;e.scrollBy(t,n)},[]),y=(0,g.useMemo)(()=>o===Me.TreeOrder?[...c].reverse():c,[o,c]);(0,g.useEffect)(()=>{if(!i||!c.length||!m){f();return}for(let t of y){if(n?.(t)===!1)continue;let r=l[c.indexOf(t)];if(!r)continue;let{direction:i,speed:o}=Y(t,r,m,e,u);if(o.x>0||o.y>0){f(),_.current=t,d(v,a),p.current=o,h.current=i;return}}p.current={x:0,y:0},h.current={x:0,y:0},f()},[e,v,n,f,i,a,JSON.stringify(m),d,c,y,l,JSON.stringify(u)])}function Pe(e,t){let n=t===null?void 0:e[t],r=n?n.node.current:null;return D(e=>t===null?null:r??e??null,[r,t])}function Fe(e,t){return(0,g.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}function Ie(e){let t=(0,g.useRef)(e);return E(()=>{t.current!==e&&(t.current=e)},[e]),t}var Le;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(Le||={});var Re;(function(e){e.Optimized=`optimized`})(Re||={});var ze=new Map,Be={measure:X,strategy:Le.WhileDragging,frequency:Re.Optimized};function Ve(e,{dragging:t,dependencies:n,config:r}){let[i,a]=(0,g.useState)(!1),{frequency:o,measure:s,strategy:c}={...Be,...r},l=(0,g.useRef)(e),u=(0,g.useCallback)(()=>a(!0),[]),d=(0,g.useRef)(null),f=m(),p=D(n=>{if(f&&!t)return ze;if(!n||n===ze||l.current!==e||i){for(let t of e)t&&(t.rect.current=t.node.current?s(t.node.current):null);return He(e)}return n},[e,t,f,s,i]);return(0,g.useEffect)(()=>{l.current=e},[e]),(0,g.useEffect)(()=>{i&&a(!1)},[i]),(0,g.useEffect)(function(){f||requestAnimationFrame(u)},[t,f]),(0,g.useEffect)(function(){f||typeof o!=`number`||d.current!==null||(d.current=setTimeout(()=>{u(),d.current=null},o))},[o,f,u,...n]),{layoutRectMap:p,recomputeLayouts:u,willRecomputeLayouts:i};function m(){switch(c){case Le.Always:return!1;case Le.BeforeDragging:return t;default:return!t}}}function He(e){let t=new Map;if(e)for(let n of e){if(!n)continue;let{id:e,rect:r}=n;r.current!=null&&t.set(e,r.current)}return t}function Ue(e){let[t,n]=(0,g.useState)(null),r=(0,g.useRef)(e),i=(0,g.useCallback)(e=>{let t=be(e.target);t&&n(e=>e?(e.set(t,xe(t)),new Map(e)):null)},[]);return(0,g.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=be(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,xe(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{be(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,g.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>M(e,t),W):Te(e):W,[e,t])}var We=[];function Ge(e){let t=(0,g.useRef)(e),n=D(n=>e?n&&e&&t.current&&e.parentNode===t.current.parentNode?n:ye(e):We,[e]);return(0,g.useEffect)(()=>{t.current=e},[e]),n}function Ke(e){(0,g.useEffect)(()=>{if(!v)return;let t=e.map(({sensor:e})=>e.setup==null?void 0:e.setup());return()=>{for(let e of t)e?.()}},e.map(({sensor:e})=>e))}function qe(e,t){return(0,g.useMemo)(()=>e.reduce((e,{eventName:n,handler:r})=>(e[n]=e=>{r(e,t)},e),{}),[e,t])}var Je=Ze(De),Ye=Qe(De);function Xe(e,t,n){let r=(0,g.useRef)(e);return D(i=>e?n||!i&&e||e!==r.current?C(e)&&e.parentNode==null?null:t(e):i??null:null,[e,n,t])}function Ze(e){return(t,n)=>Xe(t,e,n)}function Qe(e){let t=[];return function(n,r){let i=(0,g.useRef)(n);return D(a=>n.length?r||!a&&n.length||n!==i.current?n.map(t=>e(t)):a??t:t,[n,r])}}function $e(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return C(t)?t:e}function et(e){let{width:t,height:n,offsetLeft:r,offsetTop:i}=X(e);return{top:i,bottom:i+n,left:r,right:r+t,width:t,height:n,offsetTop:i,offsetLeft:r}}var tt=Ze(et);function nt({disabled:e,forceRecompute:t}){let[n,r]=O(),i=tt(e?null:$e(n.current),t);return(0,g.useMemo)(()=>({nodeRef:n,rect:i,setRef:r}),[i,n,r])}function rt(e,t){return(0,g.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function it(...e){return(0,g.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var at=class{constructor(e){this.target=e,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))}}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function ot(e){let{EventTarget:t}=x(e);return e instanceof t?e:T(e)}function st(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var Z;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Z||={});function ct(e){e.preventDefault()}function lt(e){e.stopPropagation()}var Q;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`})(Q||={});var ut={start:[Q.Space,Q.Enter],cancel:[Q.Esc],end:[Q.Space,Q.Enter]},dt=(e,{currentCoordinates:t})=>{switch(e.code){case Q.Right:return{...t,x:t.x+25};case Q.Left:return{...t,x:t.x-25};case Q.Down:return{...t,y:t.y+25};case Q.Up:return{...t,y:t.y-25}}},ft=class{constructor(e){this.props=e,this.autoScrollEnabled=!1,this.coordinates=W;let{event:{target:t}}=e;this.props=e,this.listeners=new at(T(t)),this.windowListeners=new at(x(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Z.Resize,this.handleCancel),this.windowListeners.add(Z.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Z.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props;if(!e.node.current)throw Error(`Active draggable node is undefined`);let n=De(e.node.current),r={x:n.left,y:n.top};this.coordinates=r,t(r)}handleKeyDown(e){if(ne(e)){let{coordinates:t}=this,{active:n,context:r,options:i}=this.props,{keyboardCodes:a=ut,coordinateGetter:o=dt,scrollBehavior:s=`smooth`}=i,{code:c}=e;if(a.end.includes(c)){this.handleEnd(e);return}if(a.cancel.includes(c)){this.handleCancel(e);return}let l=o(e,{active:n,context:r.current,currentCoordinates:t});if(l){let n={x:0,y:0},{scrollableAncestors:i}=r.current;for(let r of i){let i=e.code,a=N(l,t),{isTop:o,isRight:c,isLeft:u,isBottom:d,maxScroll:f,minScroll:p}=J(r),m=we(r),h={x:Math.min(i===Q.Right?m.right-m.width/2:m.right,Math.max(i===Q.Right?m.left:m.left+m.width/2,l.x)),y:Math.min(i===Q.Down?m.bottom-m.height/2:m.bottom,Math.max(i===Q.Down?m.top:m.top+m.height/2,l.y))},g=i===Q.Right&&!c||i===Q.Left&&!u,_=i===Q.Down&&!d||i===Q.Up&&!o;if(g&&h.x!==l.x){if(i===Q.Right&&r.scrollLeft+a.x<=f.x||i===Q.Left&&r.scrollLeft+a.x>=p.x){r.scrollBy({left:a.x,behavior:s});return}n.x=i===Q.Right?r.scrollLeft-f.x:r.scrollLeft-p.x,r.scrollBy({left:-n.x,behavior:s});break}else if(_&&h.y!==l.y){if(i===Q.Down&&r.scrollTop+a.y<=f.y||i===Q.Up&&r.scrollTop+a.y>=p.y){r.scrollBy({top:a.y,behavior:s});return}n.y=i===Q.Down?r.scrollTop-f.y:r.scrollTop-p.y,r.scrollBy({top:-n.y,behavior:s});break}}this.handleMove(e,M(l,n))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t),this.coordinates=t}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};ft.activators=[{eventName:`onKeyDown`,handler:(e,{keyboardCodes:t=ut,onActivation:n})=>{let{code:r}=e.nativeEvent;return t.start.includes(r)?(e.preventDefault(),n?.({event:e.nativeEvent}),!0):!1}}];function pt(e){return!!(e&&`distance`in e)}function mt(e){return!!(e&&`delay`in e)}var ht=class{constructor(e,t,n=ot(e.event.target)){this.props=e,this.events=t,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=T(i),this.documentListeners=new at(this.document),this.listeners=new at(n),this.windowListeners=new at(x(i)),this.initialCoordinates=I(r),this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),this.windowListeners.add(Z.Resize,this.handleCancel),this.windowListeners.add(Z.DragStart,ct),this.windowListeners.add(Z.VisibilityChange,this.handleCancel),this.windowListeners.add(Z.ContextMenu,ct),this.documentListeners.add(Z.Keydown,this.handleKeydown),t){if(pt(t))return;if(mt(t)){this.timeoutId=setTimeout(this.handleStart,t.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Z.Click,lt,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Z.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=I(e),s=N(n,o);if(!t&&a){if(mt(a))return st(s,a.tolerance)?this.handleCancel():void 0;if(pt(a))return a.tolerance!=null&&st(s,a.tolerance)?this.handleCancel():st(s,a.distance)?this.handleStart():void 0}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onEnd:e}=this.props;this.detach(),e()}handleCancel(){let{onCancel:e}=this.props;this.detach(),e()}handleKeydown(e){e.code===Q.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},gt={move:{name:`pointermove`},end:{name:`pointerup`}},_t=class extends ht{constructor(e){let{event:t}=e,n=T(t.target);super(e,gt,n)}};_t.activators=[{eventName:`onPointerDown`,handler:({nativeEvent:e},{onActivation:t})=>!e.isPrimary||e.button!==0?!1:(t?.({event:e}),!0)}];var vt={move:{name:`mousemove`},end:{name:`mouseup`}},yt;(function(e){e[e.RightClick=2]=`RightClick`})(yt||={});var bt=class extends ht{constructor(e){super(e,vt,T(e.event.target))}};bt.activators=[{eventName:`onMouseDown`,handler:({nativeEvent:e},{onActivation:t})=>e.button===yt.RightClick?!1:(t?.({event:e}),!0)}];var xt={move:{name:`touchmove`},end:{name:`touchend`}},St=class extends ht{constructor(e){super(e,xt)}static setup(){return window.addEventListener(xt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(xt.move.name,e)};function e(){}}};St.activators=[{eventName:`onTouchStart`,handler:({nativeEvent:e},{onActivation:t})=>{let{touches:n}=e;return n.length>1?!1:(t?.({event:e}),!0)}}];function Ct(e,{transform:t,...n}){return e?.length?e.reduce((e,t)=>t({transform:e,...n}),t):t}var wt=[{sensor:_t,options:{}},{sensor:ft,options:{}}],Tt={current:{}},Et=(0,g.createContext)({...W,scaleX:1,scaleY:1}),Dt=(0,g.memo)(function({id:e,autoScroll:t=!0,announcements:n,children:r,sensors:i=wt,collisionDetection:a=Ae,measuring:o,modifiers:s,screenReaderInstructions:c=ie,...l}){let[u,d]=(0,g.useReducer)(ce,void 0,se),[f,p]=(0,g.useState)(()=>({type:null,event:null})),[m,_]=(0,g.useState)(!1),{draggable:{active:v,nodes:y,translate:b},droppable:{containers:x}}=u,S=v?y[v]:null,C=(0,g.useRef)({initial:null,translated:null}),w=(0,g.useMemo)(()=>v==null?null:{id:v,data:S?.data??Tt,rect:C},[v,S]),T=(0,g.useRef)(null),[ee,te]=(0,g.useState)(null),[D,O]=(0,g.useState)(null),k=(0,g.useRef)(l),j=A(`DndDescribedBy`,e),N=(0,g.useMemo)(()=>x.getEnabled(),[x]),{layoutRectMap:P,recomputeLayouts:ne,willRecomputeLayouts:F}=Ve(N,{dragging:m,dependencies:[b.x,b.y],config:o?.droppable}),L=Pe(y,v),re=D?I(D):null,R=Xe(L,o?.draggable?.measure??Oe),z=Je(L),B=(0,g.useRef)(null),ae=B.current,H=(0,g.useRef)({active:null,activeNode:L,collisionRect:null,droppableRects:P,draggableNodes:y,draggingNodeRect:null,droppableContainers:x,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),U=x.getNodeFor(H.current.over?.id),ue=Je(L?L.ownerDocument.defaultView:null),fe=Je(L?L.parentElement:null),G=Ge(v?U??L:null),pe=Ye(G),ge=nt({disabled:v==null,forceRecompute:F}),K=ge.rect??R,ve=K===R?he(R,ae):W,ye=Ct(s,{transform:{x:b.x-ve.x,y:b.y-ve.y,scaleX:1,scaleY:1},activatorEvent:D,active:w,activeNodeRect:z,containerNodeRect:fe,draggingNodeRect:K,over:H.current.over,overlayNodeRect:ge.rect,scrollableAncestors:G,scrollableAncestorRects:pe,windowRect:ue}),be=re?M(re,b):null,xe=Ue(G),q=M(ye,xe),J=K?_e(K,ye):null,Se=J?_e(J,xe):null,Ce=w&&Se?a({active:w,collisionRect:Se,droppableContainers:N}):null,[Y,we]=(0,g.useState)(null),Te=me(ye,Y?.rect??null,R),Ee=(0,g.useCallback)((e,{sensor:t,options:n})=>{if(!T.current)return;let r=y[T.current];if(!r)return;let i=new t({active:T.current,activeNode:r,event:e.nativeEvent,options:n,context:H,onStart(e){let t=T.current;if(!t)return;let n=y[t];if(!n)return;let{onDragStart:r}=k.current,i={active:{id:t,data:n.data,rect:C}};(0,h.unstable_batchedUpdates)(()=>{d({type:V.DragStart,initialCoordinates:e,active:t}),p({type:V.DragStart,event:i})}),r?.(i)},onMove(e){d({type:V.DragMove,coordinates:e})},onEnd:a(V.DragEnd),onCancel:a(V.DragCancel)});(0,h.unstable_batchedUpdates)(()=>{te(i),O(e.nativeEvent)});function a(e){return async function(){let{active:t,over:n,scrollAdjustedTranslate:r}=H.current,i=null;if(t&&r){let{cancelDrop:a}=k.current;i={active:t,delta:r,over:n},e===V.DragEnd&&typeof a==`function`&&await Promise.resolve(a(i))&&(e=V.DragCancel)}if(T.current=null,(0,h.unstable_batchedUpdates)(()=>{d({type:e}),we(null),_(!1),te(null),O(null),i&&p({type:e,event:i})}),i){let{onDragCancel:t,onDragEnd:n}=k.current;(e===V.DragEnd?n:t)?.(i)}}}},[d,y]),X=Fe(i,(0,g.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent;T.current!==null||i.dndKit||i.defaultPrevented||e(n,t.options)===!0&&(i.dndKit={capturedBy:t.sensor},T.current=r,Ee(n,t))},[Ee]));Ke(i),E(()=>{k.current=l},Object.values(l)),(0,g.useEffect)(()=>{v!=null&&_(!0)},[v]),(0,g.useEffect)(()=>{w||(B.current=null),w&&R&&!B.current&&(B.current=R)},[R,w]),(0,g.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,over:n}=H.current;if(!t)return;let r={active:t,delta:{x:q.x,y:q.y},over:n};p({type:V.DragMove,event:r}),e?.(r)},[q.x,q.y]),(0,g.useEffect)(()=>{let{active:e,droppableContainers:t,scrollAdjustedTranslate:n}=H.current;if(!e||!T.current||!n)return;let{onDragOver:r}=k.current,i=t.get(Ce),a=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,o={active:e,delta:{x:n.x,y:n.y},over:a};(0,h.unstable_batchedUpdates)(()=>{we(a),p({type:V.DragOver,event:o}),r?.(o)})},[Ce]),E(()=>{H.current={active:w,activeNode:L,collisionRect:Se,droppableRects:P,draggableNodes:y,draggingNodeRect:K,droppableContainers:x,over:Y,scrollableAncestors:G,scrollAdjustedTranslate:q,translatedRect:J},C.current={initial:K,translated:J}},[w,L,Se,y,K,P,x,Y,G,q,J]),Ne({...ke(),draggingRect:J,pointerCoordinates:be,scrollableAncestors:G,scrollableAncestorRects:pe});let De=(0,g.useMemo)(()=>({active:w,activeNode:L,activeNodeRect:R,activeNodeClientRect:z,activatorEvent:D,activators:X,ariaDescribedById:{draggable:j},containerNodeRect:fe,dispatch:d,dragOverlay:ge,draggableNodes:y,droppableContainers:x,droppableRects:P,over:Y,recomputeLayouts:ne,scrollableAncestors:G,scrollableAncestorRects:pe,willRecomputeLayouts:F,windowRect:ue}),[w,L,z,R,D,X,fe,ge,d,y,j,x,P,Y,ne,G,pe,F,ue]);return g.createElement(le.Provider,{value:f},g.createElement(oe.Provider,{value:De},g.createElement(Et.Provider,{value:Te},r)),g.createElement(de,{announcements:n,hiddenTextDescribedById:j,screenReaderInstructions:c}));function ke(){let e=ee?.autoScrollEnabled===!1,n=typeof t==`object`?t.enabled===!1:t===!1,r=!e&&!n;return typeof t==`object`?{...t,enabled:r}:{enabled:r}}}),Ot=(0,g.createContext)(null),kt=`button`,At=`Droppable`;function jt({id:e,data:t,disabled:n=!1,attributes:r}){let i=A(At),{active:a,activeNodeRect:o,activatorEvent:s,ariaDescribedById:c,draggableNodes:l,droppableRects:u,activators:d,over:f}=(0,g.useContext)(oe),{role:p=kt,roleDescription:m=`draggable`,tabIndex:h=0}=r??{},_=a?.id===e,v=(0,g.useContext)(_?Et:Ot),[y,b]=O(),x=qe(d,e),S=Ie(t);return(0,g.useEffect)(()=>(l[e]={id:e,key:i,node:y,data:S},()=>{let t=l[e];t&&t.key===i&&delete l[e]}),[l,e]),{active:a,activeNodeRect:o,activatorEvent:s,attributes:(0,g.useMemo)(()=>({role:p,tabIndex:h,"aria-pressed":_&&p===kt?!0:void 0,"aria-roledescription":m,"aria-describedby":c.draggable}),[p,h,_,m,c.draggable]),droppableRects:u,isDragging:_,listeners:n?void 0:x,node:y,over:f,setNodeRef:b,transform:v}}function Mt(){return(0,g.useContext)(oe)}var Nt=`Droppable`;function Pt({data:e,disabled:t=!1,id:n}){let r=A(Nt),{active:i,dispatch:a,over:o}=(0,g.useContext)(oe),s=(0,g.useRef)(null),[c,l]=O(),u=Ie(e);return E(()=>(a({type:V.RegisterDroppable,element:{id:n,key:r,disabled:t,node:c,rect:s,data:u}}),()=>a({type:V.UnregisterDroppable,key:r,id:n})),[n]),(0,g.useEffect)(()=>{a({type:V.SetDroppableDisabled,id:n,key:r,disabled:t})},[t]),{active:i,rect:s,isOver:o?.id===n,node:c,over:o,setNodeRef:l}}function Ft(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function It(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function Lt(e){return e!==null&&e>=0}var Rt=({layoutRects:e,activeIndex:t,overIndex:n,index:r})=>{let i=Ft(e,n,t),a=e[r],o=i[r];return!o||!a?null:{x:o.offsetLeft-a.offsetLeft,y:o.offsetTop-a.offsetTop,scaleX:o.width/a.width,scaleY:o.height/a.height}},zt=`Sortable`,Bt=g.createContext({activeIndex:-1,containerId:zt,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Rt,wasDragging:{current:!1}});function Vt({children:e,id:t,items:n,strategy:r=Rt}){let{active:i,dragOverlay:a,droppableRects:o,over:s,recomputeLayouts:c,willRecomputeLayouts:l}=Mt(),u=A(zt,t),d=a.rect!==null,f=(0,g.useMemo)(()=>n.map(e=>typeof e==`string`?e:e.id),[n]),p=i!=null,m=(0,g.useRef)(!1),h=i?f.indexOf(i.id):-1,_=h!==-1,v=s?f.indexOf(s.id):-1,y=(0,g.useRef)(f),b=It(f,o),x=!Ht(f,y.current),S=v!==-1&&h===-1||x;E(()=>{x&&_&&!l&&c()},[x,_,c,l]),(0,g.useEffect)(()=>{y.current=f},[f]),(0,g.useEffect)(()=>{let e=setTimeout(()=>{m.current=p},100);return()=>clearTimeout(e)},[p]);let C=(0,g.useMemo)(()=>({activeIndex:h,containerId:u,disableTransforms:S,items:f,overIndex:v,useDragOverlay:d,sortedRects:b,strategy:r,wasDragging:m}),[h,u,S,f,v,b,d,r,m]);return g.createElement(Bt.Provider,{value:C},e)}function Ht(e,t){return e.join()===t.join()}var Ut=({id:e,items:t,activeIndex:n,overIndex:r})=>Ft(t,n,r).indexOf(e),Wt=({containerId:e,isSorting:t,wasDragging:n,index:r,items:i,newIndex:a,previousItems:o,previousContainerId:s,transition:c})=>!c||!n||o!==i&&r===a?!1:t?!0:a!==r&&e===s,Gt={duration:200,easing:`ease`},Kt=`transform`,qt=L.Transition.toString({property:Kt,duration:0,easing:`linear`}),Jt={roleDescription:`sortable`};function Yt({disabled:e,index:t,node:n,rect:r}){let[i,a]=(0,g.useState)(null),o=(0,g.useRef)(t);return E(()=>{if(!e&&t!==o.current&&n.current){let e=r.current;if(e){let t=De(n.current),r={x:e.offsetLeft-t.offsetLeft,y:e.offsetTop-t.offsetTop,scaleX:e.width/t.width,scaleY:e.height/t.height};(r.x||r.y)&&a(r)}}t!==o.current&&(o.current=t)},[e,t,n,r]),(0,g.useEffect)(()=>{i&&requestAnimationFrame(()=>{a(null)})},[i]),i}function Xt({animateLayoutChanges:e=Wt,attributes:t,disabled:n,data:r,getNewIndex:i=Ut,id:a,strategy:o,transition:s=Gt}){let{items:c,containerId:l,activeIndex:u,disableTransforms:d,sortedRects:f,overIndex:p,useDragOverlay:m,strategy:h,wasDragging:v}=(0,g.useContext)(Bt),y=c.indexOf(a),b=(0,g.useMemo)(()=>({sortable:{containerId:l,index:y,items:c},...r}),[l,r,y,c]),{rect:x,node:S,setNodeRef:C}=Pt({id:a,data:b}),{active:w,activeNodeRect:T,activatorEvent:E,attributes:ee,setNodeRef:te,listeners:D,isDragging:O,over:k,transform:A}=jt({id:a,data:b,attributes:{...Jt,...t},disabled:n}),j=_(C,te),M=!!w,N=M&&v.current&&!d&&Lt(u)&&Lt(p),P=!m&&O,ne=N?(P&&N?A:null)??(o??h)({layoutRects:f,activeNodeRect:T,activeIndex:u,overIndex:p,index:y}):null,F=Lt(u)&&Lt(p)?i({id:a,items:c,activeIndex:u,overIndex:p}):y,I=(0,g.useRef)(c),re=c!==I.current,R=(0,g.useRef)(F),z=(0,g.useRef)(l),B=e({active:w,containerId:l,isDragging:O,isSorting:M,id:a,index:y,items:c,newIndex:R.current,previousItems:I.current,previousContainerId:z.current,transition:s,wasDragging:v.current}),ie=Yt({disabled:!B,index:y,node:S,rect:x});return(0,g.useEffect)(()=>{M&&R.current!==F&&(R.current=F),l!==z.current&&(z.current=l),c!==I.current&&(I.current=c)},[M,F,l,c]),{active:w,attributes:ee,activatorEvent:E,rect:x,index:y,isSorting:M,isDragging:O,listeners:D,node:S,overIndex:p,over:k,setNodeRef:j,setDroppableNodeRef:C,setDraggableNodeRef:te,transform:ie??ne,transition:ae()};function ae(){if(ie||re&&R.current===y)return qt;if(!(P||!s)&&(M||B))return L.Transition.toString({...s,property:Kt})}}Q.Down,Q.Right,Q.Up,Q.Left;var $=i(),Zt=e=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,$.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`m12 14l4-4M3.34 19a10 10 0 1 1 17.32 0`})}),Qt=e=>(0,$.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,$.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,$.jsx)(`circle`,{cx:9,cy:12,r:1}),(0,$.jsx)(`circle`,{cx:9,cy:5,r:1}),(0,$.jsx)(`circle`,{cx:9,cy:19,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:12,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:5,r:1}),(0,$.jsx)(`circle`,{cx:15,cy:19,r:1})]})}),$t=new Set([`anthropic`,`openai`,`grok`]);function en(e){let t=e.trim();if(t===``)return{ok:!0,value:null};if(!/^\d+$/.test(t))return{ok:!1,error:`정수만 입력하세요 (0–100)`};let n=Number(t);return n>100?{ok:!1,error:`100 이하여야 합니다`}:{ok:!0,value:n===0?null:n}}function tn(e){let t=e.trim();if(!/^\d+$/.test(t))return{ok:!1,error:`1–100 사이 정수를 입력하세요`};let n=Number(t);return n<1||n>100?{ok:!1,error:`1–100 사이 정수를 입력하세요`}:{ok:!0,value:n}}var nn=new Map(Object.entries({openai:{stripe:`bg-openai-400`,bar:`bg-openai-bar`,badge:`bg-openai-50 text-openai-600`,cost:`text-openai-600`},anthropic:{stripe:`bg-anthropic-400`,bar:`bg-anthropic-400`,badge:`bg-anthropic-50 text-anthropic-600`,cost:`text-anthropic-600`},google:{stripe:`bg-google-400`,bar:`bg-google-400`,badge:`bg-google-50 text-google-600`,cost:`text-google-600`},grok:{stripe:`bg-sand-800`,bar:`bg-sand-600`,badge:`bg-sand-800 text-sand-50`,cost:`text-sand-800`}})),rn={stripe:`bg-sand-400`,bar:`bg-sienna-400`,badge:`bg-sand-200 text-sand-500`,cost:`text-sienna-600`};function an(e){return nn.get(e)??rn}function on(e,t){return e>=95?`bg-danger-400`:e>=80?`bg-caution-400`:t.bar}function sn(e){if(!e)return``;let t=new Date(e).getTime()-Date.now();if(t<=0)return`resetting...`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`resets ${n}h ${r}m`:`resets ${r}m`}function cn(e,t){if(!t||t<=0)return e;let n=t/60;return n>=24?`${Math.round(n/24)}d`:`${Math.round(n)}h`}function ln(e){if(!e)return null;let t=e.replace(/^USAGE_PERIOD_TYPE_/,``).toLowerCase();return t&&t!==`unspecified`?t:null}function un({usage:e}){let t=ln(e.periodType);return e.onDemandExcluded===!0||e.zdrVideoExcluded===!0||e.keepaliveApplicable===!1||t!==null||e.tier?(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-[10px]`,children:[e.onDemandExcluded===!0&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700`,title:`xAI에서 on-demand 과금을 끄면 다시 라우팅됩니다`,children:`excluded: on-demand billing enabled`}),e.zdrVideoExcluded===!0&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-amber-50 text-amber-700`,title:`xAI에서 data-retention opt-out(Zero Data Retention)을 끄면 비디오가 다시 라우팅됩니다`,children:`video unavailable: zero data retention`}),t!==null&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600`,children:t}),e.tier&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-600`,children:e.tier}),e.keepaliveApplicable===!1&&(0,$.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sand-100 text-sand-400`,title:`이 provider는 토큰 윈도 keepalive 대상이 아닙니다`,children:`keepalive n/a`})]}):null}function dn({label:e,utilization:t,resetsAt:n,windowDurationMins:r,theme:i,threshold:a}){let o=t??0,s=a!=null;return(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`span`,{className:`text-xs text-sand-600 w-7 shrink-0`,children:cn(e,r)}),(0,$.jsxs)(`div`,{className:`relative flex-1 min-w-0 h-2 bg-sand-200 rounded-full overflow-hidden`,children:[(0,$.jsx)(`div`,{className:`h-full rounded-full transition-all duration-300 ${on(o,i)}`,style:{width:`${Math.min(o,100)}%`}}),s&&(0,$.jsx)(`div`,{className:`absolute top-[-2px] bottom-[-2px] w-0.5 bg-sienna-500 rounded-full`,style:{left:`calc(${Math.min(a,100)}% - 1px)`}})]}),(0,$.jsxs)(`span`,{className:`text-xs tabular-nums text-sand-700 w-9 text-right shrink-0`,children:[o,`%`]}),(0,$.jsx)(`span`,{className:`hidden sm:inline text-[10px] text-sand-400 w-24 text-right shrink-0`,title:sn(n),children:sn(n)})]})}function fn({token:e,theme:n}){let r=t(),{data:i,isLoading:o,dataUpdatedAt:s}=a.useUsage(e.id);if((0,g.useEffect)(()=>{i?.error&&r.invalidateQueries({queryKey:[`Token`]})},[i?.error,s,r]),e.reauth_required)return(0,$.jsxs)(`div`,{className:`py-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-amber-600`,children:`Session expired`}),(0,$.jsx)(`p`,{className:`text-[10px] text-sand-400 mt-0.5`,children:`Please re-login via OAuth`})]});if(o)return(0,$.jsxs)(`div`,{className:`animate-pulse space-y-2 py-2`,children:[(0,$.jsx)(`div`,{className:`h-2 w-full bg-sand-200 rounded-full`}),(0,$.jsx)(`div`,{className:`h-2 w-3/4 bg-sand-200 rounded-full`})]});if(i?.error)return(0,$.jsxs)(`div`,{className:`py-1`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-amber-600`,children:`Unavailable`}),(0,$.jsx)(`p`,{className:`text-[10px] text-sand-400 mt-0.5`,children:i.error})]});if(!i?.fiveHour&&!i?.sevenDay)return(0,$.jsxs)(`div`,{className:`space-y-1.5 py-1`,children:[i&&(0,$.jsx)(un,{usage:i}),(0,$.jsx)(`p`,{className:`text-[11px] text-sand-400`,children:`No usage data`})]});let c=$t.has(e.provider)?e.quota_threshold:null;return(0,$.jsxs)(`div`,{className:`space-y-1.5 py-1`,children:[(0,$.jsx)(un,{usage:i}),i.fiveHour&&(0,$.jsx)(dn,{label:`5h`,utilization:i.fiveHour.utilization,resetsAt:i.fiveHour.resetsAt,windowDurationMins:i.fiveHour.windowDurationMins,theme:n,threshold:c}),i.sevenDay&&(0,$.jsx)(dn,{label:ln(i.periodType)===`monthly`?`1mo`:`7d`,utilization:i.sevenDay.utilization,resetsAt:i.sevenDay.resetsAt,windowDurationMins:i.sevenDay.windowDurationMins,theme:n,threshold:e.provider===`grok`?c:void 0})]})}function pn({token:e}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),o=(0,g.useRef)(null),c=t(),l=f(),u=$t.has(e.provider),d=n!==null,p=en(i),m=()=>{let t=o.current?.getBoundingClientRect();if(!t)return;let n=Math.min(Math.max(t.right-240,8),Math.max(window.innerWidth-240-8,8)),i=t.top-6-150,s=t.bottom+6;r({left:n,top:Math.min(Math.max(i>=8?i:s,8),Math.max(window.innerHeight-150-8,8))}),a(String(e.quota_threshold??100))},h=()=>r(null);if(!u)return(0,$.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] text-sand-300 border border-sand-100`,title:`Quota threshold는 이 provider에서 지원되지 않습니다`,children:[(0,$.jsx)(Zt,{className:`size-3`}),`n/a`]});let _=e=>{let t=/^\d+$/.test(i.trim())?Number(i.trim()):0,n=Math.min(Math.max(t+e,0),100);a(String(n))};return(0,$.jsxs)(`div`,{className:`inline-flex`,children:[(0,$.jsxs)(`button`,{ref:o,type:`button`,title:`사용률 제한 설정`,onClick:d?h:m,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150`,children:[(0,$.jsx)(Zt,{className:`size-3`}),`Set limit`]}),d&&n&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-40`,onPointerDown:h}),(0,$.jsxs)(`div`,{className:`fixed z-50 w-60 panel shadow-xl p-3`,style:{top:n.top,left:n.left},children:[(0,$.jsx)(`label`,{htmlFor:`threshold-${e.id}`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`사용률 제한`}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>_(-10),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150`,children:`−`}),(0,$.jsx)(s,{id:`threshold-${e.id}`,value:i,onChange:e=>a(e.target.value),inputMode:`numeric`,className:`h-9 w-14 border rounded-md text-center text-sm text-sand-900 bg-white tabular-nums focus:outline-none ${p.ok?`border-sand-200 focus:border-sienna-300`:`border-red-300 focus:border-red-400`}`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>_(10),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600 text-base leading-none hover:bg-sand-100 transition-colors duration-150`,children:`+`}),(0,$.jsx)(`span`,{className:`text-sm text-sand-500`,children:`%`})]}),p.ok?(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] text-sand-500 leading-snug`,children:p.value===null?`제한 없음 — 사용률과 무관하게 항상 사용합니다.`:`기준 사용률이 임계치에 달하면 해당 토큰을 건너뜁니다.`}):(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p.error}),(0,$.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,className:`px-2 py-1 text-[11px] font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150`,onClick:h,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,className:`px-2 py-1 text-[11px] font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,disabled:l.isPending||!p.ok,onClick:async()=>{p.ok&&(await l.mutateAsync({id:e.id,quotaThreshold:p.value}),await Promise.all([c.invalidateQueries({queryKey:[`Token`]}),c.invalidateQueries({queryKey:[`Qgrid`]})]),h())},children:l.isPending?`Saving...`:`Save`})]})]})]})]})}function mn({token:e}){let[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),o=(0,g.useRef)(null),c=t(),l=f(),u=tn(i),d=()=>{let t=o.current?.getBoundingClientRect();if(!t)return;let n=Math.min(Math.max(t.right-240,8),Math.max(window.innerWidth-240-8,8)),i=t.top-6-150,s=Math.min(Math.max(i>=8?i:t.bottom+6,8),Math.max(window.innerHeight-150-8,8));a(String(e.weight)),r({left:n,top:s})},p=()=>r(null),m=e=>{let t=/^\d+$/.test(i.trim())?Number(i.trim()):1;a(String(Math.min(Math.max(t+e,1),100)))};return(0,$.jsxs)(`div`,{className:`inline-flex`,children:[(0,$.jsxs)(`button`,{ref:o,type:`button`,title:`라우팅 가중치 설정`,onClick:n?p:d,className:`flex items-center gap-1 px-1.5 py-0.5 rounded-md text-[10px] border border-sand-200/80 text-sand-400 hover:text-sand-600 hover:border-sand-300 transition-colors duration-150`,children:[`Weight `,e.weight]}),n&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`fixed inset-0 z-40`,onPointerDown:p}),(0,$.jsxs)(`div`,{className:`fixed z-50 w-60 panel shadow-xl p-3`,style:n,children:[(0,$.jsx)(`label`,{htmlFor:`weight-${e.id}`,className:`text-[10px] uppercase tracking-wider text-sand-500 font-medium`,children:`라우팅 가중치`}),(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:()=>m(-1),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600`,children:`−`}),(0,$.jsx)(s,{id:`weight-${e.id}`,value:i,onChange:e=>a(e.target.value),inputMode:`numeric`,className:`h-9 w-16 border rounded-md text-center text-sm tabular-nums ${u.ok?`border-sand-200`:`border-red-300`}`}),(0,$.jsx)(`button`,{type:`button`,onClick:()=>m(1),className:`size-9 shrink-0 rounded-md border border-sand-200 text-sand-600`,children:`+`})]}),(0,$.jsx)(`p`,{className:`mt-1.5 text-[11px] ${u.ok?`text-sand-500`:`text-red-500`}`,children:u.ok?`새 요청의 상대 배정 비율입니다.`:u.error}),(0,$.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-1.5`,children:[(0,$.jsx)(`button`,{type:`button`,onClick:p,className:`px-2 py-1 text-[11px]`,children:`Cancel`}),(0,$.jsx)(`button`,{type:`button`,onClick:async()=>{u.ok&&(await l.mutateAsync({id:e.id,weight:u.value}),await Promise.all([c.invalidateQueries({queryKey:[`Token`]}),c.invalidateQueries({queryKey:[`Qgrid`]})]),p())},disabled:l.isPending||!u.ok,className:`px-2 py-1 text-[11px] rounded-md bg-sienna-400 text-white disabled:opacity-50`,children:l.isPending?`Saving...`:`Save`})]})]})]})]})}function hn({token:e}){let t=c(),n=u(e.provider)?e.provider:null,r=async e=>{await t.submitCode(e)&&t.reset()};return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`button`,{type:`button`,title:`기존 이름으로 다시 로그인`,disabled:n===null||t.loadingProvider!==null,onClick:()=>{n&&t.start(n,e.name??``)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-[10px] font-medium border border-sienna-300 text-sienna-600 hover:bg-sienna-50 disabled:opacity-50 transition-colors duration-150`,children:t.loadingProvider===e.provider?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`size-2.5 border-2 border-sienna-400 border-t-transparent rounded-full animate-spin`}),`로그인 대기`]}):`재로그인`}),t.codeEntryProvider&&(0,$.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-[15vh]`,children:[(0,$.jsx)(`div`,{className:`absolute inset-0 bg-sand-900/8 backdrop-blur-sm`,onClick:t.reset,onKeyDown:()=>{}}),(0,$.jsxs)(`div`,{className:`relative panel shadow-xl w-full max-w-md mx-4`,children:[(0,$.jsx)(`div`,{className:`px-5 py-4 border-b border-sand-100/60`,children:(0,$.jsx)(`h3`,{className:`text-base font-medium text-sand-900`,children:`재로그인`})}),(0,$.jsx)(`div`,{className:`px-5 py-4`,children:(0,$.jsx)(l,{provider:t.codeEntryProvider,isPending:t.completeMutation.isPending,isError:t.completeMutation.isError,onSubmit:e=>void r(e),onRestart:t.reset})})]})]})]})}function gn({token:e}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:o,isDragging:s}=Xt({id:String(e.id),transition:{duration:200,easing:`ease`}}),c={num:0,page:1};e.name&&(c.token_name=e.name);let{data:l}=a.useTotalCost(c,{enabled:!!e.name}),u=an(e.provider);return(0,$.jsxs)(`div`,{ref:r,style:{transform:L.Translate.toString(i),transition:o,opacity:s?.5:1,zIndex:s?10:void 0},className:`relative rounded-lg bg-white border border-sand-200/80 overflow-hidden shadow-sm hover:shadow-md transition-shadow duration-200`,children:[(0,$.jsx)(`div`,{className:`absolute inset-y-0 left-0 w-1 ${u.stripe}`}),(0,$.jsxs)(`div`,{className:`pl-4 pr-3 py-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,$.jsx)(`button`,{type:`button`,"aria-label":`순서 변경 핸들`,...t,...n,className:`shrink-0 -m-1 p-1 text-sand-300 hover:text-sand-500 cursor-grab active:cursor-grabbing touch-none`,children:(0,$.jsx)(Qt,{className:`size-3.5`})}),(0,$.jsx)(`span`,{className:`text-[13px] font-medium text-sand-800 truncate select-none`,children:e.name??`Unnamed`})]}),(0,$.jsxs)(`span`,{className:`text-[11px] tabular-nums font-medium shrink-0 ${u.cost}`,children:[d(l?.usd??0),l&&m(l)?(0,$.jsx)(`span`,{className:`ml-1 font-normal text-sand-400`,title:p(l)??void 0,children:m(l)}):null]})]}),(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mb-2`,children:[(0,$.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full uppercase ${u.badge}`,children:e.provider}),(0,$.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full ${e.active?`bg-sage-100 text-sage-600`:`bg-sand-200 text-sand-500`}`,children:e.active?`Active`:`Inactive`}),$t.has(e.provider)&&e.quota_threshold!==null&&(0,$.jsxs)(`span`,{className:`px-1.5 py-0.5 rounded-full bg-sienna-50 text-[10px] tabular-nums font-medium text-sienna-600`,title:`사용률 ${e.quota_threshold}% 이상이면 이 토큰 제외`,children:[`≤ `,e.quota_threshold,`%`]})]}),(0,$.jsx)(fn,{token:e,theme:u}),(0,$.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:[e.reauth_required&&(0,$.jsx)(hn,{token:e}),(0,$.jsx)(`div`,{className:`flex-1`}),(0,$.jsx)(mn,{token:e}),(0,$.jsx)(pn,{token:e})]})]})]})}var _n=[`all`,`openai`,`anthropic`,`grok`],vn={all:`All`,openai:`OpenAI`,anthropic:`Anthropic`,grok:`Grok`};function yn(){let{data:e,isLoading:n}=o.useTokens(`A`,{orderBy:`ord-asc`}),r=t(),i=o.useReorderMutation(),[a,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(`all`);(0,g.useEffect)(()=>{e?.rows&&s(e.rows)},[e?.rows]);let u=it(rt(_t,{activationConstraint:{distance:5}})),d=t=>{let{active:n,over:c}=t;if(!c||n.id===c.id)return;let l=Number(n.id),u=Number(c.id),d=a.findIndex(e=>e.id===l),f=a.findIndex(e=>e.id===u);if(d===-1||f===-1)return;let p=Ft(a,d,f);s(p);let m=o.getTokensQueryOptions(`A`,{orderBy:`ord-asc`}).queryKey,h=r.getQueryData(m);r.setQueryData(m,e=>e&&{...e,rows:p}),i.mutate({ids:p.map(e=>e.id)},{onError:()=>{r.setQueryData(m,h),e?.rows&&s(e.rows)},onSettled:()=>{Promise.all([r.invalidateQueries({queryKey:[`Token`]}),r.invalidateQueries({queryKey:[`Qgrid`]})])}})};if(n)return(0,$.jsx)(`div`,{className:`panel p-5`,children:(0,$.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Array.from({length:4}).map((e,t)=>(0,$.jsxs)(`div`,{className:`rounded-lg bg-sand-50 px-4 py-3 animate-pulse`,children:[(0,$.jsx)(`div`,{className:`h-3 w-16 bg-sand-200 rounded mb-3`}),(0,$.jsx)(`div`,{className:`h-2 w-full bg-sand-200 rounded-full`})]},`skel-${t}`))})});if(a.length===0)return(0,$.jsx)(`div`,{className:`panel px-5 py-10`,children:(0,$.jsx)(`p`,{className:`text-sand-400 text-[13px] text-center`,children:`No tokens registered`})});let f=c===`all`?a:a.filter(e=>e.provider===c);return(0,$.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,$.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-5 py-2.5`,children:[(0,$.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`Token Usage`}),(0,$.jsx)(`div`,{className:`segmented-control flex gap-0.5`,children:_n.map(e=>(0,$.jsx)(`button`,{type:`button`,"data-active":c===e,className:`px-2.5 py-[3px] text-[11px] font-medium rounded-[6px] transition-all duration-150 ${c===e?`text-sand-800`:`text-sand-500 hover:text-sand-700`}`,onClick:()=>l(e),children:vn[e]},e))})]}),(0,$.jsx)(`div`,{className:`p-4`,children:(0,$.jsx)(Dt,{sensors:u,collisionDetection:pe,onDragEnd:d,children:(0,$.jsx)(Vt,{items:f.map(e=>String(e.id)),strategy:Rt,children:(0,$.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:f.map(e=>(0,$.jsx)(gn,{token:e},e.id))})})})})]})}function bn(){return(0,$.jsx)(`div`,{className:`max-w-6xl mx-auto`,children:(0,$.jsx)(yn,{})})}export{bn as component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{f as r,g as i,h as a,m as o,p as s}from"./vendor-tanstack-
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-Dw2cE7zH.js";import{f as r,g as i,h as a,m as o,p as s}from"./vendor-tanstack-DRPs09ai.js";import{i as c}from"./vendor-react-DH4kUfK2.js";var l=n(((e,t)=>{t.exports=TypeError})),u=n(((e,t)=>{t.exports={}})),d=n(((e,t)=>{var n=typeof Map==`function`&&Map.prototype,r=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,`size`):null,i=n&&r&&typeof r.get==`function`?r.get:null,a=n&&Map.prototype.forEach,o=typeof Set==`function`&&Set.prototype,s=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,`size`):null,c=o&&s&&typeof s.get==`function`?s.get:null,l=o&&Set.prototype.forEach,d=typeof WeakMap==`function`&&WeakMap.prototype?WeakMap.prototype.has:null,f=typeof WeakSet==`function`&&WeakSet.prototype?WeakSet.prototype.has:null,p=typeof WeakRef==`function`&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,h=Object.prototype.toString,g=Function.prototype.toString,_=String.prototype.match,v=String.prototype.slice,y=String.prototype.replace,b=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,C=Array.prototype.concat,w=Array.prototype.join,ee=Array.prototype.slice,T=Math.floor,te=typeof BigInt==`function`?BigInt.prototype.valueOf:null,E=Object.getOwnPropertySymbols,ne=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?Symbol.prototype.toString:null,re=typeof Symbol==`function`&&typeof Symbol.iterator==`object`,ie=typeof Symbol==`function`&&Symbol.toStringTag?Symbol.toStringTag:null,ae=Object.prototype.propertyIsEnumerable,oe=(typeof Reflect==`function`?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function se(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e==`number`){var r=e<0?-T(-e):T(e);if(r!==e){var i=String(r),a=v.call(t,i.length+1);return y.call(i,n,`$&_`)+`.`+y.call(y.call(a,/([0-9]{3})/g,`$&_`),/_$/,``)}}return y.call(t,n,`$&_`)}var ce=u(),le=ce.custom,ue=O(le)?le:null,de={__proto__:null,double:`"`,single:`'`},fe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};t.exports=function e(t,n,r,o){var s=n||{};if(we(s,`quoteStyle`)&&!we(de,s.quoteStyle))throw TypeError(`option "quoteStyle" must be "single" or "double"`);if(we(s,`maxStringLength`)&&(typeof s.maxStringLength==`number`?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=we(s,`customInspect`)?s.customInspect:!0;if(typeof u!=`boolean`&&u!==`symbol`)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(we(s,`indent`)&&s.indent!==null&&s.indent!==` `&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(we(s,`numericSeparator`)&&typeof s.numericSeparator!=`boolean`)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(t===void 0)return`undefined`;if(t===null)return`null`;if(typeof t==`boolean`)return t?`true`:`false`;if(typeof t==`string`)return Me(t,s);if(typeof t==`number`){if(t===0)return 1/0/t>0?`0`:`-0`;var f=String(t);return d?se(t,f):f}if(typeof t==`bigint`){var p=String(t)+`n`;return d?se(t,p):p}var h=s.depth===void 0?5:s.depth;if(r===void 0&&(r=0),r>=h&&h>0&&typeof t==`object`)return he(t)?`[Array]`:`[Object]`;var g=M(s,r);if(o===void 0)o=[];else if(Ee(o,t)>=0)return`[Circular]`;function _(t,n,i){if(n&&(o=ee.call(o),o.push(n)),i){var a={depth:s.depth};return we(s,`quoteStyle`)&&(a.quoteStyle=s.quoteStyle),e(t,a,r+1,o)}return e(t,s,r+1,o)}if(typeof t==`function`&&!_e(t)){var b=Te(t),S=Re(t,_);return`[Function`+(b?`: `+b:` (anonymous)`)+`]`+(S.length>0?` { `+w.call(S,`, `)+` }`:``)}if(O(t)){var T=re?y.call(String(t),/^(Symbol\(.*\))_[^)]*$/,`$1`):ne.call(t);return typeof t==`object`&&!re?j(T):T}if(je(t)){for(var E=`<`+x.call(String(t.nodeName)),le=t.attributes||[],fe=0;fe<le.length;fe++)E+=` `+le[fe].name+`=`+pe(me(le[fe].value),`double`,s);return E+=`>`,t.childNodes&&t.childNodes.length&&(E+=`...`),E+=`</`+x.call(String(t.nodeName))+`>`,E}if(he(t)){if(t.length===0)return`[]`;var D=Re(t,_);return g&&!Ie(D)?`[`+Le(D,g)+`]`:`[ `+w.call(D,`, `)+` ]`}if(ve(t)){var Ce=Re(t,_);return!(`cause`in Error.prototype)&&`cause`in t&&!ae.call(t,`cause`)?`{ [`+String(t)+`] `+w.call(C.call(`[cause]: `+_(t.cause),Ce),`, `)+` }`:Ce.length===0?`[`+String(t)+`]`:`{ [`+String(t)+`] `+w.call(Ce,`, `)+` }`}if(typeof t==`object`&&u){if(ue&&typeof t[ue]==`function`&&ce)return ce(t,{depth:h-r});if(u!==`symbol`&&typeof t.inspect==`function`)return t.inspect()}if(De(t)){var Ne=[];return a&&a.call(t,function(e,n){Ne.push(_(n,t,!0)+` => `+_(e,t))}),Fe(`Map`,i.call(t),Ne,g)}if(Ae(t)){var ze=[];return l&&l.call(t,function(e){ze.push(_(e,t))}),Fe(`Set`,c.call(t),ze,g)}if(Oe(t))return Pe(`WeakMap`);if(A(t))return Pe(`WeakSet`);if(ke(t))return Pe(`WeakRef`);if(be(t))return j(_(Number(t)));if(Se(t))return j(_(te.call(t)));if(xe(t))return j(m.call(t));if(ye(t))return j(_(String(t)));if(typeof window<`u`&&t===window)return`{ [object Window] }`;if(typeof globalThis<`u`&&t===globalThis||typeof global<`u`&&t===global)return`{ [object globalThis] }`;if(!ge(t)&&!_e(t)){var Be=Re(t,_),Ve=oe?oe(t)===Object.prototype:t instanceof Object||t.constructor===Object,He=t instanceof Object?``:`null prototype`,Ue=!Ve&&ie&&Object(t)===t&&ie in t?v.call(k(t),8,-1):He?`Object`:``,We=(Ve||typeof t.constructor!=`function`?``:t.constructor.name?t.constructor.name+` `:``)+(Ue||He?`[`+w.call(C.call([],Ue||[],He||[]),`: `)+`] `:``);return Be.length===0?We+`{}`:g?We+`{`+Le(Be,g)+`}`:We+`{ `+w.call(Be,`, `)+` }`}return String(t)};function pe(e,t,n){var r=de[n.quoteStyle||t];return r+e+r}function me(e){return y.call(String(e),/"/g,`"`)}function D(e){return!ie||!(typeof e==`object`&&(ie in e||e[ie]!==void 0))}function he(e){return k(e)===`[object Array]`&&D(e)}function ge(e){return k(e)===`[object Date]`&&D(e)}function _e(e){return k(e)===`[object RegExp]`&&D(e)}function ve(e){return k(e)===`[object Error]`&&D(e)}function ye(e){return k(e)===`[object String]`&&D(e)}function be(e){return k(e)===`[object Number]`&&D(e)}function xe(e){return k(e)===`[object Boolean]`&&D(e)}function O(e){if(re)return e&&typeof e==`object`&&e instanceof Symbol;if(typeof e==`symbol`)return!0;if(!e||typeof e!=`object`||!ne)return!1;try{return ne.call(e),!0}catch{}return!1}function Se(e){if(!e||typeof e!=`object`||!te)return!1;try{return te.call(e),!0}catch{}return!1}var Ce=Object.prototype.hasOwnProperty||function(e){return e in this};function we(e,t){return Ce.call(e,t)}function k(e){return h.call(e)}function Te(e){if(e.name)return e.name;var t=_.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function Ee(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function De(e){if(!i||!e||typeof e!=`object`)return!1;try{i.call(e);try{c.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Oe(e){if(!d||!e||typeof e!=`object`)return!1;try{d.call(e,d);try{f.call(e,f)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function ke(e){if(!p||!e||typeof e!=`object`)return!1;try{return p.call(e),!0}catch{}return!1}function Ae(e){if(!c||!e||typeof e!=`object`)return!1;try{c.call(e);try{i.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function A(e){if(!f||!e||typeof e!=`object`)return!1;try{f.call(e,f);try{d.call(e,d)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function je(e){return!e||typeof e!=`object`?!1:typeof HTMLElement<`u`&&e instanceof HTMLElement?!0:typeof e.nodeName==`string`&&typeof e.getAttribute==`function`}function Me(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r=`... `+n+` more character`+(n>1?`s`:``);return Me(v.call(e,0,t.maxStringLength),t)+r}var i=fe[t.quoteStyle||`single`];return i.lastIndex=0,pe(y.call(y.call(e,i,`\\$1`),/[\x00-\x1f]/g,Ne),`single`,t)}function Ne(e){var t=e.charCodeAt(0),n={8:`b`,9:`t`,10:`n`,12:`f`,13:`r`}[t];return n?`\\`+n:`\\x`+(t<16?`0`:``)+b.call(t.toString(16))}function j(e){return`Object(`+e+`)`}function Pe(e){return e+` { ? }`}function Fe(e,t,n,r){var i=r?Le(n,r):w.call(n,`, `);return e+` (`+t+`) {`+i+`}`}function Ie(e){for(var t=0;t<e.length;t++)if(Ee(e[t],`
|
|
2
2
|
`)>=0)return!1;return!0}function M(e,t){var n;if(e.indent===` `)n=` `;else if(typeof e.indent==`number`&&e.indent>0)n=w.call(Array(e.indent+1),` `);else return null;return{base:n,prev:w.call(Array(t+1),n)}}function Le(e,t){if(e.length===0)return``;var n=`
|
|
3
3
|
`+t.prev+t.base;return n+w.call(e,`,`+n)+`
|
|
4
4
|
`+t.prev}function Re(e,t){var n=he(e),r=[];if(n){r.length=e.length;for(var i=0;i<e.length;i++)r[i]=we(e,i)?t(e[i],e):``}var a=typeof E==`function`?E(e):[],o;if(re){o={};for(var s=0;s<a.length;s++)o[`$`+a[s]]=a[s]}for(var c in e)we(e,c)&&(n&&String(Number(c))===c&&c<e.length||re&&o[`$`+c]instanceof Symbol||(S.call(/[^\w$]/,c)?r.push(t(c,e)+`: `+t(e[c],e)):r.push(c+`: `+t(e[c],e))));if(typeof E==`function`)for(var l=0;l<a.length;l++)ae.call(e,a[l])&&r.push(`[`+t(a[l])+`]: `+t(e[a[l]],e));return r}})),f=n(((e,t)=>{var n=d(),r=l(),i=function(e,t,n){for(var r=e,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,n||(i.next=e.next,e.next=i),i},a=function(e,t){if(e){var n=i(e,t);return n&&n.value}},o=function(e,t,n){var r=i(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},s=function(e,t){return e?!!i(e,t):!1},c=function(e,t){if(e)return i(e,t,!0)};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new r(`Side channel does not contain `+n(e))},delete:function(t){var n=e&&e.next,r=c(e,t);return r&&n&&n===r&&(e=void 0),!!r},get:function(t){return a(e,t)},has:function(t){return s(e,t)},set:function(t,n){e||={next:void 0},o(e,t,n)}};return t}})),p=n(((e,t)=>{t.exports=Object})),m=n(((e,t)=>{t.exports=Error})),h=n(((e,t)=>{t.exports=EvalError})),g=n(((e,t)=>{t.exports=RangeError})),_=n(((e,t)=>{t.exports=ReferenceError})),v=n(((e,t)=>{t.exports=SyntaxError})),y=n(((e,t)=>{t.exports=URIError})),b=n(((e,t)=>{t.exports=Math.abs})),x=n(((e,t)=>{t.exports=Math.floor})),S=n(((e,t)=>{t.exports=Math.max})),C=n(((e,t)=>{t.exports=Math.min})),w=n(((e,t)=>{t.exports=Math.pow})),ee=n(((e,t)=>{t.exports=Math.round})),T=n(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),te=n(((e,t)=>{var n=T();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),E=n(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),ne=n(((e,t)=>{var n=E();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),re=n(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),ie=n(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),ae=n(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=ie();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),oe=n(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),se=n(((e,t)=>{t.exports=p().getPrototypeOf||null})),ce=n(((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}})),le=n(((e,t)=>{var n=ce();t.exports=Function.prototype.bind||n})),ue=n(((e,t)=>{t.exports=Function.prototype.call})),de=n(((e,t)=>{t.exports=Function.prototype.apply})),fe=n(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),pe=n(((e,t)=>{var n=le(),r=de(),i=ue();t.exports=fe()||n.call(i,r)})),me=n(((e,t)=>{var n=le(),r=l(),i=ue(),a=pe();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),D=n(((e,t)=>{var n=me(),r=ne(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),he=n(((e,t)=>{var n=oe(),r=se(),i=D();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),ge=n(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=le().call(n,r)})),_e=n(((e,t)=>{var n,r=p(),i=m(),a=h(),o=g(),s=_(),c=v(),u=l(),d=y(),f=b(),T=x(),E=S(),ie=C(),ce=w(),fe=ee(),pe=te(),me=Function,D=function(e){try{return me(`"use strict"; return (`+e+`).constructor;`)()}catch{}},_e=ne(),ve=re(),ye=function(){throw new u},be=_e?function(){try{return arguments.callee,ye}catch{try{return _e(arguments,`callee`).get}catch{return ye}}}():ye,xe=ae()(),O=he(),Se=se(),Ce=oe(),we=de(),k=ue(),Te={},Ee=typeof Uint8Array>`u`||!O?n:O(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":xe&&O?O([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":Te,"%AsyncGenerator%":Te,"%AsyncGeneratorFunction%":Te,"%AsyncIteratorPrototype%":Te,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":me,"%GeneratorFunction%":Te,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xe&&O?O(O([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!xe||!O?n:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":_e,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!xe||!O?n:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xe&&O?O(``[Symbol.iterator]()):n,"%Symbol%":xe?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":be,"%TypedArray%":Ee,"%TypeError%":u,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":d,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":we,"%Object.defineProperty%":ve,"%Object.getPrototypeOf%":Se,"%Math.abs%":f,"%Math.floor%":T,"%Math.max%":E,"%Math.min%":ie,"%Math.pow%":ce,"%Math.round%":fe,"%Math.sign%":pe,"%Reflect.getPrototypeOf%":Ce};if(O)try{null.error}catch(e){De[`%Error.prototype%`]=O(O(e))}var Oe=function e(t){var n;if(t===`%AsyncFunction%`)n=D(`async function () {}`);else if(t===`%GeneratorFunction%`)n=D(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=D(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&O&&(n=O(i.prototype))}return De[t]=n,n},ke={__proto__:null,"%ArrayBufferPrototype%":[`ArrayBuffer`,`prototype`],"%ArrayPrototype%":[`Array`,`prototype`],"%ArrayProto_entries%":[`Array`,`prototype`,`entries`],"%ArrayProto_forEach%":[`Array`,`prototype`,`forEach`],"%ArrayProto_keys%":[`Array`,`prototype`,`keys`],"%ArrayProto_values%":[`Array`,`prototype`,`values`],"%AsyncFunctionPrototype%":[`AsyncFunction`,`prototype`],"%AsyncGenerator%":[`AsyncGeneratorFunction`,`prototype`],"%AsyncGeneratorPrototype%":[`AsyncGeneratorFunction`,`prototype`,`prototype`],"%BooleanPrototype%":[`Boolean`,`prototype`],"%DataViewPrototype%":[`DataView`,`prototype`],"%DatePrototype%":[`Date`,`prototype`],"%ErrorPrototype%":[`Error`,`prototype`],"%EvalErrorPrototype%":[`EvalError`,`prototype`],"%Float32ArrayPrototype%":[`Float32Array`,`prototype`],"%Float64ArrayPrototype%":[`Float64Array`,`prototype`],"%FunctionPrototype%":[`Function`,`prototype`],"%Generator%":[`GeneratorFunction`,`prototype`],"%GeneratorPrototype%":[`GeneratorFunction`,`prototype`,`prototype`],"%Int8ArrayPrototype%":[`Int8Array`,`prototype`],"%Int16ArrayPrototype%":[`Int16Array`,`prototype`],"%Int32ArrayPrototype%":[`Int32Array`,`prototype`],"%JSONParse%":[`JSON`,`parse`],"%JSONStringify%":[`JSON`,`stringify`],"%MapPrototype%":[`Map`,`prototype`],"%NumberPrototype%":[`Number`,`prototype`],"%ObjectPrototype%":[`Object`,`prototype`],"%ObjProto_toString%":[`Object`,`prototype`,`toString`],"%ObjProto_valueOf%":[`Object`,`prototype`,`valueOf`],"%PromisePrototype%":[`Promise`,`prototype`],"%PromiseProto_then%":[`Promise`,`prototype`,`then`],"%Promise_all%":[`Promise`,`all`],"%Promise_reject%":[`Promise`,`reject`],"%Promise_resolve%":[`Promise`,`resolve`],"%RangeErrorPrototype%":[`RangeError`,`prototype`],"%ReferenceErrorPrototype%":[`ReferenceError`,`prototype`],"%RegExpPrototype%":[`RegExp`,`prototype`],"%SetPrototype%":[`Set`,`prototype`],"%SharedArrayBufferPrototype%":[`SharedArrayBuffer`,`prototype`],"%StringPrototype%":[`String`,`prototype`],"%SymbolPrototype%":[`Symbol`,`prototype`],"%SyntaxErrorPrototype%":[`SyntaxError`,`prototype`],"%TypedArrayPrototype%":[`TypedArray`,`prototype`],"%TypeErrorPrototype%":[`TypeError`,`prototype`],"%Uint8ArrayPrototype%":[`Uint8Array`,`prototype`],"%Uint8ClampedArrayPrototype%":[`Uint8ClampedArray`,`prototype`],"%Uint16ArrayPrototype%":[`Uint16Array`,`prototype`],"%Uint32ArrayPrototype%":[`Uint32Array`,`prototype`],"%URIErrorPrototype%":[`URIError`,`prototype`],"%WeakMapPrototype%":[`WeakMap`,`prototype`],"%WeakSetPrototype%":[`WeakSet`,`prototype`]},Ae=le(),A=ge(),je=Ae.call(k,Array.prototype.concat),Me=Ae.call(we,Array.prototype.splice),Ne=Ae.call(k,String.prototype.replace),j=Ae.call(k,String.prototype.slice),Pe=Ae.call(k,RegExp.prototype.exec),Fe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ie=/\\(\\)?/g,M=function(e){var t=j(e,0,1),n=j(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return Ne(e,Fe,function(e,t,n,i){r[r.length]=n?Ne(i,Ie,`$1`):t||e}),r},Le=function(e,t){var n=e,r;if(A(ke,n)&&(r=ke[n],n=`%`+r[0]+`%`),A(De,n)){var i=De[n];if(i===Te&&(i=Oe(n)),i===void 0&&!t)throw new u(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new u(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new u(`"allowMissing" argument must be a boolean`);if(Pe(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=M(e),r=n.length>0?n[0]:``,i=Le(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,l=i.alias;l&&(r=l[0],Me(n,je([0,1],l)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=j(p,0,1),h=j(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,A(De,a))o=De[a];else if(o!=null){if(!(p in o)){if(!t)throw new u(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(_e&&d+1>=n.length){var g=_e(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=A(o,p),o=o[p];f&&!s&&(De[a]=o)}}return o}})),ve=n(((e,t)=>{var n=_e(),r=me(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),ye=n(((e,t)=>{var n=_e(),r=ve(),i=d(),a=l(),o=n(`%Map%`,!0),s=r(`Map.prototype.get`,!0),c=r(`Map.prototype.set`,!0),u=r(`Map.prototype.has`,!0),f=r(`Map.prototype.delete`,!0),p=r(`Map.prototype.size`,!0);t.exports=!!o&&function(){var e,t={assert:function(e){if(!t.has(e))throw new a(`Side channel does not contain `+i(e))},delete:function(t){if(e){var n=f(e,t);return p(e)===0&&(e=void 0),n}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return e?u(e,t):!1},set:function(t,n){e||=new o,c(e,t,n)}};return t}})),be=n(((e,t)=>{var n=_e(),r=ve(),i=d(),a=ye(),o=l(),s=n(`%WeakMap%`,!0),c=r(`WeakMap.prototype.get`,!0),u=r(`WeakMap.prototype.set`,!0),f=r(`WeakMap.prototype.has`,!0),p=r(`WeakMap.prototype.delete`,!0);t.exports=s?function(){var e,t,n={assert:function(e){if(!n.has(e))throw new o(`Side channel does not contain `+i(e))},delete:function(n){if(s&&n&&(typeof n==`object`||typeof n==`function`)){if(e)return p(e,n)}else if(a&&t)return t.delete(n);return!1},get:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?c(e,n):t&&t.get(n)},has:function(n){return s&&n&&(typeof n==`object`||typeof n==`function`)&&e?f(e,n):!!t&&t.has(n)},set:function(n,r){s&&n&&(typeof n==`object`||typeof n==`function`)?(e||=new s,u(e,n,r)):a&&(t||=a(),t.set(n,r))}};return n}:a})),xe=n(((e,t)=>{var n=l(),r=d(),i=f(),a=ye(),o=be()||a||i;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n(`Side channel does not contain `+r(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||=o(),e.set(t,n)}};return t}})),O=n(((e,t)=>{var n=String.prototype.replace,r=/%20/g,i={RFC1738:`RFC1738`,RFC3986:`RFC3986`};t.exports={default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,r,`+`)},RFC3986:function(e){return String(e)}},RFC1738:i.RFC1738,RFC3986:i.RFC3986}})),Se=n(((e,t)=>{var n=O(),r=xe(),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=r(),s=function(e,t){return o.set(e,t),e},c=function(e){return o.has(e)},l=function(e){return o.get(e)},u=function(e,t){o.set(e,t)},d=function(){for(var e=[],t=0;t<256;++t)e[e.length]=`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase();return e}(),f=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(a(n)){for(var r=[],i=0;i<n.length;++i)n[i]!==void 0&&(r[r.length]=n[i]);t.obj[t.prop]=r}}},p=function(e,t){for(var n=t&&t.plainObjects?{__proto__:null}:{},r=0;r<e.length;++r)e[r]!==void 0&&(n[r]=e[r]);return n},m=function e(t,n,r){if(!n)return t;if(typeof n!=`object`&&typeof n!=`function`){if(a(t)){var o=t.length;if(r&&typeof r.arrayLimit==`number`&&o>r.arrayLimit)return s(p(t.concat(n),r),o);t[o]=n}else if(t&&typeof t==`object`)if(c(t)){var d=l(t)+1;t[d]=n,u(t,d)}else if(r&&r.strictMerge)return[t,n];else (r&&(r.plainObjects||r.allowPrototypes)||!i.call(Object.prototype,n))&&(t[n]=!0);else return[t,n];return t}if(!t||typeof t!=`object`){if(c(n)){for(var f=Object.keys(n),m=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},h=0;h<f.length;h++){var g=parseInt(f[h],10);m[g+1]=n[f[h]]}return s(m,l(n)+1)}var _=[t].concat(n);return r&&typeof r.arrayLimit==`number`&&_.length>r.arrayLimit?s(p(_,r),_.length-1):_}var v=t;return a(t)&&!a(n)&&(v=p(t,r)),a(t)&&a(n)?(n.forEach(function(n,a){if(i.call(t,a)){var o=t[a];o&&typeof o==`object`&&n&&typeof n==`object`?t[a]=e(o,n,r):t[t.length]=n}else t[a]=n}),t):Object.keys(n).reduce(function(t,a){var o=n[a];if(i.call(t,a)?t[a]=e(t[a],o,r):t[a]=o,c(n)&&!c(t)&&s(t,l(n)),c(t)){var d=parseInt(a,10);String(d)===a&&d>=0&&d>l(t)&&u(t,d)}return t},v)},h=function(e,t){return Object.keys(t).reduce(function(e,n){return e[n]=t[n],e},e)},g=function(e,t,n){var r=e.replace(/\+/g,` `);if(n===`iso-8859-1`)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},_=1024;t.exports={arrayToObject:p,assign:h,combine:function(e,t,n,r){if(c(e)){var i=l(e)+1;return e[i]=t,u(e,i),e}var a=[].concat(e,t);return a.length>n?s(p(a,{plainObjects:r}),a.length-1):a},compact:function(e){for(var t=[{obj:{o:e},prop:`o`}],n=[],r=0;r<t.length;++r)for(var i=t[r],a=i.obj[i.prop],o=Object.keys(a),s=0;s<o.length;++s){var c=o[s],l=a[c];typeof l==`object`&&l&&n.indexOf(l)===-1&&(t[t.length]={obj:a,prop:c},n[n.length]=l)}return f(t),e},decode:g,encode:function(e,t,r,i,a){if(e.length===0)return e;var o=e;if(typeof e==`symbol`?o=Symbol.prototype.toString.call(e):typeof e!=`string`&&(o=String(e)),r===`iso-8859-1`)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});for(var s=``,c=0;c<o.length;c+=_){for(var l=o.length>=_?o.slice(c,c+_):o,u=[],f=0;f<l.length;++f){var p=l.charCodeAt(f);if(p===45||p===46||p===95||p===126||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||a===n.RFC1738&&(p===40||p===41)){u[u.length]=l.charAt(f);continue}if(p<128){u[u.length]=d[p];continue}if(p<2048){u[u.length]=d[192|p>>6]+d[128|p&63];continue}if(p<55296||p>=57344){u[u.length]=d[224|p>>12]+d[128|p>>6&63]+d[128|p&63];continue}f+=1,p=65536+((p&1023)<<10|l.charCodeAt(f)&1023),u[u.length]=d[240|p>>18]+d[128|p>>12&63]+d[128|p>>6&63]+d[128|p&63]}s+=u.join(``)}return s},isBuffer:function(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:c,isRegExp:function(e){return Object.prototype.toString.call(e)===`[object RegExp]`},markOverflow:s,maybeMap:function(e,t){if(a(e)){for(var n=[],r=0;r<e.length;r+=1)n[n.length]=t(e[r]);return n}return t(e)},merge:m}})),Ce=n(((e,t)=>{var n=xe(),r=Se(),i=O(),a=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+`[]`},comma:`comma`,indices:function(e,t){return e+`[`+t+`]`},repeat:function(e){return e}},s=Array.isArray,c=Array.prototype.push,l=function(e,t){c.apply(e,s(t)?t:[t])},u=Date.prototype.toISOString,d=i.default,f={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,commaRoundTrip:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:r.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:i.formatters[d],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},p=function(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`},m={},h=function e(t,i,a,o,c,u,d,h,g,_,v,y,b,x,S,C,w,ee){for(var T=t,te=ee,E=0,ne=!1;(te=te.get(m))!==void 0&&!ne;){var re=te.get(t);if(E+=1,re!==void 0){if(re===E)throw RangeError(`Cyclic object value`);ne=!0}te.get(m)===void 0&&(E=0)}if(typeof _==`function`?T=_(i,T):T instanceof Date?T=b(T):a===`comma`&&s(T)&&(T=r.maybeMap(T,function(e){return e instanceof Date?b(e):e})),T===null){if(u)return g&&!C?g(i,f.encoder,w,`key`,x):i;T=``}if(p(T)||r.isBuffer(T))return g?[S(C?i:g(i,f.encoder,w,`key`,x))+`=`+S(g(T,f.encoder,w,`value`,x))]:[S(i)+`=`+S(String(T))];var ie=[];if(T===void 0)return ie;var ae;if(a===`comma`&&s(T))C&&g&&(T=r.maybeMap(T,g)),ae=[{value:T.length>0?T.join(`,`)||null:void 0}];else if(s(_))ae=_;else{var oe=Object.keys(T);ae=v?oe.sort(v):oe}var se=h?String(i).replace(/\./g,`%2E`):String(i),ce=o&&s(T)&&T.length===1?se+`[]`:se;if(c&&s(T)&&T.length===0)return ce+`[]`;for(var le=0;le<ae.length;++le){var ue=ae[le],de=typeof ue==`object`&&ue&&ue.value!==void 0?ue.value:T[ue];if(!(d&&de===null)){var fe=y&&h?String(ue).replace(/\./g,`%2E`):String(ue),pe=s(T)?typeof a==`function`?a(ce,fe):ce:ce+(y?`.`+fe:`[`+fe+`]`);ee.set(t,E);var me=n();me.set(m,ee),l(ie,e(de,pe,a,o,c,u,d,h,a===`comma`&&C&&s(T)?null:g,_,v,y,b,x,S,C,w,me))}}return ie},g=function(e){if(!e)return f;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);var t=e.charset||f.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);var n=i.default;if(e.format!==void 0){if(!a.call(i.formatters,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}var r=i.formatters[n],c=f.filter;(typeof e.filter==`function`||s(e.filter))&&(c=e.filter);var l=e.arrayFormat in o?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:f.arrayFormat;if(`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");var u=e.allowDots===void 0?e.encodeDotInKeys===!0?!0:f.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:f.addQueryPrefix,allowDots:u,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:f.allowEmptyArrays,arrayFormat:l,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:f.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?f.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:f.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:f.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:f.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:f.encodeValuesOnly,filter:c,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:f.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:f.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:f.strictNullHandling}};t.exports=function(e,t){var r=e,i=g(t),a,c;typeof i.filter==`function`?(c=i.filter,r=c(``,r)):s(i.filter)&&(c=i.filter,a=c);var u=[];if(typeof r!=`object`||!r)return``;var d=o[i.arrayFormat],f=d===`comma`&&i.commaRoundTrip;a||=Object.keys(r),i.sort&&a.sort(i.sort);for(var p=n(),m=0;m<a.length;++m){var _=a[m],v=r[_];i.skipNulls&&v===null||l(u,h(v,_,d,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,p))}var y=u.join(i.delimiter),b=i.addQueryPrefix===!0?`?`:``;return i.charsetSentinel&&(i.charset===`iso-8859-1`?b+=`utf8=%26%2310003%3B&`:b+=`utf8=%E2%9C%93&`),y.length>0?b+y:``}})),we=n(((e,t)=>{var n=Se(),r=Object.prototype.hasOwnProperty,i=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:`utf-8`,charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:`&`,depth:5,duplicates:`combine`,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,n){if(e&&typeof e==`string`&&t.comma&&e.indexOf(`,`)>-1)return e.split(`,`);if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);return e},c=`utf8=%26%2310003%3B`,l=`utf8=%E2%9C%93`,u=function(e,t){var u={__proto__:null},d=t.ignoreQueryPrefix?e.replace(/^\?/,``):e;d=d.replace(/%5B/gi,`[`).replace(/%5D/gi,`]`);var f=t.parameterLimit===1/0?void 0:t.parameterLimit,p=d.split(t.delimiter,t.throwOnLimitExceeded?f+1:f);if(t.throwOnLimitExceeded&&p.length>f)throw RangeError(`Parameter limit exceeded. Only `+f+` parameter`+(f===1?``:`s`)+` allowed.`);var m=-1,h,g=t.charset;if(t.charsetSentinel)for(h=0;h<p.length;++h)p[h].indexOf(`utf8=`)===0&&(p[h]===l?g=`utf-8`:p[h]===c&&(g=`iso-8859-1`),m=h,h=p.length);for(h=0;h<p.length;++h)if(h!==m){var _=p[h],v=_.indexOf(`]=`),y=v===-1?_.indexOf(`=`):v+1,b,x;if(y===-1?(b=t.decoder(_,a.decoder,g,`key`),x=t.strictNullHandling?null:``):(b=t.decoder(_.slice(0,y),a.decoder,g,`key`),b!==null&&(x=n.maybeMap(s(_.slice(y+1),t,i(u[b])?u[b].length:0),function(e){return t.decoder(e,a.decoder,g,`value`)}))),x&&t.interpretNumericEntities&&g===`iso-8859-1`&&(x=o(String(x))),_.indexOf(`[]=`)>-1&&(x=i(x)?[x]:x),t.comma&&i(x)&&x.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+t.arrayLimit+` element`+(t.arrayLimit===1?``:`s`)+` allowed in an array.`);x=n.combine([],x,t.arrayLimit,t.plainObjects)}if(b!==null){var S=r.call(u,b);S&&(t.duplicates===`combine`||_.indexOf(`[]=`)>-1)?u[b]=n.combine(u[b],x,t.arrayLimit,t.plainObjects):(!S||t.duplicates===`last`)&&(u[b]=x)}}return u},d=function(e,t,r,i){var a=0;if(e.length>0&&e[e.length-1]===`[]`){var o=e.slice(0,-1).join(``);a=Array.isArray(t)&&t[o]?t[o].length:0}for(var c=i?t:s(t,r,a),l=e.length-1;l>=0;--l){var u,d=e[l];if(d===`[]`&&r.parseArrays)u=n.isOverflow(c)?c:r.allowEmptyArrays&&(c===``||r.strictNullHandling&&c===null)?[]:n.combine([],c,r.arrayLimit,r.plainObjects);else{u=r.plainObjects?{__proto__:null}:{};var f=d.charAt(0)===`[`&&d.charAt(d.length-1)===`]`?d.slice(1,-1):d,p=r.decodeDotInKeys?f.replace(/%2E/g,`.`):f,m=parseInt(p,10),h=!isNaN(m)&&d!==p&&String(m)===p&&m>=0&&r.parseArrays;if(!r.parseArrays&&p===``)u={0:c};else if(h&&m<r.arrayLimit)u=[],u[m]=c;else if(h&&r.throwOnLimitExceeded)throw RangeError(`Array limit exceeded. Only `+r.arrayLimit+` element`+(r.arrayLimit===1?``:`s`)+` allowed in an array.`);else h?(u[m]=c,n.markOverflow(u,m)):p!==`__proto__`&&(u[p]=c)}c=u}return c},f=function(e,t){var n=t.allowDots?e.replace(/\.([^.[]+)/g,`[$1]`):e;if(t.depth<=0)return!t.plainObjects&&r.call(Object.prototype,n)&&!t.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,o=i.exec(n),s=o?n.slice(0,o.index):n,c=[];if(s){if(!t.plainObjects&&r.call(Object.prototype,s)&&!t.allowPrototypes)return;c[c.length]=s}for(var l=0;(o=a.exec(n))!==null&&l<t.depth;){l+=1;var u=o[1].slice(1,-1);if(!t.plainObjects&&r.call(Object.prototype,u)&&!t.allowPrototypes)return;c[c.length]=o[1]}if(o){if(t.strictDepth===!0)throw RangeError(`Input depth exceeded depth option of `+t.depth+` and strictDepth is true`);c[c.length]=`[`+n.slice(o.index)+`]`}return c},p=function(e,t,n,r){if(e){var i=f(e,n);if(i)return d(i,t,n,r)}},m=function(e){if(!e)return a;if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.decodeDotInKeys!==void 0&&typeof e.decodeDotInKeys!=`boolean`)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!=`function`)throw TypeError(`Decoder has to be a function.`);if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);if(e.throwOnLimitExceeded!==void 0&&typeof e.throwOnLimitExceeded!=`boolean`)throw TypeError("`throwOnLimitExceeded` option must be a boolean");var t=e.charset===void 0?a.charset:e.charset,r=e.duplicates===void 0?a.duplicates:e.duplicates;if(r!==`combine`&&r!==`first`&&r!==`last`)throw TypeError(`The duplicates option must be either combine, first, or last`);return{allowDots:e.allowDots===void 0?e.decodeDotInKeys===!0?!0:a.allowDots:!!e.allowDots,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes==`boolean`?e.allowPrototypes:a.allowPrototypes,allowSparse:typeof e.allowSparse==`boolean`?e.allowSparse:a.allowSparse,arrayLimit:typeof e.arrayLimit==`number`?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:a.charsetSentinel,comma:typeof e.comma==`boolean`?e.comma:a.comma,decodeDotInKeys:typeof e.decodeDotInKeys==`boolean`?e.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof e.decoder==`function`?e.decoder:a.decoder,delimiter:typeof e.delimiter==`string`||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:typeof e.depth==`number`||e.depth===!1?+e.depth:a.depth,duplicates:r,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities==`boolean`?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==`number`?e.parameterLimit:a.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects==`boolean`?e.plainObjects:a.plainObjects,strictDepth:typeof e.strictDepth==`boolean`?!!e.strictDepth:a.strictDepth,strictMerge:typeof e.strictMerge==`boolean`?!!e.strictMerge:a.strictMerge,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded==`boolean`?e.throwOnLimitExceeded:!1}};t.exports=function(e,t){var r=m(t);if(e===``||e==null)return r.plainObjects?{__proto__:null}:{};for(var i=typeof e==`string`?u(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var c=o[s],l=p(c,i[c],r,typeof e==`string`);a=n.merge(a,l,r)}return r.allowSparse===!0?a:n.compact(a)}})),k=n(((e,t)=>{var n=Ce(),r=we();t.exports={formats:O(),parse:r,stringify:n}}));function Te(e,t){return function(){return e.apply(t,arguments)}}var{toString:Ee}=Object.prototype,{getPrototypeOf:De}=Object,{iterator:Oe,toStringTag:ke}=Symbol,Ae=(e=>t=>{let n=Ee.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),A=e=>(e=e.toLowerCase(),t=>Ae(t)===e),je=e=>t=>typeof t===e,{isArray:Me}=Array,Ne=je(`undefined`);function j(e){return e!==null&&!Ne(e)&&e.constructor!==null&&!Ne(e.constructor)&&M(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Pe=A(`ArrayBuffer`);function Fe(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Pe(e.buffer),t}var Ie=je(`string`),M=je(`function`),Le=je(`number`),Re=e=>typeof e==`object`&&!!e,ze=e=>e===!0||e===!1,Be=e=>{if(Ae(e)!==`object`)return!1;let t=De(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ke in e)&&!(Oe in e)},Ve=e=>{if(!Re(e)||j(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},He=A(`Date`),Ue=A(`File`),We=e=>!!(e&&e.uri!==void 0),Ge=e=>e&&e.getParts!==void 0,Ke=A(`Blob`),qe=A(`FileList`),Je=e=>Re(e)&&M(e.pipe);function Ye(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var Xe=Ye(),Ze=Xe.FormData===void 0?void 0:Xe.FormData,Qe=e=>{let t;return e&&(Ze&&e instanceof Ze||M(e.append)&&((t=Ae(e))===`formdata`||t===`object`&&M(e.toString)&&e.toString()===`[object FormData]`))},$e=A(`URLSearchParams`),[et,tt,nt,rt]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(A),it=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function at(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),Me(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(j(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function ot(e,t){if(j(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}var st=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,ct=e=>!Ne(e)&&e!==st;function lt(){let{caseless:e,skipUndefined:t}=ct(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&ot(n,i)||i;Be(n[a])&&Be(r)?n[a]=lt(n[a],r):Be(r)?n[a]=lt({},r):Me(r)?n[a]=r.slice():(!t||!Ne(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&at(arguments[e],r);return n}var ut=(e,t,n,{allOwnKeys:r}={})=>(at(t,(t,r)=>{n&&M(t)?Object.defineProperty(e,r,{value:Te(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),dt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ft=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},pt=(e,t,n,r)=>{let i,a,o,s={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&De(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},mt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},ht=e=>{if(!e)return null;if(Me(e))return e;let t=e.length;if(!Le(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},gt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&De(Uint8Array)),_t=(e,t)=>{let n=(e&&e[Oe]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},vt=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yt=A(`HTMLFormElement`),bt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),xt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),St=A(`RegExp`),Ct=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};at(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},wt=e=>{Ct(e,(t,n)=>{if(M(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(M(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Tt=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Me(e)?r(e):r(String(e).split(t)),n},Et=()=>{},Dt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ot(e){return!!(e&&M(e.append)&&e[ke]===`FormData`&&e[Oe])}var kt=e=>{let t=Array(10),n=(e,r)=>{if(Re(e)){if(t.indexOf(e)>=0)return;if(j(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=Me(e)?[]:{};return at(e,(e,t)=>{let a=n(e,r+1);!Ne(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},At=A(`AsyncFunction`),jt=e=>e&&(Re(e)||M(e))&&M(e.then)&&M(e.catch),Mt=((e,t)=>e?setImmediate:t?((e,t)=>(st.addEventListener(`message`,({source:n,data:r})=>{n===st&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),st.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,M(st.postMessage)),N={isArray:Me,isArrayBuffer:Pe,isBuffer:j,isFormData:Qe,isArrayBufferView:Fe,isString:Ie,isNumber:Le,isBoolean:ze,isObject:Re,isPlainObject:Be,isEmptyObject:Ve,isReadableStream:et,isRequest:tt,isResponse:nt,isHeaders:rt,isUndefined:Ne,isDate:He,isFile:Ue,isReactNativeBlob:We,isReactNative:Ge,isBlob:Ke,isRegExp:St,isFunction:M,isStream:Je,isURLSearchParams:$e,isTypedArray:gt,isFileList:qe,forEach:at,merge:lt,extend:ut,trim:it,stripBOM:dt,inherits:ft,toFlatObject:pt,kindOf:Ae,kindOfTest:A,endsWith:mt,toArray:ht,forEachEntry:_t,matchAll:vt,isHTMLForm:yt,hasOwnProperty:xt,hasOwnProp:xt,reduceDescriptors:Ct,freezeMethods:wt,toObjectSet:Tt,toCamelCase:bt,noop:Et,toFiniteNumber:Dt,findKey:ot,global:st,isContextDefined:ct,isSpecCompliantForm:Ot,toJSONObject:kt,isAsyncFn:At,isThenable:jt,setImmediate:Mt,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(st):typeof process<`u`&&process.nextTick||Mt,isIterable:e=>e!=null&&M(e[Oe])},P=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.status}}};P.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,P.ERR_BAD_OPTION=`ERR_BAD_OPTION`,P.ECONNABORTED=`ECONNABORTED`,P.ETIMEDOUT=`ETIMEDOUT`,P.ERR_NETWORK=`ERR_NETWORK`,P.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,P.ERR_DEPRECATED=`ERR_DEPRECATED`,P.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,P.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,P.ERR_CANCELED=`ERR_CANCELED`,P.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,P.ERR_INVALID_URL=`ERR_INVALID_URL`;function Nt(e){return N.isPlainObject(e)||N.isArray(e)}function Pt(e){return N.endsWith(e,`[]`)?e.slice(0,-2):e}function Ft(e,t,n){return e?e.concat(t).map(function(e,t){return e=Pt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function It(e){return N.isArray(e)&&!e.some(Nt)}var Lt=N.toFlatObject(N,{},null,function(e){return/^is[A-Z]/.test(e)});function Rt(e,t,n){if(!N.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=N.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!N.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if(N.isDate(e))return e.toISOString();if(N.isBoolean(e))return e.toString();if(!s&&N.isBlob(e))throw new P(`Blob is not supported. Use a Buffer instead.`);return N.isArrayBuffer(e)||N.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(N.isReactNative(t)&&N.isReactNativeBlob(e))return t.append(Ft(i,n,a),c(e)),!1;if(e&&!i&&typeof e==`object`){if(N.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(N.isArray(e)&&It(e)||(N.isFileList(e)||N.endsWith(n,`[]`))&&(s=N.toArray(e)))return n=Pt(n),s.forEach(function(e,r){!(N.isUndefined(e)||e===null)&&t.append(o===!0?Ft([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return Nt(e)?!0:(t.append(Ft(i,n,a),c(e)),!1)}let u=[],d=Object.assign(Lt,{defaultVisitor:l,convertValue:c,isVisitable:Nt});function f(e,n){if(!N.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),N.forEach(e,function(e,r){(!(N.isUndefined(e)||e===null)&&i.call(t,e,N.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!N.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function zt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function Bt(e,t){this._pairs=[],e&&Rt(e,this,t)}var Vt=Bt.prototype;Vt.append=function(e,t){this._pairs.push([e,t])},Vt.toString=function(e){let t=e?function(t){return e.call(this,t,zt)}:zt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Ut(e,t,n){if(!t)return e;let r=n&&n.encode||Ht,i=N.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):N.isURLSearchParams(t)?t.toString():new Bt(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Wt=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){N.forEach(this.handlers,function(t){t!==null&&e(t)})}},Gt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Kt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Bt,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},qt=e({hasBrowserEnv:()=>Jt,hasStandardBrowserEnv:()=>Xt,hasStandardBrowserWebWorkerEnv:()=>Zt,navigator:()=>Yt,origin:()=>Qt}),Jt=typeof window<`u`&&typeof document<`u`,Yt=typeof navigator==`object`&&navigator||void 0,Xt=Jt&&(!Yt||[`ReactNative`,`NativeScript`,`NS`].indexOf(Yt.product)<0),Zt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Qt=Jt&&window.location.href||`http://localhost`,F={...qt,...Kt};function $t(e,t){return Rt(e,new F.classes.URLSearchParams,{visitor:function(e,t,n,r){return F.isNode&&N.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function en(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function tn(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function nn(e){function t(e,n,r,i){let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&N.isArray(r)?r.length:a,s?(N.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!N.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&N.isArray(r[a])&&(r[a]=tn(r[a])),!o)}if(N.isFormData(e)&&N.isFunction(e.entries)){let n={};return N.forEachEntry(e,(e,r)=>{t(en(e),r,n,0)}),n}return null}function rn(e,t,n){if(N.isString(e))try{return(t||JSON.parse)(e),N.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var an={transitional:Gt,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=N.isObject(e);if(i&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return r?JSON.stringify(nn(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)||N.isReadableStream(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return $t(e,this.formSerializer).toString();if((a=N.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return Rt(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),rn(e)):e}],transformResponse:[function(e){let t=this.transitional||an.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(N.isResponse(e)||N.isReadableStream(e))return e;if(e&&N.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?P.from(e,P.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};N.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{an.headers[e]={}});var on=N.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),sn=e=>{let t={},n,r,i;return e&&e.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{v as t}from"./vendor-tanstack-DRPs09ai.js";import{i as n,r}from"./vendor-react-DH4kUfK2.js";import{a as i,o as a}from"./services.generated-B5lc3aIC.js";import{s as o}from"./index-C96h3feE.js";import{t as s}from"./use-update-token-mutation-qKBC2sn7.js";import{t as c}from"./plus-BsQdY7PS.js";var l=e(n()),u=r(),d=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0`}),(0,u.jsx)(`circle`,{cx:12,cy:12,r:3})]})}),f=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,children:[(0,u.jsx)(`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242`}),(0,u.jsx)(`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20`})]})}),p=e=>(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`,...e,children:(0,u.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 12h14`})}),m=new Map([[`qgrid`,`Qgrid`],[`slack`,`Slack 알림`],[`slackConnection`,`Slack 연결`]]);function h(e){return e?e.length<=12?`•`.repeat(e.length):`${e.slice(0,8)}${`•`.repeat(12)}${e.slice(-4)}`:``}function g({value:e,min:t,max:n,step:r,disabled:i,onChange:a}){let o=Number(e),s=Number.isFinite(o),l=t??-1/0,d=n??1/0,f=e=>{let n=Math.min(Math.max((s?o:t??0)+e,l),d);a(String(Number(n.toFixed(2))))};return(0,u.jsxs)(`div`,{className:`inline-flex items-center rounded-lg border border-sand-200/80 bg-white overflow-hidden`,children:[(0,u.jsx)(`button`,{type:`button`,"aria-label":`감소`,onClick:()=>f(-r),disabled:i||s&&o<=l,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(p,{className:`size-3`})}),(0,u.jsx)(`input`,{value:e,onChange:e=>a(e.target.value),disabled:i,inputMode:`decimal`,className:`w-12 text-center text-[12px] tabular-nums text-sand-800 bg-transparent border-x border-sand-200/80 py-1 focus:outline-none focus:bg-sand-50`}),(0,u.jsx)(`button`,{type:`button`,"aria-label":`증가`,onClick:()=>f(r),disabled:i||s&&o>=d,className:`size-7 grid place-items-center text-sand-500 hover:bg-sand-100 disabled:opacity-30 disabled:hover:bg-transparent transition-colors duration-150`,children:(0,u.jsx)(c,{className:`size-3`})})]})}function _({value:e,presets:t,disabled:n,onChange:r}){let i=Number(e);return(0,u.jsx)(`div`,{className:`segmented-control inline-flex`,children:t.map(e=>(0,u.jsx)(`button`,{type:`button`,disabled:n,"data-active":i===e,onClick:()=>r(String(e)),className:`rounded-[6px] px-2.5 py-1 text-[11px] font-medium tabular-nums text-sand-500 transition-colors hover:text-sand-800 disabled:opacity-50 data-[active=true]:text-sand-900`,children:e>=60?`${e/60}시간`:`${e}분`},e))})}function v({source:e}){return(0,u.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded ${e===`db`?`bg-sienna-50 text-sienna-600`:`bg-sand-100 text-sand-500`}`,children:e===`db`?`저장값`:e===`env`?`환경변수`:`기본값`})}function y({on:e,disabled:t,onChange:n}){return(0,u.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:t,onClick:()=>n(!e),className:`relative inline-flex h-5 w-9 shrink-0 items-center rounded-full transition-colors duration-200 disabled:opacity-50 ${e?`bg-sage-400`:`bg-sand-300`}`,children:(0,u.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${e?`translate-x-4.5`:`translate-x-0.5`}`})})}function b({item:e,disabled:n=!1}){let[r,a]=(0,l.useState)(null),[s,c]=(0,l.useState)(!1),[p,m]=(0,l.useState)(null),b=t(),x=i.useUpdateSettingMutation(),S=i.useResetSettingMutation(),C=n||x.isPending||S.isPending,w=r??e.value,T=r!==null&&r!==e.value,E=()=>b.invalidateQueries({queryKey:i.getSettingListQueryOptions().queryKey}),D=async t=>{m(null);try{await x.mutateAsync({key:e.key,value:t}),await E(),a(null)}catch(e){m(e instanceof Error?e.message:String(e))}},O=async()=>{m(null);try{await S.mutateAsync({key:e.key}),await E(),a(null)}catch(e){m(e instanceof Error?e.message:String(e))}},k=e.kind===`secret`;return(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,u.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(`span`,{className:`text-[13px] text-sand-800`,children:e.label}),(0,u.jsx)(v,{source:e.source}),e.applies===`restart`&&(0,u.jsx)(`span`,{className:`text-[10px] text-caution-500`,title:`저장해도 다음 재시작부터 반영됩니다`,children:`재시작 필요`})]}),e.help&&(0,u.jsx)(`p`,{className:`mt-0.5 text-[11px] text-sand-500`,children:e.help})]}),(0,u.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[e.kind===`boolean`&&(0,u.jsx)(y,{on:w===`true`,disabled:C,onChange:e=>void D(String(e))}),e.kind===`preset`&&(0,u.jsx)(_,{value:w,presets:e.presets,disabled:C,onChange:e=>void D(e)}),(e.kind===`integer`||e.kind===`number`)&&(0,u.jsx)(g,{value:w,min:e.min,max:e.max,step:e.kind===`integer`?1:.5,disabled:C,onChange:a}),(e.kind===`string`||k)&&(0,u.jsxs)(`div`,{className:`relative`,children:[(0,u.jsx)(`input`,{value:k&&!s?h(w):w,onChange:e=>a(e.target.value),onFocus:()=>k&&c(!0),disabled:C,className:`w-48 sm:w-64 rounded-lg border border-sand-200/80 bg-white py-1.5 pl-2.5 text-[12px] text-sand-800 focus:outline-none focus:border-sienna-300 ${k?`pr-8 font-mono`:`pr-2.5`}`}),k&&(0,u.jsx)(`button`,{type:`button`,"aria-label":s?`값 숨기기`:`값 보기`,onClick:()=>c(e=>!e),className:`absolute right-1.5 top-1/2 -translate-y-1/2 size-6 grid place-items-center text-sand-400 hover:text-sand-600 transition-colors duration-150`,children:s?(0,u.jsx)(f,{className:`size-3.5`}):(0,u.jsx)(d,{className:`size-3.5`})})]}),T&&(0,u.jsx)(`button`,{type:`button`,onClick:()=>void D(w),disabled:C,className:`px-2.5 py-1.5 text-[11px] font-medium rounded-lg bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150`,children:x.isPending?`저장 중`:`저장`}),!T&&e.source===`db`&&(0,u.jsx)(`button`,{type:`button`,title:`저장값을 지웁니다 — 환경변수 또는 기본값으로 돌아갑니다`,onClick:()=>void O(),disabled:C,className:`size-7 grid place-items-center rounded-lg text-sand-400 hover:text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:(0,u.jsx)(o,{className:`size-3.5`})})]})]}),p&&(0,u.jsx)(`p`,{className:`mt-1.5 text-[11px] text-red-500`,children:p})]})}function x({runnerEnabled:e}){let n=t(),[r,i]=(0,l.useState)(null),o=a.useTokens(`A`,{orderBy:`ord-asc`,num:100}),c=s(),d=(o.data?.rows??[]).filter(e=>e.provider===`anthropic`),f=async(e,t)=>{i(null);try{await c.mutateAsync({id:e,keepaliveEnabled:t}),await n.invalidateQueries({queryKey:[`Token`,`getTokens`]})}catch(e){i(e instanceof Error?e.message:String(e))}};return(0,u.jsxs)(`div`,{className:`border-t border-sand-100/80 bg-sand-50/40 px-4 py-3 sm:px-5`,children:[(0,u.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`p`,{className:`text-[11px] font-medium text-sand-600`,children:`토큰별 keepalive`}),(0,u.jsx)(`p`,{className:`mt-0.5 text-[10px] text-sand-400`,children:e?`켜진 활성 Anthropic 토큰만 5시간 윈도우를 유지합니다`:`이 인스턴스는 keepalive runner로 지정되지 않았습니다`})]}),(0,u.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] ${e?`bg-sage-50 text-sage-600`:`bg-sand-100 text-sand-500`}`,children:e?`runner`:`실행 안 함`})]}),o.isLoading?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`토큰을 불러오는 중…`}):d.length===0?(0,u.jsx)(`p`,{className:`py-2 text-[11px] text-sand-400`,children:`등록된 Anthropic 토큰이 없습니다`}):(0,u.jsx)(`div`,{className:`overflow-hidden rounded-lg border border-sand-200/70 bg-white`,children:d.map(t=>(0,u.jsxs)(`div`,{className:`flex items-center justify-between gap-4 border-b border-sand-100/80 px-3 py-2 last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`min-w-0`,children:[(0,u.jsx)(`span`,{className:`block truncate text-[12px] text-sand-700`,children:t.name}),!t.active&&(0,u.jsx)(`span`,{className:`text-[10px] text-sand-400`,children:`토큰 비활성`})]}),(0,u.jsx)(y,{on:t.keepalive_enabled,disabled:!e||c.isPending,onChange:e=>void f(t.id,e)})]},t.id))}),r&&(0,u.jsx)(`p`,{className:`mt-2 text-[11px] text-red-500`,children:r})]})}function S(){let[e,t]=(0,l.useState)(null),n=i.useTriggerExpiryReminderMutation(),r=async()=>{t(null);try{let{sent:e}=await n.mutateAsync();t(e===0?`재로그인이 필요한 토큰이 없습니다`:`${e}건 발송`)}catch(e){t(e instanceof Error?e.message:String(e))}};return(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e&&(0,u.jsx)(`span`,{className:`text-[11px] text-sand-500`,children:e}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void r(),disabled:n.isPending,className:`px-2 py-1 text-[11px] rounded-lg border border-sand-200/80 text-sand-600 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150`,children:n.isPending?`보내는 중`:`지금 보내기`})]})}function C(){let e=i.useSettingList(),{data:t,isLoading:n}=e;if(n)return(0,u.jsx)(`div`,{className:`space-y-4`,children:[0,1].map(e=>(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsx)(`div`,{className:`panel-header px-4 py-2.5 sm:px-5`,children:(0,u.jsx)(`div`,{className:`h-3 w-24 rounded bg-sand-200 animate-pulse`})}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:[0,1,2].map(e=>(0,u.jsxs)(`div`,{className:`px-4 py-3 sm:px-5 flex items-center justify-between gap-4`,children:[(0,u.jsx)(`div`,{className:`h-3 w-40 rounded bg-sand-100 animate-pulse`}),(0,u.jsx)(`div`,{className:`h-7 w-24 rounded-lg bg-sand-100 animate-pulse`})]},e))})]},e))});if(e.isError&&!t)return(0,u.jsxs)(`div`,{className:`panel px-5 py-6 text-center`,children:[(0,u.jsx)(`p`,{className:`text-[13px] font-medium text-sand-800`,children:`설정을 불러오지 못했습니다`}),(0,u.jsx)(`p`,{className:`mt-1 text-[11px] text-red-500`,children:e.error.message}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>void e.refetch(),disabled:e.isFetching,className:`mt-3 px-3 py-1.5 text-[12px] rounded-lg border border-sand-200 text-sand-600 hover:bg-sand-100 disabled:opacity-50`,children:e.isFetching?`다시 불러오는 중`:`다시 시도`})]});let r=t?.settings??[],a=t?.runtime??[],o=[...new Set(r.map(e=>e.group))];return(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:`환경`}),(0,u.jsx)(`span`,{className:`text-[11px] text-sand-400`,children:`기동 시점 값`})]}),(0,u.jsx)(`dl`,{className:`px-4 py-3 sm:px-5 grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5`,children:a.map(e=>(0,u.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 min-w-0`,children:[(0,u.jsx)(`dt`,{className:`text-[11px] text-sand-500 shrink-0`,children:e.label}),(0,u.jsx)(`dd`,{className:`text-[12px] font-mono text-sand-700 truncate`,children:e.value})]},e.label))})]}),o.map(e=>{let n=r.filter(t=>t.group===e);return(0,u.jsxs)(`div`,{className:`panel overflow-hidden`,children:[(0,u.jsxs)(`div`,{className:`panel-header flex items-center justify-between px-4 py-2.5 sm:px-5`,children:[(0,u.jsx)(`span`,{className:`text-[13px] font-medium text-sand-700`,children:m.get(e)??e}),e===`slack`&&(0,u.jsx)(S,{})]}),(0,u.jsx)(`div`,{className:`divide-y divide-sand-100/80`,children:n.map(e=>(0,u.jsxs)(`div`,{children:[(0,u.jsx)(b,{item:e,disabled:e.key===`qgrid.tokenWindowKeepaliveEnabled`&&!t?.keepaliveRunnerEnabled}),e.key===`qgrid.tokenWindowKeepaliveEnabled`&&(0,u.jsx)(x,{runnerEnabled:t?.keepaliveRunnerEnabled??!1})]},e.key))})]},e)})]})}function w(){return(0,u.jsx)(`div`,{className:`max-w-4xl mx-auto`,children:(0,u.jsx)(C,{})})}export{w as component};
|