ambient-display 1.1.12 → 1.1.15

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 (160) hide show
  1. package/build/client/_app/immutable/chunks/-6v_nyr3.js +5 -0
  2. package/build/client/_app/immutable/chunks/-6v_nyr3.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/-6v_nyr3.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/Bfhjek-f.js +3 -0
  5. package/build/client/_app/immutable/chunks/Bfhjek-f.js.br +0 -0
  6. package/build/client/_app/immutable/chunks/Bfhjek-f.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/C7I4vMbc.js +1 -0
  8. package/build/client/_app/immutable/chunks/C7I4vMbc.js.br +2 -0
  9. package/build/client/_app/immutable/chunks/C7I4vMbc.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/CDVeMiAl.js +1 -0
  11. package/build/client/_app/immutable/chunks/CDVeMiAl.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/CDVeMiAl.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/CvUX3i4L.js +1 -0
  14. package/build/client/_app/immutable/chunks/CvUX3i4L.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/CvUX3i4L.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/D1JCCJf3.js +4 -0
  17. package/build/client/_app/immutable/chunks/D1JCCJf3.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/D1JCCJf3.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/DGTGMr-5.js +2 -0
  20. package/build/client/_app/immutable/chunks/DGTGMr-5.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/DGTGMr-5.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/DnG2xkSB.js +1 -0
  23. package/build/client/_app/immutable/chunks/DnG2xkSB.js.br +2 -0
  24. package/build/client/_app/immutable/chunks/DnG2xkSB.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/EvVuwjft.js +1 -0
  26. package/build/client/_app/immutable/chunks/EvVuwjft.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/EvVuwjft.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/qSIFE6bv.js +1 -0
  29. package/build/client/_app/immutable/chunks/qSIFE6bv.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/qSIFE6bv.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/ynvIH2CR.js +1 -0
  32. package/build/client/_app/immutable/chunks/ynvIH2CR.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/ynvIH2CR.js.gz +0 -0
  34. package/build/client/_app/immutable/entry/app.BnYS1ESK.js +2 -0
  35. package/build/client/_app/immutable/entry/app.BnYS1ESK.js.br +0 -0
  36. package/build/client/_app/immutable/entry/app.BnYS1ESK.js.gz +0 -0
  37. package/build/client/_app/immutable/entry/start.GAUDqQZ9.js +1 -0
  38. package/build/client/_app/immutable/entry/start.GAUDqQZ9.js.br +2 -0
  39. package/build/client/_app/immutable/entry/start.GAUDqQZ9.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js +2 -0
  41. package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js.br +0 -0
  42. package/build/client/_app/immutable/nodes/0.B1ZZMXc6.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/1.CRiXPoo7.js +1 -0
  44. package/build/client/_app/immutable/nodes/1.CRiXPoo7.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/1.CRiXPoo7.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/2.BCvH_-7k.js +1 -0
  47. package/build/client/_app/immutable/nodes/2.BCvH_-7k.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/2.BCvH_-7k.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/3.CkzNUk9P.js +1 -0
  50. package/build/client/_app/immutable/nodes/3.CkzNUk9P.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/3.CkzNUk9P.js.gz +0 -0
  52. package/build/client/_app/version.json +1 -1
  53. package/build/client/_app/version.json.br +0 -0
  54. package/build/client/_app/version.json.gz +0 -0
  55. package/build/server/chunks/{0-CcOQpCXU.js → 0-Bedes_cv.js} +3 -3
  56. package/build/server/chunks/0-Bedes_cv.js.map +1 -0
  57. package/build/server/chunks/1-BRZwGoSV.js +9 -0
  58. package/build/server/chunks/1-BRZwGoSV.js.map +1 -0
  59. package/build/server/chunks/2-B3ii1avX.js +9 -0
  60. package/build/server/chunks/2-B3ii1avX.js.map +1 -0
  61. package/build/server/chunks/3-Cz5Rp48l.js +9 -0
  62. package/build/server/chunks/3-Cz5Rp48l.js.map +1 -0
  63. package/build/server/chunks/LoadingIndicator-BjVqwEwa.js +10 -0
  64. package/build/server/chunks/LoadingIndicator-BjVqwEwa.js.map +1 -0
  65. package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DEM6cLRl.js → LoadingIndicator.svelte_svelte_type_style_lang-CzuFb3Rb.js} +2 -2
  66. package/build/server/chunks/{LoadingIndicator.svelte_svelte_type_style_lang-DEM6cLRl.js.map → LoadingIndicator.svelte_svelte_type_style_lang-CzuFb3Rb.js.map} +1 -1
  67. package/build/server/chunks/{PlayingTracker-CNLMY2hy.js → PlayingTracker-DagWUwKl.js} +3 -3
  68. package/build/server/chunks/{PlayingTracker-CNLMY2hy.js.map → PlayingTracker-DagWUwKl.js.map} +1 -1
  69. package/build/server/chunks/{_layout.svelte-BHhTC2tp.js → _layout.svelte-D_Vfu08M.js} +5 -4
  70. package/build/server/chunks/_layout.svelte-D_Vfu08M.js.map +1 -0
  71. package/build/server/chunks/{_page.svelte-D9L5iBit.js → _page.svelte-CY_oFa2x.js} +15 -16
  72. package/build/server/chunks/_page.svelte-CY_oFa2x.js.map +1 -0
  73. package/build/server/chunks/_page.svelte-Csehl0cs.js +114 -0
  74. package/build/server/chunks/_page.svelte-Csehl0cs.js.map +1 -0
  75. package/build/server/chunks/error.svelte-DGl1DMvJ.js +55 -0
  76. package/build/server/chunks/error.svelte-DGl1DMvJ.js.map +1 -0
  77. package/build/server/chunks/{exports-DAjI6ZSp.js → exports-D0QHgeSL.js} +2 -17
  78. package/build/server/chunks/exports-D0QHgeSL.js.map +1 -0
  79. package/build/server/chunks/{index2-BA59f76P.js → index2-DObisaVF.js} +337 -297
  80. package/build/server/chunks/index2-DObisaVF.js.map +1 -0
  81. package/build/server/index.js +345 -156
  82. package/build/server/index.js.map +1 -1
  83. package/build/server/manifest.js +6 -5
  84. package/build/server/manifest.js.map +1 -1
  85. package/package.json +1 -1
  86. package/server/spotify/auth.js +26 -20
  87. package/server/spotify/index.js +5 -3
  88. package/server/spotify/sdk.js +21 -14
  89. package/server/spotify_auth.json +7 -1
  90. package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js +0 -1
  91. package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js.br +0 -0
  92. package/build/client/_app/immutable/chunks/LoadingIndicator.BukS53i0.js.gz +0 -0
  93. package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js +0 -5
  94. package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js.br +0 -0
  95. package/build/client/_app/immutable/chunks/PlayingTracker.98fc0gbU.js.gz +0 -0
  96. package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js +0 -1
  97. package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js.br +0 -0
  98. package/build/client/_app/immutable/chunks/disclose-version.N57b1q78.js.gz +0 -0
  99. package/build/client/_app/immutable/chunks/entry.ejCVhezY.js +0 -3
  100. package/build/client/_app/immutable/chunks/entry.ejCVhezY.js.br +0 -0
  101. package/build/client/_app/immutable/chunks/entry.ejCVhezY.js.gz +0 -0
  102. package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js +0 -1
  103. package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js.br +0 -0
  104. package/build/client/_app/immutable/chunks/index-client.DV07uIiZ.js.gz +0 -0
  105. package/build/client/_app/immutable/chunks/index.CSSyc5xk.js +0 -4
  106. package/build/client/_app/immutable/chunks/index.CSSyc5xk.js.br +0 -0
  107. package/build/client/_app/immutable/chunks/index.CSSyc5xk.js.gz +0 -0
  108. package/build/client/_app/immutable/chunks/index.DFULH2AN.js +0 -1
  109. package/build/client/_app/immutable/chunks/index.DFULH2AN.js.br +0 -0
  110. package/build/client/_app/immutable/chunks/index.DFULH2AN.js.gz +0 -0
  111. package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js +0 -1
  112. package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js.br +0 -0
  113. package/build/client/_app/immutable/chunks/legacy.DZgMwYuQ.js.gz +0 -0
  114. package/build/client/_app/immutable/chunks/props.DYfFZGja.js +0 -1
  115. package/build/client/_app/immutable/chunks/props.DYfFZGja.js.br +0 -0
  116. package/build/client/_app/immutable/chunks/props.DYfFZGja.js.gz +0 -0
  117. package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js +0 -1
  118. package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js.br +0 -0
  119. package/build/client/_app/immutable/chunks/snippet.BVSCguOu.js.gz +0 -0
  120. package/build/client/_app/immutable/chunks/this.EZLWgc5v.js +0 -1
  121. package/build/client/_app/immutable/chunks/this.EZLWgc5v.js.br +0 -0
  122. package/build/client/_app/immutable/chunks/this.EZLWgc5v.js.gz +0 -0
  123. package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js +0 -1
  124. package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js.br +0 -0
  125. package/build/client/_app/immutable/chunks/utils.BXcQV2KO.js.gz +0 -0
  126. package/build/client/_app/immutable/entry/app.RUcGX1JI.js +0 -2
  127. package/build/client/_app/immutable/entry/app.RUcGX1JI.js.br +0 -0
  128. package/build/client/_app/immutable/entry/app.RUcGX1JI.js.gz +0 -0
  129. package/build/client/_app/immutable/entry/start.BESP6Y2s.js +0 -1
  130. package/build/client/_app/immutable/entry/start.BESP6Y2s.js.br +0 -2
  131. package/build/client/_app/immutable/entry/start.BESP6Y2s.js.gz +0 -0
  132. package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js +0 -2
  133. package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js.br +0 -0
  134. package/build/client/_app/immutable/nodes/0.YOQIp7Zo.js.gz +0 -0
  135. package/build/client/_app/immutable/nodes/1.LDqagCtz.js +0 -1
  136. package/build/client/_app/immutable/nodes/1.LDqagCtz.js.br +0 -0
  137. package/build/client/_app/immutable/nodes/1.LDqagCtz.js.gz +0 -0
  138. package/build/client/_app/immutable/nodes/2.D6pNjKYR.js +0 -1
  139. package/build/client/_app/immutable/nodes/2.D6pNjKYR.js.br +0 -0
  140. package/build/client/_app/immutable/nodes/2.D6pNjKYR.js.gz +0 -0
  141. package/build/client/_app/immutable/nodes/3.C7gikcXT.js +0 -1
  142. package/build/client/_app/immutable/nodes/3.C7gikcXT.js.br +0 -0
  143. package/build/client/_app/immutable/nodes/3.C7gikcXT.js.gz +0 -0
  144. package/build/server/chunks/0-CcOQpCXU.js.map +0 -1
  145. package/build/server/chunks/1-BOId0K8p.js +0 -9
  146. package/build/server/chunks/1-BOId0K8p.js.map +0 -1
  147. package/build/server/chunks/2-Bn-uEZm1.js +0 -9
  148. package/build/server/chunks/2-Bn-uEZm1.js.map +0 -1
  149. package/build/server/chunks/3-D5OhaZz4.js +0 -9
  150. package/build/server/chunks/3-D5OhaZz4.js.map +0 -1
  151. package/build/server/chunks/LoadingIndicator-CW4ord-4.js +0 -10
  152. package/build/server/chunks/LoadingIndicator-CW4ord-4.js.map +0 -1
  153. package/build/server/chunks/_layout.svelte-BHhTC2tp.js.map +0 -1
  154. package/build/server/chunks/_page.svelte-D9L5iBit.js.map +0 -1
  155. package/build/server/chunks/_page.svelte-IR8zDMaR.js +0 -115
  156. package/build/server/chunks/_page.svelte-IR8zDMaR.js.map +0 -1
  157. package/build/server/chunks/error.svelte-BZE1ioPX.js +0 -116
  158. package/build/server/chunks/error.svelte-BZE1ioPX.js.map +0 -1
  159. package/build/server/chunks/exports-DAjI6ZSp.js.map +0 -1
  160. package/build/server/chunks/index2-BA59f76P.js.map +0 -1
