@ironmussa/funny 0.1.8 → 0.1.9
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/package.json +1 -1
- package/packages/client/dist/assets/{AcceptInvitePage-rU3bsShb.js → AcceptInvitePage-D13hs9Zr.js} +1 -1
- package/packages/client/dist/assets/{ActivityPane-_esdCTUa.js → ActivityPane-CtxWrqSm.js} +1 -1
- package/packages/client/dist/assets/{AddProjectView-DbYb4Fj3.js → AddProjectView-BrSbq9Zq.js} +1 -1
- package/packages/client/dist/assets/{AllThreadsView-BydYhYmA.js → AllThreadsView-DVZkf_3a.js} +1 -1
- package/packages/client/dist/assets/{AnalyticsView-BB2Ry67l.js → AnalyticsView-DudiSHyr.js} +1 -1
- package/packages/client/dist/assets/{App-DUg9Ibif.js → App-BkudlgY9.js} +3 -3
- package/packages/client/dist/assets/{AutomationInboxView-BwTXxoaj.js → AutomationInboxView-B20N9Rzu.js} +1 -1
- package/packages/client/dist/assets/{BrowserPanel-DQ8qgIKh.js → BrowserPanel-Dz4qr3zh.js} +1 -1
- package/packages/client/dist/assets/{BrowserPreview-CYbez9uL.js → BrowserPreview-CKJfq_nE.js} +1 -1
- package/packages/client/dist/assets/{CircuitBreakerDialog-DWNXYG6L.js → CircuitBreakerDialog-CIYWhLBH.js} +1 -1
- package/packages/client/dist/assets/{CommandPalette-Xtu8FVFI.js → CommandPalette-BWdGw1dT.js} +1 -1
- package/packages/client/dist/assets/{CommentsPane-BbeD18iG.js → CommentsPane-Cq3KSPeq.js} +1 -1
- package/packages/client/dist/assets/{CsvTable-CRwHp6ct.js → CsvTable-Y1HjLh1s.js} +1 -1
- package/packages/client/dist/assets/{FileSearchDialog-BHaSfVdS.js → FileSearchDialog-3mjmh0eF.js} +1 -1
- package/packages/client/dist/assets/{FileTree-Dnh5srh4.js → FileTree-mnY0OIfR.js} +1 -1
- package/packages/client/dist/assets/{FolderPicker-BBAhdFeF.js → FolderPicker-DlzSNNoW.js} +1 -1
- package/packages/client/dist/assets/{GeneralSettingsView-Q-zEISEg.js → GeneralSettingsView-CxS_XI8Z.js} +2 -2
- package/packages/client/dist/assets/{GitProgressModal-2BUdcYw_.js → GitProgressModal-D-h3ocu1.js} +1 -1
- package/packages/client/dist/assets/{LiveColumnsView-CWo09zTG.js → LiveColumnsView-BGRek-gh.js} +1 -1
- package/packages/client/dist/assets/{LoginPage-BPM6y1Yj.js → LoginPage-DATO3dWs.js} +1 -1
- package/packages/client/dist/assets/{MediaPreview-JO18IhtD.js → MediaPreview-Dnzd03yo.js} +1 -1
- package/packages/client/dist/assets/{MediaPreviewDialog-HOtpKIQD.js → MediaPreviewDialog-Dm1nhBR9.js} +1 -1
- package/packages/client/dist/assets/{MermaidBlock-DxJPnpCS.js → MermaidBlock-DeQ02Wb_.js} +1 -1
- package/packages/client/dist/assets/{MobilePage-B9LixzUJ.js → MobilePage-B_-4EwLh.js} +2 -2
- package/packages/client/dist/assets/{MonacoEditorDialog-BGuOUdlF.js → MonacoEditorDialog-DtBfzOtQ.js} +1 -1
- package/packages/client/dist/assets/{OrchestratorView-BiNJtR8P.js → OrchestratorView-CIthX7Z9.js} +1 -1
- package/packages/client/dist/assets/{PreferencesPanel-DEJ3B3Mx.js → PreferencesPanel-UKXVNtTZ.js} +1 -1
- package/packages/client/dist/assets/{PreviewBrowser-pI5xiPAQ.js → PreviewBrowser-Dm_Aqtps.js} +1 -1
- package/packages/client/dist/assets/{ProjectFilesPane-H9zl1XxW.js → ProjectFilesPane-B59Vq3_s.js} +1 -1
- package/packages/client/dist/assets/{ProjectHeader-CewLbcv6.js → ProjectHeader-Qf_M_sBm.js} +1 -1
- package/packages/client/dist/assets/{ProjectHooksSettings-Dz9pRWek.js → ProjectHooksSettings-D23PXt7X.js} +1 -1
- package/packages/client/dist/assets/{ReviewPane-CdspHwl1.js → ReviewPane-DEY-F3Zq.js} +1 -1
- package/packages/client/dist/assets/{SearchablePicker-BlagKlJZ.js → SearchablePicker-BQEWhSu4.js} +1 -1
- package/packages/client/dist/assets/{SettingsDetailView-DdyYDZde.js → SettingsDetailView-CyaMNfi4.js} +1 -1
- package/packages/client/dist/assets/{SettingsPageContent-ChL9gIzA.js → SettingsPageContent-BMPAc4uQ.js} +3 -3
- package/packages/client/dist/assets/{SetupWizard-B3KuWJkX.js → SetupWizard-8eO2SYvf.js} +1 -1
- package/packages/client/dist/assets/{Sidebar-Cp0Ic-cc.js → Sidebar-CDKV9zDp.js} +1 -1
- package/packages/client/dist/assets/{StashTab-CAqDgV-y.js → StashTab-KG5Zzy5-.js} +1 -1
- package/packages/client/dist/assets/{TestRunnerPane-RwW_FDpa.js → TestRunnerPane-C_gSYI4_.js} +1 -1
- package/packages/client/dist/assets/{TextSearchDialog-Q9Pvzolm.js → TextSearchDialog-CX5B9hyW.js} +1 -1
- package/packages/client/dist/assets/{ThreadPowerline-DVWTyxRC.js → ThreadPowerline-DGdjong-.js} +1 -1
- package/packages/client/dist/assets/{ThreadStatusPin-CsUuwM1e.js → ThreadStatusPin-Bmauv5AI.js} +1 -1
- package/packages/client/dist/assets/{ThreadView-PbhTHc_b.js → ThreadView-BvizmCnl.js} +1 -1
- package/packages/client/dist/assets/{app-store-DjqdXPml.js → app-store-CSYr64U4.js} +1 -1
- package/packages/client/dist/assets/{automation-store-CN7G1rmj.js → automation-store-er1E9xPe.js} +1 -1
- package/packages/client/dist/assets/{browser-panel-store-BrY0M-3u.js → browser-panel-store-BriXQezL.js} +2 -2
- package/packages/client/dist/assets/{button-DqIT3IPY.js → button-Bd970BE2.js} +1 -1
- package/packages/client/dist/assets/{combine-DMf_Pe7m.js → combine-Um6l0bxC.js} +1 -1
- package/packages/client/dist/assets/{comment-store-BLJA7qy5.js → comment-store-B4-PYjwU.js} +1 -1
- package/packages/client/dist/assets/{diff-parse-DoxsYsvR.js → diff-parse-dnfUXHzR.js} +1 -1
- package/packages/client/dist/assets/{element-CWNkjFyh.js → element-DW-xqM5t.js} +1 -1
- package/packages/client/dist/assets/{go-to-thread-1QCGvOr9.js → go-to-thread-F_voqQgr.js} +1 -1
- package/packages/client/dist/assets/{index-CmX0PQ41.js → index-ea63jMuV.js} +2 -2
- package/packages/client/dist/assets/{input-Bi-kCBn4.js → input-CcrOgEwd.js} +1 -1
- package/packages/client/dist/assets/{items-z89mbR0g.js → items-iRGH_xTR.js} +1 -1
- package/packages/client/dist/assets/{job-store-C6L3TZ6m.js → job-store-CaOITASA.js} +1 -1
- package/packages/client/dist/assets/{kbd-CYltzHK-.js → kbd-HqsH-rnU.js} +1 -1
- package/packages/client/dist/assets/{loading-state-CuNSmah_.js → loading-state-BSdX_QZB.js} +1 -1
- package/packages/client/dist/assets/{markdown-components-CDAAlOfJ.js → markdown-components-DXE4xITV.js} +1 -1
- package/packages/client/dist/assets/{native-git-store-BRK3QIOm.js → native-git-store-B4G1m25Q.js} +1 -1
- package/packages/client/dist/assets/{orchestrator-store-CpN46D7d.js → orchestrator-store-CRIf-E8M.js} +1 -1
- package/packages/client/dist/assets/{pipeline-approval-store-L_CnXcgU.js → pipeline-approval-store-Sm4xCBYI.js} +1 -1
- package/packages/client/dist/assets/{pr-detail-store-9Jf4dkle.js → pr-detail-store-DIz8x882.js} +1 -1
- package/packages/client/dist/assets/{providers-CDWMbzb0.js → providers-B6JAFGOv.js} +1 -1
- package/packages/client/dist/assets/{sidebar-thesisNh.js → sidebar-D5gUIY0G.js} +1 -1
- package/packages/client/dist/assets/{tabs-D2Tzh6Ge.js → tabs-Bx4u8bcz.js} +1 -1
- package/packages/client/dist/assets/{test-store-BIzIn_1p.js → test-store-D4S9R398.js} +1 -1
- package/packages/client/dist/assets/{tooltip-icon-button-pAxgBlHP.js → tooltip-icon-button-C1xTZR5-.js} +1 -1
- package/packages/client/dist/assets/use-active-thread-id-1WUch4uf.js +1 -0
- package/packages/client/dist/assets/{use-branch-switch-Z5J9CKxB.js → use-branch-switch-CFzzWMNs.js} +1 -1
- package/packages/client/dist/assets/{use-image-lightbox-Bu7huixI.js → use-image-lightbox-DgkrBc3N.js} +1 -1
- package/packages/client/dist/assets/{use-stable-navigate-D0phYEEB.js → use-stable-navigate-U6VQ7K0f.js} +1 -1
- package/packages/client/dist/assets/{use-terminal-scope-CWqnHWM0.js → use-terminal-scope-BvFrkm0r.js} +1 -1
- package/packages/client/dist/assets/{use-thread-creation-d4X0pWGi.js → use-thread-creation-CdjjkhNZ.js} +1 -1
- package/packages/client/dist/assets/{use-thread-search-BGPGuqA-.js → use-thread-search-CXgC1XEY.js} +1 -1
- package/packages/client/dist/assets/{use-todo-panel-Dh6mAnT6.js → use-todo-panel-BAbS_SpL.js} +1 -1
- package/packages/client/dist/assets/{use-unified-prompt-model-groups-DK1DksUz.js → use-unified-prompt-model-groups-DH94Yhir.js} +1 -1
- package/packages/client/dist/assets/{use-ws-Dne_mRf6.js → use-ws-DfaWLbd3.js} +3 -3
- package/packages/client/dist/assets/{visualizer-loader-Di5LNXnx.js → visualizer-loader-BnEPAAGw.js} +1 -1
- package/packages/client/dist/assets/{watcher-store-CwGkvZwT.js → watcher-store-DKHnSlTd.js} +1 -1
- package/packages/client/dist/index.html +1 -1
- package/packages/runtime/dist/index.js +2 -2
- package/packages/runtime/dist/index.js.map +1 -1
- package/packages/client/dist/assets/use-active-thread-id-BBsLXIrt.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-BkudlgY9.js","assets/rolldown-runtime-Cyuzqnbw.js","assets/mermaid-DOtnPRYX.js","assets/adapter-g71mvnZo.js","assets/combine-Um6l0bxC.js","assets/icons-sqwAEN28.js","assets/telemetry-BE4cJhqj.js","assets/dist-9FgEnJXd.js","assets/items-iRGH_xTR.js","assets/dist-Bdl9_5dx.js","assets/dist-D13Y8-qe.js","assets/tiptap-ByTP6yRf.js","assets/markdown-DBtwZWLP.js","assets/button-Bd970BE2.js","assets/clsx-CjueKrWZ.js","assets/syntax-C54GZp2G.js","assets/_core-lD_pNs53.js","assets/initReactI18next-Dr0vnWXF.js","assets/auth-events-BAwnCYTy.js","assets/circuit-breaker-store-DR3Dx8rQ.js","assets/react-B8mHUpgK.js","assets/useTranslation-DAPPK3Hy.js","assets/input-CcrOgEwd.js","assets/use-ws-DfaWLbd3.js","assets/StashTab-KG5Zzy5-.js","assets/tabs-Bx4u8bcz.js","assets/diff-parse-dnfUXHzR.js","assets/FileTree-mnY0OIfR.js","assets/loading-state-BSdX_QZB.js","assets/GitProgressModal-D-h3ocu1.js","assets/markdown-components-DXE4xITV.js","assets/pr-detail-store-DIz8x882.js","assets/review-pane-store-B31R8Yhv.js","assets/visualizer-loader-BnEPAAGw.js","assets/ProjectHeader-Qf_M_sBm.js","assets/kbd-HqsH-rnU.js","assets/use-stable-navigate-U6VQ7K0f.js","assets/browser-panel-store-BriXQezL.js","assets/sidebar-D5gUIY0G.js","assets/use-active-thread-id-1WUch4uf.js","assets/use-terminal-scope-BvFrkm0r.js","assets/media-preview-store-ButZu4P3.js","assets/pipeline-approval-store-Sm4xCBYI.js","assets/App-CwpH7fEN.css","assets/MobilePage-B_-4EwLh.js","assets/use-thread-creation-CdjjkhNZ.js","assets/SearchablePicker-BQEWhSu4.js","assets/use-branch-switch-CFzzWMNs.js","assets/ThreadPowerline-DGdjong-.js","assets/use-unified-prompt-model-groups-DH94Yhir.js","assets/providers-B6JAFGOv.js","assets/SettingsPageContent-BMPAc4uQ.js","assets/FolderPicker-DlzSNNoW.js","assets/tooltip-icon-button-C1xTZR5-.js","assets/SettingRow-D53ijhNn.js","assets/ThreadStatusPin-Bmauv5AI.js","assets/watcher-store-DKHnSlTd.js","assets/job-store-CaOITASA.js","assets/use-minute-tick-C-e4HaZD.js","assets/app-store-CSYr64U4.js","assets/automation-store-er1E9xPe.js","assets/use-image-lightbox-DgkrBc3N.js","assets/motion-622LpYRB.js","assets/use-todo-panel-BAbS_SpL.js","assets/LoginPage-DATO3dWs.js","assets/AcceptInvitePage-D13hs9Zr.js","assets/PreviewBrowser-Dm_Aqtps.js","assets/SetupWizard-8eO2SYvf.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,r as t,t as n}from"./rolldown-runtime-Cyuzqnbw.js";import{zr as r}from"./icons-sqwAEN28.js";import{At as i}from"./mermaid-DOtnPRYX.js";import{o as a}from"./markdown-DBtwZWLP.js";import{n as o,r as s,t as c}from"./dist-9FgEnJXd.js";import{A as l,C as u,D as d,E as f,F as p,I as m,L as h,M as g,N as _,O as v,P as y,S as b,T as x,_ as S,a as C,b as w,c as T,d as ee,f as te,i as ne,j as re,k as ie,l as ae,n as oe,o as se,p as E,t as D,u as O,w as ce,x as le,y as ue}from"./motion-622LpYRB.js";import{O as de}from"./tiptap-ByTP6yRf.js";import{t as k}from"./clsx-CjueKrWZ.js";import{a as A,i as fe,n as pe,o as me,r as he,s as ge,t as j}from"./dist-Bdl9_5dx.js";import{a as _e,r as ve}from"./dist-D13Y8-qe.js";import{t as M}from"./_core-lD_pNs53.js";import{n as ye}from"./auth-events-BAwnCYTy.js";import{t as be}from"./react-B8mHUpgK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xe=n(((e,t)=>{(function(){var n,r=`4.18.1`,i=200,a=`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`,o=`Expected a function`,s="Invalid `variable` option passed into `_.template`",c="Invalid `imports` option passed into `_.template`",l=`__lodash_hash_undefined__`,u=500,d=`__lodash_placeholder__`,f=1,p=2,m=4,h=1,g=2,_=1,v=2,y=4,b=8,x=16,S=32,C=64,w=128,T=256,ee=512,te=30,ne=`...`,re=800,ie=16,ae=1,oe=2,se=3,E=1/0,D=9007199254740991,O=17976931348623157e292,ce=NaN,le=4294967295,ue=le-1,de=le>>>1,k=[[`ary`,w],[`bind`,_],[`bindKey`,v],[`curry`,b],[`curryRight`,x],[`flip`,ee],[`partial`,S],[`partialRight`,C],[`rearg`,T]],A=`[object Arguments]`,fe=`[object Array]`,pe=`[object AsyncFunction]`,me=`[object Boolean]`,he=`[object Date]`,ge=`[object DOMException]`,j=`[object Error]`,_e=`[object Function]`,ve=`[object GeneratorFunction]`,M=`[object Map]`,ye=`[object Number]`,be=`[object Null]`,xe=`[object Object]`,N=`[object Promise]`,P=`[object Proxy]`,Se=`[object RegExp]`,Ce=`[object Set]`,we=`[object String]`,Te=`[object Symbol]`,Ee=`[object Undefined]`,De=`[object WeakMap]`,Oe=`[object WeakSet]`,ke=`[object ArrayBuffer]`,Ae=`[object DataView]`,je=`[object Float32Array]`,Me=`[object Float64Array]`,Ne=`[object Int8Array]`,Pe=`[object Int16Array]`,Fe=`[object Int32Array]`,Ie=`[object Uint8Array]`,Le=`[object Uint8ClampedArray]`,Re=`[object Uint16Array]`,ze=`[object Uint32Array]`,Be=/\b__p \+= '';/g,Ve=/\b(__p \+=) '' \+/g,He=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ue=/&(?:amp|lt|gt|quot|#39);/g,We=/[&<>"']/g,Ge=RegExp(Ue.source),Ke=RegExp(We.source),qe=/<%-([\s\S]+?)%>/g,Je=/<%([\s\S]+?)%>/g,Ye=/<%=([\s\S]+?)%>/g,Xe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ze=/^\w*$/,Qe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$e=/[\\^$.*+?()[\]{}|]/g,et=RegExp($e.source),tt=/^\s+/,nt=/\s/,rt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ot=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,st=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ut=/\w*$/,dt=/^[-+]0x[0-9a-f]+$/i,ft=/^0b[01]+$/i,pt=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,ht=/^(?:0|[1-9]\d*)$/,gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_t=/($^)/,vt=/['\n\r\u2028\u2029\\]/g,yt=`\\ud800-\\udfff`,bt=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,xt=`\\u2700-\\u27bf`,St=`a-z\\xdf-\\xf6\\xf8-\\xff`,Ct=`\\xac\\xb1\\xd7\\xf7`,wt=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,Tt=`\\u2000-\\u206f`,Et=` \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000`,Dt=`A-Z\\xc0-\\xd6\\xd8-\\xde`,Ot=`\\ufe0e\\ufe0f`,kt=Ct+wt+Tt+Et,At=`['’]`,jt=`[`+yt+`]`,Mt=`[`+kt+`]`,Nt=`[`+bt+`]`,Pt=`\\d+`,Ft=`[`+xt+`]`,It=`[`+St+`]`,Lt=`[^`+yt+kt+Pt+xt+St+Dt+`]`,Rt=`\\ud83c[\\udffb-\\udfff]`,zt=`(?:`+Nt+`|`+Rt+`)`,Bt=`[^`+yt+`]`,Vt=`(?:\\ud83c[\\udde6-\\uddff]){2}`,Ht=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Ut=`[`+Dt+`]`,Wt=`\\u200d`,Gt=`(?:`+It+`|`+Lt+`)`,Kt=`(?:`+Ut+`|`+Lt+`)`,qt=`(?:`+At+`(?:d|ll|m|re|s|t|ve))?`,Jt=`(?:`+At+`(?:D|LL|M|RE|S|T|VE))?`,Yt=zt+`?`,Xt=`[`+Ot+`]?`,Zt=`(?:`+Wt+`(?:`+[Bt,Vt,Ht].join(`|`)+`)`+Xt+Yt+`)*`,Qt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,$t=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,en=Xt+Yt+Zt,tn=`(?:`+[Ft,Vt,Ht].join(`|`)+`)`+en,nn=`(?:`+[Bt+Nt+`?`,Nt,Vt,Ht,jt].join(`|`)+`)`,rn=RegExp(At,`g`),an=RegExp(Nt,`g`),on=RegExp(Rt+`(?=`+Rt+`)|`+nn+en,`g`),sn=RegExp([Ut+`?`+It+`+`+qt+`(?=`+[Mt,Ut,`$`].join(`|`)+`)`,Kt+`+`+Jt+`(?=`+[Mt,Ut+Gt,`$`].join(`|`)+`)`,Ut+`?`+Gt+`+`+qt,Ut+`+`+Jt,$t,Qt,Pt,tn].join(`|`),`g`),cn=RegExp(`[`+Wt+yt+bt+Ot+`]`),ln=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,un=`Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout`.split(`.`),dn=-1,fn={};fn[je]=fn[Me]=fn[Ne]=fn[Pe]=fn[Fe]=fn[Ie]=fn[Le]=fn[Re]=fn[ze]=!0,fn[A]=fn[fe]=fn[ke]=fn[me]=fn[Ae]=fn[he]=fn[j]=fn[_e]=fn[M]=fn[ye]=fn[xe]=fn[Se]=fn[Ce]=fn[we]=fn[De]=!1;var F={};F[A]=F[fe]=F[ke]=F[Ae]=F[me]=F[he]=F[je]=F[Me]=F[Ne]=F[Pe]=F[Fe]=F[M]=F[ye]=F[xe]=F[Se]=F[Ce]=F[we]=F[Te]=F[Ie]=F[Le]=F[Re]=F[ze]=!0,F[j]=F[_e]=F[De]=!1;var pn={À:`A`,Á:`A`,Â:`A`,Ã:`A`,Ä:`A`,Å:`A`,à:`a`,á:`a`,â:`a`,ã:`a`,ä:`a`,å:`a`,Ç:`C`,ç:`c`,Ð:`D`,ð:`d`,È:`E`,É:`E`,Ê:`E`,Ë:`E`,è:`e`,é:`e`,ê:`e`,ë:`e`,Ì:`I`,Í:`I`,Î:`I`,Ï:`I`,ì:`i`,í:`i`,î:`i`,ï:`i`,Ñ:`N`,ñ:`n`,Ò:`O`,Ó:`O`,Ô:`O`,Õ:`O`,Ö:`O`,Ø:`O`,ò:`o`,ó:`o`,ô:`o`,õ:`o`,ö:`o`,ø:`o`,Ù:`U`,Ú:`U`,Û:`U`,Ü:`U`,ù:`u`,ú:`u`,û:`u`,ü:`u`,Ý:`Y`,ý:`y`,ÿ:`y`,Æ:`Ae`,æ:`ae`,Þ:`Th`,þ:`th`,ß:`ss`,Ā:`A`,Ă:`A`,Ą:`A`,ā:`a`,ă:`a`,ą:`a`,Ć:`C`,Ĉ:`C`,Ċ:`C`,Č:`C`,ć:`c`,ĉ:`c`,ċ:`c`,č:`c`,Ď:`D`,Đ:`D`,ď:`d`,đ:`d`,Ē:`E`,Ĕ:`E`,Ė:`E`,Ę:`E`,Ě:`E`,ē:`e`,ĕ:`e`,ė:`e`,ę:`e`,ě:`e`,Ĝ:`G`,Ğ:`G`,Ġ:`G`,Ģ:`G`,ĝ:`g`,ğ:`g`,ġ:`g`,ģ:`g`,Ĥ:`H`,Ħ:`H`,ĥ:`h`,ħ:`h`,Ĩ:`I`,Ī:`I`,Ĭ:`I`,Į:`I`,İ:`I`,ĩ:`i`,ī:`i`,ĭ:`i`,į:`i`,ı:`i`,Ĵ:`J`,ĵ:`j`,Ķ:`K`,ķ:`k`,ĸ:`k`,Ĺ:`L`,Ļ:`L`,Ľ:`L`,Ŀ:`L`,Ł:`L`,ĺ:`l`,ļ:`l`,ľ:`l`,ŀ:`l`,ł:`l`,Ń:`N`,Ņ:`N`,Ň:`N`,Ŋ:`N`,ń:`n`,ņ:`n`,ň:`n`,ŋ:`n`,Ō:`O`,Ŏ:`O`,Ő:`O`,ō:`o`,ŏ:`o`,ő:`o`,Ŕ:`R`,Ŗ:`R`,Ř:`R`,ŕ:`r`,ŗ:`r`,ř:`r`,Ś:`S`,Ŝ:`S`,Ş:`S`,Š:`S`,ś:`s`,ŝ:`s`,ş:`s`,š:`s`,Ţ:`T`,Ť:`T`,Ŧ:`T`,ţ:`t`,ť:`t`,ŧ:`t`,Ũ:`U`,Ū:`U`,Ŭ:`U`,Ů:`U`,Ű:`U`,Ų:`U`,ũ:`u`,ū:`u`,ŭ:`u`,ů:`u`,ű:`u`,ų:`u`,Ŵ:`W`,ŵ:`w`,Ŷ:`Y`,ŷ:`y`,Ÿ:`Y`,Ź:`Z`,Ż:`Z`,Ž:`Z`,ź:`z`,ż:`z`,ž:`z`,IJ:`IJ`,ij:`ij`,Œ:`Oe`,œ:`oe`,ʼn:`'n`,ſ:`s`},mn={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},hn={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},gn={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},_n=parseFloat,vn=parseInt,yn=typeof global==`object`&&global&&global.Object===Object&&global,bn=typeof self==`object`&&self&&self.Object===Object&&self,xn=yn||bn||Function(`return this`)(),Sn=typeof e==`object`&&e&&!e.nodeType&&e,Cn=Sn&&typeof t==`object`&&t&&!t.nodeType&&t,wn=Cn&&Cn.exports===Sn,Tn=wn&&yn.process,En=function(){try{return Cn&&Cn.require&&Cn.require(`util`).types||Tn&&Tn.binding&&Tn.binding(`util`)}catch{}}(),Dn=En&&En.isArrayBuffer,On=En&&En.isDate,kn=En&&En.isMap,An=En&&En.isRegExp,jn=En&&En.isSet,Mn=En&&En.isTypedArray;function Nn(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pn(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Fn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function In(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function Ln(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function Rn(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function zn(e,t){return!!(e!=null&&e.length)&&Zn(e,t,0)>-1}function Bn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Vn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Hn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Un(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function Wn(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Gn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Kn=tr(`length`);function qn(e){return e.split(``)}function Jn(e){return e.match(ot)||[]}function Yn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Xn(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Zn(e,t,n){return t===t?Dr(e,t,n):Xn(e,$n,n)}function Qn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function $n(e){return e!==e}function er(e,t){var n=e==null?0:e.length;return n?ar(e,t)/n:ce}function tr(e){return function(t){return t==null?n:t[e]}}function nr(e){return function(t){return e==null?n:e[t]}}function rr(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function ir(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function ar(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function or(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function sr(e,t){return Vn(t,function(t){return[t,e[t]]})}function cr(e){return e&&e.slice(0,jr(e)+1).replace(tt,``)}function lr(e){return function(t){return e(t)}}function ur(e,t){return Vn(t,function(t){return e[t]})}function dr(e,t){return e.has(t)}function fr(e,t){for(var n=-1,r=e.length;++n<r&&Zn(t,e[n],0)>-1;);return n}function pr(e,t){for(var n=e.length;n--&&Zn(t,e[n],0)>-1;);return n}function mr(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var hr=nr(pn),gr=nr(mn);function _r(e){return`\\`+gn[e]}function vr(e,t){return e==null?n:e[t]}function yr(e){return cn.test(e)}function br(e){return ln.test(e)}function xr(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Sr(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Cr(e,t){return function(n){return e(t(n))}}function wr(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n];(o===t||o===d)&&(e[n]=d,a[i++]=n)}return a}function Tr(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Er(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Dr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Or(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function kr(e){return yr(e)?Nr(e):Kn(e)}function Ar(e){return yr(e)?Pr(e):qn(e)}function jr(e){for(var t=e.length;t--&&nt.test(e.charAt(t)););return t}var Mr=nr(hn);function Nr(e){for(var t=on.lastIndex=0;on.test(e);)++t;return t}function Pr(e){return e.match(on)||[]}function Fr(e){return e.match(sn)||[]}var Ir=(function e(t){t=t==null?xn:Ir.defaults(xn.Object(),t,Ir.pick(xn,un));var nt=t.Array,ot=t.Date,yt=t.Error,bt=t.Function,xt=t.Math,St=t.Object,Ct=t.RegExp,wt=t.String,Tt=t.TypeError,Et=nt.prototype,Dt=bt.prototype,Ot=St.prototype,kt=t[`__core-js_shared__`],At=Dt.toString,jt=Ot.hasOwnProperty,Mt=0,Nt=function(){var e=/[^.]+$/.exec(kt&&kt.keys&&kt.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),Pt=Ot.toString,Ft=At.call(St),It=xn._,Lt=Ct(`^`+At.call(jt).replace($e,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),Rt=wn?t.Buffer:n,zt=t.Symbol,Bt=t.Uint8Array,Vt=Rt?Rt.allocUnsafe:n,Ht=Cr(St.getPrototypeOf,St),Ut=St.create,Wt=Ot.propertyIsEnumerable,Gt=Et.splice,Kt=zt?zt.isConcatSpreadable:n,qt=zt?zt.iterator:n,Jt=zt?zt.toStringTag:n,Yt=function(){try{var e=ts(St,`defineProperty`);return e({},``,{}),e}catch{}}(),Xt=t.clearTimeout!==xn.clearTimeout&&t.clearTimeout,Zt=ot&&ot.now!==xn.Date.now&&ot.now,Qt=t.setTimeout!==xn.setTimeout&&t.setTimeout,$t=xt.ceil,en=xt.floor,tn=St.getOwnPropertySymbols,nn=Rt?Rt.isBuffer:n,on=t.isFinite,sn=Et.join,cn=Cr(St.keys,St),ln=xt.max,pn=xt.min,mn=ot.now,hn=t.parseInt,gn=xt.random,yn=Et.reverse,bn=ts(t,`DataView`),Sn=ts(t,`Map`),Cn=ts(t,`Promise`),Tn=ts(t,`Set`),En=ts(t,`WeakMap`),Kn=ts(St,`create`),qn=En&&new En,nr={},Dr=Bs(bn),Nr=Bs(Sn),Pr=Bs(Cn),Lr=Bs(Tn),Rr=Bs(En),zr=zt?zt.prototype:n,Br=zr?zr.valueOf:n,Vr=zr?zr.toString:n;function I(e){if(ku(e)&&!Y(e)&&!(e instanceof L)){if(e instanceof Wr)return e;if(jt.call(e,`__wrapped__`))return Hs(e)}return new Wr(e)}var Hr=function(){function e(){}return function(t){if(!Ou(t))return{};if(Ut)return Ut(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function Ur(){}function Wr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}I.templateSettings={escape:qe,evaluate:Je,interpolate:Ye,variable:``,imports:{_:I}},I.prototype=Ur.prototype,I.prototype.constructor=I,Wr.prototype=Hr(Ur.prototype),Wr.prototype.constructor=Wr;function L(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=le,this.__views__=[]}function Gr(){var e=new L(this.__wrapped__);return e.__actions__=mo(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=mo(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=mo(this.__views__),e}function Kr(){if(this.__filtered__){var e=new L(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function qr(){var e=this.__wrapped__.value(),t=this.__dir__,n=Y(e),r=t<0,i=n?e.length:0,a=os(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=pn(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return Ya(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==oe)g=b;else if(!b){if(y==ae)continue outer;break outer}}m[f++]=g}return m}L.prototype=Hr(Ur.prototype),L.prototype.constructor=L;function Jr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Yr(){this.__data__=Kn?Kn(null):{},this.size=0}function Xr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function Zr(e){var t=this.__data__;if(Kn){var r=t[e];return r===l?n:r}return jt.call(t,e)?t[e]:n}function Qr(e){var t=this.__data__;return Kn?t[e]!==n:jt.call(t,e)}function $r(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=Kn&&t===n?l:t,this}Jr.prototype.clear=Yr,Jr.prototype.delete=Xr,Jr.prototype.get=Zr,Jr.prototype.has=Qr,Jr.prototype.set=$r;function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ti(){this.__data__=[],this.size=0}function ni(e){var t=this.__data__,n=Di(t,e);return n<0?!1:(n==t.length-1?t.pop():Gt.call(t,n,1),--this.size,!0)}function ri(e){var t=this.__data__,r=Di(t,e);return r<0?n:t[r][1]}function ii(e){return Di(this.__data__,e)>-1}function ai(e,t){var n=this.__data__,r=Di(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}ei.prototype.clear=ti,ei.prototype.delete=ni,ei.prototype.get=ri,ei.prototype.has=ii,ei.prototype.set=ai;function oi(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function si(){this.size=0,this.__data__={hash:new Jr,map:new(Sn||ei),string:new Jr}}function ci(e){var t=$o(this,e).delete(e);return this.size-=+!!t,t}function li(e){return $o(this,e).get(e)}function ui(e){return $o(this,e).has(e)}function di(e,t){var n=$o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}oi.prototype.clear=si,oi.prototype.delete=ci,oi.prototype.get=li,oi.prototype.has=ui,oi.prototype.set=di;function fi(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new oi;++t<n;)this.add(e[t])}function pi(e){return this.__data__.set(e,l),this}function mi(e){return this.__data__.has(e)}fi.prototype.add=fi.prototype.push=pi,fi.prototype.has=mi;function hi(e){var t=this.__data__=new ei(e);this.size=t.size}function gi(){this.__data__=new ei,this.size=0}function _i(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function vi(e){return this.__data__.get(e)}function yi(e){return this.__data__.has(e)}function bi(e,t){var n=this.__data__;if(n instanceof ei){var r=n.__data__;if(!Sn||r.length<i-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oi(r)}return n.set(e,t),this.size=n.size,this}hi.prototype.clear=gi,hi.prototype.delete=_i,hi.prototype.get=vi,hi.prototype.has=yi,hi.prototype.set=bi;function xi(e,t){var n=Y(e),r=!n&&pu(e),i=!n&&!r&&_u(e),a=!n&&!r&&!i&&Wu(e),o=n||r||i||a,s=o?or(e.length,wt):[],c=s.length;for(var l in e)(t||jt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||ms(l,c)))&&s.push(l);return s}function Si(e){var t=e.length;return t?e[ka(0,t-1)]:n}function Ci(e,t){return Ls(mo(e),Ni(t,0,e.length))}function wi(e){return Ls(mo(e))}function Ti(e,t,r){(r!==n&&!uu(e[t],r)||r===n&&!(t in e))&&ji(e,t,r)}function Ei(e,t,r){var i=e[t];(!(jt.call(e,t)&&uu(i,r))||r===n&&!(t in e))&&ji(e,t,r)}function Di(e,t){for(var n=e.length;n--;)if(uu(e[n][0],t))return n;return-1}function Oi(e,t,n,r){return Ri(e,function(e,i,a){t(r,e,n(e),a)}),r}function ki(e,t){return e&&ho(t,Cd(t),e)}function Ai(e,t){return e&&ho(t,wd(t),e)}function ji(e,t,n){t==`__proto__`&&Yt?Yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Mi(e,t){for(var r=-1,i=t.length,a=nt(i),o=e==null;++r<i;)a[r]=o?n:vd(e,t[r]);return a}function Ni(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function Pi(e,t,r,i,a,o){var s,c=t&f,l=t&p,u=t&m;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!Ou(e))return e;var d=Y(e);if(d){if(s=ls(e),!c)return mo(e,s)}else{var h=as(e),g=h==_e||h==ve;if(_u(e))return io(e,c);if(h==xe||h==A||g&&!a){if(s=l||g?{}:us(e),!c)return l?_o(e,Ai(s,e)):go(e,ki(s,e))}else{if(!F[h])return a?e:{};s=ds(e,h,c)}}o||=new hi;var _=o.get(e);if(_)return _;o.set(e,s),Vu(e)?e.forEach(function(n){s.add(Pi(n,t,r,n,e,o))}):Au(e)&&e.forEach(function(n,i){s.set(i,Pi(n,t,r,i,e,o))});var v=d?n:(u?l?Yo:Jo:l?wd:Cd)(e);return Fn(v||e,function(n,i){v&&(i=n,n=e[i]),Ei(s,i,Pi(n,t,r,i,e,o))}),s}function Fi(e){var t=Cd(e);return function(n){return R(n,e,t)}}function R(e,t,r){var i=r.length;if(e==null)return!i;for(e=St(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function Ii(e,t,r){if(typeof e!=`function`)throw new Tt(o);return Ns(function(){e.apply(n,r)},t)}function Li(e,t,n,r){var a=-1,o=zn,s=!0,c=e.length,l=[],u=t.length;if(!c)return l;n&&(t=Vn(t,lr(n))),r?(o=Bn,s=!1):t.length>=i&&(o=dr,s=!1,t=new fi(t));outer:for(;++a<c;){var d=e[a],f=n==null?d:n(d);if(d=r||d!==0?d:0,s&&f===f){for(var p=u;p--;)if(t[p]===f)continue outer;l.push(d)}else o(t,f,r)||l.push(d)}return l}var Ri=yo(Ki),zi=yo(qi,!0);function Bi(e,t){var n=!0;return Ri(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function Vi(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!Uu(s):r(s,c)))var c=s,l=o}return l}function Hi(e,t,r,i){var a=e.length;for(r=Z(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:Z(i),i<0&&(i+=a),i=r>i?0:Qu(i);r<i;)e[r++]=t;return e}function Ui(e,t){var n=[];return Ri(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function z(e,t,n,r,i){var a=-1,o=e.length;for(n||=ps,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?z(s,t-1,n,r,i):Hn(i,s):r||(i[i.length]=s)}return i}var Wi=bo(),Gi=bo(!0);function Ki(e,t){return e&&Wi(e,t,Cd)}function qi(e,t){return e&&Gi(e,t,Cd)}function Ji(e,t){return Rn(t,function(t){return Tu(e[t])})}function Yi(e,t){t=eo(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[zs(t[r++])];return r&&r==i?e:n}function Xi(e,t,n){var r=t(e);return Y(e)?r:Hn(r,n(e))}function Zi(e){return e==null?e===n?Ee:be:Jt&&Jt in St(e)?ns(e):Ds(e)}function Qi(e,t){return e>t}function B(e,t){return e!=null&&jt.call(e,t)}function $i(e,t){return e!=null&&t in St(e)}function ea(e,t,n){return e>=pn(t,n)&&e<ln(t,n)}function ta(e,t,r){for(var i=r?Bn:zn,a=e[0].length,o=e.length,s=o,c=nt(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=Vn(d,lr(t))),l=pn(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new fi(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?dr(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?dr(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function na(e,t,n,r){return Ki(e,function(e,i,a){t(r,n(e),i,a)}),r}function ra(e,t,r){t=eo(t,e),e=ks(e,t);var i=e==null?e:e[zs(pc(t))];return i==null?n:Nn(i,e,r)}function ia(e){return ku(e)&&Zi(e)==A}function aa(e){return ku(e)&&Zi(e)==ke}function oa(e){return ku(e)&&Zi(e)==he}function sa(e,t,n,r,i){return e===t?!0:e==null||t==null||!ku(e)&&!ku(t)?e!==e&&t!==t:ca(e,t,n,r,sa,i)}function ca(e,t,n,r,i,a){var o=Y(e),s=Y(t),c=o?fe:as(e),l=s?fe:as(t);c=c==A?xe:c,l=l==A?xe:l;var u=c==xe,d=l==xe,f=c==l;if(f&&_u(e)){if(!_u(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new hi,o||Wu(e)?Wo(e,t,n,r,i,a):Go(e,t,c,n,r,i,a);if(!(n&h)){var p=u&&jt.call(e,`__wrapped__`),m=d&&jt.call(t,`__wrapped__`);if(p||m){var g=p?e.value():e,_=m?t.value():t;return a||=new hi,i(g,_,n,r,a)}}return f?(a||=new hi,Ko(e,t,n,r,i,a)):!1}function la(e){return ku(e)&&as(e)==M}function V(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=St(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new hi;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?sa(d,u,h|g,i,f):p))return!1}}return!0}function ua(e){return!Ou(e)||ys(e)?!1:(Tu(e)?Lt:pt).test(Bs(e))}function da(e){return ku(e)&&Zi(e)==Se}function fa(e){return ku(e)&&as(e)==Ce}function pa(e){return ku(e)&&Du(e.length)&&!!fn[Zi(e)]}function ma(e){return typeof e==`function`?e:e==null?Mf:typeof e==`object`?Y(e)?ya(e[0],e[1]):va(e):Gf(e)}function ha(e){if(!xs(e))return cn(e);var t=[];for(var n in St(e))jt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function ga(e){if(!Ou(e))return Es(e);var t=xs(e),n=[];for(var r in e)r==`constructor`&&(t||!jt.call(e,r))||n.push(r);return n}function H(e,t){return e<t}function _a(e,t){var n=-1,r=hu(e)?nt(e.length):[];return Ri(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function va(e){var t=es(e);return t.length==1&&t[0][2]?Cs(t[0][0],t[0][1]):function(n){return n===e||V(n,e,t)}}function ya(e,t){return gs(e)&&Ss(t)?Cs(zs(e),t):function(r){var i=vd(r,e);return i===n&&i===t?yd(r,e):sa(t,i,h|g)}}function ba(e,t,r,i,a){e!==t&&Wi(t,function(o,s){if(a||=new hi,Ou(o))xa(e,t,s,r,ba,i,a);else{var c=i?i(js(e,s),o,s+``,e,t,a):n;c===n&&(c=o),Ti(e,s,c)}},wd)}function xa(e,t,r,i,a,o,s){var c=js(e,r),l=js(t,r),u=s.get(l);if(u){Ti(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=Y(l),m=!p&&_u(l),h=!p&&!m&&Wu(l);d=l,p||m||h?Y(c)?d=c:X(c)?d=mo(c):m?(f=!1,d=io(l,!0)):h?(f=!1,d=W(l,!0)):d=[]:Ru(l)||pu(l)?(d=c,pu(c)?d=ed(c):(!Ou(c)||Tu(c))&&(d=us(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),Ti(e,r,d)}function Sa(e,t){var r=e.length;if(r)return t+=t<0?r:0,ms(t,r)?e[t]:n}function Ca(e,t,n){t=t.length?Vn(t,function(e){return Y(e)?function(t){return Yi(t,e.length===1?e[0]:e)}:e}):[Mf];var r=-1;return t=Vn(t,lr(K())),ir(_a(e,function(e,n,i){return{criteria:Vn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return uo(e,t,n)})}function wa(e,t){return Ta(e,t,function(t,n){return yd(e,n)})}function Ta(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=Yi(e,o);n(s,o)&&Pa(a,eo(o,e),s)}return a}function Ea(e){return function(t){return Yi(t,e)}}function Da(e,t,n,r){var i=r?Qn:Zn,a=-1,o=t.length,s=e;for(e===t&&(t=mo(t)),n&&(s=Vn(e,lr(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&Gt.call(s,c,1),Gt.call(e,c,1);return e}function Oa(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;ms(i)?Gt.call(e,i,1):Ka(e,i)}}return e}function ka(e,t){return e+en(gn()*(t-e+1))}function Aa(e,t,n,r){for(var i=-1,a=ln($t((t-e)/(n||1)),0),o=nt(a);a--;)o[r?a:++i]=e,e+=n;return o}function ja(e,t){var n=``;if(!e||t<1||t>D)return n;do t%2&&(n+=e),t=en(t/2),t&&(e+=e);while(t);return n}function U(e,t){return Ps(Os(e,t,Mf),e+``)}function Ma(e){return Si(Hd(e))}function Na(e,t){var n=Hd(e);return Ls(n,Ni(t,0,n.length))}function Pa(e,t,r,i){if(!Ou(e))return e;t=eo(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=zs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=Ou(d)?d:ms(t[a+1])?[]:{})}Ei(c,l,u),c=c[l]}return e}var Fa=qn?function(e,t){return qn.set(e,t),e}:Mf,Ia=Yt?function(e,t){return Yt(e,`toString`,{configurable:!0,enumerable:!1,value:Of(t),writable:!0})}:Mf;function La(e){return Ls(Hd(e))}function Ra(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=nt(i);++r<i;)a[r]=e[r+t];return a}function za(e,t){var n;return Ri(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function Ba(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=de){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!Uu(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return Va(e,t,Mf,n)}function Va(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=Uu(t),u=t===n;a<o;){var d=en((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=Uu(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return pn(o,ue)}function Ha(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!uu(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function Ua(e){return typeof e==`number`?e:Uu(e)?ce:+e}function Wa(e){if(typeof e==`string`)return e;if(Y(e))return Vn(e,Wa)+``;if(Uu(e))return Vr?Vr.call(e):``;var t=e+``;return t==`0`&&1/e==-E?`-0`:t}function Ga(e,t,n){var r=-1,a=zn,o=e.length,s=!0,c=[],l=c;if(n)s=!1,a=Bn;else if(o>=i){var u=t?null:Ro(e);if(u)return Tr(u);s=!1,a=dr,l=new fi}else l=t?[]:c;outer:for(;++r<o;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,s&&f===f){for(var p=l.length;p--;)if(l[p]===f)continue outer;t&&l.push(f),c.push(d)}else a(l,f,n)||(l!==c&&l.push(f),c.push(d))}return c}function Ka(e,t){t=eo(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=zs(t[n]);if(i===`__proto__`&&!jt.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ks(e,t);return a==null||delete a[zs(pc(t))]}function qa(e,t,n,r){return Pa(e,t,n(Yi(e,t)),r)}function Ja(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?Ra(e,r?0:a,r?a+1:i):Ra(e,r?a+1:0,r?i:a)}function Ya(e,t){var n=e;return n instanceof L&&(n=n.value()),Un(t,function(e,t){return t.func.apply(t.thisArg,Hn([e],t.args))},n)}function Xa(e,t,n){var r=e.length;if(r<2)return r?Ga(e[0]):[];for(var i=-1,a=nt(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=Li(a[i]||o,e[s],t,n));return Ga(z(a,1),t,n)}function Za(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Qa(e){return X(e)?e:[]}function $a(e){return typeof e==`function`?e:Mf}function eo(e,t){return Y(e)?e:gs(e,t)?[e]:Rs(Q(e))}var to=U;function no(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Ra(e,t,r)}var ro=Xt||function(e){return xn.clearTimeout(e)};function io(e,t){if(t)return e.slice();var n=e.length,r=Vt?Vt(n):new e.constructor(n);return e.copy(r),r}function ao(e){var t=new e.constructor(e.byteLength);return new Bt(t).set(new Bt(e)),t}function oo(e,t){var n=t?ao(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function so(e){var t=new e.constructor(e.source,ut.exec(e));return t.lastIndex=e.lastIndex,t}function co(e){return Br?St(Br.call(e)):{}}function W(e,t){var n=t?ao(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function lo(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=Uu(e),s=t!==n,c=t===null,l=t===t,u=Uu(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function uo(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=lo(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function fo(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=ln(a-o,0),u=nt(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function po(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=ln(a-s,0),d=nt(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function mo(e,t){var n=-1,r=e.length;for(t||=nt(r);++n<r;)t[n]=e[n];return t}function ho(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?ji(r,c,l):Ei(r,c,l)}return r}function go(e,t){return ho(e,rs(e),t)}function _o(e,t){return ho(e,is(e),t)}function vo(e,t){return function(n,r){var i=Y(n)?Pn:Oi,a=t?t():{};return i(n,e,K(r,2),a)}}function G(e){return U(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&hs(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=St(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function yo(e,t){return function(n,r){if(n==null)return n;if(!hu(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=St(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function bo(e){return function(t,n,r){for(var i=-1,a=St(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function xo(e,t,n){var r=t&_,i=wo(e);function a(){return(this&&this!==xn&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function So(e){return function(t){t=Q(t);var r=yr(t)?Ar(t):n,i=r?r[0]:t.charAt(0),a=r?no(r,1).join(``):t.slice(1);return i[e]()+a}}function Co(e){return function(t){return Un(Cf(Yd(t).replace(rn,``)),e,``)}}function wo(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Hr(e.prototype),r=e.apply(n,t);return Ou(r)?r:n}}function To(e,t,r){var i=wo(e);function a(){for(var o=arguments.length,s=nt(o),c=o,l=Qo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:wr(s,l);return o-=u.length,o<r?Io(e,t,Oo,a.placeholder,n,s,u,n,n,r-o):Nn(this&&this!==xn&&this instanceof a?i:e,this,s)}return a}function Eo(e){return function(t,r,i){var a=St(t);if(!hu(t)){var o=K(r,3);t=Cd(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function Do(e){return qo(function(t){var r=t.length,i=r,a=Wr.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if(typeof s!=`function`)throw new Tt(o);if(a&&!c&&Zo(s)==`wrapper`)var c=new Wr([],!0)}for(i=c?i:r;++i<r;){s=t[i];var l=Zo(s),u=l==`wrapper`?Xo(s):n;c=u&&vs(u[0])&&u[1]==(w|b|S|T)&&!u[4].length&&u[9]==1?c[Zo(u[0])].apply(c,u[3]):s.length==1&&vs(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&e.length==1&&Y(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}})}function Oo(e,t,r,i,a,o,s,c,l,u){var d=t&w,f=t&_,p=t&v,m=t&(b|x),h=t&ee,g=p?n:wo(e);function y(){for(var n=arguments.length,_=nt(n),v=n;v--;)_[v]=arguments[v];if(m)var b=Qo(y),x=mr(_,b);if(i&&(_=fo(_,i,a,m)),o&&(_=po(_,o,s,m)),n-=x,m&&n<u){var S=wr(_,b);return Io(e,t,Oo,y.placeholder,r,_,S,c,l,u-n)}var C=f?r:this,w=p?C[e]:e;return n=_.length,c?_=As(_,c):h&&n>1&&_.reverse(),d&&l<n&&(_.length=l),this&&this!==xn&&this instanceof y&&(w=g||wo(w)),w.apply(C,_)}return y}function ko(e,t){return function(n,r){return na(n,e,t(r),{})}}function Ao(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=Wa(r),i=Wa(i)):(r=Ua(r),i=Ua(i)),a=e(r,i)}return a}}function jo(e){return qo(function(t){return t=Vn(t,lr(K())),U(function(n){var r=this;return e(t,function(e){return Nn(e,r,n)})})})}function Mo(e,t){t=t===n?` `:Wa(t);var r=t.length;if(r<2)return r?ja(t,e):t;var i=ja(t,$t(e/kr(t)));return yr(t)?no(Ar(i),0,e).join(``):i.slice(0,e)}function No(e,t,n,r){var i=t&_,a=wo(e);function o(){for(var t=-1,s=arguments.length,c=-1,l=r.length,u=nt(l+s),d=this&&this!==xn&&this instanceof o?a:e;++c<l;)u[c]=r[c];for(;s--;)u[c++]=arguments[++t];return Nn(d,i?n:this,u)}return o}function Po(e){return function(t,r,i){return i&&typeof i!=`number`&&hs(t,r,i)&&(r=i=n),t=Zu(t),r===n?(r=t,t=0):r=Zu(r),i=i===n?t<r?1:-1:Zu(i),Aa(t,r,i,e)}}function Fo(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=$u(t),n=$u(n)),e(t,n)}}function Io(e,t,r,i,a,o,s,c,l,u){var d=t&b,f=d?s:n,p=d?n:s,m=d?o:n,h=d?n:o;t|=d?S:C,t&=~(d?C:S),t&y||(t&=~(_|v));var g=[e,t,a,m,f,h,p,c,l,u],x=r.apply(n,g);return vs(e)&&Ms(x,g),x.placeholder=i,Fs(x,e,t)}function Lo(e){var t=xt[e];return function(e,n){if(e=$u(e),n=n==null?0:pn(Z(n),292),n&&on(e)){var r=(Q(e)+`e`).split(`e`);return r=(Q(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var Ro=Tn&&1/Tr(new Tn([,-0]))[1]==E?function(e){return new Tn(e)}:Bf;function zo(e){return function(t){var n=as(t);return n==M?Sr(t):n==Ce?Er(t):sr(t,e(t))}}function Bo(e,t,r,i,a,s,c,l){var u=t&v;if(!u&&typeof e!=`function`)throw new Tt(o);var d=i?i.length:0;if(d||(t&=~(S|C),i=a=n),c=c===n?c:ln(Z(c),0),l=l===n?l:Z(l),d-=a?a.length:0,t&C){var f=i,p=a;i=a=n}var m=u?n:Xo(e),h=[e,t,r,i,a,f,p,s,c,l];if(m&&Ts(h,m),e=h[0],t=h[1],r=h[2],i=h[3],a=h[4],l=h[9]=h[9]===n?u?0:e.length:ln(h[9]-d,0),!l&&t&(b|x)&&(t&=~(b|x)),!t||t==_)var g=xo(e,t,r);else g=t==b||t==x?To(e,t,l):(t==S||t==(_|S))&&!a.length?No(e,t,r,i):Oo.apply(n,h);return Fs((m?Fa:Ms)(g,h),e,t)}function Vo(e,t,r,i){return e===n||uu(e,Ot[r])&&!jt.call(i,r)?t:e}function Ho(e,t,r,i,a,o){return Ou(e)&&Ou(t)&&(o.set(t,e),ba(e,t,n,Ho,o),o.delete(t)),e}function Uo(e){return Ru(e)?n:e}function Wo(e,t,r,i,a,o){var s=r&h,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&g?new fi:n;for(o.set(e,t),o.set(t,e);++f<c;){var _=e[f],v=t[f];if(i)var y=s?i(v,_,f,t,e,o):i(_,v,f,e,t,o);if(y!==n){if(y)continue;p=!1;break}if(m){if(!Gn(t,function(e,t){if(!dr(m,t)&&(_===e||a(_,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(_===v||a(_,v,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function Go(e,t,n,r,i,a,o){switch(n){case Ae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ke:return!(e.byteLength!=t.byteLength||!a(new Bt(e),new Bt(t)));case me:case he:case ye:return uu(+e,+t);case j:return e.name==t.name&&e.message==t.message;case Se:case we:return e==t+``;case M:var s=Sr;case Ce:var c=r&h;if(s||=Tr,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=g,o.set(e,t);var u=Wo(s(e),s(t),r,i,a,o);return o.delete(e),u;case Te:if(Br)return Br.call(e)==Br.call(t)}return!1}function Ko(e,t,r,i,a,o){var s=r&h,c=Jo(e),l=c.length;if(l!=Jo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:jt.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var g=s;++u<l;){d=c[u];var _=e[d],v=t[d];if(i)var y=s?i(v,_,d,t,e,o):i(_,v,d,e,t,o);if(!(y===n?_===v||a(_,v,r,i,o):y)){m=!1;break}g||=d==`constructor`}if(m&&!g){var b=e.constructor,x=t.constructor;b!=x&&`constructor`in e&&`constructor`in t&&!(typeof b==`function`&&b instanceof b&&typeof x==`function`&&x instanceof x)&&(m=!1)}return o.delete(e),o.delete(t),m}function qo(e){return Ps(Os(e,n,nc),e+``)}function Jo(e){return Xi(e,Cd,rs)}function Yo(e){return Xi(e,wd,is)}var Xo=qn?function(e){return qn.get(e)}:Bf;function Zo(e){for(var t=e.name+``,n=nr[t],r=jt.call(nr,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Qo(e){return(jt.call(I,`placeholder`)?I:e).placeholder}function K(){var e=I.iteratee||Nf;return e=e===Nf?ma:e,arguments.length?e(arguments[0],arguments[1]):e}function $o(e,t){var n=e.__data__;return _s(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function es(e){for(var t=Cd(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Ss(i)]}return t}function ts(e,t){var r=vr(e,t);return ua(r)?r:n}function ns(e){var t=jt.call(e,Jt),r=e[Jt];try{e[Jt]=n;var i=!0}catch{}var a=Pt.call(e);return i&&(t?e[Jt]=r:delete e[Jt]),a}var rs=tn?function(e){return e==null?[]:(e=St(e),Rn(tn(e),function(t){return Wt.call(e,t)}))}:Yf,is=tn?function(e){for(var t=[];e;)Hn(t,rs(e)),e=Ht(e);return t}:Yf,as=Zi;(bn&&as(new bn(new ArrayBuffer(1)))!=Ae||Sn&&as(new Sn)!=M||Cn&&as(Cn.resolve())!=N||Tn&&as(new Tn)!=Ce||En&&as(new En)!=De)&&(as=function(e){var t=Zi(e),r=t==xe?e.constructor:n,i=r?Bs(r):``;if(i)switch(i){case Dr:return Ae;case Nr:return M;case Pr:return N;case Lr:return Ce;case Rr:return De}return t});function os(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=pn(t,e+o);break;case`takeRight`:e=ln(e,t-o);break}}return{start:e,end:t}}function ss(e){var t=e.match(it);return t?t[1].split(at):[]}function cs(e,t,n){t=eo(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=zs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Du(i)&&ms(o,i)&&(Y(e)||pu(e)))}function ls(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&jt.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function us(e){return typeof e.constructor==`function`&&!xs(e)?Hr(Ht(e)):{}}function ds(e,t,n){var r=e.constructor;switch(t){case ke:return ao(e);case me:case he:return new r(+e);case Ae:return oo(e,n);case je:case Me:case Ne:case Pe:case Fe:case Ie:case Le:case Re:case ze:return W(e,n);case M:return new r;case ye:case we:return new r(e);case Se:return so(e);case Ce:return new r;case Te:return co(e)}}function fs(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(rt,`{
|
|
3
3
|
/* [wrapped with `+t+`] */
|
|
4
4
|
`)}function ps(e){return Y(e)||pu(e)||!!(Kt&&e&&e[Kt])}function ms(e,t){var n=typeof e;return t??=D,!!t&&(n==`number`||n!=`symbol`&&ht.test(e))&&e>-1&&e%1==0&&e<t}function hs(e,t,n){if(!Ou(n))return!1;var r=typeof t;return(r==`number`?hu(n)&&ms(t,n.length):r==`string`&&t in n)?uu(n[t],e):!1}function gs(e,t){if(Y(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Uu(e)?!0:Ze.test(e)||!Xe.test(e)||t!=null&&e in St(t)}function _s(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function vs(e){var t=Zo(e),n=I[t];if(typeof n!=`function`||!(t in L.prototype))return!1;if(e===n)return!0;var r=Xo(n);return!!r&&e===r[0]}function ys(e){return!!Nt&&Nt in e}var bs=kt?Tu:Xf;function xs(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Ot)}function Ss(e){return e===e&&!Ou(e)}function Cs(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in St(r))}}function ws(e){var t=Kl(e,function(e){return n.size===u&&n.clear(),e}),n=t.cache;return t}function Ts(e,t){var n=e[1],r=t[1],i=n|r,a=i<(_|v|w),o=r==w&&n==b||r==w&&n==T&&e[7].length<=t[8]||r==(w|T)&&t[7].length<=t[8]&&n==b;if(!(a||o))return e;r&_&&(e[2]=t[2],i|=n&_?0:y);var s=t[3];if(s){var c=e[3];e[3]=c?fo(c,s,t[4]):s,e[4]=c?wr(e[3],d):t[4]}return s=t[5],s&&(c=e[5],e[5]=c?po(c,s,t[6]):s,e[6]=c?wr(e[5],d):t[6]),s=t[7],s&&(e[7]=s),r&w&&(e[8]=e[8]==null?t[8]:pn(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function Es(e){var t=[];if(e!=null)for(var n in St(e))t.push(n);return t}function Ds(e){return Pt.call(e)}function Os(e,t,r){return t=ln(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=ln(n.length-t,0),o=nt(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=nt(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),Nn(e,this,s)}}function ks(e,t){return t.length<2?e:Yi(e,Ra(t,0,-1))}function As(e,t){for(var r=e.length,i=pn(t.length,r),a=mo(e);i--;){var o=t[i];e[i]=ms(o,r)?a[o]:n}return e}function js(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var Ms=Is(Fa),Ns=Qt||function(e,t){return xn.setTimeout(e,t)},Ps=Is(Ia);function Fs(e,t,n){var r=t+``;return Ps(e,fs(r,Vs(ss(r),n)))}function Is(e){var t=0,r=0;return function(){var i=mn(),a=ie-(i-r);if(r=i,a>0){if(++t>=re)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ls(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=ka(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Rs=ws(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Qe,function(e,n,r,i){t.push(r?i.replace(ct,`$1`):n||e)}),t});function zs(e){if(typeof e==`string`||Uu(e))return e;var t=e+``;return t==`0`&&1/e==-E?`-0`:t}function Bs(e){if(e!=null){try{return At.call(e)}catch{}try{return e+``}catch{}}return``}function Vs(e,t){return Fn(k,function(n){var r=`_.`+n[0];t&n[1]&&!zn(e,r)&&e.push(r)}),e.sort()}function Hs(e){if(e instanceof L)return e.clone();var t=new Wr(e.__wrapped__,e.__chain__);return t.__actions__=mo(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Us(e,t,r){t=(r?hs(e,t,r):t===n)?1:ln(Z(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=nt($t(i/t));a<i;)s[o++]=Ra(e,a,a+=t);return s}function Ws(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Gs(){var e=arguments.length;if(!e)return[];for(var t=nt(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Hn(Y(n)?mo(n):[n],z(t,1))}var Ks=U(function(e,t){return X(e)?Li(e,z(t,1,X,!0)):[]}),qs=U(function(e,t){var r=pc(t);return X(r)&&(r=n),X(e)?Li(e,z(t,1,X,!0),K(r,2)):[]}),Js=U(function(e,t){var r=pc(t);return X(r)&&(r=n),X(e)?Li(e,z(t,1,X,!0),n,r):[]});function Ys(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Z(t),Ra(e,t<0?0:t,i)):[]}function Xs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Z(t),t=i-t,Ra(e,0,t<0?0:t)):[]}function Zs(e,t){return e&&e.length?Ja(e,K(t,3),!0,!0):[]}function Qs(e,t){return e&&e.length?Ja(e,K(t,3),!0):[]}function $s(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&hs(e,t,n)&&(n=0,r=i),Hi(e,t,n,r)):[]}function ec(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Z(n);return i<0&&(i=ln(r+i,0)),Xn(e,K(t,3),i)}function tc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=Z(r),a=r<0?ln(i+a,0):pn(a,i-1)),Xn(e,K(t,3),a,!0)}function nc(e){return e!=null&&e.length?z(e,1):[]}function rc(e){return e!=null&&e.length?z(e,E):[]}function ic(e,t){return e!=null&&e.length?(t=t===n?1:Z(t),z(e,t)):[]}function ac(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];ji(r,i[0],i[1])}return r}function oc(e){return e&&e.length?e[0]:n}function sc(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Z(n);return i<0&&(i=ln(r+i,0)),Zn(e,t,i)}function cc(e){return e!=null&&e.length?Ra(e,0,-1):[]}var lc=U(function(e){var t=Vn(e,Qa);return t.length&&t[0]===e[0]?ta(t):[]}),uc=U(function(e){var t=pc(e),r=Vn(e,Qa);return t===pc(r)?t=n:r.pop(),r.length&&r[0]===e[0]?ta(r,K(t,2)):[]}),dc=U(function(e){var t=pc(e),r=Vn(e,Qa);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?ta(r,n,t):[]});function fc(e,t){return e==null?``:sn.call(e,t)}function pc(e){var t=e==null?0:e.length;return t?e[t-1]:n}function mc(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=Z(r),a=a<0?ln(i+a,0):pn(a,i-1)),t===t?Or(e,t,a):Xn(e,$n,a,!0)}function hc(e,t){return e&&e.length?Sa(e,Z(t)):n}var gc=U(_c);function _c(e,t){return e&&e.length&&t&&t.length?Da(e,t):e}function vc(e,t,n){return e&&e.length&&t&&t.length?Da(e,t,K(n,2)):e}function yc(e,t,r){return e&&e.length&&t&&t.length?Da(e,t,n,r):e}var bc=qo(function(e,t){var n=e==null?0:e.length,r=Mi(e,t);return Oa(e,Vn(t,function(e){return ms(e,n)?+e:e}).sort(lo)),r});function xc(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=K(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return Oa(e,i),n}function Sc(e){return e==null?e:yn.call(e)}function Cc(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&hs(e,t,r)?(t=0,r=i):(t=t==null?0:Z(t),r=r===n?i:Z(r)),Ra(e,t,r)):[]}function wc(e,t){return Ba(e,t)}function Tc(e,t,n){return Va(e,t,K(n,2))}function Ec(e,t){var n=e==null?0:e.length;if(n){var r=Ba(e,t);if(r<n&&uu(e[r],t))return r}return-1}function Dc(e,t){return Ba(e,t,!0)}function Oc(e,t,n){return Va(e,t,K(n,2),!0)}function kc(e,t){if(e!=null&&e.length){var n=Ba(e,t,!0)-1;if(uu(e[n],t))return n}return-1}function Ac(e){return e&&e.length?Ha(e):[]}function jc(e,t){return e&&e.length?Ha(e,K(t,2)):[]}function Mc(e){var t=e==null?0:e.length;return t?Ra(e,1,t):[]}function Nc(e,t,r){return e&&e.length?(t=r||t===n?1:Z(t),Ra(e,0,t<0?0:t)):[]}function Pc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Z(t),t=i-t,Ra(e,t<0?0:t,i)):[]}function Fc(e,t){return e&&e.length?Ja(e,K(t,3),!1,!0):[]}function Ic(e,t){return e&&e.length?Ja(e,K(t,3)):[]}var Lc=U(function(e){return Ga(z(e,1,X,!0))}),Rc=U(function(e){var t=pc(e);return X(t)&&(t=n),Ga(z(e,1,X,!0),K(t,2))}),zc=U(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Ga(z(e,1,X,!0),n,t)});function Bc(e){return e&&e.length?Ga(e):[]}function Vc(e,t){return e&&e.length?Ga(e,K(t,2)):[]}function Hc(e,t){return t=typeof t==`function`?t:n,e&&e.length?Ga(e,n,t):[]}function Uc(e){if(!(e&&e.length))return[];var t=0;return e=Rn(e,function(e){if(X(e))return t=ln(e.length,t),!0}),or(t,function(t){return Vn(e,tr(t))})}function Wc(e,t){if(!(e&&e.length))return[];var r=Uc(e);return t==null?r:Vn(r,function(e){return Nn(t,n,e)})}var Gc=U(function(e,t){return X(e)?Li(e,t):[]}),Kc=U(function(e){return Xa(Rn(e,X))}),qc=U(function(e){var t=pc(e);return X(t)&&(t=n),Xa(Rn(e,X),K(t,2))}),Jc=U(function(e){var t=pc(e);return t=typeof t==`function`?t:n,Xa(Rn(e,X),n,t)}),Yc=U(Uc);function Xc(e,t){return Za(e||[],t||[],Ei)}function Zc(e,t){return Za(e||[],t||[],Pa)}var Qc=U(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,Wc(e,r)});function $c(e){var t=I(e);return t.__chain__=!0,t}function el(e,t){return t(e),e}function tl(e,t){return t(e)}var nl=qo(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return Mi(t,e)};return t>1||this.__actions__.length||!(i instanceof L)||!ms(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:tl,args:[a],thisArg:n}),new Wr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function rl(){return $c(this)}function il(){return new Wr(this.value(),this.__chain__)}function al(){this.__values__===n&&(this.__values__=Xu(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function ol(){return this}function sl(e){for(var t,r=this;r instanceof Ur;){var i=Hs(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function cl(){var e=this.__wrapped__;if(e instanceof L){var t=e;return this.__actions__.length&&(t=new L(this)),t=t.reverse(),t.__actions__.push({func:tl,args:[Sc],thisArg:n}),new Wr(t,this.__chain__)}return this.thru(Sc)}function ll(){return Ya(this.__wrapped__,this.__actions__)}var ul=vo(function(e,t,n){jt.call(e,n)?++e[n]:ji(e,n,1)});function dl(e,t,r){var i=Y(e)?Ln:Bi;return r&&hs(e,t,r)&&(t=n),i(e,K(t,3))}function fl(e,t){return(Y(e)?Rn:Ui)(e,K(t,3))}var pl=Eo(ec),ml=Eo(tc);function hl(e,t){return z(wl(e,t),1)}function gl(e,t){return z(wl(e,t),E)}function _l(e,t,r){return r=r===n?1:Z(r),z(wl(e,t),r)}function vl(e,t){return(Y(e)?Fn:Ri)(e,K(t,3))}function yl(e,t){return(Y(e)?In:zi)(e,K(t,3))}var bl=vo(function(e,t,n){jt.call(e,n)?e[n].push(t):ji(e,n,[t])});function xl(e,t,n,r){e=hu(e)?e:Hd(e),n=n&&!r?Z(n):0;var i=e.length;return n<0&&(n=ln(i+n,0)),Hu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Zn(e,t,n)>-1}var Sl=U(function(e,t,n){var r=-1,i=typeof t==`function`,a=hu(e)?nt(e.length):[];return Ri(e,function(e){a[++r]=i?Nn(t,e,n):ra(e,t,n)}),a}),Cl=vo(function(e,t,n){ji(e,n,t)});function wl(e,t){return(Y(e)?Vn:_a)(e,K(t,3))}function Tl(e,t,r,i){return e==null?[]:(Y(t)||(t=t==null?[]:[t]),r=i?n:r,Y(r)||(r=r==null?[]:[r]),Ca(e,t,r))}var El=vo(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function Dl(e,t,n){var r=Y(e)?Un:rr,i=arguments.length<3;return r(e,K(t,4),n,i,Ri)}function Ol(e,t,n){var r=Y(e)?Wn:rr,i=arguments.length<3;return r(e,K(t,4),n,i,zi)}function kl(e,t){return(Y(e)?Rn:Ui)(e,ql(K(t,3)))}function Al(e){return(Y(e)?Si:Ma)(e)}function jl(e,t,r){return t=(r?hs(e,t,r):t===n)?1:Z(t),(Y(e)?Ci:Na)(e,t)}function Ml(e){return(Y(e)?wi:La)(e)}function Nl(e){if(e==null)return 0;if(hu(e))return Hu(e)?kr(e):e.length;var t=as(e);return t==M||t==Ce?e.size:ha(e).length}function Pl(e,t,r){var i=Y(e)?Gn:za;return r&&hs(e,t,r)&&(t=n),i(e,K(t,3))}var Fl=U(function(e,t){if(e==null)return[];var n=t.length;return n>1&&hs(e,t[0],t[1])?t=[]:n>2&&hs(t[0],t[1],t[2])&&(t=[t[0]]),Ca(e,z(t,1),[])}),Il=Zt||function(){return xn.Date.now()};function Ll(e,t){if(typeof t!=`function`)throw new Tt(o);return e=Z(e),function(){if(--e<1)return t.apply(this,arguments)}}function Rl(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,Bo(e,w,n,n,n,n,t)}function zl(e,t){var r;if(typeof t!=`function`)throw new Tt(o);return e=Z(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var q=U(function(e,t,n){var r=_;if(n.length){var i=wr(n,Qo(q));r|=S}return Bo(e,r,t,n,i)}),J=U(function(e,t,n){var r=_|v;if(n.length){var i=wr(n,Qo(J));r|=S}return Bo(t,r,e,n,i)});function Bl(e,t,r){t=r?n:t;var i=Bo(e,b,n,n,n,n,n,t);return i.placeholder=Bl.placeholder,i}function Vl(e,t,r){t=r?n:t;var i=Bo(e,x,n,n,n,n,n,t);return i.placeholder=Vl.placeholder,i}function Hl(e,t,r){var i,a,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new Tt(o);t=$u(t)||0,Ou(r)&&(f=!!r.leading,p=`maxWait`in r,s=p?ln($u(r.maxWait)||0,t):s,m=`trailing`in r?!!r.trailing:m);function h(t){var r=i,o=a;return i=a=n,d=t,c=e.apply(o,r),c}function g(e){return d=e,l=Ns(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?pn(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=Il();if(v(e))return b(e);l=Ns(y,_(e))}function b(e){return l=n,m&&i?h(e):(i=a=n,c)}function x(){l!==n&&ro(l),d=0,i=u=a=l=n}function S(){return l===n?c:b(Il())}function C(){var e=Il(),r=v(e);if(i=arguments,a=this,u=e,r){if(l===n)return g(u);if(p)return ro(l),l=Ns(y,t),h(u)}return l===n&&(l=Ns(y,t)),c}return C.cancel=x,C.flush=S,C}var Ul=U(function(e,t){return Ii(e,1,t)}),Wl=U(function(e,t,n){return Ii(e,$u(t)||0,n)});function Gl(e){return Bo(e,ee)}function Kl(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new Tt(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Kl.Cache||oi),n}Kl.Cache=oi;function ql(e){if(typeof e!=`function`)throw new Tt(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Jl(e){return zl(2,e)}var Yl=to(function(e,t){t=t.length==1&&Y(t[0])?Vn(t[0],lr(K())):Vn(z(t,1),lr(K()));var n=t.length;return U(function(r){for(var i=-1,a=pn(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return Nn(e,this,r)})}),Xl=U(function(e,t){return Bo(e,S,n,t,wr(t,Qo(Xl)))}),Zl=U(function(e,t){return Bo(e,C,n,t,wr(t,Qo(Zl)))}),Ql=qo(function(e,t){return Bo(e,T,n,n,n,t)});function $l(e,t){if(typeof e!=`function`)throw new Tt(o);return t=t===n?t:Z(t),U(e,t)}function eu(e,t){if(typeof e!=`function`)throw new Tt(o);return t=t==null?0:ln(Z(t),0),U(function(n){var r=n[t],i=no(n,0,t);return r&&Hn(i,r),Nn(e,this,i)})}function tu(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw new Tt(o);return Ou(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),Hl(e,t,{leading:r,maxWait:t,trailing:i})}function nu(e){return Rl(e,1)}function ru(e,t){return Xl($a(t),e)}function iu(){if(!arguments.length)return[];var e=arguments[0];return Y(e)?e:[e]}function au(e){return Pi(e,m)}function ou(e,t){return t=typeof t==`function`?t:n,Pi(e,m,t)}function su(e){return Pi(e,f|m)}function cu(e,t){return t=typeof t==`function`?t:n,Pi(e,f|m,t)}function lu(e,t){return t==null||R(e,t,Cd(t))}function uu(e,t){return e===t||e!==e&&t!==t}var du=Fo(Qi),fu=Fo(function(e,t){return e>=t}),pu=ia(function(){return arguments}())?ia:function(e){return ku(e)&&jt.call(e,`callee`)&&!Wt.call(e,`callee`)},Y=nt.isArray,mu=Dn?lr(Dn):aa;function hu(e){return e!=null&&Du(e.length)&&!Tu(e)}function X(e){return ku(e)&&hu(e)}function gu(e){return e===!0||e===!1||ku(e)&&Zi(e)==me}var _u=nn||Xf,vu=On?lr(On):oa;function yu(e){return ku(e)&&e.nodeType===1&&!Ru(e)}function bu(e){if(e==null)return!0;if(hu(e)&&(Y(e)||typeof e==`string`||typeof e.splice==`function`||_u(e)||Wu(e)||pu(e)))return!e.length;var t=as(e);if(t==M||t==Ce)return!e.size;if(xs(e))return!ha(e).length;for(var n in e)if(jt.call(e,n))return!1;return!0}function xu(e,t){return sa(e,t)}function Su(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?sa(e,t,n,r):!!i}function Cu(e){if(!ku(e))return!1;var t=Zi(e);return t==j||t==ge||typeof e.message==`string`&&typeof e.name==`string`&&!Ru(e)}function wu(e){return typeof e==`number`&&on(e)}function Tu(e){if(!Ou(e))return!1;var t=Zi(e);return t==_e||t==ve||t==pe||t==P}function Eu(e){return typeof e==`number`&&e==Z(e)}function Du(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=D}function Ou(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function ku(e){return typeof e==`object`&&!!e}var Au=kn?lr(kn):la;function ju(e,t){return e===t||V(e,t,es(t))}function Mu(e,t,r){return r=typeof r==`function`?r:n,V(e,t,es(t),r)}function Nu(e){return Lu(e)&&e!=+e}function Pu(e){if(bs(e))throw new yt(a);return ua(e)}function Fu(e){return e===null}function Iu(e){return e==null}function Lu(e){return typeof e==`number`||ku(e)&&Zi(e)==ye}function Ru(e){if(!ku(e)||Zi(e)!=xe)return!1;var t=Ht(e);if(t===null)return!0;var n=jt.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&At.call(n)==Ft}var zu=An?lr(An):da;function Bu(e){return Eu(e)&&e>=-D&&e<=D}var Vu=jn?lr(jn):fa;function Hu(e){return typeof e==`string`||!Y(e)&&ku(e)&&Zi(e)==we}function Uu(e){return typeof e==`symbol`||ku(e)&&Zi(e)==Te}var Wu=Mn?lr(Mn):pa;function Gu(e){return e===n}function Ku(e){return ku(e)&&as(e)==De}function qu(e){return ku(e)&&Zi(e)==Oe}var Ju=Fo(H),Yu=Fo(function(e,t){return e<=t});function Xu(e){if(!e)return[];if(hu(e))return Hu(e)?Ar(e):mo(e);if(qt&&e[qt])return xr(e[qt]());var t=as(e);return(t==M?Sr:t==Ce?Tr:Hd)(e)}function Zu(e){return e?(e=$u(e),e===E||e===-E?(e<0?-1:1)*O:e===e?e:0):e===0?e:0}function Z(e){var t=Zu(e),n=t%1;return t===t?n?t-n:t:0}function Qu(e){return e?Ni(Z(e),0,le):0}function $u(e){if(typeof e==`number`)return e;if(Uu(e))return ce;if(Ou(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Ou(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=cr(e);var n=ft.test(e);return n||mt.test(e)?vn(e.slice(2),n?2:8):dt.test(e)?ce:+e}function ed(e){return ho(e,wd(e))}function td(e){return e?Ni(Z(e),-D,D):e===0?e:0}function Q(e){return e==null?``:Wa(e)}var nd=G(function(e,t){if(xs(t)||hu(t)){ho(t,Cd(t),e);return}for(var n in t)jt.call(t,n)&&Ei(e,n,t[n])}),rd=G(function(e,t){ho(t,wd(t),e)}),id=G(function(e,t,n,r){ho(t,wd(t),e,r)}),ad=G(function(e,t,n,r){ho(t,Cd(t),e,r)}),od=qo(Mi);function sd(e,t){var n=Hr(e);return t==null?n:ki(n,t)}var cd=U(function(e,t){e=St(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&hs(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=wd(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||uu(d,Ot[u])&&!jt.call(e,u))&&(e[u]=o[u])}return e}),ld=U(function(e){return e.push(n,Ho),Nn(Od,n,e)});function ud(e,t){return Yn(e,K(t,3),Ki)}function dd(e,t){return Yn(e,K(t,3),qi)}function fd(e,t){return e==null?e:Wi(e,K(t,3),wd)}function pd(e,t){return e==null?e:Gi(e,K(t,3),wd)}function md(e,t){return e&&Ki(e,K(t,3))}function hd(e,t){return e&&qi(e,K(t,3))}function gd(e){return e==null?[]:Ji(e,Cd(e))}function _d(e){return e==null?[]:Ji(e,wd(e))}function vd(e,t,r){var i=e==null?n:Yi(e,t);return i===n?r:i}function $(e,t){return e!=null&&cs(e,t,B)}function yd(e,t){return e!=null&&cs(e,t,$i)}var bd=ko(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=Pt.call(t)),e[t]=n},Of(Mf)),xd=ko(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=Pt.call(t)),jt.call(e,t)?e[t].push(n):e[t]=[n]},K),Sd=U(ra);function Cd(e){return hu(e)?xi(e):ha(e)}function wd(e){return hu(e)?xi(e,!0):ga(e)}function Td(e,t){var n={};return t=K(t,3),Ki(e,function(e,r,i){ji(n,t(e,r,i),e)}),n}function Ed(e,t){var n={};return t=K(t,3),Ki(e,function(e,r,i){ji(n,r,t(e,r,i))}),n}var Dd=G(function(e,t,n){ba(e,t,n)}),Od=G(function(e,t,n,r){ba(e,t,n,r)}),kd=qo(function(e,t){var n={};if(e==null)return n;var r=!1;t=Vn(t,function(t){return t=eo(t,e),r||=t.length>1,t}),ho(e,Yo(e),n),r&&(n=Pi(n,f|p|m,Uo));for(var i=t.length;i--;)Ka(n,t[i]);return n});function Ad(e,t){return Md(e,ql(K(t)))}var jd=qo(function(e,t){return e==null?{}:wa(e,t)});function Md(e,t){if(e==null)return{};var n=Vn(Yo(e),function(e){return[e]});return t=K(t),Ta(e,n,function(e,n){return t(e,n[0])})}function Nd(e,t,r){t=eo(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[zs(t[i])];o===n&&(i=a,o=r),e=Tu(o)?o.call(e):o}return e}function Pd(e,t,n){return e==null?e:Pa(e,t,n)}function Fd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:Pa(e,t,r,i)}var Id=zo(Cd),Ld=zo(wd);function Rd(e,t,n){var r=Y(e),i=r||_u(e)||Wu(e);if(t=K(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:Ou(e)&&Tu(a)?Hr(Ht(e)):{}}return(i?Fn:Ki)(e,function(e,r,i){return t(n,e,r,i)}),n}function zd(e,t){return e==null?!0:Ka(e,t)}function Bd(e,t,n){return e==null?e:qa(e,t,$a(n))}function Vd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:qa(e,t,$a(r),i)}function Hd(e){return e==null?[]:ur(e,Cd(e))}function Ud(e){return e==null?[]:ur(e,wd(e))}function Wd(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=$u(r),r=r===r?r:0),t!==n&&(t=$u(t),t=t===t?t:0),Ni($u(e),t,r)}function Gd(e,t,r){return t=Zu(t),r===n?(r=t,t=0):r=Zu(r),e=$u(e),ea(e,t,r)}function Kd(e,t,r){if(r&&typeof r!=`boolean`&&hs(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Zu(e),t===n?(t=e,e=0):t=Zu(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=gn();return pn(e+a*(t-e+_n(`1e-`+((a+``).length-1))),t)}return ka(e,t)}var qd=Co(function(e,t,n){return t=t.toLowerCase(),e+(n?Jd(t):t)});function Jd(e){return Sf(Q(e).toLowerCase())}function Yd(e){return e=Q(e),e&&e.replace(gt,hr).replace(an,``)}function Xd(e,t,r){e=Q(e),t=Wa(t);var i=e.length;r=r===n?i:Ni(Z(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function Zd(e){return e=Q(e),e&&Ke.test(e)?e.replace(We,gr):e}function Qd(e){return e=Q(e),e&&et.test(e)?e.replace($e,`\\$&`):e}var $d=Co(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),ef=Co(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),tf=So(`toLowerCase`);function nf(e,t,n){e=Q(e),t=Z(t);var r=t?kr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Mo(en(i),n)+e+Mo($t(i),n)}function rf(e,t,n){e=Q(e),t=Z(t);var r=t?kr(e):0;return t&&r<t?e+Mo(t-r,n):e}function af(e,t,n){e=Q(e),t=Z(t);var r=t?kr(e):0;return t&&r<t?Mo(t-r,n)+e:e}function of(e,t,n){return n||t==null?t=0:t&&=+t,hn(Q(e).replace(tt,``),t||0)}function sf(e,t,r){return t=(r?hs(e,t,r):t===n)?1:Z(t),ja(Q(e),t)}function cf(){var e=arguments,t=Q(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var lf=Co(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function uf(e,t,r){return r&&typeof r!=`number`&&hs(e,t,r)&&(t=r=n),r=r===n?le:r>>>0,r?(e=Q(e),e&&(typeof t==`string`||t!=null&&!zu(t))&&(t=Wa(t),!t&&yr(e))?no(Ar(e),0,r):e.split(t,r)):[]}var df=Co(function(e,t,n){return e+(n?` `:``)+Sf(t)});function ff(e,t,n){return e=Q(e),n=n==null?0:Ni(Z(n),0,e.length),t=Wa(t),e.slice(n,n+t.length)==t}function pf(e,t,r){var i=I.templateSettings;r&&hs(e,t,r)&&(t=n),e=Q(e),t=ad({},t,i,Vo);var a=ad({},t.imports,i.imports,Vo),o=Cd(a),l=ur(a,o);Fn(o,function(e){if(st.test(e))throw new yt(c)});var u,d,f=0,p=t.interpolate||_t,m=`__p += '`,h=Ct((t.escape||_t).source+`|`+p.source+`|`+(p===Ye?lt:_t).source+`|`+(t.evaluate||_t).source+`|$`,`g`),g=`//# sourceURL=`+(jt.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++dn+`]`)+`
|
|
@@ -33,4 +33,4 @@ Error generating stack: `+e.message+`
|
|
|
33
33
|
|
|
34
34
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=jn(),d;if(t){let e=typeof t==`string`?xt(t):t;ht(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):wt(e,{pathname:p});gt(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),gt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Wn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:$t([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:$t([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?N.createElement(xn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Rn(){let e=$n(),t=on(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=N.createElement(N.Fragment,null,N.createElement(`p`,null,`💿 Hey developer 👋`),N.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,N.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,N.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),N.createElement(N.Fragment,null,N.createElement(`h2`,null,`Unexpected Application Error!`),N.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?N.createElement(`pre`,{style:i},n):null,o)}var zn=N.createElement(Rn,null),Bn=class extends N.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=On(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:N.createElement(Sn.Provider,{value:this.props.routeContext},N.createElement(Cn.Provider,{value:e,children:this.props.component}));return this.context?N.createElement(Hn,{error:e},t):t}};Bn.contextType=hn;var Vn=new WeakMap;function Hn({children:e,error:t}){let{basename:n}=N.useContext(bn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Dn(t.digest);if(e){let r=Vn.get(t);if(r)throw r;let i=ln(e.location,n),a=i.absoluteURL||i.to;if(F(a))throw Error(`Invalid redirect location`);if(cn&&!Vn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Vn.set(t,n),n}return N.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function Un({routeContext:e,match:t,children:n}){let r=N.useContext(pn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),N.createElement(Sn.Provider,{value:e},n)}function Wn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);ht(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:sn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||zn,o&&(s<0&&c===0?(nr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?N.createElement(n.route.Component,null):n.route.element?n.route.element:e,N.createElement(Un,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?N.createElement(Bn,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Gn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Kn(e){let t=N.useContext(pn);return ht(t,Gn(e)),t}function qn(e){let t=N.useContext(mn);return ht(t,Gn(e)),t}function Jn(e){let t=N.useContext(Sn);return ht(t,Gn(e)),t}function Yn(e){let t=Jn(e),n=t.matches[t.matches.length-1];return ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Xn(){return Yn(`useRouteId`)}function Zn(){let e=qn(`useNavigation`);return N.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Qn(){let{matches:e,loaderData:t}=qn(`useMatches`);return N.useMemo(()=>e.map(e=>Et(e,t)),[e,t])}function $n(){let e=N.useContext(Cn),t=qn(`useRouteError`),n=Yn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function er(){let{router:e}=Kn(`useNavigate`),t=Yn(`useNavigate`),n=N.useRef(!1);return Nn(()=>{n.current=!0}),N.useCallback(async(r,i={})=>{gt(n.current,Mn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var tr={};function nr(e,t,n){!t&&!tr[e]&&(tr[e]=!0,gt(!1,n))}N.memo(rr);function rr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Ln(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ir({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){ht(!An(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=N.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=xt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=N.useMemo(()=>{let e=Gt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return gt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:N.createElement(bn.Provider,{value:c},N.createElement(xn.Provider,{children:t,value:h}))}N.Component;var ar=`get`,or=`application/x-www-form-urlencoded`;function sr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function cr(e){return sr(e)&&e.tagName.toLowerCase()===`button`}function lr(e){return sr(e)&&e.tagName.toLowerCase()===`form`}function ur(e){return sr(e)&&e.tagName.toLowerCase()===`input`}function dr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function fr(e,t){return e.button===0&&(!t||t===`_self`)&&!dr(e)}function pr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function mr(e,t){let n=pr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var hr=null;function gr(){if(hr===null)try{new FormData(document.createElement(`form`),0),hr=!1}catch{hr=!0}return hr}var _r=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function vr(e){return e!=null&&!_r.has(e)?(gt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${or}"`),null):e}function yr(e,t){let n,r,i,a,o;if(lr(e)){let o=e.getAttribute(`action`);r=o?Gt(o,t):null,n=e.getAttribute(`method`)||ar,i=vr(e.getAttribute(`enctype`))||or,a=new FormData(e)}else if(cr(e)||ur(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Gt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||ar,i=vr(e.getAttribute(`formenctype`))||vr(o.getAttribute(`enctype`))||or,a=new FormData(o,e),!gr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(sr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ar,r=null,i=or,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var br={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},xr=/[&><\u2028\u2029]/g;function Sr(e){return e.replace(xr,e=>br[e])}function Cr(e,t){if(e===!1||e==null)throw Error(t)}function wr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Gt(i.pathname,t)===`/`?i.pathname=`${en(t)}/_root.${r}`:i.pathname=`${en(i.pathname)}.${r}`,i}async function Tr(e,t){if(e.id in t)return t[e.id];try{let n=await i(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Er(e){return e!=null&&typeof e.page==`string`}function Dr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Or(e,t,n){return Nr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Tr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Dr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function kr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ar(e,t,{includeHydrateFallback:n}={}){return jr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function jr(e){return[...new Set(e)]}function Mr(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Nr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Er(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Mr(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Pr(){let e=N.useContext(pn);return Cr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Fr(){let e=N.useContext(mn);return Cr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ir=N.createContext(void 0);Ir.displayName=`FrameworkContext`;function Lr(){let e=N.useContext(Ir);return Cr(e,`You must render this element inside a <HydratedRouter> element`),e}function Rr(e,t){let n=N.useContext(Ir),[r,i]=N.useState(!1),[a,o]=N.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=N.useRef(null);N.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),N.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:zr(s,p),onBlur:zr(c,m),onMouseEnter:zr(l,p),onMouseLeave:zr(u,m),onTouchStart:zr(d,p)}]:[a,f,{}]:[!1,f,{}]}function zr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Br({page:e,...t}){let n=gn(),{nonce:r}=Lr(),{router:i}=Pr(),a=N.useMemo(()=>wt(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?N.createElement(I,{page:e,matches:a,...t}):N.createElement(Hr,{page:e,matches:a,...t})):null}function Vr(e){let{manifest:t,routeModules:n}=Lr(),[r,i]=N.useState([]);return N.useEffect(()=>{let r=!1;return Or(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function I({page:e,matches:t,...n}){let r=jn(),{future:i}=Lr(),{basename:a}=Pr(),o=N.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=wr(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return N.createElement(N.Fragment,null,o.map(e=>N.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Hr({page:e,matches:t,...n}){let r=jn(),{future:i,manifest:a,routeModules:o}=Lr(),{basename:s}=Pr(),{loaderData:c,matches:l}=Fr(),u=N.useMemo(()=>kr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=N.useMemo(()=>kr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=N.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=wr(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=N.useMemo(()=>Ar(d,a),[d,a]),m=Vr(d);return N.createElement(N.Fragment,null,f.map(e=>N.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>N.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>N.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ur(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}N.Component;var Wr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Wr&&(window.__reactRouterVersion=`7.18.0`)}catch{}function L({basename:e,children:t,useTransitions:n,window:r}){let i=N.useRef();i.current??=mt({window:r,v5Compat:!0});let a=i.current,[o,s]=N.useState({action:a.action,location:a.location}),c=N.useCallback(e=>{n===!1?s(e):N.startTransition(()=>s(e))},[n]);return N.useLayoutEffect(()=>a.listen(c),[a,c]),N.createElement(ir,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Gr({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=N.useState({action:n.action,location:n.location}),o=N.useCallback(e=>{r===!1?a(e):N.startTransition(()=>a(e))},[r]);return N.useLayoutEffect(()=>n.listen(o),[n,o]),N.createElement(ir,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Gr.displayName=`unstable_HistoryRouter`;var Kr=N.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=N.useContext(bn),v=typeof l==`string`&<.test(l),y=ln(l,h);l=y.to;let b=kn(l,{relative:r}),x=jn(),S=null;if(o){let e=Zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:$t([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Rr(n,p),ee=$r(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function te(t){e&&e(t),t.defaultPrevented||ee(t)}let ne=!(y.isExternal||i),re=N.createElement(`a`,{...p,...T,href:(ne?S:void 0)||y.absoluteURL||b,onClick:ne?te:e,ref:Ur(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?N.createElement(N.Fragment,null,re,N.createElement(Br,{page:b})):re});Kr.displayName=`Link`;var qr=N.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=In(a,{relative:c.relative}),d=jn(),f=N.useContext(mn),{navigator:p,basename:m}=N.useContext(bn),h=f!=null&&ui(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Gt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return N.createElement(Kr,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});qr.displayName=`NavLink`;var Jr=N.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ar,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=N.useContext(bn),g=ri(),_=ii(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&<.test(s);return N.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?N.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Jr.displayName=`Form`;function Yr({getKey:e,storageKey:t,...n}){let r=N.useContext(Ir),{basename:i}=N.useContext(bn),a=jn(),o=Qn();ci({getKey:e,storageKey:t});let s=N.useMemo(()=>{if(!r||!e)return null;let t=si(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),N.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Sr(JSON.stringify(t||ai))}, ${Sr(JSON.stringify(s))})`}})}Yr.displayName=`ScrollRestoration`;function Xr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zr(e){let t=N.useContext(pn);return ht(t,Xr(e)),t}function Qr(e){let t=N.useContext(mn);return ht(t,Xr(e)),t}function $r(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Pn(),d=jn(),f=In(e,{relative:o});return N.useCallback(p=>{if(fr(p,t)){p.preventDefault();let t=n===void 0?bt(d)===bt(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?N.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function ei(e){gt(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=N.useRef(pr(e)),n=N.useRef(!1),r=jn(),i=N.useMemo(()=>mr(r.search,n.current?null:t.current),[r.search]),a=Pn();return[i,N.useCallback((e,t)=>{let r=pr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var ti=0,ni=()=>`__${String(++ti)}__`;function ri(){let{router:e}=Zr(`useSubmit`),{basename:t}=N.useContext(bn),n=Xn(),r=e.fetch,i=e.navigate;return N.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=yr(e,t);a.navigate===!1?await r(a.fetcherKey||ni(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function ii(e,{relative:t}={}){let{basename:n}=N.useContext(bn),r=N.useContext(Sn);ht(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...In(e||`.`,{relative:t})},o=jn();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:$t([n,a.pathname])),bt(a)}var ai=`react-router-scroll-positions`,oi={};function si(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Gt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ci({getKey:e,storageKey:t}={}){let{router:n}=Zr(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Qr(`useScrollRestoration`),{basename:a}=N.useContext(bn),o=jn(),s=Qn(),c=Zn();N.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),li(N.useCallback(()=>{if(c.state===`idle`){let t=si(o,s,a,e);oi[t]=window.scrollY}try{sessionStorage.setItem(t||ai,JSON.stringify(oi))}catch(e){gt(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(N.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||ai);e&&(oi=JSON.parse(e))}catch{}},[t]),N.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(oi,()=>window.scrollY,e?(t,n)=>si(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),N.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{gt(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function li(e,t){let{capture:n}=t||{};N.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ui(e,{relative:t}={}){let n=N.useContext(_n);ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Zr(`useViewTransitionState`),i=In(e,{relative:t});if(!n.isTransitioning)return!1;let a=Gt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Gt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vt(i.pathname,o)!=null||Vt(i.pathname,a)!=null}var di=e(ct(),1),fi=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},pi=(e,t)=>({classGroupId:e,validator:t}),mi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hi=`-`,gi=[],_i=`arbitrary..`,vi=e=>{let t=xi(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return bi(e);let n=e.split(hi);return yi(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fi(i,t):t:i||gi}return n[e]||gi}}},yi=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=yi(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(hi):e.slice(t).join(hi),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},bi=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?_i+r:void 0})(),xi=e=>{let{theme:t,classGroups:n}=e;return Si(n,t)},Si=(e,t)=>{let n=mi();for(let r in e){let i=e[r];Ci(i,n,r,t)}return n},Ci=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];wi(i,t,n,r)}},wi=(e,t,n,r)=>{if(typeof e==`string`){Ti(e,t,n);return}if(typeof e==`function`){Ei(e,t,n,r);return}Di(e,t,n,r)},Ti=(e,t,n)=>{let r=e===``?t:Oi(t,e);r.classGroupId=n},Ei=(e,t,n,r)=>{if(ki(e)){Ci(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pi(n,e))},Di=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ci(o,Oi(t,a),n,r)}},Oi=(e,t)=>{let n=e,r=t.split(hi),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=mi(),n.nextPart.set(t,i)),n=i}return n},ki=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ai=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ji=`!`,Mi=`:`,Ni=[],Pi=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fi=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Mi){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ji)?(c=s.slice(0,-1),l=!0):s.startsWith(ji)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Pi(t,l,c,u)};if(t){let e=t+Mi,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Pi(Ni,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},R=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ii=e=>({cache:Ai(e.cacheSize),parseClassName:Fi(e),sortModifiers:R(e),postfixLookupClassGroupIds:Li(e),...vi(e)}),Li=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ri=/\s+/,zi=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ri),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+ji:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Bi=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Vi(n))&&(i&&(i+=` `),i+=r);return i},Vi=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Vi(e[r]))&&(n&&(n+=` `),n+=t);return n},Hi=(e,...t)=>{let n,r,i,a,o=o=>(n=Ii(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=zi(e,n);return i(e,a),a};return a=o,(...e)=>a(Bi(...e))},Ui=[],z=e=>{let t=t=>t[e]||Ui;return t.isThemeGetter=!0,t},Wi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ki=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,qi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ji=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Yi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Xi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qi=e=>Ki.test(e),B=e=>!!e&&!Number.isNaN(Number(e)),$i=e=>!!e&&Number.isInteger(Number(e)),ea=e=>e.endsWith(`%`)&&B(e.slice(0,-1)),ta=e=>qi.test(e),na=()=>!0,ra=e=>Ji.test(e)&&!Yi.test(e),ia=()=>!1,aa=e=>Xi.test(e),oa=e=>Zi.test(e),sa=e=>!V(e)&&!H(e),ca=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),la=e=>wa(e,Oa,ia),V=e=>Wi.test(e),ua=e=>wa(e,ka,ra),da=e=>wa(e,Aa,B),fa=e=>wa(e,U,na),pa=e=>wa(e,ja,ia),ma=e=>wa(e,Ea,ia),ha=e=>wa(e,Da,oa),ga=e=>wa(e,Ma,aa),H=e=>Gi.test(e),_a=e=>Ta(e,ka),va=e=>Ta(e,ja),ya=e=>Ta(e,Ea),ba=e=>Ta(e,Oa),xa=e=>Ta(e,Da),Sa=e=>Ta(e,Ma,!0),Ca=e=>Ta(e,U,!0),wa=(e,t,n)=>{let r=Wi.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ta=(e,t,n=!1)=>{let r=Gi.exec(e);return r?r[1]?t(r[1]):n:!1},Ea=e=>e===`position`||e===`percentage`,Da=e=>e===`image`||e===`url`,Oa=e=>e===`length`||e===`size`||e===`bg-size`,ka=e=>e===`length`,Aa=e=>e===`number`,ja=e=>e===`family-name`,U=e=>e===`number`||e===`weight`,Ma=e=>e===`shadow`,Na=Hi(()=>{let e=z(`color`),t=z(`font`),n=z(`text`),r=z(`font-weight`),i=z(`tracking`),a=z(`leading`),o=z(`breakpoint`),s=z(`container`),c=z(`spacing`),l=z(`radius`),u=z(`shadow`),d=z(`inset-shadow`),f=z(`text-shadow`),p=z(`drop-shadow`),m=z(`blur`),h=z(`perspective`),g=z(`aspect`),_=z(`ease`),v=z(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),H,V],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[H,V,c],T=()=>[Qi,`full`,`auto`,...w()],ee=()=>[$i,`none`,`subgrid`,H,V],te=()=>[`auto`,{span:[`full`,$i,H,V]},$i,H,V],ne=()=>[$i,`auto`,H,V],re=()=>[`auto`,`min`,`max`,`fr`,H,V],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],oe=()=>[`auto`,...w()],se=()=>[Qi,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],E=()=>[Qi,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],D=()=>[Qi,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,H,V],ce=()=>[...b(),ya,ma,{position:[H,V]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,ba,la,{size:[H,V]}],de=()=>[ea,_a,ua],k=()=>[``,`none`,`full`,l,H,V],A=()=>[``,B,_a,ua],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[B,ea,ya,ma],he=()=>[``,`none`,m,H,V],ge=()=>[`none`,B,H,V],j=()=>[`none`,B,H,V],_e=()=>[B,H,V],ve=()=>[Qi,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[ta],breakpoint:[ta],color:[na],container:[ta],"drop-shadow":[ta],ease:[`in`,`out`,`in-out`],font:[sa],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[ta],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[ta],shadow:[ta],spacing:[`px`,B],text:[ta],"text-shadow":[ta],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Qi,V,H,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,H,V]}],"container-named":[ca],columns:[{columns:[B,V,H,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[$i,`auto`,H,V]}],basis:[{basis:[Qi,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[B,Qi,`auto`,`initial`,`none`,V]}],grow:[{grow:[``,B,H,V]}],shrink:[{shrink:[``,B,H,V]}],order:[{order:[$i,`first`,`last`,`none`,H,V]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:se()}],"inline-size":[{inline:[`auto`,...E()]}],"min-inline-size":[{"min-inline":[`auto`,...E()]}],"max-inline-size":[{"max-inline":[`none`,...E()]}],"block-size":[{block:[`auto`,...D()]}],"min-block-size":[{"min-block":[`auto`,...D()]}],"max-block-size":[{"max-block":[`none`,...D()]}],w:[{w:[s,`screen`,...se()]}],"min-w":[{"min-w":[s,`screen`,`none`,...se()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...se()]}],h:[{h:[`screen`,`lh`,...se()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...se()]}],"max-h":[{"max-h":[`screen`,`lh`,...se()]}],"font-size":[{text:[`base`,n,_a,ua]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Ca,fa]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,ea,V]}],"font-family":[{font:[va,pa,t]}],"font-features":[{"font-features":[V]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,H,V]}],"line-clamp":[{"line-clamp":[B,`none`,H,da]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,H,V]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,H,V]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[B,`from-font`,`auto`,H,ua]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[B,`auto`,H,V]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[$i,H,V]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,H,V]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,H,V]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},$i,H,V],radial:[``,H,V],conic:[$i,H,V]},xa,ha]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:k()}],"rounded-s":[{"rounded-s":k()}],"rounded-e":[{"rounded-e":k()}],"rounded-t":[{"rounded-t":k()}],"rounded-r":[{"rounded-r":k()}],"rounded-b":[{"rounded-b":k()}],"rounded-l":[{"rounded-l":k()}],"rounded-ss":[{"rounded-ss":k()}],"rounded-se":[{"rounded-se":k()}],"rounded-ee":[{"rounded-ee":k()}],"rounded-es":[{"rounded-es":k()}],"rounded-tl":[{"rounded-tl":k()}],"rounded-tr":[{"rounded-tr":k()}],"rounded-br":[{"rounded-br":k()}],"rounded-bl":[{"rounded-bl":k()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-bs":[{"border-bs":A()}],"border-w-be":[{"border-be":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":A()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[B,H,V]}],"outline-w":[{outline:[``,B,_a,ua]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,u,Sa,ga]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,d,Sa,ga]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:A()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[B,ua]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,f,Sa,ga]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[B,H,V]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[B]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[H,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[B]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,H,V]}],filter:[{filter:[``,`none`,H,V]}],blur:[{blur:he()}],brightness:[{brightness:[B,H,V]}],contrast:[{contrast:[B,H,V]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Sa,ga]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,B,H,V]}],"hue-rotate":[{"hue-rotate":[B,H,V]}],invert:[{invert:[``,B,H,V]}],saturate:[{saturate:[B,H,V]}],sepia:[{sepia:[``,B,H,V]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,H,V]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[B,H,V]}],"backdrop-contrast":[{"backdrop-contrast":[B,H,V]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,B,H,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[B,H,V]}],"backdrop-invert":[{"backdrop-invert":[``,B,H,V]}],"backdrop-opacity":[{"backdrop-opacity":[B,H,V]}],"backdrop-saturate":[{"backdrop-saturate":[B,H,V]}],"backdrop-sepia":[{"backdrop-sepia":[``,B,H,V]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,H,V]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[B,`initial`,H,V]}],ease:[{ease:[`linear`,`initial`,_,H,V]}],delay:[{delay:[B,H,V]}],animate:[{animate:[`none`,v,H,V]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,H,V]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":[`scale-3d`],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[H,V,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":[`translate-none`],zoom:[{zoom:[$i,H,V]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,H,V]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,H,V]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[B,_a,ua,da]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Pa(...e){return Na(k(e))}var Fa=5e3,Ia={"2xs":`icon-2xs`,xs:`icon-xs`,sm:`icon-sm`,base:`icon-base`,lg:`icon-lg`,xl:`icon-xl`};function La(e){let t=e.split(`/`).pop()??``,n=t.indexOf(`-`);return n>=0?`${t.substring(0,n)}/${t.substring(n+1)}`:t}function Ra(e){if(e.branch)return e.branch;if(e.worktreePath)return La(e.worktreePath)}function za(e){return Ra(e)??e.baseBranch??void 0}function Ba(e,t){if(e.mode!==`local`)return!1;let n=za(e);return n?!t||t.mode!==`local`||t.projectId!==e.projectId?!0:za(t)!==n:!1}function Va(e,t,n=`nearest`,r=36){let i=t.getBoundingClientRect(),a=e.getBoundingClientRect(),o=i.top-a.top,s=i.bottom-a.top;if(n===`start`){let t=e.scrollTop+o-r;e.scrollTo({top:Math.max(0,t),behavior:`smooth`});return}if(o<r){let t=e.scrollTop+o-r;e.scrollTo({top:Math.max(0,t),behavior:`smooth`})}else if(s>e.clientHeight){let t=e.scrollTop+(s-e.clientHeight);e.scrollTo({top:t,behavior:`smooth`})}}function Ha({className:e,...t}){return(0,P.jsx)(`div`,{className:Pa(`animate-pulse rounded-md bg-muted`,e),...t})}var Ua=`sidebar_width`,Wa=240;function Ga(){try{let e=localStorage.getItem(Ua);return e?Number(e):Wa}catch{return Wa}}function Ka(){return(0,P.jsxs)(`div`,{className:`bg-background flex h-screen overflow-hidden`,children:[(0,P.jsxs)(`div`,{style:{width:Ga()},className:`border-sidebar-border bg-sidebar flex shrink-0 flex-col border-r`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3`,children:[(0,P.jsx)(Ha,{className:`h-5 w-24`}),(0,P.jsxs)(`div`,{className:`flex gap-1`,children:[(0,P.jsx)(Ha,{className:`size-7 rounded-md`}),(0,P.jsx)(Ha,{className:`size-7 rounded-md`})]})]}),(0,P.jsx)(`div`,{className:`px-4 pt-3 pb-2`,children:(0,P.jsx)(Ha,{className:`h-3 w-16`})}),(0,P.jsxs)(`div`,{className:`space-y-1 px-2`,children:[(0,P.jsx)(Ha,{className:`h-8 w-full rounded-md`}),(0,P.jsx)(Ha,{className:`h-8 w-full rounded-md`})]}),(0,P.jsxs)(`div`,{className:`flex items-center justify-between px-4 pt-4 pb-2`,children:[(0,P.jsx)(Ha,{className:`h-3 w-16`}),(0,P.jsx)(Ha,{className:`size-5 rounded`})]}),(0,P.jsx)(`div`,{className:`flex-1 space-y-1.5 px-2`,children:Array.from({length:3}).map((e,t)=>(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(Ha,{className:`h-7 w-full rounded-md`}),(0,P.jsxs)(`div`,{className:`space-y-1 pl-6`,children:[(0,P.jsx)(Ha,{className:`h-6 w-4/5 rounded-md`}),(0,P.jsx)(Ha,{className:`h-6 w-3/5 rounded-md`})]})]},`skeleton-${t}`))})]}),(0,P.jsxs)(`div`,{className:`bg-background flex flex-1 flex-col`,children:[(0,P.jsx)(`div`,{className:`border-border flex items-center gap-3 border-b px-4 py-3`,children:(0,P.jsx)(Ha,{className:`h-5 w-48`})}),(0,P.jsxs)(`div`,{className:`flex-1 space-y-4 p-4`,children:[(0,P.jsx)(Ha,{className:`h-14 w-3/4 rounded-lg`}),(0,P.jsx)(Ha,{className:`h-10 w-1/2 rounded-lg`}),(0,P.jsx)(Ha,{className:`h-14 w-2/3 rounded-lg`})]}),(0,P.jsx)(`div`,{className:`border-border border-t p-4`,children:(0,P.jsx)(Ha,{className:`h-20 w-full rounded-lg`})})]})]})}function qa(e,t=globalThis?.document){let n=he(e);N.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Ja=`DismissableLayer`,Ya=`dismissableLayer.update`,Xa=`dismissableLayer.pointerDownOutside`,Za=`dismissableLayer.focusOutside`,Qa,$a=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),eo=N.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=N.useContext($a),[d,f]=N.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=N.useState({}),h=_e(t,e=>f(e)),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(_),y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=N.useRef(!1),C=io(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...u.branches].some(e=>e.contains(t));!x||n||(a?.(e),s?.(e),e.defaultPrevented||c?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces}),w=ao(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p);return qa(e=>{y===u.layers.size-1&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},p),N.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Qa=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),oo(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Qa))}},[d,p,n,u]),N.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),oo())},[d,u]),N.useEffect(()=>{let e=()=>m({});return document.addEventListener(Ya,e),()=>document.removeEventListener(Ya,e)},[]),(0,P.jsx)(fe.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:ge(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ge(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ge(e.onPointerDownCapture,C.onPointerDownCapture)})});eo.displayName=Ja;var to=`DismissableLayerBranch`,no=N.forwardRef((e,t)=>{let n=N.useContext($a),r=N.useRef(null),i=_e(t,r);return N.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,P.jsx)(fe.div,{...e,ref:i})});no.displayName=to;function ro(){let e=N.useContext($a),[t,n]=N.useState(null);return N.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}function io(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,o=he(e),s=N.useRef(!1),c=N.useRef(!1),l=N.useRef(new Map),u=N.useRef(()=>{});return N.useEffect(()=>{function e(){c.current=!1,i.current=!1,l.current.clear()}function t(){return Array.from(l.current.values()).some(Boolean)}function d(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||l.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{c.current&&u.current()},0)}function f(e){c.current&&l.current.set(e.type,!1)}let p=a=>{if(a.target&&!s.current){let s=function(){n.removeEventListener(`click`,u.current);let r=t();e(),r||so(Xa,o,d,{discrete:!0})},d={originalEvent:a};c.current=!0,i.current=r&&a.button===0,l.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,u.current),u.current=s,n.addEventListener(`click`,u.current,{once:!0}))}else n.removeEventListener(`click`,u.current),e();s.current=!1},m=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of m)n.addEventListener(e,d,!0),n.addEventListener(e,f);let h=window.setTimeout(()=>{n.addEventListener(`pointerdown`,p)},0);return()=>{window.clearTimeout(h),n.removeEventListener(`pointerdown`,p),n.removeEventListener(`click`,u.current);for(let e of m)n.removeEventListener(e,d,!0),n.removeEventListener(e,f)}},[n,o,r,i,a]),{onPointerDownCapture:()=>s.current=!0}}function ao(e,t=globalThis?.document){let n=he(e),r=N.useRef(!1);return N.useEffect(()=>{let e=e=>{e.target&&!r.current&&so(Za,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function oo(){let e=new CustomEvent(Ya);document.dispatchEvent(e)}function so(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?A(i,a):i.dispatchEvent(a)}var co=N.useId||(()=>void 0),W=0;function lo(e){let[t,n]=N.useState(co());return pe(()=>{e||n(e=>e??String(W++))},[e]),e||(t?`radix-${t}`:``)}var uo=[`top`,`right`,`bottom`,`left`],fo=Math.min,po=Math.max,mo=Math.round,ho=Math.floor,go=e=>({x:e,y:e}),_o={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vo(e,t,n){return po(e,fo(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function yo(e){return e.split(`-`)[0]}function bo(e){return e.split(`-`)[1]}function xo(e){return e===`x`?`y`:`x`}function So(e){return e===`y`?`height`:`width`}function Co(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function wo(e){return xo(Co(e))}function To(e,t,n){n===void 0&&(n=!1);let r=bo(e),i=wo(e),a=So(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Po(o)),[o,Po(o)]}function Eo(e){let t=Po(e);return[Do(e),t,Do(t)]}function Do(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Oo=[`left`,`right`],ko=[`right`,`left`],Ao=[`top`,`bottom`],jo=[`bottom`,`top`];function Mo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ko:Oo:t?Oo:ko;case`left`:case`right`:return t?Ao:jo;default:return[]}}function No(e,t,n,r){let i=bo(e),a=Mo(yo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Do)))),a}function Po(e){let t=yo(e);return _o[t]+e.slice(t.length)}function Fo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Io(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Fo(e)}function Lo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ro(e,t,n){let{reference:r,floating:i}=e,a=Co(t),o=wo(t),s=So(o),c=yo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bo(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function zo(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=Io(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Lo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Lo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Bo=50,Vo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:zo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ro(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Bo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ro(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ho=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=G(e,t)||{};if(l==null)return{};let d=Io(u),f={x:n,y:r},p=wo(i),m=So(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=fo(d[_],T),te=fo(d[v],T),ne=ee,re=C-h[m]-te,ie=C/2-h[m]/2+w,ae=vo(ne,ie,re),oe=!c.arrow&&bo(i)!=null&&ie!==ae&&a.reference[m]/2-(ie<ne?ee:te)-h[m]/2<0,se=oe?ie<ne?ie-ne:ie-re:0;return{[p]:f[p]+se,data:{[p]:ae,centerOffset:ie-ae-se,...oe&&{alignmentOffset:se}},reset:oe}}}),Uo=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=yo(r),_=Co(o),v=yo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Po(o)]:Eo(o)),x=p!==`none`;!d&&x&&b.push(...No(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=To(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Co(t))||T.every(e=>Co(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Co(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Wo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Go(e){return uo.some(t=>e[t]>=0)}var Ko=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=Wo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Go(e)}}}case`escaped`:{let e=Wo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Go(e)}}}default:return{}}}}},qo=new Set([`left`,`top`]);async function Jo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=yo(n),s=bo(n),c=Co(n)===`y`,l=qo.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Yo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Jo(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Xo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Co(yo(i)),p=xo(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=vo(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=vo(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Zo=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=Co(i),f=xo(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=qo.has(yo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Qo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=G(e,t),u=await o.detectOverflow(t,l),d=yo(i),f=bo(i),p=Co(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=fo(h-u[g],v),x=fo(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=po(u.left,0),t=po(u.right,0),n=po(u.top,0),r=po(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:po(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:po(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function K(){return typeof window<`u`}function $o(e){return ns(e)?(e.nodeName||``).toLowerCase():`#document`}function es(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ts(e){return((ns(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ns(e){return K()?e instanceof Node||e instanceof es(e).Node:!1}function rs(e){return K()?e instanceof Element||e instanceof es(e).Element:!1}function is(e){return K()?e instanceof HTMLElement||e instanceof es(e).HTMLElement:!1}function as(e){return!K()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof es(e).ShadowRoot}function os(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=_s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ss(e){return/^(table|td|th)$/.test($o(e))}function cs(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ls=/transform|translate|scale|rotate|perspective|filter/,us=/paint|layout|strict|content/,ds=e=>!!e&&e!==`none`,fs;function ps(e){let t=rs(e)?_s(e):e;return ds(t.transform)||ds(t.translate)||ds(t.scale)||ds(t.rotate)||ds(t.perspective)||!hs()&&(ds(t.backdropFilter)||ds(t.filter))||ls.test(t.willChange||``)||us.test(t.contain||``)}function ms(e){let t=ys(e);for(;is(t)&&!gs(t);){if(ps(t))return t;if(cs(t))return null;t=ys(t)}return null}function hs(){return fs??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),fs}function gs(e){return/^(html|body|#document)$/.test($o(e))}function _s(e){return es(e).getComputedStyle(e)}function vs(e){return rs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ys(e){if($o(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||as(e)&&e.host||ts(e);return as(t)?t.host:t}function bs(e){let t=ys(e);return gs(t)?e.ownerDocument?e.ownerDocument.body:e.body:is(t)&&os(t)?t:bs(t)}function xs(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=bs(e),i=r===e.ownerDocument?.body,a=es(r);if(i){let e=Ss(a);return t.concat(a,a.visualViewport||[],os(r)?r:[],e&&n?xs(e):[])}else return t.concat(r,xs(r,[],n))}function Ss(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cs(e){let t=_s(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=is(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mo(n)!==a||mo(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ws(e){return rs(e)?e:e.contextElement}function Ts(e){let t=ws(e);if(!is(t))return go(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Cs(t),o=(a?mo(n.width):n.width)/r,s=(a?mo(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Es=go(0);function Ds(e){let t=es(e);return!hs()||!t.visualViewport?Es:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Os(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==es(e)?!1:t}function ks(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ws(e),o=go(1);t&&(r?rs(r)&&(o=Ts(r)):o=Ts(e));let s=Os(a,n,r)?Ds(a):go(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=es(a),t=r&&rs(r)?es(r):r,n=e,i=Ss(n);for(;i&&r&&t!==n;){let e=Ts(i),t=i.getBoundingClientRect(),r=_s(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=es(i),i=Ss(n)}}return Lo({width:u,height:d,x:c,y:l})}function As(e,t){let n=vs(e).scrollLeft;return t?t.left+n:ks(ts(e)).left+n}function js(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-As(e,n),y:n.top+t.scrollTop}}function Ms(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ts(r),s=t?cs(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=go(1),u=go(0),d=is(r);if((d||!d&&!a)&&(($o(r)!==`body`||os(o))&&(c=vs(r)),d)){let e=ks(r);l=Ts(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?js(o,c):go(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ns(e){return Array.from(e.getClientRects())}function Ps(e){let t=ts(e),n=vs(e),r=e.ownerDocument.body,i=po(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=po(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+As(e),s=-n.scrollTop;return _s(r).direction===`rtl`&&(o+=po(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Fs=25;function Is(e,t){let n=es(e),r=ts(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=hs();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=As(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Fs&&(a-=o)}else l<=Fs&&(a+=l);return{width:a,height:o,x:s,y:c}}function Ls(e,t){let n=ks(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=is(e)?Ts(e):go(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Rs(e,t,n){let r;if(t===`viewport`)r=Is(e,n);else if(t===`document`)r=Ps(ts(e));else if(rs(t))r=Ls(t,n);else{let n=Ds(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Lo(r)}function zs(e,t){let n=ys(e);return n===t||!rs(n)||gs(n)?!1:_s(n).position===`fixed`||zs(n,t)}function Bs(e,t){let n=t.get(e);if(n)return n;let r=xs(e,[],!1).filter(e=>rs(e)&&$o(e)!==`body`),i=null,a=_s(e).position===`fixed`,o=a?ys(e):e;for(;rs(o)&&!gs(o);){let t=_s(o),n=ps(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||os(o)&&!n&&zs(e,o))?r=r.filter(e=>e!==o):i=t,o=ys(o)}return t.set(e,r),r}function Vs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?cs(t)?[]:Bs(t,this._c):[].concat(n),r],o=Rs(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Rs(t,a[e],i);s=po(n.top,s),c=fo(n.right,c),l=fo(n.bottom,l),u=po(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hs(e){let{width:t,height:n}=Cs(e);return{width:t,height:n}}function Us(e,t,n){let r=is(t),i=ts(t),a=n===`fixed`,o=ks(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=go(0);function l(){c.x=As(i)}if(r||!r&&!a)if(($o(t)!==`body`||os(i))&&(s=vs(t)),r){let e=ks(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?js(i,s):go(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ws(e){return _s(e).position===`static`}function Gs(e,t){if(!is(e)||_s(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ts(e)===n&&(n=n.ownerDocument.body),n}function Ks(e,t){let n=es(e);if(cs(e))return n;if(!is(e)){let t=ys(e);for(;t&&!gs(t);){if(rs(t)&&!Ws(t))return t;t=ys(t)}return n}let r=Gs(e,t);for(;r&&ss(r)&&Ws(r);)r=Gs(r,t);return r&&gs(r)&&Ws(r)&&!ps(r)?n:r||ms(e)||n}var qs=async function(e){let t=this.getOffsetParent||Ks,n=this.getDimensions,r=await n(e.floating);return{reference:Us(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Js(e){return _s(e).direction===`rtl`}var Ys={convertOffsetParentRelativeRectToViewportRelativeRect:Ms,getDocumentElement:ts,getClippingRect:Vs,getOffsetParent:Ks,getElementRects:qs,getClientRects:Ns,getDimensions:Hs,getScale:Ts,isElement:rs,isRTL:Js};function Xs(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zs(e,t){let n=null,r,i=ts(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=ho(d),h=ho(i.clientWidth-(u+f)),g=ho(i.clientHeight-(d+p)),_=ho(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:po(0,fo(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Xs(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Qs(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ws(e),u=i||a?[...l?xs(l):[],...t?xs(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zs(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?ks(e):null;c&&g();function g(){let t=ks(e);h&&!Xs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var $s=Yo,ec=Xo,tc=Uo,nc=Qo,rc=Ko,ic=Ho,ac=Zo,oc=(e,t,n)=>{let r=new Map,i={platform:Ys,...n},a={...i.platform,_c:r};return Vo(e,t,{...i,platform:a})},sc=e(de(),1),cc=typeof document<`u`?N.useLayoutEffect:function(){};function lc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!lc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function uc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dc(e,t){let n=uc(e);return Math.round(t*n)/n}function fc(e){let t=N.useRef(e);return cc(()=>{t.current=e}),t}function pc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=N.useState(r);lc(f,r)||p(r);let[m,h]=N.useState(null),[g,_]=N.useState(null),v=N.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=N.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=N.useRef(null),C=N.useRef(null),w=N.useRef(u),T=c!=null,ee=fc(c),te=fc(i),ne=fc(l),re=N.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};te.current&&(e.platform=te.current),oc(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ne.current!==!1};ie.current&&!lc(w.current,t)&&(w.current=t,sc.flushSync(()=>{d(t)}))})},[f,t,n,te,ne]);cc(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=N.useRef(!1);cc(()=>(ie.current=!0,()=>{ie.current=!1}),[]),cc(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(ee.current)return ee.current(b,x,re);re()}},[b,x,re,ee,T]);let ae=N.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),oe=N.useMemo(()=>({reference:b,floating:x}),[b,x]),se=N.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=dc(oe.floating,u.x),r=dc(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...uc(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return N.useMemo(()=>({...u,update:re,refs:ae,elements:oe,floatingStyles:se}),[u,re,ae,oe,se])}var mc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ic({element:r.current,padding:i}).fn(n):r?ic({element:r,padding:i}).fn(n):{}}}},hc=(e,t)=>{let n=$s(e);return{name:n.name,fn:n.fn,options:[e,t]}},gc=(e,t)=>{let n=ec(e);return{name:n.name,fn:n.fn,options:[e,t]}},_c=(e,t)=>({fn:ac(e).fn,options:[e,t]}),vc=(e,t)=>{let n=tc(e);return{name:n.name,fn:n.fn,options:[e,t]}},yc=(e,t)=>{let n=nc(e);return{name:n.name,fn:n.fn,options:[e,t]}},bc=(e,t)=>{let n=rc(e);return{name:n.name,fn:n.fn,options:[e,t]}},xc=(e,t)=>{let n=mc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Sc=`Arrow`,Cc=N.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,P.jsx)(fe.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,P.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Cc.displayName=Sc;var wc=Cc;function Tc(e){let[t,n]=N.useState(void 0);return pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var Ec=`Popper`,[Dc,Oc]=me(Ec),[kc,Ac]=Dc(Ec),jc=e=>{let{__scopePopper:t,children:n}=e,[r,i]=N.useState(null),[a,o]=N.useState(void 0);return(0,P.jsx)(kc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};jc.displayName=Ec;var Mc=`PopperAnchor`,Nc=N.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Ac(Mc,n),o=N.useRef(null),s=a.onAnchorChange,c=_e(t,N.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=N.useRef(null);N.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Uc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,P.jsx)(fe.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})});Nc.displayName=Mc;var Pc=`PopperContent`,[Fc,Ic]=Dc(Pc),Lc=N.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Ac(Pc,n),[_,v]=N.useState(null),y=_e(t,e=>v(e)),[b,x]=N.useState(null),S=Tc(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],ne=te.length>0,re={padding:ee,boundary:te.filter(Vc),altBoundary:ne},{refs:ie,floatingStyles:ae,placement:oe,isPositioned:se,middlewareData:E}=pc({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Qs(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[hc({mainAxis:i+w,alignmentAxis:o}),c&&gc({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?_c():void 0,...re}),c&&vc({...re}),yc({...re,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&xc({element:b,padding:s}),Hc({arrowWidth:C,arrowHeight:w}),f&&bc({strategy:`referenceHidden`,...re,boundary:ne?re.boundary:void 0})]}),D=g.setPlacementState;pe(()=>(D(oe),()=>{D(void 0)}),[oe,D]);let[O,ce]=Uc(oe),le=he(m);pe(()=>{se&&le?.()},[se,le]);let ue=E.arrow?.x,de=E.arrow?.y,k=E.arrow?.centerOffset!==0,[A,me]=N.useState();return pe(()=>{_&&me(window.getComputedStyle(_).zIndex)},[_]),(0,P.jsx)(`div`,{ref:ie.setFloating,"data-radix-popper-content-wrapper":``,style:{...ae,transform:se?ae.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:A,"--radix-popper-transform-origin":[E.transformOrigin?.x,E.transformOrigin?.y].join(` `),...E.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,P.jsx)(Fc,{scope:n,placedSide:O,placedAlign:ce,onArrowChange:x,arrowX:ue,arrowY:de,shouldHideArrow:k,children:(0,P.jsx)(fe.div,{"data-side":O,"data-align":ce,...h,ref:y,style:{...h.style,animation:se?void 0:`none`}})})})});Lc.displayName=Pc;var Rc=`PopperArrow`,zc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Bc=N.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Ic(Rc,n),a=zc[i.placedSide];return(0,P.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,P.jsx)(wc,{...r,ref:t,style:{...r.style,display:`block`}})})});Bc.displayName=Rc;function Vc(e){return e!==null}var Hc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Uc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Uc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Wc=jc,Gc=Nc,Kc=Lc,qc=Bc,Jc=`Portal`,Yc=N.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=N.useState(!1);pe(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?sc.createPortal((0,P.jsx)(fe.div,{...r,ref:t}),o):null});Yc.displayName=Jc;var Xc=N.useInsertionEffect||pe;function Zc({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Qc({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=N.useRef(e!==void 0);N.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,N.useCallback(t=>{if(s){let n=$c(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Qc({defaultProp:e,onChange:t}){let[n,r]=N.useState(e),i=N.useRef(n),a=N.useRef(t);return Xc(()=>{a.current=t},[t]),N.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function $c(e){return typeof e==`function`}var el=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),tl=`VisuallyHidden`,nl=N.forwardRef((e,t)=>(0,P.jsx)(fe.span,{...e,ref:t,style:{...el,...e.style}}));nl.displayName=tl;var rl=nl,[il,al]=me(`Tooltip`,[Oc]),ol=Oc(),sl=`TooltipProvider`,cl=700,ll=`tooltip.open`,[ul,dl]=il(sl),fl=e=>{let{__scopeTooltip:t,delayDuration:n=cl,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=N.useRef(!0),s=N.useRef(!1),c=N.useRef(0);return N.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,P.jsx)(ul,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:N.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:N.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:N.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};fl.displayName=sl;var pl=`Tooltip`,[ml,hl]=il(pl),gl=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=dl(pl,e.__scopeTooltip),l=ol(t),[u,d]=N.useState(null),f=lo(),p=N.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=N.useRef(!1),[_,v]=Zc({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(ll))):c.onClose(),a?.(e)},caller:pl}),y=N.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=N.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=N.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=N.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return N.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,P.jsx)(Wc,{...l,children:(0,P.jsx)(ml,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:N.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:N.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};gl.displayName=pl;var _l=`TooltipTrigger`,vl=N.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=hl(_l,n),a=dl(_l,n),o=ol(n),s=_e(t,N.useRef(null),i.onTriggerChange),c=N.useRef(!1),l=N.useRef(!1),u=N.useCallback(()=>c.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,P.jsx)(Gc,{asChild:!0,...o,children:(0,P.jsx)(fe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:ge(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:ge(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:ge(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:ge(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:ge(e.onBlur,i.onClose),onClick:ge(e.onClick,i.onClose)})})});vl.displayName=_l;var yl=`TooltipPortal`,[bl,xl]=il(yl,{forceMount:void 0}),Sl=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=hl(yl,t);return(0,P.jsx)(bl,{scope:t,forceMount:n,children:(0,P.jsx)(j,{present:n||a.open,children:(0,P.jsx)(Yc,{asChild:!0,container:i,children:r})})})};Sl.displayName=yl;var Cl=`TooltipContent`,wl=N.forwardRef((e,t)=>{let n=xl(Cl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=hl(Cl,e.__scopeTooltip);return(0,P.jsx)(j,{present:r||o.open,children:o.disableHoverableContent?(0,P.jsx)(kl,{side:i,...a,ref:t}):(0,P.jsx)(Tl,{side:i,...a,ref:t})})}),Tl=N.forwardRef((e,t)=>{let n=hl(Cl,e.__scopeTooltip),r=dl(Cl,e.__scopeTooltip),i=N.useRef(null),a=_e(t,i),[o,s]=N.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=N.useCallback(()=>{s(null),d(!1)},[d]),p=N.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Nl(r,Ml(r,n.getBoundingClientRect())),a=Pl(t.getBoundingClientRect());s(Il([...i,...a])),d(!0)},[d]);return N.useEffect(()=>()=>f(),[f]),N.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),N.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Fl(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,P.jsx)(kl,{...e,ref:a})}),[El,Dl]=il(pl,{isInside:!1}),Ol=ve(`TooltipContent`),kl=N.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=hl(Cl,n),l=ol(n),{onClose:u}=c;return N.useEffect(()=>(document.addEventListener(ll,u),()=>document.removeEventListener(ll,u)),[u]),N.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,P.jsx)(eo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,P.jsxs)(Kc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,P.jsx)(Ol,{children:r}),(0,P.jsx)(El,{scope:n,isInside:!0,children:(0,P.jsx)(rl,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});wl.displayName=Cl;var Al=`TooltipArrow`,jl=N.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=ol(n);return Dl(Al,n).isInside?null:(0,P.jsx)(qc,{...i,...r,ref:t})});jl.displayName=Al;function Ml(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Nl(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Pl(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Fl(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Il(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Ll(t)}function Ll(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Rl=fl,zl=gl,q=vl,J=Sl,Bl=wl,Vl=Rl,Hl=zl;function Ul({onFocusCapture:e,ref:t,...n}){return(0,P.jsx)(q,{ref:t,onFocusCapture:t=>{if(e?.(t),t.defaultPrevented||t.isPropagationStopped())return;let n=t.target;n&&typeof n.matches==`function`&&!n.matches(`:focus-visible`)&&t.stopPropagation()},...n})}function Wl({className:e,sideOffset:t=4,ref:n,...r}){return(0,P.jsx)(J,{children:(0,P.jsx)(Bl,{ref:n,"data-slot":`tooltip-content`,sideOffset:t,className:Pa(`z-50 rounded-md border border-white/20 bg-white px-2 py-1 text-xs text-gray-900 shadow-md animate-in fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0`,e),...r})})}var Gl={listAgentTemplates:()=>M(`/agent-templates`),getAgentTemplate:e=>M(`/agent-templates/${e}`),createAgentTemplate:e=>M(`/agent-templates`,{method:`POST`,body:JSON.stringify(e)}),updateAgentTemplate:(e,t)=>M(`/agent-templates/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteAgentTemplate:e=>M(`/agent-templates/${e}`,{method:`DELETE`}),duplicateAgentTemplate:e=>M(`/agent-templates/${e}/duplicate`,{method:`POST`}),getAgentTemplateUsageStats:()=>M(`/agent-templates/stats/usage`)},Kl={analyticsOverview:(e,t)=>{let n=new URLSearchParams;e&&n.set(`projectId`,e),t&&n.set(`timeRange`,t),n.set(`tz`,String(new Date().getTimezoneOffset()));let r=n.toString();return M(`/analytics/overview${r?`?${r}`:``}`)},analyticsTimeline:(e,t,n)=>{let r=new URLSearchParams;e&&r.set(`projectId`,e),t&&r.set(`timeRange`,t),n&&r.set(`groupBy`,n),r.set(`tz`,String(new Date().getTimezoneOffset()));let i=r.toString();return M(`/analytics/timeline${i?`?${i}`:``}`)},sendLogs:e=>M(`/logs`,{method:`POST`,body:JSON.stringify({logs:e})})},ql={listAutomations:e=>M(`/automations${e?`?projectId=${e}`:``}`),getAutomation:e=>M(`/automations/${e}`),createAutomation:e=>M(`/automations`,{method:`POST`,body:JSON.stringify(e)}),updateAutomation:(e,t)=>M(`/automations/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteAutomation:e=>M(`/automations/${e}`,{method:`DELETE`}),triggerAutomation:e=>M(`/automations/${e}/trigger`,{method:`POST`}),listAutomationRuns:e=>M(`/automations/${e}/runs`),getAutomationInbox:e=>{let t=new URLSearchParams;e?.projectId&&t.append(`projectId`,e.projectId),e?.triageStatus&&t.append(`triageStatus`,e.triageStatus);let n=t.toString();return M(`/automations/inbox${n?`?${n}`:``}`)},triageRun:(e,t)=>M(`/automations/runs/${e}/triage`,{method:`PATCH`,body:JSON.stringify({triageStatus:t})})},Jl={browseRoots:()=>M(`/browse/roots`),browseList:e=>M(`/browse/list?path=${encodeURIComponent(e)}`),openInEditor:(e,t)=>M(`/browse/open-in-editor`,{method:`POST`,body:JSON.stringify({path:e,editor:t})}),openDirectory:e=>M(`/browse/open-directory`,{method:`POST`,body:JSON.stringify(e)}),repoName:e=>M(`/browse/repo-name?path=${encodeURIComponent(e)}`),remoteUrl:e=>M(`/browse/remote-url?path=${encodeURIComponent(e)}`),gitInit:e=>M(`/browse/git-init`,{method:`POST`,body:JSON.stringify({path:e})}),createDirectory:(e,t)=>M(`/browse/create-directory`,{method:`POST`,body:JSON.stringify({parent:e,name:t})}),browseFiles:(e,t,n)=>{let r=new URLSearchParams({path:e});return t&&r.set(`query`,t),n&&r.set(`limit`,String(n)),M(`/browse/files?${r.toString()}`)},getFileIndex:e=>{let t=new URLSearchParams;return`threadId`in e?t.set(`threadId`,e.threadId):t.set(`path`,e.path),e.since&&e.since>0&&t.set(`since`,String(e.since)),M(`/browse/files/index?${t.toString()}`)},searchSymbols:(e,t,n)=>{let r=new URLSearchParams({path:e});return t&&r.set(`query`,t),n&&r.set(`file`,n),M(`/browse/symbols?${r.toString()}`)},triggerSymbolIndex:e=>M(`/browse/symbols/index`,{method:`POST`,body:JSON.stringify({path:e})}),searchText:e=>{let t=new URLSearchParams({threadId:e.threadId,q:e.query});return e.caseSensitive&&t.set(`caseSensitive`,`true`),e.wholeWord&&t.set(`wholeWord`,`true`),e.regex&&t.set(`regex`,`true`),e.include&&t.set(`include`,e.include),e.exclude&&t.set(`exclude`,e.exclude),e.maxResults&&t.set(`maxResults`,String(e.maxResults)),M(`/search/text?${t.toString()}`)}},Yl={listDesigns:e=>M(`/projects/${e}/designs`),createDesign:(e,t)=>M(`/projects/${e}/designs`,{method:`POST`,body:JSON.stringify(t)}),getDesign:e=>M(`/designs/${e}`),deleteDesign:e=>M(`/designs/${e}`,{method:`DELETE`}),createDesignDirectory:(e,t)=>M(`/projects/${e}/designs/directory`,{method:`POST`,body:JSON.stringify({designId:t})}),deleteDesignDirectory:(e,t)=>M(`/projects/${e}/designs/${t}/directory`,{method:`DELETE`})},Xl={listInstalledExtensions:()=>M(`/extensions/installed`),installExtension:e=>M(`/extensions/install`,{method:`POST`,body:JSON.stringify({path:e})}),removeExtension:e=>M(`/extensions/${encodeURIComponent(e)}`,{method:`DELETE`})},Zl={getDiff:e=>M(`/git/${e}/diff`),getDiffSummary:(e,t,n,r)=>{let i=new URLSearchParams;t?.length&&i.set(`exclude`,t.join(`,`)),n&&i.set(`maxFiles`,String(n));let a=i.toString();return M(`/git/${e}/diff/summary${a?`?${a}`:``}`,{signal:r})},getFileDiff:(e,t,n,r,i)=>M(`/git/${e}/diff/file?path=${encodeURIComponent(t)}&staged=${n}${i?`&context=${i}`:``}`,{signal:r}),getSubmoduleDiffSummary:(e,t,n)=>M(`/git/${e}/diff/submodule?path=${encodeURIComponent(t)}`,{signal:n}),getSubmoduleFileDiff:(e,t,n,r,i,a)=>M(`/git/${e}/diff/submodule/file?submodule=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}&staged=${r}${a?`&context=${a}`:``}`,{signal:i}),stageFiles:(e,t)=>M(`/git/${e}/stage`,{method:`POST`,body:JSON.stringify({paths:t})}),unstageFiles:(e,t)=>M(`/git/${e}/unstage`,{method:`POST`,body:JSON.stringify({paths:t})}),stagePatch:(e,t)=>M(`/git/${e}/stage-patch`,{method:`POST`,body:JSON.stringify({patch:t})}),unstagePatch:(e,t)=>M(`/git/${e}/unstage-patch`,{method:`POST`,body:JSON.stringify({patch:t})}),revertFiles:(e,t)=>M(`/git/${e}/revert`,{method:`POST`,body:JSON.stringify({paths:t})}),resolveConflict:(e,t,n,r)=>M(`/git/${e}/conflict/resolve`,{method:`POST`,body:JSON.stringify({filePath:t,blockIndex:n,resolution:r})}),commit:(e,t,n,r)=>M(`/git/${e}/commit`,{method:`POST`,body:JSON.stringify({message:t,amend:n,noVerify:r})}),runHookCommand:(e,t)=>M(`/git/${e}/run-hook-command`,{method:`POST`,body:JSON.stringify({hookIndex:t})}),push:e=>M(`/git/${e}/push`,{method:`POST`}),createPR:(e,t,n)=>M(`/git/${e}/pr`,{method:`POST`,body:JSON.stringify({title:t,body:n})}),merge:(e,t)=>M(`/git/${e}/merge`,{method:`POST`,body:JSON.stringify(t??{})}),generateCommitMessage:(e,t,n)=>M(`/git/${e}/generate-commit-message`,{method:`POST`,body:JSON.stringify({includeUnstaged:t??!1}),signal:n}),addToGitignore:(e,t)=>M(`/git/${e}/gitignore`,{method:`POST`,body:JSON.stringify({pattern:t})}),addPatternsToGitignore:(e,t)=>M(`/git/${e}/gitignore`,{method:`POST`,body:JSON.stringify({patterns:t})}),getGitStatuses:(e,t)=>M(`/git/status?projectId=${e}`,{signal:t}),getGitStatus:(e,t)=>M(`/git/${e}/status`,{signal:t}),getGitLog:(e,t=50,n=!1,r=0,i)=>M(`/git/${e}/log?limit=${t}${n?`&all=true`:``}${r>0?`&skip=${r}`:``}`,{signal:i}),getGitGraphLog:(e,t=50,n=!0,r=0,i)=>M(`/git/${e}/graph-log?limit=${t}&all=${n?`true`:`false`}${r>0?`&skip=${r}`:``}`,{signal:i}),getReflogEvents:(e,t)=>M(`/git/${e}/reflog-events`,{signal:t}),getCommitFiles:(e,t)=>M(`/git/${e}/commit/${t}/files`),getCommitFileDiff:(e,t,n)=>M(`/git/${e}/commit/${t}/diff?path=${encodeURIComponent(n)}`),getCommitBody:(e,t)=>M(`/git/${e}/commit/${t}/body`),pull:(e,t=`ff-only`)=>M(`/git/${e}/pull`,{method:`POST`,body:JSON.stringify({strategy:t})}),fetchOrigin:e=>M(`/git/${e}/fetch`,{method:`POST`}),stash:(e,t)=>M(`/git/${e}/stash`,{method:`POST`,...t?.length?{body:JSON.stringify({files:t})}:{}}),stashPop:e=>M(`/git/${e}/stash/pop`,{method:`POST`}),stashList:(e,t)=>M(`/git/${e}/stash/list`,{signal:t}),stashShow:(e,t)=>M(`/git/${e}/stash/show/${t}`),stashFileDiff:(e,t,n)=>M(`/git/${e}/stash/${t}/diff?path=${encodeURIComponent(n)}`),stashDrop:(e,t)=>M(`/git/${e}/stash/drop/${t}`,{method:`POST`}),resetSoft:e=>M(`/git/${e}/reset-soft`,{method:`POST`}),checkoutCommit:(e,t)=>M(`/git/${e}/checkout-commit`,{method:`POST`,body:JSON.stringify({hash:t})}),revertCommit:(e,t)=>M(`/git/${e}/revert-commit`,{method:`POST`,body:JSON.stringify({hash:t})}),resetHard:(e,t)=>M(`/git/${e}/reset-hard`,{method:`POST`,body:JSON.stringify({hash:t})}),cherryPick:(e,t)=>M(`/git/${e}/cherry-pick`,{method:`POST`,body:JSON.stringify({hash:t})}),createBranch:(e,t,n)=>M(`/git/${e}/create-branch`,{method:`POST`,body:JSON.stringify({name:t,startPoint:n})}),pushBranch:(e,t)=>M(`/git/${e}/push-branch`,{method:`POST`,body:JSON.stringify({branch:t})}),mergeCurrentBranchInto:(e,t)=>M(`/git/${e}/merge-current-into`,{method:`POST`,body:JSON.stringify({targetBranch:t})}),rebaseCurrentBranchOnto:(e,t)=>M(`/git/${e}/rebase-current-onto`,{method:`POST`,body:JSON.stringify({targetBranch:t})}),projectGitStatus:(e,t)=>M(`/git/project/${e}/status`,{signal:t}),projectDiffSummary:(e,t,n,r)=>{let i=new URLSearchParams;t?.length&&i.set(`exclude`,t.join(`,`)),n&&i.set(`maxFiles`,String(n));let a=i.toString();return M(`/git/project/${e}/diff/summary${a?`?${a}`:``}`,{signal:r})},projectFileDiff:(e,t,n,r,i)=>M(`/git/project/${e}/diff/file?path=${encodeURIComponent(t)}&staged=${n}${i?`&context=${i}`:``}`,{signal:r}),projectSubmoduleDiffSummary:(e,t,n)=>M(`/git/project/${e}/diff/submodule?path=${encodeURIComponent(t)}`,{signal:n}),projectSubmoduleFileDiff:(e,t,n,r,i,a)=>M(`/git/project/${e}/diff/submodule/file?submodule=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}&staged=${r}${a?`&context=${a}`:``}`,{signal:i}),projectStageFiles:(e,t)=>M(`/git/project/${e}/stage`,{method:`POST`,body:JSON.stringify({paths:t})}),projectUnstageFiles:(e,t)=>M(`/git/project/${e}/unstage`,{method:`POST`,body:JSON.stringify({paths:t})}),projectStagePatch:(e,t)=>M(`/git/project/${e}/stage-patch`,{method:`POST`,body:JSON.stringify({patch:t})}),projectUnstagePatch:(e,t)=>M(`/git/project/${e}/unstage-patch`,{method:`POST`,body:JSON.stringify({patch:t})}),projectRevertFiles:(e,t)=>M(`/git/project/${e}/revert`,{method:`POST`,body:JSON.stringify({paths:t})}),projectResolveConflict:(e,t,n,r)=>M(`/git/project/${e}/conflict/resolve`,{method:`POST`,body:JSON.stringify({filePath:t,blockIndex:n,resolution:r})}),projectCommit:(e,t,n,r)=>M(`/git/project/${e}/commit`,{method:`POST`,body:JSON.stringify({message:t,amend:n,noVerify:r})}),projectRunHookCommand:(e,t)=>M(`/git/project/${e}/run-hook-command`,{method:`POST`,body:JSON.stringify({hookIndex:t})}),projectGetRemoteUrl:(e,t)=>M(`/git/project/${e}/remote-url`,{signal:t}),projectSetRemoteUrl:(e,t)=>M(`/git/project/${e}/remote`,{method:`POST`,body:JSON.stringify({url:t})}),projectGetGhOrgs:(e,t)=>M(`/git/project/${e}/gh-orgs`,{signal:t}),projectPublish:(e,t)=>M(`/git/project/${e}/publish`,{method:`POST`,body:JSON.stringify(t)}),projectPush:e=>M(`/git/project/${e}/push`,{method:`POST`}),projectPull:(e,t=`ff-only`)=>M(`/git/project/${e}/pull`,{method:`POST`,body:JSON.stringify({strategy:t})}),projectFetchOrigin:e=>M(`/git/project/${e}/fetch`,{method:`POST`}),projectStash:(e,t)=>M(`/git/project/${e}/stash`,{method:`POST`,...t?.length?{body:JSON.stringify({files:t})}:{}}),projectStashPop:e=>M(`/git/project/${e}/stash/pop`,{method:`POST`}),projectStashList:(e,t)=>M(`/git/project/${e}/stash/list`,{signal:t}),projectStashShow:(e,t)=>M(`/git/project/${e}/stash/show/${t}`),projectStashFileDiff:(e,t,n)=>M(`/git/project/${e}/stash/${t}/diff?path=${encodeURIComponent(n)}`),projectStashDrop:(e,t)=>M(`/git/project/${e}/stash/drop/${t}`,{method:`POST`}),projectResetSoft:e=>M(`/git/project/${e}/reset-soft`,{method:`POST`}),projectCheckoutCommit:(e,t)=>M(`/git/project/${e}/checkout-commit`,{method:`POST`,body:JSON.stringify({hash:t})}),projectRevertCommit:(e,t)=>M(`/git/project/${e}/revert-commit`,{method:`POST`,body:JSON.stringify({hash:t})}),projectResetHard:(e,t)=>M(`/git/project/${e}/reset-hard`,{method:`POST`,body:JSON.stringify({hash:t})}),projectCherryPick:(e,t)=>M(`/git/project/${e}/cherry-pick`,{method:`POST`,body:JSON.stringify({hash:t})}),projectCreateBranch:(e,t,n)=>M(`/git/project/${e}/create-branch`,{method:`POST`,body:JSON.stringify({name:t,startPoint:n})}),projectPushBranch:(e,t)=>M(`/git/project/${e}/push-branch`,{method:`POST`,body:JSON.stringify({branch:t})}),projectMergeCurrentBranchInto:(e,t)=>M(`/git/project/${e}/merge-current-into`,{method:`POST`,body:JSON.stringify({targetBranch:t})}),projectRebaseCurrentBranchOnto:(e,t)=>M(`/git/project/${e}/rebase-current-onto`,{method:`POST`,body:JSON.stringify({targetBranch:t})}),projectGitLog:(e,t=50,n=0,r)=>M(`/git/project/${e}/log?limit=${t}${n>0?`&skip=${n}`:``}`,{signal:r}),projectGitGraphLog:(e,t=50,n=!0,r=0,i)=>M(`/git/project/${e}/graph-log?limit=${t}&all=${n?`true`:`false`}${r>0?`&skip=${r}`:``}`,{signal:i}),projectReflogEvents:(e,t)=>M(`/git/project/${e}/reflog-events`,{signal:t}),projectCommitFiles:(e,t)=>M(`/git/project/${e}/commit/${t}/files`),projectCommitFileDiff:(e,t,n)=>M(`/git/project/${e}/commit/${t}/diff?path=${encodeURIComponent(n)}`),projectCommitBody:(e,t)=>M(`/git/project/${e}/commit/${t}/body`),projectGenerateCommitMessage:(e,t,n)=>M(`/git/project/${e}/generate-commit-message`,{method:`POST`,body:JSON.stringify({includeUnstaged:t??!1}),signal:n}),projectAddToGitignore:(e,t)=>M(`/git/project/${e}/gitignore`,{method:`POST`,body:JSON.stringify({pattern:t})}),projectAddPatternsToGitignore:(e,t)=>M(`/git/project/${e}/gitignore`,{method:`POST`,body:JSON.stringify({patterns:t})}),startWorkflow:(e,t)=>M(`/git/${e}/workflow`,{method:`POST`,body:JSON.stringify(t)}),projectStartWorkflow:(e,t)=>M(`/git/project/${e}/workflow`,{method:`POST`,body:JSON.stringify(t)})},Ql={githubStatus:()=>M(`/github/status`),githubStartDevice:()=>M(`/github/oauth/device`,{method:`POST`}),githubPoll:e=>M(`/github/oauth/poll`,{method:`POST`,body:JSON.stringify({deviceCode:e})}),githubDisconnect:()=>M(`/github/oauth/disconnect`,{method:`DELETE`}),githubUser:()=>M(`/github/user`),githubRepos:e=>{let t=new URLSearchParams;e?.page&&t.set(`page`,String(e.page)),e?.per_page&&t.set(`per_page`,String(e.per_page)),e?.search&&t.set(`search`,e.search),e?.sort&&t.set(`sort`,e.sort);let n=t.toString();return M(`/github/repos${n?`?${n}`:``}`)},cloneRepo:(e,t,n)=>M(`/github/clone`,{method:`POST`,body:JSON.stringify({cloneUrl:e,destinationPath:t,name:n})}),githubIssues:(e,t)=>{let n=new URLSearchParams({projectId:e});return t?.state&&n.set(`state`,t.state),t?.page&&n.set(`page`,String(t.page)),t?.per_page&&n.set(`per_page`,String(t.per_page)),M(`/github/issues?${n.toString()}`)},githubIssuesEnriched:(e,t)=>{let n=new URLSearchParams({projectId:e});return t?.state&&n.set(`state`,t.state),t?.page&&n.set(`page`,String(t.page)),t?.per_page&&n.set(`per_page`,String(t.per_page)),M(`/github/issues-enriched?${n.toString()}`)},githubPRs:(e,t)=>{let n=new URLSearchParams({projectId:e});return t?.state&&n.set(`state`,t.state),t?.page&&n.set(`page`,String(t.page)),t?.per_page&&n.set(`per_page`,String(t.per_page)),t?.sort&&n.set(`sort`,t.sort),M(`/github/prs?${n.toString()}`)},githubPRsSearch:(e,t)=>{let n=new URLSearchParams({projectId:e});return t.state&&n.set(`state`,t.state),t.page&&n.set(`page`,String(t.page)),t.per_page&&n.set(`per_page`,String(t.per_page)),t.sort&&n.set(`sort`,t.sort),t.labels?.length&&n.set(`labels`,t.labels.join(`,`)),t.authors?.length&&n.set(`authors`,t.authors.join(`,`)),t.assignees?.length&&n.set(`assignees`,t.assignees.join(`,`)),t.reviewers?.length&&n.set(`reviewers`,t.reviewers.join(`,`)),M(`/github/prs-search?${n.toString()}`)},githubPRFilterOptions:e=>M(`/github/pr-filter-options?projectId=${e}`),githubCommitAuthors:(e,t)=>{let n=new URLSearchParams({projectId:e});return t?.sha&&n.set(`sha`,t.sha),t?.page&&n.set(`page`,String(t.page)),t?.per_page&&n.set(`per_page`,String(t.per_page)),M(`/github/commit-authors?${n.toString()}`)},githubPRDetail:(e,t)=>M(`/github/pr-detail?projectId=${e}&prNumber=${t}`),githubPRThreads:(e,t)=>M(`/github/pr-threads?projectId=${e}&prNumber=${t}`),githubPRMerge:(e,t,n=`squash`)=>M(`/github/pr-merge`,{method:`POST`,body:JSON.stringify({projectId:e,prNumber:t,method:n})}),githubPRConversation:(e,t)=>M(`/github/pr-conversation?projectId=${e}&prNumber=${t}`),githubPRCommentCreate:(e,t,n)=>M(`/github/pr-comment`,{method:`POST`,body:JSON.stringify({projectId:e,prNumber:t,body:n})}),githubPRReviewReply:(e,t,n,r)=>M(`/github/pr-review-reply`,{method:`POST`,body:JSON.stringify({projectId:e,prNumber:t,commentId:n,body:r})}),githubPRThreadResolve:(e,t,n)=>M(`/github/pr-thread-resolve`,{method:`POST`,body:JSON.stringify({projectId:e,threadNodeId:t,resolve:n})}),githubPRReaction:(e,t,n,r)=>M(`/github/pr-reaction`,{method:`POST`,body:JSON.stringify({projectId:e,kind:t,commentId:n,content:r})}),githubPRCommentEdit:(e,t,n,r)=>M(`/github/pr-comment`,{method:`PATCH`,body:JSON.stringify({projectId:e,kind:t,commentId:n,body:r})}),githubPRCommentDelete:(e,t,n)=>M(`/github/pr-comment?${new URLSearchParams({projectId:e,kind:t,commentId:String(n)}).toString()}`,{method:`DELETE`}),githubPRFiles:(e,t,n)=>{let r=new URLSearchParams({projectId:e,prNumber:String(t)});return n&&r.set(`commitSha`,n),M(`/github/pr-files?${r.toString()}`)},githubPRCommits:(e,t)=>M(`/github/pr-commits?projectId=${e}&prNumber=${t}`),githubPRRevertFile:(e,t,n)=>M(`/github/pr-revert-file`,{method:`POST`,body:JSON.stringify({projectId:e,prNumber:t,filePath:n})}),githubPRFileContent:(e,t,n)=>M(`/github/pr-file-content?${new URLSearchParams({projectId:e,prNumber:String(t),filePath:n}).toString()}`)},$l={listMcpServers:(e,t=`claude`)=>M(`/mcp/servers?projectPath=${encodeURIComponent(e)}&provider=${encodeURIComponent(t)}`),addMcpServer:e=>M(`/mcp/servers`,{method:`POST`,body:JSON.stringify(e)}),removeMcpServer:(e,t,n=`claude`)=>M(`/mcp/servers/${encodeURIComponent(e)}?projectPath=${encodeURIComponent(t)}&provider=${encodeURIComponent(n)}`,{method:`DELETE`}),toggleMcpServer:(e,t,n,r=`claude`)=>M(`/mcp/servers/${encodeURIComponent(e)}/toggle`,{method:`PATCH`,body:JSON.stringify({projectPath:t,provider:r,disabled:n})}),getRecommendedMcpServers:()=>M(`/mcp/recommended`),startMcpOAuth:(e,t,n=`claude`)=>M(`/mcp/oauth/start`,{method:`POST`,body:JSON.stringify({serverName:e,projectPath:t,provider:n})}),setMcpToken:(e,t,n,r=`claude`)=>M(`/mcp/oauth/token`,{method:`POST`,body:JSON.stringify({serverName:e,projectPath:t,provider:r,token:n})})},eu={listOrchestratorRuns:()=>M(`/orchestrator/runs`),refreshOrchestrator:()=>M(`/orchestrator/refresh`,{method:`POST`})},tu={listPipelines:e=>M(`/pipelines/project/${e}`),createPipeline:e=>M(`/pipelines`,{method:`POST`,body:JSON.stringify(e)}),updatePipeline:(e,t)=>M(`/pipelines/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deletePipeline:e=>M(`/pipelines/${e}`,{method:`DELETE`}),listPipelineRuns:e=>M(`/pipelines/runs/thread/${e}`)},nu={getProfile:()=>M(`/profile`),updateProfile:e=>M(`/profile`,{method:`PUT`,body:JSON.stringify(e)}),getTranscribeToken:()=>M(`/profile/transcribe-token`),isSetupCompleted:()=>M(`/profile/setup-completed`),getRunnerInviteToken:()=>M(`/profile/runner-invite-token`),rotateRunnerInviteToken:()=>M(`/profile/runner-invite-token/rotate`,{method:`POST`}),completeSetup:()=>M(`/profile`,{method:`PUT`,body:JSON.stringify({setupCompleted:!0})})},ru={listProjects:e=>{let t=new URLSearchParams;e?t.append(`orgId`,e):e===null&&t.append(`personal`,`true`);let n=t.toString();return M(`/projects${n?`?${n}`:``}`)},createProject:(e,t)=>M(`/projects`,{method:`POST`,body:JSON.stringify({name:e,path:t})}),renameProject:(e,t)=>M(`/projects/${e}`,{method:`PATCH`,body:JSON.stringify({name:t})}),updateProject:(e,t)=>M(`/projects/${e}`,{method:`PATCH`,body:JSON.stringify(t)}),deleteProject:e=>M(`/projects/${e}`,{method:`DELETE`}),reorderProjects:e=>M(`/projects/reorder`,{method:`PUT`,body:JSON.stringify({projectIds:e})}),setProjectLocalPath:(e,t)=>M(`/projects/${e}/local-path`,{method:`POST`,body:JSON.stringify({localPath:t})}),listBranches:(e,t)=>M(`/projects/${e}/branches`,{signal:t}),checkoutPreflight:(e,t)=>M(`/projects/${e}/checkout-preflight?branch=${encodeURIComponent(t)}`),checkout:(e,t,n=`carry`,r=!1,i)=>M(`/projects/${e}/checkout`,{method:`POST`,body:JSON.stringify({branch:t,strategy:n,create:r,threadId:i})}),listCommands:e=>M(`/projects/${e}/commands`),addCommand:(e,t,n)=>M(`/projects/${e}/commands`,{method:`POST`,body:JSON.stringify({label:t,command:n})}),updateCommand:(e,t,n,r)=>M(`/projects/${e}/commands/${t}`,{method:`PUT`,body:JSON.stringify({label:n,command:r})}),deleteCommand:(e,t)=>M(`/projects/${e}/commands/${t}`,{method:`DELETE`}),runCommand:(e,t,n)=>M(`/projects/${e}/commands/${t}/start`,{method:`POST`,body:JSON.stringify(n?{threadId:n}:{})}),stopCommand:(e,t)=>M(`/projects/${e}/commands/${t}/stop`,{method:`POST`}),getProjectConfig:e=>M(`/projects/${e}/config`),updateProjectConfig:(e,t)=>M(`/projects/${e}/config`,{method:`PUT`,body:JSON.stringify(t)}),getWeaveStatus:e=>M(`/projects/${e}/weave/status`),configureWeave:e=>M(`/projects/${e}/weave/configure`,{method:`POST`}),listHooks:(e,t)=>M(`/projects/${e}/hooks${t?`?hookType=${t}`:``}`),addHook:(e,t)=>M(`/projects/${e}/hooks`,{method:`POST`,body:JSON.stringify(t)}),updateHook:(e,t,n,r)=>M(`/projects/${e}/hooks/${t}/${n}`,{method:`PUT`,body:JSON.stringify(r)}),deleteHook:(e,t,n)=>M(`/projects/${e}/hooks/${t}/${n}`,{method:`DELETE`}),reorderHooks:(e,t,n)=>M(`/projects/${e}/hooks/reorder`,{method:`PUT`,body:JSON.stringify({hookType:t,newOrder:n})}),listProjectMembers:e=>M(`/projects/${e}/members`),addProjectMember:(e,t,n=`member`)=>M(`/projects/${e}/members`,{method:`POST`,body:JSON.stringify({userId:t,role:n})}),removeProjectMember:(e,t)=>M(`/projects/${e}/members/${t}`,{method:`DELETE`}),searchUsers:e=>M(`/users/search?q=${encodeURIComponent(e)}`)},iu={listSkills:e=>M(`/skills${e?`?projectPath=${encodeURIComponent(e)}`:``}`),listAgentResources:e=>{let t=new URLSearchParams;e.projectPath&&t.set(`projectPath`,e.projectPath),e.provider&&t.set(`provider`,e.provider),e.model&&t.set(`model`,e.model),e.phase&&t.set(`phase`,e.phase);let n=t.toString();return M(`/skills/resources${n?`?${n}`:``}`)},addSkill:e=>M(`/skills`,{method:`POST`,body:JSON.stringify({identifier:e})}),removeSkill:e=>M(`/skills/${encodeURIComponent(e)}`,{method:`DELETE`}),getRecommendedSkills:()=>M(`/skills/recommended`),listPlugins:()=>M(`/plugins`)},au={bootstrap:()=>M(`/bootstrap`),setupStatus:()=>M(`/setup/status`),getAvailableShells:()=>M(`/system/shells`),buildNativeGit:()=>M(`/system/build-native-git`,{method:`POST`}),getProviders:()=>M(`/providers`),installProvider:e=>M(`/system/providers/install`,{method:`POST`,body:JSON.stringify(e)}),removeProvider:e=>M(`/system/providers/remove`,{method:`POST`,body:JSON.stringify({id:e})}),setBuiltinEnabled:(e,t)=>M(`/system/providers/${t?`enable`:`disable`}-builtin`,{method:`POST`,body:JSON.stringify({id:e})}),getAcpModels:(e,t=!1)=>M(`/system/${e}/models${t?`?refresh=1`:``}`),getOpenCodeModels:(e=!1)=>M(`/system/opencode/models${e?`?refresh=1`:``}`),readFile:e=>M(`/files/read?path=${encodeURIComponent(e)}`),getFileBlame:e=>M(`/files/blame?path=${encodeURIComponent(e)}`),writeFile:(e,t)=>M(`/files/write`,{method:`POST`,body:JSON.stringify({path:e,content:t})})},ou={getTeamSettings:()=>M(`/team-settings`),updateTeamApiKey:e=>M(`/team-settings/api-key`,{method:`PUT`,body:JSON.stringify({apiKey:e})}),updateTeamDefaults:e=>M(`/team-settings/defaults`,{method:`PUT`,body:JSON.stringify(e)}),getSmtpSettings:()=>M(`/settings/smtp`),updateSmtpSettings:e=>M(`/settings/smtp`,{method:`PUT`,body:JSON.stringify(e)}),testSmtpSettings:()=>M(`/settings/smtp/test`,{method:`POST`}),listTeamProjects:()=>M(`/team-projects`),addTeamProject:e=>M(`/team-projects`,{method:`POST`,body:JSON.stringify({projectId:e})}),removeTeamProject:e=>M(`/team-projects/${e}`,{method:`DELETE`}),listInviteLinks:()=>M(`/invite-links`),createInviteLink:e=>M(`/invite-links`,{method:`POST`,body:JSON.stringify(e)}),revokeInviteLink:e=>M(`/invite-links/${e}`,{method:`DELETE`}),acceptInviteLink:e=>M(`/invite-links/accept`,{method:`POST`,body:JSON.stringify({token:e})}),verifyInviteLink:e=>M(`/invite-links/verify/${e}`),registerViaInvite:e=>M(`/invite-links/register`,{method:`POST`,body:JSON.stringify(e)}),getMyRunners:()=>M(`/runners`),deleteRunner:e=>M(`/runners/${e}`,{method:`DELETE`}),assignRunnerProject:(e,t,n)=>M(`/runners/${e}/projects`,{method:`POST`,body:JSON.stringify({projectId:t,localPath:n})}),unassignRunnerProject:(e,t)=>M(`/runners/${e}/projects/${t}`,{method:`DELETE`}),getRunnerEnrollment:e=>M(`/runners/enroll/${encodeURIComponent(e)}`),approveRunnerEnrollment:e=>M(`/runners/enroll/approve`,{method:`POST`,body:JSON.stringify({userCode:e})})},su={listTestFiles:e=>M(`/tests/${e}/files`),discoverTestSpecs:(e,t)=>M(`/tests/${e}/specs?file=${encodeURIComponent(t)}`),runTest:(e,t,n,r)=>M(`/tests/${e}/run`,{method:`POST`,body:JSON.stringify({file:t,...n!=null&&{line:n},...r?.length&&{projects:r}})}),stopTest:e=>M(`/tests/${e}/stop`,{method:`POST`})},cu={listThreads:(e,t,n,r)=>{let i=new URLSearchParams;e&&i.set(`projectId`,e),t&&i.set(`includeArchived`,`true`),n!=null&&i.set(`limit`,String(n)),r!=null&&i.set(`offset`,String(r));let a=i.toString();return M(`/threads${a?`?${a}`:``}`)},listThreadsByDesign:(e,t=100)=>M(`/threads?${new URLSearchParams({designId:e,limit:String(t)}).toString()}`),searchThreadContent:(e,t,n=!1)=>{let r=new URLSearchParams({q:e});return t&&r.set(`projectId`,t),n&&r.set(`caseSensitive`,`true`),M(`/threads/search/content?${r.toString()}`)},getThread:(e,t,n,r={})=>{let i=new URLSearchParams;t&&i.set(`messageLimit`,String(t)),r.messageProgress!==void 0&&i.set(`messageProgress`,String(r.messageProgress));let a=i.toString();return M(`/threads/${e}${a?`?${a}`:``}`,{signal:n})},getThreadMessages:(e,t,n=50,r=`before`)=>M(`/threads/${e}/messages?${new URLSearchParams({cursor:t,limit:String(n),direction:r}).toString()}`),searchThreadMessages:(e,t,n=100,r=!1)=>{let i=new URLSearchParams({q:t,limit:String(n)});return r&&i.set(`caseSensitive`,`true`),M(`/threads/${e}/messages/search?${i.toString()}`)},getThreadEvents:(e,t)=>M(`/threads/${e}/events`,{signal:t}),getTouchedFiles:(e,t)=>M(`/threads/${e}/touched-files`,{signal:t}),createThread:e=>M(`/threads`,{method:`POST`,body:JSON.stringify(e)}),createIdleThread:e=>M(`/threads/idle`,{method:`POST`,body:JSON.stringify(e)}),createScratchThread:e=>M(`/threads`,{method:`POST`,body:JSON.stringify({isScratch:!0,projectId:null,mode:`local`,prompt:e.prompt,title:e.title,model:e.model,provider:e.provider,permissionMode:e.permissionMode,images:e.images})}),listScratchThreads:(e,t)=>{let n=new URLSearchParams;e!=null&&n.set(`limit`,String(e)),t!=null&&n.set(`offset`,String(t));let r=n.toString();return M(`/threads/scratch${r?`?${r}`:``}`)},sendMessage:(e,t,n,r)=>M(`/threads/${e}/message`,{method:`POST`,body:JSON.stringify({content:t,provider:n?.provider,model:n?.model,permissionMode:n?.permissionMode,effort:n?.effort,images:r,allowedTools:n?.allowedTools,disallowedTools:n?.disallowedTools,fileReferences:n?.fileReferences,symbolReferences:n?.symbolReferences,baseBranch:n?.baseBranch,forceQueue:n?.forceQueue})}),stopThread:e=>M(`/threads/${e}/stop`,{method:`POST`}),convertToWorktree:(e,t)=>M(`/threads/${e}/convert-to-worktree`,{method:`POST`,body:JSON.stringify({baseBranch:t})}),forkThread:(e,t,n)=>M(`/threads/${e}/fork`,{method:`POST`,body:JSON.stringify({messageId:t,title:n})}),rewindCode:(e,t)=>M(`/threads/${e}/rewind`,{method:`POST`,body:JSON.stringify({messageId:t})}),forkAndRewind:(e,t,n)=>M(`/threads/${e}/fork-and-rewind`,{method:`POST`,body:JSON.stringify({messageId:t,title:n})}),approveTool:(e,t,n,r,i,a)=>M(`/threads/${e}/approve-tool`,{method:`POST`,body:JSON.stringify({toolName:t,approved:n,allowedTools:r,disallowedTools:i,scope:a?.scope,pattern:a?.pattern,toolInput:a?.toolInput})}),deleteThread:e=>M(`/threads/${e}`,{method:`DELETE`}),updateToolCallOutput:(e,t,n)=>M(`/threads/${e}/tool-calls/${t}`,{method:`PATCH`,body:JSON.stringify({output:n})}),listQueue:e=>M(`/threads/${e}/queue`),updateQueuedMessage:(e,t,n)=>M(`/threads/${e}/queue/${t}`,{method:`PATCH`,body:JSON.stringify({content:n})}),cancelQueuedMessage:(e,t)=>M(`/threads/${e}/queue/${t}`,{method:`DELETE`}),archiveThread:(e,t)=>M(`/threads/${e}`,{method:`PATCH`,body:JSON.stringify({archived:t})}),pinThread:(e,t)=>M(`/threads/${e}`,{method:`PATCH`,body:JSON.stringify({pinned:t})}),setOrchestratorManaged:(e,t)=>M(`/threads/${e}`,{method:`PATCH`,body:JSON.stringify({orchestratorManaged:t})}),renameThread:(e,t)=>M(`/threads/${e}`,{method:`PATCH`,body:JSON.stringify({title:t})}),updateThreadStage:(e,t)=>M(`/threads/${e}`,{method:`PATCH`,body:JSON.stringify({stage:t})}),getThreadComments:e=>M(`/threads/${e}/comments`),createThreadComment:(e,t)=>M(`/threads/${e}/comments`,{method:`POST`,body:JSON.stringify({content:t})}),deleteThreadComment:(e,t)=>M(`/threads/${e}/comments/${t}`,{method:`DELETE`}),listThreadShares:e=>M(`/threads/${e}/shares`),shareThread:(e,t,n=`view`)=>M(`/threads/${e}/shares`,{method:`POST`,body:JSON.stringify({userId:t,level:n})}),unshareThread:(e,t)=>M(`/threads/${e}/shares/${t}`,{method:`DELETE`}),listSharedWithMe:()=>M(`/threads/shared-with-me`),uploadFile:(e,t)=>M(`/threads/${e}/upload`,{method:`POST`,body:JSON.stringify(t)}),listArchivedThreads:e=>{let t=new URLSearchParams;e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.search&&t.set(`search`,e.search),e?.projectId&&t.set(`projectId`,e.projectId);let n=t.toString();return M(`/threads/archived${n?`?${n}`:``}`)}},lu={listWorktrees:e=>M(`/worktrees?projectId=${e}`),previewWorktree:(e,t)=>M(`/worktrees/preview?projectId=${encodeURIComponent(e)}&branchName=${encodeURIComponent(t)}`),worktreeStatus:(e,t)=>M(`/worktrees/status?projectId=${encodeURIComponent(e)}&worktreePath=${encodeURIComponent(t)}`),createWorktree:e=>M(`/worktrees`,{method:`POST`,body:JSON.stringify(e)}),removeWorktree:(e,t,n)=>M(`/worktrees`,{method:`DELETE`,body:JSON.stringify({projectId:e,worktreePath:t,branchName:n?.branchName,deleteBranch:n?.deleteBranch})})},uu={...ru,...cu,...Zl,...$l,...lu,...iu,...ql,...tu,...eu,...Gl,...Jl,...Ql,...Kl,...au,...nu,...ou,...su,...Yl,...Xl};function du(e){return e?.session?.activeOrganizationId??null}var fu=`1.6.19`;function pu(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var Y=pu({FAILED_TO_CREATE_USER:`Failed to create user`,USER_ALREADY_EXISTS:`User already exists.`,USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL:`User already exists. Use another email.`,YOU_CANNOT_BAN_YOURSELF:`You cannot ban yourself`,YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE:`You are not allowed to change users role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS:`You are not allowed to create users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS:`You are not allowed to list users`,YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS:`You are not allowed to list users sessions`,YOU_ARE_NOT_ALLOWED_TO_BAN_USERS:`You are not allowed to ban users`,YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS:`You are not allowed to impersonate users`,YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS:`You are not allowed to revoke users sessions`,YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS:`You are not allowed to delete users`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD:`You are not allowed to set users password`,BANNED_USER:`You have been banned from this application`,YOU_ARE_NOT_ALLOWED_TO_GET_USER:`You are not allowed to get user`,NO_DATA_TO_UPDATE:`No data to update`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS:`You are not allowed to update users`,YOU_CANNOT_REMOVE_YOURSELF:`You cannot remove yourself`,YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE:`You are not allowed to set a non-existent role value`,YOU_CANNOT_IMPERSONATE_ADMINS:`You cannot impersonate admins`,INVALID_ROLE_TYPE:`Invalid role type`,YOU_ARE_NOT_ALLOWED_TO_SET_USERS_EMAIL:`You are not allowed to update users email`,PASSWORD_CANNOT_BE_UPDATED_VIA_UPDATE_USER:`Password cannot be updated through update-user. Use the set-user-password endpoint instead`});function mu(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function hu(e){let t=e.split(`
|
|
35
35
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
36
|
-
at `))}function X(e,t){class n extends e{#e;constructor(...e){if(mu()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=hu(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var gu={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};X(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:gu[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var _u=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}};function vu(e){return{success:!1,error:`You are not allowed to access resource: ${e}`}}function yu(e){return{success:!1,error:`unauthorized to access resource "${e}"`}}function bu(e){return e===`OR`?`OR`:`AND`}function xu(e){return Array.isArray(e)}function Su(e){if(xu(e))return{actions:e,connector:`AND`};if(!e||typeof e!=`object`)throw new _u(`Invalid access control request`);let{actions:t,connector:n}=e;return xu(t)?{actions:t,connector:bu(n)}:{actions:[],connector:bu(n)}}function Cu(e,t){return typeof t==`string`&&e.includes(t)}function wu(e,{actions:t,connector:n}){return t.length===0?!1:n===`OR`?t.some(t=>Cu(e,t)):t.every(t=>Cu(e,t))}function Tu(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t){if(n===`AND`)return vu(i);continue}let o=wu(t,Su(a));if(o&&(r=!0),o&&n===`OR`)return{success:!0};if(!o&&n===`AND`)return yu(i)}return r?{success:!0}:{success:!1,error:`Not authorized`}},statements:e}}function Eu(e){return{newRole(e){return Tu(e)},statements:e}}var Du=Eu({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),Ou=Du.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),ku=Du.newRole({user:[],session:[]}),Au={admin:Ou,user:ku},ju=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||`user`).split(`,`),n=e.options?.roles||Au;for(let r of t)if(n[r]?.authorize(e.permissions)?.success)return!0;return!1},Mu=e=>{let t={admin:Ou,user:ku,...e?.roles};return{id:`admin-client`,version:fu,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>ju({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions})}}),pathMethods:{"/admin/list-users":`GET`,"/admin/impersonate-user":`POST`,"/admin/stop-impersonating":`POST`},atomListeners:[{matcher:e=>e===`/admin/impersonate-user`||e===`/admin/stop-impersonating`,signal:`$sessionSignal`}],$ERROR_CODES:Y}},Nu=Object.create(null),Pu=e=>({}),Fu=new Proxy(Nu,{get(e,t){return Pu()[t]??Nu[t]},has(e,t){return t in Pu()||t in Nu},set(e,t,n){let r=Pu(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Pu(!0);return delete n[t],!0},ownKeys(){let e=Pu(!0);return Object.keys(e)}});Fu.NODE_ENV;function Iu(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Iu(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Iu(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Iu(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Iu(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Iu(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Iu(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Iu(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var Lu=47;function Ru(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Lu;)t--;return t===e.length?e:e.slice(0,t)}function zu(e){try{return(Ru(new URL(e).pathname)||`/`)!==`/`}catch{throw new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Bu(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new _u(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof _u?t:new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Vu(e,t=`/api/auth`){if(Bu(e),zu(e))return e;let n=Ru(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Hu(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Uu(e,t,n,r,i){if(e)return Vu(e,t);if(r!==!1){let e=Fu.BETTER_AUTH_URL||Fu.NEXT_PUBLIC_BETTER_AUTH_URL||Fu.PUBLIC_BETTER_AUTH_URL||Fu.NUXT_PUBLIC_BETTER_AUTH_URL||Fu.NUXT_PUBLIC_AUTH_URL||(Fu.BASE_URL===`/`?void 0:Fu.BASE_URL);if(e)return Vu(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Hu(o,`proto`)&&Hu(a,`host`))try{return Vu(`${o}://${a}`,t)}catch{}if(n){let e=Wu(n.url);if(!e)throw new _u(`Could not get origin from request. Please provide a valid base URL.`);return Vu(e,t)}if(typeof window<`u`&&window.location)return Vu(window.location.origin,t)}function Wu(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Gu=[`javascript:`,`data:`,`vbscript:`];function Ku(e){let t;try{t=new URL(e)}catch{return!0}return!Gu.includes(t.protocol)}var qu=pu({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:`You are not allowed to create a new organization`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:`You have reached the maximum number of organizations`,ORGANIZATION_ALREADY_EXISTS:`Organization already exists`,ORGANIZATION_SLUG_ALREADY_TAKEN:`Organization slug already taken`,ORGANIZATION_NOT_FOUND:`Organization not found`,USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:`User is not a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:`You are not allowed to update this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:`You are not allowed to delete this organization`,NO_ACTIVE_ORGANIZATION:`No active organization`,USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:`User is already a member of this organization`,MEMBER_NOT_FOUND:`Member not found`,ROLE_NOT_FOUND:`Role not found`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:`You are not allowed to create a new team`,TEAM_ALREADY_EXISTS:`Team already exists`,TEAM_NOT_FOUND:`Team not found`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:`You cannot leave the organization as the only owner`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:`You cannot leave the organization without an owner`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:`You are not allowed to delete this member`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:`You are not allowed to invite users to this organization`,USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:`User is already invited to this organization`,INVITATION_NOT_FOUND:`Invitation not found`,YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:`You are not the recipient of the invitation`,EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:`Email verification required before accepting or rejecting invitation`,EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:`Email verification required to view or list invitations for the session email`,YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:`You are not allowed to cancel this invitation`,INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:`Inviter is no longer a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:`You are not allowed to invite a user with this role`,FAILED_TO_RETRIEVE_INVITATION:`Failed to retrieve invitation`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:`You have reached the maximum number of teams`,UNABLE_TO_REMOVE_LAST_TEAM:`Unable to remove last team`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:`You are not allowed to update this member`,ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:`Organization membership limit reached`,YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to create teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to delete teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:`You are not allowed to update this team`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:`You are not allowed to delete this team`,INVITATION_LIMIT_REACHED:`Invitation limit reached`,TEAM_MEMBER_LIMIT_REACHED:`Team member limit reached`,USER_IS_NOT_A_MEMBER_OF_THE_TEAM:`User is not a member of the team`,YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:`You are not allowed to list the members of this team`,YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:`You do not have an active team`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:`You are not allowed to create a new member`,YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:`You are not allowed to remove a team member`,YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:`You are not allowed to access this organization as an owner`,YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:`You are not a member of this organization`,MISSING_AC_INSTANCE:`Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information`,YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:`You must be in an organization to create a role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:`You are not allowed to create a role`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:`You are not allowed to update a role`,YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:`You are not allowed to delete a role`,YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:`You are not allowed to read a role`,YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:`You are not allowed to list a role`,YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:`You are not allowed to get a role`,TOO_MANY_ROLES:`This organization has too many roles`,INVALID_RESOURCE:`The provided permission includes an invalid resource`,ROLE_NAME_IS_ALREADY_TAKEN:`That role name is already taken`,CANNOT_DELETE_A_PRE_DEFINED_ROLE:`Cannot delete a pre-defined role`,ROLE_IS_ASSIGNED_TO_MEMBERS:`Cannot delete a role that is assigned to members. Please reassign the members to a different role first`,INVALID_TEAM_ID:`Team id contains a reserved character`}),Ju=[],Yu=0,Xu=4,Zu=globalThis.nanostoresGlobal||={epoch:0},Z=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=Yu+Xu;t<Ju.length;)Ju[t]===e?Ju.splice(t,Xu):t+=Xu;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Zu.epoch++;let i=!Ju.length;for(let i of t)Ju.push(i,n.value,e,r);if(i){for(Yu=0;Yu<Ju.length;Yu+=Xu)Ju[Yu](Ju[Yu+1],Ju[Yu+2],Ju[Yu+3]);Ju.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},Qu=2,$u=5,ed=6,td=10,Q=(e,t,n,r)=>(e.events=e.events||{},e.events[n+td]||(e.events[n+td]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+td](),delete e.events[n+td])}),nd=(e,t)=>Q(e,t,Qu,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),rd=1e3,id=(e,t)=>Q(e,n=>{let r=t(n);r&&e.events[ed].push(r)},$u,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[ed]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ed])t();e.events[ed]=[]}},rd)},()=>{e.listen=n,e.off=r}});function ad(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}function od(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function sd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!sd(e[n],t[n]))return!1;return!0}if(od(e)&&od(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!sd(e[r],t[r]))return!1;return!0}return!1}function cd(e,t){return nd(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var ld=()=>typeof window>`u`;function ud(e,t){return sd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var dd=(e,t,n,r)=>{let i=Z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});cd(i,ud);let a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){let t=i.get(),n=t.data!=null&&e.data!=null&&sd(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1,s=[];for(let t of e){let e=t.subscribe(async()=>{ld()||(o?await a():id(i,()=>{let e=setTimeout(async()=>{o||(o=!0,await a())},0);return()=>{for(let e of s)e();clearTimeout(e)}}))});s.push(e)}return i},fd=Eu({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),pd=fd.newRole({organization:[`update`],invitation:[`create`,`cancel`],member:[`create`,`update`,`delete`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),md=fd.newRole({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),hd=fd.newRole({organization:[],member:[],invitation:[],team:[],ac:[`read`]}),gd={admin:pd,owner:md,member:hd},_d=(e,t)=>{if(!e.permissions)return!1;let n=e.role.split(`,`),r=e.options.creatorRole||`owner`,i=n.includes(r),a=e.allowCreatorAllPermissions||!1;if(i&&a)return!0;for(let r of n)if(t[r]?.authorize(e.permissions)?.success)return!0;return!1},vd=e=>_d(e,e.options.roles||gd),$=e=>{let t=Z(!1),n=Z(!1),r=Z(!1),i=Z(!1),a={admin:pd,member:hd,owner:md,...e?.roles};return{id:`organization`,version:fu,$InferServerPlugin:{},getActions:(t,n,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>vd({role:t.role,options:{ac:e?.ac,roles:a},permissions:t.permissions})}}),getAtoms:e=>{let a=dd(t,`/organization/list`,e,{method:`GET`});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:i,activeOrganization:dd([n],`/organization/get-full-organization`,e,()=>({method:`GET`})),listOrganizations:a,activeMember:dd([n,r],`/organization/get-active-member`,e,{method:`GET`}),activeMemberRole:dd([n,i],`/organization/get-active-member-role`,e,{method:`GET`})}},pathMethods:{"/organization/get-full-organization":`GET`,"/organization/list-user-teams":`GET`},atomListeners:[{matcher(e){return e===`/organization/create`||e===`/organization/delete`||e===`/organization/update`},signal:`$listOrg`},{matcher(e){return e===`/sign-out`||e.startsWith(`/organization`)},signal:`$activeOrgSignal`},{matcher(e){return e.startsWith(`/organization/set-active`)||e===`/organization/create`||e===`/organization/delete`||e===`/organization/remove-member`||e===`/organization/leave`||e===`/organization/accept-invitation`},signal:`$sessionSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberRoleSignal`}],$ERROR_CODES:qu}},yd=pu({INVALID_USERNAME_OR_PASSWORD:`Invalid username or password`,EMAIL_NOT_VERIFIED:`Email not verified`,UNEXPECTED_ERROR:`Unexpected error`,USERNAME_IS_ALREADY_TAKEN:`Username is already taken. Please try another.`,USERNAME_TOO_SHORT:`Username is too short`,USERNAME_TOO_LONG:`Username is too long`,INVALID_USERNAME:`Username is invalid`,INVALID_DISPLAY_USERNAME:`Display username is invalid`}),bd=()=>({id:`username`,version:fu,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/sign-in/username`,signal:`$sessionSignal`}],$ERROR_CODES:yd}),xd={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Sd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Cd={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},wd=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Td(e){return e instanceof Date&&!isNaN(e.getTime())}function Ed(e){let t=wd.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Td(f)?f:null}function Dd(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Cd)return Cd[s];if(!Sd.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(xd).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Ed(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Od(e,t={strict:!0}){return Dd(e,t)}var kd={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Ku(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},Ad=Symbol.for(`better-auth:broadcast-channel`),jd=()=>Math.floor(Date.now()/1e3),Md=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:jd()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Nd(e=`better-auth.message`){return globalThis[Ad]||(globalThis[Ad]=new Md(e)),globalThis[Ad]}var Pd=Symbol.for(`better-auth:focus-manager`),Fd=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Id(){return globalThis[Pd]||(globalThis[Pd]=new Fd),globalThis[Pd]}var Ld=Symbol.for(`better-auth:online-manager`),Rd=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function zd(){return globalThis[Ld]||(globalThis[Ld]=new Rd),globalThis[Ld]}var Bd=()=>Math.floor(Date.now()/1e3),Vd=5;function Hd(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||zd().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=Bd(),t();return}if(e?.event===`visibilitychange`){if(Bd()-c.lastSessionRequest<Vd)return;c.lastSessionRequest=Bd(),t();return}t()}},d=e=>{Nd().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Nd().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Id().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=zd().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Nd().setup(),c.cleanupFocusSetup=Id().setup(),c.cleanupOnlineSetup=zd().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Ud=()=>typeof window>`u`;function Wd(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Gd(e){return!e||e.session===null&&e.user===null?null:e}function Kd(e,t){return sd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function qd(e,t){let n=Z(!1),r,i=e=>s(e),a=Z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});cd(a,Kd);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=Wd(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=Wd(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=Gd(s),u=a.get(),d=u.data!=null&&l!=null&&sd(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return id(a,()=>{let e;Ud()||(e=setTimeout(()=>{s()},0));let i=Hd({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}function Jd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Yd(e,t,n=`.`,r){if(!Jd(t))return Yd(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Jd(a)&&Jd(i[t])?i[t]=Yd(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Xd(e){return(...t)=>t.reduce((t,n)=>Yd(t,n,``,e),{})}var Zd=Xd(),Qd=Object.defineProperty,$d=Object.defineProperties,ef=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,nf=Object.prototype.hasOwnProperty,rf=Object.prototype.propertyIsEnumerable,af=(e,t,n)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,of=(e,t)=>{for(var n in t||={})nf.call(t,n)&&af(e,n,t[n]);if(tf)for(var n of tf(t))rf.call(t,n)&&af(e,n,t[n]);return e},sf=(e,t)=>$d(e,ef(t)),cf=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},lf=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},uf=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},df=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function ff(e){if(typeof e==`number`)return new uf({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new uf(e);case`exponential`:return new df(e);default:throw Error(`Invalid retry strategy`)}}var pf=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},mf=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function hf(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return mf.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function gf(e){try{return JSON.parse(e),!0}catch{return!1}}function _f(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function vf(e){try{return JSON.parse(e)}catch{return e}}function yf(e){return typeof e==`function`}function bf(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&yf(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&yf(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function xf(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function Sf(e){let t=new Headers(xf(e?.headers,await pf(e)));if(!t.has(`content-type`)){let n=Cf(e?.body);n&&t.set(`content-type`,n)}return t}function Cf(e){return _f(e)?`application/json`:null}function wf(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function Tf(e,t){let{body:n}=e;return n?!_f(n)||typeof n==`string`?n:wf(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function Ef(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return Af.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function Df(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Of=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function kf(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Of(n.issues);return n.value}var Af=[`get`,`post`,`put`,`patch`,`delete`],jf=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await kf(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=sf(of({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=sf(of({},r),{body:i.input?await kf(i.input,n?.body):n?.body,params:i.params?await kf(i.params,n?.params):n?.params,query:i.query?await kf(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),Mf=e=>{async function t(t,n){let r=sf(of(of({},e),n),{headers:xf(e?.headers,n?.headers),plugins:[...e?.plugins||[],jf(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await If(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await If(t,r)}return t},Nf=e=>e===`.`||e===`..`;function Pf(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(Nf(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function Ff(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];Af.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>Pf(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var If=async(e,t)=>{let{hooks:n,url:r,options:i}=await lf(e,t),a=bf(i),o=new AbortController,s=i.signal??o.signal,c=Ff(r,i),l=await Sf(i),u=Tf(i,l),d=Ef(r,i),f=sf(of({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=Df(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(sf(of({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=hf(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??vf)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await kf(f.output,r.data));for(let e of n.onSuccess)e&&await e(sf(of({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??vf,_=await m.text(),v=gf(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:sf(of({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(sf(of({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=ff(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await If(e,sf(of({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new cf(m.status,m.statusText,v?y:_);return{data:null,error:sf(of({},y),{status:m.status,statusText:m.statusText})}},Lf=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Rf=(e,t)=>{let n=`credentials`in Request.prototype,r=Uu(e?.baseURL,e?.basePath,void 0,t)??Lf(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Mf({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Od(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[kd],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=qd(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Zd(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function zf(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Bf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Vf=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Hf=/['\u2019]/g;function Uf(e){return e.replace(Hf,``).match(Vf)??[]}function Wf(e){return Uf(e).map(e=>e.toLowerCase()).join(`-`)}function Gf(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Kf(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||zf(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Wf).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Gf(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function qf(e,t={}){let n=(0,N.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,N.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?ad(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,N.useSyncExternalStore)(a,o,o)}function Jf(e){return`use${Bf(e)}`}function Yf(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Rf(e),s={};for(let[e,t]of Object.entries(r))s[Jf(e)]=()=>qf(t);return Kf({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Xf=Yf({baseURL:typeof window<`u`&&window.__TAURI_INTERNALS__&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`http://localhost:5002`:``,basePath:`/api/auth`,plugins:[bd(),Mu(),$()]}),Zf=`http://localhost:4000`,Qf=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`],$f=`funny:log-level`,ep=`funny:log-ns:`;function tp(e){try{let t=localStorage.getItem(e);return t&&Qf.includes(t)?t:void 0}catch{return}}function np(){return tp($f)??`info`}var rp=null;function ip(){return rp||=s({endpoint:Zf,serviceName:`funny-client`,enabled:!0,includeUrl:!0,level:np()}),rp}function ap(e){let t=ip().child({"log.namespace":e}),n=tp(`${ep}${e}`);return n&&t.setLevel(n),t}typeof window<`u`&&(window.__funnyLog={setLevel(e){try{localStorage.setItem($f,e)}catch{}ip().setLevel(e)},setNamespaceLevel(e,t){try{localStorage.setItem(`${ep}${e}`,t)}catch{}},clear(){try{localStorage.removeItem($f);for(let e=localStorage.length-1;e>=0;e--){let t=localStorage.key(e);t?.startsWith(ep)&&localStorage.removeItem(t)}}catch{}ip().setLevel(np())}});var op=null;function sp(e){op=e}function cp(){return op}var lp=t({useAuthStore:()=>dp}),up=ap(`auth-store`),dp=be((e,t)=>({user:null,isAuthenticated:!1,isLoading:!0,activeOrgId:null,activeOrgName:null,activeOrgSlug:null,initialize:async()=>{e({isLoading:!0});try{let t=await Xf.getSession();if(t.data?.user){let n=t.data.user,r=du(t.data),i=null,a=null;if(r)try{let e=(await Xf.organization.list()).data?.find(e=>e.id===r);e&&(i=e.name,a=e.slug)}catch{}e({isAuthenticated:!0,isLoading:!1,activeOrgId:r,activeOrgName:i,activeOrgSlug:a,user:{id:n.id,username:n.username||n.name||`user`,displayName:n.name||n.username||`User`,role:n.role||`user`}}),sp(a)}else e({isAuthenticated:!1,isLoading:!1,user:null}),sp(null)}catch(t){up.error(`initialization error`,{error:t instanceof Error?t.message:String(t)}),e({isAuthenticated:!1,isLoading:!1})}},login:async(t,n)=>{let r=await Xf.signIn.username({username:t,password:n});if(r.error)throw Error(r.error.message||`Login failed`);let i=await Xf.getSession();for(let e=0;e<10&&!i.data?.user;e++)await new Promise(e=>setTimeout(e,80)),i=await Xf.getSession();let a=i.data?.user;if(!a)throw Error(`Session was not stored in the browser. Use BETTER_AUTH_BASE_URL with the same origin you open in the address bar (e.g. http://localhost:5173 with Vite), add that origin to CORS_ORIGIN, and avoid https:// in BASE_URL when using http:// locally.`);e({isAuthenticated:!0,user:{id:a.id,username:a.username||a.name||`user`,displayName:a.name||a.username||`User`,role:a.role||`user`}})},logout:async()=>{try{await Xf.signOut()}catch{}e({isAuthenticated:!1,user:null,activeOrgId:null,activeOrgName:null,activeOrgSlug:null}),sp(null)},setActiveOrg:(t,n,r)=>{e({activeOrgId:t,activeOrgName:n,activeOrgSlug:r??null}),sp(r??null)}}));ye(async()=>{try{(await Xf.getSession()).data?.user||dp.getState().logout()}catch{}});var fp=be(e=>({profile:null,setProfile:t=>e({profile:t})})),pp=1024,mp=1024*1024,hp={"gpt-5.5":{id:`gpt-5.5`,label:`GPT-5.5`,contextWindow:4e5,i18nKey:`gpt55`},"gpt-5.4":{id:`gpt-5.4`,label:`GPT-5.4`,contextWindow:4e5,i18nKey:`gpt54`},"gpt-5.4-mini":{id:`gpt-5.4-mini`,label:`GPT-5.4 Mini`,contextWindow:4e5,i18nKey:`gpt54mini`},"gpt-5.3-codex":{id:`gpt-5.3-codex`,label:`GPT-5.3 Codex`,contextWindow:4e5,i18nKey:`gpt53codex`},"gpt-5.2":{id:`gpt-5.2`,label:`GPT-5.2`,contextWindow:4e5,i18nKey:`gpt52`}},gp={"gemini-3.1-pro-preview":{id:`gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro`,contextWindow:1e6,i18nKey:`gemini31pro`},"gemini-3-flash-preview":{id:`gemini-3-flash-preview`,label:`Gemini 3 Flash`,contextWindow:1e6,i18nKey:`gemini3flash`},"gemini-3.1-flash-lite-preview":{id:`gemini-3.1-flash-lite-preview`,label:`Gemini 3.1 Flash Lite`,contextWindow:1e6,i18nKey:`gemini31flashLite`},"gemini-2.5-pro":{id:`gemini-2.5-pro`,label:`Gemini 2.5 Pro`,contextWindow:1048576,i18nKey:`gemini25pro`},"gemini-2.5-flash":{id:`gemini-2.5-flash`,label:`Gemini 2.5 Flash`,contextWindow:1048576,i18nKey:`gemini25flash`},"gemini-2.0-flash":{id:`gemini-2.0-flash`,label:`Gemini 2.0 Flash`,contextWindow:1048576,i18nKey:`gemini20flash`}},_p={default:{id:`default`,label:`Pi (configured default)`,contextWindow:2e5,i18nKey:`piDefault`}},vp={default:{id:`default`,label:`Cursor (configured default)`,contextWindow:2e5,i18nKey:`cursorDefault`}},yp={default:{id:`default`,label:`opencode (configured default)`,contextWindow:2e5,i18nKey:`opencodeDefault`}},bp={codex:{id:`codex`,label:`Codex`,kind:`acp`,spawn:{command:`codex-acp`,args:[],binEnvVars:[`CODEX_ACP_BINARY_PATH`,`ACP_CODEX_BIN`,`CODEX_BIN`],npxSpec:{useEnvVar:`CODEX_ACP_USE_NPX`,pkg:[`-y`,`@zed-industries/codex-acp`]}},models:{kind:`static`,entries:hp,defaultModel:`gpt-5.5`},setModel:{method:`unstable_setSessionModel`},modelVia:`acp-method`,modeVia:`acp-setSessionMode`,modeMap:{plan:`read-only`,ask:`auto`,confirmEdit:`auto`,auto:`auto`,autoEdit:`full-access`},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`apply_patch`,`list_directory`,`glob`,`grep`,`run_shell_command`,`web_fetch`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:20*mp,hardMaxBytes:25*mp},auth:{mode:`provider-key`,providerKeyId:`openai`},quirks:{bufferPreambleAsThink:!0,planRender:`text`,permissionModel:`gated`,splitGluedAgentMessages:!0}},gemini:{id:`gemini`,label:`Gemini`,kind:`acp`,spawn:{command:`gemini`,args:[`--acp`],binEnvVars:[`GEMINI_BINARY_PATH`,`ACP_GEMINI_BIN`]},models:{kind:`static`,entries:gp,defaultModel:`gemini-3.1-pro-preview`},modelVia:`cli-arg`,modeVia:`cli-flag`,modeMap:{plan:null,ask:null,confirmEdit:null,auto:null,autoEdit:null},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`replace`,`list_directory`,`glob`,`grep_search`,`run_shell_command`,`web_fetch`,`google_web_search`,`codebase_investigator`,`save_memory`,`ask_user`,`activate_skill`,`cli_help`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:18*mp,hardMaxBytes:20*mp},auth:{mode:`provider-key`,providerKeyId:`gemini`},prelaunch:`gemini-trust-folder`,quirks:{bufferPreambleAsThink:!0,planRender:`text`,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`}},cursor:{id:`cursor`,label:`Cursor`,kind:`acp`,spawn:{command:`cursor-agent`,args:[`acp`],binEnvVars:[`CURSOR_BINARY_PATH`,`ACP_CURSOR_BIN`],npxSpec:{useEnvVar:`CURSOR_ACP_USE_NPX`,pkg:[`-y`,`cursor-agent`,`acp`]}},models:{kind:`dynamic`,sentinel:vp.default,defaultModel:`default`},setModel:{method:`unstable_setSessionModel`},modelVia:`acp-method`,modeVia:`none`,modeMap:{plan:null,ask:null,confirmEdit:null,auto:null,autoEdit:null},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`edit_file`,`list_dir`,`glob_file_search`,`grep_search`,`run_terminal_cmd`,`web_search`,`fetch_url`,`todo_write`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:10*mp,hardMaxBytes:15*mp},auth:{mode:`provider-key`,providerKeyId:`cursor`},quirks:{planRender:`todoCard`,deferUnrenderableToolInput:!0,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`,filterMcpByCapability:!0}},opencode:{id:`opencode`,label:`opencode`,kind:`acp`,spawn:{command:`opencode`,args:[`acp`],binEnvVars:[`OPENCODE_BIN`,`ACP_OPENCODE_BIN`],npxSpec:{useEnvVar:`OPENCODE_ACP_USE_NPX`,pkg:[`-y`,`opencode-ai`,`acp`]}},models:{kind:`dynamic`,sentinel:yp.default,defaultModel:`default`},setModel:{method:`session/set_model`},modelVia:`acp-method`,modeVia:`acp-setSessionMode`,modeMap:{plan:`plan`,ask:`build`,confirmEdit:`build`,auto:`build`,autoEdit:`build`},forkCapabilityPaths:[`sessionCapabilities.fork`],builtinTools:[`read`,`write`,`edit`,`patch`,`bash`,`glob`,`grep`,`list`,`webfetch`,`todowrite`,`todoread`,`task`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:10*mp,hardMaxBytes:15*mp},auth:{mode:`runner-preauth`},quirks:{planRender:`todoCard`,deferUnrenderableToolInput:!0,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`,filterMcpByCapability:!0}}},xp=Object.keys(bp),Sp=[`pi`,...xp.filter(e=>bp[e].models.kind===`dynamic`)],Cp=`claude`,wp=`local`,Tp=`queue`,Ep=`autoEdit`,Dp={claude:{haiku:{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`,contextWindow:2e5,i18nKey:`haiku`},sonnet:{id:`claude-sonnet-4-5-20250929`,label:`Sonnet 4.5`,contextWindow:2e5,i18nKey:`sonnet`},"sonnet-4.6":{id:`claude-sonnet-4-6[1m]`,label:`Sonnet 4.6`,contextWindow:1e6,i18nKey:`sonnet46`},opus:{id:`claude-opus-4-6[1m]`,label:`Opus 4.6`,contextWindow:1e6,i18nKey:`opus`},"opus-4.7":{id:`claude-opus-4-7[1m]`,label:`Opus 4.7`,contextWindow:1e6,i18nKey:`opus47`},"opus-4.8":{id:`claude-opus-4-8[1m]`,label:`Opus 4.8`,contextWindow:1e6,i18nKey:`opus48`},"fable-5":{id:`claude-fable-5[1m]`,label:`Fable 5`,contextWindow:1e6,i18nKey:`fable5`}},codex:hp,gemini:gp,pi:_p,cursor:vp,opencode:yp,deepagent:{"minimax-m2.7":{id:`openai:MiniMax-M2.7`,label:`MiniMax M2.7`,contextWindow:204800,i18nKey:`minimaxM27`},"minimax-m2.7-highspeed":{id:`openai:MiniMax-M2.7-highspeed`,label:`MiniMax M2.7 Highspeed`,contextWindow:204800,i18nKey:`minimaxM27Highspeed`},"deepagent-gpt-4o":{id:`gpt-4o`,label:`GPT-4o`,contextWindow:128e3,i18nKey:`deepagentGpt4o`},"deepagent-sonnet":{id:`claude-sonnet-4-5-20250929`,label:`Sonnet 4.5`,contextWindow:2e5,i18nKey:`deepagentSonnet`},"deepagent-gemini-2.5-flash":{id:`google-genai:gemini-2.5-flash`,label:`Gemini 2.5 Flash`,contextWindow:1048576,i18nKey:`deepagentGemini25flash`},"deepagent-gemini-2.5-pro":{id:`google-genai:gemini-2.5-pro`,label:`Gemini 2.5 Pro`,contextWindow:1048576,i18nKey:`deepagentGemini25pro`},"deepagent-gemini-3-flash":{id:`google-genai:gemini-3-flash-preview`,label:`Gemini 3 Flash`,contextWindow:1e6,i18nKey:`deepagentGemini3flash`},"deepagent-gemini-3-pro":{id:`google-genai:gemini-3-pro-preview`,label:`Gemini 3 Pro`,contextWindow:1e6,i18nKey:`deepagentGemini3pro`},"deepagent-grok-3":{id:`openai:grok-3`,label:`Grok 3`,contextWindow:131072,i18nKey:`deepagentGrok3`},"deepagent-grok-3-mini":{id:`openai:grok-3-mini`,label:`Grok 3 Mini`,contextWindow:131072,i18nKey:`deepagentGrok3mini`},"deepagent-glm-5.1":{id:`openai:glm-5.1`,label:`GLM-5.1`,contextWindow:128e3,i18nKey:`deepagentGlm51`},"deepagent-glm-5-turbo":{id:`openai:glm-5-turbo`,label:`GLM-5 Turbo`,contextWindow:128e3,i18nKey:`deepagentGlm5turbo`},"deepagent-glm-5v-turbo":{id:`openai:glm-5v-turbo`,label:`GLM-5V Turbo`,contextWindow:128e3,i18nKey:`deepagentGlm5vturbo`}}},Op=`opus-4.8`,kp={claude:Op,deepagent:`minimax-m2.7`,pi:`default`,...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.models.defaultModel]))},Ap=1024,jp=1024*1024,Mp={claude:{inlineMaxBytes:100*Ap,uploadMaxBytes:25*jp,hardMaxBytes:30*jp},deepagent:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},pi:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},"llm-api":{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},external:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.attachmentLimits]))},Np={claude:`Claude`,deepagent:`Deep Agent`,pi:`Pi`,...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.label]))};[...Object.keys(bp)];var Pp=[{id:`github`,label:`GitHub Personal Access Token`,helpUrl:`https://github.com/settings/tokens`,description:`Used for push, PR, and private repo operations.`,envVar:`GH_TOKEN`},{id:`gemini`,label:`Google Gemini API Key`,helpUrl:`https://aistudio.google.com/apikey`,description:`Required for Gemini models (Flash, Pro).`,envVar:`GEMINI_API_KEY`,requiredByProviders:[`gemini`,`deepagent`]},{id:`openai`,label:`OpenAI API Key`,helpUrl:`https://platform.openai.com/api-keys`,description:`Required for Codex models and Deep Agent GPT-4o.`,envVar:`OPENAI_API_KEY`,requiredByProviders:[`codex`,`deepagent`]},{id:`minimax`,label:`MiniMax API Key`,helpUrl:`https://platform.minimax.io`,description:`Required by Deep Agent when selecting MiniMax M2.7 models.`,envVar:`MINIMAX_API_KEY`,requiredByProviders:[`deepagent`]},{id:`zhipuai`,label:`zAI API Key`,helpUrl:`https://z.ai/manage-apikey/apikey-list`,description:`Required by Deep Agent when selecting GLM models.`,envVar:`ZHIPUAI_API_KEY`,requiredByProviders:[`deepagent`]},{id:`xai`,label:`xAI API Key`,helpUrl:`https://console.x.ai/`,description:`Required by Deep Agent when selecting Grok models.`,envVar:`XAI_API_KEY`,requiredByProviders:[`deepagent`]},{id:`cursor`,label:`Cursor API Key`,helpUrl:`https://cursor.com/dashboard`,description:"Used by the Cursor CLI ACP adapter. Alternatively run `cursor-agent login` once on the runner.",envVar:`CURSOR_API_KEY`,requiredByProviders:[`cursor`]},{id:`assemblyai`,label:`AssemblyAI API Key`,helpUrl:`https://www.assemblyai.com/dashboard/signup`,description:`Enables voice dictation in the prompt input.`}];function Fp(e){return e in Dp}function Ip(e,t){if(Fp(e))return Dp[e][t]}function Lp(e){if(e===`llm-api`)return Op;if(Fp(e))return kp[e];throw Error(`Unknown provider: ${e}`)}function Rp(e,t){return Ip(e,t)?.contextWindow??2e5}function zp(e){return Mp[e]??Mp.claude}var Bp={cursor:`Cursor`,vscode:`VS Code`,windsurf:`Windsurf`,zed:`Zed`,sublime:`Sublime Text`,vim:`Vim`},Vp=[`Read`,`Edit`,`Write`,`Bash`,`Glob`,`Grep`,`WebSearch`,`WebFetch`,`Task`,`TodoWrite`,`NotebookEdit`],Hp={Read:`tools.readFile`,Edit:`tools.editFile`,Write:`tools.writeFile`,Bash:`tools.runCommand`,Glob:`tools.findFiles`,Grep:`tools.searchCode`,WebSearch:`tools.webSearch`,WebFetch:`tools.fetchUrl`,Task:`tools.subagent`,TodoWrite:`tools.todos`,NotebookEdit:`tools.editNotebook`},Up=Object.fromEntries(Vp.map(e=>[e,`allow`])),Wp=`funny_font_size`,Gp={small:`13px`,default:`14px`,large:`16px`},Kp={small:11,default:11,large:13},qp={small:20,default:20,large:24},Jp={small:12,default:13,large:15},Yp={small:13,default:14,large:16},Xp={small:21.1,default:22.75,large:26},Zp=Jp,Qp={small:18,default:20,large:23};function $p(){try{let e=localStorage.getItem(Wp);if(e&&e in Gp)return e}catch{}return`default`}var em=`funny_notifications_enabled`,tm=`funny_notifications_sound`,nm=`funny_hidden_prompt_models`,rm=`funny_hidden_prompt_models_version`,im=`1`;function am(){try{return localStorage.getItem(em)===`1`}catch{return!1}}function om(){try{return localStorage.getItem(tm)===`1`}catch{return!1}}var sm=new Set([`claude:haiku`,`claude:sonnet`,`claude:opus-4.8`,`pi:default`,`cursor:default`]);function cm(){let e=[];for(let[t,n]of Object.entries(Dp))for(let r of Object.keys(n))e.push(`${t}:${r}`);return e}function lm(){try{let e=localStorage.getItem(nm),t=localStorage.getItem(rm);if(e&&t===im){let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}let n=cm().filter(e=>!sm.has(e));um(n);try{localStorage.setItem(rm,im)}catch{}return n}catch{return[]}}function um(e){try{localStorage.setItem(nm,JSON.stringify(e))}catch{}}function dm(e){document.documentElement.style.fontSize=Gp[e];let t=Zp[e],n=Qp[e],r=Kp[e];document.documentElement.style.setProperty(`--diff-font-size`,`${t}px`),document.documentElement.style.setProperty(`--diff-row-height`,`${n}px`),document.documentElement.style.setProperty(`--code-font-size`,`${r}px`)}function fm(e){nu.updateProfile(e).match(()=>{},()=>{})}function pm(e){let t=[],n=[];for(let[r,i]of Object.entries(e))i===`allow`?t.push(r):i===`deny`&&n.push(r);return{allowedTools:t,disallowedTools:n}}var mm=be()((e,t)=>({defaultEditor:`cursor`,useInternalEditor:!1,terminalShell:`default`,availableShells:[],_shellsLoaded:!1,toolPermissions:{...Up},fontSize:$p(),notificationsEnabled:am(),notificationSoundEnabled:om(),hiddenPromptModels:lm(),_initialized:!1,initializeFromProfile:t=>{e({defaultEditor:t.defaultEditor??`cursor`,useInternalEditor:t.useInternalEditor??!1,terminalShell:t.terminalShell??`default`,toolPermissions:t.toolPermissions??{...Up},_initialized:!0})},setDefaultEditor:t=>{e({defaultEditor:t}),fm({defaultEditor:t})},setUseInternalEditor:t=>{e({useInternalEditor:t}),fm({useInternalEditor:t})},setTerminalShell:t=>{e({terminalShell:t}),fm({terminalShell:t})},setFontSize:t=>{e({fontSize:t});try{localStorage.setItem(Wp,t)}catch{}dm(t)},setNotificationsEnabled:t=>{e({notificationsEnabled:t});try{localStorage.setItem(em,t?`1`:`0`)}catch{}},setNotificationSoundEnabled:t=>{e({notificationSoundEnabled:t});try{localStorage.setItem(tm,t?`1`:`0`)}catch{}},setPromptModelVisible:(t,n)=>e(e=>{let r=new Set(e.hiddenPromptModels);n?r.delete(t):r.add(t);let i=[...r];return um(i),{hiddenPromptModels:i}}),resetPromptModelVisibility:()=>{let t=cm().filter(e=>!sm.has(e));um(t),e({hiddenPromptModels:t})},fetchAvailableShells:async()=>{if(t()._shellsLoaded)return;let n=await au.getAvailableShells();n.isOk()&&e({availableShells:n.value.shells,_shellsLoaded:!0})},setToolPermission:(t,n)=>e(e=>{let r={...e.toolPermissions,[t]:n};return fm({toolPermissions:r}),{toolPermissions:r}}),resetToolPermissions:()=>{let t={...Up};e({toolPermissions:t}),fm({toolPermissions:t})}}));dm(mm.getState().fontSize);var hm=/^ResizeObserver loop (completed with undelivered notifications|limit exceeded)/;window.addEventListener(`error`,e=>{e.message&&hm.test(e.message)&&(e.stopImmediatePropagation(),e.preventDefault())},!0);var gm=(0,N.lazy)(()=>i(()=>import(`./App-DUg9Ibif.js`).then(e=>({default:e.App})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),_m=(0,N.lazy)(()=>i(()=>import(`./MobilePage-B9LixzUJ.js`).then(e=>({default:e.MobilePage})),__vite__mapDeps([44,1,2,8,9,10,5,11,12,13,14,15,16,17,18,6,7,19,20,21,22,45,46,47,48,49,50,51,23,52,53,54,55,56,57,28,58,59,60,61,26,27,62,29,30,63]))),vm=(0,N.lazy)(()=>i(()=>import(`./LoginPage-BPM6y1Yj.js`).then(e=>({default:e.LoginPage})),__vite__mapDeps([64,1,12,5,13,10,14,21,11,17,22]))),ym=(0,N.lazy)(()=>i(()=>import(`./AcceptInvitePage-rU3bsShb.js`).then(e=>({default:e.AcceptInvitePage})),__vite__mapDeps([65,1,12,5,13,10,14,22,28]))),bm=(0,N.lazy)(()=>i(()=>import(`./PreviewBrowser-pI5xiPAQ.js`).then(e=>({default:e.PreviewBrowser})),__vite__mapDeps([66,1,2,12,5,13,10,14]))),xm=(0,N.lazy)(()=>i(()=>import(`./SetupWizard-B3KuWJkX.js`).then(e=>({default:e.SetupWizard})),__vite__mapDeps([67,1,12,5,13,10,14,28]))),Sm=!!window.__PREVIEW_MODE__,Cm=window.matchMedia(`(max-width: 767px)`),wm=e=>(Cm.addEventListener(`change`,e),()=>Cm.removeEventListener(`change`,e)),Tm=()=>Cm.matches;function Em(){let e=(0,N.useSyncExternalStore)(wm,Tm);return(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:e?(0,P.jsx)(_m,{}):(0,P.jsx)(gm,{})})}function Dm(){let e=window.location.pathname.match(/^\/invite\/([^/]+)$/);return e?e[1]:null}function Om(){let e=dp(e=>e.isAuthenticated),t=dp(e=>e.isLoading),n=dp(e=>e.initialize),r=mm(e=>e.initializeFromProfile),{setTheme:i}=Ze(),[a]=(0,N.useState)(Dm),[o,s]=(0,N.useState)(()=>localStorage.getItem(`funny:setupCompleted`)===`true`?!0:null);(0,N.useEffect)(()=>{n()},[n]);let c=!t&&e;return(0,N.useEffect)(()=>{if(!c)return;let e=0,t,n=!1,a=()=>{uu.getProfile().then(c=>{if(!n)if(c.isOk()){let e=c.value;fp.getState().setProfile(e);let t=e.setupCompleted??!1;s(t),t?localStorage.setItem(`funny:setupCompleted`,`true`):localStorage.removeItem(`funny:setupCompleted`),r(e),e.theme&&i(e.theme)}else e<3?(e++,t=setTimeout(a,e*1e3)):dp.getState().initialize().then(()=>{n||dp.getState().isAuthenticated&&(o||s(!1))})})};return a(),()=>{n=!0,t!==void 0&&clearTimeout(t)}},[c,r,i]),t?(0,P.jsx)(Ka,{}):a?(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:(0,P.jsx)(ym,{token:a})}):e?o===null?(0,P.jsx)(Ka,{}):o?(0,P.jsx)(L,{children:(0,P.jsx)(Em,{})}):(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(`div`,{className:`bg-background flex min-h-screen items-center justify-center`,children:(0,P.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading…`})}),children:(0,P.jsx)(xm,{onComplete:()=>s(!0)})}):(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:(0,P.jsx)(vm,{})})}var km=document.getElementById(`root`);di.createRoot(km).render((0,P.jsx)(N.StrictMode,{children:(0,P.jsx)(Qe,{attribute:`class`,defaultTheme:`one-dark`,disableTransitionOnChange:!0,themes:[`one-dark`,`dracula`,`github-dark`,`night-owl`,`catppuccin`,`sunrise`,`monochrome`,`monochrome-dark`],value:{"one-dark":`theme-one-dark`,dracula:`theme-dracula`,"github-dark":`theme-github-dark`,"night-owl":`theme-night-owl`,catppuccin:`theme-catppuccin`,sunrise:`theme-sunrise`,monochrome:`theme-monochrome`,"monochrome-dark":`theme-monochrome-dark`},children:(0,P.jsx)(Ce,{endpoint:`http://localhost:4000`,serviceName:`funny-client`,captureConsole:!0,level:`debug`,enabled:!0,includeUrl:!0,consoleOptions:{captureErrors:!0,captureUnhandledRejections:!0,captureStackTrace:!0},children:(0,P.jsx)(Vl,{delayDuration:300,skipDelayDuration:0,children:(0,P.jsx)(He,{features:We,strict:!0,children:Sm?(0,P.jsx)(N.Suspense,{fallback:null,children:(0,P.jsx)(bm,{})}):(0,P.jsx)(Om,{})})})})})}));export{Kc as $,cp as A,Zl as B,Rp as C,fp as D,xp as E,cu as F,Wl as G,ql as H,su as I,el as J,Vl as K,au as L,Xf as M,du as N,lp as O,uu as P,qc as Q,ru as R,Lp as S,Sp as T,Gl as U,Jl as V,Hl as W,Yc as X,Zc as Y,Gc as Z,wp as _,Pn as _t,Qp as a,ro as at,Np as b,Xp as c,Fa as ct,Bp as d,Ra as dt,Wc as et,mm as f,Va as ft,Cp as g,jn as gt,Ep as h,Vt as ht,Zp as i,eo as it,ap as j,dp as k,Hp as l,Pa as lt,Op as m,Kr as mt,Kp as n,Tc as nt,Jp as o,Ha as ot,Tp as p,Ba as pt,Ul as q,qp as r,lo as rt,Yp as s,Ia as st,Vp as t,Oc as tt,pm as u,za as ut,Dp as v,ei as vt,bp as w,zp as x,Pp as y,Ze as yt,Ql as z};
|
|
36
|
+
at `))}function X(e,t){class n extends e{#e;constructor(...e){if(mu()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=hu(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var gu={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};X(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:gu[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var _u=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}};function vu(e){return{success:!1,error:`You are not allowed to access resource: ${e}`}}function yu(e){return{success:!1,error:`unauthorized to access resource "${e}"`}}function bu(e){return e===`OR`?`OR`:`AND`}function xu(e){return Array.isArray(e)}function Su(e){if(xu(e))return{actions:e,connector:`AND`};if(!e||typeof e!=`object`)throw new _u(`Invalid access control request`);let{actions:t,connector:n}=e;return xu(t)?{actions:t,connector:bu(n)}:{actions:[],connector:bu(n)}}function Cu(e,t){return typeof t==`string`&&e.includes(t)}function wu(e,{actions:t,connector:n}){return t.length===0?!1:n===`OR`?t.some(t=>Cu(e,t)):t.every(t=>Cu(e,t))}function Tu(e){return{authorize(t,n=`AND`){let r=!1;for(let[i,a]of Object.entries(t)){let t=e[i];if(!t){if(n===`AND`)return vu(i);continue}let o=wu(t,Su(a));if(o&&(r=!0),o&&n===`OR`)return{success:!0};if(!o&&n===`AND`)return yu(i)}return r?{success:!0}:{success:!1,error:`Not authorized`}},statements:e}}function Eu(e){return{newRole(e){return Tu(e)},statements:e}}var Du=Eu({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`impersonate-admins`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),Ou=Du.newRole({user:[`create`,`list`,`set-role`,`ban`,`impersonate`,`delete`,`set-password`,`set-email`,`get`,`update`],session:[`list`,`revoke`,`delete`]}),ku=Du.newRole({user:[],session:[]}),Au={admin:Ou,user:ku},ju=e=>{if(e.userId&&e.options?.adminUserIds?.includes(e.userId))return!0;if(!e.permissions)return!1;let t=(e.role||e.options?.defaultRole||`user`).split(`,`),n=e.options?.roles||Au;for(let r of t)if(n[r]?.authorize(e.permissions)?.success)return!0;return!1},Mu=e=>{let t={admin:Ou,user:ku,...e?.roles};return{id:`admin-client`,version:fu,$InferServerPlugin:{},getActions:()=>({admin:{checkRolePermission:n=>ju({role:n.role,options:{ac:e?.ac,roles:t},permissions:n.permissions})}}),pathMethods:{"/admin/list-users":`GET`,"/admin/impersonate-user":`POST`,"/admin/stop-impersonating":`POST`},atomListeners:[{matcher:e=>e===`/admin/impersonate-user`||e===`/admin/stop-impersonating`,signal:`$sessionSignal`}],$ERROR_CODES:Y}},Nu=Object.create(null),Pu=e=>({}),Fu=new Proxy(Nu,{get(e,t){return Pu()[t]??Nu[t]},has(e,t){return t in Pu()||t in Nu},set(e,t,n){let r=Pu(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=Pu(!0);return delete n[t],!0},ownKeys(){let e=Pu(!0);return Object.keys(e)}});Fu.NODE_ENV;function Iu(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return Iu(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return Iu(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return Iu(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return Iu(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return Iu(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return Iu(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return Iu(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});var Lu=47;function Ru(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Lu;)t--;return t===e.length?e:e.slice(0,t)}function zu(e){try{return(Ru(new URL(e).pathname)||`/`)!==`/`}catch{throw new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function Bu(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new _u(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof _u?t:new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Vu(e,t=`/api/auth`){if(Bu(e),zu(e))return e;let n=Ru(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Hu(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Uu(e,t,n,r,i){if(e)return Vu(e,t);if(r!==!1){let e=Fu.BETTER_AUTH_URL||Fu.NEXT_PUBLIC_BETTER_AUTH_URL||Fu.PUBLIC_BETTER_AUTH_URL||Fu.NUXT_PUBLIC_BETTER_AUTH_URL||Fu.NUXT_PUBLIC_AUTH_URL||(Fu.BASE_URL===`/`?void 0:Fu.BASE_URL);if(e)return Vu(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Hu(o,`proto`)&&Hu(a,`host`))try{return Vu(`${o}://${a}`,t)}catch{}if(n){let e=Wu(n.url);if(!e)throw new _u(`Could not get origin from request. Please provide a valid base URL.`);return Vu(e,t)}if(typeof window<`u`&&window.location)return Vu(window.location.origin,t)}function Wu(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Gu=[`javascript:`,`data:`,`vbscript:`];function Ku(e){let t;try{t=new URL(e)}catch{return!0}return!Gu.includes(t.protocol)}var qu=pu({YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION:`You are not allowed to create a new organization`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS:`You have reached the maximum number of organizations`,ORGANIZATION_ALREADY_EXISTS:`Organization already exists`,ORGANIZATION_SLUG_ALREADY_TAKEN:`Organization slug already taken`,ORGANIZATION_NOT_FOUND:`Organization not found`,USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION:`User is not a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION:`You are not allowed to update this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION:`You are not allowed to delete this organization`,NO_ACTIVE_ORGANIZATION:`No active organization`,USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION:`User is already a member of this organization`,MEMBER_NOT_FOUND:`Member not found`,ROLE_NOT_FOUND:`Role not found`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM:`You are not allowed to create a new team`,TEAM_ALREADY_EXISTS:`Team already exists`,TEAM_NOT_FOUND:`Team not found`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER:`You cannot leave the organization as the only owner`,YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER:`You cannot leave the organization without an owner`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER:`You are not allowed to delete this member`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION:`You are not allowed to invite users to this organization`,USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION:`User is already invited to this organization`,INVITATION_NOT_FOUND:`Invitation not found`,YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION:`You are not the recipient of the invitation`,EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION:`Email verification required before accepting or rejecting invitation`,EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION:`Email verification required to view or list invitations for the session email`,YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION:`You are not allowed to cancel this invitation`,INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION:`Inviter is no longer a member of the organization`,YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE:`You are not allowed to invite a user with this role`,FAILED_TO_RETRIEVE_INVITATION:`Failed to retrieve invitation`,YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS:`You have reached the maximum number of teams`,UNABLE_TO_REMOVE_LAST_TEAM:`Unable to remove last team`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER:`You are not allowed to update this member`,ORGANIZATION_MEMBERSHIP_LIMIT_REACHED:`Organization membership limit reached`,YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to create teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION:`You are not allowed to delete teams in this organization`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM:`You are not allowed to update this team`,YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM:`You are not allowed to delete this team`,INVITATION_LIMIT_REACHED:`Invitation limit reached`,TEAM_MEMBER_LIMIT_REACHED:`Team member limit reached`,USER_IS_NOT_A_MEMBER_OF_THE_TEAM:`User is not a member of the team`,YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM:`You are not allowed to list the members of this team`,YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM:`You do not have an active team`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER:`You are not allowed to create a new member`,YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER:`You are not allowed to remove a team member`,YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION:`You are not allowed to access this organization as an owner`,YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION:`You are not a member of this organization`,MISSING_AC_INSTANCE:`Dynamic Access Control requires a pre-defined ac instance on the server auth plugin. Read server logs for more information`,YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE:`You must be in an organization to create a role`,YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE:`You are not allowed to create a role`,YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE:`You are not allowed to update a role`,YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE:`You are not allowed to delete a role`,YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE:`You are not allowed to read a role`,YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE:`You are not allowed to list a role`,YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE:`You are not allowed to get a role`,TOO_MANY_ROLES:`This organization has too many roles`,INVALID_RESOURCE:`The provided permission includes an invalid resource`,ROLE_NAME_IS_ALREADY_TAKEN:`That role name is already taken`,CANNOT_DELETE_A_PRE_DEFINED_ROLE:`Cannot delete a pre-defined role`,ROLE_IS_ASSIGNED_TO_MEMBERS:`Cannot delete a role that is assigned to members. Please reassign the members to a different role first`,INVALID_TEAM_ID:`Team id contains a reserved character`}),Ju=[],Yu=0,Xu=4,Zu=globalThis.nanostoresGlobal||={epoch:0},Z=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=Yu+Xu;t<Ju.length;)Ju[t]===e?Ju.splice(t,Xu):t+=Xu;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Zu.epoch++;let i=!Ju.length;for(let i of t)Ju.push(i,n.value,e,r);if(i){for(Yu=0;Yu<Ju.length;Yu+=Xu)Ju[Yu](Ju[Yu+1],Ju[Yu+2],Ju[Yu+3]);Ju.length=0}},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},Qu=2,$u=5,ed=6,td=10,Q=(e,t,n,r)=>(e.events=e.events||{},e.events[n+td]||(e.events[n+td]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+td](),delete e.events[n+td])}),nd=(e,t)=>Q(e,t,Qu,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),rd=1e3,id=(e,t)=>Q(e,n=>{let r=t(n);r&&e.events[ed].push(r)},$u,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[ed]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ed])t();e.events[ed]=[]}},rd)},()=>{e.listen=n,e.off=r}});function ad(e,t,n){let r=new Set(t).add(void 0);return e.listen((e,t,i)=>{r.has(i)&&n(e,t,i)})}function od(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function sd(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!sd(e[n],t[n]))return!1;return!0}if(od(e)&&od(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!sd(e[r],t[r]))return!1;return!0}return!1}function cd(e,t){return nd(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var ld=()=>typeof window>`u`;function ud(e,t){return sd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var dd=(e,t,n,r)=>{let i=Z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});cd(i,ud);let a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){let t=i.get(),n=t.data!=null&&e.data!=null&&sd(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1,s=[];for(let t of e){let e=t.subscribe(async()=>{ld()||(o?await a():id(i,()=>{let e=setTimeout(async()=>{o||(o=!0,await a())},0);return()=>{for(let e of s)e();clearTimeout(e)}}))});s.push(e)}return i},fd=Eu({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),pd=fd.newRole({organization:[`update`],invitation:[`create`,`cancel`],member:[`create`,`update`,`delete`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),md=fd.newRole({organization:[`update`,`delete`],member:[`create`,`update`,`delete`],invitation:[`create`,`cancel`],team:[`create`,`update`,`delete`],ac:[`create`,`read`,`update`,`delete`]}),hd=fd.newRole({organization:[],member:[],invitation:[],team:[],ac:[`read`]}),gd={admin:pd,owner:md,member:hd},_d=(e,t)=>{if(!e.permissions)return!1;let n=e.role.split(`,`),r=e.options.creatorRole||`owner`,i=n.includes(r),a=e.allowCreatorAllPermissions||!1;if(i&&a)return!0;for(let r of n)if(t[r]?.authorize(e.permissions)?.success)return!0;return!1},vd=e=>_d(e,e.options.roles||gd),$=e=>{let t=Z(!1),n=Z(!1),r=Z(!1),i=Z(!1),a={admin:pd,member:hd,owner:md,...e?.roles};return{id:`organization`,version:fu,$InferServerPlugin:{},getActions:(t,n,r)=>({$Infer:{ActiveOrganization:{},Organization:{},Invitation:{},Member:{},Team:{}},organization:{checkRolePermission:t=>vd({role:t.role,options:{ac:e?.ac,roles:a},permissions:t.permissions})}}),getAtoms:e=>{let a=dd(t,`/organization/list`,e,{method:`GET`});return{$listOrg:t,$activeOrgSignal:n,$activeMemberSignal:r,$activeMemberRoleSignal:i,activeOrganization:dd([n],`/organization/get-full-organization`,e,()=>({method:`GET`})),listOrganizations:a,activeMember:dd([n,r],`/organization/get-active-member`,e,{method:`GET`}),activeMemberRole:dd([n,i],`/organization/get-active-member-role`,e,{method:`GET`})}},pathMethods:{"/organization/get-full-organization":`GET`,"/organization/list-user-teams":`GET`},atomListeners:[{matcher(e){return e===`/organization/create`||e===`/organization/delete`||e===`/organization/update`},signal:`$listOrg`},{matcher(e){return e===`/sign-out`||e.startsWith(`/organization`)},signal:`$activeOrgSignal`},{matcher(e){return e.startsWith(`/organization/set-active`)||e===`/organization/create`||e===`/organization/delete`||e===`/organization/remove-member`||e===`/organization/leave`||e===`/organization/accept-invitation`},signal:`$sessionSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberSignal`},{matcher(e){return e.includes(`/organization/update-member-role`)||e.startsWith(`/organization/set-active`)},signal:`$activeMemberRoleSignal`}],$ERROR_CODES:qu}},yd=pu({INVALID_USERNAME_OR_PASSWORD:`Invalid username or password`,EMAIL_NOT_VERIFIED:`Email not verified`,UNEXPECTED_ERROR:`Unexpected error`,USERNAME_IS_ALREADY_TAKEN:`Username is already taken. Please try another.`,USERNAME_TOO_SHORT:`Username is too short`,USERNAME_TOO_LONG:`Username is too long`,INVALID_USERNAME:`Username is invalid`,INVALID_DISPLAY_USERNAME:`Display username is invalid`}),bd=()=>({id:`username`,version:fu,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/sign-in/username`,signal:`$sessionSignal`}],$ERROR_CODES:yd}),xd={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Sd=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Cd={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},wd=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function Td(e){return e instanceof Date&&!isNaN(e.getTime())}function Ed(e){let t=wd.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return Td(f)?f:null}function Dd(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Cd)return Cd[s];if(!Sd.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(xd).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=Ed(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function Od(e,t={strict:!0}){return Dd(e,t)}var kd={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Ku(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},Ad=Symbol.for(`better-auth:broadcast-channel`),jd=()=>Math.floor(Date.now()/1e3),Md=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:jd()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Nd(e=`better-auth.message`){return globalThis[Ad]||(globalThis[Ad]=new Md(e)),globalThis[Ad]}var Pd=Symbol.for(`better-auth:focus-manager`),Fd=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Id(){return globalThis[Pd]||(globalThis[Pd]=new Fd),globalThis[Pd]}var Ld=Symbol.for(`better-auth:online-manager`),Rd=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function zd(){return globalThis[Ld]||(globalThis[Ld]=new Rd),globalThis[Ld]}var Bd=()=>Math.floor(Date.now()/1e3),Vd=5;function Hd(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||zd().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=Bd(),t();return}if(e?.event===`visibilitychange`){if(Bd()-c.lastSessionRequest<Vd)return;c.lastSessionRequest=Bd(),t();return}t()}},d=e=>{Nd().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Nd().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Id().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=zd().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Nd().setup(),c.cleanupFocusSetup=Id().setup(),c.cleanupOnlineSetup=zd().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var Ud=()=>typeof window>`u`;function Wd(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Gd(e){return!e||e.session===null&&e.user===null?null:e}function Kd(e,t){return sd(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function qd(e,t){let n=Z(!1),r,i=e=>s(e),a=Z({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});cd(a,Kd);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=Wd(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=Wd(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=Gd(s),u=a.get(),d=u.data!=null&&l!=null&&sd(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return id(a,()=>{let e;Ud()||(e=setTimeout(()=>{s()},0));let i=Hd({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}function Jd(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Yd(e,t,n=`.`,r){if(!Jd(t))return Yd(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(Array.isArray(a)&&Array.isArray(i[t])?i[t]=[...a,...i[t]]:Jd(a)&&Jd(i[t])?i[t]=Yd(a,i[t],(n?`${n}.`:``)+t.toString(),r):i[t]=a))}return i}function Xd(e){return(...t)=>t.reduce((t,n)=>Yd(t,n,``,e),{})}var Zd=Xd(),Qd=Object.defineProperty,$d=Object.defineProperties,ef=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,nf=Object.prototype.hasOwnProperty,rf=Object.prototype.propertyIsEnumerable,af=(e,t,n)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,of=(e,t)=>{for(var n in t||={})nf.call(t,n)&&af(e,n,t[n]);if(tf)for(var n of tf(t))rf.call(t,n)&&af(e,n,t[n]);return e},sf=(e,t)=>$d(e,ef(t)),cf=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},lf=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},uf=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},df=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function ff(e){if(typeof e==`number`)return new uf({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new uf(e);case`exponential`:return new df(e);default:throw Error(`Invalid retry strategy`)}}var pf=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},mf=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function hf(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return mf.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function gf(e){try{return JSON.parse(e),!0}catch{return!1}}function _f(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function vf(e){try{return JSON.parse(e)}catch{return e}}function yf(e){return typeof e==`function`}function bf(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&yf(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&yf(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function xf(...e){let t={};for(let n of e)if(n)if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}return t}async function Sf(e){let t=new Headers(xf(e?.headers,await pf(e)));if(!t.has(`content-type`)){let n=Cf(e?.body);n&&t.set(`content-type`,n)}return t}function Cf(e){return _f(e)?`application/json`:null}function wf(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function Tf(e,t){let{body:n}=e;return n?!_f(n)||typeof n==`string`?n:wf(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function Ef(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return Af.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function Df(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var Of=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function kf(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new Of(n.issues);return n.value}var Af=[`get`,`post`,`put`,`patch`,`delete`],jf=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await kf(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=sf(of({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=sf(of({},r),{body:i.input?await kf(i.input,n?.body):n?.body,params:i.params?await kf(i.params,n?.params):n?.params,query:i.query?await kf(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),Mf=e=>{async function t(t,n){let r=sf(of(of({},e),n),{headers:xf(e?.headers,n?.headers),plugins:[...e?.plugins||[],jf(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await If(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await If(t,r)}return t},Nf=e=>e===`.`||e===`..`;function Pf(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(Nf(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function Ff(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];Af.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r)if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t));o=o.split(`/`).map(e=>Pf(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var If=async(e,t)=>{let{hooks:n,url:r,options:i}=await lf(e,t),a=bf(i),o=new AbortController,s=i.signal??o.signal,c=Ff(r,i),l=await Sf(i),u=Tf(i,l),d=Ef(r,i),f=sf(of({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=Df(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(sf(of({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=hf(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??vf)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await kf(f.output,r.data));for(let e of n.onSuccess)e&&await e(sf(of({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??vf,_=await m.text(),v=gf(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:sf(of({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(sf(of({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=ff(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await If(e,sf(of({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new cf(m.status,m.statusText,v?y:_);return{data:null,error:sf(of({},y),{status:m.status,statusText:m.statusText})}},Lf=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Rf=(e,t)=>{let n=`credentials`in Request.prototype,r=Uu(e?.baseURL,e?.basePath,void 0,t)??Lf(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Mf({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?Od(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[kd],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=qd(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=Zd(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function zf(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Bf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Vf=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Hf=/['\u2019]/g;function Uf(e){return e.replace(Hf,``).match(Vf)??[]}function Wf(e){return Uf(e).map(e=>e.toLowerCase()).join(`-`)}function Gf(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Kf(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||zf(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Wf).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Gf(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function qf(e,t={}){let n=(0,N.useRef)(e.get()),{keys:r,deps:i=[e,r]}=t,a=(0,N.useCallback)(t=>{let i=e=>{n.current!==e&&(n.current=e,t())};return i(e.value),r?.length?ad(e,r,i):e.listen(i)},i),o=()=>n.current;return(0,N.useSyncExternalStore)(a,o,o)}function Jf(e){return`use${Bf(e)}`}function Yf(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,$store:a,atomListeners:o}=Rf(e),s={};for(let[e,t]of Object.entries(r))s[Jf(e)]=()=>qf(t);return Kf({...n,...s,$fetch:i,$store:a},i,t,r,o)}var Xf=Yf({baseURL:typeof window<`u`&&window.__TAURI_INTERNALS__&&window.location.protocol!==`http:`&&window.location.protocol!==`https:`?`http://localhost:5002`:``,basePath:`/api/auth`,plugins:[bd(),Mu(),$()]}),Zf=`http://localhost:4000`,Qf=[`trace`,`debug`,`info`,`warn`,`error`,`fatal`],$f=`funny:log-level`,ep=`funny:log-ns:`;function tp(e){try{let t=localStorage.getItem(e);return t&&Qf.includes(t)?t:void 0}catch{return}}function np(){return tp($f)??`info`}var rp=null;function ip(){return rp||=s({endpoint:Zf,serviceName:`funny-client`,enabled:!0,includeUrl:!0,level:np()}),rp}function ap(e){let t=ip().child({"log.namespace":e}),n=tp(`${ep}${e}`);return n&&t.setLevel(n),t}typeof window<`u`&&(window.__funnyLog={setLevel(e){try{localStorage.setItem($f,e)}catch{}ip().setLevel(e)},setNamespaceLevel(e,t){try{localStorage.setItem(`${ep}${e}`,t)}catch{}},clear(){try{localStorage.removeItem($f);for(let e=localStorage.length-1;e>=0;e--){let t=localStorage.key(e);t?.startsWith(ep)&&localStorage.removeItem(t)}}catch{}ip().setLevel(np())}});var op=null;function sp(e){op=e}function cp(){return op}var lp=t({useAuthStore:()=>dp}),up=ap(`auth-store`),dp=be((e,t)=>({user:null,isAuthenticated:!1,isLoading:!0,activeOrgId:null,activeOrgName:null,activeOrgSlug:null,initialize:async()=>{e({isLoading:!0});try{let t=await Xf.getSession();if(t.data?.user){let n=t.data.user,r=du(t.data),i=null,a=null;if(r)try{let e=(await Xf.organization.list()).data?.find(e=>e.id===r);e&&(i=e.name,a=e.slug)}catch{}e({isAuthenticated:!0,isLoading:!1,activeOrgId:r,activeOrgName:i,activeOrgSlug:a,user:{id:n.id,username:n.username||n.name||`user`,displayName:n.name||n.username||`User`,role:n.role||`user`}}),sp(a)}else e({isAuthenticated:!1,isLoading:!1,user:null}),sp(null)}catch(t){up.error(`initialization error`,{error:t instanceof Error?t.message:String(t)}),e({isAuthenticated:!1,isLoading:!1})}},login:async(t,n)=>{let r=await Xf.signIn.username({username:t,password:n});if(r.error)throw Error(r.error.message||`Login failed`);let i=await Xf.getSession();for(let e=0;e<10&&!i.data?.user;e++)await new Promise(e=>setTimeout(e,80)),i=await Xf.getSession();let a=i.data?.user;if(!a)throw Error(`Session was not stored in the browser. Use BETTER_AUTH_BASE_URL with the same origin you open in the address bar (e.g. http://localhost:5173 with Vite), add that origin to CORS_ORIGIN, and avoid https:// in BASE_URL when using http:// locally.`);e({isAuthenticated:!0,user:{id:a.id,username:a.username||a.name||`user`,displayName:a.name||a.username||`User`,role:a.role||`user`}})},logout:async()=>{try{await Xf.signOut()}catch{}e({isAuthenticated:!1,user:null,activeOrgId:null,activeOrgName:null,activeOrgSlug:null}),sp(null)},setActiveOrg:(t,n,r)=>{e({activeOrgId:t,activeOrgName:n,activeOrgSlug:r??null}),sp(r??null)}}));ye(async()=>{try{(await Xf.getSession()).data?.user||dp.getState().logout()}catch{}});var fp=be(e=>({profile:null,setProfile:t=>e({profile:t})})),pp=1024,mp=1024*1024,hp={"gpt-5.5":{id:`gpt-5.5`,label:`GPT-5.5`,contextWindow:4e5,i18nKey:`gpt55`},"gpt-5.4":{id:`gpt-5.4`,label:`GPT-5.4`,contextWindow:4e5,i18nKey:`gpt54`},"gpt-5.4-mini":{id:`gpt-5.4-mini`,label:`GPT-5.4 Mini`,contextWindow:4e5,i18nKey:`gpt54mini`},"gpt-5.3-codex":{id:`gpt-5.3-codex`,label:`GPT-5.3 Codex`,contextWindow:4e5,i18nKey:`gpt53codex`},"gpt-5.2":{id:`gpt-5.2`,label:`GPT-5.2`,contextWindow:4e5,i18nKey:`gpt52`}},gp={"gemini-3.1-pro-preview":{id:`gemini-3.1-pro-preview`,label:`Gemini 3.1 Pro`,contextWindow:1e6,i18nKey:`gemini31pro`},"gemini-3-flash-preview":{id:`gemini-3-flash-preview`,label:`Gemini 3 Flash`,contextWindow:1e6,i18nKey:`gemini3flash`},"gemini-3.1-flash-lite-preview":{id:`gemini-3.1-flash-lite-preview`,label:`Gemini 3.1 Flash Lite`,contextWindow:1e6,i18nKey:`gemini31flashLite`},"gemini-2.5-pro":{id:`gemini-2.5-pro`,label:`Gemini 2.5 Pro`,contextWindow:1048576,i18nKey:`gemini25pro`},"gemini-2.5-flash":{id:`gemini-2.5-flash`,label:`Gemini 2.5 Flash`,contextWindow:1048576,i18nKey:`gemini25flash`},"gemini-2.0-flash":{id:`gemini-2.0-flash`,label:`Gemini 2.0 Flash`,contextWindow:1048576,i18nKey:`gemini20flash`}},_p={default:{id:`default`,label:`Pi (configured default)`,contextWindow:2e5,i18nKey:`piDefault`}},vp={default:{id:`default`,label:`Cursor (configured default)`,contextWindow:2e5,i18nKey:`cursorDefault`}},yp={default:{id:`default`,label:`opencode (configured default)`,contextWindow:2e5,i18nKey:`opencodeDefault`}},bp={codex:{id:`codex`,label:`Codex`,kind:`acp`,spawn:{command:`codex-acp`,args:[],binEnvVars:[`CODEX_ACP_BINARY_PATH`,`ACP_CODEX_BIN`,`CODEX_BIN`],npxSpec:{useEnvVar:`CODEX_ACP_USE_NPX`,pkg:[`-y`,`@zed-industries/codex-acp`]}},models:{kind:`static`,entries:hp,defaultModel:`gpt-5.5`},setModel:{method:`unstable_setSessionModel`},modelVia:`acp-method`,modeVia:`acp-setSessionMode`,modeMap:{plan:`read-only`,ask:`auto`,confirmEdit:`auto`,auto:`auto`,autoEdit:`full-access`},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`apply_patch`,`list_directory`,`glob`,`grep`,`run_shell_command`,`web_fetch`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:20*mp,hardMaxBytes:25*mp},auth:{mode:`provider-key`,providerKeyId:`openai`},quirks:{bufferPreambleAsThink:!0,planRender:`text`,permissionModel:`gated`,splitGluedAgentMessages:!0}},gemini:{id:`gemini`,label:`Gemini`,kind:`acp`,spawn:{command:`gemini`,args:[`--acp`],binEnvVars:[`GEMINI_BINARY_PATH`,`ACP_GEMINI_BIN`]},models:{kind:`static`,entries:gp,defaultModel:`gemini-3.1-pro-preview`},modelVia:`cli-arg`,modeVia:`cli-flag`,modeMap:{plan:null,ask:null,confirmEdit:null,auto:null,autoEdit:null},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`replace`,`list_directory`,`glob`,`grep_search`,`run_shell_command`,`web_fetch`,`google_web_search`,`codebase_investigator`,`save_memory`,`ask_user`,`activate_skill`,`cli_help`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:18*mp,hardMaxBytes:20*mp},auth:{mode:`provider-key`,providerKeyId:`gemini`},prelaunch:`gemini-trust-folder`,quirks:{bufferPreambleAsThink:!0,planRender:`text`,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`}},cursor:{id:`cursor`,label:`Cursor`,kind:`acp`,spawn:{command:`cursor-agent`,args:[`acp`],binEnvVars:[`CURSOR_BINARY_PATH`,`ACP_CURSOR_BIN`],npxSpec:{useEnvVar:`CURSOR_ACP_USE_NPX`,pkg:[`-y`,`cursor-agent`,`acp`]}},models:{kind:`dynamic`,sentinel:vp.default,defaultModel:`default`},setModel:{method:`unstable_setSessionModel`},modelVia:`acp-method`,modeVia:`none`,modeMap:{plan:null,ask:null,confirmEdit:null,auto:null,autoEdit:null},forkCapabilityPaths:[`sessions.fork`],builtinTools:[`read_file`,`write_file`,`edit_file`,`list_dir`,`glob_file_search`,`grep_search`,`run_terminal_cmd`,`web_search`,`fetch_url`,`todo_write`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:10*mp,hardMaxBytes:15*mp},auth:{mode:`provider-key`,providerKeyId:`cursor`},quirks:{planRender:`todoCard`,deferUnrenderableToolInput:!0,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`,filterMcpByCapability:!0}},opencode:{id:`opencode`,label:`opencode`,kind:`acp`,spawn:{command:`opencode`,args:[`acp`],binEnvVars:[`OPENCODE_BIN`,`ACP_OPENCODE_BIN`],npxSpec:{useEnvVar:`OPENCODE_ACP_USE_NPX`,pkg:[`-y`,`opencode-ai`,`acp`]}},models:{kind:`dynamic`,sentinel:yp.default,defaultModel:`default`},setModel:{method:`session/set_model`},modelVia:`acp-method`,modeVia:`acp-setSessionMode`,modeMap:{plan:`plan`,ask:`build`,confirmEdit:`build`,auto:`build`,autoEdit:`build`},forkCapabilityPaths:[`sessionCapabilities.fork`],builtinTools:[`read`,`write`,`edit`,`patch`,`bash`,`glob`,`grep`,`list`,`webfetch`,`todowrite`,`todoread`,`task`],attachmentLimits:{inlineMaxBytes:100*pp,uploadMaxBytes:10*mp,hardMaxBytes:15*mp},auth:{mode:`runner-preauth`},quirks:{planRender:`todoCard`,deferUnrenderableToolInput:!0,synthToolUseFromOrphanUpdate:!0,permissionModel:`gated`,filterMcpByCapability:!0}}},xp=Object.keys(bp),Sp=[`pi`,...xp.filter(e=>bp[e].models.kind===`dynamic`)],Cp=`claude`,wp=`local`,Tp=`queue`,Ep=`autoEdit`,Dp={claude:{haiku:{id:`claude-haiku-4-5-20251001`,label:`Haiku 4.5`,contextWindow:2e5,i18nKey:`haiku`},sonnet:{id:`claude-sonnet-4-5-20250929`,label:`Sonnet 4.5`,contextWindow:2e5,i18nKey:`sonnet`},"sonnet-4.6":{id:`claude-sonnet-4-6[1m]`,label:`Sonnet 4.6`,contextWindow:1e6,i18nKey:`sonnet46`},opus:{id:`claude-opus-4-6[1m]`,label:`Opus 4.6`,contextWindow:1e6,i18nKey:`opus`},"opus-4.7":{id:`claude-opus-4-7[1m]`,label:`Opus 4.7`,contextWindow:1e6,i18nKey:`opus47`},"opus-4.8":{id:`claude-opus-4-8[1m]`,label:`Opus 4.8`,contextWindow:1e6,i18nKey:`opus48`},"fable-5":{id:`claude-fable-5[1m]`,label:`Fable 5`,contextWindow:1e6,i18nKey:`fable5`}},codex:hp,gemini:gp,pi:_p,cursor:vp,opencode:yp,deepagent:{"minimax-m2.7":{id:`openai:MiniMax-M2.7`,label:`MiniMax M2.7`,contextWindow:204800,i18nKey:`minimaxM27`},"minimax-m2.7-highspeed":{id:`openai:MiniMax-M2.7-highspeed`,label:`MiniMax M2.7 Highspeed`,contextWindow:204800,i18nKey:`minimaxM27Highspeed`},"deepagent-gpt-4o":{id:`gpt-4o`,label:`GPT-4o`,contextWindow:128e3,i18nKey:`deepagentGpt4o`},"deepagent-sonnet":{id:`claude-sonnet-4-5-20250929`,label:`Sonnet 4.5`,contextWindow:2e5,i18nKey:`deepagentSonnet`},"deepagent-gemini-2.5-flash":{id:`google-genai:gemini-2.5-flash`,label:`Gemini 2.5 Flash`,contextWindow:1048576,i18nKey:`deepagentGemini25flash`},"deepagent-gemini-2.5-pro":{id:`google-genai:gemini-2.5-pro`,label:`Gemini 2.5 Pro`,contextWindow:1048576,i18nKey:`deepagentGemini25pro`},"deepagent-gemini-3-flash":{id:`google-genai:gemini-3-flash-preview`,label:`Gemini 3 Flash`,contextWindow:1e6,i18nKey:`deepagentGemini3flash`},"deepagent-gemini-3-pro":{id:`google-genai:gemini-3-pro-preview`,label:`Gemini 3 Pro`,contextWindow:1e6,i18nKey:`deepagentGemini3pro`},"deepagent-grok-3":{id:`openai:grok-3`,label:`Grok 3`,contextWindow:131072,i18nKey:`deepagentGrok3`},"deepagent-grok-3-mini":{id:`openai:grok-3-mini`,label:`Grok 3 Mini`,contextWindow:131072,i18nKey:`deepagentGrok3mini`},"deepagent-glm-5.1":{id:`openai:glm-5.1`,label:`GLM-5.1`,contextWindow:128e3,i18nKey:`deepagentGlm51`},"deepagent-glm-5-turbo":{id:`openai:glm-5-turbo`,label:`GLM-5 Turbo`,contextWindow:128e3,i18nKey:`deepagentGlm5turbo`},"deepagent-glm-5v-turbo":{id:`openai:glm-5v-turbo`,label:`GLM-5V Turbo`,contextWindow:128e3,i18nKey:`deepagentGlm5vturbo`}}},Op=`opus-4.8`,kp={claude:Op,deepagent:`minimax-m2.7`,pi:`default`,...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.models.defaultModel]))},Ap=1024,jp=1024*1024,Mp={claude:{inlineMaxBytes:100*Ap,uploadMaxBytes:25*jp,hardMaxBytes:30*jp},deepagent:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},pi:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},"llm-api":{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},external:{inlineMaxBytes:100*Ap,uploadMaxBytes:10*jp,hardMaxBytes:15*jp},...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.attachmentLimits]))},Np={claude:`Claude`,deepagent:`Deep Agent`,pi:`Pi`,...Object.fromEntries(Object.values(bp).map(e=>[e.id,e.label]))};[...Object.keys(bp)];var Pp=[{id:`github`,label:`GitHub Personal Access Token`,helpUrl:`https://github.com/settings/tokens`,description:`Used for push, PR, and private repo operations.`,envVar:`GH_TOKEN`},{id:`gemini`,label:`Google Gemini API Key`,helpUrl:`https://aistudio.google.com/apikey`,description:`Required for Gemini models (Flash, Pro).`,envVar:`GEMINI_API_KEY`,requiredByProviders:[`gemini`,`deepagent`]},{id:`openai`,label:`OpenAI API Key`,helpUrl:`https://platform.openai.com/api-keys`,description:`Required for Codex models and Deep Agent GPT-4o.`,envVar:`OPENAI_API_KEY`,requiredByProviders:[`codex`,`deepagent`]},{id:`minimax`,label:`MiniMax API Key`,helpUrl:`https://platform.minimax.io`,description:`Required by Deep Agent when selecting MiniMax M2.7 models.`,envVar:`MINIMAX_API_KEY`,requiredByProviders:[`deepagent`]},{id:`zhipuai`,label:`zAI API Key`,helpUrl:`https://z.ai/manage-apikey/apikey-list`,description:`Required by Deep Agent when selecting GLM models.`,envVar:`ZHIPUAI_API_KEY`,requiredByProviders:[`deepagent`]},{id:`xai`,label:`xAI API Key`,helpUrl:`https://console.x.ai/`,description:`Required by Deep Agent when selecting Grok models.`,envVar:`XAI_API_KEY`,requiredByProviders:[`deepagent`]},{id:`cursor`,label:`Cursor API Key`,helpUrl:`https://cursor.com/dashboard`,description:"Used by the Cursor CLI ACP adapter. Alternatively run `cursor-agent login` once on the runner.",envVar:`CURSOR_API_KEY`,requiredByProviders:[`cursor`]},{id:`assemblyai`,label:`AssemblyAI API Key`,helpUrl:`https://www.assemblyai.com/dashboard/signup`,description:`Enables voice dictation in the prompt input.`}];function Fp(e){return e in Dp}function Ip(e,t){if(Fp(e))return Dp[e][t]}function Lp(e){if(e===`llm-api`)return Op;if(Fp(e))return kp[e];throw Error(`Unknown provider: ${e}`)}function Rp(e,t){return Ip(e,t)?.contextWindow??2e5}function zp(e){return Mp[e]??Mp.claude}var Bp={cursor:`Cursor`,vscode:`VS Code`,windsurf:`Windsurf`,zed:`Zed`,sublime:`Sublime Text`,vim:`Vim`},Vp=[`Read`,`Edit`,`Write`,`Bash`,`Glob`,`Grep`,`WebSearch`,`WebFetch`,`Task`,`TodoWrite`,`NotebookEdit`],Hp={Read:`tools.readFile`,Edit:`tools.editFile`,Write:`tools.writeFile`,Bash:`tools.runCommand`,Glob:`tools.findFiles`,Grep:`tools.searchCode`,WebSearch:`tools.webSearch`,WebFetch:`tools.fetchUrl`,Task:`tools.subagent`,TodoWrite:`tools.todos`,NotebookEdit:`tools.editNotebook`},Up=Object.fromEntries(Vp.map(e=>[e,`allow`])),Wp=`funny_font_size`,Gp={small:`13px`,default:`14px`,large:`16px`},Kp={small:11,default:11,large:13},qp={small:20,default:20,large:24},Jp={small:12,default:13,large:15},Yp={small:13,default:14,large:16},Xp={small:21.1,default:22.75,large:26},Zp=Jp,Qp={small:18,default:20,large:23};function $p(){try{let e=localStorage.getItem(Wp);if(e&&e in Gp)return e}catch{}return`default`}var em=`funny_notifications_enabled`,tm=`funny_notifications_sound`,nm=`funny_hidden_prompt_models`,rm=`funny_hidden_prompt_models_version`,im=`1`;function am(){try{return localStorage.getItem(em)===`1`}catch{return!1}}function om(){try{return localStorage.getItem(tm)===`1`}catch{return!1}}var sm=new Set([`claude:haiku`,`claude:sonnet`,`claude:opus-4.8`,`pi:default`,`cursor:default`]);function cm(){let e=[];for(let[t,n]of Object.entries(Dp))for(let r of Object.keys(n))e.push(`${t}:${r}`);return e}function lm(){try{let e=localStorage.getItem(nm),t=localStorage.getItem(rm);if(e&&t===im){let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}let n=cm().filter(e=>!sm.has(e));um(n);try{localStorage.setItem(rm,im)}catch{}return n}catch{return[]}}function um(e){try{localStorage.setItem(nm,JSON.stringify(e))}catch{}}function dm(e){document.documentElement.style.fontSize=Gp[e];let t=Zp[e],n=Qp[e],r=Kp[e];document.documentElement.style.setProperty(`--diff-font-size`,`${t}px`),document.documentElement.style.setProperty(`--diff-row-height`,`${n}px`),document.documentElement.style.setProperty(`--code-font-size`,`${r}px`)}function fm(e){nu.updateProfile(e).match(()=>{},()=>{})}function pm(e){let t=[],n=[];for(let[r,i]of Object.entries(e))i===`allow`?t.push(r):i===`deny`&&n.push(r);return{allowedTools:t,disallowedTools:n}}var mm=be()((e,t)=>({defaultEditor:`cursor`,useInternalEditor:!1,terminalShell:`default`,availableShells:[],_shellsLoaded:!1,toolPermissions:{...Up},fontSize:$p(),notificationsEnabled:am(),notificationSoundEnabled:om(),hiddenPromptModels:lm(),_initialized:!1,initializeFromProfile:t=>{e({defaultEditor:t.defaultEditor??`cursor`,useInternalEditor:t.useInternalEditor??!1,terminalShell:t.terminalShell??`default`,toolPermissions:t.toolPermissions??{...Up},_initialized:!0})},setDefaultEditor:t=>{e({defaultEditor:t}),fm({defaultEditor:t})},setUseInternalEditor:t=>{e({useInternalEditor:t}),fm({useInternalEditor:t})},setTerminalShell:t=>{e({terminalShell:t}),fm({terminalShell:t})},setFontSize:t=>{e({fontSize:t});try{localStorage.setItem(Wp,t)}catch{}dm(t)},setNotificationsEnabled:t=>{e({notificationsEnabled:t});try{localStorage.setItem(em,t?`1`:`0`)}catch{}},setNotificationSoundEnabled:t=>{e({notificationSoundEnabled:t});try{localStorage.setItem(tm,t?`1`:`0`)}catch{}},setPromptModelVisible:(t,n)=>e(e=>{let r=new Set(e.hiddenPromptModels);n?r.delete(t):r.add(t);let i=[...r];return um(i),{hiddenPromptModels:i}}),resetPromptModelVisibility:()=>{let t=cm().filter(e=>!sm.has(e));um(t),e({hiddenPromptModels:t})},fetchAvailableShells:async()=>{if(t()._shellsLoaded)return;let n=await au.getAvailableShells();n.isOk()&&e({availableShells:n.value.shells,_shellsLoaded:!0})},setToolPermission:(t,n)=>e(e=>{let r={...e.toolPermissions,[t]:n};return fm({toolPermissions:r}),{toolPermissions:r}}),resetToolPermissions:()=>{let t={...Up};e({toolPermissions:t}),fm({toolPermissions:t})}}));dm(mm.getState().fontSize);var hm=/^ResizeObserver loop (completed with undelivered notifications|limit exceeded)/;window.addEventListener(`error`,e=>{e.message&&hm.test(e.message)&&(e.stopImmediatePropagation(),e.preventDefault())},!0);var gm=(0,N.lazy)(()=>i(()=>import(`./App-BkudlgY9.js`).then(e=>({default:e.App})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),_m=(0,N.lazy)(()=>i(()=>import(`./MobilePage-B_-4EwLh.js`).then(e=>({default:e.MobilePage})),__vite__mapDeps([44,1,2,8,9,10,5,11,12,13,14,15,16,17,18,6,7,19,20,21,22,45,46,47,48,49,50,51,23,52,53,54,55,56,57,28,58,59,60,61,26,27,62,29,30,63]))),vm=(0,N.lazy)(()=>i(()=>import(`./LoginPage-DATO3dWs.js`).then(e=>({default:e.LoginPage})),__vite__mapDeps([64,1,12,5,13,10,14,21,11,17,22]))),ym=(0,N.lazy)(()=>i(()=>import(`./AcceptInvitePage-D13hs9Zr.js`).then(e=>({default:e.AcceptInvitePage})),__vite__mapDeps([65,1,12,5,13,10,14,22,28]))),bm=(0,N.lazy)(()=>i(()=>import(`./PreviewBrowser-Dm_Aqtps.js`).then(e=>({default:e.PreviewBrowser})),__vite__mapDeps([66,1,2,12,5,13,10,14]))),xm=(0,N.lazy)(()=>i(()=>import(`./SetupWizard-8eO2SYvf.js`).then(e=>({default:e.SetupWizard})),__vite__mapDeps([67,1,12,5,13,10,14,28]))),Sm=!!window.__PREVIEW_MODE__,Cm=window.matchMedia(`(max-width: 767px)`),wm=e=>(Cm.addEventListener(`change`,e),()=>Cm.removeEventListener(`change`,e)),Tm=()=>Cm.matches;function Em(){let e=(0,N.useSyncExternalStore)(wm,Tm);return(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:e?(0,P.jsx)(_m,{}):(0,P.jsx)(gm,{})})}function Dm(){let e=window.location.pathname.match(/^\/invite\/([^/]+)$/);return e?e[1]:null}function Om(){let e=dp(e=>e.isAuthenticated),t=dp(e=>e.isLoading),n=dp(e=>e.initialize),r=mm(e=>e.initializeFromProfile),{setTheme:i}=Ze(),[a]=(0,N.useState)(Dm),[o,s]=(0,N.useState)(()=>localStorage.getItem(`funny:setupCompleted`)===`true`?!0:null);(0,N.useEffect)(()=>{n()},[n]);let c=!t&&e;return(0,N.useEffect)(()=>{if(!c)return;let e=0,t,n=!1,a=()=>{uu.getProfile().then(c=>{if(!n)if(c.isOk()){let e=c.value;fp.getState().setProfile(e);let t=e.setupCompleted??!1;s(t),t?localStorage.setItem(`funny:setupCompleted`,`true`):localStorage.removeItem(`funny:setupCompleted`),r(e),e.theme&&i(e.theme)}else e<3?(e++,t=setTimeout(a,e*1e3)):dp.getState().initialize().then(()=>{n||dp.getState().isAuthenticated&&(o||s(!1))})})};return a(),()=>{n=!0,t!==void 0&&clearTimeout(t)}},[c,r,i]),t?(0,P.jsx)(Ka,{}):a?(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:(0,P.jsx)(ym,{token:a})}):e?o===null?(0,P.jsx)(Ka,{}):o?(0,P.jsx)(L,{children:(0,P.jsx)(Em,{})}):(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(`div`,{className:`bg-background flex min-h-screen items-center justify-center`,children:(0,P.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading…`})}),children:(0,P.jsx)(xm,{onComplete:()=>s(!0)})}):(0,P.jsx)(N.Suspense,{fallback:(0,P.jsx)(Ka,{}),children:(0,P.jsx)(vm,{})})}var km=document.getElementById(`root`);di.createRoot(km).render((0,P.jsx)(N.StrictMode,{children:(0,P.jsx)(Qe,{attribute:`class`,defaultTheme:`one-dark`,disableTransitionOnChange:!0,themes:[`one-dark`,`dracula`,`github-dark`,`night-owl`,`catppuccin`,`sunrise`,`monochrome`,`monochrome-dark`],value:{"one-dark":`theme-one-dark`,dracula:`theme-dracula`,"github-dark":`theme-github-dark`,"night-owl":`theme-night-owl`,catppuccin:`theme-catppuccin`,sunrise:`theme-sunrise`,monochrome:`theme-monochrome`,"monochrome-dark":`theme-monochrome-dark`},children:(0,P.jsx)(Ce,{endpoint:`http://localhost:4000`,serviceName:`funny-client`,captureConsole:!0,level:`debug`,enabled:!0,includeUrl:!0,consoleOptions:{captureErrors:!0,captureUnhandledRejections:!0,captureStackTrace:!0},children:(0,P.jsx)(Vl,{delayDuration:300,skipDelayDuration:0,children:(0,P.jsx)(He,{features:We,strict:!0,children:Sm?(0,P.jsx)(N.Suspense,{fallback:null,children:(0,P.jsx)(bm,{})}):(0,P.jsx)(Om,{})})})})})}));export{Kc as $,cp as A,Zl as B,Rp as C,fp as D,xp as E,cu as F,Wl as G,ql as H,su as I,el as J,Vl as K,au as L,Xf as M,du as N,lp as O,uu as P,qc as Q,ru as R,Lp as S,Sp as T,Gl as U,Jl as V,Hl as W,Yc as X,Zc as Y,Gc as Z,wp as _,Pn as _t,Qp as a,ro as at,Np as b,Xp as c,Fa as ct,Bp as d,Ra as dt,Wc as et,mm as f,Va as ft,Cp as g,jn as gt,Ep as h,Vt as ht,Zp as i,eo as it,ap as j,dp as k,Hp as l,Pa as lt,Op as m,Kr as mt,Kp as n,Tc as nt,Jp as o,Ha as ot,Tp as p,Ba as pt,Ul as q,qp as r,lo as rt,Yp as s,Ia as st,Vp as t,Oc as tt,pm as u,za as ut,Dp as v,ei as vt,bp as w,zp as x,Pp as y,Ze as yt,Ql as z};
|