headroom-cms 0.1.4 → 0.1.6

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.
Files changed (129) hide show
  1. package/admin/assets/AdminsPage-BqfhR4Zc.js +1 -0
  2. package/admin/assets/AllContentPage-C11eeRMt.js +1 -0
  3. package/admin/assets/ApiKeysPage-DJjOSLoR.js +1 -0
  4. package/admin/assets/AuditPage-DJNk7IaW.js +1 -0
  5. package/admin/assets/{BlockEditor-uSyk_TPt.js → BlockEditor-DDsml97y.js} +54 -54
  6. package/admin/assets/BlockTypeEditPage-Cg7BifaZ.js +1 -0
  7. package/admin/assets/BlockTypesPage-BDFj8TSL.js +1 -0
  8. package/admin/assets/BulkActionBar-CastJGEP.js +1 -0
  9. package/admin/assets/CollectionEditPage-DGW4iMfo.js +1 -0
  10. package/admin/assets/CollectionsPage-C8XNxRda.js +1 -0
  11. package/admin/assets/ContentCreatePage-CX4aOzTR.js +1 -0
  12. package/admin/assets/ContentEditPage-Dj3RK2BF.js +2 -0
  13. package/admin/assets/ContentListPage-CoDanHrR.js +1 -0
  14. package/admin/assets/{CustomBlockPreview-ers8OdZ0.js → CustomBlockPreview-DfDOcbmR.js} +1 -1
  15. package/admin/assets/FieldBuilder-8VVLG_j0.js +3 -0
  16. package/admin/assets/FilterBar-JCp03kkK.js +1 -0
  17. package/admin/assets/{LoginPage-uxiw8K1J.js → LoginPage-gPNC9XRN.js} +1 -1
  18. package/admin/assets/MediaField-Du7_gRse.js +1 -0
  19. package/admin/assets/MediaPage-D9763lEk.js +1 -0
  20. package/admin/assets/RelationshipPicker-D7dFI43Q.js +1 -0
  21. package/admin/assets/SiteSettingsPage-Tfiex2yn.js +1 -0
  22. package/admin/assets/SiteUsersPage-CSV8syR3.js +1 -0
  23. package/admin/assets/SitesPage-BFIZ3Y5K.js +1 -0
  24. package/admin/assets/SubmissionDetailPage-8vtUQsLd.js +1 -0
  25. package/admin/assets/SubmissionEditPage-PgowJuvq.js +1 -0
  26. package/admin/assets/SubmissionListPage-HFDQxPhn.js +1 -0
  27. package/admin/assets/TagInput-CDkKZboX.js +1 -0
  28. package/admin/assets/TagsPage-BW15-W4H.js +1 -0
  29. package/admin/assets/UsersPage-C-zlDeTy.js +1 -0
  30. package/admin/assets/WebhookEditPage-cPPALIbH.js +1 -0
  31. package/admin/assets/WebhooksPage-vkPC4m9a.js +1 -0
  32. package/admin/assets/{card-C7fgQS_U.js → card-10FqkZPA.js} +1 -1
  33. package/admin/assets/checkbox-fC1QPb_4.js +1 -0
  34. package/admin/assets/collapsible-B414SspL.js +1 -0
  35. package/admin/assets/command-BeacdV75.js +1 -0
  36. package/admin/assets/{core.esm-DRuhixPo.js → core.esm-B_kcYf6n.js} +2 -2
  37. package/admin/assets/index-Do_SK4Zl.css +1 -0
  38. package/admin/assets/index-wYNPRVrc.js +18 -0
  39. package/admin/assets/media-url-DIg_vSyf.js +1 -0
  40. package/admin/assets/popover-BJDj8C6y.js +1 -0
  41. package/admin/assets/{radix-lA_IxTIV.js → radix-C1kb_NqW.js} +2 -2
  42. package/admin/assets/react-vendor-C2CvUxFh.js +4 -0
  43. package/admin/assets/select-BV3jemT6.js +1 -0
  44. package/admin/assets/serializeToText-BJy0Ms5I.js +2 -0
  45. package/admin/assets/sortable.esm-QyXA6fio.js +1 -0
  46. package/admin/assets/{table-BjSue8Ev.js → table-WkEcC9MH.js} +1 -1
  47. package/admin/assets/{tanstack-oFmRhGwV.js → tanstack-Bs3zYPPV.js} +1 -1
  48. package/admin/assets/textarea-CHQ9tT69.js +1 -0
  49. package/admin/assets/useAdminResolver-CpZj93vH.js +1 -0
  50. package/admin/assets/useContent-D8yDRTTy.js +1 -0
  51. package/admin/assets/useContentSearch-B-_p0_QX.js +1 -0
  52. package/admin/assets/{useDebouncedValue-DHUCnm9B.js → useDebouncedValue-C-cQUcLG.js} +1 -1
  53. package/admin/assets/useFilterParams-DYdEuWPE.js +1 -0
  54. package/admin/assets/useMedia-m6zKB__r.js +1 -0
  55. package/admin/assets/usePageTitle-Bwf-MpTD.js +1 -0
  56. package/admin/assets/useSiteUsers-QbiItSH1.js +1 -0
  57. package/admin/assets/{useTags-BuXf7_7H.js → useTags-CLPWVUB3.js} +1 -1
  58. package/admin/assets/{useWebhooks-Cx9tbBME.js → useWebhooks-no0l3-mF.js} +1 -1
  59. package/admin/favicon-16x16.png +0 -0
  60. package/admin/favicon-32x32.png +0 -0
  61. package/admin/index.html +8 -7
  62. package/admin/sw.js +1 -1
  63. package/dist/api.d.ts +1 -0
  64. package/dist/api.d.ts.map +1 -1
  65. package/dist/api.js +8 -0
  66. package/dist/api.js.map +1 -1
  67. package/dist/cdn.js +1 -1
  68. package/dist/cdn.js.map +1 -1
  69. package/dist/index.d.ts +3 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +13 -2
  72. package/dist/index.js.map +1 -1
  73. package/dist/scheduler.d.ts +25 -0
  74. package/dist/scheduler.d.ts.map +1 -0
  75. package/dist/scheduler.js +64 -0
  76. package/dist/scheduler.js.map +1 -0
  77. package/dist/storage.d.ts +1 -0
  78. package/dist/storage.d.ts.map +1 -1
  79. package/dist/storage.js +16 -0
  80. package/dist/storage.js.map +1 -1
  81. package/lambda/api/bootstrap +0 -0
  82. package/lambda/image-lambda/index.mjs +1 -1
  83. package/lambda/webhook-worker/bootstrap +0 -0
  84. package/package.json +1 -1
  85. package/src/api.ts +9 -0
  86. package/src/cdn.ts +1 -1
  87. package/src/index.ts +17 -2
  88. package/src/scheduler.ts +83 -0
  89. package/src/sst-env.d.ts +4 -0
  90. package/src/storage.ts +17 -0
  91. package/admin/assets/AdminsPage-Cvqw6UOu.js +0 -1
  92. package/admin/assets/AllContentPage-Cnkt8Fgm.js +0 -1
  93. package/admin/assets/ApiKeysPage-FLex3Chc.js +0 -1
  94. package/admin/assets/AuditPage-ClgwR_8y.js +0 -1
  95. package/admin/assets/BlockTypeEditPage-Dr_yNLDI.js +0 -1
  96. package/admin/assets/BlockTypesPage-CwsGPuAZ.js +0 -1
  97. package/admin/assets/BulkActionBar-C-88Wnqw.js +0 -1
  98. package/admin/assets/CollectionEditPage-Cimkb84B.js +0 -1
  99. package/admin/assets/CollectionsPage-CxnSFPCH.js +0 -1
  100. package/admin/assets/ContentCreatePage-DZCyOcte.js +0 -1
  101. package/admin/assets/ContentEditPage-RtHbU_l4.js +0 -3
  102. package/admin/assets/ContentListPage-qFcZVzg9.js +0 -1
  103. package/admin/assets/FieldBuilder-Ds-agLm7.js +0 -3
  104. package/admin/assets/MediaPage-CeepVDHQ.js +0 -1
  105. package/admin/assets/SiteSettingsPage-xkngL15i.js +0 -1
  106. package/admin/assets/SitesPage-BD9tou9-.js +0 -1
  107. package/admin/assets/TagsPage-BxSwTLpQ.js +0 -1
  108. package/admin/assets/UsersPage-BayuQyLh.js +0 -1
  109. package/admin/assets/WebhookEditPage-BrXm8Dht.js +0 -1
  110. package/admin/assets/WebhooksPage-BUE6XuIP.js +0 -1
  111. package/admin/assets/badge-B8OxObuF.js +0 -1
  112. package/admin/assets/check-CxKAR64t.js +0 -1
  113. package/admin/assets/checkbox-BV2kjQBe.js +0 -1
  114. package/admin/assets/command-qGFnWxcS.js +0 -1
  115. package/admin/assets/copy-CgYzmj06.js +0 -1
  116. package/admin/assets/index-DX9xeoQx.js +0 -18
  117. package/admin/assets/index-PpbsYFRh.css +0 -1
  118. package/admin/assets/plus-HdRn2U0S.js +0 -1
  119. package/admin/assets/popover-Cou924mw.js +0 -1
  120. package/admin/assets/react-vendor-B0Dih9Pj.js +0 -4
  121. package/admin/assets/search-C-3Q9nn7.js +0 -1
  122. package/admin/assets/select-CHW5R8qv.js +0 -1
  123. package/admin/assets/sortable.esm-CBJBhe4k.js +0 -1
  124. package/admin/assets/trash-2-CWWRVuRB.js +0 -1
  125. package/admin/assets/use-mobile-C1r2eP64.js +0 -1
  126. package/admin/assets/useAdminResolver-D6B6RXnk.js +0 -1
  127. package/admin/assets/useContent-f19XHVlJ.js +0 -1
  128. package/admin/assets/useMedia-DkvP1QLG.js +0 -1
  129. package/admin/vite.svg +0 -1
