@baseplate-dev/project-builder-web 0.2.6 → 0.3.0

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 (194) hide show
  1. package/dist/assets/-constants-C0cnDlAn.js +4 -0
  2. package/dist/assets/-constants-C0cnDlAn.js.map +1 -0
  3. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-BCejYgPM.js +2 -0
  4. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/{web-CEscUEnR.js.map → web-BCejYgPM.js.map} +1 -1
  5. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BxDAWgq7.js +2 -0
  6. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BxDAWgq7.js.map +1 -0
  7. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-D6OnTPTN.js +46 -0
  8. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-D6OnTPTN.js.map +1 -0
  9. package/dist/assets/__federation_shared_@baseplate-dev/utils-DvvrgoSE.js +5 -0
  10. package/dist/assets/__federation_shared_@baseplate-dev/utils-DvvrgoSE.js.map +1 -0
  11. package/dist/assets/__federation_shared_@tanstack/react-router-B5c6YNeC.js +19 -0
  12. package/dist/assets/__federation_shared_@tanstack/react-router-B5c6YNeC.js.map +1 -0
  13. package/dist/assets/__federation_shared_react-WURrSs1p.js +2 -0
  14. package/dist/assets/{__federation_shared_react-CTQ9xfiH.js.map → __federation_shared_react-WURrSs1p.js.map} +1 -1
  15. package/dist/assets/__federation_shared_react-dom-CWagDEjd.js +2 -0
  16. package/dist/assets/{__federation_shared_react-dom-DPv53nVg.js.map → __federation_shared_react-dom-CWagDEjd.js.map} +1 -1
  17. package/dist/assets/_commonjsHelpers-CqkleIqs.js +2 -0
  18. package/dist/assets/_commonjsHelpers-CqkleIqs.js.map +1 -0
  19. package/dist/assets/_virtual___federation_fn_import-DXu2m-ZE.js +2 -0
  20. package/dist/assets/{_virtual___federation_fn_import-BLYgPlMt.js.map → _virtual___federation_fn_import-DXu2m-ZE.js.map} +1 -1
  21. package/dist/assets/admin-Bw70Pql0.js +2 -0
  22. package/dist/assets/admin-Bw70Pql0.js.map +1 -0
  23. package/dist/assets/backend-CoqSwiCt.js +2 -0
  24. package/dist/assets/{backend-hJNcdERv.js.map → backend-CoqSwiCt.js.map} +1 -1
  25. package/dist/assets/badge-with-type-label-BXoSRTRE.js +2 -0
  26. package/dist/assets/{badge-with-type-label-CezAtjFy.js.map → badge-with-type-label-BXoSRTRE.js.map} +1 -1
  27. package/dist/assets/edit._key-CtMMGDWu.js +2 -0
  28. package/dist/assets/edit._key-CtMMGDWu.js.map +1 -0
  29. package/dist/assets/edit._sectionKey-CTX9L0j4.js +3 -0
  30. package/dist/assets/edit._sectionKey-CTX9L0j4.js.map +1 -0
  31. package/dist/assets/enum-info-form-D5bAsvPH.js +2 -0
  32. package/dist/assets/{enum-info-form-xlZ2HO8I.js.map → enum-info-form-D5bAsvPH.js.map} +1 -1
  33. package/dist/assets/graphql-BmA-sAqU.js +2 -0
  34. package/dist/assets/{graphql-D3J4ZWXL.js.map → graphql-BmA-sAqU.js.map} +1 -1
  35. package/dist/assets/hierarchy-CZorhmS7.js +2 -0
  36. package/dist/assets/{hierarchy-DF9lzUjz.js.map → hierarchy-CZorhmS7.js.map} +1 -1
  37. package/dist/assets/immer-B7fdkLVi.js +2 -0
  38. package/dist/assets/immer-B7fdkLVi.js.map +1 -0
  39. package/dist/assets/index-BABen-rU.js +2 -0
  40. package/dist/assets/index-BABen-rU.js.map +1 -0
  41. package/dist/assets/index-BGLRovL6.js +2 -0
  42. package/dist/assets/index-BGLRovL6.js.map +1 -0
  43. package/dist/assets/index-BPzqpd9P.js +2 -0
  44. package/dist/assets/{index-DJsZccoO.js.map → index-BPzqpd9P.js.map} +1 -1
  45. package/dist/assets/index-BUYA3Tes.js +40 -0
  46. package/dist/assets/index-BUYA3Tes.js.map +1 -0
  47. package/dist/assets/index-Bl_iRlKL.js +2 -0
  48. package/dist/assets/index-Bl_iRlKL.js.map +1 -0
  49. package/dist/assets/index-BpDkQSTy.js +2 -0
  50. package/dist/assets/{index-BdmJimiZ.js.map → index-BpDkQSTy.js.map} +1 -1
  51. package/dist/assets/index-CaiaVpxa.js +2 -0
  52. package/dist/assets/index-CaiaVpxa.js.map +1 -0
  53. package/dist/assets/index-CsGKSjOd.js +2 -0
  54. package/dist/assets/index-CsGKSjOd.js.map +1 -0
  55. package/dist/assets/index-D-dbw3Qx.js +2 -0
  56. package/dist/assets/{index-1ErFJbDw.js.map → index-D-dbw3Qx.js.map} +1 -1
  57. package/dist/assets/index-DCiH936w.js +2 -0
  58. package/dist/assets/{index-Bv8hyN9u.js.map → index-DCiH936w.js.map} +1 -1
  59. package/dist/assets/index-DDivWD4R.js +2 -0
  60. package/dist/assets/index-DDivWD4R.js.map +1 -0
  61. package/dist/assets/index-DpJKJe06.js +2 -0
  62. package/dist/assets/index-DpJKJe06.js.map +1 -0
  63. package/dist/assets/{index-B0D_rfGi.js → index-DqHVrEeL.js} +2 -2
  64. package/dist/assets/{index-B0D_rfGi.js.map → index-DqHVrEeL.js.map} +1 -1
  65. package/dist/assets/index-PlVWOW99.css +1 -0
  66. package/dist/assets/index-_mf2naQd.js +2 -0
  67. package/dist/assets/index-_mf2naQd.js.map +1 -0
  68. package/dist/assets/{index-9Ra4Lmds.js → index-c0qeY2gs.js} +3 -3
  69. package/dist/assets/{index-9Ra4Lmds.js.map → index-c0qeY2gs.js.map} +1 -1
  70. package/dist/assets/index-p--SDqro.js +2 -0
  71. package/dist/assets/{index-B5-Qczd9.js.map → index-p--SDqro.js.map} +1 -1
  72. package/dist/assets/index.esm-CTDJ8Wko.js +2 -0
  73. package/dist/assets/index.esm-CTDJ8Wko.js.map +1 -0
  74. package/dist/assets/jsx-runtime-D_zvdyIk.js +10 -0
  75. package/dist/assets/jsx-runtime-D_zvdyIk.js.map +1 -0
  76. package/dist/assets/model-info-form-pKQBCJu4.js +2 -0
  77. package/dist/assets/{model-info-form-VtbYsjrH.js.map → model-info-form-pKQBCJu4.js.map} +1 -1
  78. package/dist/assets/model-merger-vEOkdVdS.js +2 -0
  79. package/dist/assets/model-merger-vEOkdVdS.js.map +1 -0
  80. package/dist/assets/new-admin-section-dialog-F58HZ0yO.js +2 -0
  81. package/dist/assets/new-admin-section-dialog-F58HZ0yO.js.map +1 -0
  82. package/dist/assets/new-app-dialog-DPQv-mvi.js +2 -0
  83. package/dist/assets/new-app-dialog-DPQv-mvi.js.map +1 -0
  84. package/dist/assets/new-enum-dialog-xVvneRQN.js +2 -0
  85. package/dist/assets/{new-enum-dialog-B0QcIWdY.js.map → new-enum-dialog-xVvneRQN.js.map} +1 -1
  86. package/dist/assets/new-model-dialog-ApenxGWq.js +2 -0
  87. package/dist/assets/{new-model-dialog-CM2dJ8Iv.js.map → new-model-dialog-ApenxGWq.js.map} +1 -1
  88. package/dist/assets/route-1RLqcpwJ.js +2 -0
  89. package/dist/assets/{route-DmdFbZkw.js.map → route-1RLqcpwJ.js.map} +1 -1
  90. package/dist/assets/route-9nRSk82v.js +2 -0
  91. package/dist/assets/route-9nRSk82v.js.map +1 -0
  92. package/dist/assets/route-B5_zLW88.js +2 -0
  93. package/dist/assets/{route-CAp89B2q.js.map → route-B5_zLW88.js.map} +1 -1
  94. package/dist/assets/route-BPsno3Cl.js +2 -0
  95. package/dist/assets/route-BPsno3Cl.js.map +1 -0
  96. package/dist/assets/route-BW0F_EH4.js +2 -0
  97. package/dist/assets/{route-DcsVxxui.js.map → route-BW0F_EH4.js.map} +1 -1
  98. package/dist/assets/route-C1hyfOXp.js +2 -0
  99. package/dist/assets/route-C1hyfOXp.js.map +1 -0
  100. package/dist/assets/route-CH7VQVwb.js +2 -0
  101. package/dist/assets/route-CH7VQVwb.js.map +1 -0
  102. package/dist/assets/route-CpoiDvOD.js +2 -0
  103. package/dist/assets/route-CpoiDvOD.js.map +1 -0
  104. package/dist/assets/route-Dq2UgkxS.js +2 -0
  105. package/dist/assets/{route-BsIUCKz1.js.map → route-Dq2UgkxS.js.map} +1 -1
  106. package/dist/assets/route-z54yq2nP.js +2 -0
  107. package/dist/assets/route-z54yq2nP.js.map +1 -0
  108. package/dist/assets/service-Cv-U7NUv.js +2 -0
  109. package/dist/assets/service-Cv-U7NUv.js.map +1 -0
  110. package/dist/assets/sortBy-C9bvycg5.js +2 -0
  111. package/dist/assets/sortBy-C9bvycg5.js.map +1 -0
  112. package/dist/assets/template-extractor-ElrbBsVj.js +2 -0
  113. package/dist/assets/{template-extractor-DEU0CX0Y.js.map → template-extractor-ElrbBsVj.js.map} +1 -1
  114. package/dist/assets/{theme-builder-La1nKR0K.js → theme-builder-Butjmy7L.js} +6 -6
  115. package/dist/assets/{theme-builder-La1nKR0K.js.map → theme-builder-Butjmy7L.js.map} +1 -1
  116. package/dist/assets/{use-definition-schema-CuFFJIzk.js → use-definition-schema-e7us6WfR.js} +2 -2
  117. package/dist/assets/{use-definition-schema-CuFFJIzk.js.map → use-definition-schema-e7us6WfR.js.map} +1 -1
  118. package/dist/assets/use-enum-form-CEyTBPQn.js +2 -0
  119. package/dist/assets/{use-enum-form-DKD2EDHZ.js.map → use-enum-form-CEyTBPQn.js.map} +1 -1
  120. package/dist/assets/use-model-form-Ch_tz0Rd.js +2 -0
  121. package/dist/assets/{use-model-form-BQa-PiE_.js.map → use-model-form-Ch_tz0Rd.js.map} +1 -1
  122. package/dist/assets/words-Cs2RBKRm.js +2 -0
  123. package/dist/assets/words-Cs2RBKRm.js.map +1 -0
  124. package/dist/index.html +11 -8
  125. package/package.json +11 -11
  126. package/dist/assets/-constants-CqYT9Sad.js +0 -4
  127. package/dist/assets/-constants-CqYT9Sad.js.map +0 -1
  128. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-CEscUEnR.js +0 -2
  129. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CzpSl25Z.js +0 -5
  130. package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CzpSl25Z.js.map +0 -1
  131. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-Bpztr-cx.js +0 -46
  132. package/dist/assets/__federation_shared_@baseplate-dev/ui-components-Bpztr-cx.js.map +0 -1
  133. package/dist/assets/__federation_shared_react-CTQ9xfiH.js +0 -2
  134. package/dist/assets/__federation_shared_react-dom-DPv53nVg.js +0 -2
  135. package/dist/assets/_virtual___federation_fn_import-BLYgPlMt.js +0 -2
  136. package/dist/assets/backend-hJNcdERv.js +0 -2
  137. package/dist/assets/badge-with-type-label-CezAtjFy.js +0 -2
  138. package/dist/assets/edit._id-bMpe6S3O.js +0 -2
  139. package/dist/assets/edit._id-bMpe6S3O.js.map +0 -1
  140. package/dist/assets/enum-info-form-xlZ2HO8I.js +0 -2
  141. package/dist/assets/graphql-D3J4ZWXL.js +0 -2
  142. package/dist/assets/hierarchy-DF9lzUjz.js +0 -2
  143. package/dist/assets/immer-BOh2djD_.js +0 -2
  144. package/dist/assets/immer-BOh2djD_.js.map +0 -1
  145. package/dist/assets/index-1ErFJbDw.js +0 -2
  146. package/dist/assets/index-37eYMUXo.js +0 -2
  147. package/dist/assets/index-37eYMUXo.js.map +0 -1
  148. package/dist/assets/index-B5-Qczd9.js +0 -2
  149. package/dist/assets/index-BLuLGksP.js +0 -2
  150. package/dist/assets/index-BLuLGksP.js.map +0 -1
  151. package/dist/assets/index-BPK2SbiO.js +0 -2
  152. package/dist/assets/index-BPK2SbiO.js.map +0 -1
  153. package/dist/assets/index-BdmJimiZ.js +0 -2
  154. package/dist/assets/index-Bv8hyN9u.js +0 -2
  155. package/dist/assets/index-C15I7WFi.js +0 -2
  156. package/dist/assets/index-C15I7WFi.js.map +0 -1
  157. package/dist/assets/index-C_wN4CIq.js +0 -58
  158. package/dist/assets/index-C_wN4CIq.js.map +0 -1
  159. package/dist/assets/index-DBOJRz5n.css +0 -1
  160. package/dist/assets/index-DJsZccoO.js +0 -2
  161. package/dist/assets/index-DwyYddxl.js +0 -2
  162. package/dist/assets/index-DwyYddxl.js.map +0 -1
  163. package/dist/assets/index-P-wtG1LL.js +0 -2
  164. package/dist/assets/index-P-wtG1LL.js.map +0 -1
  165. package/dist/assets/index.esm-DcyGeCKA.js +0 -10
  166. package/dist/assets/index.esm-DcyGeCKA.js.map +0 -1
  167. package/dist/assets/model-info-form-VtbYsjrH.js +0 -2
  168. package/dist/assets/model-merger-qJqD9I2_.js +0 -2
  169. package/dist/assets/model-merger-qJqD9I2_.js.map +0 -1
  170. package/dist/assets/new-app-dialog-CTtQ52jO.js +0 -2
  171. package/dist/assets/new-app-dialog-CTtQ52jO.js.map +0 -1
  172. package/dist/assets/new-enum-dialog-B0QcIWdY.js +0 -2
  173. package/dist/assets/new-model-dialog-CM2dJ8Iv.js +0 -2
  174. package/dist/assets/route-B34jnFQF.js +0 -2
  175. package/dist/assets/route-B34jnFQF.js.map +0 -1
  176. package/dist/assets/route-BRBmSLMi.js +0 -2
  177. package/dist/assets/route-BRBmSLMi.js.map +0 -1
  178. package/dist/assets/route-BsIUCKz1.js +0 -2
  179. package/dist/assets/route-CAp89B2q.js +0 -2
  180. package/dist/assets/route-DcsVxxui.js +0 -2
  181. package/dist/assets/route-DmdFbZkw.js +0 -2
  182. package/dist/assets/route-Dpmx4lrA.js +0 -2
  183. package/dist/assets/route-Dpmx4lrA.js.map +0 -1
  184. package/dist/assets/route-T4J_Uk-9.js +0 -2
  185. package/dist/assets/route-T4J_Uk-9.js.map +0 -1
  186. package/dist/assets/route-w8_2x1VY.js +0 -2
  187. package/dist/assets/route-w8_2x1VY.js.map +0 -1
  188. package/dist/assets/service-Bgm1ICPI.js +0 -2
  189. package/dist/assets/service-Bgm1ICPI.js.map +0 -1
  190. package/dist/assets/template-extractor-DEU0CX0Y.js +0 -2
  191. package/dist/assets/use-enum-form-DKD2EDHZ.js +0 -2
  192. package/dist/assets/use-model-form-BQa-PiE_.js +0 -2
  193. package/dist/assets/utils-BYjOwi1b.js +0 -2
  194. package/dist/assets/utils-BYjOwi1b.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ import{s as L}from"../sortBy-C9bvycg5.js";import{i as P}from"../isEqual-C420KeG-.js";import{i as _}from"../_virtual___federation_fn_import-DXu2m-ZE.js";function v(t){return typeof t=="object"&&t!==null}function C(t,e,n){const r=Object.keys(e);for(let s=0;s<r.length;s++){const o=r[s],i=e[o],c=t[o],a=n(c,i,o,t,e);a!=null?t[o]=a:Array.isArray(i)?t[o]=C(c??[],i,n):v(c)&&v(i)?t[o]=C(c??{},i,n):(c===void 0||i!==void 0)&&(t[o]=i)}return t}function F(t){return typeof t=="string"?new TextEncoder().encode(t):t}async function xe(t){const e=F(t),n=await crypto.subtle.digest("SHA-256",e);return[...new Uint8Array(n)].map(s=>s.toString(16).padStart(2,"0")).join("")}function ke(t,e){const n=new Error(`${e}: ${t instanceof Error?t.message:String(t)}`,{cause:t});return t instanceof Error&&(n.stack=t.stack),n}class Z{listenerMap=new Map;eventEmitterAbortController=new AbortController;on(e,n,r){const{signal:s}=r??{},o=this.listenerMap.get(e)??[];this.listenerMap.set(e,[...o,n]);const i=()=>{const c=(this.listenerMap.get(e)??[]).filter(a=>a!==n);c.length>0?this.listenerMap.set(e,c):this.listenerMap.delete(e)};return s?.addEventListener("abort",i,{once:!0}),i}async*onAsync(e,n){const r=[];let s,o=!1;const i=this.eventEmitterAbortController.signal;if(n.signal?.aborted||i.aborted)return;function c(){o=!0,s?.(void 0)}for(n.signal?.addEventListener("abort",c,{once:!0}),i.addEventListener("abort",c,{once:!0}),this.on(e,a=>{s?(s(a),s=void 0):r.push(a)},{signal:n.signal});!o;){const a=r.shift()??await new Promise(u=>{s=u});if(o)break;yield a}}emit(e,n){const r=this.listenerMap.get(e)??[];for(const s of r)s(n)}clearListeners(){this.listenerMap.clear(),this.eventEmitterAbortController.abort()}abortEventEmitter(){this.eventEmitterAbortController.abort()}}function $e(){return new Z}class M{_value;defaultValue;isSet=!1;setBySource;getDynamicSource;constructor(e,n){this.defaultValue=e,this.getDynamicSource=n?.getDynamicSource}getValue(){return this._value===void 0?this.defaultValue:this._value}set(e,n){if(this.isSet)throw new Error(`Value has already been set by ${this.setBySource} and cannot be overwritten by ${n}`);this._value=e,this.isSet=!0,this.setBySource=n??this.getDynamicSource?.()??"unknown"}}class K{_stripDuplicates;_value;constructor(e,n){this._stripDuplicates=n?.stripDuplicates??!1,this._value=e??[]}push(...e){let n=this._value;this._stripDuplicates?n=[...new Set([...n,...e])]:n=[...n,...e],this._value=n}getValue(){return this._value}}class U{map;getDynamicSource;constructor(e,n){this.getDynamicSource=n?.getDynamicSource,this.map=new Map(Object.entries(e).map(([r,s])=>[r,{value:s,setBySource:this.getDynamicSource?.()}]))}set(e,n,r){const s=this.map.get(e);if(s?.setBySource)throw new Error(`Value for key ${e} has already been set by ${s.setBySource} and cannot be overwritten by ${r}`);this.map.set(e,{value:n,setBySource:r??this.getDynamicSource?.()})}merge(e,n){const r=n??this.getDynamicSource?.();for(const[s,o]of Object.entries(e))this.set(s,o,r)}getValue(){return Object.fromEntries([...this.map.entries()].map(([e,n])=>[e,n.value]))}}class B{_value;getDynamicSource;constructor(e,n){this.getDynamicSource=n?.getDynamicSource;const r=e??new Map;this._value=new Map([...r.entries()].map(([s,o])=>[s,{value:o,setBySource:this.getDynamicSource?.()}]))}set(e,n,r){const s=this._value.get(e);if(s?.setBySource)throw new Error(`Value for key ${e} has already been set by ${s.setBySource} and cannot be overwritten by ${r}`);this._value.set(e,{value:n,setBySource:r??this.getDynamicSource?.()})}merge(e,n){const r=n??this.getDynamicSource?.();for(const[s,o]of e.entries())this.set(s,o,r)}mergeObj(e,n){const r=n??this.getDynamicSource?.();for(const[s,o]of Object.entries(e))this.set(s,o,r)}getValue(){return new Map([...this._value.entries()].map(([e,n])=>[e,n.value]))}}class W{_value;getDynamicSource;constructor(e,n){this.getDynamicSource=n?.getDynamicSource;const r=e??[];this._value=new Map(r.map(s=>[s.name,{value:s,setBySource:this.getDynamicSource?.()}]))}add(e,n){const r=this._value.get(e.name);if(r?.setBySource)throw new Error(`Value for name ${e.name} has already been set by ${r.setBySource} and cannot be overwritten by ${n}`);this._value.set(e.name,{value:e,setBySource:n??this.getDynamicSource?.()})}addMany(e,n){for(const r of e)this.add(r,n)}getValue(){return L([...this._value.values()].map(e=>e.value),[e=>e.name])}}class V{_value;getDynamicSource;constructor(e,n){this.getDynamicSource=n?.getDynamicSource;const r=e??new Map;this._value=new Map([...r.entries()].map(([s,o])=>[s,{value:new Map([...o.entries()].map(([i,c])=>[i,{value:c,setBySource:this.getDynamicSource?.()}])),setBySource:this.getDynamicSource?.()}]))}set(e,n,r,s){const o=this._value.get(e),i=s??this.getDynamicSource?.()??"unknown";if(!o){const a=new Map;a.set(n,{value:r,setBySource:i}),this._value.set(e,{value:a,setBySource:i});return}const c=o.value.get(n);if(c?.setBySource)throw new Error(`Value for keys ${e}+${n} has already been set by ${c.setBySource} and cannot be overwritten by ${i}`);o.value.set(n,{value:r,setBySource:i})}merge(e,n,r){const s=r??this.getDynamicSource?.()??"unknown";for(const[o,i]of n.entries())this.set(e,o,i,s)}mergeObj(e,n,r){const s=r??this.getDynamicSource?.()??"unknown";for(const[o,i]of Object.entries(n))this.set(e,o,i,s)}getValue(){return new Map([...this._value.entries()].map(([e,n])=>[e,new Map([...n.value.entries()].map(([r,s])=>[r,s.value]))]))}}class J{options;constructor(e){this.options=e}scalar(e){return new M(e,this.options)}string(e){return new M(e,this.options)}number(e){return new M(e,this.options)}boolean(e){return new M(e,this.options)}array(e,n){return new K(e,n)}object(e){return new U(e,this.options)}map(e){return new B(e??new Map,this.options)}mapFromObj(e){return new B(new Map(Object.entries(e??{})),this.options)}namedArray(e){return new W(e,this.options)}mapOfMaps(e){return new V(e??new Map,this.options)}mapOfMapsFromObj(e){const n=new Map;if(e)for(const[r,s]of Object.entries(e))n.set(r,new Map(Object.entries(s)));return new V(n,this.options)}}function ve(t){return t}function Be(t,e){const n=t(new J(e));return{...n,getValues:()=>{const r={};for(const s of Object.keys(n)){const o=n[s];r[s]=o.getValue()}return r}}}function I(t){if(t==null||typeof t=="boolean"||typeof t=="string"||typeof t=="number")return t;if(typeof t=="object"){if(t instanceof Date||t instanceof RegExp)throw new TypeError(`Cannot clone value of unsupported type: ${t.constructor.name}`);if(Array.isArray(t)){const n=[];for(const[r,s]of t.entries())n[r]=I(s);return n}const e={};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const r=t[n];e[n]=I(r)}return e}throw new Error(`Cannot clone value of unsupported type: ${typeof t}`)}function A(t){return typeof t=="object"&&t!==null}function q(t,e){if(Array.isArray(t))t.forEach(e);else if(A(t))for(const n of Object.keys(t)){const r=t[n];e(r,n)}}function T(t){let e=0;return Array.isArray(t)||A(t)?(q(t,n=>{if(Array.isArray(n)||A(n)){const r=T(n);r>e&&(e=r)}}),e+1):e}function d(t,e,n){return e in t?t[e]:n}const G=/("(?:[^\\"]|\\.)*")|[:,]|\{(?!})|(?<!\{)}|\[(?!])|(?<!\[)]/g;function X(t,e={}){const n={"{":"{","}":"}","[":"[","]":"]",",":", ",":":": "};return(e.addMargin||e.addObjectMargin)&&(n["{"]="{ ",n["}"]=" }"),(e.addMargin||e.addArrayMargin)&&(n["["]="[ ",n["]"]=" ]"),t.replaceAll(G,(r,s)=>s?r:n[r])}function H(t,e={}){const n=JSON.stringify([1],null,d(e,"indent",2)).slice(2,-3),r=d(e,"margins",!1),s=d(e,"arrayMargins",!1),o=d(e,"objectMargins",!0),i=n===""?1/0:d(e,"maxLength",80),c=d(e,"maxNesting",1/0);return function a(u,f,l){u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON());const h=JSON.stringify(u);if(h===void 0)return h;const g=i-f.length-l;if(T(u)<=c&&h.length<=g){const y=X(h,{addMargin:r,addArrayMargin:s,addObjectMargin:o});if(y.length<=g)return y}if(A(u)){const y=f+n,w=[];let S;const x=(p,b)=>b===p.length-1?0:1;if(Array.isArray(u)){for(let p=0;p<u.length;p+=1)w.push(a(u[p],y,x(u,p))||"null");S="[]"}else Object.keys(u).forEach((p,b,z)=>{const k=`${JSON.stringify(p)}: `,$=a(u[p],y,k.length+x(z,b));$!==void 0&&w.push(k+$)}),S="{}";if(w.length>0)return[S[0],n+w.join(`,