@@ -10,12 +10,12 @@ return {
10
10
  assets: new Set(["favicon.ico","favicon.png","icons/144.favicon.png","icons/168.favicon.png","icons/192.favicon.png","icons/48.favicon.png","icons/72.favicon.png","icons/96.favicon.png","manifest.json"]),
11
11
  mimeTypes: {".png":"image/png",".json":"application/json"},
12
12
  _: {
13
- client: {"start":"_app/immutable/entry/start.BESP6Y2s.js","app":"_app/immutable/entry/app.RUcGX1JI.js","imports":["_app/immutable/entry/start.BESP6Y2s.js","_app/immutable/chunks/entry.ejCVhezY.js","_app/immutable/chunks/utils.BXcQV2KO.js","_app/immutable/chunks/index.DFULH2AN.js","_app/immutable/chunks/index-client.DV07uIiZ.js","_app/immutable/entry/app.RUcGX1JI.js","_app/immutable/chunks/utils.BXcQV2KO.js","_app/immutable/chunks/disclose-version.N57b1q78.js","_app/immutable/chunks/props.DYfFZGja.js","_app/immutable/chunks/this.EZLWgc5v.js","_app/immutable/chunks/index-client.DV07uIiZ.js"],"stylesheets":[],"fonts":[],"uses_env_dynamic_public":false},
13
+ client: {start:"_app/immutable/entry/start.GAUDqQZ9.js",app:"_app/immutable/entry/app.BnYS1ESK.js",imports:["_app/immutable/entry/start.GAUDqQZ9.js","_app/immutable/chunks/Bfhjek-f.js","_app/immutable/chunks/CDVeMiAl.js","_app/immutable/chunks/ynvIH2CR.js","_app/immutable/entry/app.BnYS1ESK.js","_app/immutable/chunks/CDVeMiAl.js","_app/immutable/chunks/qSIFE6bv.js","_app/immutable/chunks/CvUX3i4L.js","_app/immutable/chunks/DnG2xkSB.js","_app/immutable/chunks/ynvIH2CR.js"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},
14
14
  nodes: [
15
- __memo(() => import('./chunks/0-CcOQpCXU.js')),
16
- __memo(() => import('./chunks/1-BOId0K8p.js')),
17
- __memo(() => import('./chunks/2-Bn-uEZm1.js')),
18
- __memo(() => import('./chunks/3-D5OhaZz4.js'))
15
+ __memo(() => import('./chunks/0-Bedes_cv.js')),
16
+ __memo(() => import('./chunks/1-BRZwGoSV.js')),
17
+ __memo(() => import('./chunks/2-B3ii1avX.js')),
18
+ __memo(() => import('./chunks/3-Cz5Rp48l.js'))
19
19
  ],
20
20
  routes: [
21
21
  {
@@ -33,6 +33,7 @@ return {
33
33
  endpoint: null
34
34
  }
35
35
  ],
36
+ prerendered_routes: new Set([]),
36
37
  matchers: async () => {
37
38
 
38
39
  return { };
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"favicon.ico\",\"favicon.png\",\"icons/144.favicon.png\",\"icons/168.favicon.png\",\"icons/192.favicon.png\",\"icons/48.favicon.png\",\"icons/72.favicon.png\",\"icons/96.favicon.png\",\"manifest.json\"]),\n\tmimeTypes: {\".png\":\"image/png\",\".json\":\"application/json\"},\n\t_: {\n\t\tclient: {\"start\":\"_app/immutable/entry/start.BESP6Y2s.js\",\"app\":\"_app/immutable/entry/app.RUcGX1JI.js\",\"imports\":[\"_app/immutable/entry/start.BESP6Y2s.js\",\"_app/immutable/chunks/entry.ejCVhezY.js\",\"_app/immutable/chunks/utils.BXcQV2KO.js\",\"_app/immutable/chunks/index.DFULH2AN.js\",\"_app/immutable/chunks/index-client.DV07uIiZ.js\",\"_app/immutable/entry/app.RUcGX1JI.js\",\"_app/immutable/chunks/utils.BXcQV2KO.js\",\"_app/immutable/chunks/disclose-version.N57b1q78.js\",\"_app/immutable/chunks/props.DYfFZGja.js\",\"_app/immutable/chunks/this.EZLWgc5v.js\",\"_app/immutable/chunks/index-client.DV07uIiZ.js\"],\"stylesheets\":[],\"fonts\":[],\"uses_env_dynamic_public\":false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js'))\n\t\t],\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/\",\n\t\t\t\tpattern: /^\\/$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/player\",\n\t\t\t\tpattern: /^\\/player\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\tserver_assets: {}\n\t}\n}\n})();\n\nexport const prerendered = new Set([]);\n\nexport const base = \"\";"],"names":[],"mappings":"AAAY,MAAC,QAAQ,GAAG,CAAC,MAAM;AAC/B,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,CAAC,IAAI,KAAK;AACV,CAAC,OAAO,MAAM,KAAK,MAAM,KAAK,GAAG,EAAE,EAAE,CAAC;AACtC;;AAEA,OAAO;AACP,CAAC,MAAM,EAAE,MAAM;AACf,CAAC,OAAO,EAAE,MAAM;AAChB,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC;AAC5M,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;AAC3D,CAAC,CAAC,EAAE;AACJ,EAAE,MAAM,EAAE,CAAC,OAAO,CAAC,wCAAwC,CAAC,KAAK,CAAC,sCAAsC,CAAC,SAAS,CAAC,CAAC,wCAAwC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,yCAAyC,CAAC,gDAAgD,CAAC,sCAAsC,CAAC,yCAAyC,CAAC,oDAAoD,CAAC,yCAAyC,CAAC,wCAAwC,CAAC,gDAAgD,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,yBAAyB,CAAC,KAAK,CAAC;AACnpB,EAAE,KAAK,EAAE;AACT,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC;AACtC,GAAG;AACH,EAAE,MAAM,EAAE;AACV,GAAG;AACH,IAAI,EAAE,EAAE,GAAG;AACX,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,OAAO,EAAE,eAAe;AAC5B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,GAAG;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
1
+ {"version":3,"file":"manifest.js","sources":["../../.svelte-kit/adapter-node/manifest.js"],"sourcesContent":["export const manifest = (() => {\nfunction __memo(fn) {\n\tlet value;\n\treturn () => value ??= (value = fn());\n}\n\nreturn {\n\tappDir: \"_app\",\n\tappPath: \"_app\",\n\tassets: new Set([\"favicon.ico\",\"favicon.png\",\"icons/144.favicon.png\",\"icons/168.favicon.png\",\"icons/192.favicon.png\",\"icons/48.favicon.png\",\"icons/72.favicon.png\",\"icons/96.favicon.png\",\"manifest.json\"]),\n\tmimeTypes: {\".png\":\"image/png\",\".json\":\"application/json\"},\n\t_: {\n\t\tclient: {start:\"_app/immutable/entry/start.GAUDqQZ9.js\",app:\"_app/immutable/entry/app.BnYS1ESK.js\",imports:[\"_app/immutable/entry/start.GAUDqQZ9.js\",\"_app/immutable/chunks/Bfhjek-f.js\",\"_app/immutable/chunks/CDVeMiAl.js\",\"_app/immutable/chunks/ynvIH2CR.js\",\"_app/immutable/entry/app.BnYS1ESK.js\",\"_app/immutable/chunks/CDVeMiAl.js\",\"_app/immutable/chunks/qSIFE6bv.js\",\"_app/immutable/chunks/CvUX3i4L.js\",\"_app/immutable/chunks/DnG2xkSB.js\",\"_app/immutable/chunks/ynvIH2CR.js\"],stylesheets:[],fonts:[],uses_env_dynamic_public:false},\n\t\tnodes: [\n\t\t\t__memo(() => import('./nodes/0.js')),\n\t\t\t__memo(() => import('./nodes/1.js')),\n\t\t\t__memo(() => import('./nodes/2.js')),\n\t\t\t__memo(() => import('./nodes/3.js'))\n\t\t],\n\t\troutes: [\n\t\t\t{\n\t\t\t\tid: \"/\",\n\t\t\t\tpattern: /^\\/$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 2 },\n\t\t\t\tendpoint: null\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"/player\",\n\t\t\t\tpattern: /^\\/player\\/?$/,\n\t\t\t\tparams: [],\n\t\t\t\tpage: { layouts: [0,], errors: [1,], leaf: 3 },\n\t\t\t\tendpoint: null\n\t\t\t}\n\t\t],\n\t\tprerendered_routes: new Set([]),\n\t\tmatchers: async () => {\n\t\t\t\n\t\t\treturn { };\n\t\t},\n\t\tserver_assets: {}\n\t}\n}\n})();\n\nexport const prerendered = new Set([]);\n\nexport const base = \"\";"],"names":[],"mappings":"AAAY,MAAC,QAAQ,GAAG,CAAC,MAAM;AAC/B,SAAS,MAAM,CAAC,EAAE,EAAE;AACpB,CAAC,IAAI,KAAK;AACV,CAAC,OAAO,MAAM,KAAK,MAAM,KAAK,GAAG,EAAE,EAAE,CAAC;AACtC;;AAEA,OAAO;AACP,CAAC,MAAM,EAAE,MAAM;AACf,CAAC,OAAO,EAAE,MAAM;AAChB,CAAC,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC;AAC5M,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;AAC3D,CAAC,CAAC,EAAE;AACJ,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,wCAAwC,CAAC,GAAG,CAAC,sCAAsC,CAAC,OAAO,CAAC,CAAC,wCAAwC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,sCAAsC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAAC,KAAK,CAAC;AACrhB,EAAE,KAAK,EAAE;AACT,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC,CAAC;AACvC,GAAG,MAAM,CAAC,MAAM,OAAO,wBAAc,CAAC;AACtC,GAAG;AACH,EAAE,MAAM,EAAE;AACV,GAAG;AACH,IAAI,EAAE,EAAE,GAAG;AACX,IAAI,OAAO,EAAE,MAAM;AACnB,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd,IAAI;AACJ,GAAG;AACH,IAAI,EAAE,EAAE,SAAS;AACjB,IAAI,OAAO,EAAE,eAAe;AAC5B,IAAI,MAAM,EAAE,EAAE;AACd,IAAI,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;AAClD,IAAI,QAAQ,EAAE;AACd;AACA,GAAG;AACH,EAAE,kBAAkB,EAAE,IAAI,GAAG,CAAC,EAAE,CAAC;AACjC,EAAE,QAAQ,EAAE,YAAY;AACxB;AACA,GAAG,OAAO,IAAI;AACd,GAAG;AACH,EAAE,aAAa,EAAE;AACjB;AACA;AACA,CAAC;;AAEW,MAAC,WAAW,GAAG,IAAI,GAAG,CAAC,EAAE;;AAEzB,MAAC,IAAI,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ambient-display",
3
- "version": "1.1.12",
3
+ "version": "1.1.15",
4
4
  "description": "Like a spotify jam but much worse, but also much better. If you need it, you'll love it.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,6 +54,30 @@ export const SpotifyAuth = {
54
54
  }
55
55
  };
56
56
 
57
+ export const refreshAuth = async (client_id, client_secret, previous) => {
58
+ const { error, ...token } = await SpotifyAuth.token.refresh(
59
+ client_id,
60
+ client_secret,
61
+ previous.refresh_token,
62
+ previous.access_token
63
+ );
64
+
65
+ if (error) {
66
+ // This is a shot in the dark, but this was throwing sometimes in quick success of accessing, so wondered if its a rate limit thing
67
+ if (error === 'invalid_request') {
68
+ return previous;
69
+ }
70
+
71
+ throw new Error('Invalid token');
72
+ }
73
+
74
+ // Intialise the return with the refresh token, in case it didn't come in the refreshed call. Will get overwritten if it did
75
+ return {
76
+ refresh_token: previous.refresh_token,
77
+ ...token
78
+ };
79
+ };
80
+
57
81
  /**
58
82
  *
59
83
  * @param {OptionsTypes.SpotifyOptions} options
@@ -71,27 +95,9 @@ export async function initialisePreviousAuth({
71
95
  // Parse the object to utilise it
72
96
  const previous = JSON.parse(previousAuth);
73
97
 
74
- const { error, ...token } = await SpotifyAuth.token.refresh(
75
- client_id,
76
- client_secret,
77
- previous.refresh_token,
78
- previous.access_token
79
- );
80
-
81
- if (error) {
82
- // This is a shot in the dark, but this was throwing sometimes in quick success of accessing, so wondered if its a rate limit thing
83
- if (error === 'invalid_request') {
84
- return previous;
85
- }
86
-
87
- throw new Error('Invalid token');
88
- }
98
+ const token = await refreshAuth(client_id, client_secret, previous);
89
99
 
90
- // Intialise the return with the refresh token, in case it didn't come in the refreshed call. Will get overwritten if it did
91
- return {
92
- refresh_token: previous.refresh_token,
93
- ...token
94
- };
100
+ return token;
95
101
  } catch {
96
102
  return false;
97
103
  }
@@ -3,7 +3,7 @@ import { Router } from 'express';
3
3
  import { ERROR } from '../constants.js';
4
4
  import { events } from '../events.js';
5
5
  import { initialisePreviousAuth, SpotifyAuth } from './auth.js';
6
- import { persistSdk } from './sdk.js';
6
+ import { initiateSdk, persistSdk } from './sdk.js';
7
7
  import { catchAndRetry } from '../utils.js';
8
8
 
9
9
  // These scoped items are fixed and necessary for the app to run
@@ -24,7 +24,8 @@ const run = async (sdk, options) => {
24
24
 
25
25
  // If there is, initialise it while also persisting the auth
26
26
  if (refreshedAuth) {
27
- sdk.current = await persistSdk(refreshedAuth, options);
27
+ await persistSdk(refreshedAuth, options);
28
+ sdk.current = initiateSdk(refreshedAuth, options);
28
29
  }
29
30
 
30
31
  // Initalise a sub router
@@ -92,7 +93,8 @@ const run = async (sdk, options) => {
92
93
  );
93
94
  });
94
95
 
95
- sdk.current = await persistSdk(accessTokenJson, options);
96
+ await persistSdk(accessTokenJson, options);
97
+ sdk.current = initiateSdk(accessTokenJson, options);
96
98
 
97
99
  events.system('authenticated');
98
100
 
@@ -5,7 +5,7 @@ import { events } from '../events.js';
5
5
  import { log } from '../logs.js';
6
6
  import * as Types from '../types/index.js';
7
7
  import * as OptionTypes from '../types/options.js';
8
- import { SpotifyAuth } from './auth.js';
8
+ import { refreshAuth, SpotifyAuth } from './auth.js';
9
9
  import { ERROR } from '../constants.js';
10
10
  import path from 'node:path';
11
11
  import { expandAliases, __dirname } from '../utils.js';
@@ -99,7 +99,7 @@ const safeBody = async (resp) => {
99
99
  */
100
100
  export async function persistSdk(
101
101
  accessTokenData,
102
- { spotify: { client_id, client_secret, accessTokenJsonLocation }, verbose }
102
+ { spotify: { accessTokenJsonLocation }, verbose }
103
103
  ) {
104
104
  const p = path.resolve(expandAliases(accessTokenJsonLocation));
105
105
 
@@ -131,20 +131,27 @@ export async function persistSdk(
131
131
 
132
132
  // Persist the access token data to disk
133
133
  await fs.writeFile(p, JSON.stringify(accessTokenData), 'utf-8');
134
+ }
135
+
136
+ /**
137
+ *
138
+ * @param {Types.SpotifyAccessToken} accessTokenData
139
+ * @param {OptionTypes.SpotifyAmbientDisplayOptions} opts
140
+ * @returns
141
+ */
142
+ export function initiateSdk(accessTokenData, opts) {
143
+ const {
144
+ spotify: { client_id, client_secret }
145
+ } = opts;
134
146
 
135
147
  return new SpotifyApi(
136
- new FixedAccessTokenStrategy(
137
- client_id,
138
- accessTokenData,
139
- (_client_id, _client_secret, token) => {
140
- SpotifyAuth.token.refresh(
141
- client_id,
142
- client_secret,
143
- token.refresh_token,
144
- token.access_token
145
- );
146
- }
147
- ),
148
+ new FixedAccessTokenStrategy(client_id, accessTokenData, async (_client_id, token) => {
149
+ const refreshedToken = await refreshAuth(client_id, client_secret, token);
150
+
151
+ await persistSdk(refreshedToken, opts);
152
+
153
+ return refreshedToken;
154
+ }),
148
155
  {
149
156
  deserializer: {
150
157
  async deserialize(response) {
@@ -1 +1,7 @@
1
- {"refresh_token":"AQBAFqcupbCx89_PRsBTqVLMh_-UcwelJnu1FNA1XVLGZPZO9MZIQcfMaaAC_WseRuahnHFufZYJ8tuiT9_DN8xFAq353b0LhWhlWM51nD-LW6ioGM0rU4SJPtyJrTLqliU","access_token":"BQCGuzKADp9mNfAXWhjZXDQPM0mIT-EyII37V41DTzImiVCHrmP3gwhNVccbyHYoHJp5yw-Md0cNjjts2NKx4ZmkgnOu9i7Rh1cYgClbIvITOZe1osYogkQkEdBJeC5dA5EJMkZwdI7UNO4lzEe2nf7nzLX1r2mwTtovt4ekGmkjEsZG6GIzDFbN912vGbxBKRcHYy0R_8LgpRfJgsrdHrpRkuIYUYqHvL61kA","token_type":"Bearer","expires_in":3600,"scope":"user-modify-playback-state user-read-playback-state user-read-currently-playing user-read-email user-read-private"}
1
+ {
2
+ "refresh_token": "AQBAFqcupbCx89_PRsBTqVLMh_-UcwelJnu1FNA1XVLGZPZO9MZIQcfMaaAC_WseRuahnHFufZYJ8tuiT9_DN8xFAq353b0LhWhlWM51nD-LW6ioGM0rU4SJPtyJrTLqliU",
3
+ "access_token": "BQCGuzKADp9mNfAXWhjZXDQPM0mIT-EyII37V41DTzImiVCHrmP3gwhNVccbyHYoHJp5yw-Md0cNjjts2NKx4ZmkgnOu9i7Rh1cYgClbIvITOZe1osYogkQkEdBJeC5dA5EJMkZwdI7UNO4lzEe2nf7nzLX1r2mwTtovt4ekGmkjEsZG6GIzDFbN912vGbxBKRcHYy0R_8LgpRfJgsrdHrpRkuIYUYqHvL61kA",
4
+ "token_type": "Bearer",
5
+ "expires_in": 3600,
6
+ "scope": "user-modify-playback-state user-read-playback-state user-read-currently-playing user-read-email user-read-private"
7
+ }
@@ -1 +0,0 @@
1
- import{q as Ue,h as C,Y as Z,at as ht,ap as ut,F as ft,d as lt,V as dt,aC as Me,W as pt,X as Oe,Z as ee,g as q,ay as yt,aH as $,_ as Fe,f as He,I as _t,Q as Re,aI as Se,aJ as gt,aB as mt,aK as vt,i as wt,ao as bt,aL as de,aM as pe,a0 as Et,N as Ce,aN as $e,aO as kt,aP as At,as as Tt,T as Ot,aQ as Rt,aR as St,z as Ct}from"./utils.BXcQV2KO.js";import{k as Bt,l as Nt,e as xt,o as Lt,p as Pt,a as qt,t as It}from"./disclose-version.N57b1q78.js";import{w as V,d as U}from"./index.DFULH2AN.js";import{b as Dt}from"./props.DYfFZGja.js";function Vt(s,e){if(e){const t=document.body;s.autofocus=!0,Ue(()=>{document.activeElement===t&&s.focus()})}}let te=null;function Xs(s,e){return e}function Ut(s,e,t,r){for(var i=[],n=e.length,o=0;o<n;o++)gt(e[o].e,i,!0);var a=n>0&&i.length===0&&t!==null;if(a){var c=t.parentNode;mt(c),c.append(t),r.clear(),N(s,e[0].prev,e[n-1].next)}vt(i,()=>{for(var m=0;m<n;m++){var d=e[m];a||(r.delete(d.k),N(s,d.prev,d.next)),wt(d.e,!a)}})}function Qs(s,e,t,r,i,n=null){var o=s,a={flags:e,items:new Map,first:null},c=(e&$e)!==0;if(c){var m=s;o=C?Z(ht(m)):m.appendChild(ut())}C&&ft();var d=null,w=!1;lt(()=>{var k=t(),p=dt(k)?k:k==null?[]:Me(k),v=p.length;if(w&&v===0)return;w=v===0;let h=!1;if(C){var S=o.data===pt;S!==(v===0)&&(o=Oe(),Z(o),ee(!1),h=!0)}if(C){for(var l=null,y,g=0;g<v;g++){if(q.nodeType===8&&q.data===yt){o=q,h=!0,ee(!1);break}var E=p[g],u=r(E,g);y=Ke(q,a,l,null,E,u,g,i,e),a.items.set(u,y),l=y}v>0&&Z(Oe())}if(!C){var _=bt;Mt(p,a,o,i,e,(_.f&$)!==0,r)}n!==null&&(v===0?d?Fe(d):d=He(()=>n(o)):d!==null&&_t(d,()=>{d=null})),h&&ee(!0),t()}),C&&(o=q)}function Mt(s,e,t,r,i,n,o,a){var be,Ee,ke,Ae;var c=(i&kt)!==0,m=(i&(de|pe))!==0,d=s.length,w=e.items,k=e.first,p=k,v,h=null,S,l=[],y=[],g,E,u,_;if(c)for(_=0;_<d;_+=1)g=s[_],E=o(g,_),u=w.get(E),u!==void 0&&((be=u.a)==null||be.measure(),(S??(S=new Set)).add(u));for(_=0;_<d;_+=1){if(g=s[_],E=o(g,_),u=w.get(E),u===void 0){var X=p?p.e.nodes_start:t;h=Ke(X,e,h,h===null?e.first:h.next,g,E,_,r,i),w.set(E,h),l=[],y=[],p=h.next;continue}if(m&&Ft(u,g,_,i),u.e.f&$&&(Fe(u.e),c&&((Ee=u.a)==null||Ee.unfix(),(S??(S=new Set)).delete(u))),u!==p){if(v!==void 0&&v.has(u)){if(l.length<y.length){var M=y[0],B;h=M.prev;var we=l[0],Q=l[l.length-1];for(B=0;B<l.length;B+=1)Be(l[B],M,t);for(B=0;B<y.length;B+=1)v.delete(y[B]);N(e,we.prev,Q.next),N(e,h,we),N(e,Q,M),p=M,h=Q,_-=1,l=[],y=[]}else v.delete(u),Be(u,p,t),N(e,u.prev,u.next),N(e,u,h===null?e.first:h.next),N(e,h,u),h=u;continue}for(l=[],y=[];p!==null&&p.k!==E;)(n||!(p.e.f&$))&&(v??(v=new Set)).add(p),y.push(p),p=p.next;if(p===null)continue;u=p}l.push(u),h=u,p=u.next}if(p!==null||v!==void 0){for(var P=v===void 0?[]:Me(v);p!==null;)(n||!(p.e.f&$))&&P.push(p),p=p.next;var G=P.length;if(G>0){var ct=i&$e&&d===0?t:null;if(c){for(_=0;_<G;_+=1)(ke=P[_].a)==null||ke.measure();for(_=0;_<G;_+=1)(Ae=P[_].a)==null||Ae.fix()}Ut(e,P,ct,w)}}c&&Ue(()=>{var Te;if(S!==void 0)for(u of S)(Te=u.a)==null||Te.apply()}),Re.first=e.first&&e.first.e,Re.last=h&&h.e}function Ft(s,e,t,r){r&de&&Se(s.v,e),r&pe?Se(s.i,t):s.i=t}function Ke(s,e,t,r,i,n,o,a,c,m){var d=te,w=(c&de)!==0,k=(c&At)===0,p=w?k?Et(i):Ce(i):i,v=c&pe?Ce(o):o,h={i:v,v:p,k:n,a:null,e:null,prev:t,next:r};te=h;try{return h.e=He(()=>a(s,p,v),C),h.e.prev=t&&t.e,h.e.next=r&&r.e,t===null?e.first=h:(t.next=h,t.e.next=h.e),r!==null&&(r.prev=h,r.e.prev=h.e),h}finally{te=d}}function Be(s,e,t){for(var r=s.next?s.next.e.nodes_start:t,i=e?e.e.nodes_start:t,n=s.e.nodes_start;n!==r;){var o=Tt(n);i.before(n),n=o}}function N(s,e,t){e===null?s.first=t:(e.next=t,e.e.next=t&&t.e),t!==null&&(t.prev=e,t.e.prev=e&&e.e)}function Ht(s,e){e?s.hasAttribute("selected")||s.setAttribute("selected",""):s.removeAttribute("selected")}function $t(s,e,t,r){var i=s.__attributes??(s.__attributes={});C&&(i[e]=s.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&s.nodeName==="LINK")||i[e]!==(i[e]=t)&&(e==="style"&&"__styles"in s&&(s.__styles={}),e==="loading"&&(s[St]=t),t==null?s.removeAttribute(e):typeof t!="string"&&We(s).includes(e)?s[e]=t:s.setAttribute(e,t))}function Gs(s,e,t,r,i=!1,n=!1,o=!1){var a=e||{},c=s.tagName==="OPTION";for(var m in e)m in t||(t[m]=null);var d=We(s),w=s.__attributes??(s.__attributes={});for(const l in t){let y=t[l];if(c&&l==="value"&&y==null){s.value=s.__value="",a[l]=y;continue}var k=a[l];if(y!==k){a[l]=y;var p=l[0]+l[1];if(p!=="$$"){if(p==="on"){const g={},E="$$"+l;let u=l.slice(2);var v=Pt(u);if(Bt(u)&&(u=u.slice(0,-7),g.capture=!0),!v&&k){if(y!=null)continue;s.removeEventListener(u,a[E],g),a[E]=null}if(y!=null)if(v)s[`__${u}`]=y,xt([u]);else{let _=function(X){a[l].call(this,X)};a[E]=Nt(u,s,_,g)}else v&&(s[`__${u}`]=void 0)}else if(l==="style"&&y!=null)s.style.cssText=y+"";else if(l==="autofocus")Vt(s,!!y);else if(l==="__value"||l==="value"&&y!=null)s.value=s[l]=s.__value=y;else if(l==="selected"&&c)Ht(s,y);else{var h=l;i||(h=Lt(h));var S=h==="defaultValue"||h==="defaultChecked";if(y==null&&!n&&!S)if(w[l]=null,h==="value"||h==="checked"){let g=s;if(h==="value"){let E=g.defaultValue;g.removeAttribute(h),g.defaultValue=E}else{let E=g.defaultChecked;g.removeAttribute(h),g.defaultChecked=E}}else s.removeAttribute(l);else S||d.includes(h)&&(n||typeof y!="string")?s[h]=y:typeof y!="function"&&(C&&(h==="src"||h==="href"||h==="srcset")||$t(s,h,y))}l==="style"&&"__styles"in s&&(s.__styles={})}}}return a}var Ne=new Map;function We(s){var e=Ne.get(s.nodeName);if(e)return e;Ne.set(s.nodeName,e=[]);for(var t,r=s,i=Element.prototype;i!==r;){t=Rt(r);for(var n in t)t[n].set&&e.push(n);r=Ot(r)}return e}function Kt(s,e,t){if(t){if(s.classList.contains(e))return;s.classList.add(e)}else{if(!s.classList.contains(e))return;s.classList.remove(e)}}const se=V([]);let xe=0;const Ye={...se,addItem(s){const e=xe+1;return se.update(t=>[...t,{id:e,...s}]),xe=e,()=>Ye.removeItem(e)},removeItem(s){se.update(e=>{const t=e.slice();return t.splice(t.findIndex(r=>r.id===s),1),t})}},Wt=V(!1),Zs=V(!1),Yt=V(!1),ze=V({}),zt=U([ze],([s])=>[s==null?void 0:s.protocol,s==null?void 0:s.origin].join("")),jt=U([ze],([s])=>s.port),Le=s=>Object.values(s).length>0,je=U([Wt,zt,jt],([s,e,t])=>{const r=`${typeof window<"u"?window.location.protocol:"http:"}//${e}:${t}`;return{full:r,naked:[e,t].join(":"),get(i){return`${r}${i}`},endpoint:s||!e?"":`${e}:${t}`,server(i){return`${this.endpoint}${i}`}}}),er=U([je],([s])=>{const e=async(t,r={},i={})=>{try{const n=new URL([s.endpoint.startsWith("http")?"":window.location.origin,s.endpoint,"/api",t].join(""));i.method==="POST"&&Le(r)?i.body=JSON.stringify(r):Le(r)&&(n.search=new URLSearchParams(r).toString());const o=await fetch(n,i),a=await o.json();if(o.status!==200)throw new Error(a);return a}catch(n){throw Ye.addItem({message:"Api Error",type:"error"}),n}};return{health(){return e("/health")},info(){return e("/info")},search(t){return e("/search",{q:t})},artist(t){return e(`/artist/${t}`)},album(t){return e(`/album/${t}`)},addTrack(t,r){return e("/add",{uri:t,name:r})},play(){return e("/play")},pause(){return e("/pause")},skipForward(){return e("/skipForward")},skipBackward(){return e("/skipBackward")}}}),R=Object.create(null);R.open="0";R.close="1";R.ping="2";R.pong="3";R.message="4";R.upgrade="5";R.noop="6";const K=Object.create(null);Object.keys(R).forEach(s=>{K[R[s]]=s});const ae={type:"error",data:"parser error"},Je=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Xe=typeof ArrayBuffer=="function",Qe=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,ye=({type:s,data:e},t,r)=>Je&&e instanceof Blob?t?r(e):Pe(e,r):Xe&&(e instanceof ArrayBuffer||Qe(e))?t?r(e):Pe(new Blob([e]),r):r(R[s]+(e||"")),Pe=(s,e)=>{const t=new FileReader;return t.onload=function(){const r=t.result.split(",")[1];e("b"+(r||""))},t.readAsDataURL(s)};function qe(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let re;function Jt(s,e){if(Je&&s.data instanceof Blob)return s.data.arrayBuffer().then(qe).then(e);if(Xe&&(s.data instanceof ArrayBuffer||Qe(s.data)))return e(qe(s.data));ye(s,!1,t=>{re||(re=new TextEncoder),e(re.encode(t))})}const Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ie.length;s++)D[Ie.charCodeAt(s)]=s;const Xt=s=>{let e=s.length*.75,t=s.length,r,i=0,n,o,a,c;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);const m=new ArrayBuffer(e),d=new Uint8Array(m);for(r=0;r<t;r+=4)n=D[s.charCodeAt(r)],o=D[s.charCodeAt(r+1)],a=D[s.charCodeAt(r+2)],c=D[s.charCodeAt(r+3)],d[i++]=n<<2|o>>4,d[i++]=(o&15)<<4|a>>2,d[i++]=(a&3)<<6|c&63;return m},Qt=typeof ArrayBuffer=="function",_e=(s,e)=>{if(typeof s!="string")return{type:"message",data:Ge(s,e)};const t=s.charAt(0);return t==="b"?{type:"message",data:Gt(s.substring(1),e)}:K[t]?s.length>1?{type:K[t],data:s.substring(1)}:{type:K[t]}:ae},Gt=(s,e)=>{if(Qt){const t=Xt(s);return Ge(t,e)}else return{base64:!0,data:s}},Ge=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},Ze="",Zt=(s,e)=>{const t=s.length,r=new Array(t);let i=0;s.forEach((n,o)=>{ye(n,!1,a=>{r[o]=a,++i===t&&e(r.join(Ze))})})},es=(s,e)=>{const t=s.split(Ze),r=[];for(let i=0;i<t.length;i++){const n=_e(t[i],e);if(r.push(n),n.type==="error")break}return r};function ts(){return new TransformStream({transform(s,e){Jt(s,t=>{const r=t.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,r)}else{i=new Uint8Array(9);const n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(r))}s.data&&typeof s.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let ie;function F(s){return s.reduce((e,t)=>e+t.length,0)}function H(s,e){if(s[0].length===e)return s.shift();const t=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)t[i]=s[0][r++],r===s[0].length&&(s.shift(),r=0);return s.length&&r<s[0].length&&(s[0]=s[0].slice(r)),t}function ss(s,e){ie||(ie=new TextDecoder);const t=[];let r=0,i=-1,n=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(r===0){if(F(t)<1)break;const c=H(t,1);n=(c[0]&128)===128,i=c[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(F(t)<2)break;const c=H(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),r=3}else if(r===2){if(F(t)<8)break;const c=H(t,8),m=new DataView(c.buffer,c.byteOffset,c.length),d=m.getUint32(0);if(d>Math.pow(2,21)-1){a.enqueue(ae);break}i=d*Math.pow(2,32)+m.getUint32(4),r=3}else{if(F(t)<i)break;const c=H(t,i);a.enqueue(_e(n?c:ie.decode(c),e)),r=0}if(i===0||i>s){a.enqueue(ae);break}}}})}const et=4;function b(s){if(s)return rs(s)}function rs(s){for(var e in b.prototype)s[e]=b.prototype[e];return s}b.prototype.on=b.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};b.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};b.prototype.off=b.prototype.removeListener=b.prototype.removeAllListeners=b.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var r,i=0;i<t.length;i++)if(r=t[i],r===e||r.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+s],this};b.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,i=t.length;r<i;++r)t[r].apply(this,e)}return this};b.prototype.emitReserved=b.prototype.emit;b.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};b.prototype.hasListeners=function(s){return!!this.listeners(s).length};const j=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),A=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),is="arraybuffer";function tt(s,...e){return e.reduce((t,r)=>(s.hasOwnProperty(r)&&(t[r]=s[r]),t),{})}const ns=A.setTimeout,os=A.clearTimeout;function J(s,e){e.useNativeTimers?(s.setTimeoutFn=ns.bind(A),s.clearTimeoutFn=os.bind(A)):(s.setTimeoutFn=A.setTimeout.bind(A),s.clearTimeoutFn=A.clearTimeout.bind(A))}const as=1.33;function cs(s){return typeof s=="string"?hs(s):Math.ceil((s.byteLength||s.size)*as)}function hs(s){let e=0,t=0;for(let r=0,i=s.length;r<i;r++)e=s.charCodeAt(r),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(r++,t+=4);return t}function st(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function us(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function fs(s){let e={},t=s.split("&");for(let r=0,i=t.length;r<i;r++){let n=t[r].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}class ls extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class ge extends b{constructor(e){super(),this.writable=!1,J(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,r){return super.emitReserved("error",new ls(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=_e(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=us(e);return t.length?"?"+t:""}}class ds extends ge{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};es(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Zt(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=st()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let rt=!1;try{rt=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ps=rt;function ys(){}class _s extends ds{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let r=location.port;r||(r=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}}class O extends b{constructor(e,t,r){super(),this.createRequest=e,J(this,r),this._opts=r,this._method=r.method||"GET",this._uri=t,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const t=tt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(t);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=O.requestsCount++,O.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ys,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete O.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}O.requestsCount=0;O.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",De);else if(typeof addEventListener=="function"){const s="onpagehide"in A?"pagehide":"unload";addEventListener(s,De,!1)}}function De(){for(let s in O.requests)O.requests.hasOwnProperty(s)&&O.requests[s].abort()}const gs=function(){const s=it({xdomain:!1});return s&&s.responseType!==null}();class ms extends _s{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=gs&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new O(it,this.uri(),e)}}function it(s){const e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||ps))return new XMLHttpRequest}catch{}if(!e)try{return new A[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const nt=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class vs extends ge{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,r=nt?{}:tt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],i=t===e.length-1;ye(r,this.supportsBinary,n=>{try{this.doWrite(r,n)}catch{}i&&j(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=st()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const ne=A.WebSocket||A.MozWebSocket;class ws extends vs{createSocket(e,t,r){return nt?new ne(e,t,r):t?new ne(e,t):new ne(e)}doWrite(e,t){this.ws.send(t)}}class bs extends ge{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=ss(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),i=ts();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const n=()=>{r.read().then(({done:a,value:c})=>{a||(this.onPacket(c),n())}).catch(a=>{})};n();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],i=t===e.length-1;this._writer.write(r).then(()=>{i&&j(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const Es={websocket:ws,webtransport:bs,polling:ms},ks=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,As=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ce(s){if(s.length>8e3)throw"URI too long";const e=s,t=s.indexOf("["),r=s.indexOf("]");t!=-1&&r!=-1&&(s=s.substring(0,t)+s.substring(t,r).replace(/:/g,";")+s.substring(r,s.length));let i=ks.exec(s||""),n={},o=14;for(;o--;)n[As[o]]=i[o]||"";return t!=-1&&r!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=Ts(n,n.path),n.queryKey=Os(n,n.query),n}function Ts(s,e){const t=/\/{2,9}/g,r=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Os(s,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,n){i&&(t[i]=n)}),t}const he=typeof addEventListener=="function"&&typeof removeEventListener=="function",W=[];he&&addEventListener("offline",()=>{W.forEach(s=>s())},!1);class x extends b{constructor(e,t){if(super(),this.binaryType=is,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const r=ce(e);t.hostname=r.host,t.secure=r.protocol==="https"||r.protocol==="wss",t.port=r.port,r.query&&(t.query=r.query)}else t.host&&(t.hostname=ce(t.host).host);J(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=fs(this.opts.query)),he&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},W.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=et,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&x.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",x.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(t+=cs(i)),r>0&&t>this._maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,j(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,r){return this._sendPacket("message",e,t,r),this}send(e,t,r){return this._sendPacket("message",e,t,r),this}_sendPacket(e,t,r,i){if(typeof t=="function"&&(i=t,t=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const n={type:e,data:t,options:r};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}_onError(e){if(x.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),he&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=W.indexOf(this._offlineEventListener);r!==-1&&W.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}x.protocol=et;class Rs extends x{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),r=!1;x.priorWebsocketSuccess=!1;const i=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",w=>{if(!r)if(w.type==="pong"&&w.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;x.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const k=new Error("probe error");k.transport=t.name,this.emitReserved("upgradeError",k)}}))};function n(){r||(r=!0,d(),t.close(),t=null)}const o=w=>{const k=new Error("probe error: "+w);k.transport=t.name,n(),this.emitReserved("upgradeError",k)};function a(){o("transport closed")}function c(){o("socket closed")}function m(w){t&&w.name!==t.name&&n()}const d=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}let Ss=class extends Rs{constructor(e,t={}){const r=typeof e=="object"?e:t;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(i=>Es[i]).filter(i=>!!i)),super(e,r)}};function Cs(s,e="",t){let r=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),r=ce(s)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const n=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+n+":"+r.port+e,r.href=r.protocol+"://"+n+(t&&t.port===r.port?"":":"+r.port),r}const Bs=typeof ArrayBuffer=="function",Ns=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,ot=Object.prototype.toString,xs=typeof Blob=="function"||typeof Blob<"u"&&ot.call(Blob)==="[object BlobConstructor]",Ls=typeof File=="function"||typeof File<"u"&&ot.call(File)==="[object FileConstructor]";function me(s){return Bs&&(s instanceof ArrayBuffer||Ns(s))||xs&&s instanceof Blob||Ls&&s instanceof File}function Y(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,r=s.length;t<r;t++)if(Y(s[t]))return!0;return!1}if(me(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Y(s.toJSON(),!0);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&Y(s[t]))return!0;return!1}function Ps(s){const e=[],t=s.data,r=s;return r.data=ue(t,e),r.attachments=e.length,{packet:r,buffers:e}}function ue(s,e){if(!s)return s;if(me(s)){const t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){const t=new Array(s.length);for(let r=0;r<s.length;r++)t[r]=ue(s[r],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){const t={};for(const r in s)Object.prototype.hasOwnProperty.call(s,r)&&(t[r]=ue(s[r],e));return t}return s}function qs(s,e){return s.data=fe(s.data,e),delete s.attachments,s}function fe(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=fe(s[t],e);else if(typeof s=="object")for(const t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=fe(s[t],e));return s}const Is=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Ds=5;var f;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(f||(f={}));class Vs{constructor(e){this.replacer=e}encode(e){return(e.type===f.EVENT||e.type===f.ACK)&&Y(e)?this.encodeAsBinary({type:e.type===f.EVENT?f.BINARY_EVENT:f.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===f.BINARY_EVENT||e.type===f.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Ps(e),r=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(r),i}}function Ve(s){return Object.prototype.toString.call(s)==="[object Object]"}class ve extends b{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===f.BINARY_EVENT;r||t.type===f.BINARY_ACK?(t.type=r?f.EVENT:f.ACK,this.reconstructor=new Us(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(me(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(f[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===f.BINARY_EVENT||r.type===f.BINARY_ACK){const n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){const n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(n,t)}else r.nsp="/";const i=e.charAt(t+1);if(i!==""&&Number(i)==i){const n=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){const n=this.tryParse(e.substr(t));if(ve.isPayloadValid(r.type,n))r.data=n;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case f.CONNECT:return Ve(t);case f.DISCONNECT:return t===void 0;case f.CONNECT_ERROR:return typeof t=="string"||Ve(t);case f.EVENT:case f.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Is.indexOf(t[0])===-1);case f.ACK:case f.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Us{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=qs(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const Ms=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ve,Encoder:Vs,get PacketType(){return f},protocol:Ds},Symbol.toStringTag,{value:"Module"}));function T(s,e,t){return s.on(e,t),function(){s.off(e,t)}}const Fs=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class at extends b{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[T(e,"open",this.onopen.bind(this)),T(e,"packet",this.onpacket.bind(this)),T(e,"error",this.onerror.bind(this)),T(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var r,i,n;if(Fs.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const o={type:f.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const d=this.ids++,w=t.pop();this._registerAckCallback(d,w),o.id=d}const a=(i=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||i===void 0?void 0:i.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}const n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);t.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(n),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((r,i)=>{const n=(o,a)=>o?i(o):r(a);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:f.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case f.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case f.EVENT:case f.BINARY_EVENT:this.onevent(e);break;case f.ACK:case f.BINARY_ACK:this.onack(e);break;case f.DISCONNECT:this.ondisconnect();break;case f.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...i){r||(r=!0,t.packet({type:f.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:f.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function L(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}L.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=Math.floor(e*10)&1?s+t:s-t}return Math.min(s,this.max)|0};L.prototype.reset=function(){this.attempts=0};L.prototype.setMin=function(s){this.ms=s};L.prototype.setMax=function(s){this.max=s};L.prototype.setJitter=function(s){this.jitter=s};class le extends b{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,J(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new L({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Ms;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ss(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=T(t,"open",function(){r.onopen(),e&&e()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=T(t,"error",n);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(T(e,"ping",this.onping.bind(this)),T(e,"data",this.ondata.bind(this)),T(e,"error",this.onerror.bind(this)),T(e,"close",this.onclose.bind(this)),T(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){j(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new at(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const I={};function z(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};const t=Cs(s,e.path||"/socket.io"),r=t.source,i=t.id,n=t.path,o=I[i]&&n in I[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new le(r,e):(I[i]||(I[i]=new le(r,e)),c=I[i]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(z,{Manager:le,Socket:at,io:z,connect:z});const oe={current:null},sr=U([je,Yt],([s,e])=>{if(!e)return null;const t=z(s.endpoint);return oe.current&&oe.current.disconnect(),oe.current=t,t});var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ir(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Hs(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}const $s={},Ks=Object.freeze(Object.defineProperty({__proto__:null,default:$s},Symbol.toStringTag,{value:"Module"})),nr=Hs(Ks);var Ws=It('<div class="loading svelte-1aqhn4j"><div class="loading-icon svelte-1aqhn4j"></div> <div class="loading-icon svelte-1aqhn4j"></div> <div class="loading-icon svelte-1aqhn4j"></div></div>');function or(s,e){const t=Dt(e,"floating",3,!1);var r=Ws();Ct(()=>Kt(r,"floating",t())),qt(s,r)}export{or as L,je as a,te as b,ze as c,$t as d,er as e,Qs as f,ir as g,Ye as h,Xs as i,Yt as j,sr as k,Wt as l,Zs as m,rr as n,nr as r,Gs as s,Kt as t};