@@ -0,0 +1,4 @@
1
+ function tn(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const o=Object.getOwnPropertyDescriptor(a,n);o&&Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var oo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function io(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function a(){var n=!1;try{n=this instanceof a}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}),r}var St={exports:{}},F={};var tr;function nn(){if(tr)return F;tr=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),n=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),R=Symbol.iterator;function y(u){return u===null||typeof u!="object"?null:(u=R&&u[R]||u["@@iterator"],typeof u=="function"?u:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,C={};function P(u,w,A){this.props=u,this.context=w,this.refs=C,this.updater=A||L}P.prototype.isReactComponent={},P.prototype.setState=function(u,w){if(typeof u!="object"&&typeof u!="function"&&u!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,u,w,"setState")},P.prototype.forceUpdate=function(u){this.updater.enqueueForceUpdate(this,u,"forceUpdate")};function T(){}T.prototype=P.prototype;function N(u,w,A){this.props=u,this.context=w,this.refs=C,this.updater=A||L}var W=N.prototype=new T;W.constructor=N,M(W,P.prototype),W.isPureReactComponent=!0;var B=Array.isArray;function h(){}var _={H:null,A:null,T:null,S:null},Y=Object.prototype.hasOwnProperty;function j(u,w,A){var $=A.ref;return{$$typeof:e,type:u,key:w,ref:$!==void 0?$:null,props:A}}function Z(u,w){return j(u.type,w,u.props)}function te(u){return typeof u=="object"&&u!==null&&u.$$typeof===e}function Me(u){var w={"=":"=0",":":"=2"};return"$"+u.replace(/[=:]/g,function(A){return w[A]})}var _e=/\/+/g;function de(u,w){return typeof u=="object"&&u!==null&&u.key!=null?Me(""+u.key):w.toString(36)}function je(u){switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:switch(typeof u.status=="string"?u.then(h,h):(u.status="pending",u.then(function(w){u.status==="pending"&&(u.status="fulfilled",u.value=w)},function(w){u.status==="pending"&&(u.status="rejected",u.reason=w)})),u.status){case"fulfilled":return u.value;case"rejected":throw u.reason}}throw u}function G(u,w,A,$,H){var z=typeof u;(z==="undefined"||z==="boolean")&&(u=null);var K=!1;if(u===null)K=!0;else switch(z){case"bigint":case"string":case"number":K=!0;break;case"object":switch(u.$$typeof){case e:case t:K=!0;break;case v:return K=u._init,G(K(u._payload),w,A,$,H)}}if(K)return H=H(u),K=$===""?"."+de(u,0):$,B(H)?(A="",K!=null&&(A=K.replace(_e,"$&/")+"/"),G(H,w,A,"",function(ae){return ae})):H!=null&&(te(H)&&(H=Z(H,A+(H.key==null||u&&u.key===H.key?"":(""+H.key).replace(_e,"$&/")+"/")+K)),w.push(H)),1;K=0;var ue=$===""?".":$+":";if(B(u))for(var ie=0;ie<u.length;ie++)$=u[ie],z=ue+de($,ie),K+=G($,w,A,z,H);else if(ie=y(u),typeof ie=="function")for(u=ie.call(u),ie=0;!($=u.next()).done;)$=$.value,z=ue+de($,ie++),K+=G($,w,A,z,H);else if(z==="object"){if(typeof u.then=="function")return G(je(u),w,A,$,H);throw w=String(u),Error("Objects are not valid as a React child (found: "+(w==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":w)+"). If you meant to render a collection of children, use an array instead.")}return K}function we(u,w,A){if(u==null)return u;var $=[],H=0;return G(u,$,"","",function(z){return w.call(A,z,H++)}),$}function Oe(u){if(u._status===-1){var w=u._result;w=w(),w.then(function(A){(u._status===0||u._status===-1)&&(u._status=1,u._result=A)},function(A){(u._status===0||u._status===-1)&&(u._status=2,u._result=A)}),u._status===-1&&(u._status=0,u._result=w)}if(u._status===1)return u._result.default;throw u._result}var Ee=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var w=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(w))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},he={map:we,forEach:function(u,w,A){we(u,function(){w.apply(this,arguments)},A)},count:function(u){var w=0;return we(u,function(){w++}),w},toArray:function(u){return we(u,function(w){return w})||[]},only:function(u){if(!te(u))throw Error("React.Children.only expected to receive a single React element child.");return u}};return F.Activity=E,F.Children=he,F.Component=P,F.Fragment=r,F.Profiler=n,F.PureComponent=N,F.StrictMode=a,F.Suspense=c,F.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,F.__COMPILER_RUNTIME={__proto__:null,c:function(u){return _.H.useMemoCache(u)}},F.cache=function(u){return function(){return u.apply(null,arguments)}},F.cacheSignal=function(){return null},F.cloneElement=function(u,w,A){if(u==null)throw Error("The argument must be a React element, but you passed "+u+".");var $=M({},u.props),H=u.key;if(w!=null)for(z in w.key!==void 0&&(H=""+w.key),w)!Y.call(w,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&w.ref===void 0||($[z]=w[z]);var z=arguments.length-2;if(z===1)$.children=A;else if(1<z){for(var K=Array(z),ue=0;ue<z;ue++)K[ue]=arguments[ue+2];$.children=K}return j(u.type,H,$)},F.createContext=function(u){return u={$$typeof:l,_currentValue:u,_currentValue2:u,_threadCount:0,Provider:null,Consumer:null},u.Provider=u,u.Consumer={$$typeof:o,_context:u},u},F.createElement=function(u,w,A){var $,H={},z=null;if(w!=null)for($ in w.key!==void 0&&(z=""+w.key),w)Y.call(w,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(H[$]=w[$]);var K=arguments.length-2;if(K===1)H.children=A;else if(1<K){for(var ue=Array(K),ie=0;ie<K;ie++)ue[ie]=arguments[ie+2];H.children=ue}if(u&&u.defaultProps)for($ in K=u.defaultProps,K)H[$]===void 0&&(H[$]=K[$]);return j(u,z,H)},F.createRef=function(){return{current:null}},F.forwardRef=function(u){return{$$typeof:s,render:u}},F.isValidElement=te,F.lazy=function(u){return{$$typeof:v,_payload:{_status:-1,_result:u},_init:Oe}},F.memo=function(u,w){return{$$typeof:f,type:u,compare:w===void 0?null:w}},F.startTransition=function(u){var w=_.T,A={};_.T=A;try{var $=u(),H=_.S;H!==null&&H(A,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(h,Ee)}catch(z){Ee(z)}finally{w!==null&&A.types!==null&&(w.types=A.types),_.T=w}},F.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},F.use=function(u){return _.H.use(u)},F.useActionState=function(u,w,A){return _.H.useActionState(u,w,A)},F.useCallback=function(u,w){return _.H.useCallback(u,w)},F.useContext=function(u){return _.H.useContext(u)},F.useDebugValue=function(){},F.useDeferredValue=function(u,w){return _.H.useDeferredValue(u,w)},F.useEffect=function(u,w){return _.H.useEffect(u,w)},F.useEffectEvent=function(u){return _.H.useEffectEvent(u)},F.useId=function(){return _.H.useId()},F.useImperativeHandle=function(u,w,A){return _.H.useImperativeHandle(u,w,A)},F.useInsertionEffect=function(u,w){return _.H.useInsertionEffect(u,w)},F.useLayoutEffect=function(u,w){return _.H.useLayoutEffect(u,w)},F.useMemo=function(u,w){return _.H.useMemo(u,w)},F.useOptimistic=function(u,w){return _.H.useOptimistic(u,w)},F.useReducer=function(u,w,A){return _.H.useReducer(u,w,A)},F.useRef=function(u){return _.H.useRef(u)},F.useState=function(u){return _.H.useState(u)},F.useSyncExternalStore=function(u,w,A){return _.H.useSyncExternalStore(u,w,A)},F.useTransition=function(){return _.H.useTransition()},F.version="19.2.4",F}var rr;function an(){return rr||(rr=1,St.exports=nn()),St.exports}var m=an();const on=rn(m),lo=tn({__proto__:null,default:on},[m]);var nr="popstate";function ln(e={}){function t(a,n){let{pathname:o,search:l,hash:s}=a.location;return Ze("",{pathname:o,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default")}function r(a,n){return typeof n=="string"?n:Te(n)}return un(t,r,null,e)}function I(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ne(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sn(){return Math.random().toString(36).substring(2,10)}function ar(e,t){return{usr:e.state,key:e.key,idx:t}}function Ze(e,t,r=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?De(t):t,state:r,key:t&&t.key||a||sn()}}function Te({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function De(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function un(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,l=n.history,s="POP",c=null,f=v();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function v(){return(l.state||{idx:null}).idx}function E(){s="POP";let C=v(),P=C==null?null:C-f;f=C,c&&c({action:s,location:M.location,delta:P})}function R(C,P){s="PUSH";let T=Ze(M.location,C,P);f=v()+1;let N=ar(T,f),W=M.createHref(T);try{l.pushState(N,"",W)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;n.location.assign(W)}o&&c&&c({action:s,location:M.location,delta:1})}function y(C,P){s="REPLACE";let T=Ze(M.location,C,P);f=v();let N=ar(T,f),W=M.createHref(T);l.replaceState(N,"",W),o&&c&&c({action:s,location:M.location,delta:0})}function L(C){let P=n.location.origin!=="null"?n.location.origin:n.location.href,T=typeof C=="string"?C:Te(C);return T=T.replace(/ $/,"%20"),I(P,`No window.location.(origin|href) available to create URL for href: ${T}`),new URL(T,P)}let M={get action(){return s},get location(){return e(n,l)},listen(C){if(c)throw new Error("A history only accepts one active listener");return n.addEventListener(nr,E),c=C,()=>{n.removeEventListener(nr,E),c=null}},createHref(C){return t(n,C)},createURL:L,encodeLocation(C){let P=L(C);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:R,replace:y,go(C){return l.go(C)}};return M}var cn=new Set(["lazy","caseSensitive","path","id","index","children"]);function fn(e){return e.index===!0}function mt(e,t,r=[],a={}){return e.map((n,o)=>{let l=[...r,String(o)],s=typeof n.id=="string"?n.id:l.join("-");if(I(n.index!==!0||!n.children,"Cannot specify children on an index route"),I(!a[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),fn(n)){let c={...n,...t(n),id:s};return a[s]=c,c}else{let c={...n,...t(n),id:s,children:void 0};return a[s]=c,n.children&&(c.children=mt(n.children,t,l,a)),c}})}function Le(e,t,r="/"){return ft(e,t,r,!1)}function ft(e,t,r,a){let n=typeof t=="string"?De(t):t,o=pe(n.pathname||"/",r);if(o==null)return null;let l=Cr(e);hn(l);let s=null;for(let c=0;s==null&&c<l.length;++c){let f=Pn(o);s=bn(l[c],f,a)}return s}function dn(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],handle:r.handle}}function Cr(e,t=[],r=[],a=""){let n=(o,l,s)=>{let c={relativePath:s===void 0?o.path||"":s,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};c.relativePath.startsWith("/")&&(I(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length));let f=ge([a,c.relativePath]),v=r.concat(c);o.children&&o.children.length>0&&(I(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),Cr(o.children,t,v,f)),!(o.path==null&&!o.index)&&t.push({path:f,score:En(f,o.index),routesMeta:v})};return e.forEach((o,l)=>{if(o.path===""||!o.path?.includes("?"))n(o,l);else for(let s of Pr(o.path))n(o,l,s)}),t}function Pr(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let l=Pr(a.join("/")),s=[];return s.push(...l.map(c=>c===""?o:[o,c].join("/"))),n&&s.push(...l),s.map(c=>e.startsWith("/")&&c===""?"/":c)}function hn(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Rn(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var mn=/^:[\w-]+$/,pn=3,vn=2,yn=1,gn=10,wn=-2,or=e=>e==="*";function En(e,t){let r=e.split("/"),a=r.length;return r.some(or)&&(a+=wn),t&&(a+=vn),r.filter(n=>!or(n)).reduce((n,o)=>n+(mn.test(o)?pn:o===""?yn:gn),a)}function Rn(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function bn(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",l=[];for(let s=0;s<a.length;++s){let c=a[s],f=s===a.length-1,v=o==="/"?t:t.slice(o.length)||"/",E=pt({path:c.relativePath,caseSensitive:c.caseSensitive,end:f},v),R=c.route;if(!E&&f&&r&&!a[a.length-1].route.index&&(E=pt({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},v)),!E)return null;Object.assign(n,E.params),l.push({params:n,pathname:ge([o,E.pathname]),pathnameBase:Ln(ge([o,E.pathnameBase])),route:R}),E.pathnameBase!=="/"&&(o=ge([o,E.pathnameBase]))}return l}function pt(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Cn(e.path,e.caseSensitive,e.end),n=t.match(r);if(!n)return null;let o=n[0],l=o.replace(/(.)\/+$/,"$1"),s=n.slice(1);return{params:a.reduce((f,{paramName:v,isOptional:E},R)=>{if(v==="*"){let L=s[R]||"";l=o.slice(0,o.length-L.length).replace(/(.)\/+$/,"$1")}const y=s[R];return E&&!y?f[v]=void 0:f[v]=(y||"").replace(/%2F/g,"/"),f},{}),pathname:o,pathnameBase:l,pattern:e}}function Cn(e,t=!1,r=!0){ne(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,s,c)=>(a.push({paramName:s,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function Pn(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ne(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function pe(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Sn(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?De(e):e;return{pathname:r?r.startsWith("/")?r:xn(r,t):t,search:Tn(a),hash:Dn(n)}}function xn(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function xt(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Sr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function yt(e){let t=Sr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function gt(e,t,r,a=!1){let n;typeof e=="string"?n=De(e):(n={...e},I(!n.pathname||!n.pathname.includes("?"),xt("?","pathname","search",n)),I(!n.pathname||!n.pathname.includes("#"),xt("#","pathname","hash",n)),I(!n.search||!n.search.includes("#"),xt("#","search","hash",n)));let o=e===""||n.pathname==="",l=o?"/":n.pathname,s;if(l==null)s=r;else{let E=t.length-1;if(!a&&l.startsWith("..")){let R=l.split("/");for(;R[0]==="..";)R.shift(),E-=1;n.pathname=R.join("/")}s=E>=0?t[E]:"/"}let c=Sn(n,s),f=l&&l!=="/"&&l.endsWith("/"),v=(o||l===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(f||v)&&(c.pathname+="/"),c}var ge=e=>e.join("/").replace(/\/\/+/g,"/"),Ln=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Tn=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Dn=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,vt=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function et(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var xr=["POST","PUT","PATCH","DELETE"],Mn=new Set(xr),_n=["GET",...xr],On=new Set(_n),An=new Set([301,302,303,307,308]),$n=new Set([307,308]),Lt={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Nn={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ge={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$t=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kn=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Lr="remix-router-transitions",Tr=Symbol("ResetLoaderData");function Fn(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";I(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.mapRouteProperties||kn,n={},o=mt(e.routes,a,void 0,n),l,s=e.basename||"/",c=e.dataStrategy||zn,f=e.patchRoutesOnNavigation,v={...e.future},E=null,R=new Set,y=null,L=null,M=null,C=e.hydrationData!=null,P=Le(o,e.history.location,s),T=!1,N=null;if(P==null&&!f){let i=ce(404,{pathname:e.history.location.pathname}),{matches:d,route:p}=vr(o);P=d,N={[p.id]:i}}P&&!e.hydrationData&&at(P,o,e.history.location.pathname).active&&(P=null);let W;if(P)if(P.some(i=>i.route.lazy))W=!1;else if(!P.some(i=>i.route.loader))W=!0;else{let i=e.hydrationData?e.hydrationData.loaderData:null,d=e.hydrationData?e.hydrationData.errors:null;if(d){let p=P.findIndex(g=>d[g.route.id]!==void 0);W=P.slice(0,p+1).every(g=>!_t(g.route,i,d))}else W=P.every(p=>!_t(p.route,i,d))}else{W=!1,P=[];let i=at(null,o,e.history.location.pathname);i.active&&i.matches&&(T=!0,P=i.matches)}let B,h={historyAction:e.history.action,location:e.history.location,matches:P,initialized:W,navigation:Lt,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},_="POP",Y=!1,j,Z=!1,te=new Map,Me=null,_e=!1,de=!1,je=new Set,G=new Map,we=0,Oe=-1,Ee=new Map,he=new Set,u=new Map,w=new Map,A=new Set,$=new Map,H,z=null;function K(){if(E=e.history.listen(({action:i,location:d,delta:p})=>{if(H){H(),H=void 0;return}ne($.size===0||p!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let g=Xt({currentLocation:h.location,nextLocation:d,historyAction:i});if(g&&p!=null){let S=new Promise(O=>{H=O});e.history.go(p*-1),nt(g,{state:"blocked",location:d,proceed(){nt(g,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),S.then(()=>e.history.go(p))},reset(){let O=new Map(h.blockers);O.set(g,Ge),ae({blockers:O})}});return}return Ae(i,d)}),r){Zn(t,te);let i=()=>ea(t,te);t.addEventListener("pagehide",i),Me=()=>t.removeEventListener("pagehide",i)}return h.initialized||Ae("POP",h.location,{initialHydration:!0}),B}function ue(){E&&E(),Me&&Me(),R.clear(),j&&j.abort(),h.fetchers.forEach((i,d)=>bt(d)),h.blockers.forEach((i,d)=>qt(d))}function ie(i){return R.add(i),()=>R.delete(i)}function ae(i,d={}){h={...h,...i};let p=[],g=[];h.fetchers.forEach((S,O)=>{S.state==="idle"&&(A.has(O)?p.push(O):g.push(O))}),A.forEach(S=>{!h.fetchers.has(S)&&!G.has(S)&&p.push(S)}),[...R].forEach(S=>S(h,{deletedFetchers:p,viewTransitionOpts:d.viewTransitionOpts,flushSync:d.flushSync===!0})),p.forEach(S=>bt(S)),g.forEach(S=>h.fetchers.delete(S))}function He(i,d,{flushSync:p}={}){let g=h.actionData!=null&&h.navigation.formMethod!=null&&me(h.navigation.formMethod)&&h.navigation.state==="loading"&&i.state?._isRedirect!==!0,S;d.actionData?Object.keys(d.actionData).length>0?S=d.actionData:S=null:g?S=h.actionData:S=null;let O=d.loaderData?mr(h.loaderData,d.loaderData,d.matches||[],d.errors):h.loaderData,k=h.blockers;k.size>0&&(k=new Map(k),k.forEach((b,U)=>k.set(U,Ge)));let x=Y===!0||h.navigation.formMethod!=null&&me(h.navigation.formMethod)&&i.state?._isRedirect!==!0;l&&(o=l,l=void 0),_e||_==="POP"||(_==="PUSH"?e.history.push(i,i.state):_==="REPLACE"&&e.history.replace(i,i.state));let D;if(_==="POP"){let b=te.get(h.location.pathname);b&&b.has(i.pathname)?D={currentLocation:h.location,nextLocation:i}:te.has(i.pathname)&&(D={currentLocation:i,nextLocation:h.location})}else if(Z){let b=te.get(h.location.pathname);b?b.add(i.pathname):(b=new Set([i.pathname]),te.set(h.location.pathname,b)),D={currentLocation:h.location,nextLocation:i}}ae({...d,actionData:S,loaderData:O,historyAction:_,location:i,initialized:!0,navigation:Lt,revalidation:"idle",restoreScrollPosition:Zt(i,d.matches||h.matches),preventScrollReset:x,blockers:k},{viewTransitionOpts:D,flushSync:p===!0}),_="POP",Y=!1,Z=!1,_e=!1,de=!1,z?.resolve(),z=null}async function Bt(i,d){if(typeof i=="number"){e.history.go(i);return}let p=Mt(h.location,h.matches,s,i,d?.fromRouteId,d?.relative),{path:g,submission:S,error:O}=ir(!1,p,d),k=h.location,x=Ze(h.location,g,d&&d.state);x={...x,...e.history.encodeLocation(x)};let D=d&&d.replace!=null?d.replace:void 0,b="PUSH";D===!0?b="REPLACE":D===!1||S!=null&&me(S.formMethod)&&S.formAction===h.location.pathname+h.location.search&&(b="REPLACE");let U=d&&"preventScrollReset"in d?d.preventScrollReset===!0:void 0,V=(d&&d.flushSync)===!0,Q=Xt({currentLocation:k,nextLocation:x,historyAction:b});if(Q){nt(Q,{state:"blocked",location:x,proceed(){nt(Q,{state:"proceeding",proceed:void 0,reset:void 0,location:x}),Bt(i,d)},reset(){let oe=new Map(h.blockers);oe.set(Q,Ge),ae({blockers:oe})}});return}await Ae(b,x,{submission:S,pendingError:O,preventScrollReset:U,replace:d&&d.replace,enableViewTransition:d&&d.viewTransition,flushSync:V})}function Ir(){z||(z=ta()),Rt(),ae({revalidation:"loading"});let i=z.promise;return h.navigation.state==="submitting"?i:h.navigation.state==="idle"?(Ae(h.historyAction,h.location,{startUninterruptedRevalidation:!0}),i):(Ae(_||h.historyAction,h.navigation.location,{overrideNavigation:h.navigation,enableViewTransition:Z===!0}),i)}async function Ae(i,d,p){j&&j.abort(),j=null,_=i,_e=(p&&p.startUninterruptedRevalidation)===!0,Xr(h.location,h.matches),Y=(p&&p.preventScrollReset)===!0,Z=(p&&p.enableViewTransition)===!0;let g=l||o,S=p&&p.overrideNavigation,O=p?.initialHydration&&h.matches&&h.matches.length>0&&!T?h.matches:Le(g,d,s),k=(p&&p.flushSync)===!0;if(O&&h.initialized&&!de&&Jn(h.location,d)&&!(p&&p.submission&&me(p.submission.formMethod))){He(d,{matches:O},{flushSync:k});return}let x=at(O,g,d.pathname);if(x.active&&x.matches&&(O=x.matches),!O){let{error:X,notFoundMatches:q,route:re}=Ct(d.pathname);He(d,{matches:q,loaderData:{},errors:{[re.id]:X}},{flushSync:k});return}j=new AbortController;let D=Be(e.history,d,j.signal,p&&p.submission),b;if(p&&p.pendingError)b=[ke(O).route.id,{type:"error",error:p.pendingError}];else if(p&&p.submission&&me(p.submission.formMethod)){let X=await zr(D,d,p.submission,O,x.active,{replace:p.replace,flushSync:k});if(X.shortCircuited)return;if(X.pendingActionResult){let[q,re]=X.pendingActionResult;if(se(re)&&et(re.error)&&re.error.status===404){j=null,He(d,{matches:X.matches,loaderData:{},errors:{[q]:re.error}});return}}O=X.matches||O,b=X.pendingActionResult,S=Tt(d,p.submission),k=!1,x.active=!1,D=Be(e.history,D.url,D.signal)}let{shortCircuited:U,matches:V,loaderData:Q,errors:oe}=await Br(D,d,O,x.active,S,p&&p.submission,p&&p.fetcherSubmission,p&&p.replace,p&&p.initialHydration===!0,k,b);U||(j=null,He(d,{matches:V||O,...pr(b),loaderData:Q,errors:oe}))}async function zr(i,d,p,g,S,O={}){Rt();let k=Xn(d,p);if(ae({navigation:k},{flushSync:O.flushSync===!0}),S){let b=await ot(g,d.pathname,i.signal);if(b.type==="aborted")return{shortCircuited:!0};if(b.type==="error"){let U=ke(b.partialMatches).route.id;return{matches:b.partialMatches,pendingActionResult:[U,{type:"error",error:b.error}]}}else if(b.matches)g=b.matches;else{let{notFoundMatches:U,error:V,route:Q}=Ct(d.pathname);return{matches:U,pendingActionResult:[Q.id,{type:"error",error:V}]}}}let x,D=Qe(g,d);if(!D.route.action&&!D.route.lazy)x={type:"error",error:ce(405,{method:i.method,pathname:d.pathname,routeId:D.route.id})};else if(x=(await Ye("action",h,i,[D],g,null))[D.route.id],i.signal.aborted)return{shortCircuited:!0};if(Fe(x)){let b;return O&&O.replace!=null?b=O.replace:b=fr(x.response.headers.get("Location"),new URL(i.url),s)===h.location.pathname+h.location.search,await $e(i,x,!0,{submission:p,replace:b}),{shortCircuited:!0}}if(se(x)){let b=ke(g,D.route.id);return(O&&O.replace)!==!0&&(_="PUSH"),{matches:g,pendingActionResult:[b.route.id,x]}}return{matches:g,pendingActionResult:[D.route.id,x]}}async function Br(i,d,p,g,S,O,k,x,D,b,U){let V=S||Tt(d,O),Q=O||k||gr(V),oe=!_e&&!D;if(g){if(oe){let le=Wt(U);ae({navigation:V,...le!==void 0?{actionData:le}:{}},{flushSync:b})}let J=await ot(p,d.pathname,i.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let le=ke(J.partialMatches).route.id;return{matches:J.partialMatches,loaderData:{},errors:{[le]:J.error}}}else if(J.matches)p=J.matches;else{let{error:le,notFoundMatches:st,route:Je}=Ct(d.pathname);return{matches:st,loaderData:{},errors:{[Je.id]:le}}}}let X=l||o,[q,re]=sr(e.history,h,p,Q,d,D===!0,de,je,A,u,he,X,s,U);if(Oe=++we,q.length===0&&re.length===0){let J=Jt();return He(d,{matches:p,loaderData:{},errors:U&&se(U[1])?{[U[0]]:U[1].error}:null,...pr(U),...J?{fetchers:new Map(h.fetchers)}:{}},{flushSync:b}),{shortCircuited:!0}}if(oe){let J={};if(!g){J.navigation=V;let le=Wt(U);le!==void 0&&(J.actionData=le)}re.length>0&&(J.fetchers=Wr(re)),ae(J,{flushSync:b})}re.forEach(J=>{Se(J.key),J.controller&&G.set(J.key,J.controller)});let Ie=()=>re.forEach(J=>Se(J.key));j&&j.signal.addEventListener("abort",Ie);let{loaderResults:Ve,fetcherResults:be}=await Yt(h,p,q,re,i);if(i.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Ie),re.forEach(J=>G.delete(J.key));let ye=ut(Ve);if(ye)return await $e(i,ye.result,!0,{replace:x}),{shortCircuited:!0};if(ye=ut(be),ye)return he.add(ye.key),await $e(i,ye.result,!0,{replace:x}),{shortCircuited:!0};let{loaderData:Pt,errors:Ke}=hr(h,p,Ve,U,re,be);D&&h.errors&&(Ke={...h.errors,...Ke});let Ne=Jt(),it=Gt(Oe),lt=Ne||it||re.length>0;return{matches:p,loaderData:Pt,errors:Ke,...lt?{fetchers:new Map(h.fetchers)}:{}}}function Wt(i){if(i&&!se(i[1]))return{[i[0]]:i[1].data};if(h.actionData)return Object.keys(h.actionData).length===0?null:h.actionData}function Wr(i){return i.forEach(d=>{let p=h.fetchers.get(d.key),g=qe(void 0,p?p.data:void 0);h.fetchers.set(d.key,g)}),new Map(h.fetchers)}async function Yr(i,d,p,g){Se(i);let S=(g&&g.flushSync)===!0,O=l||o,k=Mt(h.location,h.matches,s,p,d,g?.relative),x=Le(O,k,s),D=at(x,O,k);if(D.active&&D.matches&&(x=D.matches),!x){Re(i,d,ce(404,{pathname:k}),{flushSync:S});return}let{path:b,submission:U,error:V}=ir(!0,k,g);if(V){Re(i,d,V,{flushSync:S});return}let Q=Qe(x,b),oe=(g&&g.preventScrollReset)===!0;if(U&&me(U.formMethod)){await Vr(i,d,b,Q,x,D.active,S,oe,U);return}u.set(i,{routeId:d,path:b}),await Kr(i,d,b,Q,x,D.active,S,oe,U)}async function Vr(i,d,p,g,S,O,k,x,D){Rt(),u.delete(i);function b(ee){if(!ee.route.action&&!ee.route.lazy){let ze=ce(405,{method:D.formMethod,pathname:p,routeId:d});return Re(i,d,ze,{flushSync:k}),!0}return!1}if(!O&&b(g))return;let U=h.fetchers.get(i);Pe(i,Qn(D,U),{flushSync:k});let V=new AbortController,Q=Be(e.history,p,V.signal,D);if(O){let ee=await ot(S,p,Q.signal);if(ee.type==="aborted")return;if(ee.type==="error"){Re(i,d,ee.error,{flushSync:k});return}else if(ee.matches){if(S=ee.matches,g=Qe(S,p),b(g))return}else{Re(i,d,ce(404,{pathname:p}),{flushSync:k});return}}G.set(i,V);let oe=we,q=(await Ye("action",h,Q,[g],S,i))[g.route.id];if(Q.signal.aborted){G.get(i)===V&&G.delete(i);return}if(A.has(i)){if(Fe(q)||se(q)){Pe(i,xe(void 0));return}}else{if(Fe(q))if(G.delete(i),Oe>oe){Pe(i,xe(void 0));return}else return he.add(i),Pe(i,qe(D)),$e(Q,q,!1,{fetcherSubmission:D,preventScrollReset:x});if(se(q)){Re(i,d,q.error);return}}let re=h.navigation.location||h.location,Ie=Be(e.history,re,V.signal),Ve=l||o,be=h.navigation.state!=="idle"?Le(Ve,h.navigation.location,s):h.matches;I(be,"Didn't find any matches after fetcher action");let ye=++we;Ee.set(i,ye);let Pt=qe(D,q.data);h.fetchers.set(i,Pt);let[Ke,Ne]=sr(e.history,h,be,D,re,!1,de,je,A,u,he,Ve,s,[g.route.id,q]);Ne.filter(ee=>ee.key!==i).forEach(ee=>{let ze=ee.key,er=h.fetchers.get(ze),en=qe(void 0,er?er.data:void 0);h.fetchers.set(ze,en),Se(ze),ee.controller&&G.set(ze,ee.controller)}),ae({fetchers:new Map(h.fetchers)});let it=()=>Ne.forEach(ee=>Se(ee.key));V.signal.addEventListener("abort",it);let{loaderResults:lt,fetcherResults:J}=await Yt(h,be,Ke,Ne,Ie);if(V.signal.aborted)return;V.signal.removeEventListener("abort",it),Ee.delete(i),G.delete(i),Ne.forEach(ee=>G.delete(ee.key));let le=ut(lt);if(le)return $e(Ie,le.result,!1,{preventScrollReset:x});if(le=ut(J),le)return he.add(le.key),$e(Ie,le.result,!1,{preventScrollReset:x});let{loaderData:st,errors:Je}=hr(h,be,lt,void 0,Ne,J);if(h.fetchers.has(i)){let ee=xe(q.data);h.fetchers.set(i,ee)}Gt(ye),h.navigation.state==="loading"&&ye>Oe?(I(_,"Expected pending action"),j&&j.abort(),He(h.navigation.location,{matches:be,loaderData:st,errors:Je,fetchers:new Map(h.fetchers)})):(ae({errors:Je,loaderData:mr(h.loaderData,st,be,Je),fetchers:new Map(h.fetchers)}),de=!1)}async function Kr(i,d,p,g,S,O,k,x,D){let b=h.fetchers.get(i);Pe(i,qe(D,b?b.data:void 0),{flushSync:k});let U=new AbortController,V=Be(e.history,p,U.signal);if(O){let q=await ot(S,p,V.signal);if(q.type==="aborted")return;if(q.type==="error"){Re(i,d,q.error,{flushSync:k});return}else if(q.matches)S=q.matches,g=Qe(S,p);else{Re(i,d,ce(404,{pathname:p}),{flushSync:k});return}}G.set(i,U);let Q=we,X=(await Ye("loader",h,V,[g],S,i))[g.route.id];if(G.get(i)===U&&G.delete(i),!V.signal.aborted){if(A.has(i)){Pe(i,xe(void 0));return}if(Fe(X))if(Oe>Q){Pe(i,xe(void 0));return}else{he.add(i),await $e(V,X,!1,{preventScrollReset:x});return}if(se(X)){Re(i,d,X.error);return}Pe(i,xe(X.data))}}async function $e(i,d,p,{submission:g,fetcherSubmission:S,preventScrollReset:O,replace:k}={}){d.response.headers.has("X-Remix-Revalidate")&&(de=!0);let x=d.response.headers.get("Location");I(x,"Expected a Location header on the redirect Response"),x=fr(x,new URL(i.url),s);let D=Ze(h.location,x,{_isRedirect:!0});if(r){let X=!1;if(d.response.headers.has("X-Remix-Reload-Document"))X=!0;else if($t.test(x)){const q=e.history.createURL(x);X=q.origin!==t.location.origin||pe(q.pathname,s)==null}if(X){k?t.location.replace(x):t.location.assign(x);return}}j=null;let b=k===!0||d.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:U,formAction:V,formEncType:Q}=h.navigation;!g&&!S&&U&&V&&Q&&(g=gr(h.navigation));let oe=g||S;if($n.has(d.response.status)&&oe&&me(oe.formMethod))await Ae(b,D,{submission:{...oe,formAction:x},preventScrollReset:O||Y,enableViewTransition:p?Z:void 0});else{let X=Tt(D,g);await Ae(b,D,{overrideNavigation:X,fetcherSubmission:S,preventScrollReset:O||Y,enableViewTransition:p?Z:void 0})}}async function Ye(i,d,p,g,S,O){let k,x={};try{k=await Bn(c,i,d,p,g,S,O,n,a)}catch(D){return g.forEach(b=>{x[b.route.id]={type:"error",error:D}}),x}for(let[D,b]of Object.entries(k))if(Gn(b)){let U=b.result;x[D]={type:"redirect",response:Vn(U,p,D,S,s)}}else x[D]=await Yn(b);return x}async function Yt(i,d,p,g,S){let O=Ye("loader",i,S,p,d,null),k=Promise.all(g.map(async b=>{if(b.matches&&b.match&&b.controller){let V=(await Ye("loader",i,Be(e.history,b.path,b.controller.signal),[b.match],b.matches,b.key))[b.match.route.id];return{[b.key]:V}}else return Promise.resolve({[b.key]:{type:"error",error:ce(404,{pathname:b.path})}})})),x=await O,D=(await k).reduce((b,U)=>Object.assign(b,U),{});return{loaderResults:x,fetcherResults:D}}function Rt(){de=!0,u.forEach((i,d)=>{G.has(d)&&je.add(d),Se(d)})}function Pe(i,d,p={}){h.fetchers.set(i,d),ae({fetchers:new Map(h.fetchers)},{flushSync:(p&&p.flushSync)===!0})}function Re(i,d,p,g={}){let S=ke(h.matches,d);bt(i),ae({errors:{[S.route.id]:p},fetchers:new Map(h.fetchers)},{flushSync:(g&&g.flushSync)===!0})}function Vt(i){return w.set(i,(w.get(i)||0)+1),A.has(i)&&A.delete(i),h.fetchers.get(i)||Nn}function bt(i){let d=h.fetchers.get(i);G.has(i)&&!(d&&d.state==="loading"&&Ee.has(i))&&Se(i),u.delete(i),Ee.delete(i),he.delete(i),A.delete(i),je.delete(i),h.fetchers.delete(i)}function Jr(i){let d=(w.get(i)||0)-1;d<=0?(w.delete(i),A.add(i)):w.set(i,d),ae({fetchers:new Map(h.fetchers)})}function Se(i){let d=G.get(i);d&&(d.abort(),G.delete(i))}function Kt(i){for(let d of i){let p=Vt(d),g=xe(p.data);h.fetchers.set(d,g)}}function Jt(){let i=[],d=!1;for(let p of he){let g=h.fetchers.get(p);I(g,`Expected fetcher: ${p}`),g.state==="loading"&&(he.delete(p),i.push(p),d=!0)}return Kt(i),d}function Gt(i){let d=[];for(let[p,g]of Ee)if(g<i){let S=h.fetchers.get(p);I(S,`Expected fetcher: ${p}`),S.state==="loading"&&(Se(p),Ee.delete(p),d.push(p))}return Kt(d),d.length>0}function Gr(i,d){let p=h.blockers.get(i)||Ge;return $.get(i)!==d&&$.set(i,d),p}function qt(i){h.blockers.delete(i),$.delete(i)}function nt(i,d){let p=h.blockers.get(i)||Ge;I(p.state==="unblocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="blocked"||p.state==="blocked"&&d.state==="proceeding"||p.state==="blocked"&&d.state==="unblocked"||p.state==="proceeding"&&d.state==="unblocked",`Invalid blocker state transition: ${p.state} -> ${d.state}`);let g=new Map(h.blockers);g.set(i,d),ae({blockers:g})}function Xt({currentLocation:i,nextLocation:d,historyAction:p}){if($.size===0)return;$.size>1&&ne(!1,"A router only supports one blocker at a time");let g=Array.from($.entries()),[S,O]=g[g.length-1],k=h.blockers.get(S);if(!(k&&k.state==="proceeding")&&O({currentLocation:i,nextLocation:d,historyAction:p}))return S}function Ct(i){let d=ce(404,{pathname:i}),p=l||o,{matches:g,route:S}=vr(p);return{notFoundMatches:g,route:S,error:d}}function qr(i,d,p){if(y=i,M=d,L=p||null,!C&&h.navigation===Lt){C=!0;let g=Zt(h.location,h.matches);g!=null&&ae({restoreScrollPosition:g})}return()=>{y=null,M=null,L=null}}function Qt(i,d){return L&&L(i,d.map(g=>dn(g,h.loaderData)))||i.key}function Xr(i,d){if(y&&M){let p=Qt(i,d);y[p]=M()}}function Zt(i,d){if(y){let p=Qt(i,d),g=y[p];if(typeof g=="number")return g}return null}function at(i,d,p){if(f)if(i){if(Object.keys(i[0].params).length>0)return{active:!0,matches:ft(d,p,s,!0)}}else return{active:!0,matches:ft(d,p,s,!0)||[]};return{active:!1,matches:null}}async function ot(i,d,p){if(!f)return{type:"success",matches:i};let g=i;for(;;){let S=l==null,O=l||o,k=n;try{await f({path:d,matches:g,patch:(b,U)=>{p.aborted||cr(b,U,O,k,a)}})}catch(b){return{type:"error",error:b,partialMatches:g}}finally{S&&!p.aborted&&(o=[...o])}if(p.aborted)return{type:"aborted"};let x=Le(O,d,s);if(x)return{type:"success",matches:x};let D=ft(O,d,s,!0);if(!D||g.length===D.length&&g.every((b,U)=>b.route.id===D[U].route.id))return{type:"success",matches:null};g=D}}function Qr(i){n={},l=mt(i,a,void 0,n)}function Zr(i,d){let p=l==null;cr(i,d,l||o,n,a),p&&(o=[...o],ae({}))}return B={get basename(){return s},get future(){return v},get state(){return h},get routes(){return o},get window(){return t},initialize:K,subscribe:ie,enableScrollRestoration:qr,navigate:Bt,fetch:Yr,revalidate:Ir,createHref:i=>e.history.createHref(i),encodeLocation:i=>e.history.encodeLocation(i),getFetcher:Vt,deleteFetcher:Jr,dispose:ue,getBlocker:Gr,deleteBlocker:qt,patchRoutes:Zr,_internalFetchControllers:G,_internalSetRoutes:Qr},B}function Un(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Mt(e,t,r,a,n,o){let l,s;if(n){l=[];for(let f of t)if(l.push(f),f.route.id===n){s=f;break}}else l=t,s=t[t.length-1];let c=gt(a||".",yt(l),pe(e.pathname,r)||e.pathname,o==="path");if(a==null&&(c.search=e.search,c.hash=e.hash),(a==null||a===""||a===".")&&s){let f=Nt(c.search);if(s.route.index&&!f)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&f){let v=new URLSearchParams(c.search),E=v.getAll("index");v.delete("index"),E.filter(y=>y).forEach(y=>v.append("index",y));let R=v.toString();c.search=R?`?${R}`:""}}return r!=="/"&&(c.pathname=c.pathname==="/"?r:ge([r,c.pathname])),Te(c)}function ir(e,t,r){if(!r||!Un(r))return{path:t};if(r.formMethod&&!qn(r.formMethod))return{path:t,error:ce(405,{method:r.formMethod})};let a=()=>({path:t,error:ce(400,{type:"invalid-body"})}),o=(r.formMethod||"get").toUpperCase(),l=Mr(t);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!me(o))return a();let E=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((R,[y,L])=>`${R}${y}=${L}
2
+ `,""):String(r.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:E}}}else if(r.formEncType==="application/json"){if(!me(o))return a();try{let E=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:r.formEncType,formData:void 0,json:E,text:void 0}}}catch{return a()}}}I(typeof FormData=="function","FormData is not available in this environment");let s,c;if(r.formData)s=Ot(r.formData),c=r.formData;else if(r.body instanceof FormData)s=Ot(r.body),c=r.body;else if(r.body instanceof URLSearchParams)s=r.body,c=dr(s);else if(r.body==null)s=new URLSearchParams,c=new FormData;else try{s=new URLSearchParams(r.body),c=dr(s)}catch{return a()}let f={formMethod:o,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(me(f.formMethod))return{path:t,submission:f};let v=De(t);return e&&v.search&&Nt(v.search)&&s.append("index",""),v.search=`?${s}`,{path:Te(v),submission:f}}function lr(e,t,r=!1){let a=e.findIndex(n=>n.route.id===t);return a>=0?e.slice(0,r?a+1:a):e}function sr(e,t,r,a,n,o,l,s,c,f,v,E,R,y){let L=y?se(y[1])?y[1].error:y[1].data:void 0,M=e.createURL(t.location),C=e.createURL(n),P=r;o&&t.errors?P=lr(r,Object.keys(t.errors)[0],!0):y&&se(y[1])&&(P=lr(r,y[0]));let T=y?y[1].statusCode:void 0,N=T&&T>=400,W=P.filter((h,_)=>{let{route:Y}=h;if(Y.lazy)return!0;if(Y.loader==null)return!1;if(o)return _t(Y,t.loaderData,t.errors);if(jn(t.loaderData,t.matches[_],h))return!0;let j=t.matches[_],Z=h;return ur(h,{currentUrl:M,currentParams:j.params,nextUrl:C,nextParams:Z.params,...a,actionResult:L,actionStatus:T,defaultShouldRevalidate:N?!1:l||M.pathname+M.search===C.pathname+C.search||M.search!==C.search||Hn(j,Z)})}),B=[];return f.forEach((h,_)=>{if(o||!r.some(Me=>Me.route.id===h.routeId)||c.has(_))return;let Y=Le(E,h.path,R);if(!Y){B.push({key:_,routeId:h.routeId,path:h.path,matches:null,match:null,controller:null});return}let j=t.fetchers.get(_),Z=Qe(Y,h.path),te=!1;v.has(_)?te=!1:s.has(_)?(s.delete(_),te=!0):j&&j.state!=="idle"&&j.data===void 0?te=l:te=ur(Z,{currentUrl:M,currentParams:t.matches[t.matches.length-1].params,nextUrl:C,nextParams:r[r.length-1].params,...a,actionResult:L,actionStatus:T,defaultShouldRevalidate:N?!1:l}),te&&B.push({key:_,routeId:h.routeId,path:h.path,matches:Y,match:Z,controller:new AbortController})}),[W,B]}function _t(e,t,r){if(e.lazy)return!0;if(!e.loader)return!1;let a=t!=null&&t[e.id]!==void 0,n=r!=null&&r[e.id]!==void 0;return!a&&n?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!n}function jn(e,t,r){let a=!t||r.route.id!==t.route.id,n=!e.hasOwnProperty(r.route.id);return a||n}function Hn(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function ur(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}function cr(e,t,r,a,n){let o;if(e){let c=a[e];I(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),o=c.children}else o=r;let l=t.filter(c=>!o.some(f=>Dr(c,f))),s=mt(l,n,[e||"_","patch",String(o?.length||"0")],a);o.push(...s)}function Dr(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((r,a)=>t.children?.some(n=>Dr(r,n))):!1}async function In(e,t,r){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let n=r[e.id];I(n,"No route found in manifest");let o={};for(let l in a){let c=n[l]!==void 0&&l!=="hasErrorBoundary";ne(!c,`Route "${n.id}" has a static property "${l}" defined but its lazy function is also returning a value for this property. The lazy route property "${l}" will be ignored.`),!c&&!cn.has(l)&&(o[l]=a[l])}Object.assign(n,o),Object.assign(n,{...t(n),lazy:void 0})}async function zn({matches:e}){let t=e.filter(a=>a.shouldLoad);return(await Promise.all(t.map(a=>a.resolve()))).reduce((a,n,o)=>Object.assign(a,{[t[o].route.id]:n}),{})}async function Bn(e,t,r,a,n,o,l,s,c,f){let v=o.map(y=>y.route.lazy?In(y.route,c,s):void 0),E=o.map((y,L)=>{let M=v[L],C=n.some(T=>T.route.id===y.route.id);return{...y,shouldLoad:C,resolve:async T=>(T&&a.method==="GET"&&(y.route.lazy||y.route.loader)&&(C=!0),C?Wn(t,a,y,M,T,f):Promise.resolve({type:"data",result:void 0}))}}),R=await e({matches:E,request:a,params:o[0].params,fetcherKey:l,context:f});try{await Promise.all(v)}catch{}return R}async function Wn(e,t,r,a,n,o){let l,s,c=f=>{let v,E=new Promise((L,M)=>v=M);s=()=>v(),t.signal.addEventListener("abort",s);let R=L=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${r.route.id}]`)):f({request:t,params:r.params,context:o},...L!==void 0?[L]:[]),y=(async()=>{try{return{type:"data",result:await(n?n(M=>R(M)):R())}}catch(L){return{type:"error",result:L}}})();return Promise.race([y,E])};try{let f=r.route[e];if(a)if(f){let v,[E]=await Promise.all([c(f).catch(R=>{v=R}),a]);if(v!==void 0)throw v;l=E}else if(await a,f=r.route[e],f)l=await c(f);else if(e==="action"){let v=new URL(t.url),E=v.pathname+v.search;throw ce(405,{method:t.method,pathname:E,routeId:r.route.id})}else return{type:"data",result:void 0};else if(f)l=await c(f);else{let v=new URL(t.url),E=v.pathname+v.search;throw ce(404,{pathname:E})}}catch(f){return{type:"error",result:f}}finally{s&&t.signal.removeEventListener("abort",s)}return l}async function Yn(e){let{result:t,type:r}=e;if(_r(t)){let a;try{let n=t.headers.get("Content-Type");n&&/\bapplication\/json\b/.test(n)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(n){return{type:"error",error:n}}return r==="error"?{type:"error",error:new vt(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:"data",data:a,statusCode:t.status,headers:t.headers}}return r==="error"?yr(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new vt(t.init?.status||500,void 0,t.data),statusCode:et(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:et(t)?t.status:void 0}:yr(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Vn(e,t,r,a,n){let o=e.headers.get("Location");if(I(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!$t.test(o)){let l=a.slice(0,a.findIndex(s=>s.route.id===r)+1);o=Mt(new URL(t.url),l,n,o),e.headers.set("Location",o)}return e}function fr(e,t,r){if($t.test(e)){let a=e,n=a.startsWith("//")?new URL(t.protocol+a):new URL(a),o=pe(n.pathname,r)!=null;if(n.origin===t.origin&&o)return n.pathname+n.search+n.hash}return e}function Be(e,t,r,a){let n=e.createURL(Mr(t)).toString(),o={signal:r};if(a&&me(a.formMethod)){let{formMethod:l,formEncType:s}=a;o.method=l.toUpperCase(),s==="application/json"?(o.headers=new Headers({"Content-Type":s}),o.body=JSON.stringify(a.json)):s==="text/plain"?o.body=a.text:s==="application/x-www-form-urlencoded"&&a.formData?o.body=Ot(a.formData):o.body=a.formData}return new Request(n,o)}function Ot(e){let t=new URLSearchParams;for(let[r,a]of e.entries())t.append(r,typeof a=="string"?a:a.name);return t}function dr(e){let t=new FormData;for(let[r,a]of e.entries())t.append(r,a);return t}function Kn(e,t,r,a=!1,n=!1){let o={},l=null,s,c=!1,f={},v=r&&se(r[1])?r[1].error:void 0;return e.forEach(E=>{if(!(E.route.id in t))return;let R=E.route.id,y=t[R];if(I(!Fe(y),"Cannot handle redirect results in processLoaderData"),se(y)){let L=y.error;if(v!==void 0&&(L=v,v=void 0),l=l||{},n)l[R]=L;else{let M=ke(e,R);l[M.route.id]==null&&(l[M.route.id]=L)}a||(o[R]=Tr),c||(c=!0,s=et(y.error)?y.error.status:500),y.headers&&(f[R]=y.headers)}else o[R]=y.data,y.statusCode&&y.statusCode!==200&&!c&&(s=y.statusCode),y.headers&&(f[R]=y.headers)}),v!==void 0&&r&&(l={[r[0]]:v},o[r[0]]=void 0),{loaderData:o,errors:l,statusCode:s||200,loaderHeaders:f}}function hr(e,t,r,a,n,o){let{loaderData:l,errors:s}=Kn(t,r,a);return n.forEach(c=>{let{key:f,match:v,controller:E}=c,R=o[f];if(I(R,"Did not find corresponding fetcher result"),!(E&&E.signal.aborted))if(se(R)){let y=ke(e.matches,v?.route.id);s&&s[y.route.id]||(s={...s,[y.route.id]:R.error}),e.fetchers.delete(f)}else if(Fe(R))I(!1,"Unhandled fetcher revalidation redirect");else{let y=xe(R.data);e.fetchers.set(f,y)}}),{loaderData:l,errors:s}}function mr(e,t,r,a){let n=Object.entries(t).filter(([,o])=>o!==Tr).reduce((o,[l,s])=>(o[l]=s,o),{});for(let o of r){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(n[l]=e[l]),a&&a.hasOwnProperty(l))break}return n}function pr(e){return e?se(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ke(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function vr(e){let t=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function ce(e,{pathname:t,routeId:r,method:a,type:n,message:o}={}){let l="Unknown Server Error",s="Unknown @remix-run/router error";return e===400?(l="Bad Request",a&&t&&r?s=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:n==="invalid-body"&&(s="Unable to encode submission body")):e===403?(l="Forbidden",s=`Route "${r}" does not match URL "${t}"`):e===404?(l="Not Found",s=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",a&&t&&r?s=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:a&&(s=`Invalid request method "${a.toUpperCase()}"`)),new vt(e||500,l,new Error(s),!0)}function ut(e){let t=Object.entries(e);for(let r=t.length-1;r>=0;r--){let[a,n]=t[r];if(Fe(n))return{key:a,result:n}}}function Mr(e){let t=typeof e=="string"?De(e):e;return Te({...t,hash:""})}function Jn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Gn(e){return _r(e.result)&&An.has(e.result.status)}function se(e){return e.type==="error"}function Fe(e){return(e&&e.type)==="redirect"}function yr(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function _r(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function qn(e){return On.has(e.toUpperCase())}function me(e){return Mn.has(e.toUpperCase())}function Nt(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qe(e,t){let r=typeof t=="string"?De(t).search:t.search;if(e[e.length-1].route.index&&Nt(r||""))return e[e.length-1];let a=Sr(e);return a[a.length-1]}function gr(e){let{formMethod:t,formAction:r,formEncType:a,text:n,formData:o,json:l}=e;if(!(!t||!r||!a)){if(n!=null)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:void 0,text:n};if(o!=null)return{formMethod:t,formAction:r,formEncType:a,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:r,formEncType:a,formData:void 0,json:l,text:void 0}}}function Tt(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Xn(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qe(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Qn(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function xe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Zn(e,t){try{let r=e.sessionStorage.getItem(Lr);if(r){let a=JSON.parse(r);for(let[n,o]of Object.entries(a||{}))o&&Array.isArray(o)&&t.set(n,new Set(o||[]))}}catch{}}function ea(e,t){if(t.size>0){let r={};for(let[a,n]of t)r[a]=[...n];try{e.sessionStorage.setItem(Lr,JSON.stringify(r))}catch(a){ne(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function ta(){let e,t,r=new Promise((a,n)=>{e=async o=>{a(o);try{await r}catch{}},t=async o=>{n(o);try{await r}catch{}}});return{promise:r,resolve:e,reject:t}}var Ue=m.createContext(null);Ue.displayName="DataRouter";var tt=m.createContext(null);tt.displayName="DataRouterState";var kt=m.createContext({isTransitioning:!1});kt.displayName="ViewTransition";var Or=m.createContext(new Map);Or.displayName="Fetchers";var ra=m.createContext(null);ra.displayName="Await";var ve=m.createContext(null);ve.displayName="Navigation";var wt=m.createContext(null);wt.displayName="Location";var fe=m.createContext({outlet:null,matches:[],isDataRoute:!1});fe.displayName="Route";var Ft=m.createContext(null);Ft.displayName="RouteError";function na(e,{relative:t}={}){I(We(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=m.useContext(ve),{hash:n,pathname:o,search:l}=rt(e,{relative:t}),s=o;return r!=="/"&&(s=o==="/"?r:ge([r,o])),a.createHref({pathname:s,search:l,hash:n})}function We(){return m.useContext(wt)!=null}function Ce(){return I(We(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(wt).location}var Ar="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function $r(e){m.useContext(ve).static||m.useLayoutEffect(e)}function Ut(){let{isDataRoute:e}=m.useContext(fe);return e?ga():aa()}function aa(){I(We(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(Ue),{basename:t,navigator:r}=m.useContext(ve),{matches:a}=m.useContext(fe),{pathname:n}=Ce(),o=JSON.stringify(yt(a)),l=m.useRef(!1);return $r(()=>{l.current=!0}),m.useCallback((c,f={})=>{if(ne(l.current,Ar),!l.current)return;if(typeof c=="number"){r.go(c);return}let v=gt(c,JSON.parse(o),n,f.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:ge([t,v.pathname])),(f.replace?r.replace:r.push)(v,f.state,f)},[t,r,o,n,e])}var oa=m.createContext(null);function ia(e){let t=m.useContext(fe).outlet;return t&&m.createElement(oa.Provider,{value:e},t)}function so(){let{matches:e}=m.useContext(fe),t=e[e.length-1];return t?t.params:{}}function rt(e,{relative:t}={}){let{matches:r}=m.useContext(fe),{pathname:a}=Ce(),n=JSON.stringify(yt(r));return m.useMemo(()=>gt(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function la(e,t,r,a){I(We(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n,static:o}=m.useContext(ve),{matches:l}=m.useContext(fe),s=l[l.length-1],c=s?s.params:{},f=s?s.pathname:"/",v=s?s.pathnameBase:"/",E=s&&s.route;{let T=E&&E.path||"";Nr(f,!E||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
3
+
4
+ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let R=Ce(),y;y=R;let L=y.pathname||"/",M=L;if(v!=="/"){let T=v.replace(/^\//,"").split("/");M="/"+L.replace(/^\//,"").split("/").slice(T.length).join("/")}let C=!o&&r&&r.matches&&r.matches.length>0?r.matches:Le(e,{pathname:M});return ne(E||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),ne(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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.`),da(C&&C.map(T=>Object.assign({},T,{params:Object.assign({},c,T.params),pathname:ge([v,n.encodeLocation?n.encodeLocation(T.pathname).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?v:ge([v,n.encodeLocation?n.encodeLocation(T.pathnameBase).pathname:T.pathnameBase])})),l,r,a)}function sa(){let e=ya(),t=et(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:o},"ErrorBoundary")," or"," ",m.createElement("code",{style:o},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),r?m.createElement("pre",{style:n},r):null,l)}var ua=m.createElement(sa,null),ca=class extends m.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?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?m.createElement(fe.Provider,{value:this.props.routeContext},m.createElement(Ft.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function fa({routeContext:e,match:t,children:r}){let a=m.useContext(Ue);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(fe.Provider,{value:e},r)}function da(e,t=[],r=null,a=null){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 n=e,o=r?.errors;if(o!=null){let c=n.findIndex(f=>f.route.id&&o?.[f.route.id]!==void 0);I(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let l=!1,s=-1;if(r)for(let c=0;c<n.length;c++){let f=n[c];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(s=c),f.route.id){let{loaderData:v,errors:E}=r,R=f.route.loader&&!v.hasOwnProperty(f.route.id)&&(!E||E[f.route.id]===void 0);if(f.route.lazy||R){l=!0,s>=0?n=n.slice(0,s+1):n=[n[0]];break}}}return n.reduceRight((c,f,v)=>{let E,R=!1,y=null,L=null;r&&(E=o&&f.route.id?o[f.route.id]:void 0,y=f.route.errorElement||ua,l&&(s<0&&v===0?(Nr("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,L=null):s===v&&(R=!0,L=f.route.hydrateFallbackElement||null)));let M=t.concat(n.slice(0,v+1)),C=()=>{let P;return E?P=y:R?P=L:f.route.Component?P=m.createElement(f.route.Component,null):f.route.element?P=f.route.element:P=c,m.createElement(fa,{match:f,routeContext:{outlet:c,matches:M,isDataRoute:r!=null},children:P})};return r&&(f.route.ErrorBoundary||f.route.errorElement||v===0)?m.createElement(ca,{location:r.location,revalidation:r.revalidation,component:y,error:E,children:C(),routeContext:{outlet:null,matches:M,isDataRoute:!0}}):C()},null)}function jt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ha(e){let t=m.useContext(Ue);return I(t,jt(e)),t}function ma(e){let t=m.useContext(tt);return I(t,jt(e)),t}function pa(e){let t=m.useContext(fe);return I(t,jt(e)),t}function Ht(e){let t=pa(e),r=t.matches[t.matches.length-1];return I(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function va(){return Ht("useRouteId")}function ya(){let e=m.useContext(Ft),t=ma("useRouteError"),r=Ht("useRouteError");return e!==void 0?e:t.errors?.[r]}function ga(){let{router:e}=ha("useNavigate"),t=Ht("useNavigate"),r=m.useRef(!1);return $r(()=>{r.current=!0}),m.useCallback(async(n,o={})=>{ne(r.current,Ar),r.current&&(typeof n=="number"?e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var wr={};function Nr(e,t,r){!t&&!wr[e]&&(wr[e]=!0,ne(!1,r))}var Er={};function Rr(e,t){!e&&!Er[t]&&(Er[t]=!0,console.warn(t))}function wa(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&ne(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:m.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&ne(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&ne(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Ea=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",t(r))}})}};function uo({router:e,flushSync:t}){let[r,a]=m.useState(e.state),[n,o]=m.useState(),[l,s]=m.useState({isTransitioning:!1}),[c,f]=m.useState(),[v,E]=m.useState(),[R,y]=m.useState(),L=m.useRef(new Map),M=m.useCallback((N,{deletedFetchers:W,flushSync:B,viewTransitionOpts:h})=>{N.fetchers.forEach((Y,j)=>{Y.data!==void 0&&L.current.set(j,Y.data)}),W.forEach(Y=>L.current.delete(Y)),Rr(B===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let _=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Rr(h==null||_,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!h||!_){t&&B?t(()=>a(N)):m.startTransition(()=>a(N));return}if(t&&B){t(()=>{v&&(c&&c.resolve(),v.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:h.currentLocation,nextLocation:h.nextLocation})});let Y=e.window.document.startViewTransition(()=>{t(()=>a(N))});Y.finished.finally(()=>{t(()=>{f(void 0),E(void 0),o(void 0),s({isTransitioning:!1})})}),t(()=>E(Y));return}v?(c&&c.resolve(),v.skipTransition(),y({state:N,currentLocation:h.currentLocation,nextLocation:h.nextLocation})):(o(N),s({isTransitioning:!0,flushSync:!1,currentLocation:h.currentLocation,nextLocation:h.nextLocation}))},[e.window,t,v,c]);m.useLayoutEffect(()=>e.subscribe(M),[e,M]),m.useEffect(()=>{l.isTransitioning&&!l.flushSync&&f(new Ea)},[l]),m.useEffect(()=>{if(c&&n&&e.window){let N=n,W=c.promise,B=e.window.document.startViewTransition(async()=>{m.startTransition(()=>a(N)),await W});B.finished.finally(()=>{f(void 0),E(void 0),o(void 0),s({isTransitioning:!1})}),E(B)}},[n,c,e.window]),m.useEffect(()=>{c&&n&&r.location.key===n.location.key&&c.resolve()},[c,v,r.location,n]),m.useEffect(()=>{!l.isTransitioning&&R&&(o(R.state),s({isTransitioning:!0,flushSync:!1,currentLocation:R.currentLocation,nextLocation:R.nextLocation}),y(void 0))},[l.isTransitioning,R]);let C=m.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:N=>e.navigate(N),push:(N,W,B)=>e.navigate(N,{state:W,preventScrollReset:B?.preventScrollReset}),replace:(N,W,B)=>e.navigate(N,{replace:!0,state:W,preventScrollReset:B?.preventScrollReset})}),[e]),P=e.basename||"/",T=m.useMemo(()=>({router:e,navigator:C,static:!1,basename:P}),[e,C,P]);return m.createElement(m.Fragment,null,m.createElement(Ue.Provider,{value:T},m.createElement(tt.Provider,{value:r},m.createElement(Or.Provider,{value:L.current},m.createElement(kt.Provider,{value:l},m.createElement(Ca,{basename:P,location:r.location,navigationType:r.historyAction,navigator:C},m.createElement(Ra,{routes:e.routes,future:e.future,state:r})))))),null)}var Ra=m.memo(ba);function ba({routes:e,future:t,state:r}){return la(e,void 0,r,t)}function co({to:e,replace:t,state:r,relative:a}){I(We(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n}=m.useContext(ve);ne(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=m.useContext(fe),{pathname:l}=Ce(),s=Ut(),c=gt(e,yt(o),l,a==="path"),f=JSON.stringify(c);return m.useEffect(()=>{s(JSON.parse(f),{replace:t,state:r,relative:a})},[s,f,a,t,r]),null}function fo(e){return ia(e.context)}function Ca({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1}){I(!We(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=m.useMemo(()=>({basename:l,navigator:n,static:o,future:{}}),[l,n,o]);typeof r=="string"&&(r=De(r));let{pathname:c="/",search:f="",hash:v="",state:E=null,key:R="default"}=r,y=m.useMemo(()=>{let L=pe(c,l);return L==null?null:{location:{pathname:L,search:f,hash:v,state:E,key:R},navigationType:a}},[l,c,f,v,E,R,a]);return ne(y!=null,`<Router basename="${l}"> is not able to match the URL "${c}${f}${v}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:m.createElement(ve.Provider,{value:s},m.createElement(wt.Provider,{children:t,value:y}))}var dt="get",ht="application/x-www-form-urlencoded";function Et(e){return e!=null&&typeof e.tagName=="string"}function Pa(e){return Et(e)&&e.tagName.toLowerCase()==="button"}function Sa(e){return Et(e)&&e.tagName.toLowerCase()==="form"}function xa(e){return Et(e)&&e.tagName.toLowerCase()==="input"}function La(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ta(e,t){return e.button===0&&(!t||t==="_self")&&!La(e)}function At(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Da(e,t){let r=At(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var ct=null;function Ma(){if(ct===null)try{new FormData(document.createElement("form"),0),ct=!1}catch{ct=!0}return ct}var _a=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dt(e){return e!=null&&!_a.has(e)?(ne(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ht}"`),null):e}function Oa(e,t){let r,a,n,o,l;if(Sa(e)){let s=e.getAttribute("action");a=s?pe(s,t):null,r=e.getAttribute("method")||dt,n=Dt(e.getAttribute("enctype"))||ht,o=new FormData(e)}else if(Pa(e)||xa(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||s.getAttribute("action");if(a=c?pe(c,t):null,r=e.getAttribute("formmethod")||s.getAttribute("method")||dt,n=Dt(e.getAttribute("formenctype"))||Dt(s.getAttribute("enctype"))||ht,o=new FormData(s,e),!Ma()){let{name:f,type:v,value:E}=e;if(v==="image"){let R=f?`${f}.`:"";o.append(`${R}x`,"0"),o.append(`${R}y`,"0")}else f&&o.append(f,E)}}else{if(Et(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=dt,a=null,n=ht,l=e}return o&&n==="text/plain"&&(l=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:l}}function It(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function Aa(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $a(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 Na(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let l=await Aa(o,r);return l.links?l.links():[]}return[]}));return ja(a.flat(1).filter($a).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function br(e,t,r,a,n,o){let l=(c,f)=>r[f]?c.route.id!==r[f].route.id:!0,s=(c,f)=>r[f].pathname!==c.pathname||r[f].route.path?.endsWith("*")&&r[f].params["*"]!==c.params["*"];return o==="assets"?t.filter((c,f)=>l(c,f)||s(c,f)):o==="data"?t.filter((c,f)=>{let v=a.routes[c.route.id];if(!v||!v.hasLoader)return!1;if(l(c,f)||s(c,f))return!0;if(c.route.shouldRevalidate){let E=c.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function ka(e,t){return Fa(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let n=[a.module];return a.imports&&(n=n.concat(a.imports)),n}).flat(1))}function Fa(e){return[...new Set(e)]}function Ua(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function ja(e,t){let r=new Set;return new Set(t),e.reduce((a,n)=>{let o=JSON.stringify(Ua(n));return r.has(o)||(r.add(o),a.push({key:o,link:n})),a},[])}function Ha(e){let t=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return t.pathname==="/"?t.pathname="_root.data":t.pathname=`${t.pathname.replace(/\/$/,"")}.data`,t}function Ia(){let e=m.useContext(Ue);return It(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function za(){let e=m.useContext(tt);return It(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var zt=m.createContext(void 0);zt.displayName="FrameworkContext";function kr(){let e=m.useContext(zt);return It(e,"You must render this element inside a <HydratedRouter> element"),e}function Ba(e,t){let r=m.useContext(zt),[a,n]=m.useState(!1),[o,l]=m.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:f,onMouseLeave:v,onTouchStart:E}=t,R=m.useRef(null);m.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let M=P=>{P.forEach(T=>{l(T.isIntersecting)})},C=new IntersectionObserver(M,{threshold:.5});return R.current&&C.observe(R.current),()=>{C.disconnect()}}},[e]),m.useEffect(()=>{if(a){let M=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(M)}}},[a]);let y=()=>{n(!0)},L=()=>{n(!1),l(!1)};return r?e!=="intent"?[o,R,{}]:[o,R,{onFocus:Xe(s,y),onBlur:Xe(c,L),onMouseEnter:Xe(f,y),onMouseLeave:Xe(v,L),onTouchStart:Xe(E,y)}]:[!1,R,{}]}function Xe(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function Wa({page:e,...t}){let{router:r}=Ia(),a=m.useMemo(()=>Le(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?m.createElement(Va,{page:e,matches:a,...t}):null}function Ya(e){let{manifest:t,routeModules:r}=kr(),[a,n]=m.useState([]);return m.useEffect(()=>{let o=!1;return Na(e,t,r).then(l=>{o||n(l)}),()=>{o=!0}},[e,t,r]),a}function Va({page:e,matches:t,...r}){let a=Ce(),{manifest:n,routeModules:o}=kr(),{loaderData:l,matches:s}=za(),c=m.useMemo(()=>br(e,t,s,n,a,"data"),[e,t,s,n,a]),f=m.useMemo(()=>br(e,t,s,n,a,"assets"),[e,t,s,n,a]),v=m.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let y=new Set,L=!1;if(t.forEach(C=>{let P=n.routes[C.route.id];!P||!P.hasLoader||(!c.some(T=>T.route.id===C.route.id)&&C.route.id in l&&o[C.route.id]?.shouldRevalidate||P.hasClientLoader?L=!0:y.add(C.route.id))}),y.size===0)return[];let M=Ha(e);return L&&y.size>0&&M.searchParams.set("_routes",t.filter(C=>y.has(C.route.id)).map(C=>C.route.id).join(",")),[M.pathname+M.search]},[l,a,n,c,t,e,o]),E=m.useMemo(()=>ka(f,n),[f,n]),R=Ya(f);return m.createElement(m.Fragment,null,v.map(y=>m.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),E.map(y=>m.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),R.map(({key:y,link:L})=>m.createElement("link",{key:y,...L})))}function Ka(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var Fr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Fr&&(window.__reactRouterVersion="7.1.5")}catch{}function ho(e,t){return Fn({basename:t?.basename,future:t?.future,history:ln({window:t?.window}),hydrationData:Ja(),routes:e,mapRouteProperties:wa,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function Ja(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ga(e.errors)}),e}function Ga(e){if(!e)return null;let t=Object.entries(e),r={};for(let[a,n]of t)if(n&&n.__type==="RouteErrorResponse")r[a]=new vt(n.status,n.statusText,n.data,n.internal===!0);else if(n&&n.__type==="Error"){if(n.__subType){let o=window[n.__subType];if(typeof o=="function")try{let l=new o(n.message);l.stack="",r[a]=l}catch{}}if(r[a]==null){let o=new Error(n.message);o.stack="",r[a]=o}}else r[a]=n;return r}var Ur=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,jr=m.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:l,state:s,target:c,to:f,preventScrollReset:v,viewTransition:E,...R},y){let{basename:L}=m.useContext(ve),M=typeof f=="string"&&Ur.test(f),C,P=!1;if(typeof f=="string"&&M&&(C=f,Fr))try{let j=new URL(window.location.href),Z=f.startsWith("//")?new URL(j.protocol+f):new URL(f),te=pe(Z.pathname,L);Z.origin===j.origin&&te!=null?f=te+Z.search+Z.hash:P=!0}catch{ne(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=na(f,{relative:n}),[N,W,B]=Ba(a,R),h=Za(f,{replace:l,state:s,target:c,preventScrollReset:v,relative:n,viewTransition:E});function _(j){t&&t(j),j.defaultPrevented||h(j)}let Y=m.createElement("a",{...R,...B,href:C||T,onClick:P||o?t:_,ref:Ka(y,W),target:c,"data-discover":!M&&r==="render"?"true":void 0});return N&&!M?m.createElement(m.Fragment,null,Y,m.createElement(Wa,{page:T})):Y});jr.displayName="Link";var qa=m.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:l,viewTransition:s,children:c,...f},v){let E=rt(l,{relative:f.relative}),R=Ce(),y=m.useContext(tt),{navigator:L,basename:M}=m.useContext(ve),C=y!=null&&ao(E)&&s===!0,P=L.encodeLocation?L.encodeLocation(E).pathname:E.pathname,T=R.pathname,N=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;r||(T=T.toLowerCase(),N=N?N.toLowerCase():null,P=P.toLowerCase()),N&&M&&(N=pe(N,M)||N);const W=P!=="/"&&P.endsWith("/")?P.length-1:P.length;let B=T===P||!n&&T.startsWith(P)&&T.charAt(W)==="/",h=N!=null&&(N===P||!n&&N.startsWith(P)&&N.charAt(P.length)==="/"),_={isActive:B,isPending:h,isTransitioning:C},Y=B?t:void 0,j;typeof a=="function"?j=a(_):j=[a,B?"active":null,h?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let Z=typeof o=="function"?o(_):o;return m.createElement(jr,{...f,"aria-current":Y,className:j,ref:v,style:Z,to:l,viewTransition:s},typeof c=="function"?c(_):c)});qa.displayName="NavLink";var Xa=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:l=dt,action:s,onSubmit:c,relative:f,preventScrollReset:v,viewTransition:E,...R},y)=>{let L=ro(),M=no(s,{relative:f}),C=l.toLowerCase()==="get"?"get":"post",P=typeof s=="string"&&Ur.test(s),T=N=>{if(c&&c(N),N.defaultPrevented)return;N.preventDefault();let W=N.nativeEvent.submitter,B=W?.getAttribute("formmethod")||l;L(W||N.currentTarget,{fetcherKey:t,method:B,navigate:r,replace:n,state:o,relative:f,preventScrollReset:v,viewTransition:E})};return m.createElement("form",{ref:y,method:C,action:M,onSubmit:a?c:T,...R,"data-discover":!P&&e==="render"?"true":void 0})});Xa.displayName="Form";function Qa(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Hr(e){let t=m.useContext(Ue);return I(t,Qa(e)),t}function Za(e,{target:t,replace:r,state:a,preventScrollReset:n,relative:o,viewTransition:l}={}){let s=Ut(),c=Ce(),f=rt(e,{relative:o});return m.useCallback(v=>{if(Ta(v,t)){v.preventDefault();let E=r!==void 0?r:Te(c)===Te(f);s(e,{replace:E,state:a,preventScrollReset:n,relative:o,viewTransition:l})}},[c,s,f,r,a,t,e,n,o,l])}function mo(e){ne(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=m.useRef(At(e)),r=m.useRef(!1),a=Ce(),n=m.useMemo(()=>Da(a.search,r.current?null:t.current),[a.search]),o=Ut(),l=m.useCallback((s,c)=>{const f=At(typeof s=="function"?s(n):s);r.current=!0,o("?"+f,c)},[o,n]);return[n,l]}var eo=0,to=()=>`__${String(++eo)}__`;function ro(){let{router:e}=Hr("useSubmit"),{basename:t}=m.useContext(ve),r=va();return m.useCallback(async(a,n={})=>{let{action:o,method:l,encType:s,formData:c,body:f}=Oa(a,t);if(n.navigate===!1){let v=n.fetcherKey||to();await e.fetch(v,r,n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:f,formMethod:n.method||l,formEncType:n.encType||s,flushSync:n.flushSync})}else await e.navigate(n.action||o,{preventScrollReset:n.preventScrollReset,formData:c,body:f,formMethod:n.method||l,formEncType:n.encType||s,replace:n.replace,state:n.state,fromRouteId:r,flushSync:n.flushSync,viewTransition:n.viewTransition})},[e,t,r])}function no(e,{relative:t}={}){let{basename:r}=m.useContext(ve),a=m.useContext(fe);I(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...rt(e||".",{relative:t})},l=Ce();if(e==null){o.search=l.search;let s=new URLSearchParams(o.search),c=s.getAll("index");if(c.some(v=>v==="")){s.delete("index"),c.filter(E=>E).forEach(E=>s.append("index",E));let v=s.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:ge([r,o.pathname])),Te(o)}function ao(e,t={}){let r=m.useContext(kt);I(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Hr("useViewTransitionState"),n=rt(e,{relative:t.relative});if(!r.isTransitioning)return!1;let o=pe(r.currentLocation.pathname,a)||r.currentLocation.pathname,l=pe(r.nextLocation.pathname,a)||r.nextLocation.pathname;return pt(n.pathname,l)!=null||pt(n.pathname,o)!=null}new TextEncoder;export{jr as L,co as N,fo as O,on as R,an as a,lo as b,oo as c,io as d,Ce as e,Ut as f,rn as g,qa as h,ya as i,et as j,ho as k,uo as l,mo as m,m as r,so as u};
@@ -0,0 +1 @@
1
+ import{j as e}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{ak as n,y as s,Z as i,aj as d}from"./index-wYNPRVrc.js";import{a1 as c,a2 as u,a3 as m,a4 as p,a5 as x,a6 as f,a7 as g,a8 as v,a9 as h,aa as b,ab as j,ac as w,ad as y,ae as S,af as z}from"./radix-C1kb_NqW.js";function D({...t}){return e.jsx(c,{"data-slot":"select",...t})}function T({...t}){return e.jsx(S,{"data-slot":"select-group",...t})}function U({...t}){return e.jsx(p,{"data-slot":"select-value",...t})}function V({className:t,size:a="default",children:r,...o}){return e.jsxs(u,{"data-slot":"select-trigger","data-size":a,className:s("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...o,children:[r,e.jsx(m,{asChild:!0,children:e.jsx(n,{className:"size-4 opacity-50"})})]})}function G({className:t,children:a,position:r="item-aligned",align:o="center",...l}){return e.jsx(x,{children:e.jsxs(f,{"data-slot":"select-content",className:s("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:o,...l,children:[e.jsx(N,{}),e.jsx(g,{className:s("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(_,{})]})})}function L({className:t,...a}){return e.jsx(z,{"data-slot":"select-label",className:s("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function R({className:t,children:a,...r}){return e.jsxs(v,{"data-slot":"select-item",className:s("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(h,{children:e.jsx(i,{className:"size-4"})})}),e.jsx(b,{children:a})]})}function E({className:t,...a}){return e.jsx(y,{"data-slot":"select-separator",className:s("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function N({className:t,...a}){return e.jsx(j,{"data-slot":"select-scroll-up-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(d,{className:"size-4"})})}function _({className:t,...a}){return e.jsx(w,{"data-slot":"select-scroll-down-button",className:s("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(n,{className:"size-4"})})}export{D as S,V as a,U as b,G as c,R as d,E as e,T as f,L as g};
@@ -0,0 +1,2 @@
1
+ import{j as f}from"./tanstack-Bs3zYPPV.js";import{r as k}from"./react-vendor-C2CvUxFh.js";import{y as w}from"./index-wYNPRVrc.js";class V{diff(e,t,r={}){let n;typeof r=="function"?(n=r,r={}):"callback"in r&&(n=r.callback);const l=this.castInput(e,r),i=this.castInput(t,r),o=this.removeEmpty(this.tokenize(l,r)),u=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(o,u,r,n)}diffWithOptionsObj(e,t,r,n){var l;const i=d=>{if(d=this.postProcess(d,r),n){setTimeout(function(){n(d)},0);return}else return d},o=t.length,u=e.length;let a=1,c=o+u;r.maxEditLength!=null&&(c=Math.min(c,r.maxEditLength));const y=(l=r.timeout)!==null&&l!==void 0?l:1/0,v=Date.now()+y,p=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(p[0],t,e,0,r);if(p[0].oldPos+1>=u&&m+1>=o)return i(this.buildValues(p[0].lastComponent,t,e));let A=-1/0,E=1/0;const $=()=>{for(let d=Math.max(A,-a);d<=Math.min(E,a);d+=2){let g;const b=p[d-1],j=p[d+1];b&&(p[d-1]=void 0);let W=!1;if(j){const I=j.oldPos-d;W=j&&0<=I&&I<o}const T=b&&b.oldPos+1<u;if(!W&&!T){p[d]=void 0;continue}if(!T||W&&b.oldPos<j.oldPos?g=this.addToPath(j,!0,!1,0,r):g=this.addToPath(b,!1,!0,1,r),m=this.extractCommon(g,t,e,d,r),g.oldPos+1>=u&&m+1>=o)return i(this.buildValues(g.lastComponent,t,e))||!0;p[d]=g,g.oldPos+1>=u&&(E=Math.min(E,d-1)),m+1>=o&&(A=Math.max(A,d+1))}a++};if(n)(function d(){setTimeout(function(){if(a>c||Date.now()>v)return n(void 0);$()||d()},0)})();else for(;a<=c&&Date.now()<=v;){const d=$();if(d)return d}}addToPath(e,t,r,n,l){const i=e.lastComponent;return i&&!l.oneChangePerToken&&i.added===t&&i.removed===r?{oldPos:e.oldPos+n,lastComponent:{count:i.count+1,added:t,removed:r,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:t,removed:r,previousComponent:i}}}extractCommon(e,t,r,n,l){const i=t.length,o=r.length;let u=e.oldPos,a=u-n,c=0;for(;a+1<i&&u+1<o&&this.equals(r[u+1],t[a+1],l);)a++,u++,c++,l.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return c&&!l.oneChangePerToken&&(e.lastComponent={count:c,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=u,a}equals(e,t,r){return r.comparator?r.comparator(e,t):e===t||!!r.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){const t=[];for(let r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,r){const n=[];let l;for(;e;)n.push(e),l=e.previousComponent,delete e.previousComponent,e=l;n.reverse();const i=n.length;let o=0,u=0,a=0;for(;o<i;o++){const c=n[o];if(c.removed)c.value=this.join(r.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&this.useLongestToken){let y=t.slice(u,u+c.count);y=y.map(function(v,p){const m=r[a+p];return m.length>v.length?m:v}),c.value=this.join(y)}else c.value=this.join(t.slice(u,u+c.count));u+=c.count,c.added||(a+=c.count)}}return n}}function O(s,e){let t;for(t=0;t<s.length&&t<e.length;t++)if(s[t]!=e[t])return s.slice(0,t);return s.slice(0,t)}function F(s,e){let t;if(!s||!e||s[s.length-1]!=e[e.length-1])return"";for(t=0;t<s.length&&t<e.length;t++)if(s[s.length-(t+1)]!=e[e.length-(t+1)])return s.slice(-t);return s.slice(-t)}function N(s,e,t){if(s.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't start with prefix ${JSON.stringify(e)}; this is a bug`);return t+s.slice(e.length)}function D(s,e,t){if(!e)return s+t;if(s.slice(-e.length)!=e)throw Error(`string ${JSON.stringify(s)} doesn't end with suffix ${JSON.stringify(e)}; this is a bug`);return s.slice(0,-e.length)+t}function C(s,e){return N(s,e,"")}function S(s,e){return D(s,e,"")}function M(s,e){return e.slice(0,q(s,e))}function q(s,e){let t=0;s.length>e.length&&(t=s.length-e.length);let r=e.length;s.length<e.length&&(r=s.length);const n=Array(r);let l=0;n[0]=0;for(let i=1;i<r;i++){for(e[i]==e[l]?n[i]=n[l]:n[i]=l;l>0&&e[i]!=e[l];)l=n[l];e[i]==e[l]&&l++}l=0;for(let i=t;i<s.length;i++){for(;l>0&&s[i]!=e[l];)l=n[l];s[i]==e[l]&&l++}return l}function P(s){let e;for(e=s.length-1;e>=0&&s[e].match(/\s/);e--);return s.substring(e+1)}function h(s){const e=s.match(/^\s*/);return e?e[0]:""}const z="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",H=new RegExp(`[${z}]+|\\s+|[^${z}]`,"ug");class B extends V{equals(e,t,r){return r.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let r;if(t.intlSegmenter){const i=t.intlSegmenter;if(i.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=[];for(const o of Array.from(i.segment(e))){const u=o.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(u)?r[r.length-1]+=u:r.push(u)}}else r=e.match(H)||[];const n=[];let l=null;return r.forEach(i=>{/\s/.test(i)?l==null?n.push(i):n.push(n.pop()+i):l!=null&&/\s/.test(l)?n[n.length-1]==l?n.push(n.pop()+i):n.push(l+i):n.push(i),l=i}),n}join(e){return e.map((t,r)=>r==0?t:t.replace(/^\s+/,"")).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let r=null,n=null,l=null;return e.forEach(i=>{i.added?n=i:i.removed?l=i:((n||l)&&R(r,l,n,i),r=i,n=null,l=null)}),(n||l)&&R(r,l,n,null),e}}const U=new B;function Y(s,e,t){return U.diff(s,e,t)}function R(s,e,t,r){if(e&&t){const n=h(e.value),l=P(e.value),i=h(t.value),o=P(t.value);if(s){const u=O(n,i);s.value=D(s.value,i,u),e.value=C(e.value,u),t.value=C(t.value,u)}if(r){const u=F(l,o);r.value=N(r.value,o,u),e.value=S(e.value,u),t.value=S(t.value,u)}}else if(t){if(s){const n=h(t.value);t.value=t.value.substring(n.length)}if(r){const n=h(r.value);r.value=r.value.substring(n.length)}}else if(s&&r){const n=h(r.value),l=h(e.value),i=P(e.value),o=O(n,l);e.value=C(e.value,o);const u=F(C(n,o),i);e.value=S(e.value,u),r.value=N(r.value,n,u),s.value=D(s.value,n,n.slice(0,n.length-u.length))}else if(r){const n=h(r.value),l=P(e.value),i=M(l,n);e.value=S(e.value,i)}else if(s){const n=P(s.value),l=h(e.value),i=M(n,l);e.value=C(e.value,i)}}class Z extends V{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}}const G=new Z;function Q(s,e,t){return G.diff(s,e,t)}const X=5;function ce({published:s,draft:e,leftLabel:t="Published",rightLabel:r="Draft"}){const n=k.useMemo(()=>ne(s,e),[s,e]),l=k.useMemo(()=>se(n),[n]);return n.every(i=>i.type==="unchanged")?f.jsxs("p",{className:"text-sm text-muted-foreground italic py-4",children:["No changes between ",t," and ",r," versions."]}):f.jsxs("div",{className:"font-mono text-xs leading-relaxed border rounded-md overflow-hidden",children:[f.jsxs("div",{className:"grid grid-cols-2 border-b bg-muted/50 text-muted-foreground text-[10px] font-semibold",children:[f.jsx("div",{className:"px-3 py-1.5",children:t}),f.jsx("div",{className:"px-3 py-1.5 border-l",children:r})]}),f.jsx("div",{children:l.map((i,o)=>f.jsx(K,{segment:i},o))})]})}function K({segment:s}){const[e,t]=k.useState(!1);return s.type==="collapsed"&&!e?f.jsxs("button",{onClick:()=>t(!0),className:"w-full grid grid-cols-2 text-[10px] text-muted-foreground bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",children:[f.jsxs("div",{className:"px-3 py-1 text-center border-b",children:["... ",s.count," unchanged lines ..."]}),f.jsxs("div",{className:"px-3 py-1 text-center border-l border-b",children:["... ",s.count," unchanged lines ..."]})]}):s.type==="collapsed"?null:f.jsx(f.Fragment,{children:s.rows.map((r,n)=>f.jsx(ee,{row:r},n))})}function _({oldText:s,newText:e,side:t}){const r=Y(s,e);return f.jsx(f.Fragment,{children:r.map((n,l)=>n.added?t==="right"?f.jsx("span",{className:"font-bold bg-green-200 dark:bg-green-800/50",children:n.value},l):null:n.removed?t==="left"?f.jsx("span",{className:"line-through bg-red-200 dark:bg-red-800/50",children:n.value},l):null:f.jsx("span",{children:n.value},l))})}function ee({row:s}){const e=s.type==="modified";return f.jsxs("div",{className:"grid grid-cols-2 border-b last:border-b-0",children:[f.jsx("div",{className:w("px-3 py-0.5 min-h-[1.5em]",(s.type==="removed"||e)&&"bg-red-50 dark:bg-red-950/30"),style:s.left?{paddingLeft:`calc(0.75rem + ${s.left.indent*1}rem)`}:void 0,children:f.jsx("span",{className:w(s.left?.type==="label"&&"text-muted-foreground font-semibold",s.left?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?f.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"left"}):s.left?.text??""})}),f.jsx("div",{className:w("px-3 py-0.5 min-h-[1.5em] border-l",(s.type==="added"||e)&&"bg-green-50 dark:bg-green-950/30"),style:s.right?{paddingLeft:`calc(0.75rem + ${s.right.indent*1}rem)`}:void 0,children:f.jsx("span",{className:w(s.right?.type==="label"&&"text-muted-foreground font-semibold",s.right?.type==="heading"&&"font-bold"),children:e&&s.left&&s.right?f.jsx(_,{oldText:s.left.text,newText:s.right.text,side:"right"}):s.right?.text??""})})]})}function te(s,e){const t=[],r=new Set;for(const n of s){if(!n.text){t.push({type:"removed",left:n});continue}let l=-1,i=-1;for(let o=0;o<e.length;o++){if(r.has(o)||!e[o].text)continue;let u=1;e[o].indent===n.indent&&u++,e[o].type===n.type&&u++,u>i&&(i=u,l=o)}l>=0?(r.add(l),t.push({type:"modified",left:n,right:e[l]})):t.push({type:"removed",left:n})}for(let n=0;n<e.length;n++)r.has(n)||t.push({type:"added",right:e[n]});return t}function ne(s,e){const t=Q(s,e,{comparator:(n,l)=>n.text===l.text&&n.indent===l.indent&&n.type===l.type}),r=[];for(let n=0;n<t.length;n++){const l=t[n],i=t[n+1];if(l.removed&&i?.added){const o=l.value,u=i.value,a=te(o,u);r.push(...a),n++}else if(l.added)for(const o of l.value)r.push({type:"added",right:o});else if(l.removed)for(const o of l.value)r.push({type:"removed",left:o});else for(const o of l.value)r.push({type:"unchanged",left:o,right:o})}return r}function se(s){const e=[];let t=[];function r(){if(t.length!==0){if(t.length>X){const i=t.slice(0,2),o=t.slice(-2),u=t.length-4;e.push({type:"rows",rows:i}),u>0&&e.push({type:"collapsed",count:u}),e.push({type:"rows",rows:o})}else e.push({type:"rows",rows:t});t=[]}}let n=[];function l(){n.length!==0&&(e.push({type:"rows",rows:n}),n=[])}for(const i of s)i.type==="unchanged"?(l(),t.push(i)):(r(),n.push(i));return l(),r(),e}function J(s,e){if(e==null||e==="")return[{text:"(empty)",indent:0,type:"value"}];switch(s.type){case"text":case"url":case"email":case"date":case"number":case"select":return[{text:String(e),indent:0,type:"value"}];case"textarea":return String(e).split(`
2
+ `).map(t=>({text:t,indent:0,type:"value"}));case"boolean":return[{text:e?"Yes":"No",indent:0,type:"value"}];case"media":return[{text:`[Media: ${e}]`,indent:0,type:"value"}];case"blocks":return L(e);case"array":return ie(s,e);default:return[{text:String(e),indent:0,type:"value"}]}}function fe(s,e,t,r){const n=[];t&&(t.title!==void 0&&(n.push({text:"Title",indent:0,type:"label"}),n.push({text:t.title||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.slug!==void 0&&(n.push({text:"Slug",indent:0,type:"label"}),n.push({text:t.slug||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.snippet!==void 0&&(n.push({text:"Snippet",indent:0,type:"label"}),n.push({text:t.snippet||"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})),t.tags!==void 0&&(n.push({text:"Tags",indent:0,type:"label"}),n.push({text:t.tags.length>0?t.tags.join(", "):"(empty)",indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})));for(const l of s){n.push({text:l.label,indent:0,type:"label"});const i=J(l,e[l.name]);n.push(...i),n.push({text:"",indent:0,type:"empty"})}if(r&&r.defs.length>0)for(const l of r.defs){n.push({text:l.label,indent:0,type:"label"});const i=r.values[l.name]??[];i.length===0?n.push({text:"(empty)",indent:0,type:"value"}):n.push({text:i.map(o=>o.title).join(", "),indent:0,type:"value"}),n.push({text:"",indent:0,type:"empty"})}return n.length>0&&n[n.length-1].type==="empty"&&n.pop(),n}const le=[["bold","**","**"],["italic","_","_"],["underline","__","__"],["strike","~~","~~"],["code","`","`"]];function re(s,e){if(!e||!s)return s;let t=s;for(const[r,n,l]of le)e[r]===!0&&(t=n+t+l);return t}function x(s){return Array.isArray(s)?s.map(e=>typeof e.text=="string"?re(e.text,e.styles):e.type==="link"&&Array.isArray(e.content)?`[${x(e.content)}](${e.href??""})`:"").join(""):""}function L(s,e=0){if(!Array.isArray(s))return[{text:"(empty)",indent:0,type:"value"}];if(s.length===0)return[{text:"(empty)",indent:0,type:"value"}];const t=[];let r=0;for(const n of s){if(typeof n!="object"||n===null)continue;const l=n,i=l.type??"";switch(i!=="numberedListItem"&&(r=0),i){case"paragraph":{const o=x(l.content);t.push({text:o||"",indent:e,type:"value"});break}case"heading":{const o=l.props?.level??1,u="#".repeat(Math.min(o,6))+" ",a=x(l.content);t.push({text:u+a,indent:e,type:"heading"});break}case"bulletListItem":{const o=x(l.content);t.push({text:`- ${o}`,indent:e,type:"list-item"});break}case"numberedListItem":{r++;const o=x(l.content);t.push({text:`${r}. ${o}`,indent:e,type:"list-item"});break}case"image":case"HeadroomImage":{const o=l.props?.alt,u=l.props?.mediaId,a=o||u||"image";t.push({text:`[Image: ${a}]`,indent:e,type:"value"});break}default:{if(l.props&&typeof l.props=="object"){const o=l.props,u=Object.entries(o).filter(([a])=>!["textAlignment","level"].includes(a));if(u.length>0){t.push({text:`[${i}]`,indent:e,type:"label"});for(const[a,c]of u)c==null||c===""||(Array.isArray(c)?(t.push({text:`${a}:`,indent:e+1,type:"label"}),t.push(...L(c,e+2))):t.push({text:`${a}: ${String(c)}`,indent:e+1,type:"value"}))}else t.push({text:`[${i}]`,indent:e,type:"value"})}else{const o=x(l.content);o&&t.push({text:o,indent:e,type:"value"})}break}}Array.isArray(l.children)&&l.children.length>0&&t.push(...L(l.children,e+1))}return t}function ie(s,e){if(!Array.isArray(e)||e.length===0)return[{text:"(empty)",indent:0,type:"value"}];const r=s.options?.itemFields??[],n=[];for(let l=0;l<e.length;l++){n.push({text:`${l+1}.`,indent:0,type:"list-item"});const i=e[l];if(r.length>0)for(const o of r){n.push({text:o.label+":",indent:1,type:"label"});const u=J(o,i[o.name]);n.push(...u.map(a=>({...a,indent:a.indent+1})))}else n.push({text:JSON.stringify(i,null,2),indent:1,type:"value"})}return n}export{ce as T,Q as d,fe as s};
@@ -0,0 +1 @@
1
+ import{r as g,R as j}from"./react-vendor-C2CvUxFh.js";import{f as ue,g as de,h as k,d as le,b as fe,i as ge,j as pe,C as q,k as ve,K as E}from"./core.esm-B_kcYf6n.js";function B(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function be(e,n){return e.reduce((t,r,s)=>{const a=n.get(r);return a&&(t[s]=a),t},Array(e.length))}function N(e){return e!==null&&e>=0}function me(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ie(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const F=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const a=B(n,r,t),o=n[s],i=a[s];return!i||!o?null:{x:i.left-o.left,y:i.top-o.top,scaleX:i.width/o.width,scaleY:i.height/o.height}},A={scaleX:1,scaleY:1},Ne=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:a,overIndex:o}=e;const i=(n=a[t])!=null?n:r;if(!i)return null;if(s===t){const u=a[o];return u?{x:0,y:t<o?u.top+u.height-(i.top+i.height):u.top-i.top,...A}:null}const l=xe(a,s,t);return s>t&&s<=o?{x:0,y:-i.height-l,...A}:s<t&&s>=o?{x:0,y:i.height+l,...A}:{x:0,y:0,...A}};function xe(e,n,t){const r=e[n],s=e[n-1],a=e[n+1];return r?t<n?s?r.top-(s.top+s.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const H="Sortable",U=j.createContext({activeIndex:-1,containerId:H,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:F,disabled:{draggable:!1,droppable:!1}});function Ae(e){let{children:n,id:t,items:r,strategy:s=F,disabled:a=!1}=e;const{active:o,dragOverlay:i,droppableRects:l,over:u,measureDroppableContainers:c}=ue(),v=de(H,t),m=i.rect!==null,f=g.useMemo(()=>r.map(I=>typeof I=="object"&&"id"in I?I.id:I),[r]),T=o!=null,y=o?f.indexOf(o.id):-1,b=u?f.indexOf(u.id):-1,O=g.useRef(f),R=!me(f,O.current),D=b!==-1&&y===-1||R,p=Ie(a);k(()=>{R&&T&&c(f)},[R,f,T,c]),g.useEffect(()=>{O.current=f},[f]);const S=g.useMemo(()=>({activeIndex:y,containerId:v,disabled:p,disableTransforms:D,items:f,overIndex:b,useDragOverlay:m,sortedRects:be(f,l),strategy:s}),[y,v,p.draggable,p.droppable,D,f,b,l,m,s]);return j.createElement(U.Provider,{value:S},n)}const he=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return B(t,r,s).indexOf(n)},ye=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:a,newIndex:o,previousItems:i,previousContainerId:l,transition:u}=e;return!u||!r||i!==a&&s===o?!1:t?!0:o!==s&&n===l},Re={duration:200,easing:"ease"},V="transform",De=q.Transition.toString({property:V,duration:0,easing:"linear"}),Se={roleDescription:"sortable"};function Ce(e){let{disabled:n,index:t,node:r,rect:s}=e;const[a,o]=g.useState(null),i=g.useRef(t);return k(()=>{if(!n&&t!==i.current&&r.current){const l=s.current;if(l){const u=ve(r.current,{ignoreTransform:!0}),c={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(c.x||c.y)&&o(c)}}t!==i.current&&(i.current=t)},[n,t,r,s]),g.useEffect(()=>{a&&o(null)},[a]),a}function Le(e){let{animateLayoutChanges:n=ye,attributes:t,disabled:r,data:s,getNewIndex:a=he,id:o,strategy:i,resizeObserverConfig:l,transition:u=Re}=e;const{items:c,containerId:v,activeIndex:m,disabled:f,disableTransforms:T,sortedRects:y,overIndex:b,useDragOverlay:O,strategy:R}=g.useContext(U),D=we(r,f),p=c.indexOf(o),S=g.useMemo(()=>({sortable:{containerId:v,index:p,items:c},...s}),[v,s,p,c]),I=g.useMemo(()=>c.slice(c.indexOf(o)),[c,o]),{rect:$,node:z,isOver:J,setNodeRef:P}=le({id:o,data:S,disabled:D.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...l}}),{active:C,activatorEvent:Q,activeNodeRect:W,attributes:Z,setNodeRef:X,listeners:ee,isDragging:L,over:te,setActivatorNodeRef:re,transform:ne}=fe({id:o,data:S,attributes:{...Se,...t},disabled:D.draggable}),se=ge(P,X),x=!!C,_=x&&!T&&N(m)&&N(b),G=!O&&L,K=G&&_?ne:null,oe=_?K??(i??R)({rects:y,activeNodeRect:W,activeIndex:m,overIndex:b,index:p}):null,w=N(m)&&N(b)?a({id:o,items:c,activeIndex:m,overIndex:b}):p,h=C?.id,d=g.useRef({activeId:h,items:c,newIndex:w,containerId:v}),ae=c!==d.current.items,Y=n({active:C,containerId:v,isDragging:L,isSorting:x,id:o,index:p,items:c,newIndex:d.current.newIndex,previousItems:d.current.items,previousContainerId:d.current.containerId,transition:u,wasDragging:d.current.activeId!=null}),M=Ce({disabled:!Y,index:p,node:z,rect:$});return g.useEffect(()=>{x&&d.current.newIndex!==w&&(d.current.newIndex=w),v!==d.current.containerId&&(d.current.containerId=v),c!==d.current.items&&(d.current.items=c)},[x,w,v,c]),g.useEffect(()=>{if(h===d.current.activeId)return;if(h!=null&&d.current.activeId==null){d.current.activeId=h;return}const ce=setTimeout(()=>{d.current.activeId=h},50);return()=>clearTimeout(ce)},[h]),{active:C,activeIndex:m,attributes:Z,data:S,rect:$,index:p,newIndex:w,items:c,isOver:J,isSorting:x,isDragging:L,listeners:ee,node:z,overIndex:b,over:te,setNodeRef:se,setActivatorNodeRef:re,setDroppableNodeRef:P,setDraggableNodeRef:X,transform:M??oe,transition:ie()};function ie(){if(M||ae&&d.current.newIndex===p)return De;if(!(G&&!pe(Q)||!u)&&(x||Y))return q.Transition.toString({...u,property:V})}}function we(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}E.Down,E.Right,E.Up,E.Left;export{Ae as S,B as a,Le as u,Ne as v};
@@ -1 +1 @@
1
- import{j as t}from"./tanstack-oFmRhGwV.js";import"./react-vendor-B0Dih9Pj.js";import{w as l}from"./index-DX9xeoQx.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function d({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function c({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,d as a,b,i as c,c as d,m as e};
1
+ import{j as t}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as l}from"./index-wYNPRVrc.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function d({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function c({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,d as a,b,i as c,c as d,m as e};
@@ -1 +1 @@
1
- import{r as y}from"./react-vendor-B0Dih9Pj.js";var _={exports:{}},A={};var tt;function St(){if(tt)return A;tt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var n in r)n!=="key"&&(a[n]=r[n])}else a=r;return r=a.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:a}}return A.Fragment=e,A.jsx=s,A.jsxs=s,A}var et;function Ft(){return et||(et=1,_.exports=St()),_.exports}var Et=Ft(),T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},E=typeof window>"u"||"Deno"in globalThis;function b(){}function Mt(t,e){return typeof t=="function"?t(e):t}function H(t){return typeof t=="number"&&t>=0&&t!==1/0}function ht(t,e){return Math.max(t+(e||0)-Date.now(),0)}function D(t,e){return typeof t=="function"?t(e):t}function P(t,e){return typeof t=="function"?t(e):t}function st(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:n}=t;if(o){if(i){if(e.queryHash!==$(o,e.options))return!1}else if(!q(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof n=="boolean"&&e.isStale()!==n||r&&r!==e.state.fetchStatus||a&&!a(e))}function it(t,e){const{exact:s,status:i,predicate:r,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(M(e.options.mutationKey)!==M(a))return!1}else if(!q(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function $(t,e){return(e?.queryKeyHashFn||M)(t)}function M(t){return JSON.stringify(t,(e,s)=>N(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function q(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!q(t[s],e[s])):!1}function ct(t,e){if(t===e)return t;const s=rt(t)&&rt(e);if(s||N(t)&&N(e)){const i=s?t:Object.keys(t),r=i.length,a=s?e:Object.keys(e),o=a.length,n=s?[]:{};let u=0;for(let l=0;l<o;l++){const h=s?l:a[l];(!s&&i.includes(h)||s)&&t[h]===void 0&&e[h]===void 0?(n[h]=void 0,u++):(n[h]=ct(t[h],e[h]),n[h]===t[h]&&t[h]!==void 0&&u++)}return r===o&&u===r?t:n}return e}function j(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function rt(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function N(t){if(!nt(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!nt(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nt(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qt(t){return new Promise(e=>{setTimeout(e,t)})}function G(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?ct(t,e):e}function xt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Dt(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var V=Symbol();function lt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===V?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Tt=class extends T{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Y=new Tt,At=class extends T{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},k=new At;function B(){let t,e;const s=new Promise((r,a)=>{t=r,e=a});s.status="pending",s.catch(()=>{});function i(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},s.reject=r=>{i({status:"rejected",reason:r}),e(r)},s}function qt(t){return Math.min(1e3*2**t,3e4)}function ft(t){return(t??"online")==="online"?k.isOnline():!0}var dt=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function K(t){return t instanceof dt}function pt(t){let e=!1,s=0,i=!1,r;const a=B(),o=c=>{i||(f(new dt(c)),t.abort?.())},n=()=>{e=!0},u=()=>{e=!1},l=()=>Y.isFocused()&&(t.networkMode==="always"||k.isOnline())&&t.canRun(),h=()=>ft(t.networkMode)&&t.canRun(),O=c=>{i||(i=!0,t.onSuccess?.(c),r?.(),a.resolve(c))},f=c=>{i||(i=!0,t.onError?.(c),r?.(),a.reject(c))},w=()=>new Promise(c=>{r=g=>{(i||l())&&c(g)},t.onPause?.()}).then(()=>{r=void 0,i||t.onContinue?.()}),p=()=>{if(i)return;let c;const g=s===0?t.initialPromise:void 0;try{c=g??t.fn()}catch(v){c=Promise.reject(v)}Promise.resolve(c).then(O).catch(v=>{if(i)return;const R=t.retry??(E?0:3),S=t.retryDelay??qt,F=typeof S=="function"?S(s,v):S,Z=R===!0||typeof R=="number"&&s<R||typeof R=="function"&&R(s,v);if(e||!Z){f(v);return}s++,t.onFail?.(s,v),Qt(F).then(()=>l()?void 0:w()).then(()=>{e?f(v):p()})})};return{promise:a,cancel:o,continue:()=>(r?.(),a),cancelRetry:n,continueRetry:u,canStart:h,start:()=>(h()?p():w().then(p),a)}}function It(){let t=[],e=0,s=n=>{n()},i=n=>{n()},r=n=>setTimeout(n,0);const a=n=>{e?t.push(n):r(()=>{s(n)})},o=()=>{const n=t;t=[],n.length&&r(()=>{i(()=>{n.forEach(u=>{s(u)})})})};return{batch:n=>{let u;e++;try{u=n()}finally{e--,e||o()}return u},batchCalls:n=>(...u)=>{a(()=>{n(...u)})},schedule:a,setNotifyFunction:n=>{s=n},setBatchNotifyFunction:n=>{i=n},setScheduler:n=>{r=n}}}var d=It(),yt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(E?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Ut=class extends yt{#e;#t;#s;#i;#a;#n;constructor(t){super(),this.#n=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#s=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=jt(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=G(this.state.data,t,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#r({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>P(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ht(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#n?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const n=this.observers.find(u=>u.options.queryFn);n&&this.setOptions(n.options)}const s=new AbortController,i=n=>{Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(this.#n=!0,s.signal)})},r=()=>{const n=lt(this.options,e),u={queryKey:this.queryKey,meta:this.meta};return i(u),this.#n=!1,this.options.persister?this.options.persister(n,u,this):n(u)},a={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(a),this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#r({type:"fetch",meta:a.fetchOptions?.meta});const o=n=>{K(n)&&n.silent||this.#r({type:"error",error:n}),K(n)||(this.#s.config.onError?.(n,this),this.#s.config.onSettled?.(this.state.data,n,this)),this.scheduleGc()};return this.#i=pt({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:n=>{if(n===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(n)}catch(u){o(u);return}this.#s.config.onSuccess?.(n,this),this.#s.config.onSettled?.(n,this.state.error,this),this.scheduleGc()},onError:o,onFail:(n,u)=>{this.#r({type:"failed",failureCount:n,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#r(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...vt(s.data,this.options),fetchMeta:t.meta??null};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return K(i)&&i.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),d.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function vt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var kt=class extends T{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,s){const i=e.queryKey,r=e.queryHash??$(i,e);let a=this.get(r);return a||(a=new Ut({cache:this,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){d.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>st(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>st(t,s)):e}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){d.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){d.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lt=class extends yt{#e;#t;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||mt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){this.#s=pt({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,r)=>{this.#i({type:"failed",failureCount:i,error:r})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const e=this.state.status==="pending",s=!this.#s.canStart();try{if(!e){this.#i({type:"pending",variables:t,isPaused:s}),await this.#t.config.onMutate?.(t,this);const r=await this.options.onMutate?.(t);r!==this.state.context&&this.#i({type:"pending",context:r,variables:t,isPaused:s})}const i=await this.#s.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#i({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#i({type:"error",error:i})}}finally{this.#t.runNext(this)}}#i(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),d.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _t=class extends T{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(t,e,s){const i=new Lt({mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);s?s.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=U(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=U(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){d.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>it(e,s))}findAll(t={}){return this.getAll().filter(e=>it(t,e))}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return d.batch(()=>Promise.all(t.map(e=>e.continue().catch(b))))}};function U(t){return t.options.scope?.id}function L(t){return{onFetch:(e,s)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let n={pages:[],pageParams:[]},u=0;const l=async()=>{let h=!1;const O=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},f=lt(e.options,e.fetchOptions),w=async(p,c,g)=>{if(h)return Promise.reject();if(c==null&&p.pages.length)return Promise.resolve(p);const v={queryKey:e.queryKey,pageParam:c,direction:g?"backward":"forward",meta:e.options.meta};O(v);const R=await f(v),{maxPages:S}=e.options,F=g?Dt:xt;return{pages:F(p.pages,R,S),pageParams:F(p.pageParams,c,S)}};if(r&&a.length){const p=r==="backward",c=p?gt:z,g={pages:a,pageParams:o},v=c(i,g);n=await w(g,v,p)}else{const p=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:z(i,n);if(u>0&&c==null)break;n=await w(n,c),u++}while(u<p)}return n};e.options.persister?e.fetchFn=()=>e.options.persister?.(l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function z(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function gt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function Kt(t,e){return e?z(t,e)!=null:!1}function Ht(t,e){return!e||!t.getPreviousPageParam?!1:gt(t,e)!=null}var re=class{#e;#t;#s;#i;#a;#n;#r;#o;constructor(t={}){this.#e=t.queryCache||new kt,this.#t=t.mutationCache||new _t,this.#s=t.defaultOptions||{},this.#i=new Map,this.#a=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#r=Y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=k.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#r?.(),this.#r=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#e.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(D(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(i.queryHash)?.state.data,o=Mt(e,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return d.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;d.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#e,i={type:"active",...t};return d.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=d.batch(()=>this.#e.findAll(t).map(r=>r.cancel(s)));return Promise.all(i).then(b).catch(b)}invalidateQueries(t,e={}){return d.batch(()=>{if(this.#e.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none")return Promise.resolve();const s={...t,type:t?.refetchType??t?.type??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=d.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()).map(r=>{let a=r.fetch(void 0,s);return s.throwOnError||(a=a.catch(b)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(b)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#e.build(this,e);return s.isStaleByTime(D(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(b).catch(b)}fetchInfiniteQuery(t){return t.behavior=L(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(b).catch(b)}ensureInfiniteQueryData(t){return t.behavior=L(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return k.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#i.set(M(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{q(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#a.set(M(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#a.values()];let s={};return e.forEach(i=>{q(t,i.mutationKey)&&(s={...s,...i.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=$(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===V&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bt=class extends T{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#r=B(),this.options.experimental_prefetchInRender||this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#a;#n;#r;#o;#y;#f;#d;#h;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),at(this.#t,this.options)?this.#l():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#R(),this.#t.removeObserver(this)}setOptions(t,e){const s=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof P(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),s._defaulted&&!j(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&ot(this.#t,i,this.options,s)&&this.#l(),this.updateResult(e),r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(s.staleTime,this.#t))&&this.#v();const a=this.#m();r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||a!==this.#u)&&this.#g(a)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return Gt(this,s)&&(this.#i=s,this.#n=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){const s={};return Object.keys(t).forEach(i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})}),s}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(b)),e}#v(){this.#O();const t=D(this.options.staleTime,this.#t);if(E||this.#i.isStale||!H(t))return;const s=ht(this.#i.dataUpdatedAt,t)+1;this.#h=setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(t){this.#R(),this.#u=t,!(E||P(this.options.enabled,this.#t)===!1||!H(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Y.isFocused())&&this.#l()},this.#u))}#b(){this.#v(),this.#g(this.#m())}#O(){this.#h&&(clearTimeout(this.#h),this.#h=void 0)}#R(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#i,a=this.#a,o=this.#n,u=t!==s?t.state:this.#s,{state:l}=t;let h={...l},O=!1,f;if(e._optimisticResults){const m=this.hasListeners(),Q=!m&&at(t,e),x=m&&ot(t,s,e,i);(Q||x)&&(h={...h,...vt(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:p,status:c}=h;if(e.select&&h.data!==void 0)if(r&&h.data===a?.data&&e.select===this.#y)f=this.#f;else try{this.#y=e.select,f=e.select(h.data),f=G(r?.data,f,e),this.#f=f,this.#o=null}catch(m){this.#o=m}else f=h.data;if(e.placeholderData!==void 0&&f===void 0&&c==="pending"){let m;if(r?.isPlaceholderData&&e.placeholderData===o?.placeholderData)m=r.data;else if(m=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,e.select&&m!==void 0)try{m=e.select(m),this.#o=null}catch(Q){this.#o=Q}m!==void 0&&(c="success",f=G(r?.data,m,e),O=!0)}this.#o&&(w=this.#o,f=this.#f,p=Date.now(),c="error");const g=h.fetchStatus==="fetching",v=c==="pending",R=c==="error",S=v&&g,F=f!==void 0,C={status:c,fetchStatus:h.fetchStatus,isPending:v,isSuccess:c==="success",isError:R,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:R&&!F,isPaused:h.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:R&&F,isStale:X(t,e),refetch:this.refetch,promise:this.#r};if(this.options.experimental_prefetchInRender){const m=I=>{C.status==="error"?I.reject(C.error):C.data!==void 0&&I.resolve(C.data)},Q=()=>{const I=this.#r=C.promise=B();m(I)},x=this.#r;switch(x.status){case"pending":t.queryHash===s.queryHash&&m(x);break;case"fulfilled":(C.status==="error"||C.data!==x.value)&&Q();break;case"rejected":(C.status!=="error"||C.error!==x.reason)&&Q();break}}return C}updateResult(t){const e=this.#i,s=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#n=this.options,this.#a.data!==void 0&&(this.#d=this.#t),j(s,e))return;this.#i=s;const i={},r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#p.size)return!0;const n=new Set(o??this.#p);return this.options.throwOnError&&n.add("error"),Object.keys(this.#i).some(u=>{const l=u;return this.#i[l]!==e[l]&&n.has(l)})};t?.listeners!==!1&&r()&&(i.listeners=!0),this.#C({...i,...t})}#P(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){d.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Nt(t,e){return P(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function at(t,e){return Nt(t,e)||t.state.data!==void 0&&J(t,e,e.refetchOnMount)}function J(t,e,s){if(P(e.enabled,t)!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&X(t,e)}return!1}function ot(t,e,s,i){return(t!==e||P(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&X(t,s)}function X(t,e){return P(e.enabled,t)!==!1&&t.isStaleByTime(D(e.staleTime,t))}function Gt(t,e){return!j(t.getCurrentResult(),e)}var Bt=class extends bt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:L()},e)}getOptimisticResult(t){return t.behavior=L(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:s}=t,i=super.createResult(t,e),{isFetching:r,isRefetching:a,isError:o,isRefetchError:n}=i,u=s.fetchMeta?.fetchMore?.direction,l=o&&u==="forward",h=r&&u==="forward",O=o&&u==="backward",f=r&&u==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Kt(e,s.data),hasPreviousPage:Ht(e,s.data),isFetchNextPageError:l,isFetchingNextPage:h,isFetchPreviousPageError:O,isFetchingPreviousPage:f,isRefetchError:n&&!l&&!O,isRefetching:a&&!h&&!f}}},zt=class extends T{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),j(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&M(e.mutationKey)!==M(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#n(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#a(),this.#n()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#a(){const t=this.#s?.state??mt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#n(t){d.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context;t?.type==="success"?(this.#i.onSuccess?.(t.data,e,s),this.#i.onSettled?.(t.data,null,e,s)):t?.type==="error"&&(this.#i.onError?.(t.error,e,s),this.#i.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach(e=>{e(this.#t)})})}},Ot=y.createContext(void 0),Rt=t=>{const e=y.useContext(Ot);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ne=({client:t,children:e})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Et.jsx(Ot.Provider,{value:t,children:e})),Pt=y.createContext(!1),Jt=()=>y.useContext(Pt);Pt.Provider;function Wt(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var $t=y.createContext(Wt()),Vt=()=>y.useContext($t);function Ct(t,e){return typeof t=="function"?t(...e):!!t}function W(){}var Yt=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Xt=t=>{y.useEffect(()=>{t.clearReset()},[t])},Zt=({result:t,errorResetBoundary:e,throwOnError:s,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&Ct(s,[t.error,i]),te=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...s)=>Math.max(e(...s),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},ee=(t,e)=>t.isLoading&&t.isFetching&&!e,se=(t,e)=>t?.suspense&&e.isPending,ut=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function wt(t,e,s){const i=Rt(),r=Jt(),a=Vt(),o=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?"isRestoring":"optimistic",te(o),Yt(o,a),Xt(a);const n=!i.getQueryCache().get(o.queryHash),[u]=y.useState(()=>new e(i,o)),l=u.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(h=>{const O=r?W:u.subscribe(d.batchCalls(h));return u.updateResult(),O},[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),se(o,l))throw ut(o,u,a);if(Zt({result:l,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash)}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!E&&ee(l,r)&&(n?ut(o,u,a):i.getQueryCache().get(o.queryHash)?.promise)?.catch(W).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?l:u.trackResult(l)}function ae(t,e){return wt(t,bt)}function oe(t,e){const s=Rt(),[i]=y.useState(()=>new zt(s,t));y.useEffect(()=>{i.setOptions(t)},[i,t]);const r=y.useSyncExternalStore(y.useCallback(o=>i.subscribe(d.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=y.useCallback((o,n)=>{i.mutate(o,n).catch(W)},[i]);if(r.error&&Ct(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}function ue(t,e){return wt(t,Bt)}export{re as Q,Rt as a,oe as b,ne as c,ue as d,Et as j,ae as u};
1
+ import{r as y}from"./react-vendor-C2CvUxFh.js";var _={exports:{}},A={};var tt;function St(){if(tt)return A;tt=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function s(i,r,a){var o=null;if(a!==void 0&&(o=""+a),r.key!==void 0&&(o=""+r.key),"key"in r){a={};for(var n in r)n!=="key"&&(a[n]=r[n])}else a=r;return r=a.ref,{$$typeof:t,type:i,key:o,ref:r!==void 0?r:null,props:a}}return A.Fragment=e,A.jsx=s,A.jsxs=s,A}var et;function Ft(){return et||(et=1,_.exports=St()),_.exports}var Et=Ft(),T=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},E=typeof window>"u"||"Deno"in globalThis;function b(){}function Mt(t,e){return typeof t=="function"?t(e):t}function H(t){return typeof t=="number"&&t>=0&&t!==1/0}function ht(t,e){return Math.max(t+(e||0)-Date.now(),0)}function D(t,e){return typeof t=="function"?t(e):t}function P(t,e){return typeof t=="function"?t(e):t}function st(t,e){const{type:s="all",exact:i,fetchStatus:r,predicate:a,queryKey:o,stale:n}=t;if(o){if(i){if(e.queryHash!==$(o,e.options))return!1}else if(!q(e.queryKey,o))return!1}if(s!=="all"){const u=e.isActive();if(s==="active"&&!u||s==="inactive"&&u)return!1}return!(typeof n=="boolean"&&e.isStale()!==n||r&&r!==e.state.fetchStatus||a&&!a(e))}function it(t,e){const{exact:s,status:i,predicate:r,mutationKey:a}=t;if(a){if(!e.options.mutationKey)return!1;if(s){if(M(e.options.mutationKey)!==M(a))return!1}else if(!q(e.options.mutationKey,a))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function $(t,e){return(e?.queryKeyHashFn||M)(t)}function M(t){return JSON.stringify(t,(e,s)=>N(s)?Object.keys(s).sort().reduce((i,r)=>(i[r]=s[r],i),{}):s)}function q(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(s=>!q(t[s],e[s])):!1}function ct(t,e){if(t===e)return t;const s=rt(t)&&rt(e);if(s||N(t)&&N(e)){const i=s?t:Object.keys(t),r=i.length,a=s?e:Object.keys(e),o=a.length,n=s?[]:{};let u=0;for(let l=0;l<o;l++){const h=s?l:a[l];(!s&&i.includes(h)||s)&&t[h]===void 0&&e[h]===void 0?(n[h]=void 0,u++):(n[h]=ct(t[h],e[h]),n[h]===t[h]&&t[h]!==void 0&&u++)}return r===o&&u===r?t:n}return e}function j(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function rt(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function N(t){if(!nt(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!nt(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function nt(t){return Object.prototype.toString.call(t)==="[object Object]"}function Qt(t){return new Promise(e=>{setTimeout(e,t)})}function G(t,e,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,e):s.structuralSharing!==!1?ct(t,e):e}function xt(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function Dt(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var V=Symbol();function lt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===V?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Tt=class extends T{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Y=new Tt,At=class extends T{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!E&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},k=new At;function B(){let t,e;const s=new Promise((r,a)=>{t=r,e=a});s.status="pending",s.catch(()=>{});function i(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{i({status:"fulfilled",value:r}),t(r)},s.reject=r=>{i({status:"rejected",reason:r}),e(r)},s}function qt(t){return Math.min(1e3*2**t,3e4)}function ft(t){return(t??"online")==="online"?k.isOnline():!0}var dt=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function K(t){return t instanceof dt}function pt(t){let e=!1,s=0,i=!1,r;const a=B(),o=c=>{i||(f(new dt(c)),t.abort?.())},n=()=>{e=!0},u=()=>{e=!1},l=()=>Y.isFocused()&&(t.networkMode==="always"||k.isOnline())&&t.canRun(),h=()=>ft(t.networkMode)&&t.canRun(),O=c=>{i||(i=!0,t.onSuccess?.(c),r?.(),a.resolve(c))},f=c=>{i||(i=!0,t.onError?.(c),r?.(),a.reject(c))},w=()=>new Promise(c=>{r=g=>{(i||l())&&c(g)},t.onPause?.()}).then(()=>{r=void 0,i||t.onContinue?.()}),p=()=>{if(i)return;let c;const g=s===0?t.initialPromise:void 0;try{c=g??t.fn()}catch(v){c=Promise.reject(v)}Promise.resolve(c).then(O).catch(v=>{if(i)return;const R=t.retry??(E?0:3),S=t.retryDelay??qt,F=typeof S=="function"?S(s,v):S,Z=R===!0||typeof R=="number"&&s<R||typeof R=="function"&&R(s,v);if(e||!Z){f(v);return}s++,t.onFail?.(s,v),Qt(F).then(()=>l()?void 0:w()).then(()=>{e?f(v):p()})})};return{promise:a,cancel:o,continue:()=>(r?.(),a),cancelRetry:n,continueRetry:u,canStart:h,start:()=>(h()?p():w().then(p),a)}}function It(){let t=[],e=0,s=n=>{n()},i=n=>{n()},r=n=>setTimeout(n,0);const a=n=>{e?t.push(n):r(()=>{s(n)})},o=()=>{const n=t;t=[],n.length&&r(()=>{i(()=>{n.forEach(u=>{s(u)})})})};return{batch:n=>{let u;e++;try{u=n()}finally{e--,e||o()}return u},batchCalls:n=>(...u)=>{a(()=>{n(...u)})},schedule:a,setNotifyFunction:n=>{s=n},setBatchNotifyFunction:n=>{i=n},setScheduler:n=>{r=n}}}var d=It(),yt=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),H(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(E?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Ut=class extends yt{#e;#t;#s;#i;#a;#n;constructor(t){super(),this.#n=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#s=t.cache,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=jt(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){this.options={...this.#a,...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#s.remove(this)}setData(t,e){const s=G(this.state.data,t,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#r({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(b).catch(b):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>P(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!ht(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#n?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#s.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}fetch(t,e){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const n=this.observers.find(u=>u.options.queryFn);n&&this.setOptions(n.options)}const s=new AbortController,i=n=>{Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(this.#n=!0,s.signal)})},r=()=>{const n=lt(this.options,e),u={queryKey:this.queryKey,meta:this.meta};return i(u),this.#n=!1,this.options.persister?this.options.persister(n,u,this):n(u)},a={fetchOptions:e,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(a),this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#r({type:"fetch",meta:a.fetchOptions?.meta});const o=n=>{K(n)&&n.silent||this.#r({type:"error",error:n}),K(n)||(this.#s.config.onError?.(n,this),this.#s.config.onSettled?.(this.state.data,n,this)),this.scheduleGc()};return this.#i=pt({initialPromise:e?.initialPromise,fn:a.fetchFn,abort:s.abort.bind(s),onSuccess:n=>{if(n===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(n)}catch(u){o(u);return}this.#s.config.onSuccess?.(n,this),this.#s.config.onSettled?.(n,this.state.error,this),this.scheduleGc()},onError:o,onFail:(n,u)=>{this.#r({type:"failed",failureCount:n,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}),this.#i.start()}#r(t){const e=s=>{switch(t.type){case"failed":return{...s,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...vt(s.data,this.options),fetchMeta:t.meta??null};case"success":return{...s,data:t.data,dataUpdateCount:s.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return K(i)&&i.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...s,error:i,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...t.state}}};this.state=e(this.state),d.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#s.notify({query:this,type:"updated",action:t})})}};function vt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ft(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jt(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,s=e!==void 0,i=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var kt=class extends T{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,s){const i=e.queryKey,r=e.queryHash??$(i,e);let a=this.get(r);return a||(a=new Ut({cache:this,queryKey:i,queryHash:r,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){d.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(s=>st(e,s))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(s=>st(t,s)):e}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){d.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){d.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Lt=class extends yt{#e;#t;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#t=t.mutationCache,this.#e=[],this.state=t.state||mt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){this.#s=pt({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(i,r)=>{this.#i({type:"failed",failureCount:i,error:r})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const e=this.state.status==="pending",s=!this.#s.canStart();try{if(!e){this.#i({type:"pending",variables:t,isPaused:s}),await this.#t.config.onMutate?.(t,this);const r=await this.options.onMutate?.(t);r!==this.state.context&&this.#i({type:"pending",context:r,variables:t,isPaused:s})}const i=await this.#s.start();return await this.#t.config.onSuccess?.(i,t,this.state.context,this),await this.options.onSuccess?.(i,t,this.state.context),await this.#t.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,t,this.state.context),this.#i({type:"success",data:i}),i}catch(i){try{throw await this.#t.config.onError?.(i,t,this.state.context,this),await this.options.onError?.(i,t,this.state.context),await this.#t.config.onSettled?.(void 0,i,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,i,t,this.state.context),i}finally{this.#i({type:"error",error:i})}}finally{this.#t.runNext(this)}}#i(t){const e=s=>{switch(t.type){case"failed":return{...s,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...s,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:t.error,failureCount:s.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),d.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(t)}),this.#t.notify({mutation:this,type:"updated",action:t})})}};function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _t=class extends T{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#s=0}#e;#t;#s;build(t,e,s){const i=new Lt({mutationCache:this,mutationId:++this.#s,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);s?s.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=U(t);if(typeof e=="string"){const s=this.#t.get(e);if(s)if(s.length>1){const i=s.indexOf(t);i!==-1&&s.splice(i,1)}else s[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=U(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(r=>r.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=U(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){d.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(s=>it(e,s))}findAll(t={}){return this.getAll().filter(e=>it(t,e))}notify(t){d.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return d.batch(()=>Promise.all(t.map(e=>e.continue().catch(b))))}};function U(t){return t.options.scope?.id}function L(t){return{onFetch:(e,s)=>{const i=e.options,r=e.fetchOptions?.meta?.fetchMore?.direction,a=e.state.data?.pages||[],o=e.state.data?.pageParams||[];let n={pages:[],pageParams:[]},u=0;const l=async()=>{let h=!1;const O=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},f=lt(e.options,e.fetchOptions),w=async(p,c,g)=>{if(h)return Promise.reject();if(c==null&&p.pages.length)return Promise.resolve(p);const v={queryKey:e.queryKey,pageParam:c,direction:g?"backward":"forward",meta:e.options.meta};O(v);const R=await f(v),{maxPages:S}=e.options,F=g?Dt:xt;return{pages:F(p.pages,R,S),pageParams:F(p.pageParams,c,S)}};if(r&&a.length){const p=r==="backward",c=p?gt:z,g={pages:a,pageParams:o},v=c(i,g);n=await w(g,v,p)}else{const p=t??a.length;do{const c=u===0?o[0]??i.initialPageParam:z(i,n);if(u>0&&c==null)break;n=await w(n,c),u++}while(u<p)}return n};e.options.persister?e.fetchFn=()=>e.options.persister?.(l,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=l}}}function z(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function gt(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}function Kt(t,e){return e?z(t,e)!=null:!1}function Ht(t,e){return!e||!t.getPreviousPageParam?!1:gt(t,e)!=null}var re=class{#e;#t;#s;#i;#a;#n;#r;#o;constructor(t={}){this.#e=t.queryCache||new kt,this.#t=t.mutationCache||new _t,this.#s=t.defaultOptions||{},this.#i=new Map,this.#a=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#r=Y.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=k.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#r?.(),this.#r=void 0,this.#o?.(),this.#o=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#e.build(this,e),i=s.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(D(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:s})=>{const i=s.data;return[e,i]})}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#e.get(i.queryHash)?.state.data,o=Mt(e,a);if(o!==void 0)return this.#e.build(this,i).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return d.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;d.batch(()=>{e.findAll(t).forEach(s=>{e.remove(s)})})}resetQueries(t,e){const s=this.#e,i={type:"active",...t};return d.batch(()=>(s.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries(i,e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=d.batch(()=>this.#e.findAll(t).map(r=>r.cancel(s)));return Promise.all(i).then(b).catch(b)}invalidateQueries(t,e={}){return d.batch(()=>{if(this.#e.findAll(t).forEach(i=>{i.invalidate()}),t?.refetchType==="none")return Promise.resolve();const s={...t,type:t?.refetchType??t?.type??"active"};return this.refetchQueries(s,e)})}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=d.batch(()=>this.#e.findAll(t).filter(r=>!r.isDisabled()).map(r=>{let a=r.fetch(void 0,s);return s.throwOnError||(a=a.catch(b)),r.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(b)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const s=this.#e.build(this,e);return s.isStaleByTime(D(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(b).catch(b)}fetchInfiniteQuery(t){return t.behavior=L(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(b).catch(b)}ensureInfiniteQueryData(t){return t.behavior=L(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return k.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#s}setDefaultOptions(t){this.#s=t}setQueryDefaults(t,e){this.#i.set(M(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#i.values()],s={};return e.forEach(i=>{q(t,i.queryKey)&&Object.assign(s,i.defaultOptions)}),s}setMutationDefaults(t,e){this.#a.set(M(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#a.values()];let s={};return e.forEach(i=>{q(t,i.mutationKey)&&(s={...s,...i.defaultOptions})}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#s.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=$(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===V&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#s.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},bt=class extends T{constructor(t,e){super(),this.options=e,this.#e=t,this.#o=null,this.#r=B(),this.options.experimental_prefetchInRender||this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#a;#n;#r;#o;#y;#f;#d;#h;#c;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),at(this.#t,this.options)?this.#l():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return J(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return J(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#R(),this.#t.removeObserver(this)}setOptions(t,e){const s=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof P(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#P(),this.#t.setOptions(this.options),s._defaulted&&!j(this.options,s)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&ot(this.#t,i,this.options,s)&&this.#l(),this.updateResult(e),r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||D(this.options.staleTime,this.#t)!==D(s.staleTime,this.#t))&&this.#v();const a=this.#m();r&&(this.#t!==i||P(this.options.enabled,this.#t)!==P(s.enabled,this.#t)||a!==this.#u)&&this.#g(a)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return Gt(this,s)&&(this.#i=s,this.#n=this.options,this.#a=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){const s={};return Object.keys(t).forEach(i=>{Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),e?.(i),t[i])})}),s}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#P();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(b)),e}#v(){this.#O();const t=D(this.options.staleTime,this.#t);if(E||this.#i.isStale||!H(t))return;const s=ht(this.#i.dataUpdatedAt,t)+1;this.#h=setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#m(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#g(t){this.#R(),this.#u=t,!(E||P(this.options.enabled,this.#t)===!1||!H(this.#u)||this.#u===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||Y.isFocused())&&this.#l()},this.#u))}#b(){this.#v(),this.#g(this.#m())}#O(){this.#h&&(clearTimeout(this.#h),this.#h=void 0)}#R(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(t,e){const s=this.#t,i=this.options,r=this.#i,a=this.#a,o=this.#n,u=t!==s?t.state:this.#s,{state:l}=t;let h={...l},O=!1,f;if(e._optimisticResults){const m=this.hasListeners(),Q=!m&&at(t,e),x=m&&ot(t,s,e,i);(Q||x)&&(h={...h,...vt(l.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:p,status:c}=h;if(e.select&&h.data!==void 0)if(r&&h.data===a?.data&&e.select===this.#y)f=this.#f;else try{this.#y=e.select,f=e.select(h.data),f=G(r?.data,f,e),this.#f=f,this.#o=null}catch(m){this.#o=m}else f=h.data;if(e.placeholderData!==void 0&&f===void 0&&c==="pending"){let m;if(r?.isPlaceholderData&&e.placeholderData===o?.placeholderData)m=r.data;else if(m=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,e.select&&m!==void 0)try{m=e.select(m),this.#o=null}catch(Q){this.#o=Q}m!==void 0&&(c="success",f=G(r?.data,m,e),O=!0)}this.#o&&(w=this.#o,f=this.#f,p=Date.now(),c="error");const g=h.fetchStatus==="fetching",v=c==="pending",R=c==="error",S=v&&g,F=f!==void 0,C={status:c,fetchStatus:h.fetchStatus,isPending:v,isSuccess:c==="success",isError:R,isInitialLoading:S,isLoading:S,data:f,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:p,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:R&&!F,isPaused:h.fetchStatus==="paused",isPlaceholderData:O,isRefetchError:R&&F,isStale:X(t,e),refetch:this.refetch,promise:this.#r};if(this.options.experimental_prefetchInRender){const m=I=>{C.status==="error"?I.reject(C.error):C.data!==void 0&&I.resolve(C.data)},Q=()=>{const I=this.#r=C.promise=B();m(I)},x=this.#r;switch(x.status){case"pending":t.queryHash===s.queryHash&&m(x);break;case"fulfilled":(C.status==="error"||C.data!==x.value)&&Q();break;case"rejected":(C.status!=="error"||C.error!==x.reason)&&Q();break}}return C}updateResult(t){const e=this.#i,s=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#n=this.options,this.#a.data!==void 0&&(this.#d=this.#t),j(s,e))return;this.#i=s;const i={},r=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#p.size)return!0;const n=new Set(o??this.#p);return this.options.throwOnError&&n.add("error"),Object.keys(this.#i).some(u=>{const l=u;return this.#i[l]!==e[l]&&n.has(l)})};t?.listeners!==!1&&r()&&(i.listeners=!0),this.#C({...i,...t})}#P(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(t){d.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Nt(t,e){return P(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function at(t,e){return Nt(t,e)||t.state.data!==void 0&&J(t,e,e.refetchOnMount)}function J(t,e,s){if(P(e.enabled,t)!==!1){const i=typeof s=="function"?s(t):s;return i==="always"||i!==!1&&X(t,e)}return!1}function ot(t,e,s,i){return(t!==e||P(i.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&X(t,s)}function X(t,e){return P(e.enabled,t)!==!1&&t.isStaleByTime(D(e.staleTime,t))}function Gt(t,e){return!j(t.getCurrentResult(),e)}var Bt=class extends bt{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t,e){super.setOptions({...t,behavior:L()},e)}getOptimisticResult(t){return t.behavior=L(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){const{state:s}=t,i=super.createResult(t,e),{isFetching:r,isRefetching:a,isError:o,isRefetchError:n}=i,u=s.fetchMeta?.fetchMore?.direction,l=o&&u==="forward",h=r&&u==="forward",O=o&&u==="backward",f=r&&u==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Kt(e,s.data),hasPreviousPage:Ht(e,s.data),isFetchNextPageError:l,isFetchingNextPage:h,isFetchPreviousPageError:O,isFetchingPreviousPage:f,isRefetchError:n&&!l&&!O,isRefetching:a&&!h&&!f}}},zt=class extends T{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),j(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&M(e.mutationKey)!==M(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#n(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#a(),this.#n()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#a(){const t=this.#s?.state??mt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#n(t){d.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context;t?.type==="success"?(this.#i.onSuccess?.(t.data,e,s),this.#i.onSettled?.(t.data,null,e,s)):t?.type==="error"&&(this.#i.onError?.(t.error,e,s),this.#i.onSettled?.(void 0,t.error,e,s))}this.listeners.forEach(e=>{e(this.#t)})})}},Ot=y.createContext(void 0),Rt=t=>{const e=y.useContext(Ot);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ne=({client:t,children:e})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Et.jsx(Ot.Provider,{value:t,children:e})),Pt=y.createContext(!1),Jt=()=>y.useContext(Pt);Pt.Provider;function Wt(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var $t=y.createContext(Wt()),Vt=()=>y.useContext($t);function Ct(t,e){return typeof t=="function"?t(...e):!!t}function W(){}var Yt=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Xt=t=>{y.useEffect(()=>{t.clearReset()},[t])},Zt=({result:t,errorResetBoundary:e,throwOnError:s,query:i})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&Ct(s,[t.error,i]),te=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...s)=>Math.max(e(...s),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},ee=(t,e)=>t.isLoading&&t.isFetching&&!e,se=(t,e)=>t?.suspense&&e.isPending,ut=(t,e,s)=>e.fetchOptimistic(t).catch(()=>{s.clearReset()});function wt(t,e,s){const i=Rt(),r=Jt(),a=Vt(),o=i.defaultQueryOptions(t);i.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?"isRestoring":"optimistic",te(o),Yt(o,a),Xt(a);const n=!i.getQueryCache().get(o.queryHash),[u]=y.useState(()=>new e(i,o)),l=u.getOptimisticResult(o);if(y.useSyncExternalStore(y.useCallback(h=>{const O=r?W:u.subscribe(d.batchCalls(h));return u.updateResult(),O},[u,r]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),y.useEffect(()=>{u.setOptions(o,{listeners:!1})},[o,u]),se(o,l))throw ut(o,u,a);if(Zt({result:l,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash)}))throw l.error;return i.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!E&&ee(l,r)&&(n?ut(o,u,a):i.getQueryCache().get(o.queryHash)?.promise)?.catch(W).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?l:u.trackResult(l)}function ae(t,e){return wt(t,bt)}function oe(t,e){const s=Rt(),[i]=y.useState(()=>new zt(s,t));y.useEffect(()=>{i.setOptions(t)},[i,t]);const r=y.useSyncExternalStore(y.useCallback(o=>i.subscribe(d.batchCalls(o)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),a=y.useCallback((o,n)=>{i.mutate(o,n).catch(W)},[i]);if(r.error&&Ct(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:a,mutateAsync:r.mutate}}function ue(t,e){return wt(t,Bt)}export{re as Q,Rt as a,oe as b,ne as c,ue as d,Et as j,ae as u};
@@ -0,0 +1 @@
1
+ import{j as i}from"./tanstack-Bs3zYPPV.js";import"./react-vendor-C2CvUxFh.js";import{y as t}from"./index-wYNPRVrc.js";function s({className:r,...e}){return i.jsx("textarea",{"data-slot":"textarea",className:t("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),...e})}export{s as T};
@@ -0,0 +1 @@
1
+ import{r as t}from"./react-vendor-C2CvUxFh.js";import{aW as n}from"./index-wYNPRVrc.js";function c(o){const r=[...new Set(o)],{data:e}=n(r);return{resolve:t.useCallback(s=>e?.users[s]?.email??s,[e]),isLoaded:!!e}}export{c as u};
@@ -0,0 +1 @@
1
+ import{u as r,a,b as c}from"./tanstack-Bs3zYPPV.js";import{e as u}from"./index-wYNPRVrc.js";function y(e,t,i,n){const s=u(),o=new URLSearchParams({collection:t});return n&&o.set("cursor",n),i?.q&&o.set("q",i.q),i?.search&&o.set("search",i.search),i?.tag&&o.set("tag",i.tag),i?.status&&o.set("status",i.status),i?.sort&&o.set("sort",i.sort),i?.relatedTo&&o.set("relatedTo",i.relatedTo),i?.relField&&o.set("relField",i.relField),r({queryKey:["sites",e,"content",t,i??{},n??""],queryFn:()=>s.apiFetch(`/v1/admin/sites/${e}/content?${o.toString()}`),enabled:!!e&&!!t})}function v(e,t){const i=u(),n=new URLSearchParams;t&&n.set("cursor",t);const s=n.toString();return r({queryKey:["sites",e,"content","__all__",t??""],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content${s?`?${s}`:""}`),enabled:!!e})}function m(e,t){const i=u();return r({queryKey:["sites",e,"content-detail",t],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}`),enabled:!!e&&!!t})}function q(e){const t=u(),i=a();return c({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/content`,{method:"POST",body:JSON.stringify({collection:n.collection,params:{title:n.title,slug:n.slug,body:{}}})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"content"]})})}function p(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/draft`,{method:"PUT",body:JSON.stringify(s)}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function F(e,t,i){const n=u();return r({queryKey:["sites",e,"content-published",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/published`),enabled:!!e&&!!t&&i})}function $(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/publish`,{method:"POST",...s!=null?{body:JSON.stringify({publishDate:s})}:{}}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),n.invalidateQueries({queryKey:["sites",e,"content-published",t]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function S(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/unpublish`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]}),n.invalidateQueries({queryKey:["sites",e,"content-published",t]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function K(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}`,{method:"DELETE"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function f(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/publish-date`,{method:"PATCH",body:JSON.stringify({publishDate:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function b(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/schedule`,{method:"POST",body:JSON.stringify({scheduleAt:s})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function Q(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/unschedule`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function h(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}/publish`,{method:"POST"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function g(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}/unpublish`,{method:"POST"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function P(e){const t=u(),i=a();return c({mutationFn:n=>Promise.allSettled(n.map(s=>t.apiFetch(`/v1/admin/sites/${e}/content/${s}`,{method:"DELETE"}))),onSettled:()=>{i.invalidateQueries({queryKey:["sites",e,"content"]}),i.invalidateQueries({queryKey:["sites",e,"tags"]})}})}function O(e,t){const i=u(),n=a();return c({mutationFn:()=>i.apiFetch(`/v1/admin/sites/${e}/content/${t}/discard`,{method:"POST"}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function C(e,t,i){const n=u();return r({queryKey:["sites",e,"content-detail",t,"versions",i],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions/${i}`),enabled:!!e&&!!t&&!!i})}function T(e,t){const i=u();return r({queryKey:["sites",e,"content-detail",t,"versions"],queryFn:async()=>({items:(await i.apiFetch(`/v1/admin/sites/${e}/content/${t}/versions`)).versions??[]}),enabled:!!e&&!!t})}function U(e){const t=u(),i=a();return c({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/submissions/${n.collection}`,{method:"POST",body:JSON.stringify({fields:n.fields,...n.relationships&&Object.keys(n.relationships).length>0?{relationships:n.relationships}:{}})}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"content"]})})}function D(e,t){const i=u(),n=a();return c({mutationFn:s=>i.apiFetch(`/v1/admin/sites/${e}/submissions/${t}`,{method:"PUT",body:JSON.stringify({fields:s.fields,...s.relationships&&Object.keys(s.relationships).length>0?{relationships:s.relationships}:{}})}),onSuccess:()=>{n.invalidateQueries({queryKey:["sites",e,"content"]}),n.invalidateQueries({queryKey:["sites",e,"content-detail",t]})}})}function J(e,t,i){const n=u();return r({queryKey:["sites",e,"content-references",t],queryFn:()=>n.apiFetch(`/v1/admin/sites/${e}/content/${t}/references`),enabled:!!e&&!!t&&i})}export{h as a,g as b,P as c,y as d,q as e,p as f,F as g,C as h,T as i,m as j,$ as k,S as l,K as m,f as n,b as o,Q as p,O as q,J as r,U as s,D as t,v as u};
@@ -0,0 +1 @@
1
+ import{u as c}from"./tanstack-Bs3zYPPV.js";import{e as f}from"./index-wYNPRVrc.js";function d(n,i,e,s){const m=f(),a=e?.length===1?e[0]:void 0,t=new URLSearchParams;return i?(t.set("q",i),t.set("search","full")):t.set("limit","5"),a&&t.set("collection",a),s&&t.set("status",s),c({queryKey:["sites",n,"content-search",i,e??[],s??""],queryFn:async()=>{const r=await m.apiFetch(`/v1/admin/sites/${n}/content?${t.toString()}`);return e&&e.length>1?{...r,items:r.items.filter(u=>e.includes(u.collection))}:r},enabled:!!n,staleTime:3e4})}export{d as u};
@@ -1 +1 @@
1
- import{r as o}from"./react-vendor-B0Dih9Pj.js";function n(e,t){const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r}export{n as u};
1
+ import{r as o}from"./react-vendor-C2CvUxFh.js";function n(e,t){const[r,u]=o.useState(e);return o.useEffect(()=>{const s=setTimeout(()=>u(e),t);return()=>clearTimeout(s)},[e,t]),r}export{n as u};
@@ -0,0 +1 @@
1
+ import{m as d,r as u}from"./react-vendor-C2CvUxFh.js";function z(t){const[l,i]=d(),c=u.useMemo(()=>{const s={};for(const a of t){const r=l.get(a.key);r!==null?s[a.key]=a.deserialize?a.deserialize(r):r:s[a.key]=a.defaultValue}return s},[l]),f=u.useCallback(s=>{i(a=>{const r=new URLSearchParams(a);for(const e of t){if(!(e.key in s))continue;const n=s[e.key],o=e.serialize?e.serialize(n):String(n??""),m=e.serialize?e.serialize(e.defaultValue):String(e.defaultValue??"");o===m?r.delete(e.key):r.set(e.key,o)}return r},{replace:!0})},[i]);return[c,f]}export{z as u};
@@ -0,0 +1 @@
1
+ import{a as o,b as d,u,d as c}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-wYNPRVrc.js";function m(i,e){const n=a();return u({queryKey:["sites",i,"media","item",e],queryFn:()=>n.apiFetch(`/v1/admin/sites/${i}/media/${e}`),enabled:!!i&&!!e})}function f(i,e){const n=a(),t=new URLSearchParams;e?.tag&&t.set("tag",e.tag),e?.folderId!==void 0&&t.set("folderId",e.folderId),e?.q&&t.set("q",e.q),e?.sort&&t.set("sort",e.sort),e?.limit&&t.set("limit",String(e.limit));const s=t.toString();return u({queryKey:["sites",i,"media",e],queryFn:()=>n.apiFetch(`/v1/admin/sites/${i}/media${s?`?${s}`:""}`),enabled:!!i})}function y(i,e){const n=a();return c({queryKey:["sites",i,"media","infinite",e],queryFn:({pageParam:t})=>{const s=new URLSearchParams;return t&&s.set("cursor",t),e?.tag&&s.set("tag",e.tag),e?.folderId!==void 0&&s.set("folderId",e.folderId),e?.q&&s.set("q",e.q),e?.sort&&s.set("sort",e.sort),e?.limit&&s.set("limit",String(e.limit)),n.apiFetch(`/v1/admin/sites/${i}/media?${s.toString()}`)},initialPageParam:void 0,getNextPageParam:t=>t.hasMore?t.cursor??void 0:void 0,enabled:!!i})}function q(i){const e=a();return d({mutationFn:n=>e.apiFetch(`/v1/admin/sites/${i}/media/upload-url`,{method:"POST",body:JSON.stringify(n)})})}function F(i){const e=a(),n=o();return d({mutationFn:t=>e.apiFetch(`/v1/admin/sites/${i}/media/${t.mediaId}/complete`,{method:"POST",body:JSON.stringify({filename:t.filename,alt:t.alt,caption:t.caption,folderId:t.folderId})}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",i,"media"]})})}function v(i,e){const n=a(),t=o();return d({mutationFn:s=>n.apiFetch(`/v1/admin/sites/${i}/media/${e}`,{method:"PUT",body:JSON.stringify(s)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",i,"media"]})})}function $(i,e){const n=a(),t=o();return d({mutationFn:()=>n.apiFetch(`/v1/admin/sites/${i}/media/${e}`,{method:"DELETE"}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",i,"media"]})})}function S(i){const e=a();return u({queryKey:["sites",i,"media","folders"],queryFn:()=>e.apiFetch(`/v1/admin/sites/${i}/media/folders`),enabled:!!i})}function g(i){const e=a(),n=o();return d({mutationFn:t=>e.apiFetch(`/v1/admin/sites/${i}/media/folders`,{method:"POST",body:JSON.stringify({name:t})}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",i,"media","folders"]})})}function b(i){const e=a(),n=o();return d({mutationFn:({folderId:t,name:s})=>e.apiFetch(`/v1/admin/sites/${i}/media/folders/${t}`,{method:"PUT",body:JSON.stringify({name:s})}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",i,"media","folders"]})})}function h(i){const e=a(),n=o();return d({mutationFn:t=>e.apiFetch(`/v1/admin/sites/${i}/media/folders/${t}`,{method:"DELETE"}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",i,"media","folders"]})})}function K(i){const e=a(),n=o();return d({mutationFn:t=>e.apiFetch(`/v1/admin/sites/${i}/media/bulk`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>n.invalidateQueries({queryKey:["sites",i,"media"]})})}function M(i){const e=a();return d({mutationFn:({filename:n,size:t})=>e.apiFetch(`/v1/admin/sites/${i}/media/check-duplicate?filename=${encodeURIComponent(n)}&size=${t}`)})}function O(i,e){const n=a(),t=o();return d({mutationFn:s=>n.apiFetch(`/v1/admin/sites/${i}/media/${e}/save-transform`,{method:"POST",body:JSON.stringify(s)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",i,"media"]})})}function P(i,e){const n=a();return u({queryKey:["sites",i,"media","usage",e],queryFn:()=>n.apiFetch(`/v1/admin/sites/${i}/media/${e}/usage`),enabled:!!i&&!!e})}export{O as a,v as b,$ as c,P as d,S as e,g as f,b as g,h,q as i,F as j,K as k,M as l,f as m,y as n,m as u};
@@ -0,0 +1 @@
1
+ import{r as o}from"./react-vendor-C2CvUxFh.js";import{b1 as s,V as c}from"./index-wYNPRVrc.js";function f(e){const r=s(),i=c(),n=o.useRef("");o.useEffect(()=>{if(!r)return;const t=`${e.title}|${e.showBack??""}|${e.backTo??""}|${e.badge?.label??""}|${e.badge?.variant??""}|${e.subtitle??""}`;t!==n.current&&(n.current=t,r.setTitleBar(e))}),o.useEffect(()=>{if(e.title){const t=i?.site?.name||i?.site?.host;document.title=t?`${e.title} | ${t}`:e.title}return()=>{document.title="Headroom"}},[e.title,i?.site?.name,i?.site?.host])}export{f as u};
@@ -0,0 +1 @@
1
+ import{u as c,a as r,b as a}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-wYNPRVrc.js";function m(e,t){const i=n(),s=new URLSearchParams;t?.cursor&&s.set("cursor",t.cursor),t?.tag&&s.set("tag",t.tag),t?.limit&&s.set("limit",String(t.limit));const u=s.toString();return c({queryKey:["sites",e,"site-users",u],queryFn:()=>i.apiFetch(`/v1/admin/sites/${e}/site-users${u?`?${u}`:""}`),enabled:!!e})}function y(e){const t=n(),i=r();return a({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/site-users`,{method:"POST",body:JSON.stringify(s)}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function l(e){const t=n(),i=r();return a({mutationFn:({userId:s,...u})=>t.apiFetch(`/v1/admin/sites/${e}/site-users/${s}`,{method:"PUT",body:JSON.stringify(u)}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function S(e){const t=n(),i=r();return a({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/site-users/${s}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"site-users"]})})}function f(e){const t=n();return c({queryKey:["sites",e,"auth"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/auth`),enabled:!!e})}function q(e){const t=n(),i=r();return a({mutationFn:s=>t.apiFetch(`/v1/admin/sites/${e}/auth`,{method:"PUT",body:JSON.stringify(s)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"auth"]}),i.invalidateQueries({queryKey:["sites",e]})}})}function v(e){const t=n();return a({mutationFn:i=>t.apiFetch(`/v1/admin/sites/${e}/auth/test-email`,{method:"POST",body:JSON.stringify({email:i})})})}export{q as a,v as b,m as c,y as d,S as e,l as f,f as u};
@@ -1 +1 @@
1
- import{u as r,a as i,b as u}from"./tanstack-oFmRhGwV.js";import{e as a}from"./index-DX9xeoQx.js";function m(e){const t=a();return r({queryKey:["sites",e,"tags"],queryFn:async()=>(await t.apiFetch(`/v1/admin/sites/${e}/tags`)).tags,enabled:!!e})}function y(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags`,{method:"POST",body:JSON.stringify({tag:n})}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}function d(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}export{y as a,d as b,m as u};
1
+ import{u as r,a as i,b as u}from"./tanstack-Bs3zYPPV.js";import{e as a}from"./index-wYNPRVrc.js";function m(e){const t=a();return r({queryKey:["sites",e,"tags"],queryFn:async()=>(await t.apiFetch(`/v1/admin/sites/${e}/tags`)).tags,enabled:!!e})}function y(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags`,{method:"POST",body:JSON.stringify({tag:n})}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}function d(e){const t=a(),s=i();return u({mutationFn:n=>t.apiFetch(`/v1/admin/sites/${e}/tags/${encodeURIComponent(n)}`,{method:"DELETE"}),onSuccess:()=>s.invalidateQueries({queryKey:["sites",e,"tags"]})})}export{y as a,d as b,m as u};
@@ -1 +1 @@
1
- import{u,a,b as o}from"./tanstack-oFmRhGwV.js";import{e as n}from"./index-DX9xeoQx.js";function y(e){const s=n();return u({queryKey:["sites",e,"webhooks"],queryFn:async()=>({items:(await s.apiFetch(`/v1/admin/sites/${e}/webhooks`)).webhooks}),enabled:!!e})}function d(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`),enabled:!!e&&!!s})}function m(e){const s=n(),t=a();return o({mutationFn:i=>s.apiFetch(`/v1/admin/sites/${e}/webhooks`,{method:"POST",body:JSON.stringify(i)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function h(e,s){const t=n(),i=a();return o({mutationFn:c=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"PUT",body:JSON.stringify(c)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"webhooks"]})}})}function l(e,s){const t=n(),i=a();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function k(e,s){const t=n();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/test`,{method:"POST"})})}function v(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s,"deliveries"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/deliveries`),enabled:!!e&&!!s})}export{d as a,m as b,h as c,l as d,k as e,v as f,y as u};
1
+ import{u,a,b as o}from"./tanstack-Bs3zYPPV.js";import{e as n}from"./index-wYNPRVrc.js";function y(e){const s=n();return u({queryKey:["sites",e,"webhooks"],queryFn:async()=>({items:(await s.apiFetch(`/v1/admin/sites/${e}/webhooks`)).webhooks}),enabled:!!e})}function d(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`),enabled:!!e&&!!s})}function m(e){const s=n(),t=a();return o({mutationFn:i=>s.apiFetch(`/v1/admin/sites/${e}/webhooks`,{method:"POST",body:JSON.stringify(i)}),onSuccess:()=>t.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function h(e,s){const t=n(),i=a();return o({mutationFn:c=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"PUT",body:JSON.stringify(c)}),onSuccess:()=>{i.invalidateQueries({queryKey:["sites",e,"webhooks"]})}})}function l(e,s){const t=n(),i=a();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}`,{method:"DELETE"}),onSuccess:()=>i.invalidateQueries({queryKey:["sites",e,"webhooks"]})})}function k(e,s){const t=n();return o({mutationFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/test`,{method:"POST"})})}function v(e,s){const t=n();return u({queryKey:["sites",e,"webhooks",s,"deliveries"],queryFn:()=>t.apiFetch(`/v1/admin/sites/${e}/webhooks/${s}/deliveries`),enabled:!!e&&!!s})}export{d as a,m as b,h as c,l as d,k as e,v as f,y as u};
Binary file
Binary file