2
+ ${y}`),S[1]].join(`
3
+ ${f}`)}return h}(t,"",0)}function D(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Q(t,e={}){if(!D(t)&&!Array.isArray(t))throw new TypeError("Expected a plain object or array");const{deep:n,compare:r}=e,s=new WeakMap,o=c=>{const a=s.get(c);if(a!==void 0)return a;const u=[];return s.set(c,u),u.push(...c.map(f=>Array.isArray(f)?o(f):D(f)?i(f):f)),u},i=c=>{const a=s.get(c);if(a!==void 0)return a;const u={},f=Object.keys(c).sort(r);s.set(c,u);for(const l of f){const h=c[l];let g;n&&Array.isArray(h)?g=o(h):g=n&&D(h)?i(h):h,Object.defineProperty(u,l,{...Object.getOwnPropertyDescriptor(c,l),value:g})}return u};return Array.isArray(t)?n?o(t):[...t]:i(t)}function Ve(t){const e=Q(t,{deep:!0});return`${H(e)}
4
+ `}function Ie(t,e){const n=new Map;for(const r of t){const s=e(r),o=n.get(s);o?o.push(r):n.set(s,[r])}return n}function Ne(t,e){const n=new Map;for(const r of t){const s=e(r);n.set(s,r)}return n}function Pe(t,e){const n=new Map;for(const[r,s]of t.entries())n.set(r,e(s,r,t));return n}function R(t,e={}){const n=new Map;for(const r of t)for(const[s,o]of r){if(n.has(s)){const i=n.get(s);if(!e.allowEqualValues||!P(i,o))throw new Error(`Cannot merge key ${String(s)} because it already exists.`)}n.set(s,o)}return n}function Te(t,e,n={}){return R([t,e],n)}function Re(...t){return R(t)}function Y(t,e,n={}){return C(t,e,(r,s,o)=>{if(o in t&&o in e){if(n.allowEqualValues&&P(r,s))return s;throw new Error(`Cannot merge key ${o} because it already exists.`)}return s})}function ee(t,e={}){const n={};for(const r of t.flat())Y(n,r,e);return n}function je(...t){return ee(t)}function N(t){return t===null||typeof t!="object"?t:Array.isArray(t)?t.map(N):Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,N(n)]))}function ze(t){return Object.fromEntries(Object.entries(t).sort(([e],[n])=>e.localeCompare(n)))}function Le(t,e){const n=new Set;for(const r of t)e.has(r)||n.add(r);return n}function Fe(t,e){if(!/[a-zA-Z0-9]/.test(t))return t;const r=/^([^a-zA-Z0-9]*)/.exec(t)?.[1]??"",o=/([^a-zA-Z0-9]*)$/.exec(t)?.[1]??"",i=r.length,c=t.length-o.length,a=t.slice(i,c),u=a&&/[a-zA-Z0-9]/.test(a)?e(a):a;return r+u+o}function Ze(t){return`'${t.replaceAll("'",String.raw`\'`)}'`}function Ke(t){return`"${t.replaceAll('"',String.raw`\"`)}"`}let te=t=>crypto.getRandomValues(new Uint8Array(t)),ne=(t,e,n)=>{let r=(2<<Math.log2(t.length-1))-1,s=-~(1.6*r*e/t.length);return(o=e)=>{let i="";for(;;){let c=n(s),a=s|0;for(;a--;)if(i+=t[c[a]&r]||"",i.length>=o)return i}}},re=(t,e=21)=>ne(t,e|0,te);const se="0123456789",oe="abcdefghijklmnopqrstuvwxyz",ie="ABCDEFGHIJKLMNOPQRSTUVWXYZ",ce=re(`${se}${oe}${ie}_`,12);function Ue(t=12){return ce(t)}class j extends Error{cyclePath;constructor(e){super(`Cyclical dependency detected: ${e.map(n=>JSON.stringify(n)).join(" -> ")}`),this.name="ToposortCyclicalDependencyError",this.cyclePath=e}}class O extends Error{unknownNode;constructor(e){super(`Unknown node referenced in edges: ${JSON.stringify(e)}`),this.name="ToposortUnknownNodeError",this.unknownNode=e}}function ae(t,e){const n=new Map;for(const r of e){const[s,o]=r,i=t.get(s),c=t.get(o);if(i===void 0)throw new O(s);if(c===void 0)throw new O(o);const a=n.get(c);a?a.add(i):n.set(c,new Set([i]))}return n}function ue(t,e){const n=Array.from({length:e},()=>0);for(const[,r]of t.entries())for(const s of r)n[s]++;return n}function fe(t,e,n){const r=new Set;for(let o=0;o<t.length;o++)if(!e.has(o)&&!r.has(o)){const a=s(o,[],new Set);if(a)return a.map(u=>t[u])}return[];function s(o,i,c){i.push(o),c.add(o),r.add(o);const a=n.get(o)??new Set;for(const u of a){if(c.has(u)){const f=i.indexOf(u),l=i.slice(f);return l.push(u),l}if(!r.has(u)){const f=s(u,i,c);if(f)return f}}return c.delete(o),i.pop(),null}}function le(t,e){return typeof t=="string"&&typeof e=="string"?t.localeCompare(e):t===e?0:t<e?-1:1}function We(t,e,n={}){const{compareFunc:r=le}=n,s=(l,h)=>r(t[l],t[h]),o=new Map(t.map((l,h)=>[l,h])),i=ae(o,e),c=ue(i,t.length),a=[];for(const[l,h]of c.entries())h===0&&a.push(l);a.sort(s);const u=[],f=new Set;for(;a.length>0;){const l=a.pop();if(l===void 0)break;f.add(l),u.push(t[l]);const h=i.get(l),g=[];if(h)for(const m of h)c[m]--,c[m]===0&&g.push(m);g.sort(s),a.push(...g)}if(u.length!==t.length){const l=fe(t,f,i);throw new j(l.toReversed())}return u.toReversed()}class he{constructor(e=[],n=(r,s)=>r<s?-1:r>s?1:0){if(this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],n=this.data.pop();return--this.length>0&&(this.data[0]=n,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:n,compare:r}=this,s=n[e];for(;e>0;){const o=e-1>>1,i=n[o];if(r(s,i)>=0)break;n[e]=i,e=o}n[e]=s}_down(e){const{data:n,compare:r}=this,s=this.length>>1,o=n[e];for(;e<s;){let i=(e<<1)+1;const c=i+1;if(c<this.length&&r(n[c],n[i])<0&&(i=c),r(n[i],o)>=0)break;n[e]=n[i],e=i}n[e]=o}}function ge(t,e){const n=new Map;for(const r of e){const[s,o]=r,i=t.get(s),c=t.get(o);if(i===void 0)throw new O(s);if(c===void 0)throw new O(o);const a=n.get(i);a?a.add(c):n.set(i,new Set([c]))}return n}function pe(t,e){const n=Array.from({length:e},()=>0);for(const[,r]of t.entries())for(const s of r)n[s]++;return n}function ye(t,e,n){if(e.size===t.length)return[];const r=[],s=new Set;function o(i){if(s.has(i))return r.push(i),!0;if(e.has(i))return!1;s.add(i),r.push(i);const c=n.get(i)??new Set;for(const a of c)if(o(a))return!0;return r.pop(),s.delete(i),!1}for(let i=0;i<t.length;i++)if(!e.has(i)&&(r.length=0,s.clear(),o(i)))return r.map(a=>t[a]);return[]}function de(t,e){return typeof t=="string"&&typeof e=="string"?t.localeCompare(e):t===e?0:t<e?-1:1}function me(t,e,n={}){const{compareFunc:r}=n,s=new Map(t.map((f,l)=>[f,l])),o=ge(s,e),i=pe(o,t.length),c=r?new he([],(f,l)=>r(t[f],t[l])):[];for(const[f,l]of i.entries())l===0&&c.push(f);const a=[],u=new Set;for(;c.length>0;){const f=c.pop();if(f===void 0)break;u.add(f),a.push(t[f]);const l=o.get(f);if(l)for(const h of l)i[h]--,i[h]===0&&c.push(h)}if(a.length!==t.length){const f=ye(t,u,o);throw new j(f)}return a}function Je(t,e,n=de){return me(t,e,{compareFunc:n})}function qe(t){return t!=null}const{z:E}=await _("zod"),we=/^[a-z0-9-]+$/,Se=/^[A-Z][a-zA-Z0-9]*$/,Me=/^[a-z][a-zA-Z0-9]*$/,Ee=/^[A-Z][A-Z0-9_]*$/,Ge={KEBAB_CASE:E.string().regex(we,{message:'Must be kebab case (e.g. "my-project")'}),PASCAL_CASE:E.string().regex(Se,{message:'Must be pascal case (e.g. "MyProject")'}),CAMEL_CASE:E.string().regex(Me,{message:'Must be camel case (e.g. "myProject")'}),CONSTANT_CASE:E.string().regex(Ee,{message:'Must be constant case (e.g. "MY_PROJECT")'})},{z:Ae}=await _("zod"),Oe=Ae.number().int().positive(),Xe={POSITIVE_INT:Oe},{z:be}=await _("zod");function He(t,e){return(n,r)=>{const s=t(n);if(!s)return n;const o=s.safeParse((e?n[e]:n)??void 0);if(!o.success){for(const i of o.error.issues)r.addIssue({...i,path:[...e?[e]:[],...i.path]});return be.NEVER}return e?{...n,[e]:o.data}:o.data}}export{K as ArrayContainer,Me as CAMEL_CASE_REGEX,Ge as CASE_VALIDATORS,Ee as CONSTANT_CASE_REGEX,J as FieldMapSchemaBuilder,we as KEBAB_CASE_REGEX,B as MapContainer,V as MapOfMapsContainer,Xe as NUMBER_VALIDATORS,W as NamedArrayFieldContainer,U as ObjectContainer,Se as PASCAL_CASE_REGEX,M as ScalarContainer,j as ToposortCyclicalDependencyError,O as ToposortUnknownNodeError,Z as TypedEventEmitter,Fe as convertCaseWithPrefix,Be as createFieldMap,ve as createFieldMapSchemaBuilder,$e as createTypedEventEmitter,Le as differenceSet,Ke as doubleQuot,ke as enhanceErrorWithContext,xe as hashWithSHA256,I as jsonDeepClone,Ie as mapGroupBy,Ne as mapKeyBy,Pe as mapValuesOfMap,qe as notEmpty,Ze as quot,Ue as randomKey,Y as safeMerge,je as safeMergeAll,ee as safeMergeAllWithOptions,Te as safeMergeMap,Re as safeMergeMaps,R as safeMergeMapsWithOptions,N as sortKeysRecursive,ze as sortObjectKeys,H as stringifyPrettyCompact,Ve as stringifyPrettyStable,me as toposort,We as toposortLocal,Je as toposortOrdered,He as transformWithDynamicSchema};
5
+ //# sourceMappingURL=utils-DvvrgoSE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils-DvvrgoSE.js","sources":["../../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs","../../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/object/mergeWith.mjs","../../../../utils/dist/crypto/hash.js","../../../../utils/dist/errors/enhance-error-with-context.js","../../../../utils/dist/events/typed-event-emitter.js","../../../../utils/dist/field-map/field-map.js","../../../../utils/dist/json/json-deep-clone.js","../../../../utils/dist/json/stringify-pretty-compact.js","../../../../../node_modules/.pnpm/is-plain-obj@4.1.0/node_modules/is-plain-obj/index.js","../../../../../node_modules/.pnpm/sort-keys@5.1.0/node_modules/sort-keys/index.js","../../../../utils/dist/json/stringify-pretty-stable.js","../../../../utils/dist/maps/group-by.js","../../../../utils/dist/maps/key-by.js","../../../../utils/dist/maps/map-values-of-map.js","../../../../utils/dist/maps/safe-merge-map.js","../../../../utils/dist/objects/safe-merge.js","../../../../utils/dist/objects/sort-keys-recursive.js","../../../../utils/dist/objects/sort-object-keys.js","../../../../utils/dist/sets/difference.js","../../../../utils/dist/string/convert-case-with-prefix.js","../../../../utils/dist/string/quot.js","../../../../../node_modules/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.js","../../../../utils/dist/string/random-key.js","../../../../utils/dist/toposort/errors.js","../../../../utils/dist/toposort/toposort-local.js","../../../../../node_modules/.pnpm/tinyqueue@3.0.0/node_modules/tinyqueue/index.js","../../../../utils/dist/toposort/toposort.js","../../../../utils/dist/type-guards/not-empty.js","../../../../utils/dist/validators/case-validators.js","../../../../utils/dist/validators/number-validators.js","../../../../utils/dist/validators/transform-with-dynamic-schema.js"],"sourcesContent":["function isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\n\nexport { isObjectLike };\n","import { isObjectLike } from '../compat/predicate/isObjectLike.mjs';\n\nfunction mergeWith(target, source, merge) {\n const sourceKeys = Object.keys(source);\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n const sourceValue = source[key];\n const targetValue = target[key];\n const merged = merge(targetValue, sourceValue, key, target, source);\n if (merged != null) {\n target[key] = merged;\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = mergeWith(targetValue ?? [], sourceValue, merge);\n }\n else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {\n target[key] = mergeWith(targetValue ?? {}, sourceValue, merge);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\n\nexport { mergeWith };\n","function normalizeContent(content) {\n if (typeof content === 'string') {\n const encoder = new TextEncoder();\n return encoder.encode(content);\n }\n return content;\n}\nexport async function hashWithSHA256(content) {\n const data = normalizeContent(content);\n const hashBuffer = await crypto.subtle.digest('SHA-256', data);\n const hashArray = [...new Uint8Array(hashBuffer)];\n return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');\n}\n//# sourceMappingURL=hash.js.map","/**\n * Enhances an error with additional context while preserving the original stack trace\n * @param {Error} originalError - The original error that was caught\n * @param {string} contextMessage - Additional context to prepend to the error message\n * @param {Object} [additionalProps] - Optional object with additional properties to add to the error\n * @returns {Error} - Enhanced error with preserved stack trace\n */\nexport function enhanceErrorWithContext(originalError, contextMessage) {\n // Create a new error with combined message\n const enhancedError = new Error(`${contextMessage}: ${originalError instanceof Error\n ? originalError.message\n : String(originalError)}`, { cause: originalError });\n // Preserve the original stack if possible\n if (originalError instanceof Error) {\n enhancedError.stack = originalError.stack;\n }\n return enhancedError;\n}\n//# sourceMappingURL=enhance-error-with-context.js.map","/**\n * Class providing typed event emitter functionality.\n *\n * @template T - Mapping of event names to payload types.\n */\nexport class TypedEventEmitter {\n listenerMap = new Map();\n /**\n * Abort controller for the event emitter to terminate all async generator listeners.\n */\n eventEmitterAbortController = new AbortController();\n /**\n * Registers a listener for an event.\n *\n * @template K - The event name.\n * @param eventName - Name of the event.\n * @param listener - Callback invoked with the event payload.\n * @param options - Options for the listener.\n * @returns Function to unregister the listener.\n */\n on(eventName, listener, options) {\n const { signal } = options ?? {};\n const existingListeners = this.listenerMap.get(eventName) ?? [];\n this.listenerMap.set(eventName, [\n ...existingListeners,\n listener,\n ]);\n // Returns a function that unregisters this listener.\n const unregister = () => {\n const updatedListeners = (this.listenerMap.get(eventName) ?? []).filter((l) => l !== listener);\n if (updatedListeners.length > 0) {\n this.listenerMap.set(eventName, updatedListeners);\n }\n else {\n this.listenerMap.delete(eventName);\n }\n };\n signal?.addEventListener('abort', unregister, {\n once: true,\n });\n return unregister;\n }\n /**\n * Creates an async generator for an event.\n *\n * @template K - The event name.\n * @param eventName - Name of the event.\n * @param options - Additional options.\n * @returns An async generator yielding event payloads.\n */\n async *onAsync(eventName, options) {\n // Create a queue to store events when consumer isn't ready\n const queue = [];\n let pendingNext;\n let isDone = false;\n // Return early if the signal is aborted\n const eventEmitterAbortSignal = this.eventEmitterAbortController.signal;\n if (options.signal?.aborted || eventEmitterAbortSignal.aborted)\n return;\n function abortHandler() {\n isDone = true;\n // trigger dummy event to unblock the consumer\n pendingNext?.(undefined);\n }\n options.signal?.addEventListener('abort', abortHandler, { once: true });\n eventEmitterAbortSignal.addEventListener('abort', abortHandler, {\n once: true,\n });\n this.on(eventName, (payload) => {\n if (pendingNext) {\n pendingNext(payload);\n pendingNext = undefined;\n }\n else {\n queue.push(payload);\n }\n }, { signal: options.signal });\n // Keep yielding events until done\n while (!isDone) {\n const payload = queue.shift() ??\n (await new Promise((resolve) => {\n pendingNext = resolve;\n }));\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- false positive since isDone is set to true in the abort handler\n if (isDone)\n break;\n yield payload;\n }\n }\n /**\n * Emits an event with the given payload.\n *\n * @template K - The event name.\n * @param eventName - Name of the event.\n * @param payload - Payload for the event.\n */\n emit(eventName, payload) {\n const listeners = this.listenerMap.get(eventName) ?? [];\n for (const listener of listeners) {\n listener(payload);\n }\n }\n /**\n * Removes all registered event listeners.\n *\n * Note: This is dangerous and should only be used in testing.\n */\n clearListeners() {\n this.listenerMap.clear();\n this.eventEmitterAbortController.abort();\n }\n /**\n * Aborts the event emitter to terminate all async generator listeners.\n */\n abortEventEmitter() {\n this.eventEmitterAbortController.abort();\n }\n}\n/**\n * Creates a typed event emitter that supports event listening and emitting.\n *\n * @template T - Mapping of event names to payload types.\n * @returns An emitter with `on`, `emit`, and `clear` methods.\n */\nexport function createTypedEventEmitter() {\n return new TypedEventEmitter();\n}\n//# sourceMappingURL=typed-event-emitter.js.map","import { sortBy } from 'es-toolkit';\n/**\n * Field container for a single value that cannot be overridden once set\n */\nexport class ScalarContainer {\n _value;\n defaultValue;\n isSet = false;\n setBySource;\n getDynamicSource;\n constructor(defaultValue, options) {\n this.defaultValue = defaultValue;\n this.getDynamicSource = options?.getDynamicSource;\n }\n getValue() {\n return this._value === undefined ? this.defaultValue : this._value;\n }\n set(value, source) {\n if (this.isSet) {\n throw new Error(`Value has already been set by ${this.setBySource} and cannot be overwritten by ${source}`);\n }\n this._value = value;\n this.isSet = true;\n this.setBySource = source ?? this.getDynamicSource?.() ?? 'unknown';\n }\n}\n// Array field container\nexport class ArrayContainer {\n _stripDuplicates;\n _value;\n constructor(initialValue, options) {\n this._stripDuplicates = options?.stripDuplicates ?? false;\n this._value = initialValue ?? [];\n }\n push(...items) {\n let currentValue = this._value;\n if (this._stripDuplicates) {\n // Add items without duplicates\n const set = new Set([...currentValue, ...items]);\n currentValue = [...set];\n }\n else {\n // Add all items\n currentValue = [...currentValue, ...items];\n }\n this._value = currentValue;\n }\n getValue() {\n return this._value;\n }\n}\nexport class ObjectContainer {\n map;\n getDynamicSource;\n constructor(initialValue, options) {\n this.getDynamicSource = options?.getDynamicSource;\n this.map = new Map(Object.entries(initialValue).map(([key, value]) => [\n key,\n { value, setBySource: this.getDynamicSource?.() },\n ]));\n }\n set(key, value, source) {\n const existingValue = this.map.get(key);\n if (existingValue?.setBySource) {\n throw new Error(`Value for key ${key} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);\n }\n this.map.set(key, {\n value,\n setBySource: source ?? this.getDynamicSource?.(),\n });\n }\n merge(value, source) {\n const mergeSource = source ?? this.getDynamicSource?.();\n for (const [key, val] of Object.entries(value)) {\n this.set(key, val, mergeSource);\n }\n }\n getValue() {\n return Object.fromEntries([...this.map.entries()].map(([key, value]) => [key, value.value]));\n }\n}\n// Map field container\nexport class MapContainer {\n _value;\n getDynamicSource;\n constructor(initialValue, options) {\n this.getDynamicSource = options?.getDynamicSource;\n const initialMap = initialValue ?? new Map();\n this._value = new Map([...initialMap.entries()].map(([key, value]) => [\n key,\n { value, setBySource: this.getDynamicSource?.() },\n ]));\n }\n set(key, value, source) {\n const existingValue = this._value.get(key);\n if (existingValue?.setBySource) {\n throw new Error(`Value for key ${key} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);\n }\n this._value.set(key, {\n value,\n setBySource: source ?? this.getDynamicSource?.(),\n });\n }\n merge(value, source) {\n const mergeSource = source ?? this.getDynamicSource?.();\n for (const [key, val] of value.entries()) {\n this.set(key, val, mergeSource);\n }\n }\n mergeObj(value, source) {\n const mergeSource = source ?? this.getDynamicSource?.();\n for (const [key, val] of Object.entries(value)) {\n this.set(key, val, mergeSource);\n }\n }\n getValue() {\n return new Map([...this._value.entries()].map(([key, value]) => [key, value.value]));\n }\n}\n/**\n * Named field container\n *\n * This container stores objects that contains a name field that can be used for\n * detecting duplicate names.\n */\nexport class NamedArrayFieldContainer {\n _value;\n getDynamicSource;\n constructor(initialValue, options) {\n this.getDynamicSource = options?.getDynamicSource;\n const value = initialValue ?? [];\n this._value = new Map(value.map((val) => [\n val.name,\n { value: val, setBySource: this.getDynamicSource?.() },\n ]));\n }\n add(value, source) {\n const existingValue = this._value.get(value.name);\n if (existingValue?.setBySource) {\n throw new Error(`Value for name ${value.name} has already been set by ${existingValue.setBySource} and cannot be overwritten by ${source}`);\n }\n this._value.set(value.name, {\n value,\n setBySource: source ?? this.getDynamicSource?.(),\n });\n }\n addMany(values, source) {\n for (const value of values) {\n this.add(value, source);\n }\n }\n getValue() {\n return sortBy([...this._value.values()].map((value) => value.value), [(v) => v.name]);\n }\n}\n// Map of maps field container\nexport class MapOfMapsContainer {\n _value;\n getDynamicSource;\n constructor(initialValue, options) {\n this.getDynamicSource = options?.getDynamicSource;\n const initialMap = initialValue ?? new Map();\n this._value = new Map([...initialMap.entries()].map(([key1, innerMap]) => [\n key1,\n {\n value: new Map([...innerMap.entries()].map(([key2, value]) => [\n key2,\n { value, setBySource: this.getDynamicSource?.() },\n ])),\n setBySource: this.getDynamicSource?.(),\n },\n ]));\n }\n set(key1, key2, value, source) {\n const existingOuterValue = this._value.get(key1);\n const sourceToUse = source ?? this.getDynamicSource?.() ?? 'unknown';\n // If the outer key doesn't exist yet, create a new map for it\n if (!existingOuterValue) {\n const newInnerMap = new Map();\n newInnerMap.set(key2, { value, setBySource: sourceToUse });\n this._value.set(key1, {\n value: newInnerMap,\n setBySource: sourceToUse,\n });\n return;\n }\n // Check if this specific key1+key2 combination has already been set\n const existingInnerValue = existingOuterValue.value.get(key2);\n if (existingInnerValue?.setBySource) {\n throw new Error(`Value for keys ${key1}+${key2} has already been set by ${existingInnerValue.setBySource} and cannot be overwritten by ${sourceToUse}`);\n }\n // Add the new value to the existing inner map\n existingOuterValue.value.set(key2, {\n value,\n setBySource: sourceToUse,\n });\n }\n merge(key1, value, source) {\n const mergeSource = source ?? this.getDynamicSource?.() ?? 'unknown';\n for (const [key2, val] of value.entries()) {\n this.set(key1, key2, val, mergeSource);\n }\n }\n mergeObj(key1, value, source) {\n const mergeSource = source ?? this.getDynamicSource?.() ?? 'unknown';\n for (const [key2, val] of Object.entries(value)) {\n this.set(key1, key2, val, mergeSource);\n }\n }\n getValue() {\n return new Map([...this._value.entries()].map(([key1, outerValue]) => [\n key1,\n new Map([...outerValue.value.entries()].map(([key2, innerValue]) => [\n key2,\n innerValue.value,\n ])),\n ]));\n }\n}\n// Schema builder class\nexport class FieldMapSchemaBuilder {\n options;\n constructor(options) {\n this.options = options;\n }\n scalar(defaultValue) {\n return new ScalarContainer(defaultValue, this.options);\n }\n string(defaultValue) {\n return new ScalarContainer(defaultValue, this.options);\n }\n number(defaultValue) {\n return new ScalarContainer(defaultValue, this.options);\n }\n boolean(defaultValue) {\n return new ScalarContainer(defaultValue, this.options);\n }\n array(initialValue, options) {\n return new ArrayContainer(initialValue, options);\n }\n object(defaultValue) {\n return new ObjectContainer(defaultValue, this.options);\n }\n map(initialValue) {\n return new MapContainer(initialValue ?? new Map(), this.options);\n }\n mapFromObj(initialValue) {\n return new MapContainer(new Map(Object.entries(initialValue ?? {})), this.options);\n }\n namedArray(initialValue) {\n return new NamedArrayFieldContainer(initialValue, this.options);\n }\n mapOfMaps(initialValue) {\n return new MapOfMapsContainer(initialValue ?? new Map(), this.options);\n }\n mapOfMapsFromObj(initialValue) {\n const map = new Map();\n if (initialValue) {\n for (const [key1, innerObj] of Object.entries(initialValue)) {\n map.set(key1, new Map(Object.entries(innerObj)));\n }\n }\n return new MapOfMapsContainer(map, this.options);\n }\n}\nexport function createFieldMapSchemaBuilder(schemaBuilder) {\n return schemaBuilder;\n}\n/**\n * Creates a field map with type-safe field definitions\n */\nexport function createFieldMap(schemaBuilder, options) {\n const schema = schemaBuilder(new FieldMapSchemaBuilder(options));\n // Add getValues method\n return {\n ...schema,\n getValues: () => {\n const values = {};\n for (const key of Object.keys(schema)) {\n const container = schema[key];\n values[key] = container.getValue();\n }\n return values;\n },\n };\n}\n//# sourceMappingURL=field-map.js.map","/**\n * Recursively deep clones JSON-compatible values.\n * Throws if the value is not JSON-serializable.\n *\n * @param value - The value to clone\n * @returns A deep-cloned copy of the value\n * @throws Error if a non-JSON value is encountered\n */\nexport function jsonDeepClone(value) {\n if (value === undefined ||\n value === null ||\n typeof value === 'boolean' ||\n typeof value === 'string') {\n return value;\n }\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'object') {\n if (value instanceof Date || value instanceof RegExp) {\n throw new TypeError(`Cannot clone value of unsupported type: ${value.constructor.name}`);\n }\n if (Array.isArray(value)) {\n // Clone array elements\n const copy = [];\n for (const [i, element] of value.entries()) {\n copy[i] = jsonDeepClone(element);\n }\n return copy;\n }\n // Clone plain object properties\n const copy = {};\n for (const key in value) {\n if (Object.prototype.hasOwnProperty.call(value, key)) {\n const prop = value[key];\n copy[key] = jsonDeepClone(prop);\n }\n }\n return copy;\n }\n // Reject functions, symbols, BigInt, etc.\n throw new Error(`Cannot clone value of unsupported type: ${typeof value}`);\n}\n//# sourceMappingURL=json-deep-clone.js.map","// adapted from https://github.com/AitoDotAI/json-stringify-pretty-compact\n// allows { } to be presented as {} to better mirror prettier formatting\nfunction isObject(obj) {\n return typeof obj === 'object' && obj !== null;\n}\nfunction forEach(obj, cb) {\n if (Array.isArray(obj)) {\n // eslint-disable-next-line unicorn/no-array-for-each\n obj.forEach(cb);\n }\n else if (isObject(obj)) {\n for (const key of Object.keys(obj)) {\n const val = obj[key];\n cb(val, key);\n }\n }\n}\nfunction getTreeDepth(obj) {\n let depth = 0;\n if (Array.isArray(obj) || isObject(obj)) {\n forEach(obj, (val) => {\n if (Array.isArray(val) || isObject(val)) {\n const tmpDepth = getTreeDepth(val);\n if (tmpDepth > depth) {\n depth = tmpDepth;\n }\n }\n });\n return depth + 1;\n }\n return depth;\n}\nfunction get(options, name, defaultValue) {\n return (name in options ? options[name] : defaultValue);\n}\n// Note: This regex matches even invalid JSON strings, but since we’re\n// working on the output of `JSON.stringify` we know that only valid strings\n// are present (unless the user supplied a weird `options.indent` but in\n// that case we don’t care since the output would be invalid anyway).\n// This regex has been adjusted to allow replacement of { } and [ ] with {} and []\n// to better mirror prettier formatting.\nconst stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]|\\{(?!})|(?<!\\{)}|\\[(?!])|(?<!\\[)]/g;\nfunction prettify(str, options = {}) {\n const tokens = {\n '{': '{',\n '}': '}',\n '[': '[',\n ']': ']',\n ',': ', ',\n ':': ': ',\n };\n if (!!options.addMargin || !!options.addObjectMargin) {\n tokens['{'] = '{ ';\n tokens['}'] = ' }';\n }\n if (!!options.addMargin || !!options.addArrayMargin) {\n tokens['['] = '[ ';\n tokens[']'] = ' ]';\n }\n return str.replaceAll(stringOrChar, (match, string) => string ? match : tokens[match]);\n}\nexport function stringifyPrettyCompact(rootObj, options = {}) {\n const indent = JSON.stringify([1], null, get(options, 'indent', 2)).slice(2, -3);\n const addMargin = get(options, 'margins', false);\n const addArrayMargin = get(options, 'arrayMargins', false);\n const addObjectMargin = get(options, 'objectMargins', true);\n const maxLength = indent === '' ? Infinity : get(options, 'maxLength', 80);\n const maxNesting = get(options, 'maxNesting', Infinity);\n return (function stringifyRecursive(obj, currentIndent, reserved) {\n if (obj &&\n typeof obj === 'object' &&\n typeof obj.toJSON === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression\n obj = obj.toJSON();\n }\n const string = JSON.stringify(obj);\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (string === undefined) {\n return string;\n }\n const length = maxLength - currentIndent.length - reserved;\n const treeDepth = getTreeDepth(obj);\n if (treeDepth <= maxNesting && string.length <= length) {\n const prettified = prettify(string, {\n addMargin,\n addArrayMargin,\n addObjectMargin,\n });\n if (prettified.length <= length) {\n return prettified;\n }\n }\n if (isObject(obj)) {\n const nextIndent = currentIndent + indent;\n const items = [];\n let delimiters;\n const atEndOfArray = (array, index) => index === array.length - 1 ? 0 : 1;\n if (Array.isArray(obj)) {\n for (let index = 0; index < obj.length; index += 1) {\n items.push(stringifyRecursive(obj[index], nextIndent, atEndOfArray(obj, index)) || 'null');\n }\n delimiters = '[]';\n }\n else {\n // eslint-disable-next-line unicorn/no-array-for-each\n Object.keys(obj).forEach((key, index, array) => {\n const keyPart = `${JSON.stringify(key)}: `;\n const value = stringifyRecursive(obj[key], nextIndent, keyPart.length + atEndOfArray(array, index));\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (value !== undefined) {\n items.push(keyPart + value);\n }\n });\n delimiters = '{}';\n }\n if (items.length > 0) {\n return [\n delimiters[0],\n indent + items.join(`,\\n${nextIndent}`),\n delimiters[1],\n ].join(`\\n${currentIndent}`);\n }\n }\n return string;\n })(rootObj, '', 0);\n}\n//# sourceMappingURL=stringify-pretty-compact.js.map","export default function isPlainObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value);\n}\n","import isPlainObject from 'is-plain-obj';\n\nexport default function sortKeys(object, options = {}) {\n\tif (!isPlainObject(object) && !Array.isArray(object)) {\n\t\tthrow new TypeError('Expected a plain object or array');\n\t}\n\n\tconst {deep, compare} = options;\n\tconst cache = new WeakMap();\n\n\tconst deepSortArray = array => {\n\t\tconst resultFromCache = cache.get(array);\n\t\tif (resultFromCache !== undefined) {\n\t\t\treturn resultFromCache;\n\t\t}\n\n\t\tconst result = [];\n\t\tcache.set(array, result);\n\n\t\tresult.push(...array.map(item => {\n\t\t\tif (Array.isArray(item)) {\n\t\t\t\treturn deepSortArray(item);\n\t\t\t}\n\n\t\t\tif (isPlainObject(item)) {\n\t\t\t\treturn _sortKeys(item);\n\t\t\t}\n\n\t\t\treturn item;\n\t\t}));\n\n\t\treturn result;\n\t};\n\n\tconst _sortKeys = object => {\n\t\tconst resultFromCache = cache.get(object);\n\t\tif (resultFromCache !== undefined) {\n\t\t\treturn resultFromCache;\n\t\t}\n\n\t\tconst result = {};\n\t\tconst keys = Object.keys(object).sort(compare);\n\n\t\tcache.set(object, result);\n\n\t\tfor (const key of keys) {\n\t\t\tconst value = object[key];\n\t\t\tlet newValue;\n\n\t\t\tif (deep && Array.isArray(value)) {\n\t\t\t\tnewValue = deepSortArray(value);\n\t\t\t} else {\n\t\t\t\tnewValue = deep && isPlainObject(value) ? _sortKeys(value) : value;\n\t\t\t}\n\n\t\t\tObject.defineProperty(result, key, {\n\t\t\t\t...Object.getOwnPropertyDescriptor(object, key),\n\t\t\t\tvalue: newValue,\n\t\t\t});\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tif (Array.isArray(object)) {\n\t\treturn deep ? deepSortArray(object) : [...object];\n\t}\n\n\treturn _sortKeys(object);\n}\n","import sortKeys from 'sort-keys';\nimport { stringifyPrettyCompact } from './stringify-pretty-compact.js';\n/**\n * Stringifies a value with stable pretty printing.\n *\n * That means the keys are sorted and the value is pretty printed.\n *\n * @param value - The value to stringify.\n * @returns The stringified value.\n */\nexport function stringifyPrettyStable(value) {\n const sortedValue = sortKeys(value, {\n deep: true,\n });\n return `${stringifyPrettyCompact(sortedValue)}\\n`;\n}\n//# sourceMappingURL=stringify-pretty-stable.js.map","/**\n * Groups values of an iterable using a key-generating function and returns a Map.\n *\n * Mimics the behavior of ES2025 `Map.groupBy`.\n *\n * @template T The type of elements in the iterable.\n * @template K The key type returned by the key function.\n * @param iterable The iterable to group.\n * @param keyFn A function that returns a grouping key for each element.\n * @returns A Map where each key maps to an array of elements with that key.\n */\nexport function mapGroupBy(iterable, keyFn) {\n const result = new Map();\n for (const item of iterable) {\n const key = keyFn(item);\n const group = result.get(key);\n if (group) {\n group.push(item);\n }\n else {\n result.set(key, [item]);\n }\n }\n return result;\n}\n//# sourceMappingURL=group-by.js.map","/**\n * Creates a Map from an iterable, using a key-generating function.\n * If multiple elements generate the same key, later elements override earlier ones.\n *\n * Analogous to lodash's keyBy function, but returns a Map instead of an object.\n *\n * @template T The type of elements in the iterable.\n * @template K The key type returned by the key function.\n * @param iterable The iterable to transform.\n * @param keyFn A function that returns a unique key for each element.\n * @returns A Map where each key maps to a single element.\n */\nexport function mapKeyBy(iterable, keyFn) {\n const result = new Map();\n for (const item of iterable) {\n const key = keyFn(item);\n result.set(key, item);\n }\n return result;\n}\n//# sourceMappingURL=key-by.js.map","/**\n * Maps the values of a Map to a new Map with the same keys.\n *\n * @template K - Type of keys in the map.\n * @template V - Original value type.\n * @template R - Resulting value type.\n * @param map - The input Map to transform.\n * @param fn - A function to transform each value, receiving the value, key, and original map.\n * @returns A new Map with the same keys and transformed values.\n */\nexport function mapValuesOfMap(map, fn) {\n const result = new Map();\n for (const [key, value] of map.entries()) {\n result.set(key, fn(value, key, map));\n }\n return result;\n}\n//# sourceMappingURL=map-values-of-map.js.map","import { isEqual } from 'es-toolkit';\n/**\n * Merges an array of maps, throwing an error if any keys overlap (unless the values are deeply equal and allowed).\n *\n * @param maps - The array of maps to merge.\n * @param options - Options to control merge behavior.\n * @returns The merged map.\n */\nexport function safeMergeMapsWithOptions(maps, options = {}) {\n const result = new Map();\n for (const map of maps) {\n for (const [key, value] of map) {\n if (result.has(key)) {\n const existing = result.get(key);\n if (!options.allowEqualValues || !isEqual(existing, value)) {\n throw new Error(`Cannot merge key ${String(key)} because it already exists.`);\n }\n }\n result.set(key, value);\n }\n }\n return result;\n}\n/**\n * Merges two maps, throwing an error if any keys overlap.\n *\n * @param mapOne - The first map to merge.\n * @param mapTwo - The second map to merge.\n * @param options - Options to control merge behavior\n * @returns The merged map.\n */\nexport function safeMergeMap(mapOne, mapTwo, options = {}) {\n return safeMergeMapsWithOptions([mapOne, mapTwo], options);\n}\n/**\n * Merges an array of maps, throwing an error if any keys overlap (unless the values are deeply equal and allowed).\n * This function delegates to safeMergeMapsWithOptions.\n *\n * @param maps - The array of maps to merge.\n * @returns The merged map.\n */\nexport function safeMergeMaps(...maps) {\n return safeMergeMapsWithOptions(maps);\n}\n//# sourceMappingURL=safe-merge-map.js.map","import { isEqual, mergeWith } from 'es-toolkit';\n/**\n * Merges two objects, throwing an error if any keys overlap.\n *\n * @param itemOne - The first object to merge.\n * @param itemTwo - The second object to merge.\n * @param options - Options to control merge behavior\n * @returns The merged object.\n */\nexport function safeMerge(itemOne, itemTwo, options = {}) {\n return mergeWith(itemOne, itemTwo, (targetValue, sourceValue, key) => {\n if (key in itemOne && key in itemTwo) {\n if (options.allowEqualValues && isEqual(targetValue, sourceValue)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- we're just using the sourceValue\n return sourceValue;\n }\n throw new Error(`Cannot merge key ${key} because it already exists.`);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return -- we're just using the sourceValue\n return sourceValue;\n });\n}\n/**\n * Merges an array of objects, throwing an error if any keys overlap.\n *\n * @param items - The array of objects to merge.\n * @param options - Options to control merge behavior\n * @returns The merged object.\n */\nexport function safeMergeAllWithOptions(items, options = {}) {\n const targetValue = {};\n for (const item of items.flat()) {\n safeMerge(targetValue, item, options);\n }\n return targetValue;\n}\n/**\n * Merges an array of objects, throwing an error if any keys overlap.\n *\n * @param items - The array of objects to merge.\n * @returns The merged object.\n */\nexport function safeMergeAll(...items) {\n return safeMergeAllWithOptions(items);\n}\n//# sourceMappingURL=safe-merge.js.map","/**\n * Recursively sorts all keys in an object, including nested objects and arrays.\n *\n * @param obj - The object to sort recursively.\n * @returns A new object with all keys sorted recursively.\n */\nexport function sortKeysRecursive(obj) {\n if (obj === null || typeof obj !== 'object') {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map(sortKeysRecursive);\n }\n return Object.fromEntries(Object.entries(obj)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, value]) => [key, sortKeysRecursive(value)]));\n}\n//# sourceMappingURL=sort-keys-recursive.js.map","/**\n * Sorts the keys of an object.\n *\n * @param obj - The object to sort.\n * @returns The sorted object.\n */\nexport function sortObjectKeys(obj) {\n return Object.fromEntries(Object.entries(obj).sort(([a], [b]) => a.localeCompare(b)));\n}\n//# sourceMappingURL=sort-object-keys.js.map","/**\n * Returns a new Set containing values in `setA` that are not in `setB`.\n *\n * @param setA - The original set\n * @param setB - The set of values to exclude\n * @returns A new Set with the difference\n */\nexport function differenceSet(setA, setB) {\n const result = new Set();\n for (const value of setA) {\n if (!setB.has(value)) {\n result.add(value);\n }\n }\n return result;\n}\n//# sourceMappingURL=difference.js.map","/**\n * Converts a string to the specified case while preserving non-alphanumeric prefixes and suffixes.\n *\n * @param input - The string to convert\n * @param caseConverter - The case conversion function to apply\n * @returns The converted string with preserved prefix and suffix\n *\n * @example\n * ```typescript\n * convertCaseWithPrefix('_layoutTest', kebabCase)\n * // Returns: '_layout-test'\n *\n * convertCaseWithPrefix('__privateHelper', kebabCase)\n * // Returns: '__private-helper'\n *\n * convertCaseWithPrefix('[id]', kebabCase)\n * // Returns: '[id]'\n * ```\n */\nexport function convertCaseWithPrefix(input, caseConverter) {\n // Handle special pattern where the entire string is non-alphanumeric (like \"[id]\")\n if (!/[a-zA-Z0-9]/.test(input)) {\n return input;\n }\n // Extract non-alphanumeric prefix\n const prefixMatch = /^([^a-zA-Z0-9]*)/.exec(input);\n const prefix = prefixMatch?.[1] ?? '';\n // Extract non-alphanumeric suffix\n const suffixMatch = /([^a-zA-Z0-9]*)$/.exec(input);\n const suffix = suffixMatch?.[1] ?? '';\n // Get the middle part (everything between prefix and suffix)\n const startIndex = prefix.length;\n const endIndex = input.length - suffix.length;\n const middlePart = input.slice(startIndex, endIndex);\n // Only apply case conversion to the middle part if it contains alphanumeric characters\n const convertedMiddlePart = middlePart && /[a-zA-Z0-9]/.test(middlePart)\n ? caseConverter(middlePart)\n : middlePart;\n return prefix + convertedMiddlePart + suffix;\n}\n//# sourceMappingURL=convert-case-with-prefix.js.map","/**\n * Quotes a string with single quotes and escapes single quotes.\n * @param value - The string to quote.\n * @returns The quoted string.\n */\nexport function quot(value) {\n return `'${value.replaceAll(\"'\", String.raw `\\'`)}'`;\n}\n/**\n * Quotes a string with double quotes and escapes double quotes.\n * @param value - The string to quote.\n * @returns The quoted string.\n */\nexport function doubleQuot(value) {\n return `\"${value.replaceAll('\"', String.raw `\\\"`)}\"`;\n}\n//# sourceMappingURL=quot.js.map","import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step | 0\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length >= size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size | 0, random)\nexport let nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)))\n while (size--) {\n id += scopedUrlAlphabet[bytes[size] & 63]\n }\n return id\n}\n","import { customAlphabet } from 'nanoid';\nconst NUMBERS = '0123456789';\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n/**\n * Use custom ID generator for characters that be easily selected\n */\nconst customNanoid = customAlphabet(`${NUMBERS}${LOWERCASE}${UPPERCASE}_`, 12);\n/**\n * Generate a random key string made up of numbers, lowercase, and uppercase letters\n * @returns A random key string\n */\nexport function randomKey(length = 12) {\n return customNanoid(length);\n}\n//# sourceMappingURL=random-key.js.map","export class ToposortCyclicalDependencyError extends Error {\n cyclePath;\n constructor(nodes) {\n super(`Cyclical dependency detected: ${nodes.map((n) => JSON.stringify(n)).join(' -> ')}`);\n this.name = 'ToposortCyclicalDependencyError';\n this.cyclePath = nodes; // Store the path for potential inspection\n }\n}\nexport class ToposortUnknownNodeError extends Error {\n unknownNode;\n constructor(node) {\n super(`Unknown node referenced in edges: ${JSON.stringify(node)}`);\n this.name = 'ToposortUnknownNodeError';\n this.unknownNode = node; // Store the node for potential inspection\n }\n}\n//# sourceMappingURL=errors.js.map","import { ToposortCyclicalDependencyError, ToposortUnknownNodeError, } from './errors.js';\n/**\n * Creates a map of inbound edges from node indices to their source indices\n */\nfunction makeInboundEdges(nodes, edgeArr) {\n const inboundEdgesMap = new Map();\n for (const edge of edgeArr) {\n const [source, target] = edge;\n const sourceIndex = nodes.get(source);\n const targetIndex = nodes.get(target);\n // Check both source and target exist in the provided nodes set\n if (sourceIndex === undefined)\n throw new ToposortUnknownNodeError(source);\n if (targetIndex === undefined)\n throw new ToposortUnknownNodeError(target);\n const targetEdges = inboundEdgesMap.get(targetIndex);\n if (targetEdges) {\n targetEdges.add(sourceIndex);\n }\n else {\n inboundEdgesMap.set(targetIndex, new Set([sourceIndex]));\n }\n }\n return inboundEdgesMap;\n}\n/**\n * Creates a map of node indices to their out-degree\n */\nfunction makeNodeOutDegrees(inboundEdgesMap, nodeLength) {\n const nodeOutDegrees = Array.from({ length: nodeLength }, () => 0);\n for (const [, sources] of inboundEdgesMap.entries()) {\n for (const source of sources) {\n nodeOutDegrees[source]++;\n }\n }\n return nodeOutDegrees;\n}\n/**\n * Detects a cycle in a graph and returns the path of the first cycle found.\n */\nfunction detectCycle(nodes, \n// Set of nodes already processed by a prior algorithm (e.g., a topological sort).\n// This function will only search for cycles among the remaining nodes.\ninitialVisited, edges) {\n // Tracks nodes visited by ANY DFS traversal within this function.\n const cycleCheckVisited = new Set();\n for (let i = 0; i < nodes.length; i++) {\n if (!initialVisited.has(i) && !cycleCheckVisited.has(i)) {\n const path = [];\n const recursionStack = new Set();\n const cyclePath = dfs(i, path, recursionStack);\n if (cyclePath) {\n // A cycle was found, convert indices to nodes and return immediately.\n return cyclePath.map((idx) => nodes[idx]);\n }\n }\n }\n // No cycles were found in any of the graph's components.\n return [];\n /**\n * Performs a DFS from a starting node to find a cycle.\n * @returns The cycle path as an array of indices if found, otherwise null.\n */\n function dfs(node, path, recursionStack) {\n path.push(node);\n recursionStack.add(node);\n cycleCheckVisited.add(node);\n const neighbors = edges.get(node) ?? new Set();\n for (const neighbor of neighbors) {\n if (recursionStack.has(neighbor)) {\n const cycleStartIndex = path.indexOf(neighbor);\n const cycle = path.slice(cycleStartIndex);\n cycle.push(neighbor);\n return cycle;\n }\n // If the neighbor hasn't been visited by any DFS run yet, recurse.\n if (!cycleCheckVisited.has(neighbor)) {\n const result = dfs(neighbor, path, recursionStack);\n if (result) {\n // A cycle was found deeper in the traversal; propagate the result up.\n return result;\n }\n }\n }\n // Backtrack: No cycle found from this node.\n recursionStack.delete(node);\n path.pop();\n return null;\n }\n}\n/**\n * Default comparison function for stable topological sort\n */\nfunction defaultCompareFunc(a, b) {\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n if (a === b)\n return 0;\n return a < b ? -1 : 1;\n}\n/**\n * Performs a locality-based topological sort on a directed acyclic graph.\n *\n * This is a variant of Kahn's algorithm that starts from nodes with no outbound edges first,\n * and then works its way back.\n *\n * This is useful for tasks where we want to process nodes in a way that is consistent with their locality in the graph\n * such as sorting fragments of a generated code file that depend on each other.\n *\n * @param nodes - The nodes to sort\n * @param edges - The edges of the graph\n * @param options - Optional options for the topological sort\n * @returns The sorted nodes\n */\nexport function toposortLocal(nodes, edges, options = {}) {\n const { compareFunc = defaultCompareFunc } = options;\n const compareIdx = (a, b) => compareFunc(nodes[a], nodes[b]);\n // Map each node to its index\n const nodeIndexMap = new Map(nodes.map((node, index) => [node, index]));\n // Create a map of outgoing edges from each node\n const inboundEdgesMap = makeInboundEdges(nodeIndexMap, edges);\n const nodeOutDegrees = makeNodeOutDegrees(inboundEdgesMap, nodes.length);\n // Create a stack of nodes with no incoming edges (in-degree == 0)\n // We use a stack so that the most recently added nodes are processed first\n const zeroOutDegreeStack = [];\n for (const [i, nodeOutDegree] of nodeOutDegrees.entries()) {\n if (nodeOutDegree === 0) {\n zeroOutDegreeStack.push(i);\n }\n }\n zeroOutDegreeStack.sort(compareIdx);\n const reverseResult = [];\n const visited = new Set();\n // Process nodes in BFS order\n while (zeroOutDegreeStack.length > 0) {\n const current = zeroOutDegreeStack.pop();\n if (current === undefined)\n break;\n visited.add(current);\n reverseResult.push(nodes[current]);\n // Process all outgoing edges from the current node\n const incomingEdges = inboundEdgesMap.get(current);\n const newZeroOutDegreeNodes = [];\n if (incomingEdges) {\n for (const source of incomingEdges) {\n nodeOutDegrees[source]--;\n // If the target node now has no incoming edges, add it to the queue\n if (nodeOutDegrees[source] === 0) {\n newZeroOutDegreeNodes.push(source);\n }\n }\n }\n newZeroOutDegreeNodes.sort(compareIdx);\n zeroOutDegreeStack.push(...newZeroOutDegreeNodes);\n }\n // Check for cycles\n if (reverseResult.length !== nodes.length) {\n const cyclePath = detectCycle(nodes, visited, inboundEdgesMap);\n throw new ToposortCyclicalDependencyError(cyclePath.toReversed());\n }\n return reverseResult.toReversed();\n}\n//# sourceMappingURL=toposort-local.js.map","\nexport default class TinyQueue {\n constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n this.data = data;\n this.length = this.data.length;\n this.compare = compare;\n\n if (this.length > 0) {\n for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n }\n\n push(item) {\n this.data.push(item);\n this._up(this.length++);\n }\n\n pop() {\n if (this.length === 0) return undefined;\n\n const top = this.data[0];\n const bottom = this.data.pop();\n\n if (--this.length > 0) {\n this.data[0] = bottom;\n this._down(0);\n }\n\n return top;\n }\n\n peek() {\n return this.data[0];\n }\n\n _up(pos) {\n const {data, compare} = this;\n const item = data[pos];\n\n while (pos > 0) {\n const parent = (pos - 1) >> 1;\n const current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n }\n\n _down(pos) {\n const {data, compare} = this;\n const halfLength = this.length >> 1;\n const item = data[pos];\n\n while (pos < halfLength) {\n let bestChild = (pos << 1) + 1; // initially it is the left child\n const right = bestChild + 1;\n\n if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n bestChild = right;\n }\n if (compare(data[bestChild], item) >= 0) break;\n\n data[pos] = data[bestChild];\n pos = bestChild;\n }\n\n data[pos] = item;\n }\n}\n","import TinyQueue from 'tinyqueue';\nimport { ToposortCyclicalDependencyError, ToposortUnknownNodeError, } from './errors.js';\n/**\n * Creates a map of outgoing edges from node indices to their target indices\n */\nfunction makeOutgoingEdges(nodes, edgeArr) {\n const outgoingEdgesMap = new Map();\n for (const edge of edgeArr) {\n const [source, target] = edge;\n const sourceIndex = nodes.get(source);\n const targetIndex = nodes.get(target);\n // Check both source and target exist in the provided nodes set\n if (sourceIndex === undefined)\n throw new ToposortUnknownNodeError(source);\n if (targetIndex === undefined)\n throw new ToposortUnknownNodeError(target);\n const sourceEdges = outgoingEdgesMap.get(sourceIndex);\n if (sourceEdges) {\n sourceEdges.add(targetIndex);\n }\n else {\n outgoingEdgesMap.set(sourceIndex, new Set([targetIndex]));\n }\n }\n return outgoingEdgesMap;\n}\n/**\n * Creates a map of node indices to their in-degree\n */\nfunction makeNodeInDegrees(outgoingEdgesMap, nodeLength) {\n const nodeInDegrees = Array.from({ length: nodeLength }, () => 0);\n for (const [, targets] of outgoingEdgesMap.entries()) {\n for (const target of targets) {\n nodeInDegrees[target]++;\n }\n }\n return nodeInDegrees;\n}\n/**\n * Detects cycles in a graph by checking if all nodes are included in the topological sort\n */\nfunction detectCycle(nodes, visited, edges) {\n // If all nodes were visited, no cycle exists\n if (visited.size === nodes.length) {\n return [];\n }\n // Run DFS from any unvisited node to find a cycle\n const path = [];\n const visitSet = new Set();\n function dfs(node) {\n if (visitSet.has(node)) {\n path.push(node);\n return true;\n }\n if (visited.has(node)) {\n return false;\n }\n visitSet.add(node);\n path.push(node);\n const neighbors = edges.get(node) ?? new Set();\n for (const neighbor of neighbors) {\n if (dfs(neighbor)) {\n return true;\n }\n }\n path.pop();\n visitSet.delete(node);\n return false;\n }\n // For cycle detection, we need to try all unvisited nodes\n for (let i = 0; i < nodes.length; i++) {\n if (!visited.has(i)) {\n // Reset path and visitSet for each starting node\n path.length = 0;\n visitSet.clear();\n const cycleFound = dfs(i);\n if (cycleFound) {\n // Convert path indices to actual nodes\n return path.map((idx) => nodes[idx]);\n }\n }\n }\n return [];\n}\n/**\n * Default comparison function for stable topological sort\n */\nfunction defaultCompareFunc(a, b) {\n if (typeof a === 'string' && typeof b === 'string') {\n return a.localeCompare(b);\n }\n if (a === b)\n return 0;\n return a < b ? -1 : 1;\n}\n/**\n * Performs a topological sort on a directed acyclic graph.\n *\n * @param nodes - The nodes to sort\n * @param edges - The edges of the graph\n * @param options - Optional options for the topological sort\n * @returns The sorted nodes\n */\nexport function toposort(nodes, edges, options = {}) {\n const { compareFunc } = options;\n // Map each node to its index\n const nodeIndexMap = new Map(nodes.map((node, index) => [node, index]));\n // Create a map of outgoing edges from each node\n const outgoingEdgesMap = makeOutgoingEdges(nodeIndexMap, edges);\n const nodeInDegrees = makeNodeInDegrees(outgoingEdgesMap, nodes.length);\n // Create a queue of nodes with no incoming edges (in-degree == 0)\n const zeroInDegreeQueue = compareFunc\n ? new TinyQueue([], (a, b) => compareFunc(nodes[a], nodes[b]))\n : [];\n for (const [i, nodeInDegree] of nodeInDegrees.entries()) {\n if (nodeInDegree === 0) {\n zeroInDegreeQueue.push(i);\n }\n }\n const result = [];\n const visited = new Set();\n // Process nodes in BFS order\n while (zeroInDegreeQueue.length > 0) {\n const current = zeroInDegreeQueue.pop();\n if (current === undefined)\n break;\n visited.add(current);\n result.push(nodes[current]);\n // Process all outgoing edges from the current node\n const outgoingEdges = outgoingEdgesMap.get(current);\n if (outgoingEdges) {\n for (const target of outgoingEdges) {\n nodeInDegrees[target]--;\n // If the target node now has no incoming edges, add it to the queue\n if (nodeInDegrees[target] === 0) {\n zeroInDegreeQueue.push(target);\n }\n }\n }\n }\n // Check for cycles\n if (result.length !== nodes.length) {\n const cyclePath = detectCycle(nodes, visited, outgoingEdgesMap);\n throw new ToposortCyclicalDependencyError(cyclePath);\n }\n return result;\n}\n/**\n * Performs a topological sort on a directed acyclic graph, always selecting\n * the smallest available node according to the provided comparison function,\n * yielding the lexicographically minimal ordering.\n *\n * @param nodes - The nodes to sort\n * @param edges - The edges of the graph\n * @param compareFunc - Optional custom comparison function to break ties between nodes with the same topological level (default is string comparison)\n * @returns The sorted nodes\n */\nexport function toposortOrdered(nodes, edges, compareFunc = defaultCompareFunc) {\n return toposort(nodes, edges, { compareFunc });\n}\n//# sourceMappingURL=toposort.js.map","/**\n * Type guard to check if a value is not null or undefined.\n */\nexport function notEmpty(value) {\n return value !== null && value !== undefined;\n}\n//# sourceMappingURL=not-empty.js.map","import { z } from 'zod';\n/**\n * Regex for validating kebab case, e.g. \"my-project\".\n */\nexport const KEBAB_CASE_REGEX = /^[a-z0-9-]+$/;\n/**\n * Regex for validating pascal case, e.g. \"MyProject\".\n */\nexport const PASCAL_CASE_REGEX = /^[A-Z][a-zA-Z0-9]*$/;\n/**\n * Regex for validating camel case, e.g. \"myProject\".\n */\nexport const CAMEL_CASE_REGEX = /^[a-z][a-zA-Z0-9]*$/;\n/**\n * Regex for validating constant case, e.g. \"MY_PROJECT\".\n */\nexport const CONSTANT_CASE_REGEX = /^[A-Z][A-Z0-9_]*$/;\nexport const CASE_VALIDATORS = {\n /**\n * Zod validator for validating kebab case, e.g. \"my-project\".\n */\n KEBAB_CASE: z.string().regex(KEBAB_CASE_REGEX, {\n message: 'Must be kebab case (e.g. \"my-project\")',\n }),\n /**\n * Zod validator for validating pascal case, e.g. \"MyProject\".\n */\n PASCAL_CASE: z.string().regex(PASCAL_CASE_REGEX, {\n message: 'Must be pascal case (e.g. \"MyProject\")',\n }),\n /**\n * Zod validator for validating camel case, e.g. \"myProject\".\n */\n CAMEL_CASE: z.string().regex(CAMEL_CASE_REGEX, {\n message: 'Must be camel case (e.g. \"myProject\")',\n }),\n /**\n * Zod validator for validating constant case, e.g. \"MY_PROJECT\".\n */\n CONSTANT_CASE: z.string().regex(CONSTANT_CASE_REGEX, {\n message: 'Must be constant case (e.g. \"MY_PROJECT\")',\n }),\n};\n//# sourceMappingURL=case-validators.js.map","import { z } from 'zod';\n/**\n * Zod validator for a positive integer.\n */\nconst POSITIVE_INT = z.number().int().positive();\n/**\n * Zod number validators.\n */\nexport const NUMBER_VALIDATORS = {\n POSITIVE_INT,\n};\n//# sourceMappingURL=number-validators.js.map","import { z } from 'zod';\n/**\n * Transforms a value using a dynamic schema and forwards any issues to transform context.\n *\n * Note: This does not change the return type of the schema.\n *\n * @param schemaFn - A function returning a Zod schema based on the current object.\n */\nexport function transformWithDynamicSchema(schemaFn, valuePath) {\n return (data, ctx) => {\n const schema = schemaFn(data);\n if (!schema) {\n return data;\n }\n const result = schema.safeParse((valuePath ? data[valuePath] : data) ?? undefined);\n if (!result.success) {\n for (const issue of result.error.issues) {\n ctx.addIssue({\n ...issue,\n path: [...(valuePath ? [valuePath] : []), ...issue.path],\n });\n }\n return z.NEVER;\n }\n return valuePath\n ? {\n ...data,\n [valuePath]: result.data,\n }\n : result.data;\n };\n}\n//# sourceMappingURL=transform-with-dynamic-schema.js.map"],"names":["isObjectLike","value","mergeWith","target","source","merge","sourceKeys","i","key","sourceValue","targetValue","merged","normalizeContent","content","hashWithSHA256","data","hashBuffer","b","enhanceErrorWithContext","originalError","contextMessage","enhancedError","TypedEventEmitter","eventName","listener","options","signal","existingListeners","unregister","updatedListeners","l","queue","pendingNext","isDone","eventEmitterAbortSignal","abortHandler","payload","resolve","listeners","createTypedEventEmitter","ScalarContainer","defaultValue","ArrayContainer","initialValue","items","currentValue","ObjectContainer","existingValue","mergeSource","val","MapContainer","initialMap","NamedArrayFieldContainer","values","sortBy","v","MapOfMapsContainer","key1","innerMap","key2","existingOuterValue","sourceToUse","newInnerMap","existingInnerValue","outerValue","innerValue","FieldMapSchemaBuilder","map","innerObj","createFieldMapSchemaBuilder","schemaBuilder","createFieldMap","schema","container","jsonDeepClone","copy","element","prop","isObject","obj","forEach","cb","getTreeDepth","depth","tmpDepth","get","name","stringOrChar","prettify","str","tokens","match","string","stringifyPrettyCompact","rootObj","indent","addMargin","addArrayMargin","addObjectMargin","maxLength","maxNesting","stringifyRecursive","currentIndent","reserved","length","prettified","nextIndent","delimiters","atEndOfArray","array","index","keyPart","isPlainObject","prototype","sortKeys","object","deep","compare","cache","deepSortArray","resultFromCache","result","item","_sortKeys","keys","newValue","stringifyPrettyStable","sortedValue","mapGroupBy","iterable","keyFn","group","mapKeyBy","mapValuesOfMap","fn","safeMergeMapsWithOptions","maps","existing","isEqual","safeMergeMap","mapOne","mapTwo","safeMergeMaps","safeMerge","itemOne","itemTwo","safeMergeAllWithOptions","safeMergeAll","sortKeysRecursive","a","sortObjectKeys","differenceSet","setA","setB","convertCaseWithPrefix","input","caseConverter","prefix","suffix","startIndex","endIndex","middlePart","convertedMiddlePart","quot","doubleQuot","random","bytes","customRandom","alphabet","defaultSize","getRandom","mask","step","size","id","j","customAlphabet","NUMBERS","LOWERCASE","UPPERCASE","customNanoid","randomKey","ToposortCyclicalDependencyError","nodes","ToposortUnknownNodeError","node","makeInboundEdges","edgeArr","inboundEdgesMap","edge","sourceIndex","targetIndex","targetEdges","makeNodeOutDegrees","nodeLength","nodeOutDegrees","sources","detectCycle","initialVisited","edges","cycleCheckVisited","cyclePath","dfs","idx","path","recursionStack","neighbors","neighbor","cycleStartIndex","cycle","defaultCompareFunc","toposortLocal","compareFunc","compareIdx","nodeIndexMap","zeroOutDegreeStack","nodeOutDegree","reverseResult","visited","current","incomingEdges","newZeroOutDegreeNodes","TinyQueue","top","bottom","pos","parent","halfLength","bestChild","right","makeOutgoingEdges","outgoingEdgesMap","sourceEdges","makeNodeInDegrees","nodeInDegrees","targets","visitSet","toposort","zeroInDegreeQueue","nodeInDegree","outgoingEdges","toposortOrdered","notEmpty","z","importShared","KEBAB_CASE_REGEX","PASCAL_CASE_REGEX","CAMEL_CASE_REGEX","CONSTANT_CASE_REGEX","CASE_VALIDATORS","POSITIVE_INT","NUMBER_VALIDATORS","transformWithDynamicSchema","schemaFn","valuePath","ctx","issue"],"mappings":"wJAAA,SAASA,EAAaC,EAAO,CACzB,OAAO,OAAOA,GAAU,UAAYA,IAAU,IAClD,CCAA,SAASC,EAAUC,EAAQC,EAAQC,EAAO,CACtC,MAAMC,EAAa,OAAO,KAAKF,CAAM,EACrC,QAASG,EAAI,EAAGA,EAAID,EAAW,OAAQC,IAAK,CACxC,MAAMC,EAAMF,EAAWC,CAAC,EAClBE,EAAcL,EAAOI,CAAG,EACxBE,EAAcP,EAAOK,CAAG,EACxBG,EAASN,EAAMK,EAAaD,EAAaD,EAAKL,EAAQC,CAAM,EAC9DO,GAAU,KACVR,EAAOK,CAAG,EAAIG,EAET,MAAM,QAAQF,CAAW,EAC9BN,EAAOK,CAAG,EAAIN,EAAUQ,GAAe,CAAE,EAAED,EAAaJ,CAAK,EAExDL,EAAaU,CAAW,GAAKV,EAAaS,CAAW,EAC1D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S,uCACjB,CAAK,EAID,cAAeJ,EAAE,SAAS,MAAMK,GAAqB,CACjD,QAAS,2CACjB,CAAK,CACL,EC1CA,CAAA,EAAAL,EAAA,EAAA,MAAAC,EAAA,KAAA,EAIMM,GAAeP,GAAE,OAAQ,EAAC,IAAG,EAAG,SAAU,EAInCQ,GAAoB,CAC7B,aAAAD,EACJ,ECVA,CAAA,EAAAP,EAAA,EAAA,MAAAC,EAAA,KAAA,EAQO,SAASQ,GAA2BC,EAAUC,EAAW,CAC5D,MAAO,CAAC/O,EAAMgP,IAAQ,CAClB,MAAMvL,EAASqL,EAAS9O,CAAI,EAC5B,GAAI,CAACyD,EACD,OAAOzD,EAEX,MAAM0G,EAASjD,EAAO,WAAWsL,EAAY/O,EAAK+O,CAAS,EAAI/O,IAAS,MAAS,EACjF,GAAI,CAAC0G,EAAO,QAAS,CACjB,UAAWuI,KAASvI,EAAO,MAAM,OAC7BsI,EAAI,SAAS,CACT,GAAGC,EACH,KAAM,CAAC,GAAIF,EAAY,CAACA,CAAS,EAAI,GAAK,GAAGE,EAAM,IAAI,CAC3E,CAAiB,EAEL,OAAOb,GAAE,KACrB,CACQ,OAAOW,EACD,CACE,GAAG/O,EACH,CAAC+O,CAAS,EAAGrI,EAAO,IACpC,EACcA,EAAO,IAChB,CACL","x_google_ignoreList":[0,1,8,9,21,25]}
@@ -0,0 +1,19 @@
1
+ import{i as N}from"../_virtual___federation_fn_import-DXu2m-ZE.js";import{j as S}from"../jsx-runtime-D_zvdyIk.js";import{r as Ze}from"../index-c0qeY2gs.js";var oe={exports:{}},se={};/**
2
+ * @license React
3
+ * use-sync-external-store-shim.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Te;function Rn(){if(Te)return se;Te=1;var t=Ze();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var e=typeof Object.is=="function"?Object.is:n,r=t.useState,o=t.useEffect,s=t.useLayoutEffect,i=t.useDebugValue;function c(l,u){var f=u(),p=r({inst:{value:f,getSnapshot:u}}),m=p[0].inst,v=p[1];return s(function(){m.value=f,m.getSnapshot=u,a(m)&&v({inst:m})},[l,f,u]),o(function(){return a(m)&&v({inst:m}),l(function(){a(m)&&v({inst:m})})},[l]),i(f),f}function a(l){var u=l.getSnapshot;l=l.value;try{var f=u();return!e(l,f)}catch{return!0}}function d(l,u){return u()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return se.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,se}var $e;function Pn(){return $e||($e=1,oe.exports=Rn()),oe.exports}var wn="Invariant failed";function dt(t,n){if(!t)throw new Error(wn)}function _o(t,n){}const wt=new WeakMap,Vt=new WeakMap,zt={current:[]};let ie=!1,$t=0;const Tt=new Set,At=new Map;function Qe(t){const n=Array.from(t).sort((e,r)=>e instanceof xt&&e.options.deps.includes(r)?1:r instanceof xt&&r.options.deps.includes(e)?-1:0);for(const e of n){if(zt.current.includes(e))continue;zt.current.push(e),e.recompute();const r=Vt.get(e);if(r)for(const o of r){const s=wt.get(o);s&&Qe(s)}}}function xn(t){t.listeners.forEach(n=>n({prevVal:t.prevState,currentVal:t.state}))}function Cn(t){t.listeners.forEach(n=>n({prevVal:t.prevState,currentVal:t.state}))}function tn(t){if($t>0&&!At.has(t)&&At.set(t,t.prevState),Tt.add(t),!($t>0)&&!ie)try{for(ie=!0;Tt.size>0;){const n=Array.from(Tt);Tt.clear();for(const e of n){const r=At.get(e)??e.prevState;e.prevState=r,xn(e)}for(const e of n){const r=wt.get(e);r&&(zt.current.push(e),Qe(r))}for(const e of n){const r=wt.get(e);if(r)for(const o of r)Cn(o)}}}finally{ie=!1,zt.current=[],At.clear()}}function Fe(t){$t++;try{t()}finally{if($t--,$t===0){const n=Array.from(Tt)[0];n&&tn(n)}}}function bn(t){return typeof t=="function"}class pe{constructor(n,e){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const i=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),i?.()}},this.prevState=n,this.state=n,this.options=e}setState(n){var e,r,o;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(n):bn(n)?this.state=n(this.prevState):this.state=n,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),tn(this)}}class xt{constructor(n){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const e=[],r=[];for(const o of this.options.deps)e.push(o.prevState),r.push(o.state);return this.lastSeenDepValues=r,{prevDepVals:e,currDepVals:r,prevVal:this.prevState??void 0}},this.recompute=()=>{var e,r;this.prevState=this.state;const{prevDepVals:o,currDepVals:s,prevVal:i}=this.getDepVals();this.state=this.options.fn({prevDepVals:o,currDepVals:s,prevVal:i}),(r=(e=this.options).onUpdate)==null||r.call(e)},this.checkIfRecalculationNeededDeeply=()=>{for(const s of this.options.deps)s instanceof xt&&s.checkIfRecalculationNeededDeeply();let e=!1;const r=this.lastSeenDepValues,{currDepVals:o}=this.getDepVals();for(let s=0;s<o.length;s++)if(o[s]!==r[s]){e=!0;break}e&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const e of this._subscriptions)e()}),this.subscribe=e=>{var r,o;this.listeners.add(e);const s=(o=(r=this.options).onSubscribe)==null?void 0:o.call(r,e,this);return()=>{this.listeners.delete(e),s?.()}},this.options=n,this.state=n.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(n=this.options.deps){for(const e of n)if(e instanceof xt)e.registerOnGraph(),this.registerOnGraph(e.options.deps);else if(e instanceof pe){let r=wt.get(e);r||(r=new Set,wt.set(e,r)),r.add(this);let o=Vt.get(this);o||(o=new Set,Vt.set(this,o)),o.add(e)}}unregisterFromGraph(n=this.options.deps){for(const e of n)if(e instanceof xt)this.unregisterFromGraph(e.options.deps);else if(e instanceof pe){const r=wt.get(e);r&&r.delete(this);const o=Vt.get(this);o&&o.delete(e)}}}const ft="__TSR_index",Be="popstate",Oe="beforeunload";function en(t){let n=t.getLocation();const e=new Set,r=i=>{n=t.getLocation(),e.forEach(c=>c({location:n,action:i}))},o=i=>{t.notifyOnIndexChange??!0?r(i):n=t.getLocation()},s=async({task:i,navigateOpts:c,...a})=>{var d,h;if(c?.ignoreBlocker??!1){i();return}const u=((d=t.getBlockers)==null?void 0:d.call(t))??[],f=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&f)for(const p of u){const m=Ct(a.path,a.state);if(await p.blockerFn({currentLocation:n,nextLocation:m,action:a.type})){(h=t.onBlocked)==null||h.call(t);return}}i()};return{get location(){return n},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{const d=n.state[ft];c=me(d+1,c),s({task:()=>{t.pushState(i,c),r({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{const d=n.state[ft];c=me(d,c),s({task:()=>{t.replaceState(i,c),r({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{s({task:()=>{t.go(i),o({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{s({task:()=>{t.back(i?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{s({task:()=>{t.forward(i?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>n.state[ft]!==0,createHref:i=>t.createHref(i),block:i=>{var c;if(!t.setBlockers)return()=>{};const a=((c=t.getBlockers)==null?void 0:c.call(t))??[];return t.setBlockers([...a,i]),()=>{var d,h;const l=((d=t.getBlockers)==null?void 0:d.call(t))??[];(h=t.setBlockers)==null||h.call(t,l.filter(u=>u!==i))}},flush:()=>{var i;return(i=t.flush)==null?void 0:i.call(t)},destroy:()=>{var i;return(i=t.destroy)==null?void 0:i.call(t)},notify:r}}function me(t,n){n||(n={});const e=we();return{...n,key:e,__TSR_key:e,[ft]:t}}function nn(t){var n,e;const r=t?.window??(typeof document<"u"?window:void 0),o=r.history.pushState,s=r.history.replaceState;let i=[];const c=()=>i,a=y=>i=y,d=t?.createHref??(y=>y),h=t?.parseLocation??(()=>Ct(`${r.location.pathname}${r.location.search}${r.location.hash}`,r.history.state));if(!((n=r.history.state)!=null&&n.__TSR_key)&&!((e=r.history.state)!=null&&e.key)){const y=we();r.history.replaceState({[ft]:0,key:y,__TSR_key:y},"")}let l=h(),u,f=!1,p=!1,m=!1,v=!1;const g=()=>l;let w,P;const _=()=>{w&&(M._ignoreSubscribers=!0,(w.isPush?r.history.pushState:r.history.replaceState)(w.state,"",w.href),M._ignoreSubscribers=!1,w=void 0,P=void 0,u=void 0)},$=(y,L,C)=>{const T=d(L);P||(u=l),l=Ct(L,C),w={href:T,state:C,isPush:w?.isPush||y==="push"},P||(P=Promise.resolve().then(()=>_()))},I=y=>{l=h(),M.notify({type:y})},R=async()=>{if(p){p=!1;return}const y=h(),L=y.state[ft]-l.state[ft],C=L===1,T=L===-1,O=!C&&!T||f;f=!1;const H=O?"GO":T?"BACK":"FORWARD",b=O?{type:"GO",index:L}:{type:T?"BACK":"FORWARD"};if(m)m=!1;else{const A=c();if(typeof document<"u"&&A.length){for(const E of A)if(await E.blockerFn({currentLocation:l,nextLocation:y,action:H})){p=!0,r.history.go(1),M.notify(b);return}}}l=h(),M.notify(b)},x=y=>{if(v){v=!1;return}let L=!1;const C=c();if(typeof document<"u"&&C.length)for(const T of C){const O=T.enableBeforeUnload??!0;if(O===!0){L=!0;break}if(typeof O=="function"&&O()===!0){L=!0;break}}if(L)return y.preventDefault(),y.returnValue=""},M=en({getLocation:g,getLength:()=>r.history.length,pushState:(y,L)=>$("push",y,L),replaceState:(y,L)=>$("replace",y,L),back:y=>(y&&(m=!0),v=!0,r.history.back()),forward:y=>{y&&(m=!0),v=!0,r.history.forward()},go:y=>{f=!0,r.history.go(y)},createHref:y=>d(y),flush:_,destroy:()=>{r.history.pushState=o,r.history.replaceState=s,r.removeEventListener(Oe,x,{capture:!0}),r.removeEventListener(Be,R)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:c,setBlockers:a,notifyOnIndexChange:!1});return r.addEventListener(Oe,x,{capture:!0}),r.addEventListener(Be,R),r.history.pushState=function(...y){const L=o.apply(r.history,y);return M._ignoreSubscribers||I("PUSH"),L},r.history.replaceState=function(...y){const L=s.apply(r.history,y);return M._ignoreSubscribers||I("REPLACE"),L},M}function Ro(t){const n=t?.window??(typeof document<"u"?window:void 0);return nn({window:n,parseLocation:()=>{const e=n.location.hash.split("#").slice(1),r=e[0]??"/",o=n.location.search,s=e.slice(1),i=s.length===0?"":`#${s.join("#")}`,c=`${r}${o}${i}`;return Ct(c,n.history.state)},createHref:e=>`${n.location.pathname}${n.location.search}#${e}`})}function Ln(t={initialEntries:["/"]}){const n=t.initialEntries;let e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),n.length-1):n.length-1;const r=n.map((s,i)=>me(i,void 0));return en({getLocation:()=>Ct(n[e],r[e]),getLength:()=>n.length,pushState:(s,i)=>{e<n.length-1&&(n.splice(e+1),r.splice(e+1)),r.push(i),n.push(s),e=Math.max(n.length-1,0)},replaceState:(s,i)=>{r[e]=i,n[e]=s},back:()=>{e=Math.max(e-1,0)},forward:()=>{e=Math.min(e+1,n.length-1)},go:s=>{e=Math.min(Math.max(e+s,0),n.length-1)},createHref:s=>s})}function Ct(t,n){const e=t.indexOf("#"),r=t.indexOf("?"),o=we();return{href:t,pathname:t.substring(0,e>0?r>0?Math.min(e,r):e:r>0?r:t.length),hash:e>-1?t.substring(e):"",search:r>-1?t.slice(r,e===-1?void 0:e):"",state:n||{[ft]:0,key:o,__TSR_key:o}}}function we(){return(Math.random()+1).toString(36).substring(7)}function ve(t){return t[t.length-1]}function Mn(t){return typeof t=="function"}function mt(t,n){return Mn(t)?t(n):t}function Kt(t,n){return n.reduce((e,r)=>(e[r]=t[r],e),{})}function nt(t,n){if(t===n)return t;const e=n,r=je(t)&&je(e);if(r||Ae(t)&&Ae(e)){const o=r?t:Object.keys(t).concat(Object.getOwnPropertySymbols(t)),s=o.length,i=r?e:Object.keys(e).concat(Object.getOwnPropertySymbols(e)),c=i.length,a=r?[]:{};let d=0;for(let h=0;h<c;h++){const l=r?h:i[h];(!r&&o.includes(l)||r)&&t[l]===void 0&&e[l]===void 0?(a[l]=void 0,d++):(a[l]=nt(t[l],e[l]),a[l]===t[l]&&t[l]!==void 0&&d++)}return s===c&&d===s?t:a}return e}function Ae(t){return ge(t)&&Object.getOwnPropertyNames(t).length===Object.keys(t).length}function ge(t){if(!De(t))return!1;const n=t.constructor;if(typeof n>"u")return!0;const e=n.prototype;return!(!De(e)||!e.hasOwnProperty("isPrototypeOf"))}function De(t){return Object.prototype.toString.call(t)==="[object Object]"}function je(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ne(t,n){let e=Object.keys(t);return n&&(e=e.filter(r=>t[r]!==void 0)),e}function vt(t,n,e){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(ge(t)&&ge(n)){const r=e?.ignoreUndefined??!0,o=Ne(t,r),s=Ne(n,r);return!e?.partial&&o.length!==s.length?!1:s.every(i=>vt(t[i],n[i],e))}return Array.isArray(t)&&Array.isArray(n)?t.length!==n.length?!1:!t.some((r,o)=>!vt(r,n[o],e)):!1}function Rt(t){let n,e;const r=new Promise((o,s)=>{n=o,e=s});return r.status="pending",r.resolve=o=>{r.status="resolved",r.value=o,n(o),t?.(o)},r.reject=o=>{r.status="rejected",e(o)},r}function Po(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}function wo(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;const e=Object.keys(t);if(e.length!==Object.keys(n).length)return!1;for(const r of e)if(!Object.prototype.hasOwnProperty.call(n,r)||!Object.is(t[r],n[r]))return!1;return!0}function En(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}const ct=0,yt=1,St=2,bt=3;function lt(t){return xe(t.filter(n=>n!==void 0).join("/"))}function xe(t){return t.replace(/\/{2,}/g,"/")}function Ce(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function Lt(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function ae(t){return Lt(Ce(t))}function Ut(t,n){return t?.endsWith("/")&&t!=="/"&&t!==`${n}/`?t.slice(0,-1):t}function kn(t,n,e){return Ut(t,e)===Ut(n,e)}function In(t){const{type:n,value:e}=t;if(n===ct)return e;const{prefixSegment:r,suffixSegment:o}=t;if(n===yt){const s=e.substring(1);if(r&&o)return`${r}{$${s}}${o}`;if(r)return`${r}{$${s}}`;if(o)return`{$${s}}${o}`}if(n===bt){const s=e.substring(1);return r&&o?`${r}{-$${s}}${o}`:r?`${r}{-$${s}}`:o?`{-$${s}}${o}`:`{-$${s}}`}if(n===St){if(r&&o)return`${r}{$}${o}`;if(r)return`${r}{$}`;if(o)return`{$}${o}`}return e}function Tn({basepath:t,base:n,to:e,trailingSlash:r="never",caseSensitive:o,parseCache:s}){var i;n=Ht(t,n,o),e=Ht(t,e,o);let c=Mt(n,s).slice();const a=Mt(e,s);c.length>1&&((i=ve(c))==null?void 0:i.value)==="/"&&c.pop();for(let l=0,u=a.length;l<u;l++){const f=a[l],p=f.value;p==="/"?l?l===u-1&&c.push(f):c=[f]:p===".."?c.pop():p==="."||c.push(f)}c.length>1&&(ve(c).value==="/"?r==="never"&&c.pop():r==="always"&&c.push({type:ct,value:"/"}));const d=c.map(In);return lt([t,...d])}const Mt=(t,n)=>{if(!t)return[];const e=n?.get(t);if(e)return e;const r=Dn(t);return n?.set(t,r),r},$n=/^\$.{1,}$/,Fn=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Bn=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,On=/^\$$/,An=/^(.*?)\{\$\}(.*)$/;function Dn(t){t=xe(t);const n=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),n.push({type:ct,value:"/"})),!t)return n;const e=t.split("/").filter(Boolean);return n.push(...e.map(r=>{const o=r.match(An);if(o){const c=o[1],a=o[2];return{type:St,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}const s=r.match(Bn);if(s){const c=s[1],a=s[2],d=s[3];return{type:bt,value:a,prefixSegment:c||void 0,suffixSegment:d||void 0}}const i=r.match(Fn);if(i){const c=i[1],a=i[2],d=i[3];return{type:yt,value:""+a,prefixSegment:c||void 0,suffixSegment:d||void 0}}if($n.test(r)){const c=r.substring(1);return{type:yt,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return On.test(r)?{type:St,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:ct,value:r.includes("%25")?r.split("%25").map(c=>decodeURI(c)).join("%25"):decodeURI(r)}})),t.slice(-1)==="/"&&(t=t.substring(1),n.push({type:ct,value:"/"})),n}function Dt({path:t,params:n,leaveWildcards:e,leaveParams:r,decodeCharMap:o,parseCache:s}){const i=Mt(t,s);function c(l){const u=n[l],f=typeof u=="string";return l==="*"||l==="_splat"?f?encodeURI(u):u:f?jn(u,o):u}let a=!1;const d={},h=lt(i.map(l=>{if(l.type===ct)return l.value;if(l.type===St){d._splat=n._splat;const u=l.prefixSegment||"",f=l.suffixSegment||"";if(!("_splat"in n))return a=!0,e?`${u}${l.value}${f}`:u||f?`${u}${f}`:void 0;const p=c("_splat");return e?`${u}${l.value}${p??""}${f}`:`${u}${p}${f}`}if(l.type===yt){const u=l.value.substring(1);!a&&!(u in n)&&(a=!0),d[u]=n[u];const f=l.prefixSegment||"",p=l.suffixSegment||"";if(r){const m=c(l.value);return`${f}${l.value}${m??""}${p}`}return`${f}${c(u)??"undefined"}${p}`}if(l.type===bt){const u=l.value.substring(1),f=l.prefixSegment||"",p=l.suffixSegment||"";if(!(u in n)||n[u]==null)return e?`${f}${u}${p}`:f||p?`${f}${p}`:void 0;if(d[u]=n[u],r){const m=c(l.value);return`${f}${l.value}${m??""}${p}`}return e?`${f}${u}${c(u)??""}${p}`:`${f}${c(u)??""}${p}`}return l.value}));return{usedParams:d,interpolatedPath:h,isMissingParams:a}}function jn(t,n){let e=encodeURIComponent(t);if(n)for(const[r,o]of n)e=e.replaceAll(r,o);return e}function ye(t,n,e,r){const o=Nn(t,n,e,r);if(!(e.to&&!o))return o??{}}function Ht(t,n,e=!1){const r=e?t:t.toLowerCase(),o=e?n:n.toLowerCase();switch(!0){case r==="/":return n;case o===r:return"";case n.length<t.length:return n;case o[r.length]!=="/":return n;case o.startsWith(r):return n.slice(t.length);default:return n}}function Nn(t,n,{to:e,fuzzy:r,caseSensitive:o},s){if(t!=="/"&&!n.startsWith(t))return;n=Ht(t,n,o),e=Ht(t,`${e??"$"}`,o);const i=Mt(n.startsWith("/")?n:`/${n}`,s),c=Mt(e.startsWith("/")?e:`/${e}`,s),a={};return Vn(i,c,a,r,o)?a:void 0}function Vn(t,n,e,r,o){var s,i,c;let a=0,d=0;for(;a<t.length||d<n.length;){const h=t[a],l=n[d];if(l){if(l.type===St){const u=t.slice(a);let f;if(l.prefixSegment||l.suffixSegment){if(!h)return!1;const p=l.prefixSegment||"",m=l.suffixSegment||"",v=h.value;if("prefixSegment"in l&&!v.startsWith(p)||"suffixSegment"in l&&!((s=t[t.length-1])!=null&&s.value.endsWith(m)))return!1;let g=decodeURI(lt(u.map(w=>w.value)));p&&g.startsWith(p)&&(g=g.slice(p.length)),m&&g.endsWith(m)&&(g=g.slice(0,g.length-m.length)),f=g}else f=decodeURI(lt(u.map(p=>p.value)));return e["*"]=f,e._splat=f,!0}if(l.type===ct){if(l.value==="/"&&!h?.value){d++;continue}if(h){if(o){if(l.value!==h.value)return!1}else if(l.value.toLowerCase()!==h.value.toLowerCase())return!1;a++,d++;continue}else return!1}if(l.type===yt){if(!h||h.value==="/")return!1;let u="",f=!1;if(l.prefixSegment||l.suffixSegment){const p=l.prefixSegment||"",m=l.suffixSegment||"",v=h.value;if(p&&!v.startsWith(p)||m&&!v.endsWith(m))return!1;let g=v;p&&g.startsWith(p)&&(g=g.slice(p.length)),m&&g.endsWith(m)&&(g=g.slice(0,g.length-m.length)),u=decodeURIComponent(g),f=!0}else u=decodeURIComponent(h.value),f=!0;f&&(e[l.value.substring(1)]=u,a++),d++;continue}if(l.type===bt){if(!h){d++;continue}if(h.value==="/"){d++;continue}let u="",f=!1;if(l.prefixSegment||l.suffixSegment){const p=l.prefixSegment||"",m=l.suffixSegment||"",v=h.value;if((!p||v.startsWith(p))&&(!m||v.endsWith(m))){let g=v;p&&g.startsWith(p)&&(g=g.slice(p.length)),m&&g.endsWith(m)&&(g=g.slice(0,g.length-m.length)),u=decodeURIComponent(g),f=!0}}else{let p=!0;for(let m=d+1;m<n.length;m++){const v=n[m];if(v?.type===ct&&v.value===h.value){p=!1;break}if(v?.type===yt||v?.type===St)break}p&&(u=decodeURIComponent(h.value),f=!0)}f&&(e[l.value.substring(1)]=u,a++),d++;continue}}if(a<t.length&&d>=n.length)return e["**"]=lt(t.slice(a).map(u=>u.value)),!!r&&((i=n[n.length-1])==null?void 0:i.value)!=="/";if(d<n.length&&a>=t.length){for(let u=d;u<n.length;u++)if(((c=n[u])==null?void 0:c.type)!==bt)return!1;break}break}return!0}function rn(t={}){if(t.isNotFound=!0,t.throw)throw t;return t}function rt(t){return!!t?.isNotFound}function Wn(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{return}}const Gt="tsr-scroll-restoration-v1_3",zn=(t,n)=>{let e;return(...r)=>{e||(e=setTimeout(()=>{t(...r),e=null},n))}};function Kn(){const t=Wn();if(!t)return;const n=t.getItem(Gt);let e=n?JSON.parse(n):{};return{state:e,set:r=>(e=mt(r,e)||e,t.setItem(Gt,JSON.stringify(e)))}}const Wt=Kn(),qt=t=>t.state.__TSR_key||t.href;function on(t){const n=[];let e;for(;e=t.parentNode;)n.unshift(`${t.tagName}:nth-child(${[].indexOf.call(e.children,t)+1})`),t=e;return`${n.join(" > ")}`.toLowerCase()}let Jt=!1;function sn({storageKey:t,key:n,behavior:e,shouldScrollRestoration:r,scrollToTopSelectors:o,location:s}){var i;let c;try{c=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(h){console.error(h);return}const a=n||((i=window.history.state)==null?void 0:i.key),d=c[a];Jt=!0,(()=>{if(r&&d&&Object.keys(d).length>0){for(const l in d){const u=d[l];if(l==="window")window.scrollTo({top:u.scrollY,left:u.scrollX,behavior:e});else if(l){const f=document.querySelector(l);f&&(f.scrollLeft=u.scrollX,f.scrollTop=u.scrollY)}}return}const h=(s??window.location).hash.split("#")[1];if(h){const l=(window.history.state||{}).__hashScrollIntoViewOptions??!0;if(l){const u=document.getElementById(h);u&&u.scrollIntoView(l)}return}["window",...o?.filter(l=>l!=="window")??[]].forEach(l=>{const u=l==="window"?window:typeof l=="function"?l():document.querySelector(l);u&&u.scrollTo({top:0,left:0,behavior:e})})})(),Jt=!1}function an(t,n){if(Wt===void 0||((n??t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),typeof document>"u"||t.isScrollRestorationSetup))return;t.isScrollRestorationSetup=!0,Jt=!1;const r=t.options.getScrollRestorationKey||qt;window.history.scrollRestoration="manual";const o=s=>{if(Jt||!t.isScrollRestoring)return;let i="";if(s.target===document||s.target===window)i="window";else{const a=s.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=on(s.target)}const c=r(t.state.location);Wt.set(a=>{const d=a[c]=a[c]||{},h=d[i]=d[i]||{};if(i==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(i){const l=document.querySelector(i);l&&(h.scrollX=l.scrollLeft||0,h.scrollY=l.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",zn(o,100),!0),t.subscribe("onRendered",s=>{const i=r(s.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}sn({storageKey:Gt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Wt.set(c=>(c[i]=c[i]||{},c))})}function Un(t){if(typeof document<"u"&&document.querySelector){const n=t.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(n)}}}function Hn(t,n){const e=Object.entries(t).flatMap(([o,s])=>Array.isArray(s)?s.map(i=>[o,String(i)]):[[o,String(s)]]),r=new URLSearchParams(e);return(n||"")+r.toString()}function ce(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function Gn(t,n){const e=n?t.slice(n.length):t;return[...new URLSearchParams(e).entries()].reduce((s,[i,c])=>{const a=s[i];return a==null?s[i]=ce(c):s[i]=Array.isArray(a)?[...a,ce(c)]:[a,ce(c)],s},{})}const qn=Yn(JSON.parse),Jn=Xn(JSON.stringify,JSON.parse);function Yn(t){return n=>{n.substring(0,1)==="?"&&(n=n.substring(1));const e=Gn(n);for(const r in e){const o=e[r];if(typeof o=="string")try{e[r]=t(o)}catch{}}return e}}function Xn(t,n){function e(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(typeof r=="string"&&typeof n=="function")try{return n(r),t(r)}catch{}return r}return r=>{r={...r},Object.keys(r).forEach(s=>{const i=r[s];typeof i>"u"||i===void 0?delete r[s]:r[s]=e(i)});const o=Hn(r).toString();return o?`?${o}`:""}}const ot="__root__";function Zn(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument)try{new URL(`${t.href}`),t.reloadDocument=!0}catch{}const n=new Headers(t.headers||{});t.href&&n.get("Location")===null&&n.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:n});if(e.options=t,t.throw)throw e;return e}function st(t){return t instanceof Response&&!!t.options}function Qn(t){const n=new Map;let e,r;const o=s=>{s.next&&(s.prev?(s.prev.next=s.next,s.next.prev=s.prev,s.next=void 0,r&&(r.next=s,s.prev=r)):(s.next.prev=void 0,e=s.next,s.next=void 0,r&&(s.prev=r,r.next=s)),r=s)};return{get(s){const i=n.get(s);if(i)return o(i),i.value},set(s,i){if(n.size>=t&&e){const a=e;n.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===r&&(r=void 0)}const c=n.get(s);if(c)c.value=i,o(c);else{const a={key:s,value:i,prev:r};r&&(r.next=a),r=a,e||(e=a),n.set(s,a)}}}}function tr(t){return t instanceof Error?{name:t.name,message:t.message}:{data:t}}function gt(t){const n=t.resolvedLocation,e=t.location,r=n?.pathname!==e.pathname,o=n?.href!==e.href,s=n?.hash!==e.hash;return{fromLocation:n,toLocation:e,pathChanged:r,hrefChanged:o,hashChanged:s}}class er{constructor(n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{var r;e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const o=this.options;this.options={...this.options,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(s=>[encodeURIComponent(s),s])):void 0,(!this.basepath||e.basepath&&e.basepath!==o.basepath)&&(e.basepath===void 0||e.basepath===""||e.basepath==="/"?this.basepath="/":this.basepath=`/${ae(e.basepath)}`),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history??(this.isServer?Ln({initialEntries:[this.basepath||"/"]}):nn()),this.latestLocation=this.parseLocation()),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),this.__store||(this.__store=new pe(rr(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(s=>!["redirected"].includes(s.status))}}}),an(this)),typeof window<"u"&&"CSS"in window&&typeof((r=window.CSS)==null?void 0:r.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.buildRouteTree=()=>{const{routesById:e,routesByPath:r,flatRoutes:o}=ar({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=r,this.flatRoutes=o;const s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)},this.subscribe=(e,r)=>{const o={eventType:e,fn:r};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=e=>{this.subscribers.forEach(r=>{r.eventType===e.type&&r.fn(e)})},this.parseLocation=(e,r)=>{const o=({pathname:a,search:d,hash:h,state:l})=>{const u=this.options.parseSearch(d),f=this.options.stringifySearch(u);return{pathname:a,searchStr:f,search:nt(e?.search,u),hash:h.split("#").reverse()[0]??"",href:`${a}${f}${h}`,state:nt(e?.state,l)}},s=o(r??this.history.location),{__tempLocation:i,__tempKey:c}=s.state;if(i&&(!c||c===this.tempLocationKey)){const a=o(i);return a.state.key=s.state.key,a.state.__TSR_key=s.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:s}}return s},this.resolvePathWithBase=(e,r)=>Tn({basepath:this.basepath,base:e,to:xe(r),trailingSlash:this.options.trailingSlash,caseSensitive:this.options.caseSensitive,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,r,o)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:r},o):this.matchRoutesInternal(e,r),this.parsePathnameCache=Qn(1e3),this.getMatchedRoutes=(e,r)=>cr({pathname:e,routePathname:r,basepath:this.basepath,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const r=this.getMatch(e);r&&(r.abortController.abort(),this.updateMatch(e,o=>(clearTimeout(o.pendingTimeout),{...o,pendingTimeout:void 0})))},this.cancelMatches=()=>{var e;(e=this.state.pendingMatches)==null||e.forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const r=(s={})=>{var i;const c=s._fromLocation||this.latestLocation,a=this.matchRoutes(c,{_buildLocation:!0}),d=ve(a);let h=d.fullPath;const l=s.to?this.resolvePathWithBase(h,`${s.to}`):this.resolvePathWithBase(h,"."),u=!!s.to&&!We(s.to.toString(),h)&&!We(l,h);s.unsafeRelative==="path"?h=c.pathname:u&&s.from&&(h=s.from);const f=d.search,p={...d.params},m=s.to?this.resolvePathWithBase(h,`${s.to}`):this.resolvePathWithBase(h,".");let v=s.params===!1||s.params===null?{}:(s.params??!0)===!0?p:{...p,...mt(s.params,p)};const g=Dt({path:m,params:v??{},parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(g,{},{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);Object.keys(v).length>0&&w.map(M=>{var y;return((y=M.options.params)==null?void 0:y.stringify)??M.options.stringifyParams}).filter(Boolean).forEach(M=>{v={...v,...M(v)}});const P=Dt({path:m,params:v??{},leaveWildcards:!1,leaveParams:e.leaveParams,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath;let _=f;if(e._includeValidateSearch&&((i=this.options.search)!=null&&i.strict)){let M={};w.forEach(y=>{try{y.options.validateSearch&&(M={...M,...Se(y.options.validateSearch,{...M,..._})??{}})}catch{}}),_=M}_=lr({search:_,dest:s,destRoutes:w,_includeValidateSearch:e._includeValidateSearch}),_=nt(f,_);const $=this.options.stringifySearch(_),I=s.hash===!0?c.hash:s.hash?mt(s.hash,c.hash):void 0,R=I?`#${I}`:"";let x=s.state===!0?c.state:s.state?mt(s.state,c.state):{};return x=nt(c.state,x),{pathname:P,search:_,searchStr:$,state:x,hash:I??"",href:`${P}${$}${R}`,unmaskOnReload:s.unmaskOnReload}},o=(s={},i)=>{var c;const a=r(s);let d=i?r(i):void 0;if(!d){let h={};const l=(c=this.options.routeMasks)==null?void 0:c.find(u=>{const f=ye(this.basepath,a.pathname,{to:u.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return f?(h=f,!0):!1});if(l){const{from:u,...f}=l;i={...Kt(e,["from"]),...f,params:h},d=r(i)}}if(d){const h=r(i);a.maskedLocation=h}return a};return e.mask?o(e,{...Kt(e,["from"]),...e.mask}):o(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:r,...o})=>{const s=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(h=>{o.state[h]=this.latestLocation.state[h]});const d=vt(o.state,this.latestLocation.state);return a.forEach(h=>{delete o.state[h]}),d},i=this.latestLocation.href===o.href,c=this.commitLocationPromise;if(this.commitLocationPromise=Rt(()=>{c?.resolve()}),i&&s())this.load();else{let{maskedLocation:a,hashScrollIntoView:d,...h}=o;a&&(h={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[o.replace?"replace":"push"](h.href,h.state,{ignoreBlocker:r})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:r,hashScrollIntoView:o,viewTransition:s,ignoreBlocker:i,href:c,...a}={})=>{if(c){const h=this.history.location.state.__TSR_index,l=Ct(c,{__TSR_index:e?h:h+1});a.to=l.pathname,a.search=this.options.parseSearch(l.search),a.hash=l.hash.slice(1)}const d=this.buildLocation({...a,_includeValidateSearch:!0});return this.commitLocation({...d,viewTransition:s,replace:e,resetScroll:r,hashScrollIntoView:o,ignoreBlocker:i})},this.navigate=({to:e,reloadDocument:r,href:o,...s})=>{if(!r&&o)try{new URL(`${o}`),r=!0}catch{}if(r){if(!o){const i=this.buildLocation({to:e,...s});o=this.history.createHref(i.href)}return s.replace?window.location.replace(o):window.location.href=o,Promise.resolve()}return this.buildAndCommitLocation({...s,href:o,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.latestLocation=this.parseLocation(this.latestLocation),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),o=s=>{try{return encodeURI(decodeURI(s))}catch{return s}};if(ae(o(this.latestLocation.href))!==ae(o(r.href)))throw Zn({href:r.href})}const e=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:r.cachedMatches.filter(o=>!e.some(s=>s.id===o.id))}))},this.load=async e=>{let r,o,s;for(s=new Promise(i=>{this.startTransition(async()=>{var c;try{this.beforeLoad();const a=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...gt({resolvedLocation:d,location:a})}),this.emit({type:"onBeforeLoad",...gt({resolvedLocation:d,location:a})}),await this.loadMatches({sync:e?.sync,matches:this.state.pendingMatches,location:a,onReady:async()=>{this.startViewTransition(async()=>{let h,l,u;Fe(()=>{this.__store.setState(f=>{const p=f.matches,m=f.pendingMatches||f.matches;return h=p.filter(v=>!m.some(g=>g.id===v.id)),l=m.filter(v=>!p.some(g=>g.id===v.id)),u=p.filter(v=>m.some(g=>g.id===v.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...h.filter(v=>v.status!=="error")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[l,"onEnter"],[u,"onStay"]].forEach(([f,p])=>{f.forEach(m=>{var v,g;(g=(v=this.looseRoutesById[m.routeId].options)[p])==null||g.call(v,m)})})})}})}catch(a){st(a)?(r=a,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):rt(a)&&(o=a),this.__store.setState(d=>({...d,statusCode:r?r.status:o?404:d.matches.some(h=>h.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===s&&((c=this.commitLocationPromise)==null||c.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=s,await s;this.latestLoadPromise&&s!==this.latestLoadPromise;)await this.latestLoadPromise;this.hasNotFoundMatch()&&this.__store.setState(i=>({...i,statusCode:404}))},this.startViewTransition=e=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const s=this.latestLocation,i=this.state.resolvedLocation,c=typeof r.types=="function"?r.types(gt({resolvedLocation:i,location:s})):r.types;o={update:e,types:c}}else o=e;document.startViewTransition(o)}else e()},this.updateMatch=(e,r)=>{var o;const s=(o=this.state.pendingMatches)!=null&&o.some(i=>i.id===e)?"pendingMatches":this.state.matches.some(i=>i.id===e)?"matches":this.state.cachedMatches.some(i=>i.id===e)?"cachedMatches":"";s&&this.__store.setState(i=>{var c;return{...i,[s]:(c=i[s])==null?void 0:c.map(a=>a.id===e?r(a):a)}})},this.getMatch=e=>{var r;const o=s=>s.id===e;return this.state.cachedMatches.find(o)??((r=this.state.pendingMatches)==null?void 0:r.find(o))??this.state.matches.find(o)},this.loadMatches=async({location:e,matches:r,preload:o,onReady:s,updateMatch:i=this.updateMatch,sync:c})=>{let a,d=!1;const h=async()=>{d||(d=!0,await s?.())},l=p=>!!(o&&!this.state.matches.some(m=>m.id===p));!this.isServer&&this.state.matches.some(p=>p._forcePending)&&h();const u=(p,m)=>{var v,g,w;if(st(m)||rt(m)){if(st(m)&&m.redirectHandled&&!m.options.reloadDocument)throw m;if((v=p.beforeLoadPromise)==null||v.resolve(),(g=p.loaderPromise)==null||g.resolve(),i(p.id,P=>({...P,status:st(m)?"redirected":rt(m)?"notFound":"error",isFetching:!1,error:m,beforeLoadPromise:void 0,loaderPromise:void 0})),m.routeId||(m.routeId=p.routeId),(w=p.loadPromise)==null||w.resolve(),st(m))throw d=!0,m.options._fromLocation=e,m.redirectHandled=!0,m=this.resolveRedirect(m),m;if(rt(m))throw this._handleNotFound(r,m,{updateMatch:i}),m}},f=p=>{const m=this.getMatch(p);return!!(!this.isServer&&m._dehydrated||this.isServer&&m.ssr===!1)};try{await new Promise((p,m)=>{(async()=>{var v,g,w,P;try{const _=(R,x,M)=>{var y,L;const{id:C,routeId:T}=r[R],O=this.looseRoutesById[T];if(x instanceof Promise)throw x;x.routerCode=M,a=a??R,u(this.getMatch(C),x);try{(L=(y=O.options).onError)==null||L.call(y,x)}catch(H){x=H,u(this.getMatch(C),x)}i(C,H=>{var b,A;return(b=H.beforeLoadPromise)==null||b.resolve(),(A=H.loadPromise)==null||A.resolve(),{...H,error:x,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController,beforeLoadPromise:void 0}})};for(const[R,{id:x,routeId:M}]of r.entries()){const y=this.getMatch(x),L=(v=r[R-1])==null?void 0:v.id,C=L?this.getMatch(L):void 0,T=this.looseRoutesById[M],O=T.options.pendingMs??this.options.defaultPendingMs;if(this.isServer){let E;if(this.isShell())E=x===ot;else{const V=this.options.defaultSsr??!0;if(C?.ssr===!1)E=!1;else{let J;if(T.options.ssr===void 0)J=V;else if(typeof T.options.ssr=="function"){let Y=function(F,k){return k?{status:"error",error:k}:{status:"success",value:F}};const{search:Q,params:tt}=this.getMatch(x),G={search:Y(Q,y.searchError),params:Y(tt,y.paramsError),location:e,matches:r.map(F=>({index:F.index,pathname:F.pathname,fullPath:F.fullPath,staticData:F.staticData,id:F.id,routeId:F.routeId,search:Y(F.search,F.searchError),params:Y(F.params,F.paramsError),ssr:F.ssr}))};J=await T.options.ssr(G)??V}else J=T.options.ssr;J===!0&&C?.ssr==="data-only"?E="data-only":E=J}}i(x,V=>({...V,ssr:E}))}if(f(x))continue;const H=!!(s&&!this.isServer&&!l(x)&&(T.options.loader||T.options.beforeLoad||ze(T))&&typeof O=="number"&&O!==1/0&&(T.options.pendingComponent??((g=this.options)==null?void 0:g.defaultPendingComponent)));let b=!0;const A=()=>{if(H&&this.getMatch(x).pendingTimeout===void 0){const E=setTimeout(()=>{try{h()}catch{}},O);i(x,V=>({...V,pendingTimeout:E}))}};if(y.beforeLoadPromise||y.loaderPromise){A(),await y.beforeLoadPromise;const E=this.getMatch(x);E.status==="error"?b=!0:E.preload&&(E.status==="redirected"||E.status==="notFound")&&u(E,E.error)}if(b){try{i(x,j=>{const U=j.loadPromise;return{...j,loadPromise:Rt(()=>{U?.resolve()}),beforeLoadPromise:Rt()}});const{paramsError:E,searchError:V}=this.getMatch(x);E&&_(R,E,"PARSE_PARAMS"),V&&_(R,V,"VALIDATE_SEARCH"),A();const J=new AbortController,Y=C?.context??this.options.context??{};i(x,j=>({...j,isFetching:"beforeLoad",fetchCount:j.fetchCount+1,abortController:J,context:{...Y,...j.__routeContext}}));const{search:Q,params:tt,context:G,cause:F}=this.getMatch(x),k=l(x),K={search:Q,abortController:J,params:tt,preload:k,context:G,location:e,navigate:j=>this.navigate({...j,_fromLocation:e}),buildLocation:this.buildLocation,cause:k?"preload":F,matches:r},W=await((P=(w=T.options).beforeLoad)==null?void 0:P.call(w,K));(st(W)||rt(W))&&_(R,W,"BEFORE_LOAD"),i(x,j=>({...j,__beforeLoadContext:W,context:{...Y,...j.__routeContext,...W},abortController:J}))}catch(E){_(R,E,"BEFORE_LOAD")}i(x,E=>{var V;return(V=E.beforeLoadPromise)==null||V.resolve(),{...E,beforeLoadPromise:void 0,isFetching:!1}})}}const $=r.slice(0,a),I=[];$.forEach(({id:R,routeId:x},M)=>{I.push((async()=>{let y=!1,L=!1;const C=this.looseRoutesById[x],T=async()=>{var b,A,E,V,J,Y;const Q=this.getMatch(R);if(!Q)return;const tt={matches:r,match:Q,params:Q.params,loaderData:Q.loaderData},G=await((A=(b=C.options).head)==null?void 0:A.call(b,tt)),F=G?.meta,k=G?.links,K=G?.scripts,W=G?.styles,j=await((V=(E=C.options).scripts)==null?void 0:V.call(E,tt)),U=await((Y=(J=C.options).headers)==null?void 0:Y.call(J,tt));return{meta:F,links:k,headScripts:K,headers:U,scripts:j,styles:W}},O=async()=>{const b=this.getMatch(R);b.minPendingPromise&&await b.minPendingPromise},H=this.getMatch(R);if(f(R)){if(this.isServer){const b=await T();return i(R,A=>({...A,...b})),this.getMatch(R)}}else if(H.loaderPromise){if(H.status==="success"&&!c&&!H.preload)return this.getMatch(R);await H.loaderPromise;const b=this.getMatch(R);b.error&&u(b,b.error)}else{const b=I[M-1],A=()=>{const{params:k,loaderDeps:K,abortController:W,context:j,cause:U}=this.getMatch(R),q=l(R);return{params:k,deps:K,preload:!!q,parentMatchPromise:b,abortController:W,context:j,location:e,navigate:et=>this.navigate({...et,_fromLocation:e}),cause:q?"preload":U,route:C}},E=Date.now()-this.getMatch(R).updatedAt,V=l(R),J=V?C.options.preloadStaleTime??this.options.defaultPreloadStaleTime??3e4:C.options.staleTime??this.options.defaultStaleTime??0,Y=C.options.shouldReload,Q=typeof Y=="function"?Y(A()):Y;i(R,k=>({...k,loaderPromise:Rt(),preload:!!V&&!this.state.matches.some(K=>K.id===R)}));const tt=async()=>{var k,K,W,j;try{try{(!this.isServer||this.isServer&&this.getMatch(R).ssr===!0)&&this.loadRouteChunk(C),i(R,et=>({...et,isFetching:"loader"}));const U=await((K=(k=C.options).loader)==null?void 0:K.call(k,A()));u(this.getMatch(R),U),i(R,et=>({...et,loaderData:U})),await C._lazyPromise;const q=await T();await O(),await C._componentsPromise,i(R,et=>({...et,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...q}))}catch(U){let q=U;await O(),u(this.getMatch(R),U);try{(j=(W=C.options).onError)==null||j.call(W,U)}catch(_t){q=_t,u(this.getMatch(R),_t)}const et=await T();i(R,_t=>({..._t,error:q,status:"error",isFetching:!1,...et}))}}catch(U){const q=await T();i(R,et=>({...et,loaderPromise:void 0,...q})),u(this.getMatch(R),U)}},{status:G,invalid:F}=this.getMatch(R);if(y=G==="success"&&(F||(Q??E>J)),!(V&&C.options.preload===!1))if(y&&!c)L=!0,(async()=>{try{await tt();const{loaderPromise:k,loadPromise:K}=this.getMatch(R);k?.resolve(),K?.resolve(),i(R,W=>({...W,loaderPromise:void 0}))}catch(k){st(k)&&await this.navigate(k.options)}})();else if(G!=="success"||y&&c)await tt();else{const k=await T();i(R,K=>({...K,...k}))}}if(!L){const{loaderPromise:b,loadPromise:A}=this.getMatch(R);b?.resolve(),A?.resolve()}return i(R,b=>(clearTimeout(b.pendingTimeout),{...b,isFetching:L?b.isFetching:!1,loaderPromise:L?b.loaderPromise:void 0,invalid:!1,pendingTimeout:void 0,_dehydrated:void 0})),this.getMatch(R)})())}),await Promise.all(I),p()}catch(_){m(_)}})()}),await h()}catch(p){if(st(p)||rt(p))throw rt(p)&&!o&&await h(),p}return r},this.invalidate=e=>{const r=o=>{var s;return((s=e?.filter)==null?void 0:s.call(e,o))??!0?{...o,invalid:!0,...e?.forcePending||o.status==="error"?{status:"pending",error:void 0}:{}}:o};return this.__store.setState(o=>{var s;return{...o,matches:o.matches.map(r),cachedMatches:o.cachedMatches.map(r),pendingMatches:(s=o.pendingMatches)==null?void 0:s.map(r)}}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>(e.options.href||(e.options.href=this.buildLocation(e.options).href,e.headers.set("Location",e.options.href)),e.headers.get("Location")||e.headers.set("Location",e.options.href),e),this.clearCache=e=>{const r=e?.filter;r!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(s=>!r(s))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=r=>{const o=this.looseRoutesById[r.routeId];if(!o.options.loader)return!0;const s=(r.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=s};this.clearCache({filter:e})},this.loadRouteChunk=e=>(e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:o,...s}=r.options;Object.assign(e.options,s)}):e._lazyPromise=Promise.resolve()),e._componentsPromise===void 0&&(e._componentsPromise=e._lazyPromise.then(()=>Promise.all(cn.map(async r=>{const o=e.options[r];o?.preload&&await o.preload()})))),e._componentsPromise),this.preloadRoute=async e=>{const r=this.buildLocation(e);let o=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:e});const s=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...s,...this.state.cachedMatches.map(c=>c.id)]);Fe(()=>{o.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return o=await this.loadMatches({matches:o,location:r,preload:!0,updateMatch:(c,a)=>{s.has(c)?o=o.map(d=>d.id===c?a(d):d):this.updateMatch(c,a)}}),o}catch(c){if(st(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:r});rt(c)||console.error(c);return}},this.matchRoute=(e,r)=>{const o={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},s=this.buildLocation(o);if(r?.pending&&this.state.status!=="pending")return!1;const c=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=ye(this.basepath,c.pathname,{...r,to:s.pathname},this.parsePathnameCache);return!a||e.params&&!vt(a,e.params,{partial:!0})?!1:a&&(r?.includeSearch??!0)?vt(c.search,s.search,{partial:!0})?a:!1:a},this._handleNotFound=(e,r,{updateMatch:o=this.updateMatch}={})=>{var s;const i=this.routesById[r.routeId??""]??this.routeTree,c={};for(const d of e)c[d.routeId]=d;!i.options.notFoundComponent&&((s=this.options)!=null&&s.defaultNotFoundComponent)&&(i.options.notFoundComponent=this.options.defaultNotFoundComponent),dt(i.options.notFoundComponent);const a=c[i.id];dt(a,"Could not find match for route: "+i.id),o(a.id,d=>({...d,status:"notFound",error:r,isFetching:!1})),r.routerCode==="BEFORE_LOAD"&&i.parentRoute&&(r.routeId=i.parentRoute.id,this._handleNotFound(e,r,{updateMatch:o}))},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...n,caseSensitive:n.caseSensitive??!1,notFoundMode:n.notFoundMode??"fuzzy",stringifySearch:n.stringifySearch??Jn,parseSearch:n.parseSearch??qn}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(n,e){var r;const{foundRoute:o,matchedRoutes:s,routeParams:i}=this.getMatchedRoutes(n.pathname,(r=e?.dest)==null?void 0:r.to);let c=!1;(o?o.path!=="/"&&i["**"]:Lt(n.pathname))&&(this.options.notFoundRoute?s.push(this.options.notFoundRoute):c=!0);const a=(()=>{if(c){if(this.options.notFoundMode!=="root")for(let u=s.length-1;u>=0;u--){const f=s[u];if(f.children)return f.id}return ot}})(),d=s.map(u=>{var f;let p;const m=((f=u.options.params)==null?void 0:f.parse)??u.options.parseParams;if(m)try{const v=m(i);Object.assign(i,v)}catch(v){if(p=new nr(v.message,{cause:v}),e?.throwOnError)throw p;return p}}),h=[],l=u=>u?.id?u.context??this.options.context??{}:this.options.context??{};return s.forEach((u,f)=>{var p,m;const v=h[f-1],[g,w,P]=(()=>{const O=v?.search??n.search,H=v?._strictSearch??{};try{const b=Se(u.options.validateSearch,{...O})??{};return[{...O,...b},{...H,...b},void 0]}catch(b){let A=b;if(b instanceof Yt||(A=new Yt(b.message,{cause:b})),e?.throwOnError)throw A;return[O,{},A]}})(),_=((m=(p=u.options).loaderDeps)==null?void 0:m.call(p,{search:g}))??"",$=_?JSON.stringify(_):"",{usedParams:I,interpolatedPath:R}=Dt({path:u.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),x=Dt({path:u.id,params:i,leaveWildcards:!0,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath+$,M=this.getMatch(x),y=this.state.matches.find(O=>O.routeId===u.id),L=y?"stay":"enter";let C;if(M)C={...M,cause:L,params:y?nt(y.params,i):i,_strictParams:I,search:nt(y?y.search:M.search,g),_strictSearch:w};else{const O=u.options.loader||u.options.beforeLoad||u.lazyFn||ze(u)?"pending":"success";C={id:x,index:f,routeId:u.id,params:y?nt(y.params,i):i,_strictParams:I,pathname:lt([this.basepath,R]),updatedAt:Date.now(),search:y?nt(y.search,g):g,_strictSearch:w,searchError:void 0,status:O,isFetching:!1,error:void 0,paramsError:d[f],__routeContext:{},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:L,loaderDeps:y?nt(y.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},loadPromise:Rt(),fullPath:u.fullPath}}e?.preload||(C.globalNotFound=a===u.id),C.searchError=P;const T=l(v);C.context={...T,...C.__routeContext,...C.__beforeLoadContext},h.push(C)}),h.forEach((u,f)=>{var p,m;const v=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){const w=h[f-1],P=l(w),_={deps:u.loaderDeps,params:u.params,context:P,location:n,navigate:$=>this.navigate({...$,_fromLocation:n}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:h};u.__routeContext=((m=(p=v.options).context)==null?void 0:m.call(p,_))??{},u.context={...P,...u.__routeContext,...u.__beforeLoadContext}}}),h}}class Yt extends Error{}class nr extends Error{}const Ve=t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t;function We(t,n){return Ve(t)===Ve(n)}function xo(t,n){return async(...e)=>(await t())[n||"default"](...e)}function rr(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Se(t,n){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(n);if(e instanceof Promise)throw new Yt("Async validation not supported");if(e.issues)throw new Yt(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(n):typeof t=="function"?t(n):{}}const cn=["component","errorComponent","pendingComponent","notFoundComponent"];function ze(t){var n;for(const e of cn)if((n=t.options[e])!=null&&n.preload)return!0;return!1}const or=.5,sr=.4,ir=.25;function Ke(t,n){return t.prefixSegment&&t.suffixSegment?n+.05:t.prefixSegment?n+.02:t.suffixSegment?n+.01:n}function ar({routeTree:t,initRoute:n}){const e={},r={},o=a=>{a.forEach((d,h)=>{n?.(d,h);const l=e[d.id];if(dt(!l,`Duplicate routes found with id: ${String(d.id)}`),e[d.id]=d,!d.isRoot&&d.path){const f=Lt(d.fullPath);(!r[f]||d.fullPath.endsWith("/"))&&(r[f]=d)}const u=d.children;u?.length&&o(u)})};o([t]);const s=[];Object.values(e).forEach((a,d)=>{var h;if(a.isRoot||!a.path)return;const l=Ce(a.fullPath);let u=Mt(l),f=0;for(;u.length>f+1&&((h=u[f])==null?void 0:h.value)==="/";)f++;f>0&&(u=u.slice(f));let p=0,m=!1;const v=u.map((g,w)=>{if(g.value==="/")return .75;let P;if(g.type===yt?P=or:g.type===bt?(P=sr,p++):g.type===St&&(P=ir),P){for(let _=w+1;_<u.length;_++){const $=u[_];if($.type===ct&&$.value!=="/")return m=!0,Ke(g,P+.2)}return Ke(g,P)}return 1});s.push({child:a,trimmed:l,parsed:u,index:d,scores:v,optionalParamCount:p,hasStaticAfter:m})});const c=s.sort((a,d)=>{const h=Math.min(a.scores.length,d.scores.length);for(let l=0;l<h;l++)if(a.scores[l]!==d.scores[l])return d.scores[l]-a.scores[l];if(a.scores.length!==d.scores.length){if(a.optionalParamCount!==d.optionalParamCount){if(a.hasStaticAfter===d.hasStaticAfter)return a.optionalParamCount-d.optionalParamCount;if(a.hasStaticAfter&&!d.hasStaticAfter)return-1;if(!a.hasStaticAfter&&d.hasStaticAfter)return 1}return d.scores.length-a.scores.length}for(let l=0;l<h;l++)if(a.parsed[l].value!==d.parsed[l].value)return a.parsed[l].value>d.parsed[l].value?1:-1;return a.index-d.index}).map((a,d)=>(a.child.rank=d,a.child));return{routesById:e,routesByPath:r,flatRoutes:c}}function cr({pathname:t,routePathname:n,basepath:e,caseSensitive:r,routesByPath:o,routesById:s,flatRoutes:i,parseCache:c}){let a={};const d=Lt(t),h=p=>{var m;return ye(e,d,{to:p.fullPath,caseSensitive:((m=p.options)==null?void 0:m.caseSensitive)??r,fuzzy:!0},c)};let l=n!==void 0?o[n]:void 0;if(l)a=h(l);else{let p;for(const m of i){const v=h(m);if(v)if(m.path!=="/"&&v["**"])p||(p={foundRoute:m,routeParams:v});else{l=m,a=v;break}}!l&&p&&(l=p.foundRoute,a=p.routeParams)}let u=l||s[ot];const f=[u];for(;u.parentRoute;)u=u.parentRoute,f.push(u);return f.reverse(),{matchedRoutes:f,routeParams:a,foundRoute:l}}function lr({search:t,dest:n,destRoutes:e,_includeValidateSearch:r}){const o=e.reduce((c,a)=>{var d;const h=[];if("search"in a.options)(d=a.options.search)!=null&&d.middlewares&&h.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const l=({search:u,next:f})=>{let p=u;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(p=a.options.preSearchFilters.reduce((v,g)=>g(v),u));const m=f(p);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((v,g)=>g(v),m):m};h.push(l)}if(r&&a.options.validateSearch){const l=({search:u,next:f})=>{const p=f(u);try{return{...p,...Se(a.options.validateSearch,p)??{}}}catch{return p}};h.push(l)}return c.concat(h)},[])??[],s=({search:c})=>n.search?n.search===!0?c:mt(n.search,c):{};o.push(s);const i=(c,a)=>{if(c>=o.length)return a;const d=o[c];return d({search:a,next:l=>i(c+1,l)})};return i(0,t)}const at=Symbol.for("TSR_DEFERRED_PROMISE");function ur(t,n){const e=t;return e[at]||(e[at]={status:"pending"},e.then(r=>{e[at].status="success",e[at].data=r}).catch(r=>{e[at].status="error",e[at].error={data:(n?.serializeError??tr)(r),__isServerError:!0}})),e}const dr="Error preloading route! ☝️",Co=(t,n)=>{const e=n.split(".");let r,o=t;for(;(r=e.shift())!=null&&o!=null;)o=o[r];return o!=null};class ln{constructor(n){if(this.init=e=>{var r,o;this.originalIndex=e.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=(o=(r=this.options).getParentRoute)==null?void 0:o.call(r),i?this._path=ot:this.parentRoute||dt(!1);let c=i?ot:s?.path;c&&c!=="/"&&(c=Ce(c));const a=s?.id||c;let d=i?ot:lt([this.parentRoute.id===ot?"":this.parentRoute.id,a]);c===ot&&(c="/"),d!==ot&&(d=lt(["/",d]));const h=d===ot?"/":lt([this.parentRoute.fullPath,c]);this._path=c,this._id=d,this._fullPath=h,this._to=h},this.clone=e=>{this._path=e._path,this._id=e._id,this._fullPath=e._fullPath,this._to=e._to,this.options.getParentRoute=e.options.getParentRoute,this.children=e.children},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=n||{},this.isRoot=!n?.getParentRoute,n?.id&&n?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class hr{constructor({id:n}){this.notFound=e=>rn({routeId:this.id,...e}),this.id=n}}class fr extends ln{constructor(n){super(n)}}function bo(t){return({search:n,next:e})=>{const r=e(n);return t===!0?{...n,...r}:(t.forEach(o=>{o in r||(r[o]=n[o])}),r)}}function Lo(t){return({search:n,next:e})=>{if(t===!0)return{};const r=e(n);return Array.isArray(t)?t.forEach(o=>{delete r[o]}):Object.entries(t).forEach(([o,s])=>{vt(r[o],s)&&delete r[o]}),r}}const pr=await N("react");function mr({promise:t}){const n=ur(t);if(n[at].status==="pending")throw n;if(n[at].status==="error")throw n[at].error;return[n[at].data,n]}function Mo(t){const n=S.jsx(vr,{...t});return t.fallback?S.jsx(pr.Suspense,{fallback:t.fallback,children:n}):n}function vr(t){const[n]=mr(t);return t.children(n)}const be=await N("react");function Le(t){const n=t.errorComponent??Xt;return S.jsx(gr,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:r})=>e?be.createElement(n,{error:e,reset:r}):t.children})}class gr extends be.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(n){return{resetKey:n.getResetKey()}}static getDerivedStateFromError(n){return{error:n}}reset(){this.setState({error:null})}componentDidUpdate(n,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(n,e){this.props.onCatch&&this.props.onCatch(n,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Xt({error:t}){const[n,e]=be.useState(!1);return S.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[S.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[S.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),S.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(r=>!r),children:n?"Hide Error":"Show Error"})]}),S.jsx("div",{style:{height:".25rem"}}),n?S.jsx("div",{children:S.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?S.jsx("code",{children:t.message}):null})}):null]})}const _e=await N("react");function yr({children:t,fallback:n=null}){return Sr()?S.jsx(_e.Fragment,{children:t}):S.jsx(_e.Fragment,{children:n})}function Sr(){return _e.useSyncExternalStore(_r,()=>!0,()=>!1)}function _r(){return()=>{}}var le={exports:{}},ue={};/**
10
+ * @license React
11
+ * use-sync-external-store-shim/with-selector.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ue;function Rr(){if(Ue)return ue;Ue=1;var t=Ze(),n=Pn();function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;return ue.useSyncExternalStoreWithSelector=function(d,h,l,u,f){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=c(function(){function g(I){if(!w){if(w=!0,P=I,I=u(I),f!==void 0&&m.hasValue){var R=m.value;if(f(R,I))return _=R}return _=I}if(R=_,r(P,I))return R;var x=u(I);return f!==void 0&&f(R,x)?(P=I,R):(P=I,_=x)}var w=!1,P,_,$=l===void 0?null:l;return[function(){return g(h())},$===null?void 0:function(){return g($())}]},[h,l,u,f]);var v=o(d,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),a(v),v},ue}var He;function Pr(){return He||(He=1,le.exports=Rr()),le.exports}var wr=Pr();function xr(t,n=e=>e){return wr.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,n,Cr)}function Cr(t,n){if(Object.is(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(const[r,o]of t)if(!n.has(r)||!Object.is(o,n.get(r)))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(const r of t)if(!n.has(r))return!1;return!0}if(t instanceof Date&&n instanceof Date)return t.getTime()===n.getTime();const e=Object.keys(t);if(e.length!==Object.keys(n).length)return!1;for(let r=0;r<e.length;r++)if(!Object.prototype.hasOwnProperty.call(n,e[r])||!Object.is(t[e[r]],n[e[r]]))return!1;return!0}const br=await N("react"),de=br.createContext(null);function un(){return typeof document>"u"?de:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=de,de)}const Lr=await N("react");function z(t){const n=Lr.useContext(un());return t?.warn,n}const{useRef:Mr}=await N("react");function B(t){const n=z({warn:t?.router===void 0}),e=t?.router||n,r=Mr(void 0);return xr(e.__store,o=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const s=nt(r.current,t.select(o));return r.current=s,s}return t.select(o)}return o})}const dn=await N("react"),Et=dn.createContext(void 0),Er=dn.createContext(void 0),kr=await N("react");function X(t){const n=kr.useContext(t.from?Er:Et);return B({select:r=>{const o=r.matches.find(s=>t.from?t.from===s.routeId:s.id===n);if(dt(!((t.shouldThrow??!0)&&!o),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),o!==void 0)return t.select?t.select(o):o},structuralSharing:t.structuralSharing})}function Zt(t){return X({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:n=>t.select?t.select(n.loaderData):n.loaderData})}function Qt(t){const{select:n,...e}=t;return X({...e,select:r=>n?n(r.loaderDeps):r.loaderDeps})}function te(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:n=>t.select?t.select(n.params):n.params})}function ee(t){return X({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:n=>t.select?t.select(n.search):n.search})}const Re=await N("react");function Ft(t){const{navigate:n,state:e}=z(),r=X({strict:!1,select:o=>o.index});return Re.useCallback(o=>{const s=o.from??t?.from??e.matches[r].fullPath;return n({...o,from:s})},[t?.from,n])}function Eo(t){const n=z(),e=Ft(),r=Re.useRef(null);return Re.useEffect(()=>{r.current!==t&&(e(t),r.current=t)},[n,t,e]),null}const pt=await N("react");function ko(t){const n=pt.useRef(t);return n.current=t,pt.useRef((...r)=>n.current(...r)).current}const jt=typeof window<"u"?pt.useLayoutEffect:pt.useEffect;function he(t){const n=pt.useRef({value:t,prev:null}),e=n.current.value;return t!==e&&(n.current={value:t,prev:e}),n.current.prev}function Ir(t,n,e={},r={}){pt.useEffect(()=>{if(!t.current||r.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([s])=>{n(s)},e);return o.observe(t.current),()=>{o.disconnect()}},[n,e,r.disabled,t])}function Tr(t){const n=pt.useRef(null);return pt.useImperativeHandle(t,()=>n.current,[]),n}const it=await N("react"),{flushSync:$r}=await N("react-dom");function Fr(t,n){const e=z(),[r,o]=it.useState(!1),s=it.useRef(!1),i=Tr(n),{activeProps:c,inactiveProps:a,activeOptions:d,to:h,preload:l,preloadDelay:u,hashScrollIntoView:f,replace:p,startTransition:m,resetScroll:v,viewTransition:g,children:w,target:P,disabled:_,style:$,className:I,onClick:R,onFocus:x,onMouseEnter:M,onMouseLeave:y,onTouchStart:L,ignoreBlocker:C,params:T,search:O,hash:H,state:b,mask:A,reloadDocument:E,unsafeRelative:V,from:J,_fromLocation:Y,...Q}=t,tt=it.useMemo(()=>{try{return new URL(h),"external"}catch{}return"internal"},[h]),G=B({select:D=>D.location.search,structuralSharing:!0}),F=X({strict:!1,select:D=>t.from??D.fullPath}),k=it.useMemo(()=>e.buildLocation({...t,from:F}),[e,G,t._fromLocation,F,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),K=tt==="external",W=t.reloadDocument||K?!1:l??e.options.defaultPreload,j=u??e.options.defaultPreloadDelay??0,U=B({select:D=>{if(K)return!1;if(d?.exact){if(!kn(D.location.pathname,k.pathname,e.basepath))return!1}else{const Z=Ut(D.location.pathname,e.basepath),ht=Ut(k.pathname,e.basepath);if(!(Z.startsWith(ht)&&(Z.length===ht.length||Z[ht.length]==="/")))return!1}return(d?.includeSearch??!0)&&!vt(D.location.search,k.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?D.location.hash===k.hash:!0}}),q=it.useCallback(()=>{e.preloadRoute({...t,from:F}).catch(D=>{console.warn(D),console.warn(dr)})},[e,t.to,t._fromLocation,F,t.search,t.hash,t.params,t.state,t.mask,t.unsafeRelative,t.hashScrollIntoView,t.href,t.ignoreBlocker,t.reloadDocument,t.replace,t.resetScroll,t.viewTransition]),et=it.useCallback(D=>{D?.isIntersecting&&q()},[q]);if(Ir(i,et,jr,{disabled:!!_||W!=="viewport"}),it.useEffect(()=>{s.current||!_&&W==="render"&&(q(),s.current=!0)},[_,q,W]),K)return{...Q,ref:i,type:tt,href:h,...w&&{children:w},...P&&{target:P},..._&&{disabled:_},...$&&{style:$},...I&&{className:I},...R&&{onClick:R},...x&&{onFocus:x},...M&&{onMouseEnter:M},...y&&{onMouseLeave:y},...L&&{onTouchStart:L}};const _t=D=>{if(!_&&!Nr(D)&&!D.defaultPrevented&&(!P||P==="_self")&&D.button===0){D.preventDefault(),$r(()=>{o(!0)});const Z=e.subscribe("onResolved",()=>{Z(),o(!1)});e.navigate({...t,from:F,replace:p,resetScroll:v,hashScrollIntoView:f,startTransition:m,viewTransition:g,ignoreBlocker:C})}},Ee=D=>{_||W&&q()},yn=Ee,Sn=D=>{if(!(_||!W))if(!j)q();else{const Z=D.target;if(kt.has(Z))return;const ht=setTimeout(()=>{kt.delete(Z),q()},j);kt.set(Z,ht)}},_n=D=>{if(_||!W||!j)return;const Z=D.target,ht=kt.get(Z);ht&&(clearTimeout(ht),kt.delete(Z))},Bt=U?mt(c,{})??Br:fe,Ot=U?fe:mt(a,{})??fe,ke=[I,Bt.className,Ot.className].filter(Boolean).join(" "),Ie=($||Bt.style||Ot.style)&&{...$,...Bt.style,...Ot.style};return{...Q,...Bt,...Ot,href:_?void 0:k.maskedLocation?e.history.createHref(k.maskedLocation.href):e.history.createHref(k.href),ref:i,onClick:It([R,_t]),onFocus:It([x,Ee]),onMouseEnter:It([M,Sn]),onMouseLeave:It([y,_n]),onTouchStart:It([L,yn]),disabled:!!_,target:P,...Ie&&{style:Ie},...ke&&{className:ke},..._&&Or,...U&&Ar,...r&&Dr}}const fe={},Br={className:"active"},Or={role:"link","aria-disabled":!0},Ar={"data-status":"active","aria-current":"page"},Dr={"data-transitioning":"transitioning"},kt=new WeakMap,jr={rootMargin:"100px"},It=t=>n=>{t.filter(Boolean).forEach(e=>{n.defaultPrevented||e(n)})};function Io(t){return it.forwardRef(function(e,r){return S.jsx(ne,{...e,_asChild:t,ref:r})})}const ne=it.forwardRef((t,n)=>{const{_asChild:e,...r}=t,{type:o,ref:s,...i}=Fr(r,n),c=typeof r.children=="function"?r.children({isActive:i["data-status"]==="active"}):r.children;return e===void 0&&delete i.disabled,it.createElement(e||"a",{...i,ref:s},c)});function Nr(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}const To=t=>t,Me=await N("react");function $o(t){return new Vr({id:t})}class Vr extends hr{constructor({id:n}){super({id:n}),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>X({from:this.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>ee({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>te({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Qt({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Zt({...e,from:this.id,strict:!1}),this.useNavigate=()=>{const e=z();return Ft({from:e.routesById[this.id].fullPath})},this.notFound=e=>rn({routeId:this.id,...e}),this.Link=Me.forwardRef((e,r)=>{const s=z().routesById[this.id].fullPath;return S.jsx(ne,{ref:r,from:s,...e})})}}class hn extends ln{constructor(n){super(n),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>X({...e,from:this.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>ee({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>te({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Qt({...e,from:this.id}),this.useLoaderData=e=>Zt({...e,from:this.id}),this.useNavigate=()=>Ft({from:this.fullPath}),this.Link=Me.forwardRef((e,r)=>S.jsx(ne,{ref:r,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Wr(t){return new hn(t)}function zr(){return t=>Ur(t)}const Fo=zr;class Kr extends fr{constructor(n){super(n),this.useMatch=e=>X({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>X({...e,from:this.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>ee({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>te({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Qt({...e,from:this.id}),this.useLoaderData=e=>Zt({...e,from:this.id}),this.useNavigate=()=>Ft({from:this.fullPath}),this.Link=Me.forwardRef((e,r)=>S.jsx(ne,{ref:r,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Ur(t){return new Kr(t)}function Bo(t){return t}class Oo extends hn{constructor(n){super({...n,id:"404"})}}function Ge(t){return typeof t=="object"?new qe(t,{silent:!0}).createRoute(t):new qe(t,{silent:!0}).createRoute}class qe{constructor(n,e){this.path=n,this.createRoute=r=>{this.silent;const o=Wr(r);return o.isRoot=!1,o},this.silent=e?.silent}}function Ao(t){return n=>n}class Pe{constructor(n){this.useMatch=e=>X({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>X({from:this.options.id,select:r=>e?.select?e.select(r.context):r.context}),this.useSearch=e=>ee({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>te({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Qt({...e,from:this.options.id}),this.useLoaderData=e=>Zt({...e,from:this.options.id}),this.useNavigate=()=>{const e=z();return Ft({from:e.routesById[this.options.id].fullPath})},this.options=n,this.$$typeof=Symbol.for("react.memo")}}function Do(t){return n=>new Pe({id:t,...n})}function Je(t){return typeof t=="object"?new Pe(t):n=>new Pe({id:t,...n})}const Hr=await N("react");function jo(t,n){let e,r,o,s;const i=()=>(e||(e=t().then(a=>{e=void 0,r=a[n??"default"]}).catch(a=>{if(o=a,En(o)&&o instanceof Error&&typeof window<"u"&&typeof sessionStorage<"u"){const d=`tanstack_router_reload:${o.message}`;sessionStorage.getItem(d)||(sessionStorage.setItem(d,"1"),s=!0)}})),e),c=function(d){if(s)throw window.location.reload(),new Promise(()=>{});if(o)throw o;if(!r)throw i();return Hr.createElement(r,d)};return c.preload=i,c}const Nt=await N("react");function Gr(){const t=z(),n=Nt.useRef({router:t,mounted:!1}),[e,r]=Nt.useState(!1),{hasPendingMatches:o,isLoading:s}=B({select:l=>({isLoading:l.isLoading,hasPendingMatches:l.matches.some(u=>u.status==="pending")}),structuralSharing:!0}),i=he(s),c=s||e||o,a=he(c),d=s||o,h=he(d);return t.startTransition=l=>{r(!0),Nt.startTransition(()=>{l(),r(!1)})},Nt.useEffect(()=>{const l=t.history.subscribe(t.load),u=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Lt(t.latestLocation.href)!==Lt(u.href)&&t.commitLocation({...u,replace:!0}),()=>{l()}},[t,t.history]),jt(()=>{if(typeof window<"u"&&t.ssr||n.current.router===t&&n.current.mounted)return;n.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(u){console.error(u)}})()},[t]),jt(()=>{i&&!s&&t.emit({type:"onLoad",...gt(t.state)})},[i,t,s]),jt(()=>{h&&!d&&t.emit({type:"onBeforeRouteMount",...gt(t.state)})},[d,h,t]),jt(()=>{a&&!c&&(t.emit({type:"onResolved",...gt(t.state)}),t.__store.setState(l=>({...l,status:"idle",resolvedLocation:l.location})),Un(t))},[c,a,t]),null}function qr(t){const n=B({select:e=>`not-found-${e.location.pathname}-${e.status}`});return S.jsx(Le,{getResetKey:()=>n,onCatch:(e,r)=>{var o;if(rt(e))(o=t.onCatch)==null||o.call(t,e,r);else throw e},errorComponent:({error:e})=>{var r;if(rt(e))return(r=t.fallback)==null?void 0:r.call(t,e);throw e},children:t.children})}function Jr(){return S.jsx("p",{children:"Not Found"})}function Pt(t){return S.jsx(S.Fragment,{children:t.children})}function fn(t,n,e){return n.options.notFoundComponent?S.jsx(n.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?S.jsx(t.options.defaultNotFoundComponent,{data:e}):S.jsx(Jr,{})}function Yr({children:t}){return typeof document<"u"?null:S.jsx("script",{className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(`
18
+ `)}})}function Xr(){const t=z(),e=(t.options.getScrollRestorationKey||qt)(t.latestLocation),r=e!==qt(t.latestLocation)?e:void 0;if(!t.isScrollRestoring||!t.isServer)return null;const o={storageKey:Gt,shouldScrollRestoration:!0};return r&&(o.key=r),S.jsx(Yr,{children:`(${sn.toString()})(${JSON.stringify(o)})`})}const ut=await N("react"),pn=ut.memo(function({matchId:n}){var e,r;const o=z(),s=B({select:P=>{const _=P.matches.find($=>$.id===n);return dt(_),Kt(_,["routeId","ssr","_displayPending"])},structuralSharing:!0}),i=o.routesById[s.routeId],c=i.options.pendingComponent??o.options.defaultPendingComponent,a=c?S.jsx(c,{}):null,d=i.options.errorComponent??o.options.defaultErrorComponent,h=i.options.onCatch??o.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??((e=o.options.notFoundRoute)==null?void 0:e.options.component):i.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",f=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??c??(((r=i.options.errorComponent)==null?void 0:r.preload)||u))?ut.Suspense:Pt,p=d?Le:Pt,m=l?qr:Pt,v=B({select:P=>P.loadedAt}),g=B({select:P=>{var _;const $=P.matches.findIndex(I=>I.id===n);return(_=P.matches[$-1])==null?void 0:_.routeId}}),w=i.isRoot?i.options.shellComponent??Pt:Pt;return S.jsxs(w,{children:[S.jsx(Et.Provider,{value:n,children:S.jsx(f,{fallback:a,children:S.jsx(p,{getResetKey:()=>v,errorComponent:d||Xt,onCatch:(P,_)=>{if(rt(P))throw P;h?.(P,_)},children:S.jsx(m,{fallback:P=>{if(!l||P.routeId&&P.routeId!==s.routeId||!P.routeId&&!i.isRoot)throw P;return ut.createElement(l,P)},children:u||s._displayPending?S.jsx(yr,{fallback:a,children:S.jsx(Ye,{matchId:n})}):S.jsx(Ye,{matchId:n})})})})}),g===ot&&o.options.scrollRestoration?S.jsxs(S.Fragment,{children:[S.jsx(Zr,{}),S.jsx(Xr,{})]}):null]})});function Zr(){const t=z(),n=ut.useRef(void 0);return S.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(n.current===void 0||n.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...gt(t.state)}),n.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const Ye=ut.memo(function({matchId:n}){var e,r,o,s,i;const c=z(),{match:a,key:d,routeId:h}=B({select:f=>{const p=f.matches.findIndex(_=>_.id===n),m=f.matches[p],v=m.routeId,g=c.routesById[v].options.remountDeps??c.options.defaultRemountDeps,w=g?.({routeId:v,loaderDeps:m.loaderDeps,params:m._strictParams,search:m._strictSearch});return{key:w?JSON.stringify(w):void 0,routeId:v,match:Kt(m,["id","status","error","_forcePending","_displayPending"])}},structuralSharing:!0}),l=c.routesById[h],u=ut.useMemo(()=>{const f=l.options.component??c.options.defaultComponent;return f?S.jsx(f,{},d):S.jsx(Qr,{})},[d,l.options.component,c.options.defaultComponent]);if(a._displayPending)throw(e=c.getMatch(a.id))==null?void 0:e.displayPendingPromise;if(a._forcePending)throw(r=c.getMatch(a.id))==null?void 0:r.minPendingPromise;if(a.status==="pending"){const f=l.options.pendingMinMs??c.options.defaultPendingMinMs;if(f&&!((o=c.getMatch(a.id))!=null&&o.minPendingPromise)&&!c.isServer){const p=Rt();Promise.resolve().then(()=>{c.updateMatch(a.id,m=>({...m,minPendingPromise:p}))}),setTimeout(()=>{p.resolve(),c.updateMatch(a.id,m=>({...m,minPendingPromise:void 0}))},f)}throw(s=c.getMatch(a.id))==null?void 0:s.loadPromise}if(a.status==="notFound")return dt(rt(a.error)),fn(c,l,a.error);if(a.status==="redirected")throw dt(st(a.error)),(i=c.getMatch(a.id))==null?void 0:i.loadPromise;if(a.status==="error"){if(c.isServer){const f=(l.options.errorComponent??c.options.defaultErrorComponent)||Xt;return S.jsx(f,{error:a.error,reset:void 0,info:{componentStack:""}})}throw a.error}return u}),Qr=ut.memo(function(){const n=z(),e=ut.useContext(Et),r=B({select:d=>{var h;return(h=d.matches.find(l=>l.id===e))==null?void 0:h.routeId}}),o=n.routesById[r],s=B({select:d=>{const l=d.matches.find(u=>u.id===e);return dt(l),l.globalNotFound}}),i=B({select:d=>{var h;const l=d.matches,u=l.findIndex(f=>f.id===e);return(h=l[u+1])==null?void 0:h.id}}),c=n.options.defaultPendingComponent?S.jsx(n.options.defaultPendingComponent,{}):null;if(s)return fn(n,o,void 0);if(!i)return null;const a=S.jsx(pn,{matchId:i});return e===ot?S.jsx(ut.Suspense,{fallback:c,children:a}):a}),re=await N("react");function to(){const t=z(),n=t.options.defaultPendingComponent?S.jsx(t.options.defaultPendingComponent,{}):null,e=t.isServer||typeof document<"u"&&t.ssr?Pt:re.Suspense,r=S.jsxs(e,{fallback:n,children:[!t.isServer&&S.jsx(Gr,{}),S.jsx(eo,{})]});return t.options.InnerWrap?S.jsx(t.options.InnerWrap,{children:r}):r}function eo(){const t=z(),n=B({select:o=>{var s;return(s=o.matches[0])==null?void 0:s.id}}),e=B({select:o=>o.loadedAt}),r=n?S.jsx(pn,{matchId:n}):null;return S.jsx(Et.Provider,{value:n,children:t.options.disableGlobalCatchBoundary?r:S.jsx(Le,{getResetKey:()=>e,errorComponent:Xt,onCatch:o=>{o.message||o.toString()},children:r})})}function no(){const t=z();return B({select:n=>{var e;return[n.location.href,(e=n.resolvedLocation)==null?void 0:e.href,n.status]},structuralSharing:!0}),re.useCallback(n=>{const{pending:e,caseSensitive:r,fuzzy:o,includeSearch:s,...i}=n;return t.matchRoute(i,{pending:e,caseSensitive:r,fuzzy:o,includeSearch:s})},[t])}function No(t){const e=no()(t);return typeof t.children=="function"?t.children(e):e?t.children:null}function mn(t){return B({select:n=>{const e=n.matches;return t?.select?t.select(e):e},structuralSharing:t?.structuralSharing})}function Vo(t){const n=re.useContext(Et);return mn({select:e=>(e=e.slice(0,e.findIndex(r=>r.id===n)),t?.select?t.select(e):e),structuralSharing:t?.structuralSharing})}function Wo(t){const n=re.useContext(Et);return mn({select:e=>(e=e.slice(e.findIndex(r=>r.id===n)+1),t?.select?t.select(e):e),structuralSharing:t?.structuralSharing})}const zo=t=>new ro(t);class ro extends er{constructor(n){super(n)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ge,globalThis.createLazyFileRoute=Je):typeof window<"u"&&(window.createFileRoute=Ge,window.createFileRoute=Je);function oo({router:t,children:n,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const r=un(),o=S.jsx(r.Provider,{value:t,children:n});return t.options.Wrap?S.jsx(t.options.Wrap,{children:o}):o}function Ko({router:t,...n}){return S.jsx(oo,{router:t,...n,children:S.jsx(to,{})})}function vn(){const t=z();an(t,!0)}function Uo(t){return vn(),null}function Ho(t){var n,e;vn();const r=z(),o=t.getKey||qt;let s="";if(t.id)s=`[data-scroll-restoration-id="${t.id}"]`;else{const a=(n=t.getElement)==null?void 0:n.call(t);if(!a)return;s=a instanceof Window?"window":on(a)}const i=o(r.latestLocation),c=(e=Wt)==null?void 0:e.state[i];return c?.[s]}const Xe=await N("react");function so(t,n){if(t===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in t)return t;if(typeof t=="function"){const s=!!(n??!0);return{shouldBlockFn:async()=>s?await t():!1,enableBeforeUnload:s,withResolver:!1}}const e=!!(t.condition??!0),r=t.blockerFn;return{shouldBlockFn:async()=>e&&r!==void 0?await r():e,enableBeforeUnload:e,withResolver:r===void 0}}function io(t,n){const{shouldBlockFn:e,enableBeforeUnload:r=!0,disabled:o=!1,withResolver:s=!1}=so(t,n),i=z(),{history:c}=i,[a,d]=Xe.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return Xe.useEffect(()=>{const h=async l=>{function u(w){const P=i.parseLocation(void 0,w),_=i.getMatchedRoutes(P.pathname,void 0);if(_.foundRoute===void 0)throw new Error(`No route found for location ${w.href}`);return{routeId:_.foundRoute.id,fullPath:_.foundRoute.fullPath,pathname:P.pathname,params:_.routeParams,search:P.search}}const f=u(l.currentLocation),p=u(l.nextLocation),m=await e({action:l.action,current:f,next:p});if(!s)return m;if(!m)return!1;const g=await new Promise(w=>{d({status:"blocked",current:f,next:p,action:l.action,proceed:()=>w(!1),reset:()=>w(!0)})});return d({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),g};return o?void 0:c.block({blockerFn:h,enableBeforeUnload:r})},[e,r,o,s,c,i]),a}const ao=t=>{if("shouldBlockFn"in t)return{...t};const n=!!(t.condition??!0),e=t.blockerFn;return{shouldBlockFn:async()=>n&&e!==void 0?await e():n,enableBeforeUnload:n,withResolver:e===void 0}};function Go(t){const{children:n,...e}=t,r=ao(e),o=io(r);return n?typeof n=="function"?n(o):n:null}function qo(t){return X({...t,select:n=>t.select?t.select(n.context):n.context})}function Jo(t){return B({select:n=>t?.select?t.select(n.location):n.location})}function Yo(){return B({select:t=>t.location.state.__TSR_index!==0})}const co=await N("react");function gn({tag:t,attrs:n,children:e}){switch(t){case"title":return S.jsx("title",{...n,suppressHydrationWarning:!0,children:e});case"meta":return S.jsx("meta",{...n,suppressHydrationWarning:!0});case"link":return S.jsx("link",{...n,suppressHydrationWarning:!0});case"style":return S.jsx("style",{...n,dangerouslySetInnerHTML:{__html:e}});case"script":return S.jsx(lo,{attrs:n,children:e});default:return null}}function lo({attrs:t,children:n}){return co.useEffect(()=>{if(t?.src){const e=document.createElement("script");for(const[r,o]of Object.entries(t))r!=="suppressHydrationWarning"&&o!==void 0&&o!==!1&&e.setAttribute(r,typeof o=="boolean"?"":String(o));return document.head.appendChild(e),()=>{e.parentNode&&e.parentNode.removeChild(e)}}if(typeof n=="string"){const e=document.createElement("script");if(e.textContent=n,t)for(const[r,o]of Object.entries(t))r!=="suppressHydrationWarning"&&o!==void 0&&o!==!1&&e.setAttribute(r,typeof o=="boolean"?"":String(o));return document.head.appendChild(e),()=>{e.parentNode&&e.parentNode.removeChild(e)}}},[t,n]),t?.src&&typeof t.src=="string"?S.jsx("script",{...t,suppressHydrationWarning:!0}):typeof n=="string"?S.jsx("script",{...t,dangerouslySetInnerHTML:{__html:n},suppressHydrationWarning:!0}):null}const uo=await N("react"),{createElement:ho}=await N("react"),fo=()=>{const t=z(),n=B({select:c=>c.matches.map(a=>a.meta).filter(Boolean)}),e=uo.useMemo(()=>{const c=[],a={};let d;return[...n].reverse().forEach(h=>{[...h].reverse().forEach(l=>{if(l)if(l.title)d||(d={tag:"title",children:l.title});else{const u=l.name??l.property;if(u){if(a[u])return;a[u]=!0}c.push({tag:"meta",attrs:{...l}})}})}),d&&c.push(d),c.reverse(),c},[n]),r=B({select:c=>{var a;const d=c.matches.map(u=>u.links).filter(Boolean).flat(1).map(u=>({tag:"link",attrs:{...u}})),h=(a=t.ssr)==null?void 0:a.manifest,l=c.matches.map(u=>{var f;return((f=h?.routes[u.routeId])==null?void 0:f.assets)??[]}).filter(Boolean).flat(1).filter(u=>u.tag==="link").map(u=>({tag:"link",attrs:{...u.attrs,suppressHydrationWarning:!0}}));return[...d,...l]},structuralSharing:!0}),o=B({select:c=>{const a=[];return c.matches.map(d=>t.looseRoutesById[d.routeId]).forEach(d=>{var h,l,u,f;return(f=(u=(l=(h=t.ssr)==null?void 0:h.manifest)==null?void 0:l.routes[d.id])==null?void 0:u.preloads)==null?void 0:f.filter(Boolean).forEach(p=>{a.push({tag:"link",attrs:{rel:"modulepreload",href:p}})})}),a},structuralSharing:!0}),s=B({select:c=>c.matches.map(a=>a.styles).flat(1).filter(Boolean).map(({children:a,...d})=>({tag:"style",attrs:d,children:a})),structuralSharing:!0}),i=B({select:c=>c.matches.map(a=>a.headScripts).flat(1).filter(Boolean).map(({children:a,...d})=>({tag:"script",attrs:{...d},children:a})),structuralSharing:!0});return po([...e,...o,...r,...s,...i],c=>JSON.stringify(c))};function Xo(){return fo().map(n=>ho(gn,{...n,key:`tsr-meta-${JSON.stringify(n)}`}))}function po(t,n){const e=new Set;return t.filter(r=>{const o=n(r);return e.has(o)?!1:(e.add(o),!0)})}const{createElement:mo}=await N("react"),Zo=()=>{const t=z(),n=B({select:o=>{var s;const i=[],c=(s=t.ssr)==null?void 0:s.manifest;return c?(o.matches.map(a=>t.looseRoutesById[a.routeId]).forEach(a=>{var d,h;return(h=(d=c.routes[a.id])==null?void 0:d.assets)==null?void 0:h.filter(l=>l.tag==="script").forEach(l=>{i.push({tag:"script",attrs:l.attrs,children:l.children})})}),i):[]},structuralSharing:!0}),{scripts:e}=B({select:o=>({scripts:o.matches.map(s=>s.scripts).flat(1).filter(Boolean).map(({children:s,...i})=>({tag:"script",attrs:{...i,suppressHydrationWarning:!0},children:s}))}),structuralSharing:!0}),r=[...e,...n];return S.jsx(S.Fragment,{children:r.map((o,s)=>mo(gn,{...o,key:`tsr-scripts-${o.tag}-${s}`}))})};export{gn as Asset,Mo as Await,Go as Block,Le as CatchBoundary,qr as CatchNotFound,yr as ClientOnly,Jr as DefaultGlobalNotFound,Xt as ErrorComponent,qe as FileRoute,Ao as FileRouteLoader,Xo as HeadContent,Pe as LazyRoute,ne as Link,pn as Match,No as MatchRoute,to as Matches,Eo as Navigate,Oo as NotFoundRoute,Qr as Outlet,nr as PathParamError,Kr as RootRoute,hn as Route,Vr as RouteApi,ro as Router,oo as RouterContextProvider,Ko as RouterProvider,Yr as ScriptOnce,Zo as Scripts,Uo as ScrollRestoration,Yt as SearchParamError,at as TSR_DEFERRED_PROMISE,xe as cleanPath,cn as componentTypes,nn as createBrowserHistory,Rt as createControlledPromise,Ge as createFileRoute,Ro as createHashHistory,en as createHistory,Je as createLazyFileRoute,Do as createLazyRoute,Io as createLink,Ln as createMemoryHistory,Ur as createRootRoute,zr as createRootRouteWithContext,Wr as createRoute,Bo as createRouteMask,zo as createRouter,Gn as decode,vt as deepEqual,qn as defaultParseSearch,tr as defaultSerializeError,Jn as defaultStringifySearch,ur as defer,Hn as encode,Po as escapeJSON,mt as functionalUpdate,rr as getInitialRouterState,$o as getRouteApi,un as getRouterContext,Dt as interpolatePath,dt as invariant,Co as isMatch,rt as isNotFound,je as isPlainArray,ge as isPlainObject,st as isRedirect,lt as joinPaths,xo as lazyFn,jo as lazyRouteComponent,To as linkOptions,Nn as matchByPath,Et as matchContext,ye as matchPathname,rn as notFound,Mt as parsePathname,Yn as parseSearchWith,Kt as pick,Zn as redirect,Ht as removeBasepath,nt as replaceEqualDeep,Tn as resolvePath,bo as retainSearchParams,ot as rootRouteId,Fo as rootRouteWithContext,wo as shallow,Xn as stringifySearchWith,Lo as stripSearchParams,ae as trimPath,Ce as trimPathLeft,Lt as trimPathRight,mr as useAwaited,io as useBlocker,Yo as useCanGoBack,Wo as useChildMatches,Ho as useElementScrollRestoration,jt as useLayoutEffect,Fr as useLinkProps,Zt as useLoaderData,Qt as useLoaderDeps,Jo as useLocation,X as useMatch,no as useMatchRoute,mn as useMatches,Ft as useNavigate,te as useParams,Vo as useParentMatches,qo as useRouteContext,z as useRouter,B as useRouterState,ee as useSearch,ko as useStableCallback,_o as warning};
19
+ //# sourceMappingURL=react-router-B5c6YNeC.js.map