zudoku 0.0.0-f865d81 → 0.0.0-fa903e7

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 (446) hide show
  1. package/dist/app/demo.js +0 -2
  2. package/dist/app/demo.js.map +1 -1
  3. package/dist/app/entry.client.js +14 -0
  4. package/dist/app/entry.client.js.map +1 -1
  5. package/dist/app/entry.server.js +6 -6
  6. package/dist/app/entry.server.js.map +1 -1
  7. package/dist/app/main.d.ts +1 -1
  8. package/dist/app/main.js +2 -2
  9. package/dist/app/main.js.map +1 -1
  10. package/dist/app/standalone.js +0 -2
  11. package/dist/app/standalone.js.map +1 -1
  12. package/dist/cli/cli.js +1 -2
  13. package/dist/cli/cli.js.map +1 -1
  14. package/dist/cli/common/logger.js +9 -0
  15. package/dist/cli/common/logger.js.map +1 -1
  16. package/dist/codegen.d.ts +3 -0
  17. package/dist/codegen.js +45 -0
  18. package/dist/codegen.js.map +1 -0
  19. package/dist/config/validators/InputSidebarSchema.d.ts +10 -10
  20. package/dist/config/validators/validate.d.ts +148 -117
  21. package/dist/config/validators/validate.js +13 -6
  22. package/dist/config/validators/validate.js.map +1 -1
  23. package/dist/index.d.ts +2 -2
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/lib/authentication/AuthenticationPlugin.d.ts +4 -2
  27. package/dist/lib/authentication/AuthenticationPlugin.js +3 -0
  28. package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -1
  29. package/dist/lib/authentication/authentication.d.ts +3 -3
  30. package/dist/lib/authentication/hook.d.ts +5 -4
  31. package/dist/lib/authentication/hook.js +1 -3
  32. package/dist/lib/authentication/hook.js.map +1 -1
  33. package/dist/lib/authentication/providers/auth0.js +12 -11
  34. package/dist/lib/authentication/providers/auth0.js.map +1 -1
  35. package/dist/lib/authentication/providers/openid.d.ts +0 -1
  36. package/dist/lib/authentication/providers/openid.js +11 -26
  37. package/dist/lib/authentication/providers/openid.js.map +1 -1
  38. package/dist/lib/authentication/state.d.ts +25 -4
  39. package/dist/lib/authentication/state.js +28 -3
  40. package/dist/lib/authentication/state.js.map +1 -1
  41. package/dist/lib/authentication/use-broadcast/shared.d.ts +48 -0
  42. package/dist/lib/authentication/use-broadcast/shared.js +243 -0
  43. package/dist/lib/authentication/use-broadcast/shared.js.map +1 -0
  44. package/dist/lib/authentication/use-broadcast/useBroadcast.d.ts +24 -0
  45. package/dist/lib/authentication/use-broadcast/useBroadcast.js +106 -0
  46. package/dist/lib/authentication/use-broadcast/useBroadcast.js.map +1 -0
  47. package/dist/lib/components/Bootstrap.d.ts +3 -1
  48. package/dist/lib/components/Bootstrap.js +10 -4
  49. package/dist/lib/components/Bootstrap.js.map +1 -1
  50. package/dist/lib/components/ClientOnly.d.ts +4 -2
  51. package/dist/lib/components/ClientOnly.js +1 -1
  52. package/dist/lib/components/ClientOnly.js.map +1 -1
  53. package/dist/lib/components/DeveloperHint.js +2 -1
  54. package/dist/lib/components/DeveloperHint.js.map +1 -1
  55. package/dist/lib/components/Header.js +16 -10
  56. package/dist/lib/components/Header.js.map +1 -1
  57. package/dist/lib/components/Heading.d.ts +1 -1
  58. package/dist/lib/components/Layout.js +12 -4
  59. package/dist/lib/components/Layout.js.map +1 -1
  60. package/dist/lib/components/MobileTopNavigation.js +6 -7
  61. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  62. package/dist/lib/components/SyntaxHighlight.js +16 -12
  63. package/dist/lib/components/SyntaxHighlight.js.map +1 -1
  64. package/dist/lib/components/ThemeSwitch.d.ts +1 -0
  65. package/dist/lib/components/ThemeSwitch.js +13 -0
  66. package/dist/lib/components/ThemeSwitch.js.map +1 -0
  67. package/dist/lib/components/TopNavigation.d.ts +2 -0
  68. package/dist/lib/components/TopNavigation.js +13 -7
  69. package/dist/lib/components/TopNavigation.js.map +1 -1
  70. package/dist/lib/components/{DevPortal.d.ts → Zudoku.d.ts} +3 -3
  71. package/dist/lib/components/{DevPortal.js → Zudoku.js} +13 -14
  72. package/dist/lib/components/Zudoku.js.map +1 -0
  73. package/dist/lib/components/context/ZudokuContext.d.ts +7 -7
  74. package/dist/lib/components/context/ZudokuContext.js +8 -13
  75. package/dist/lib/components/context/ZudokuContext.js.map +1 -1
  76. package/dist/lib/components/context/ZudokuProvider.d.ts +2 -2
  77. package/dist/lib/components/context/ZudokuProvider.js.map +1 -1
  78. package/dist/lib/components/index.d.ts +18 -10
  79. package/dist/lib/components/index.js +2 -3
  80. package/dist/lib/components/index.js.map +1 -1
  81. package/dist/lib/components/navigation/Sidebar.js +1 -1
  82. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  83. package/dist/lib/components/navigation/utils.js +2 -2
  84. package/dist/lib/components/navigation/utils.js.map +1 -1
  85. package/dist/lib/core/{DevPortalContext.d.ts → ZudokuContext.d.ts} +3 -7
  86. package/dist/lib/core/{DevPortalContext.js → ZudokuContext.js} +2 -7
  87. package/dist/lib/core/ZudokuContext.js.map +1 -0
  88. package/dist/lib/core/plugins.d.ts +18 -12
  89. package/dist/lib/core/plugins.js.map +1 -1
  90. package/dist/lib/errors/ErrorAlert.js +1 -1
  91. package/dist/lib/errors/ErrorAlert.js.map +1 -1
  92. package/dist/lib/oas/graphql/index.js +4 -4
  93. package/dist/lib/oas/graphql/index.js.map +1 -1
  94. package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
  95. package/dist/lib/oas/parser/upgrade/index.js +2 -17
  96. package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
  97. package/dist/lib/plugins/api-keys/index.d.ts +9 -9
  98. package/dist/lib/plugins/api-keys/index.js +3 -0
  99. package/dist/lib/plugins/api-keys/index.js.map +1 -1
  100. package/dist/lib/plugins/custom-pages/index.d.ts +2 -2
  101. package/dist/lib/plugins/custom-pages/index.js.map +1 -1
  102. package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
  103. package/dist/lib/plugins/markdown/MdxPage.js +14 -1
  104. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  105. package/dist/lib/plugins/markdown/index.d.ts +2 -2
  106. package/dist/lib/plugins/markdown/index.js +1 -1
  107. package/dist/lib/plugins/markdown/index.js.map +1 -1
  108. package/dist/lib/plugins/openapi/CollapsibleCode.d.ts +5 -0
  109. package/dist/lib/plugins/openapi/CollapsibleCode.js +24 -0
  110. package/dist/lib/plugins/openapi/CollapsibleCode.js.map +1 -0
  111. package/dist/lib/plugins/openapi/ColorizedParam.js +13 -9
  112. package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -1
  113. package/dist/lib/plugins/openapi/Endpoint.d.ts +1 -1
  114. package/dist/lib/plugins/openapi/Endpoint.js +5 -9
  115. package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
  116. package/dist/lib/plugins/openapi/OperationList.d.ts +2 -2
  117. package/dist/lib/plugins/openapi/OperationList.js +21 -22
  118. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  119. package/dist/lib/plugins/openapi/ParameterListItem.js +6 -1
  120. package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
  121. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +7 -3
  122. package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  123. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js +9 -2
  124. package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  125. package/dist/lib/plugins/openapi/Route.d.ts +4 -4
  126. package/dist/lib/plugins/openapi/Route.js +2 -4
  127. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  128. package/dist/lib/plugins/openapi/Sidecar.d.ts +1 -1
  129. package/dist/lib/plugins/openapi/Sidecar.js +35 -33
  130. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  131. package/dist/lib/plugins/openapi/client/GraphQLClient.d.ts +8 -0
  132. package/dist/lib/plugins/openapi/client/GraphQLClient.js +114 -0
  133. package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -0
  134. package/dist/lib/plugins/openapi/client/GraphQLContext.d.ts +7 -0
  135. package/dist/lib/plugins/openapi/client/GraphQLContext.js +5 -0
  136. package/dist/lib/plugins/openapi/client/GraphQLContext.js.map +1 -0
  137. package/dist/lib/plugins/openapi/client/createServer.d.ts +1 -0
  138. package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +5 -0
  139. package/dist/lib/plugins/openapi/client/useCreateQuery.js +15 -0
  140. package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -0
  141. package/dist/lib/plugins/openapi/client/worker.d.ts +4 -1
  142. package/dist/lib/plugins/openapi/client/worker.js +23 -14
  143. package/dist/lib/plugins/openapi/client/worker.js.map +1 -1
  144. package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +3 -3
  145. package/dist/lib/plugins/openapi/graphql/fragment-masking.js +3 -4
  146. package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  147. package/dist/lib/plugins/openapi/graphql/gql.d.ts +5 -51
  148. package/dist/lib/plugins/openapi/graphql/gql.js +4 -2
  149. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  150. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +32 -8
  151. package/dist/lib/plugins/openapi/graphql/graphql.js +194 -662
  152. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  153. package/dist/lib/plugins/openapi/index.d.ts +2 -2
  154. package/dist/lib/plugins/openapi/index.js +40 -53
  155. package/dist/lib/plugins/openapi/index.js.map +1 -1
  156. package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
  157. package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
  158. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
  159. package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
  160. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
  161. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
  162. package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
  163. package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
  164. package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
  165. package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
  166. package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
  167. package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
  168. package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
  169. package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
  170. package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
  171. package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
  172. package/dist/lib/plugins/openapi/schema/SchemaView.js +2 -1
  173. package/dist/lib/plugins/openapi/schema/SchemaView.js.map +1 -1
  174. package/dist/lib/plugins/openapi/util/generateSchemaExample.d.ts +0 -1
  175. package/dist/lib/plugins/openapi/util/generateSchemaExample.js +25 -36
  176. package/dist/lib/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  177. package/dist/lib/plugins/openapi-worker.d.ts +1 -1
  178. package/dist/lib/plugins/openapi-worker.js +7 -1
  179. package/dist/lib/plugins/openapi-worker.js.map +1 -1
  180. package/dist/lib/plugins/redirect/index.d.ts +4 -7
  181. package/dist/lib/plugins/redirect/index.js +1 -1
  182. package/dist/lib/plugins/redirect/index.js.map +1 -1
  183. package/dist/lib/plugins/search-inkeep/index.d.ts +2 -2
  184. package/dist/lib/plugins/search-inkeep/index.js.map +1 -1
  185. package/dist/lib/ui/ActionButton.d.ts +4 -0
  186. package/dist/lib/ui/ActionButton.js +10 -0
  187. package/dist/lib/ui/ActionButton.js.map +1 -0
  188. package/dist/lib/util/MdxComponents.d.ts +1 -1
  189. package/dist/lib/util/traverse.d.ts +2 -0
  190. package/dist/lib/util/traverse.js +18 -0
  191. package/dist/lib/util/traverse.js.map +1 -0
  192. package/dist/lib/util/useIsomorphicLayoutEffect.d.ts +3 -0
  193. package/dist/lib/util/useIsomorphicLayoutEffect.js +4 -0
  194. package/dist/lib/util/useIsomorphicLayoutEffect.js.map +1 -0
  195. package/dist/lib/util/useOnScreen.d.ts +4 -0
  196. package/dist/lib/util/useOnScreen.js +19 -0
  197. package/dist/lib/util/useOnScreen.js.map +1 -0
  198. package/dist/vite/build.js +5 -1
  199. package/dist/vite/build.js.map +1 -1
  200. package/dist/vite/config.d.ts +2 -8
  201. package/dist/vite/config.js +25 -54
  202. package/dist/vite/config.js.map +1 -1
  203. package/dist/vite/config.test.js +3 -4
  204. package/dist/vite/config.test.js.map +1 -1
  205. package/dist/vite/html.js +0 -2
  206. package/dist/vite/html.js.map +1 -1
  207. package/dist/vite/output.d.ts +101 -0
  208. package/dist/vite/output.js +53 -0
  209. package/dist/vite/output.js.map +1 -0
  210. package/dist/vite/plugin-api.js +23 -19
  211. package/dist/vite/plugin-api.js.map +1 -1
  212. package/dist/vite/plugin-component.js +14 -19
  213. package/dist/vite/plugin-component.js.map +1 -1
  214. package/dist/vite/plugin-config.d.ts +2 -3
  215. package/dist/vite/plugin-config.js +2 -3
  216. package/dist/vite/plugin-config.js.map +1 -1
  217. package/dist/vite/plugin-docs.test.js +15 -23
  218. package/dist/vite/plugin-docs.test.js.map +1 -1
  219. package/dist/vite/plugin-mdx.d.ts +0 -6
  220. package/dist/vite/plugin-mdx.js +13 -5
  221. package/dist/vite/plugin-mdx.js.map +1 -1
  222. package/dist/vite/plugin.js +1 -3
  223. package/dist/vite/plugin.js.map +1 -1
  224. package/dist/vite/prerender.js +3 -2
  225. package/dist/vite/prerender.js.map +1 -1
  226. package/dist/vite/remarkStaticGeneration.d.ts +3 -0
  227. package/dist/vite/remarkStaticGeneration.js +125 -0
  228. package/dist/vite/remarkStaticGeneration.js.map +1 -0
  229. package/dist/zuplo/with-zuplo.d.ts +3 -0
  230. package/dist/zuplo/with-zuplo.js +28 -0
  231. package/dist/zuplo/with-zuplo.js.map +1 -0
  232. package/lib/{AnchorLink-BbB2q-jx.js → AnchorLink-CDlhr8gL.js} +11 -10
  233. package/lib/{AnchorLink-BbB2q-jx.js.map → AnchorLink-CDlhr8gL.js.map} +1 -1
  234. package/lib/AuthenticationPlugin-D0Em0SwR.js +59 -0
  235. package/lib/{AuthenticationPlugin-C9BHGXlE.js.map → AuthenticationPlugin-D0Em0SwR.js.map} +1 -1
  236. package/lib/Button-jK0EsymC.js +48 -0
  237. package/lib/Button-jK0EsymC.js.map +1 -0
  238. package/lib/{ClientOnly-CVN6leDu.js → ClientOnly-E7hGysn1.js} +4 -4
  239. package/lib/ClientOnly-E7hGysn1.js.map +1 -0
  240. package/lib/Markdown-ievDDhFT.js +15192 -0
  241. package/lib/Markdown-ievDDhFT.js.map +1 -0
  242. package/lib/MdxPage-B2FpJ9KC.js +183 -0
  243. package/lib/MdxPage-B2FpJ9KC.js.map +1 -0
  244. package/lib/OperationList-BkNQEsNs.js +4693 -0
  245. package/lib/OperationList-BkNQEsNs.js.map +1 -0
  246. package/lib/Route-DlG_HTMu.js +11 -0
  247. package/lib/Route-DlG_HTMu.js.map +1 -0
  248. package/lib/{Select-Bagt3Bme.js → Select-O9ZM3ZgX.js} +7 -7
  249. package/lib/Select-O9ZM3ZgX.js.map +1 -0
  250. package/lib/{Spinner-C6zroowC.js → SidebarBadge-DxFJcJ6V.js} +28 -17
  251. package/lib/SidebarBadge-DxFJcJ6V.js.map +1 -0
  252. package/lib/SlotletProvider-DyomlzGx.js +252 -0
  253. package/lib/SlotletProvider-DyomlzGx.js.map +1 -0
  254. package/lib/Spinner-3cQDBVGr.js +7 -0
  255. package/lib/Spinner-3cQDBVGr.js.map +1 -0
  256. package/lib/SyntaxHighlight-DkLOsjHS.js +2983 -0
  257. package/lib/SyntaxHighlight-DkLOsjHS.js.map +1 -0
  258. package/lib/assets/{worker-Bf8vjASY.js → worker-BHClFO3A.js} +156 -156
  259. package/lib/assets/worker-BHClFO3A.js.map +1 -0
  260. package/lib/context-D1nXWxm7.js +22 -0
  261. package/lib/context-D1nXWxm7.js.map +1 -0
  262. package/lib/createServer-CpJlUPtn.js +15299 -0
  263. package/lib/createServer-CpJlUPtn.js.map +1 -0
  264. package/lib/{hook-sn0zMTkE.js → hook-hEqe7fPB.js} +12 -14
  265. package/lib/hook-hEqe7fPB.js.map +1 -0
  266. package/lib/index-C7SaIME0.js +1277 -0
  267. package/lib/index-C7SaIME0.js.map +1 -0
  268. package/lib/index-Czzd9rjU.js +899 -0
  269. package/lib/index-Czzd9rjU.js.map +1 -0
  270. package/lib/index-Yn8c3UWE.js +921 -0
  271. package/lib/index-Yn8c3UWE.js.map +1 -0
  272. package/lib/object_hash-CvlLgU-M.js +785 -0
  273. package/lib/object_hash-CvlLgU-M.js.map +1 -0
  274. package/lib/post-processors/removeExtensions.js +11 -0
  275. package/lib/post-processors/removeExtensions.js.map +1 -0
  276. package/lib/post-processors/removePaths.js +28 -0
  277. package/lib/post-processors/removePaths.js.map +1 -0
  278. package/lib/post-processors/traverse.js +12 -0
  279. package/lib/post-processors/traverse.js.map +1 -0
  280. package/lib/{router-BsfSoK2j.js → router-lfyopgBI.js} +23 -23
  281. package/lib/{router-BsfSoK2j.js.map → router-lfyopgBI.js.map} +1 -1
  282. package/lib/state-tsXBLONe.js +203 -0
  283. package/lib/{state-CsuHT8ZO.js.map → state-tsXBLONe.js.map} +1 -1
  284. package/lib/ui/ActionButton.js +25 -0
  285. package/lib/ui/ActionButton.js.map +1 -0
  286. package/lib/useExposedProps-CTPtylCV.js +10 -0
  287. package/lib/{useExposedProps-ChOIUaS4.js.map → useExposedProps-CTPtylCV.js.map} +1 -1
  288. package/lib/{ZudokuContext-BKXGJTmu.js → utils-DcpDOncX.js} +242 -246
  289. package/lib/utils-DcpDOncX.js.map +1 -0
  290. package/lib/zudoku.auth-auth0.js +24 -18
  291. package/lib/zudoku.auth-auth0.js.map +1 -1
  292. package/lib/zudoku.auth-clerk.js +2 -2
  293. package/lib/zudoku.auth-openid.js +124 -138
  294. package/lib/zudoku.auth-openid.js.map +1 -1
  295. package/lib/zudoku.components.js +1291 -1119
  296. package/lib/zudoku.components.js.map +1 -1
  297. package/lib/zudoku.openapi-worker.js +10 -16336
  298. package/lib/zudoku.openapi-worker.js.map +1 -1
  299. package/lib/zudoku.plugin-api-keys.js +41 -39
  300. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  301. package/lib/zudoku.plugin-custom-pages.js +2 -2
  302. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  303. package/lib/zudoku.plugin-markdown.js +15 -14
  304. package/lib/zudoku.plugin-markdown.js.map +1 -1
  305. package/lib/zudoku.plugin-openapi.js +5 -9
  306. package/lib/zudoku.plugin-openapi.js.map +1 -1
  307. package/lib/zudoku.plugin-redirect.js +2 -2
  308. package/lib/zudoku.plugin-redirect.js.map +1 -1
  309. package/lib/zudoku.plugin-search-inkeep.js +1 -1
  310. package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
  311. package/package.json +27 -7
  312. package/src/app/demo.tsx +0 -3
  313. package/src/app/entry.client.tsx +14 -0
  314. package/src/app/entry.server.tsx +59 -53
  315. package/src/app/main.css +1 -1
  316. package/src/app/main.tsx +4 -4
  317. package/src/app/standalone.tsx +0 -3
  318. package/src/lib/authentication/AuthenticationPlugin.tsx +4 -1
  319. package/src/lib/authentication/authentication.ts +3 -3
  320. package/src/lib/authentication/hook.ts +1 -3
  321. package/src/lib/authentication/providers/auth0.tsx +17 -11
  322. package/src/lib/authentication/providers/openid.tsx +12 -30
  323. package/src/lib/authentication/state.ts +50 -9
  324. package/{LICENSE.md → src/lib/authentication/use-broadcast/LICENSE.md} +2 -2
  325. package/src/lib/authentication/use-broadcast/shared.ts +372 -0
  326. package/src/lib/authentication/use-broadcast/useBroadcast.ts +146 -0
  327. package/src/lib/components/Bootstrap.tsx +36 -14
  328. package/src/lib/components/ClientOnly.tsx +6 -3
  329. package/src/lib/components/DeveloperHint.tsx +6 -1
  330. package/src/lib/components/Header.tsx +68 -40
  331. package/src/lib/components/Layout.tsx +49 -37
  332. package/src/lib/components/MobileTopNavigation.tsx +15 -18
  333. package/src/lib/components/SyntaxHighlight.tsx +81 -46
  334. package/src/lib/components/ThemeSwitch.tsx +26 -0
  335. package/src/lib/components/TopNavigation.tsx +27 -19
  336. package/src/lib/components/Zudoku.tsx +108 -0
  337. package/src/lib/components/context/ZudokuContext.ts +11 -16
  338. package/src/lib/components/context/ZudokuProvider.tsx +2 -2
  339. package/src/lib/components/index.ts +2 -3
  340. package/src/lib/components/navigation/Sidebar.tsx +3 -3
  341. package/src/lib/components/navigation/utils.ts +2 -2
  342. package/src/lib/core/{DevPortalContext.ts → ZudokuContext.ts} +3 -11
  343. package/src/lib/core/plugins.ts +20 -16
  344. package/src/lib/errors/ErrorAlert.tsx +2 -1
  345. package/src/lib/oas/graphql/index.ts +4 -4
  346. package/src/lib/oas/parser/upgrade/index.ts +3 -24
  347. package/src/lib/plugins/api-keys/index.tsx +12 -9
  348. package/src/lib/plugins/custom-pages/index.tsx +2 -2
  349. package/src/lib/plugins/markdown/MdxPage.tsx +25 -1
  350. package/src/lib/plugins/markdown/index.tsx +3 -2
  351. package/src/lib/plugins/openapi/CollapsibleCode.tsx +80 -0
  352. package/src/lib/plugins/openapi/ColorizedParam.tsx +23 -14
  353. package/src/lib/plugins/openapi/Endpoint.tsx +5 -10
  354. package/src/lib/plugins/openapi/OperationList.tsx +20 -40
  355. package/src/lib/plugins/openapi/ParameterListItem.tsx +37 -31
  356. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +18 -13
  357. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +17 -12
  358. package/src/lib/plugins/openapi/Route.tsx +11 -12
  359. package/src/lib/plugins/openapi/Sidecar.tsx +73 -59
  360. package/src/lib/plugins/openapi/client/GraphQLClient.tsx +157 -0
  361. package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -0
  362. package/src/lib/plugins/openapi/client/createServer.ts +2 -0
  363. package/src/lib/plugins/openapi/client/useCreateQuery.ts +21 -0
  364. package/src/lib/plugins/openapi/client/worker.ts +38 -24
  365. package/src/lib/plugins/openapi/graphql/fragment-masking.ts +11 -18
  366. package/src/lib/plugins/openapi/graphql/gql.ts +10 -27
  367. package/src/lib/plugins/openapi/graphql/graphql.ts +233 -665
  368. package/src/lib/plugins/openapi/index.tsx +42 -67
  369. package/src/lib/plugins/openapi/interfaces.ts +1 -1
  370. package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
  371. package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
  372. package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
  373. package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
  374. package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
  375. package/src/lib/plugins/openapi/schema/SchemaView.tsx +5 -2
  376. package/src/lib/plugins/openapi/util/generateSchemaExample.ts +28 -42
  377. package/src/lib/plugins/openapi-worker.ts +11 -1
  378. package/src/lib/plugins/redirect/index.tsx +5 -9
  379. package/src/lib/plugins/search-inkeep/index.tsx +2 -2
  380. package/src/lib/ui/ActionButton.tsx +28 -0
  381. package/src/lib/util/traverse.ts +25 -0
  382. package/src/lib/util/useIsomorphicLayoutEffect.ts +5 -0
  383. package/src/lib/util/useOnScreen.ts +32 -0
  384. package/dist/lib/components/DevPortal.js.map +0 -1
  385. package/dist/lib/components/context/ThemeContext.d.ts +0 -2
  386. package/dist/lib/components/context/ThemeContext.js +0 -7
  387. package/dist/lib/components/context/ThemeContext.js.map +0 -1
  388. package/dist/lib/components/context/ThemeProvider.d.ts +0 -4
  389. package/dist/lib/components/context/ThemeProvider.js +0 -23
  390. package/dist/lib/components/context/ThemeProvider.js.map +0 -1
  391. package/dist/lib/core/DevPortalContext.js.map +0 -1
  392. package/dist/lib/plugins/openapi/client/createMemoryClient.d.ts +0 -12
  393. package/dist/lib/plugins/openapi/client/createMemoryClient.js +0 -46
  394. package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +0 -1
  395. package/dist/lib/plugins/openapi/client/createWorkerClient.d.ts +0 -10
  396. package/dist/lib/plugins/openapi/client/createWorkerClient.js +0 -61
  397. package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +0 -1
  398. package/dist/lib/plugins/openapi/client/interfaces.d.ts +0 -4
  399. package/dist/lib/plugins/openapi/client/interfaces.js +0 -2
  400. package/dist/lib/plugins/openapi/client/interfaces.js.map +0 -1
  401. package/dist/lib/themeToggle.d.ts +0 -1
  402. package/dist/lib/themeToggle.js +0 -7
  403. package/dist/lib/themeToggle.js.map +0 -1
  404. package/dist/lib/util/createWaitForNotify.d.ts +0 -1
  405. package/dist/lib/util/createWaitForNotify.js +0 -15
  406. package/dist/lib/util/createWaitForNotify.js.map +0 -1
  407. package/dist/vite/plugin-html-transform.d.ts +0 -2
  408. package/dist/vite/plugin-html-transform.js +0 -15
  409. package/dist/vite/plugin-html-transform.js.map +0 -1
  410. package/lib/AuthenticationPlugin-C9BHGXlE.js +0 -55
  411. package/lib/ClientOnly-CVN6leDu.js.map +0 -1
  412. package/lib/DeveloperHint-DHdLXGHA.js +0 -16
  413. package/lib/DeveloperHint-DHdLXGHA.js.map +0 -1
  414. package/lib/Markdown-BDcCAWwm.js +0 -18059
  415. package/lib/Markdown-BDcCAWwm.js.map +0 -1
  416. package/lib/MdxPage-DKMH_t0f.js +0 -174
  417. package/lib/MdxPage-DKMH_t0f.js.map +0 -1
  418. package/lib/OperationList-Tj7ubW_t.js +0 -604
  419. package/lib/OperationList-Tj7ubW_t.js.map +0 -1
  420. package/lib/Route-C3DGB6OS.js +0 -13
  421. package/lib/Route-C3DGB6OS.js.map +0 -1
  422. package/lib/Select-Bagt3Bme.js.map +0 -1
  423. package/lib/SlotletProvider-Da7eFgd2.js +0 -241
  424. package/lib/SlotletProvider-Da7eFgd2.js.map +0 -1
  425. package/lib/Spinner-C6zroowC.js.map +0 -1
  426. package/lib/StaggeredRender-DDHSzQKE.js +0 -17
  427. package/lib/StaggeredRender-DDHSzQKE.js.map +0 -1
  428. package/lib/ZudokuContext-BKXGJTmu.js.map +0 -1
  429. package/lib/assets/worker-Bf8vjASY.js.map +0 -1
  430. package/lib/hook-sn0zMTkE.js.map +0 -1
  431. package/lib/index-AjWCJNGC.js +0 -5690
  432. package/lib/index-AjWCJNGC.js.map +0 -1
  433. package/lib/index-CRo94sKK.js +0 -1783
  434. package/lib/index-CRo94sKK.js.map +0 -1
  435. package/lib/state-CsuHT8ZO.js +0 -183
  436. package/lib/urql-core-KJnLL26g.js +0 -1455
  437. package/lib/urql-core-KJnLL26g.js.map +0 -1
  438. package/lib/useExposedProps-ChOIUaS4.js +0 -9
  439. package/src/lib/components/DevPortal.tsx +0 -111
  440. package/src/lib/components/context/ThemeContext.tsx +0 -8
  441. package/src/lib/components/context/ThemeProvider.tsx +0 -27
  442. package/src/lib/plugins/openapi/client/createMemoryClient.ts +0 -51
  443. package/src/lib/plugins/openapi/client/createWorkerClient.ts +0 -75
  444. package/src/lib/plugins/openapi/client/interfaces.ts +0 -5
  445. package/src/lib/themeToggle.ts +0 -7
  446. package/src/lib/util/createWaitForNotify.ts +0 -18
@@ -0,0 +1,4693 @@
1
+ import { j as d } from "./jsx-runtime-B6kdoens.js";
2
+ import { g as Ht } from "./utils-DcpDOncX.js";
3
+ import { C as nr } from "./CategoryHeading-Bb9dqxD3.js";
4
+ import { I as Tn, M as be, H as _e, P as je } from "./Markdown-ievDDhFT.js";
5
+ import { c as D } from "./cn-BmFQLtkS.js";
6
+ import { CheckIcon as Cn, CopyIcon as Pn, ChevronDownIcon as kn, CircleFadingPlusIcon as En, CircleDotIcon as Nn, CircleIcon as Rn, SquareMinusIcon as An, SquarePlusIcon as qn, ListPlusIcon as In } from "lucide-react";
7
+ import { useContext as Ln, useMemo as Jr, useTransition as Gr, useState as ve, useRef as Vr, useEffect as Qr, useLayoutEffect as Un, Fragment as Fn, useCallback as _n } from "react";
8
+ import { a as Kr } from "./state-tsXBLONe.js";
9
+ import { Button as Dr } from "./ui/Button.js";
10
+ import { h as Hn } from "./object_hash-CvlLgU-M.js";
11
+ import { a as Bn, u as Bt } from "./context-D1nXWxm7.js";
12
+ import { g as ut, S as Yr, C as Xr, P as Mn } from "./index-C7SaIME0.js";
13
+ import { Tabs as zn, TabsList as Wn, TabsTrigger as Jn, TabsContent as Gn } from "./ui/Tabs.js";
14
+ import { T as fe, b as Vn } from "./SidebarBadge-DxFJcJ6V.js";
15
+ import { Card as de, CardHeader as Qn, CardTitle as Kn, CardContent as Dn } from "./ui/Card.js";
16
+ import { g as Yn, c as He, a as Xn } from "./_commonjsHelpers-BkfeUUK-.js";
17
+ import { _ as Zn } from "./__vite-browser-external-BYRIRx8p.js";
18
+ import { u as eo } from "./index-Yn8c3UWE.js";
19
+ import { S as Mt } from "./SyntaxHighlight-DkLOsjHS.js";
20
+ import { B as or } from "./Button-jK0EsymC.js";
21
+ import * as ee from "@radix-ui/react-collapsible";
22
+ import * as De from "@radix-ui/react-tabs";
23
+ function to(t, e) {
24
+ return e;
25
+ }
26
+ const zt = (t, ...e) => {
27
+ const r = Ln(Bn);
28
+ if (r === void 0)
29
+ throw new Error("useGraphQL must be used within a GraphQLProvider");
30
+ const o = Jr(() => Hn(e[0] ?? {}), [e]);
31
+ return {
32
+ queryFn: () => r.fetch(t, ...e),
33
+ queryKey: [t, o]
34
+ };
35
+ }, ro = ut(
36
+ /* GraphQL */
37
+ `
38
+ query ServersQuery($input: JSON!, $type: SchemaType!) {
39
+ schema(input: $input, type: $type) {
40
+ url
41
+ servers {
42
+ url
43
+ }
44
+ }
45
+ }
46
+ `
47
+ ), ar = ({ url: t }) => {
48
+ const [e, r] = ve(!1);
49
+ return /* @__PURE__ */ d.jsx(
50
+ Dr,
51
+ {
52
+ onClick: () => {
53
+ navigator.clipboard.writeText(t).then(() => {
54
+ r(!0), setTimeout(() => r(!1), 2e3);
55
+ });
56
+ },
57
+ variant: "ghost",
58
+ size: "icon",
59
+ children: e ? /* @__PURE__ */ d.jsx(Cn, { className: "text-green-600", size: 14 }) : /* @__PURE__ */ d.jsx(Pn, { size: 14, strokeWidth: 1.3 })
60
+ }
61
+ );
62
+ }, no = () => {
63
+ const { input: t, type: e } = Bt(), r = zt(ro, { input: t, type: e }), o = Ht(r), [, i] = Gr(), { selectedServer: a, setSelectedServer: n } = Kr(), { servers: s } = o.data.schema;
64
+ return s.length === 1 ? /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
65
+ /* @__PURE__ */ d.jsx("span", { className: "font-medium text-sm", children: "Endpoint:" }),
66
+ /* @__PURE__ */ d.jsx(Tn, { className: "text-xs px-2 py-1.5", selectOnClick: !0, children: s[0].url }),
67
+ /* @__PURE__ */ d.jsx(ar, { url: s[0].url })
68
+ ] }) : /* @__PURE__ */ d.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
69
+ /* @__PURE__ */ d.jsxs("span", { className: "font-medium text-sm", children: [
70
+ s.length > 1 ? "Endpoints" : "Endpoint",
71
+ ":"
72
+ ] }),
73
+ /* @__PURE__ */ d.jsx(
74
+ Yr,
75
+ {
76
+ className: "font-mono text-xs bg-border/50 dark:bg-border/70 py-1.5 max-w-[450px] truncate",
77
+ onChange: (l) => i(() => {
78
+ n(l.target.value);
79
+ }),
80
+ value: a ?? o.data.schema.url,
81
+ showChevrons: s.length > 1,
82
+ options: s.map((l) => ({
83
+ value: l.url,
84
+ label: l.url
85
+ }))
86
+ }
87
+ ),
88
+ /* @__PURE__ */ d.jsx(ar, { url: a ?? o.data.schema.url })
89
+ ] });
90
+ }, Zr = (t, e) => t.reduce(
91
+ (r, o) => {
92
+ const i = e(o);
93
+ return r[i] || (r[i] = []), r[i].push(o), r;
94
+ },
95
+ {}
96
+ ), oo = (t, e) => t ? e(t) : void 0, ao = (t) => t.schema != null && typeof t.schema == "object" ? t.schema : {
97
+ type: "string"
98
+ }, io = ({
99
+ parameter: t,
100
+ group: e,
101
+ id: r
102
+ }) => {
103
+ const o = ao(t);
104
+ return /* @__PURE__ */ d.jsxs("li", { className: "p-4 bg-border/20 text-sm flex flex-col gap-1", children: [
105
+ /* @__PURE__ */ d.jsxs("div", { className: "flex items-center gap-2", children: [
106
+ /* @__PURE__ */ d.jsx("code", { children: e === "path" ? /* @__PURE__ */ d.jsx(
107
+ Xr,
108
+ {
109
+ name: t.name,
110
+ backgroundOpacity: "15%",
111
+ slug: r + "-" + t.name.toLocaleLowerCase()
112
+ }
113
+ ) : t.name }),
114
+ t.required && /* @__PURE__ */ d.jsx("span", { className: "py-px px-1.5 font-medium bg-primary/75 text-muted rounded-lg", children: "required" }),
115
+ o.type && /* @__PURE__ */ d.jsx("span", { className: "text-muted-foreground", children: o.type === "array" ? `${o.items.type}[]` : o.type })
116
+ ] }),
117
+ t.description && /* @__PURE__ */ d.jsx(
118
+ be,
119
+ {
120
+ content: t.description,
121
+ className: "text-sm prose-p:my-1 prose-code:whitespace-pre-line"
122
+ }
123
+ )
124
+ ] });
125
+ }, so = ({
126
+ group: t,
127
+ parameters: e,
128
+ id: r
129
+ }) => /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
130
+ /* @__PURE__ */ d.jsx(_e, { level: 3, id: `${r}/${t}-parameters`, className: "capitalize", children: t === "header" ? "Headers" : `${t} Parameters` }),
131
+ /* @__PURE__ */ d.jsx(de, { children: /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0 divide-y ", children: e.sort((o, i) => o.required === i.required ? 0 : o.required ? -1 : 1).map((o) => /* @__PURE__ */ d.jsx(
132
+ io,
133
+ {
134
+ parameter: o,
135
+ id: r,
136
+ group: t
137
+ },
138
+ `${o.name}-${o.in}`
139
+ )) }) })
140
+ ] });
141
+ var ir = (t, e) => {
142
+ const r = t[e.name];
143
+ return r === void 0 ? (t[e.name] = e.value, t) : Array.isArray(r) ? (r.push(e.value), t) : (t[e.name] = [r, e.value], t);
144
+ }, sr = "", lr = `
145
+ `, C = class {
146
+ /**
147
+ * Helper object to format and aggragate lines of code.
148
+ * Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
149
+ */
150
+ constructor({ indent: t, join: e } = {}) {
151
+ this.postProcessors = [], this.code = [], this.indentationCharacter = sr, this.lineJoin = lr, this.indentLine = (r, o = 0) => `${this.indentationCharacter.repeat(o)}${r}`, this.unshift = (r, o) => {
152
+ const i = this.indentLine(r, o);
153
+ this.code.unshift(i);
154
+ }, this.push = (r, o) => {
155
+ const i = this.indentLine(r, o);
156
+ this.code.push(i);
157
+ }, this.blank = () => {
158
+ this.code.push("");
159
+ }, this.join = () => {
160
+ const r = this.code.join(this.lineJoin);
161
+ return this.postProcessors.reduce((i, a) => a(i), r);
162
+ }, this.addPostProcessor = (r) => {
163
+ this.postProcessors = [...this.postProcessors, r];
164
+ }, this.indentationCharacter = t || sr, this.lineJoin = e ?? lr;
165
+ }
166
+ }, lo = function(t) {
167
+ return Object.prototype.toString.call(t) === "[object RegExp]";
168
+ }, co = function(t) {
169
+ var e = typeof t;
170
+ return t !== null && (e === "object" || e === "function");
171
+ }, Wt = {};
172
+ Object.defineProperty(Wt, "__esModule", { value: !0 });
173
+ Wt.default = (t) => Object.getOwnPropertySymbols(t).filter((e) => Object.prototype.propertyIsEnumerable.call(t, e));
174
+ const uo = lo, po = co, fo = Wt.default;
175
+ var ho = (t, e, r) => {
176
+ const o = [];
177
+ return function i(a, n, s) {
178
+ n = n || {}, n.indent = n.indent || " ", s = s || "";
179
+ let l;
180
+ n.inlineCharacterLimit === void 0 ? l = {
181
+ newLine: `
182
+ `,
183
+ newLineOrSpace: `
184
+ `,
185
+ pad: s,
186
+ indent: s + n.indent
187
+ } : l = {
188
+ newLine: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
189
+ newLineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
190
+ pad: "@@__STRINGIFY_OBJECT_PAD__@@",
191
+ indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
192
+ };
193
+ const c = (u) => {
194
+ if (n.inlineCharacterLimit === void 0)
195
+ return u;
196
+ const f = u.replace(new RegExp(l.newLine, "g"), "").replace(new RegExp(l.newLineOrSpace, "g"), " ").replace(new RegExp(l.pad + "|" + l.indent, "g"), "");
197
+ return f.length <= n.inlineCharacterLimit ? f : u.replace(new RegExp(l.newLine + "|" + l.newLineOrSpace, "g"), `
198
+ `).replace(new RegExp(l.pad, "g"), s).replace(new RegExp(l.indent, "g"), s + n.indent);
199
+ };
200
+ if (o.indexOf(a) !== -1)
201
+ return '"[Circular]"';
202
+ if (a == null || typeof a == "number" || typeof a == "boolean" || typeof a == "function" || typeof a == "symbol" || uo(a))
203
+ return String(a);
204
+ if (a instanceof Date)
205
+ return `new Date('${a.toISOString()}')`;
206
+ if (Array.isArray(a)) {
207
+ if (a.length === 0)
208
+ return "[]";
209
+ o.push(a);
210
+ const u = "[" + l.newLine + a.map((f, p) => {
211
+ const h = a.length - 1 === p ? l.newLine : "," + l.newLineOrSpace;
212
+ let y = i(f, n, s + n.indent);
213
+ return n.transform && (y = n.transform(a, p, y)), l.indent + y + h;
214
+ }).join("") + l.pad + "]";
215
+ return o.pop(), c(u);
216
+ }
217
+ if (po(a)) {
218
+ let u = Object.keys(a).concat(fo(a));
219
+ if (n.filter && (u = u.filter((p) => n.filter(a, p))), u.length === 0)
220
+ return "{}";
221
+ o.push(a);
222
+ const f = "{" + l.newLine + u.map((p, h) => {
223
+ const y = u.length - 1 === h ? l.newLine : "," + l.newLineOrSpace, g = typeof p == "symbol", b = !g && /^[a-z$_][a-z$_0-9]*$/i.test(p), x = g || b ? p : i(p, n);
224
+ let m = i(a[p], n, s + n.indent);
225
+ return n.transform && (m = n.transform(a, p, m)), l.indent + String(x) + ": " + m + y;
226
+ }).join("") + l.pad + "}";
227
+ return o.pop(), c(f);
228
+ }
229
+ return a = String(a).replace(/[\r\n]/g, (u) => u === `
230
+ ` ? "\\n" : "\\r"), n.singleQuotes === !1 ? (a = a.replace(/"/g, '\\"'), `"${a}"`) : (a = a.replace(/\\?'/g, "\\'"), `'${a}'`);
231
+ }(t, e, r);
232
+ };
233
+ const z = /* @__PURE__ */ Yn(ho);
234
+ function We(t, e = {}) {
235
+ const { delimiter: r = '"', escapeChar: o = "\\", escapeNewlines: i = !0 } = e;
236
+ return [...t.toString()].map((n) => n === "\b" ? `${o}b` : n === " " ? `${o}t` : n === `
237
+ ` ? i ? `${o}n` : n : n === "\f" ? `${o}f` : n === "\r" ? i ? `${o}r` : n : n === o ? o + o : n === r ? o + r : n < " " || n > "~" ? JSON.stringify(n).slice(1, -1) : n).join("");
238
+ }
239
+ var Je = (t) => We(t, { delimiter: "'" }), H = (t) => We(t, { delimiter: '"' }), yo = {
240
+ info: {
241
+ key: "libcurl",
242
+ title: "Libcurl",
243
+ link: "http://curl.haxx.se/libcurl",
244
+ description: "Simple REST and HTTP API Client for C",
245
+ extname: ".c"
246
+ },
247
+ convert: ({ method: t, fullUrl: e, headersObj: r, allHeaders: o, postData: i }) => {
248
+ const { push: a, blank: n, join: s } = new C();
249
+ a("CURL *hnd = curl_easy_init();"), n(), a(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${t.toUpperCase()}");`), a("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"), a(`curl_easy_setopt(hnd, CURLOPT_URL, "${e}");`);
250
+ const l = Object.keys(r);
251
+ return l.length && (n(), a("struct curl_slist *headers = NULL;"), l.forEach((c) => {
252
+ a(`headers = curl_slist_append(headers, "${c}: ${H(r[c])}");`);
253
+ }), a("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), o.cookie && (n(), a(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${o.cookie}");`)), i.text && (n(), a(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(i.text)});`)), n(), a("CURLcode ret = curl_easy_perform(hnd);"), s();
254
+ }
255
+ }, mo = {
256
+ info: {
257
+ key: "c",
258
+ title: "C",
259
+ default: "libcurl",
260
+ cli: "c"
261
+ },
262
+ clientsById: {
263
+ libcurl: yo
264
+ }
265
+ }, J = (t, e) => Object.keys(t).find((r) => r.toLowerCase() === e.toLowerCase()), ue = (t, e) => {
266
+ const r = J(t, e);
267
+ if (r)
268
+ return t[r];
269
+ }, pt = (t, e) => !!J(t, e), go = (t) => ["application/json", "application/x-json", "text/json", "text/x-json", "+json"].some(
270
+ (e) => t.indexOf(e) > -1
271
+ ), cr = class {
272
+ constructor(t) {
273
+ this.name = "", this.toString = () => `:${this.name}`, this.name = t;
274
+ }
275
+ }, bo = class {
276
+ constructor(t) {
277
+ this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
278
+ }
279
+ }, en = (t) => t === void 0 ? null : t === null ? "null" : t.constructor.name.toLowerCase(), tn = (t) => t === void 0 ? !0 : en(t) === "object" ? Object.keys(t).length === 0 : !1, ur = (t) => (Object.keys(t).filter((e) => tn(t[e])).forEach((e) => {
280
+ delete t[e];
281
+ }), t), et = (t, e) => {
282
+ const r = " ".repeat(t);
283
+ return e.replace(/\n/g, `
284
+ ${r}`);
285
+ }, Ct = (t) => {
286
+ switch (en(t)) {
287
+ case "string":
288
+ return `"${t.replace(/"/g, '\\"')}"`;
289
+ case "file":
290
+ return t.toString();
291
+ case "keyword":
292
+ return t.toString();
293
+ case "null":
294
+ return "nil";
295
+ case "regexp":
296
+ return `#"${t.source}"`;
297
+ case "object": {
298
+ const e = Object.keys(t).reduce((r, o) => {
299
+ const i = et(o.length + 2, Ct(t[o]));
300
+ return `${r}:${o} ${i}
301
+ `;
302
+ }, "").trim();
303
+ return `{${et(1, e)}}`;
304
+ }
305
+ case "array": {
306
+ const e = t.reduce((r, o) => `${r} ${Ct(o)}`, "").trim();
307
+ return `[${et(1, e)}]`;
308
+ }
309
+ default:
310
+ return t.toString();
311
+ }
312
+ }, vo = {
313
+ info: {
314
+ key: "clj_http",
315
+ title: "clj-http",
316
+ link: "https://github.com/dakrone/clj-http",
317
+ description: "An idiomatic clojure http client wrapping the apache client.",
318
+ extname: ".clj"
319
+ },
320
+ convert: ({ queryObj: t, method: e, postData: r, url: o, allHeaders: i }, a) => {
321
+ const { push: n, join: s } = new C({ indent: a == null ? void 0 : a.indent }), l = ["get", "post", "put", "delete", "patch", "head", "options"];
322
+ if (e = e.toLowerCase(), !l.includes(e))
323
+ return n("Method not supported"), s();
324
+ const c = {
325
+ headers: i,
326
+ "query-params": t
327
+ };
328
+ switch (r.mimeType) {
329
+ case "application/json":
330
+ {
331
+ c["content-type"] = new cr("json"), c["form-params"] = r.jsonObj;
332
+ const u = J(c.headers, "content-type");
333
+ u && delete c.headers[u];
334
+ }
335
+ break;
336
+ case "application/x-www-form-urlencoded":
337
+ {
338
+ c["form-params"] = r.paramsObj;
339
+ const u = J(c.headers, "content-type");
340
+ u && delete c.headers[u];
341
+ }
342
+ break;
343
+ case "text/plain":
344
+ {
345
+ c.body = r.text;
346
+ const u = J(c.headers, "content-type");
347
+ u && delete c.headers[u];
348
+ }
349
+ break;
350
+ case "multipart/form-data": {
351
+ if (r.params) {
352
+ c.multipart = r.params.map((f) => f.fileName && !f.value ? {
353
+ name: f.name,
354
+ content: new bo(f.fileName)
355
+ } : {
356
+ name: f.name,
357
+ content: f.value
358
+ });
359
+ const u = J(c.headers, "content-type");
360
+ u && delete c.headers[u];
361
+ }
362
+ break;
363
+ }
364
+ }
365
+ switch (ue(c.headers, "accept")) {
366
+ case "application/json":
367
+ {
368
+ c.accept = new cr("json");
369
+ const u = J(c.headers, "accept");
370
+ u && delete c.headers[u];
371
+ }
372
+ break;
373
+ }
374
+ if (n(`(require '[clj-http.client :as client])
375
+ `), tn(ur(c)))
376
+ n(`(client/${e} "${o}")`);
377
+ else {
378
+ const u = 11 + e.length + o.length, f = et(u, Ct(ur(c)));
379
+ n(`(client/${e} "${o}" ${f})`);
380
+ }
381
+ return s();
382
+ }
383
+ }, xo = {
384
+ info: {
385
+ key: "clojure",
386
+ title: "Clojure",
387
+ default: "clj_http"
388
+ },
389
+ clientsById: {
390
+ clj_http: vo
391
+ }
392
+ }, $o = (t) => {
393
+ let e = ue(t, "accept-encoding");
394
+ if (!e)
395
+ return [];
396
+ const r = {
397
+ gzip: "DecompressionMethods.GZip",
398
+ deflate: "DecompressionMethods.Deflate"
399
+ }, o = [];
400
+ return typeof e == "string" && (e = [e]), e.forEach((i) => {
401
+ i.split(",").forEach((a) => {
402
+ const n = /\s*([^;\s]+)/.exec(a);
403
+ if (n) {
404
+ const s = r[n[1]];
405
+ s && o.push(s);
406
+ }
407
+ });
408
+ }), o;
409
+ }, wo = {
410
+ info: {
411
+ key: "httpclient",
412
+ title: "HttpClient",
413
+ link: "https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",
414
+ description: ".NET Standard HTTP Client",
415
+ extname: ".cs"
416
+ },
417
+ convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, i) => {
418
+ var h, y;
419
+ const a = {
420
+ indent: " ",
421
+ ...i
422
+ }, { push: n, join: s } = new C({ indent: a.indent });
423
+ n("using System.Net.Http.Headers;");
424
+ let l = "";
425
+ const c = !!t.cookie, u = $o(t);
426
+ (c || u.length) && (l = "clientHandler", n("var clientHandler = new HttpClientHandler"), n("{"), c && n("UseCookies = false,", 1), u.length && n(`AutomaticDecompression = ${u.join(" | ")},`, 1), n("};")), n(`var client = new HttpClient(${l});`), n("var request = new HttpRequestMessage"), n("{");
427
+ const f = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS", "TRACE"];
428
+ r = r.toUpperCase(), r && f.includes(r) ? r = `HttpMethod.${r[0]}${r.substring(1).toLowerCase()}` : r = `new HttpMethod("${r}")`, n(`Method = ${r},`, 1), n(`RequestUri = new Uri("${o}"),`, 1);
429
+ const p = Object.keys(t).filter((g) => {
430
+ switch (g.toLowerCase()) {
431
+ case "content-type":
432
+ case "content-length":
433
+ case "accept-encoding":
434
+ return !1;
435
+ default:
436
+ return !0;
437
+ }
438
+ });
439
+ if (p.length && (n("Headers =", 1), n("{", 1), p.forEach((g) => {
440
+ n(`{ "${g}", "${H(t[g])}" },`, 2);
441
+ }), n("},", 1)), e.text) {
442
+ const g = e.mimeType;
443
+ switch (g) {
444
+ case "application/x-www-form-urlencoded":
445
+ n("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), n("{", 1), (h = e.params) == null || h.forEach((b) => {
446
+ n(`{ "${b.name}", "${b.value}" },`, 2);
447
+ }), n("}),", 1);
448
+ break;
449
+ case "multipart/form-data":
450
+ n("Content = new MultipartFormDataContent", 1), n("{", 1), (y = e.params) == null || y.forEach((b) => {
451
+ n(`new StringContent(${JSON.stringify(b.value || "")})`, 2), n("{", 2), n("Headers =", 3), n("{", 3), b.contentType && n(`ContentType = new MediaTypeHeaderValue("${b.contentType}"),`, 4), n('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), n("{", 4), n(`Name = "${b.name}",`, 5), b.fileName && n(`FileName = "${b.fileName}",`, 5), n("}", 4), n("}", 3), n("},", 2);
452
+ }), n("},", 1);
453
+ break;
454
+ default:
455
+ n(`Content = new StringContent(${JSON.stringify(e.text || "")})`, 1), n("{", 1), n("Headers =", 2), n("{", 2), n(`ContentType = new MediaTypeHeaderValue("${g}")`, 3), n("}", 2), n("}", 1);
456
+ break;
457
+ }
458
+ }
459
+ return n("};"), n("using (var response = await client.SendAsync(request))"), n("{"), n("response.EnsureSuccessStatusCode();", 1), n("var body = await response.Content.ReadAsStringAsync();", 1), n("Console.WriteLine(body);", 1), n("}"), s();
460
+ }
461
+ };
462
+ function jo(t) {
463
+ return t[0].toUpperCase() + t.slice(1).toLowerCase();
464
+ }
465
+ var So = {
466
+ info: {
467
+ key: "restsharp",
468
+ title: "RestSharp",
469
+ link: "http://restsharp.org/",
470
+ description: "Simple REST and HTTP API Client for .NET",
471
+ extname: ".cs",
472
+ installation: "dotnet add package RestSharp"
473
+ },
474
+ convert: ({ method: t, fullUrl: e, headersObj: r, cookies: o, postData: i, uriObj: a }) => {
475
+ const { push: n, join: s } = new C();
476
+ if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(
477
+ t.toUpperCase()
478
+ ))
479
+ return "Method not supported";
480
+ n(`using RestSharp;
481
+
482
+ `), n(`var options = new RestClientOptions("${e}");`), n("var client = new RestClient(options);"), n('var request = new RestRequest("");');
483
+ const c = i.mimeType && i.mimeType === "multipart/form-data";
484
+ switch (c && n("request.AlwaysMultipartFormData = true;"), Object.keys(r).forEach((u) => {
485
+ if (i.mimeType && u.toLowerCase() === "content-type" && i.text) {
486
+ c && i.boundary && n(`request.FormBoundary = "${i.boundary}";`);
487
+ return;
488
+ }
489
+ n(`request.AddHeader("${u}", "${H(r[u])}");`);
490
+ }), o.forEach(({ name: u, value: f }) => {
491
+ n(`request.AddCookie("${u}", "${H(f)}", "${a.pathname}", "${a.host}");`);
492
+ }), i.mimeType) {
493
+ case "multipart/form-data":
494
+ if (!i.params) break;
495
+ i.params.forEach((u) => {
496
+ u.fileName ? n(`request.AddFile("${u.name}", "${u.fileName}");`) : n(`request.AddParameter("${u.name}", "${u.value}");`);
497
+ });
498
+ break;
499
+ case "application/x-www-form-urlencoded":
500
+ if (!i.params) break;
501
+ i.params.forEach((u) => {
502
+ n(`request.AddParameter("${u.name}", "${u.value}");`);
503
+ });
504
+ break;
505
+ case "application/json": {
506
+ if (!i.text) break;
507
+ const u = JSON.stringify(i.text);
508
+ n(`request.AddJsonBody(${u}, false);`);
509
+ break;
510
+ }
511
+ default:
512
+ if (!i.text) break;
513
+ n(`request.AddStringBody("${i.text}", "${i.mimeType}");`);
514
+ }
515
+ return n(`var response = await client.${jo(t)}Async(request);
516
+ `), n(`Console.WriteLine("{0}", response.Content);
517
+ `), s();
518
+ }
519
+ }, Oo = {
520
+ info: {
521
+ key: "csharp",
522
+ title: "C#",
523
+ default: "restsharp",
524
+ cli: "dotnet"
525
+ },
526
+ clientsById: {
527
+ httpclient: wo,
528
+ restsharp: So
529
+ }
530
+ }, To = {
531
+ info: {
532
+ key: "native",
533
+ title: "NewRequest",
534
+ link: "http://golang.org/pkg/net/http/#NewRequest",
535
+ description: "Golang HTTP client request",
536
+ extname: ".go"
537
+ },
538
+ convert: ({ postData: t, method: e, allHeaders: r, fullUrl: o }, i = {}) => {
539
+ const { blank: a, push: n, join: s } = new C({ indent: " " }), { showBoilerplate: l = !0, checkErrors: c = !1, printBody: u = !0, timeout: f = -1 } = i, p = c ? "err" : "_", h = l ? 1 : 0, y = () => {
540
+ c && (n("if err != nil {", h), n("panic(err)", h + 1), n("}", h));
541
+ };
542
+ l && (n("package main"), a(), n("import ("), n('"fmt"', h), f > 0 && n('"time"', h), t.text && n('"strings"', h), n('"net/http"', h), u && n('"io"', h), n(")"), a(), n("func main() {"), a());
543
+ const g = f > 0, b = g, x = b ? "client" : "http.DefaultClient";
544
+ return b && (n("client := http.Client{", h), g && n(`Timeout: time.Duration(${f} * time.Second),`, h + 1), n("}", h), a()), n(`url := "${o}"`, h), a(), t.text ? (n(`payload := strings.NewReader(${JSON.stringify(t.text)})`, h), a(), n(`req, ${p} := http.NewRequest("${e}", url, payload)`, h), a()) : (n(`req, ${p} := http.NewRequest("${e}", url, nil)`, h), a()), y(), Object.keys(r).length && (Object.keys(r).forEach((m) => {
545
+ n(`req.Header.Add("${m}", "${H(r[m])}")`, h);
546
+ }), a()), n(`res, ${p} := ${x}.Do(req)`, h), y(), u && (a(), n("defer res.Body.Close()", h), n(`body, ${p} := io.ReadAll(res.Body)`, h), y()), a(), u && n("fmt.Println(string(body))", h), l && (a(), n("}")), s();
547
+ }
548
+ }, Co = {
549
+ info: {
550
+ key: "go",
551
+ title: "Go",
552
+ default: "native",
553
+ cli: "go"
554
+ },
555
+ clientsById: {
556
+ native: To
557
+ }
558
+ }, pr = `\r
559
+ `, Po = {
560
+ info: {
561
+ key: "http1.1",
562
+ title: "HTTP/1.1",
563
+ link: "https://tools.ietf.org/html/rfc7230",
564
+ description: "HTTP/1.1 request string in accordance with RFC 7230",
565
+ extname: null
566
+ },
567
+ convert: ({ method: t, fullUrl: e, uriObj: r, httpVersion: o, allHeaders: i, postData: a }, n) => {
568
+ const s = {
569
+ absoluteURI: !1,
570
+ autoContentLength: !0,
571
+ autoHost: !0,
572
+ ...n
573
+ }, { blank: l, push: c, join: u } = new C({ indent: "", join: pr }), f = s.absoluteURI ? e : r.path;
574
+ c(`${t} ${f} ${o}`);
575
+ const p = Object.keys(i);
576
+ if (p.forEach((g) => {
577
+ const b = g.toLowerCase().replace(/(^|-)(\w)/g, (x) => x.toUpperCase());
578
+ c(`${b}: ${i[g]}`);
579
+ }), s.autoHost && !p.includes("host") && c(`Host: ${r.host}`), s.autoContentLength && a.text && !p.includes("content-length")) {
580
+ const b = new TextEncoder().encode(a.text).length.toString();
581
+ c(`Content-Length: ${b}`);
582
+ }
583
+ l();
584
+ const h = u(), y = a.text || "";
585
+ return `${h}${pr}${y}`;
586
+ }
587
+ }, ko = {
588
+ info: {
589
+ key: "http",
590
+ title: "HTTP",
591
+ default: "http1.1"
592
+ },
593
+ clientsById: {
594
+ "http1.1": Po
595
+ }
596
+ }, Eo = {
597
+ info: {
598
+ key: "asynchttp",
599
+ title: "AsyncHttp",
600
+ link: "https://github.com/AsyncHttpClient/async-http-client",
601
+ description: "Asynchronous Http and WebSocket Client library for Java",
602
+ extname: ".java"
603
+ },
604
+ convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
605
+ const a = {
606
+ indent: " ",
607
+ ...i
608
+ }, { blank: n, push: s, join: l } = new C({ indent: a.indent });
609
+ return s("AsyncHttpClient client = new DefaultAsyncHttpClient();"), s(`client.prepare("${t.toUpperCase()}", "${o}")`), Object.keys(e).forEach((c) => {
610
+ s(`.setHeader("${c}", "${H(e[c])}")`, 1);
611
+ }), r.text && s(`.setBody(${JSON.stringify(r.text)})`, 1), s(".execute()", 1), s(".toCompletableFuture()", 1), s(".thenAccept(System.out::println)", 1), s(".join();", 1), n(), s("client.close();"), l();
612
+ }
613
+ }, No = {
614
+ info: {
615
+ key: "nethttp",
616
+ title: "java.net.http",
617
+ link: "https://openjdk.java.net/groups/net/httpclient/intro.html",
618
+ description: "Java Standardized HTTP Client API",
619
+ extname: ".java"
620
+ },
621
+ convert: ({ allHeaders: t, fullUrl: e, method: r, postData: o }, i) => {
622
+ const a = {
623
+ indent: " ",
624
+ ...i
625
+ }, { push: n, join: s } = new C({ indent: a.indent });
626
+ return n("HttpRequest request = HttpRequest.newBuilder()"), n(`.uri(URI.create("${e}"))`, 2), Object.keys(t).forEach((l) => {
627
+ n(`.header("${l}", "${H(t[l])}")`, 2);
628
+ }), o.text ? n(
629
+ `.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(o.text)}))`,
630
+ 2
631
+ ) : n(`.method("${r.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), n(".build();", 2), n(
632
+ "HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"
633
+ ), n("System.out.println(response.body());"), s();
634
+ }
635
+ }, Ro = {
636
+ info: {
637
+ key: "okhttp",
638
+ title: "OkHttp",
639
+ link: "http://square.github.io/okhttp/",
640
+ description: "An HTTP Request Client Library",
641
+ extname: ".java"
642
+ },
643
+ convert: ({ postData: t, method: e, fullUrl: r, allHeaders: o }, i) => {
644
+ const a = {
645
+ indent: " ",
646
+ ...i
647
+ }, { push: n, blank: s, join: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
648
+ return n("OkHttpClient client = new OkHttpClient();"), s(), t.text && (t.boundary ? n(`MediaType mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}");`) : n(`MediaType mediaType = MediaType.parse("${t.mimeType}");`), n(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(t.text)});`)), n("Request request = new Request.Builder()"), n(`.url("${r}")`, 1), c.includes(e.toUpperCase()) ? u.includes(e.toUpperCase()) ? t.text ? n(`.${e.toLowerCase()}(body)`, 1) : n(`.${e.toLowerCase()}(null)`, 1) : n(`.${e.toLowerCase()}()`, 1) : t.text ? n(`.method("${e.toUpperCase()}", body)`, 1) : n(`.method("${e.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
649
+ n(`.addHeader("${f}", "${H(o[f])}")`, 1);
650
+ }), n(".build();", 1), s(), n("Response response = client.newCall(request).execute();"), l();
651
+ }
652
+ }, Ao = {
653
+ info: {
654
+ key: "unirest",
655
+ title: "Unirest",
656
+ link: "http://unirest.io/java.html",
657
+ description: "Lightweight HTTP Request Client Library",
658
+ extname: ".java"
659
+ },
660
+ convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
661
+ const a = {
662
+ indent: " ",
663
+ ...i
664
+ }, { join: n, push: s } = new C({ indent: a.indent });
665
+ return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(t.toUpperCase()) ? s(`HttpResponse<String> response = Unirest.${t.toLowerCase()}("${o}")`) : s(`HttpResponse<String> response = Unirest.customMethod("${t.toUpperCase()}","${o}")`), Object.keys(e).forEach((c) => {
666
+ s(`.header("${c}", "${H(e[c])}")`, 1);
667
+ }), r.text && s(`.body(${JSON.stringify(r.text)})`, 1), s(".asString();", 1), n();
668
+ }
669
+ }, qo = {
670
+ info: {
671
+ key: "java",
672
+ title: "Java",
673
+ default: "unirest"
674
+ },
675
+ clientsById: {
676
+ asynchttp: Eo,
677
+ nethttp: No,
678
+ okhttp: Ro,
679
+ unirest: Ao
680
+ }
681
+ }, Io = {
682
+ info: {
683
+ key: "axios",
684
+ title: "Axios",
685
+ link: "https://github.com/axios/axios",
686
+ description: "Promise based HTTP client for the browser and node.js",
687
+ extname: ".js",
688
+ installation: "npm install axios --save"
689
+ },
690
+ convert: ({ allHeaders: t, method: e, url: r, queryObj: o, postData: i }, a) => {
691
+ const n = {
692
+ indent: " ",
693
+ ...a
694
+ }, { blank: s, push: l, join: c, addPostProcessor: u } = new C({ indent: n.indent });
695
+ l("import axios from 'axios';"), s();
696
+ const f = {
697
+ method: e,
698
+ url: r
699
+ };
700
+ switch (Object.keys(o).length && (f.params = o), Object.keys(t).length && (f.headers = t), i.mimeType) {
701
+ case "application/x-www-form-urlencoded":
702
+ i.params && (l("const encodedParams = new URLSearchParams();"), i.params.forEach((h) => {
703
+ l(`encodedParams.set('${h.name}', '${h.value}');`);
704
+ }), s(), f.data = "encodedParams,", u((h) => h.replace(/'encodedParams,'/, "encodedParams,")));
705
+ break;
706
+ case "application/json":
707
+ i.jsonObj && (f.data = i.jsonObj);
708
+ break;
709
+ case "multipart/form-data":
710
+ if (!i.params)
711
+ break;
712
+ l("const form = new FormData();"), i.params.forEach((h) => {
713
+ l(`form.append('${h.name}', '${h.value || h.fileName || ""}');`);
714
+ }), s(), f.data = "[form]";
715
+ break;
716
+ default:
717
+ i.text && (f.data = i.text);
718
+ }
719
+ const p = z(f, {
720
+ indent: " ",
721
+ inlineCharacterLimit: 80
722
+ }).replace('"[form]"', "form");
723
+ return l(`const options = ${p};`), s(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), c();
724
+ }
725
+ }, Lo = {
726
+ info: {
727
+ key: "fetch",
728
+ title: "fetch",
729
+ link: "https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",
730
+ description: "Perform asynchronous HTTP requests with the Fetch API",
731
+ extname: ".js"
732
+ },
733
+ convert: ({ method: t, allHeaders: e, postData: r, fullUrl: o }, i) => {
734
+ const a = {
735
+ indent: " ",
736
+ credentials: null,
737
+ ...i
738
+ }, { blank: n, join: s, push: l } = new C({ indent: a.indent }), c = {
739
+ method: t
740
+ };
741
+ switch (Object.keys(e).length && (c.headers = e), a.credentials !== null && (c.credentials = a.credentials), r.mimeType) {
742
+ case "application/x-www-form-urlencoded":
743
+ c.body = r.paramsObj ? r.paramsObj : r.text;
744
+ break;
745
+ case "application/json":
746
+ r.jsonObj && (c.body = r.jsonObj);
747
+ break;
748
+ case "multipart/form-data":
749
+ if (!r.params)
750
+ break;
751
+ const u = J(e, "content-type");
752
+ u && delete e[u], l("const form = new FormData();"), r.params.forEach((f) => {
753
+ l(`form.append('${f.name}', '${f.value || f.fileName || ""}');`);
754
+ }), n();
755
+ break;
756
+ default:
757
+ r.text && (c.body = r.text);
758
+ }
759
+ return c.headers && !Object.keys(c.headers).length && delete c.headers, l(
760
+ `const options = ${z(c, {
761
+ indent: a.indent,
762
+ inlineCharacterLimit: 80,
763
+ // The Fetch API body only accepts string parameters, but stringified JSON can be difficult
764
+ // to read, so we keep the object as a literal and use this transform function to wrap the
765
+ // literal in a `JSON.stringify` call.
766
+ transform: (u, f, p) => {
767
+ if (f === "body") {
768
+ if (r.mimeType === "application/x-www-form-urlencoded")
769
+ return `new URLSearchParams(${p})`;
770
+ if (r.mimeType === "application/json")
771
+ return `JSON.stringify(${p})`;
772
+ }
773
+ return p;
774
+ }
775
+ })};`
776
+ ), n(), r.params && r.mimeType === "multipart/form-data" && (l("options.body = form;"), n()), l(`fetch('${o}', options)`), l(".then(response => response.json())", 1), l(".then(response => console.log(response))", 1), l(".catch(err => console.error(err));", 1), s();
777
+ }
778
+ }, Uo = {
779
+ info: {
780
+ key: "jquery",
781
+ title: "jQuery",
782
+ link: "http://api.jquery.com/jquery.ajax/",
783
+ description: "Perform an asynchronous HTTP (Ajax) requests with jQuery",
784
+ extname: ".js"
785
+ },
786
+ convert: ({ fullUrl: t, method: e, allHeaders: r, postData: o }, i) => {
787
+ var f;
788
+ const a = {
789
+ indent: " ",
790
+ ...i
791
+ }, { blank: n, push: s, join: l } = new C({ indent: a.indent }), c = {
792
+ async: !0,
793
+ crossDomain: !0,
794
+ url: t,
795
+ method: e,
796
+ headers: r
797
+ };
798
+ switch (o.mimeType) {
799
+ case "application/x-www-form-urlencoded":
800
+ c.data = o.paramsObj ? o.paramsObj : o.text;
801
+ break;
802
+ case "application/json":
803
+ c.processData = !1, c.data = o.text;
804
+ break;
805
+ case "multipart/form-data":
806
+ if (!o.params)
807
+ break;
808
+ if (s("const form = new FormData();"), o.params.forEach((p) => {
809
+ s(`form.append('${p.name}', '${p.value || p.fileName || ""}');`);
810
+ }), c.processData = !1, c.contentType = !1, c.mimeType = "multipart/form-data", c.data = "[form]", pt(r, "content-type") && (f = ue(r, "content-type")) != null && f.includes("boundary")) {
811
+ const p = J(r, "content-type");
812
+ p && delete c.headers[p];
813
+ }
814
+ n();
815
+ break;
816
+ default:
817
+ o.text && (c.data = o.text);
818
+ }
819
+ const u = z(c, { indent: a.indent }).replace("'[form]'", "form");
820
+ return s(`const settings = ${u};`), n(), s("$.ajax(settings).done(function (response) {"), s("console.log(response);", 1), s("});"), l();
821
+ }
822
+ }, Fo = {
823
+ info: {
824
+ key: "xhr",
825
+ title: "XMLHttpRequest",
826
+ link: "https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",
827
+ description: "W3C Standard API that provides scripted client functionality",
828
+ extname: ".js"
829
+ },
830
+ convert: ({ postData: t, allHeaders: e, method: r, fullUrl: o }, i) => {
831
+ var c;
832
+ const a = {
833
+ indent: " ",
834
+ cors: !0,
835
+ ...i
836
+ }, { blank: n, push: s, join: l } = new C({ indent: a.indent });
837
+ switch (t.mimeType) {
838
+ case "application/json":
839
+ s(
840
+ `const data = JSON.stringify(${z(t.jsonObj, {
841
+ indent: a.indent
842
+ })});`
843
+ ), n();
844
+ break;
845
+ case "multipart/form-data":
846
+ if (!t.params)
847
+ break;
848
+ if (s("const data = new FormData();"), t.params.forEach((u) => {
849
+ s(`data.append('${u.name}', '${u.value || u.fileName || ""}');`);
850
+ }), pt(e, "content-type") && (c = ue(e, "content-type")) != null && c.includes("boundary")) {
851
+ const u = J(e, "content-type");
852
+ u && delete e[u];
853
+ }
854
+ n();
855
+ break;
856
+ default:
857
+ s(`const data = ${t.text ? `'${t.text}'` : "null"};`), n();
858
+ }
859
+ return s("const xhr = new XMLHttpRequest();"), a.cors && s("xhr.withCredentials = true;"), n(), s("xhr.addEventListener('readystatechange', function () {"), s("if (this.readyState === this.DONE) {", 1), s("console.log(this.responseText);", 2), s("}", 1), s("});"), n(), s(`xhr.open('${r}', '${o}');`), Object.keys(e).forEach((u) => {
860
+ s(`xhr.setRequestHeader('${u}', '${Je(e[u])}');`);
861
+ }), n(), s("xhr.send(data);"), l();
862
+ }
863
+ }, _o = {
864
+ info: {
865
+ key: "javascript",
866
+ title: "JavaScript",
867
+ default: "xhr"
868
+ },
869
+ clientsById: {
870
+ xhr: Fo,
871
+ axios: Io,
872
+ fetch: Lo,
873
+ jquery: Uo
874
+ }
875
+ }, Ho = {
876
+ info: {
877
+ key: "native",
878
+ title: "Native JSON",
879
+ link: "https://www.json.org/json-en.html",
880
+ description: "A JSON represetation of any HAR payload.",
881
+ extname: ".json"
882
+ },
883
+ convert: ({ postData: t }, e) => {
884
+ const r = {
885
+ indent: " ",
886
+ ...e
887
+ };
888
+ let o = "";
889
+ switch (t.mimeType) {
890
+ case "application/x-www-form-urlencoded":
891
+ o = t.paramsObj ? t.paramsObj : t.text;
892
+ break;
893
+ case "application/json":
894
+ t.jsonObj && (o = t.jsonObj);
895
+ break;
896
+ case "multipart/form-data":
897
+ if (!t.params)
898
+ break;
899
+ const i = {};
900
+ t.params.forEach((a) => {
901
+ i[a.name] = a.value;
902
+ }), o = i;
903
+ break;
904
+ default:
905
+ t.text && (o = t.text);
906
+ }
907
+ return typeof o > "u" || o === "" ? "No JSON body" : JSON.stringify(o, null, r.indent);
908
+ }
909
+ }, Bo = {
910
+ info: {
911
+ key: "json",
912
+ title: "JSON",
913
+ default: "native"
914
+ },
915
+ clientsById: {
916
+ native: Ho
917
+ }
918
+ }, Mo = {
919
+ info: {
920
+ key: "okhttp",
921
+ title: "OkHttp",
922
+ link: "http://square.github.io/okhttp/",
923
+ description: "An HTTP Request Client Library",
924
+ extname: ".kt"
925
+ },
926
+ convert: ({ postData: t, fullUrl: e, method: r, allHeaders: o }, i) => {
927
+ const a = {
928
+ indent: " ",
929
+ ...i
930
+ }, { blank: n, join: s, push: l } = new C({ indent: a.indent }), c = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], u = ["POST", "PUT", "DELETE", "PATCH"];
931
+ return l("val client = OkHttpClient()"), n(), t.text && (t.boundary ? l(`val mediaType = MediaType.parse("${t.mimeType}; boundary=${t.boundary}")`) : l(`val mediaType = MediaType.parse("${t.mimeType}")`), l(`val body = RequestBody.create(mediaType, ${JSON.stringify(t.text)})`)), l("val request = Request.Builder()"), l(`.url("${e}")`, 1), c.includes(r.toUpperCase()) ? u.includes(r.toUpperCase()) ? t.text ? l(`.${r.toLowerCase()}(body)`, 1) : l(`.${r.toLowerCase()}(null)`, 1) : l(`.${r.toLowerCase()}()`, 1) : t.text ? l(`.method("${r.toUpperCase()}", body)`, 1) : l(`.method("${r.toUpperCase()}", null)`, 1), Object.keys(o).forEach((f) => {
932
+ l(`.addHeader("${f}", "${H(o[f])}")`, 1);
933
+ }), l(".build()", 1), n(), l("val response = client.newCall(request).execute()"), s();
934
+ }
935
+ }, zo = {
936
+ info: {
937
+ key: "kotlin",
938
+ title: "Kotlin",
939
+ default: "okhttp"
940
+ },
941
+ clientsById: {
942
+ okhttp: Mo
943
+ }
944
+ }, Wo = {
945
+ info: {
946
+ key: "axios",
947
+ title: "Axios",
948
+ link: "https://github.com/axios/axios",
949
+ description: "Promise based HTTP client for the browser and node.js",
950
+ extname: ".cjs",
951
+ installation: "npm install axios --save"
952
+ },
953
+ convert: ({ method: t, fullUrl: e, allHeaders: r, postData: o }, i) => {
954
+ const a = {
955
+ indent: " ",
956
+ ...i
957
+ }, { blank: n, join: s, push: l, addPostProcessor: c } = new C({ indent: a.indent });
958
+ l("const axios = require('axios');");
959
+ const u = {
960
+ method: t,
961
+ url: e
962
+ };
963
+ switch (Object.keys(r).length && (u.headers = r), o.mimeType) {
964
+ case "application/x-www-form-urlencoded":
965
+ o.params && (l("const { URLSearchParams } = require('url');"), n(), l("const encodedParams = new URLSearchParams();"), o.params.forEach((p) => {
966
+ l(`encodedParams.set('${p.name}', '${p.value}');`);
967
+ }), n(), u.data = "encodedParams,", c((p) => p.replace(/'encodedParams,'/, "encodedParams,")));
968
+ break;
969
+ case "application/json":
970
+ n(), o.jsonObj && (u.data = o.jsonObj);
971
+ break;
972
+ default:
973
+ n(), o.text && (u.data = o.text);
974
+ }
975
+ const f = z(u, { indent: " ", inlineCharacterLimit: 80 });
976
+ return l(`const options = ${f};`), n(), l("axios"), l(".request(options)", 1), l(".then(function (response) {", 1), l("console.log(response.data);", 2), l("})", 1), l(".catch(function (error) {", 1), l("console.error(error);", 2), l("});", 1), s();
977
+ }
978
+ }, Jo = {
979
+ info: {
980
+ key: "fetch",
981
+ title: "Fetch",
982
+ link: "https://github.com/bitinn/node-fetch",
983
+ description: "Simplified HTTP node-fetch client",
984
+ extname: ".cjs",
985
+ installation: "npm install node-fetch@2 --save"
986
+ },
987
+ convert: ({ method: t, fullUrl: e, postData: r, headersObj: o, cookies: i }, a) => {
988
+ var g;
989
+ const n = {
990
+ indent: " ",
991
+ ...a
992
+ };
993
+ let s = !1;
994
+ const { blank: l, push: c, join: u, unshift: f } = new C({ indent: n.indent });
995
+ c("const fetch = require('node-fetch');");
996
+ const p = e, h = {
997
+ method: t
998
+ };
999
+ switch (Object.keys(o).length && (h.headers = o), r.mimeType) {
1000
+ case "application/x-www-form-urlencoded":
1001
+ f("const { URLSearchParams } = require('url');"), c("const encodedParams = new URLSearchParams();"), l(), (g = r.params) == null || g.forEach((x) => {
1002
+ c(`encodedParams.set('${x.name}', '${x.value}');`);
1003
+ }), h.body = "encodedParams";
1004
+ break;
1005
+ case "application/json":
1006
+ r.jsonObj && (h.body = r.jsonObj);
1007
+ break;
1008
+ case "multipart/form-data":
1009
+ if (!r.params)
1010
+ break;
1011
+ const b = J(o, "content-type");
1012
+ b && delete o[b], f("const FormData = require('form-data');"), c("const formData = new FormData();"), l(), r.params.forEach((x) => {
1013
+ if (!x.fileName && !x.fileName && !x.contentType) {
1014
+ c(`formData.append('${x.name}', '${x.value}');`);
1015
+ return;
1016
+ }
1017
+ x.fileName && (s = !0, c(`formData.append('${x.name}', fs.createReadStream('${x.fileName}'));`));
1018
+ });
1019
+ break;
1020
+ default:
1021
+ r.text && (h.body = r.text);
1022
+ }
1023
+ if (i.length) {
1024
+ const b = i.map(({ name: x, value: m }) => `${encodeURIComponent(x)}=${encodeURIComponent(m)}`).join("; ");
1025
+ h.headers || (h.headers = {}), h.headers.cookie = b;
1026
+ }
1027
+ l(), c(`const url = '${p}';`), h.headers && !Object.keys(h.headers).length && delete h.headers;
1028
+ const y = z(h, {
1029
+ indent: " ",
1030
+ inlineCharacterLimit: 80,
1031
+ // The Fetch API body only accepts string parameters, but stringified JSON can be difficult to
1032
+ // read, so we keep the object as a literal and use this transform function to wrap the literal
1033
+ // in a `JSON.stringify` call.
1034
+ transform: (b, x, m) => x === "body" && r.mimeType === "application/json" ? `JSON.stringify(${m})` : m
1035
+ });
1036
+ return c(`const options = ${y};`), l(), s && f("const fs = require('fs');"), r.params && r.mimeType === "multipart/form-data" && (c("options.body = formData;"), l()), c("fetch(url, options)"), c(".then(res => res.json())", 1), c(".then(json => console.log(json))", 1), c(".catch(err => console.error('error:' + err));", 1), u().replace(/'encodedParams'/, "encodedParams").replace(/"fs\.createReadStream\(\\"(.+)\\"\)"/, 'fs.createReadStream("$1")');
1037
+ }
1038
+ }, Go = {
1039
+ info: {
1040
+ key: "native",
1041
+ title: "HTTP",
1042
+ link: "http://nodejs.org/api/http.html#http_http_request_options_callback",
1043
+ description: "Node.js native HTTP interface",
1044
+ extname: ".cjs"
1045
+ },
1046
+ convert: ({ uriObj: t, method: e, allHeaders: r, postData: o }, i = {}) => {
1047
+ var f;
1048
+ const { indent: a = " " } = i, { blank: n, join: s, push: l, unshift: c } = new C({ indent: a }), u = {
1049
+ method: e,
1050
+ hostname: t.hostname,
1051
+ port: t.port,
1052
+ path: t.path,
1053
+ headers: r
1054
+ };
1055
+ switch (l(`const http = require('${(f = t.protocol) == null ? void 0 : f.replace(":", "")}');`), n(), l(`const options = ${z(u, { indent: a })};`), n(), l("const req = http.request(options, function (res) {"), l("const chunks = [];", 1), n(), l("res.on('data', function (chunk) {", 1), l("chunks.push(chunk);", 2), l("});", 1), n(), l("res.on('end', function () {", 1), l("const body = Buffer.concat(chunks);", 2), l("console.log(body.toString());", 2), l("});", 1), l("});"), n(), o.mimeType) {
1056
+ case "application/x-www-form-urlencoded":
1057
+ o.paramsObj && (c("const qs = require('querystring');"), l(
1058
+ `req.write(qs.stringify(${z(o.paramsObj, {
1059
+ indent: " ",
1060
+ inlineCharacterLimit: 80
1061
+ })}));`
1062
+ ));
1063
+ break;
1064
+ case "application/json":
1065
+ o.jsonObj && l(
1066
+ `req.write(JSON.stringify(${z(o.jsonObj, {
1067
+ indent: " ",
1068
+ inlineCharacterLimit: 80
1069
+ })}));`
1070
+ );
1071
+ break;
1072
+ default:
1073
+ o.text && l(`req.write(${z(o.text, { indent: a })});`);
1074
+ }
1075
+ return l("req.end();"), s();
1076
+ }
1077
+ }, Vo = {
1078
+ info: {
1079
+ key: "request",
1080
+ title: "Request",
1081
+ link: "https://github.com/request/request",
1082
+ description: "Simplified HTTP request client",
1083
+ extname: ".cjs",
1084
+ installation: "npm install request --save"
1085
+ },
1086
+ convert: ({ method: t, url: e, fullUrl: r, postData: o, headersObj: i, cookies: a }, n) => {
1087
+ const s = {
1088
+ indent: " ",
1089
+ ...n
1090
+ };
1091
+ let l = !1;
1092
+ const { push: c, blank: u, join: f, unshift: p, addPostProcessor: h } = new C({ indent: s.indent });
1093
+ c("const request = require('request');"), u();
1094
+ const y = {
1095
+ method: t,
1096
+ url: r
1097
+ };
1098
+ switch (Object.keys(i).length && (y.headers = i), o.mimeType) {
1099
+ case "application/x-www-form-urlencoded":
1100
+ y.form = o.paramsObj;
1101
+ break;
1102
+ case "application/json":
1103
+ o.jsonObj && (y.body = o.jsonObj, y.json = !0);
1104
+ break;
1105
+ case "multipart/form-data":
1106
+ if (!o.params)
1107
+ break;
1108
+ y.formData = {}, o.params.forEach((g) => {
1109
+ if (!g.fileName && !g.fileName && !g.contentType) {
1110
+ y.formData[g.name] = g.value;
1111
+ return;
1112
+ }
1113
+ let b = {};
1114
+ g.fileName ? (l = !0, b = {
1115
+ value: `fs.createReadStream(${g.fileName})`,
1116
+ options: {
1117
+ filename: g.fileName,
1118
+ contentType: g.contentType ? g.contentType : null
1119
+ }
1120
+ }) : g.value && (b.value = g.value), y.formData[g.name] = b;
1121
+ }), h((g) => g.replace(/'fs\.createReadStream\((.*)\)'/, "fs.createReadStream('$1')"));
1122
+ break;
1123
+ default:
1124
+ o.text && (y.body = o.text);
1125
+ }
1126
+ return a.length && (y.jar = "JAR", c("const jar = request.jar();"), a.forEach(({ name: g, value: b }) => {
1127
+ c(`jar.setCookie(request.cookie('${encodeURIComponent(g)}=${encodeURIComponent(b)}'), '${e}');`);
1128
+ }), u(), h((g) => g.replace(/'JAR'/, "jar"))), l && p("const fs = require('fs');"), c(`const options = ${z(y, { indent: " ", inlineCharacterLimit: 80 })};`), u(), c("request(options, function (error, response, body) {"), c("if (error) throw new Error(error);", 1), u(), c("console.log(body);", 1), c("});"), f();
1129
+ }
1130
+ }, Qo = {
1131
+ info: {
1132
+ key: "unirest",
1133
+ title: "Unirest",
1134
+ link: "http://unirest.io/nodejs.html",
1135
+ description: "Lightweight HTTP Request Client Library",
1136
+ extname: ".cjs"
1137
+ },
1138
+ convert: ({ method: t, url: e, cookies: r, queryObj: o, postData: i, headersObj: a }, n) => {
1139
+ const s = {
1140
+ indent: " ",
1141
+ ...n
1142
+ };
1143
+ let l = !1;
1144
+ const { addPostProcessor: c, blank: u, join: f, push: p, unshift: h } = new C({
1145
+ indent: s.indent
1146
+ });
1147
+ switch (p("const unirest = require('unirest');"), u(), p(`const req = unirest('${t}', '${e}');`), u(), r.length && (p("const CookieJar = unirest.jar();"), r.forEach((y) => {
1148
+ p(`CookieJar.add('${encodeURIComponent(y.name)}=${encodeURIComponent(y.value)}', '${e}');`);
1149
+ }), p("req.jar(CookieJar);"), u()), Object.keys(o).length && (p(`req.query(${z(o, { indent: s.indent })});`), u()), Object.keys(a).length && (p(`req.headers(${z(a, { indent: s.indent })});`), u()), i.mimeType) {
1150
+ case "application/x-www-form-urlencoded":
1151
+ i.paramsObj && (p(`req.form(${z(i.paramsObj, { indent: s.indent })});`), u());
1152
+ break;
1153
+ case "application/json":
1154
+ i.jsonObj && (p("req.type('json');"), p(`req.send(${z(i.jsonObj, { indent: s.indent })});`), u());
1155
+ break;
1156
+ case "multipart/form-data": {
1157
+ if (!i.params)
1158
+ break;
1159
+ const y = [];
1160
+ i.params.forEach((g) => {
1161
+ const b = {};
1162
+ g.fileName && !g.value ? (l = !0, b.body = `fs.createReadStream('${g.fileName}')`, c((x) => x.replace(/'fs\.createReadStream\(\\'(.+)\\'\)'/, "fs.createReadStream('$1')"))) : g.value && (b.body = g.value), b.body && (g.contentType && (b["content-type"] = g.contentType), y.push(b));
1163
+ }), p(`req.multipart(${z(y, { indent: s.indent })});`), u();
1164
+ break;
1165
+ }
1166
+ default:
1167
+ i.text && (p(`req.send(${z(i.text, { indent: s.indent })});`), u());
1168
+ }
1169
+ return l && h("const fs = require('fs');"), p("req.end(function (res) {"), p("if (res.error) throw new Error(res.error);", 1), u(), p("console.log(res.body);", 1), p("});"), f();
1170
+ }
1171
+ }, Ko = {
1172
+ info: {
1173
+ key: "node",
1174
+ title: "Node.js",
1175
+ default: "native",
1176
+ cli: "node %s"
1177
+ },
1178
+ clientsById: {
1179
+ native: Go,
1180
+ request: Vo,
1181
+ unirest: Qo,
1182
+ axios: Wo,
1183
+ fetch: Jo
1184
+ }
1185
+ }, ht = (t, e, r, o) => {
1186
+ const i = `${t} *${e} = `, a = Pt(r, o ? i.length : void 0);
1187
+ return `${i}${a};`;
1188
+ }, Pt = (t, e) => {
1189
+ const r = e === void 0 ? ", " : `,
1190
+ ${" ".repeat(e)}`;
1191
+ switch (Object.prototype.toString.call(t)) {
1192
+ case "[object Number]":
1193
+ return `@${t}`;
1194
+ case "[object Array]":
1195
+ return `@[ ${t.map((i) => Pt(i)).join(r)} ]`;
1196
+ case "[object Object]": {
1197
+ const o = [];
1198
+ return Object.keys(t).forEach((i) => {
1199
+ o.push(`@"${i}": ${Pt(t[i])}`);
1200
+ }), `@{ ${o.join(r)} }`;
1201
+ }
1202
+ case "[object Boolean]":
1203
+ return t ? "@YES" : "@NO";
1204
+ default:
1205
+ return t == null ? "" : `@"${t.toString().replace(/"/g, '\\"')}"`;
1206
+ }
1207
+ }, Do = {
1208
+ info: {
1209
+ key: "nsurlsession",
1210
+ title: "NSURLSession",
1211
+ link: "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
1212
+ description: "Foundation's NSURLSession request",
1213
+ extname: ".m"
1214
+ },
1215
+ convert: ({ allHeaders: t, postData: e, method: r, fullUrl: o }, i) => {
1216
+ var u;
1217
+ const a = {
1218
+ indent: " ",
1219
+ pretty: !0,
1220
+ timeout: 10,
1221
+ ...i
1222
+ }, { push: n, join: s, blank: l } = new C({ indent: a.indent }), c = {
1223
+ hasHeaders: !1,
1224
+ hasBody: !1
1225
+ };
1226
+ if (n("#import <Foundation/Foundation.h>"), Object.keys(t).length && (c.hasHeaders = !0, l(), n(ht("NSDictionary", "headers", t, a.pretty))), e.text || e.jsonObj || e.params)
1227
+ switch (c.hasBody = !0, e.mimeType) {
1228
+ case "application/x-www-form-urlencoded":
1229
+ if ((u = e.params) != null && u.length) {
1230
+ l();
1231
+ const [f, ...p] = e.params;
1232
+ n(
1233
+ `NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${f.name}=${f.value}" dataUsingEncoding:NSUTF8StringEncoding]];`
1234
+ ), p.forEach(({ name: h, value: y }) => {
1235
+ n(`[postData appendData:[@"&${h}=${y}" dataUsingEncoding:NSUTF8StringEncoding]];`);
1236
+ });
1237
+ } else
1238
+ c.hasBody = !1;
1239
+ break;
1240
+ case "application/json":
1241
+ e.jsonObj && (n(ht("NSDictionary", "parameters", e.jsonObj, a.pretty)), l(), n("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
1242
+ break;
1243
+ case "multipart/form-data":
1244
+ n(ht("NSArray", "parameters", e.params || [], a.pretty)), n(`NSString *boundary = @"${e.boundary}";`), l(), n("NSError *error;"), n("NSMutableString *body = [NSMutableString string];"), n("for (NSDictionary *param in parameters) {"), n('[body appendFormat:@"--%@\\r\\n", boundary];', 1), n('if (param[@"fileName"]) {', 1), n(
1245
+ '[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',
1246
+ 2
1247
+ ), n('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), n(
1248
+ '[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',
1249
+ 2
1250
+ ), n("if (error) {", 2), n('NSLog(@"%@", error);', 3), n("}", 2), n("} else {", 1), n('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2), n('[body appendFormat:@"%@", param[@"value"]];', 2), n("}", 1), n("}"), n('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'), n("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");
1251
+ break;
1252
+ default:
1253
+ l(), n(
1254
+ `NSData *postData = [[NSData alloc] initWithData:[@"${e.text}" dataUsingEncoding:NSUTF8StringEncoding]];`
1255
+ );
1256
+ }
1257
+ return l(), n(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${o}"]`), n(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), n(` timeoutInterval:${a.timeout.toFixed(1)}];`), n(`[request setHTTPMethod:@"${r}"];`), c.hasHeaders && n("[request setAllHTTPHeaderFields:headers];"), c.hasBody && n("[request setHTTPBody:postData];"), l(), n("NSURLSession *session = [NSURLSession sharedSession];"), n("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), n(
1258
+ " completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"
1259
+ ), n(" if (error) {", 1), n(' NSLog(@"%@", error);', 2), n(" } else {", 1), n(
1260
+ " NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",
1261
+ 2
1262
+ ), n(' NSLog(@"%@", httpResponse);', 2), n(" }", 1), n(" }];"), n("[dataTask resume];"), s();
1263
+ }
1264
+ }, Yo = {
1265
+ info: {
1266
+ key: "objc",
1267
+ title: "Objective-C",
1268
+ default: "nsurlsession"
1269
+ },
1270
+ clientsById: {
1271
+ nsurlsession: Do
1272
+ }
1273
+ }, Xo = {
1274
+ info: {
1275
+ key: "cohttp",
1276
+ title: "CoHTTP",
1277
+ link: "https://github.com/mirage/ocaml-cohttp",
1278
+ description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
1279
+ extname: ".ml",
1280
+ installation: "opam install cohttp-lwt-unix cohttp-async"
1281
+ },
1282
+ convert: ({ fullUrl: t, allHeaders: e, postData: r, method: o }, i) => {
1283
+ const a = {
1284
+ indent: " ",
1285
+ ...i
1286
+ }, n = ["get", "post", "head", "delete", "patch", "put", "options"], { push: s, blank: l, join: c } = new C({ indent: a.indent });
1287
+ s("open Cohttp_lwt_unix"), s("open Cohttp"), s("open Lwt"), l(), s(`let uri = Uri.of_string "${t}" in`);
1288
+ const u = Object.keys(e);
1289
+ u.length === 1 ? s(
1290
+ `let headers = Header.add (Header.init ()) "${u[0]}" "${H(
1291
+ e[u[0]]
1292
+ )}" in`
1293
+ ) : u.length > 1 && (s("let headers = Header.add_list (Header.init ()) ["), u.forEach((y) => {
1294
+ s(`("${y}", "${H(e[y])}");`, 1);
1295
+ }), s("] in")), r.text && s(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(r.text)} in`), l();
1296
+ const f = u.length ? "~headers " : "", p = r.text ? "~body " : "", h = n.includes(o.toLowerCase()) ? `\`${o.toUpperCase()}` : `(Code.method_of_string "${o}")`;
1297
+ return s(`Client.call ${f}${p}${h} uri`), s(">>= fun (res, body_stream) ->"), s("(* Do stuff with the result *)", 1), c();
1298
+ }
1299
+ }, Zo = {
1300
+ info: {
1301
+ key: "ocaml",
1302
+ title: "OCaml",
1303
+ default: "cohttp"
1304
+ },
1305
+ clientsById: {
1306
+ cohttp: Xo
1307
+ }
1308
+ }, N = (t, e, r) => {
1309
+ switch (r = r || "", e = e || "", Object.prototype.toString.call(t)) {
1310
+ case "[object Boolean]":
1311
+ return t;
1312
+ case "[object Null]":
1313
+ return "null";
1314
+ case "[object Undefined]":
1315
+ return "null";
1316
+ case "[object String]":
1317
+ return `'${We(t, { delimiter: "'", escapeNewlines: !1 })}'`;
1318
+ case "[object Number]":
1319
+ return t.toString();
1320
+ case "[object Array]": {
1321
+ const o = t.map((i) => N(i, `${e}${e}`, e)).join(`,
1322
+ ${e}`);
1323
+ return `[
1324
+ ${e}${o}
1325
+ ${r}]`;
1326
+ }
1327
+ case "[object Object]": {
1328
+ const o = [];
1329
+ for (const i in t)
1330
+ Object.prototype.hasOwnProperty.call(t, i) && o.push(`${N(i, e)} => ${N(t[i], `${e}${e}`, e)}`);
1331
+ return `[
1332
+ ${e}${o.join(`,
1333
+ ${e}`)}
1334
+ ${r}]`;
1335
+ }
1336
+ default:
1337
+ return "null";
1338
+ }
1339
+ }, fr = [
1340
+ "ACL",
1341
+ "BASELINE_CONTROL",
1342
+ "CHECKIN",
1343
+ "CHECKOUT",
1344
+ "CONNECT",
1345
+ "COPY",
1346
+ "DELETE",
1347
+ "GET",
1348
+ "HEAD",
1349
+ "LABEL",
1350
+ "LOCK",
1351
+ "MERGE",
1352
+ "MKACTIVITY",
1353
+ "MKCOL",
1354
+ "MKWORKSPACE",
1355
+ "MOVE",
1356
+ "OPTIONS",
1357
+ "POST",
1358
+ "PROPFIND",
1359
+ "PROPPATCH",
1360
+ "PUT",
1361
+ "REPORT",
1362
+ "TRACE",
1363
+ "UNCHECKOUT",
1364
+ "UNLOCK",
1365
+ "UPDATE",
1366
+ "VERSION_CONTROL"
1367
+ ], ea = {
1368
+ info: {
1369
+ key: "curl",
1370
+ title: "cURL",
1371
+ link: "http://php.net/manual/en/book.curl.php",
1372
+ description: "PHP with ext-curl",
1373
+ extname: ".php"
1374
+ },
1375
+ convert: ({ uriObj: t, postData: e, fullUrl: r, method: o, httpVersion: i, cookies: a, headersObj: n }, s = {}) => {
1376
+ const {
1377
+ closingTag: l = !1,
1378
+ indent: c = " ",
1379
+ maxRedirects: u = 10,
1380
+ namedErrors: f = !1,
1381
+ noTags: p = !1,
1382
+ shortTags: h = !1,
1383
+ timeout: y = 30
1384
+ } = s, { push: g, blank: b, join: x } = new C({ indent: c });
1385
+ p || (g(h ? "<?" : "<?php"), b()), g("$curl = curl_init();"), b();
1386
+ const m = [
1387
+ {
1388
+ escape: !0,
1389
+ name: "CURLOPT_PORT",
1390
+ value: t.port
1391
+ },
1392
+ {
1393
+ escape: !0,
1394
+ name: "CURLOPT_URL",
1395
+ value: r
1396
+ },
1397
+ {
1398
+ escape: !1,
1399
+ name: "CURLOPT_RETURNTRANSFER",
1400
+ value: "true"
1401
+ },
1402
+ {
1403
+ escape: !0,
1404
+ name: "CURLOPT_ENCODING",
1405
+ value: ""
1406
+ },
1407
+ {
1408
+ escape: !1,
1409
+ name: "CURLOPT_MAXREDIRS",
1410
+ value: u
1411
+ },
1412
+ {
1413
+ escape: !1,
1414
+ name: "CURLOPT_TIMEOUT",
1415
+ value: y
1416
+ },
1417
+ {
1418
+ escape: !1,
1419
+ name: "CURLOPT_HTTP_VERSION",
1420
+ value: i === "HTTP/1.0" ? "CURL_HTTP_VERSION_1_0" : "CURL_HTTP_VERSION_1_1"
1421
+ },
1422
+ {
1423
+ escape: !0,
1424
+ name: "CURLOPT_CUSTOMREQUEST",
1425
+ value: o
1426
+ },
1427
+ {
1428
+ escape: !e.jsonObj,
1429
+ name: "CURLOPT_POSTFIELDS",
1430
+ value: e ? e.jsonObj ? `json_encode(${N(e.jsonObj, c.repeat(2), c)})` : e.text : void 0
1431
+ }
1432
+ ];
1433
+ g("curl_setopt_array($curl, [");
1434
+ const v = new C({ indent: c, join: `
1435
+ ${c}` });
1436
+ m.forEach(({ value: S, name: k, escape: E }) => {
1437
+ S != null && v.push(`${k} => ${E ? JSON.stringify(S) : S},`);
1438
+ });
1439
+ const j = a.map((S) => `${encodeURIComponent(S.name)}=${encodeURIComponent(S.value)}`);
1440
+ j.length && v.push(`CURLOPT_COOKIE => "${j.join("; ")}",`);
1441
+ const w = Object.keys(n).sort().map((S) => `"${S}: ${H(n[S])}"`);
1442
+ return w.length && (v.push("CURLOPT_HTTPHEADER => ["), v.push(w.join(`,
1443
+ ${c}${c}`), 1), v.push("],")), g(v.join(), 1), g("]);"), b(), g("$response = curl_exec($curl);"), g("$err = curl_error($curl);"), b(), g("curl_close($curl);"), b(), g("if ($err) {"), g(f ? 'echo array_flip(get_defined_constants(true)["curl"])[$err];' : 'echo "cURL Error #:" . $err;', 1), g("} else {"), g("echo $response;", 1), g("}"), !p && l && (b(), g("?>")), x();
1444
+ }
1445
+ }, ta = {
1446
+ info: {
1447
+ key: "guzzle",
1448
+ title: "Guzzle",
1449
+ link: "http://docs.guzzlephp.org/en/stable/",
1450
+ description: "PHP with Guzzle",
1451
+ extname: ".php",
1452
+ installation: "composer require guzzlehttp/guzzle"
1453
+ },
1454
+ convert: ({ postData: t, fullUrl: e, method: r, cookies: o, headersObj: i }, a) => {
1455
+ var g;
1456
+ const n = {
1457
+ closingTag: !1,
1458
+ indent: " ",
1459
+ noTags: !1,
1460
+ shortTags: !1,
1461
+ ...a
1462
+ }, { push: s, blank: l, join: c } = new C({ indent: n.indent }), { code: u, push: f, join: p } = new C({ indent: n.indent });
1463
+ switch (n.noTags || s(n.shortTags ? "<?" : "<?php"), s("require_once('vendor/autoload.php');"), l(), t.mimeType) {
1464
+ case "application/x-www-form-urlencoded":
1465
+ f(`'form_params' => ${N(t.paramsObj, n.indent + n.indent, n.indent)},`, 1);
1466
+ break;
1467
+ case "multipart/form-data": {
1468
+ const b = [];
1469
+ if (t.params && t.params.forEach((x) => {
1470
+ if (x.fileName) {
1471
+ const m = {
1472
+ name: x.name,
1473
+ filename: x.fileName,
1474
+ contents: x.value
1475
+ };
1476
+ x.contentType && (m.headers = { "Content-Type": x.contentType }), b.push(m);
1477
+ } else x.value && b.push({
1478
+ name: x.name,
1479
+ contents: x.value
1480
+ });
1481
+ }), b.length && (f(`'multipart' => ${N(b, n.indent + n.indent, n.indent)}`, 1), pt(i, "content-type") && (g = ue(i, "content-type")) != null && g.indexOf("boundary"))) {
1482
+ const x = J(i, "content-type");
1483
+ x && delete i[x];
1484
+ }
1485
+ break;
1486
+ }
1487
+ default:
1488
+ t.text && f(`'body' => ${N(t.text)},`, 1);
1489
+ }
1490
+ const h = Object.keys(i).sort().map(function(b) {
1491
+ return `${n.indent}${n.indent}'${b}' => '${Je(i[b])}',`;
1492
+ }), y = o.map((b) => `${encodeURIComponent(b.name)}=${encodeURIComponent(b.value)}`).join("; ");
1493
+ return y.length && h.push(`${n.indent}${n.indent}'cookie' => '${Je(y)}',`), h.length && (f("'headers' => [", 1), f(h.join(`
1494
+ `)), f("],", 1)), s("$client = new \\GuzzleHttp\\Client();"), l(), u.length ? (s(`$response = $client->request('${r}', '${e}', [`), s(p()), s("]);")) : s(`$response = $client->request('${r}', '${e}');`), l(), s("echo $response->getBody();"), !n.noTags && n.closingTag && (l(), s("?>")), c();
1495
+ }
1496
+ }, ra = {
1497
+ info: {
1498
+ key: "http1",
1499
+ title: "HTTP v1",
1500
+ link: "http://php.net/manual/en/book.http.php",
1501
+ description: "PHP with pecl/http v1",
1502
+ extname: ".php"
1503
+ },
1504
+ convert: ({ method: t, url: e, postData: r, queryObj: o, headersObj: i, cookiesObj: a }, n = {}) => {
1505
+ const { closingTag: s = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
1506
+ switch (c || (f(u ? "<?" : "<?php"), p()), fr.includes(t.toUpperCase()) || f(`HttpRequest::methodRegister('${t}');`), f("$request = new HttpRequest();"), f(`$request->setUrl(${N(e)});`), fr.includes(t.toUpperCase()) ? f(`$request->setMethod(HTTP_METH_${t.toUpperCase()});`) : f(`$request->setMethod(HttpRequest::HTTP_METH_${t.toUpperCase()});`), p(), Object.keys(o).length && (f(`$request->setQueryData(${N(o, l)});`), p()), Object.keys(i).length && (f(`$request->setHeaders(${N(i, l)});`), p()), Object.keys(a).length && (f(`$request->setCookies(${N(a, l)});`), p()), r.mimeType) {
1507
+ case "application/x-www-form-urlencoded":
1508
+ f(`$request->setContentType(${N(r.mimeType)});`), f(`$request->setPostFields(${N(r.paramsObj, l)});`), p();
1509
+ break;
1510
+ case "application/json":
1511
+ f(`$request->setContentType(${N(r.mimeType)});`), f(`$request->setBody(json_encode(${N(r.jsonObj, l)}));`), p();
1512
+ break;
1513
+ default:
1514
+ r.text && (f(`$request->setBody(${N(r.text)});`), p());
1515
+ }
1516
+ return f("try {"), f("$response = $request->send();", 1), p(), f("echo $response->getBody();", 1), f("} catch (HttpException $ex) {"), f("echo $ex;", 1), f("}"), !c && s && (p(), f("?>")), h();
1517
+ }
1518
+ }, na = {
1519
+ info: {
1520
+ key: "http2",
1521
+ title: "HTTP v2",
1522
+ link: "http://devel-m6w6.rhcloud.com/mdref/http",
1523
+ description: "PHP with pecl/http v2",
1524
+ extname: ".php"
1525
+ },
1526
+ convert: ({ postData: t, headersObj: e, method: r, queryObj: o, cookiesObj: i, url: a }, n = {}) => {
1527
+ var g;
1528
+ const { closingTag: s = !1, indent: l = " ", noTags: c = !1, shortTags: u = !1 } = n, { push: f, blank: p, join: h } = new C({ indent: l });
1529
+ let y = !1;
1530
+ switch (c || (f(u ? "<?" : "<?php"), p()), f("$client = new http\\Client;"), f("$request = new http\\Client\\Request;"), p(), t.mimeType) {
1531
+ case "application/x-www-form-urlencoded":
1532
+ f("$body = new http\\Message\\Body;"), f(`$body->append(new http\\QueryString(${N(t.paramsObj, l)}));`), p(), y = !0;
1533
+ break;
1534
+ case "multipart/form-data": {
1535
+ if (!t.params)
1536
+ break;
1537
+ const b = [], x = {};
1538
+ t.params.forEach(({ name: j, fileName: w, value: S, contentType: k }) => {
1539
+ if (w) {
1540
+ b.push({
1541
+ name: j,
1542
+ type: k,
1543
+ file: w,
1544
+ data: S
1545
+ });
1546
+ return;
1547
+ }
1548
+ S && (x[j] = S);
1549
+ });
1550
+ const m = Object.keys(x).length ? N(x, l) : "null", v = b.length ? N(b, l) : "null";
1551
+ if (f("$body = new http\\Message\\Body;"), f(`$body->addForm(${m}, ${v});`), pt(e, "content-type") && (g = ue(e, "content-type")) != null && g.indexOf("boundary")) {
1552
+ const j = J(e, "content-type");
1553
+ j && delete e[j];
1554
+ }
1555
+ p(), y = !0;
1556
+ break;
1557
+ }
1558
+ case "application/json":
1559
+ f("$body = new http\\Message\\Body;"), f(`$body->append(json_encode(${N(t.jsonObj, l)}));`), y = !0;
1560
+ break;
1561
+ default:
1562
+ t.text && (f("$body = new http\\Message\\Body;"), f(`$body->append(${N(t.text)});`), p(), y = !0);
1563
+ }
1564
+ return f(`$request->setRequestUrl(${N(a)});`), f(`$request->setRequestMethod(${N(r)});`), y && (f("$request->setBody($body);"), p()), Object.keys(o).length && (f(`$request->setQuery(new http\\QueryString(${N(o, l)}));`), p()), Object.keys(e).length && (f(`$request->setHeaders(${N(e, l)});`), p()), Object.keys(i).length && (p(), f(`$client->setCookies(${N(i, l)});`), p()), f("$client->enqueue($request)->send();"), f("$response = $client->getResponse();"), p(), f("echo $response->getBody();"), !c && s && (p(), f("?>")), h();
1565
+ }
1566
+ }, oa = {
1567
+ info: {
1568
+ key: "php",
1569
+ title: "PHP",
1570
+ default: "curl",
1571
+ cli: "php %s"
1572
+ },
1573
+ clientsById: {
1574
+ curl: ea,
1575
+ guzzle: ta,
1576
+ http1: ra,
1577
+ http2: na
1578
+ }
1579
+ }, rn = (t) => ({ method: r, headersObj: o, cookies: i, uriObj: a, fullUrl: n, postData: s, allHeaders: l }) => {
1580
+ const { push: c, join: u } = new C();
1581
+ if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(r.toUpperCase()))
1582
+ return "Method not supported";
1583
+ const p = [], h = Object.keys(o);
1584
+ return h.length && (c("$headers=@{}"), h.forEach((y) => {
1585
+ y !== "connection" && c(`$headers.Add("${y}", "${We(o[y], { escapeChar: "`" })}")`);
1586
+ }), p.push("-Headers $headers")), i.length && (c("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), i.forEach((y) => {
1587
+ c("$cookie = New-Object System.Net.Cookie"), c(`$cookie.Name = '${y.name}'`), c(`$cookie.Value = '${y.value}'`), c(`$cookie.Domain = '${a.host}'`), c("$session.Cookies.Add($cookie)");
1588
+ }), p.push("-WebSession $session")), s.text && (p.push(
1589
+ `-ContentType '${We(ue(l, "content-type"), { delimiter: "'", escapeChar: "`" })}'`
1590
+ ), p.push(`-Body '${s.text}'`)), c(`$response = ${t} -Uri '${n}' -Method ${r} ${p.join(" ")}`.trim()), u();
1591
+ }, aa = {
1592
+ info: {
1593
+ key: "restmethod",
1594
+ title: "Invoke-RestMethod",
1595
+ link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",
1596
+ description: "Powershell Invoke-RestMethod client",
1597
+ extname: ".ps1"
1598
+ },
1599
+ convert: rn("Invoke-RestMethod")
1600
+ }, ia = {
1601
+ info: {
1602
+ key: "webrequest",
1603
+ title: "Invoke-WebRequest",
1604
+ link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",
1605
+ description: "Powershell Invoke-WebRequest client",
1606
+ extname: ".ps1"
1607
+ },
1608
+ convert: rn("Invoke-WebRequest")
1609
+ }, sa = {
1610
+ info: {
1611
+ key: "powershell",
1612
+ title: "Powershell",
1613
+ default: "webrequest"
1614
+ },
1615
+ clientsById: {
1616
+ webrequest: ia,
1617
+ restmethod: aa
1618
+ }
1619
+ };
1620
+ function dr(t, e, r, o, i) {
1621
+ const a = o.repeat(i), n = o.repeat(i - 1), s = r ? `,
1622
+ ${a}` : ", ", l = t === "object" ? "{" : "[", c = t === "object" ? "}" : "]";
1623
+ return r ? `${l}
1624
+ ${a}${e.join(s)}
1625
+ ${n}${c}` : t === "object" && e.length > 0 ? `${l} ${e.join(s)} ${c}` : `${l}${e.join(s)}${c}`;
1626
+ }
1627
+ var ke = (t, e, r) => {
1628
+ switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
1629
+ case "[object Number]":
1630
+ return t;
1631
+ case "[object Array]": {
1632
+ let o = !1;
1633
+ const i = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ke(a, e, r)));
1634
+ return dr("array", i, o, e.indent, r);
1635
+ }
1636
+ case "[object Object]": {
1637
+ const o = [];
1638
+ for (const i in t)
1639
+ o.push(`"${i}": ${ke(t[i], e, r)}`);
1640
+ return dr("object", o, e.pretty && o.length > 1, e.indent, r);
1641
+ }
1642
+ case "[object Null]":
1643
+ return "None";
1644
+ case "[object Boolean]":
1645
+ return t ? "True" : "False";
1646
+ default:
1647
+ return t == null ? "" : `"${t.toString().replace(/"/g, '\\"')}"`;
1648
+ }
1649
+ }, la = ["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"], ca = {
1650
+ info: {
1651
+ key: "requests",
1652
+ title: "Requests",
1653
+ link: "http://docs.python-requests.org/en/latest/api/#requests.request",
1654
+ description: "Requests HTTP library",
1655
+ extname: ".py",
1656
+ installation: "python -m pip install requests"
1657
+ },
1658
+ convert: ({ fullUrl: t, postData: e, allHeaders: r, method: o }, i) => {
1659
+ const a = {
1660
+ indent: " ",
1661
+ pretty: !0,
1662
+ ...i
1663
+ }, { push: n, blank: s, join: l, addPostProcessor: c } = new C({ indent: a.indent });
1664
+ n("import requests"), s(), n(`url = "${t}"`), s();
1665
+ const u = r;
1666
+ let f = {};
1667
+ const p = {};
1668
+ let h = !1, y = !1, g = !1;
1669
+ switch (e.mimeType) {
1670
+ case "application/json":
1671
+ e.jsonObj && (n(`payload = ${ke(e.jsonObj, a)}`), g = !0, y = !0);
1672
+ break;
1673
+ case "multipart/form-data":
1674
+ if (!e.params)
1675
+ break;
1676
+ if (f = {}, e.params.forEach((m) => {
1677
+ m.fileName ? (m.contentType ? p[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'), '${m.contentType}')` : p[m.name] = `('${m.fileName}', open('${m.fileName}', 'rb'))`, h = !0) : (f[m.name] = m.value, y = !0);
1678
+ }), h) {
1679
+ n(`files = ${ke(p, a)}`), y && n(`payload = ${ke(f, a)}`);
1680
+ const m = J(u, "content-type");
1681
+ m && delete u[m];
1682
+ } else {
1683
+ const m = JSON.stringify(e.text);
1684
+ m && (n(`payload = ${m}`), y = !0);
1685
+ }
1686
+ c(
1687
+ (m) => m.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g, '("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g, '("$1", open("$2", "rb"), "$3")')
1688
+ );
1689
+ break;
1690
+ default: {
1691
+ if (e.mimeType === "application/x-www-form-urlencoded" && e.paramsObj) {
1692
+ n(`payload = ${ke(e.paramsObj, a)}`), y = !0;
1693
+ break;
1694
+ }
1695
+ const m = JSON.stringify(e.text);
1696
+ m && (n(`payload = ${m}`), y = !0);
1697
+ }
1698
+ }
1699
+ const b = Object.keys(u).length;
1700
+ if (b === 0 && (y || h))
1701
+ s();
1702
+ else if (b === 1)
1703
+ Object.keys(u).forEach((m) => {
1704
+ n(`headers = {"${m}": "${H(u[m])}"}`), s();
1705
+ });
1706
+ else if (b > 1) {
1707
+ let m = 1;
1708
+ n("headers = {"), Object.keys(u).forEach((v) => {
1709
+ n(m !== b ? `"${v}": "${H(u[v])}",` : `"${v}": "${H(u[v])}"`, 1), m += 1;
1710
+ }), n("}"), s();
1711
+ }
1712
+ let x = la.includes(o) ? `response = requests.${o.toLowerCase()}(url` : `response = requests.request("${o}", url`;
1713
+ return y && (g ? x += ", json=payload" : x += ", data=payload"), h && (x += ", files=files"), b > 0 && (x += ", headers=headers"), x += ")", n(x), s(), n("print(response.text)"), l();
1714
+ }
1715
+ }, ua = {
1716
+ info: {
1717
+ key: "python",
1718
+ title: "Python",
1719
+ default: "requests",
1720
+ cli: "python3 %s"
1721
+ },
1722
+ clientsById: {
1723
+ requests: ca
1724
+ }
1725
+ }, pa = {
1726
+ info: {
1727
+ key: "httr",
1728
+ title: "httr",
1729
+ link: "https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",
1730
+ description: "httr: Tools for Working with URLs and HTTP",
1731
+ extname: ".r"
1732
+ },
1733
+ convert: ({ url: t, queryObj: e, queryString: r, postData: o, allHeaders: i, method: a }) => {
1734
+ const { push: n, blank: s, join: l } = new C();
1735
+ n("library(httr)"), s(), n(`url <- "${t}"`), s();
1736
+ const c = e;
1737
+ delete e.key;
1738
+ const u = Object.keys(c).length;
1739
+ r.length === 1 ? (n(`queryString <- list(${Object.keys(c)} = "${Object.values(c).toString()}")`), s()) : r.length > 1 && (n("queryString <- list("), Object.keys(c).forEach((w, S) => {
1740
+ S !== u - 1 ? n(` ${w} = "${c[w].toString()}",`) : n(` ${w} = "${c[w].toString()}"`);
1741
+ }), n(")"), s());
1742
+ const f = JSON.stringify(o.text);
1743
+ if (f && (n(`payload <- ${f}`), s()), o.text || o.jsonObj || o.params)
1744
+ switch (o.mimeType) {
1745
+ case "application/x-www-form-urlencoded":
1746
+ n('encode <- "form"'), s();
1747
+ break;
1748
+ case "application/json":
1749
+ n('encode <- "json"'), s();
1750
+ break;
1751
+ case "multipart/form-data":
1752
+ n('encode <- "multipart"'), s();
1753
+ break;
1754
+ default:
1755
+ n('encode <- "raw"'), s();
1756
+ break;
1757
+ }
1758
+ const p = ue(i, "cookie"), h = ue(i, "accept"), y = p ? `set_cookies(\`${String(p).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, g = h ? `accept("${H(h)}")` : void 0, b = `content_type("${H(o.mimeType)}")`, x = Object.entries(i).filter(([w]) => !["cookie", "accept", "content-type"].includes(w.toLowerCase())).map(([w, S]) => `'${w}' = '${Je(S)}'`).join(", "), m = x ? `add_headers(${x})` : void 0;
1759
+ let v = `response <- VERB("${a}", url`;
1760
+ f && (v += ", body = payload"), r.length && (v += ", query = queryString");
1761
+ const j = [m, b, g, y].filter((w) => !!w).join(", ");
1762
+ return j && (v += `, ${j}`), (o.text || o.jsonObj || o.params) && (v += ", encode = encode"), v += ")", n(v), s(), n('content(response, "text")'), l();
1763
+ }
1764
+ }, fa = {
1765
+ info: {
1766
+ key: "r",
1767
+ title: "R",
1768
+ default: "httr"
1769
+ },
1770
+ clientsById: {
1771
+ httr: pa
1772
+ }
1773
+ }, da = {
1774
+ info: {
1775
+ key: "native",
1776
+ title: "net::http",
1777
+ link: "http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",
1778
+ description: "Ruby HTTP client",
1779
+ extname: ".rb"
1780
+ },
1781
+ convert: ({ uriObj: t, method: e, fullUrl: r, postData: o, allHeaders: i }) => {
1782
+ const { push: a, blank: n, join: s } = new C();
1783
+ a("require 'uri'"), a("require 'net/http'"), n();
1784
+ const l = e.toUpperCase(), c = [
1785
+ "GET",
1786
+ "POST",
1787
+ "HEAD",
1788
+ "DELETE",
1789
+ "PATCH",
1790
+ "PUT",
1791
+ "OPTIONS",
1792
+ "COPY",
1793
+ "LOCK",
1794
+ "UNLOCK",
1795
+ "MOVE",
1796
+ "TRACE"
1797
+ ], u = l.charAt(0) + l.substring(1).toLowerCase();
1798
+ c.includes(l) || (a(`class Net::HTTP::${u} < Net::HTTPRequest`), a(` METHOD = '${l.toUpperCase()}'`), a(` REQUEST_HAS_BODY = '${o.text ? "true" : "false"}'`), a(" RESPONSE_HAS_BODY = true"), a("end"), n()), a(`url = URI("${r}")`), n(), a("http = Net::HTTP.new(url.host, url.port)"), t.protocol === "https:" && a("http.use_ssl = true"), n(), a(`request = Net::HTTP::${u}.new(url)`);
1799
+ const f = Object.keys(i);
1800
+ return f.length && f.forEach((p) => {
1801
+ a(`request["${p}"] = '${Je(i[p])}'`);
1802
+ }), o.text && a(`request.body = ${JSON.stringify(o.text)}`), n(), a("response = http.request(request)"), a("puts response.read_body"), s();
1803
+ }
1804
+ }, ha = {
1805
+ info: {
1806
+ key: "ruby",
1807
+ title: "Ruby",
1808
+ default: "native"
1809
+ },
1810
+ clientsById: {
1811
+ native: da
1812
+ }
1813
+ }, M = (t = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(t) ? t : `'${t.replace(/'/g, "'\\''")}'`, ya = (t) => t.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), ma = {
1814
+ "http1.0": "0",
1815
+ "url ": "",
1816
+ cookie: "b",
1817
+ data: "d",
1818
+ form: "F",
1819
+ globoff: "g",
1820
+ header: "H",
1821
+ insecure: "k",
1822
+ request: "X"
1823
+ }, ga = (t) => (e) => {
1824
+ if (t) {
1825
+ const r = ma[e];
1826
+ return r ? `-${r}` : "";
1827
+ }
1828
+ return `--${e}`;
1829
+ }, ba = {
1830
+ info: {
1831
+ key: "curl",
1832
+ title: "cURL",
1833
+ link: "http://curl.haxx.se/",
1834
+ description: "cURL is a command line tool and library for transferring data with URL syntax",
1835
+ extname: ".sh"
1836
+ },
1837
+ convert: ({ fullUrl: t, method: e, httpVersion: r, headersObj: o, allHeaders: i, postData: a }, n = {}) => {
1838
+ var b;
1839
+ const { indent: s = " ", short: l = !1, binary: c = !1, globOff: u = !1 } = n, f = " ", { push: p, join: h } = new C({
1840
+ ...typeof s == "string" ? { indent: s } : {},
1841
+ join: s !== !1 ? ` \\
1842
+ ${s}` : " "
1843
+ }), y = ga(l);
1844
+ let g = M(t);
1845
+ if (p(`curl ${y("request")} ${e}`), u && (g = unescape(g), p(y("globoff"))), p(`${y("url ")}${g}`), r === "HTTP/1.0" && p(y("http1.0")), ue(i, "accept-encoding") && p("--compressed"), a.mimeType === "multipart/form-data") {
1846
+ const x = J(o, "content-type");
1847
+ if (x) {
1848
+ const m = o[x];
1849
+ if (x && m) {
1850
+ const v = String(m).replace(/; boundary.+?(?=(;|$))/, "");
1851
+ o[x] = v, i[x] = v;
1852
+ }
1853
+ }
1854
+ }
1855
+ switch (Object.keys(o).sort().forEach((x) => {
1856
+ const m = `${x}: ${o[x]}`;
1857
+ p(`${y("header")} ${M(m)}`);
1858
+ }), i.cookie && p(`${y("cookie")} ${M(i.cookie)}`), a.mimeType) {
1859
+ case "multipart/form-data":
1860
+ (b = a.params) == null || b.forEach((m) => {
1861
+ let v = "";
1862
+ m.fileName ? v = `${m.name}='@${m.fileName}'` : v = M(`${m.name}=${m.value}`), p(`${y("form")} ${v}`);
1863
+ });
1864
+ break;
1865
+ case "application/x-www-form-urlencoded":
1866
+ a.params ? a.params.forEach((m) => {
1867
+ const v = m.name, j = encodeURIComponent(m.name), w = j !== v, S = w ? j : v, k = c ? "--data-binary" : w ? "--data-urlencode" : y("data");
1868
+ p(`${k} ${M(`${S}=${m.value}`)}`);
1869
+ }) : p(`${c ? "--data-binary" : y("data")} ${M(a.text)}`);
1870
+ break;
1871
+ default:
1872
+ if (!a.text)
1873
+ break;
1874
+ let x = !1;
1875
+ if (go(a.mimeType) && a.text.length > 20)
1876
+ try {
1877
+ const m = JSON.parse(a.text);
1878
+ x = !0, a.text.indexOf("'") > 0 ? p(
1879
+ `${c ? "--data-binary" : y("data")} @- <<EOF
1880
+ ${JSON.stringify(
1881
+ m,
1882
+ null,
1883
+ f
1884
+ )}
1885
+ EOF`
1886
+ ) : p(
1887
+ `${c ? "--data-binary" : y("data")} '
1888
+ ${JSON.stringify(m, null, f)}
1889
+ '`
1890
+ );
1891
+ } catch {
1892
+ }
1893
+ x || p(`${c ? "--data-binary" : y("data")} ${M(a.text)}`);
1894
+ }
1895
+ return h();
1896
+ }
1897
+ }, va = {
1898
+ info: {
1899
+ key: "httpie",
1900
+ title: "HTTPie",
1901
+ link: "http://httpie.org/",
1902
+ description: "a CLI, cURL-like tool for humans",
1903
+ extname: ".sh",
1904
+ installation: "brew install httpie"
1905
+ },
1906
+ convert: ({ allHeaders: t, postData: e, queryObj: r, fullUrl: o, method: i, url: a }, n) => {
1907
+ const s = {
1908
+ body: !1,
1909
+ cert: !1,
1910
+ headers: !1,
1911
+ indent: " ",
1912
+ pretty: !1,
1913
+ print: !1,
1914
+ queryParams: !1,
1915
+ short: !1,
1916
+ style: !1,
1917
+ timeout: !1,
1918
+ verbose: !1,
1919
+ verify: !1,
1920
+ ...n
1921
+ }, { push: l, join: c, unshift: u } = new C({
1922
+ indent: s.indent,
1923
+ // @ts-expect-error SEEMS LEGIT
1924
+ join: s.indent !== !1 ? ` \\
1925
+ ${s.indent}` : " "
1926
+ });
1927
+ let f = !1;
1928
+ const p = [];
1929
+ s.headers && p.push(s.short ? "-h" : "--headers"), s.body && p.push(s.short ? "-b" : "--body"), s.verbose && p.push(s.short ? "-v" : "--verbose"), s.print && p.push(`${s.short ? "-p" : "--print"}=${s.print}`), s.verify && p.push(`--verify=${s.verify}`), s.cert && p.push(`--cert=${s.cert}`), s.pretty && p.push(`--pretty=${s.pretty}`), s.style && p.push(`--style=${s.style}`), s.timeout && p.push(`--timeout=${s.timeout}`), s.queryParams && Object.keys(r).forEach((y) => {
1930
+ const g = r[y];
1931
+ Array.isArray(g) ? g.forEach((b) => {
1932
+ l(`${y}==${M(b)}`);
1933
+ }) : l(`${y}==${M(g)}`);
1934
+ }), Object.keys(t).sort().forEach((y) => {
1935
+ l(`${y}:${M(t[y])}`);
1936
+ }), e.mimeType === "application/x-www-form-urlencoded" ? e.params && e.params.length && (p.push(s.short ? "-f" : "--form"), e.params.forEach((y) => {
1937
+ l(`${y.name}=${M(y.value)}`);
1938
+ })) : f = !0;
1939
+ const h = p.length ? `${p.join(" ")} ` : "";
1940
+ if (a = M(s.queryParams ? a : o), u(`http ${h}${i} ${a}`), f && e.text) {
1941
+ const y = M(e.text);
1942
+ u(`echo ${y} | `);
1943
+ }
1944
+ return c();
1945
+ }
1946
+ }, xa = {
1947
+ info: {
1948
+ key: "wget",
1949
+ title: "Wget",
1950
+ link: "https://www.gnu.org/software/wget/",
1951
+ description: "a free software package for retrieving files using HTTP, HTTPS",
1952
+ extname: ".sh"
1953
+ },
1954
+ convert: ({ method: t, postData: e, allHeaders: r, fullUrl: o }, i) => {
1955
+ const a = {
1956
+ indent: " ",
1957
+ short: !1,
1958
+ verbose: !1,
1959
+ ...i
1960
+ }, { push: n, join: s } = new C({
1961
+ ...typeof a.indent == "string" ? { indent: a.indent } : {},
1962
+ join: a.indent !== !1 ? ` \\
1963
+ ${a.indent}` : " "
1964
+ });
1965
+ return a.verbose ? n(`wget ${a.short ? "-v" : "--verbose"}`) : n(`wget ${a.short ? "-q" : "--quiet"}`), n(`--method ${M(t)}`), Object.keys(r).forEach((l) => {
1966
+ const c = `${l}: ${r[l]}`;
1967
+ n(`--header ${M(c)}`);
1968
+ }), e.text && n(`--body-data ${ya(M(e.text))}`), n(a.short ? "-O" : "--output-document"), n(`- ${M(o)}`), s();
1969
+ }
1970
+ }, $a = {
1971
+ info: {
1972
+ key: "shell",
1973
+ title: "Shell",
1974
+ default: "curl",
1975
+ cli: "%s"
1976
+ },
1977
+ clientsById: {
1978
+ curl: ba,
1979
+ httpie: va,
1980
+ wget: xa
1981
+ }
1982
+ }, hr = (t, e) => e.repeat(t), yr = (t, e, r, o) => {
1983
+ const i = hr(o, r), a = hr(o - 1, r), n = e ? `,
1984
+ ${i}` : ", ";
1985
+ return e ? `[
1986
+ ${i}${t.join(n)}
1987
+ ${a}]` : `[${t.join(n)}]`;
1988
+ }, mr = (t, e, r) => `let ${t} = ${ot(e, r)}`, ot = (t, e, r) => {
1989
+ switch (r = r === void 0 ? 1 : r + 1, Object.prototype.toString.call(t)) {
1990
+ case "[object Number]":
1991
+ return t;
1992
+ case "[object Array]": {
1993
+ let o = !1;
1994
+ const i = t.map((a) => (Object.prototype.toString.call(a) === "[object Object]" && (o = Object.keys(a).length > 1), ot(a, e, r)));
1995
+ return yr(i, o, e.indent, r);
1996
+ }
1997
+ case "[object Object]": {
1998
+ const o = [];
1999
+ for (const i in t)
2000
+ o.push(`"${i}": ${ot(t[i], e, r)}`);
2001
+ return yr(
2002
+ o,
2003
+ // @ts-expect-error needs better types
2004
+ e.pretty && o.length > 1,
2005
+ // @ts-expect-error needs better types
2006
+ e.indent,
2007
+ r
2008
+ );
2009
+ }
2010
+ case "[object Boolean]":
2011
+ return t.toString();
2012
+ default:
2013
+ return t == null ? "nil" : `"${t.toString().replace(/"/g, '\\"')}"`;
2014
+ }
2015
+ }, wa = {
2016
+ info: {
2017
+ key: "urlsession",
2018
+ title: "URLSession",
2019
+ link: "https://developer.apple.com/documentation/foundation/urlsession",
2020
+ description: "Foundation's URLSession request",
2021
+ extname: ".swift"
2022
+ },
2023
+ convert: ({ allHeaders: t, postData: e, uriObj: r, queryObj: o, method: i }, a) => {
2024
+ var p;
2025
+ const n = {
2026
+ indent: " ",
2027
+ pretty: !0,
2028
+ timeout: 10,
2029
+ ...a
2030
+ }, { push: s, blank: l, join: c } = new C({ indent: n.indent });
2031
+ s("import Foundation"), l();
2032
+ const u = e.text || e.jsonObj || e.params;
2033
+ if (u)
2034
+ switch (e.mimeType) {
2035
+ case "application/x-www-form-urlencoded":
2036
+ if ((p = e.params) != null && p.length) {
2037
+ const h = e.params.map((y) => `"${y.name}": "${y.value}"`);
2038
+ n.pretty ? (s("let parameters = ["), h.forEach((y) => s(`${y},`, 1)), s("]")) : s(`let parameters = [${h.join(", ")}]`), s('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'), s("let postData = Data(joinedParameters.utf8)"), l();
2039
+ }
2040
+ break;
2041
+ case "application/json":
2042
+ e.jsonObj && (s(`${mr("parameters", e.jsonObj, n)} as [String : Any?]`), l(), s("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"), l());
2043
+ break;
2044
+ case "multipart/form-data":
2045
+ s(mr("parameters", e.params, n)), l(), s(`let boundary = "${e.boundary}"`), l(), s('var body = ""'), s("for param in parameters {"), s('let paramName = param["name"]!', 1), s('body += "--\\(boundary)\\r\\n"', 1), s('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), s('if let filename = param["fileName"] {', 1), s('let contentType = param["contentType"]!', 2), s("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)", 2), s('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), s('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), s("body += fileContent", 2), s('} else if let paramValue = param["value"] {', 1), s('body += "\\r\\n\\r\\n\\(paramValue)"', 2), s("}", 1), s("}"), l(), s("let postData = Data(body.utf8)"), l();
2046
+ break;
2047
+ default:
2048
+ s(`let postData = Data("${e.text}".utf8)`), l();
2049
+ }
2050
+ s(`let url = URL(string: "${r.href}")!`);
2051
+ const f = o ? Object.entries(o) : [];
2052
+ return f.length < 1 ? s("var request = URLRequest(url: url)") : (s("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"), s("let queryItems: [URLQueryItem] = ["), f.forEach((h) => {
2053
+ const y = h[0], g = h[1];
2054
+ switch (Object.prototype.toString.call(g)) {
2055
+ case "[object String]":
2056
+ s(`URLQueryItem(name: "${y}", value: "${g}"),`, 1);
2057
+ break;
2058
+ case "[object Array]":
2059
+ g.forEach((b) => {
2060
+ s(`URLQueryItem(name: "${y}", value: "${b}"),`, 1);
2061
+ });
2062
+ break;
2063
+ }
2064
+ }), s("]"), s("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"), l(), s("var request = URLRequest(url: components.url!)")), s(`request.httpMethod = "${i}"`), s(`request.timeoutInterval = ${n.timeout}`), Object.keys(t).length && s(`request.allHTTPHeaderFields = ${ot(t, n)}`), u && s("request.httpBody = postData"), l(), s("let (data, _) = try await URLSession.shared.data(for: request)"), s("print(String(decoding: data, as: UTF8.self))"), c();
2065
+ }
2066
+ }, ja = {
2067
+ info: {
2068
+ key: "swift",
2069
+ title: "Swift",
2070
+ default: "urlsession"
2071
+ },
2072
+ clientsById: {
2073
+ urlsession: wa
2074
+ }
2075
+ }, Sa = {
2076
+ c: mo,
2077
+ clojure: xo,
2078
+ csharp: Oo,
2079
+ go: Co,
2080
+ http: ko,
2081
+ java: qo,
2082
+ javascript: _o,
2083
+ json: Bo,
2084
+ kotlin: zo,
2085
+ node: Ko,
2086
+ objc: Yo,
2087
+ ocaml: Zo,
2088
+ php: oa,
2089
+ powershell: sa,
2090
+ python: ua,
2091
+ r: fa,
2092
+ ruby: ha,
2093
+ shell: $a,
2094
+ swift: ja
2095
+ }, at = { exports: {} };
2096
+ /*! https://mths.be/punycode v1.4.1 by @mathias */
2097
+ at.exports;
2098
+ (function(t, e) {
2099
+ (function(r) {
2100
+ var o = e && !e.nodeType && e, i = t && !t.nodeType && t, a = typeof He == "object" && He;
2101
+ (a.global === a || a.window === a || a.self === a) && (r = a);
2102
+ var n, s = 2147483647, l = 36, c = 1, u = 26, f = 38, p = 700, h = 72, y = 128, g = "-", b = /^xn--/, x = /[^\x20-\x7E]/, m = /[\x2E\u3002\uFF0E\uFF61]/g, v = {
2103
+ overflow: "Overflow: input needs wider integers to process",
2104
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
2105
+ "invalid-input": "Invalid input"
2106
+ }, j = l - c, w = Math.floor, S = String.fromCharCode, k;
2107
+ function E($) {
2108
+ throw new RangeError(v[$]);
2109
+ }
2110
+ function R($, O) {
2111
+ for (var P = $.length, A = []; P--; )
2112
+ A[P] = O($[P]);
2113
+ return A;
2114
+ }
2115
+ function F($, O) {
2116
+ var P = $.split("@"), A = "";
2117
+ P.length > 1 && (A = P[0] + "@", $ = P[1]), $ = $.replace(m, ".");
2118
+ var I = $.split("."), K = R(I, O).join(".");
2119
+ return A + K;
2120
+ }
2121
+ function te($) {
2122
+ for (var O = [], P = 0, A = $.length, I, K; P < A; )
2123
+ I = $.charCodeAt(P++), I >= 55296 && I <= 56319 && P < A ? (K = $.charCodeAt(P++), (K & 64512) == 56320 ? O.push(((I & 1023) << 10) + (K & 1023) + 65536) : (O.push(I), P--)) : O.push(I);
2124
+ return O;
2125
+ }
2126
+ function re($) {
2127
+ return R($, function(O) {
2128
+ var P = "";
2129
+ return O > 65535 && (O -= 65536, P += S(O >>> 10 & 1023 | 55296), O = 56320 | O & 1023), P += S(O), P;
2130
+ }).join("");
2131
+ }
2132
+ function L($) {
2133
+ return $ - 48 < 10 ? $ - 22 : $ - 65 < 26 ? $ - 65 : $ - 97 < 26 ? $ - 97 : l;
2134
+ }
2135
+ function V($, O) {
2136
+ return $ + 22 + 75 * ($ < 26) - ((O != 0) << 5);
2137
+ }
2138
+ function Q($, O, P) {
2139
+ var A = 0;
2140
+ for ($ = P ? w($ / p) : $ >> 1, $ += w($ / O); $ > j * u >> 1; A += l)
2141
+ $ = w($ / j);
2142
+ return w(A + (j + 1) * $ / ($ + f));
2143
+ }
2144
+ function Y($) {
2145
+ var O = [], P = $.length, A, I = 0, K = y, B = h, X, ne, ie, pe, W, Z, oe, ye, $e;
2146
+ for (X = $.lastIndexOf(g), X < 0 && (X = 0), ne = 0; ne < X; ++ne)
2147
+ $.charCodeAt(ne) >= 128 && E("not-basic"), O.push($.charCodeAt(ne));
2148
+ for (ie = X > 0 ? X + 1 : 0; ie < P; ) {
2149
+ for (pe = I, W = 1, Z = l; ie >= P && E("invalid-input"), oe = L($.charCodeAt(ie++)), (oe >= l || oe > w((s - I) / W)) && E("overflow"), I += oe * W, ye = Z <= B ? c : Z >= B + u ? u : Z - B, !(oe < ye); Z += l)
2150
+ $e = l - ye, W > w(s / $e) && E("overflow"), W *= $e;
2151
+ A = O.length + 1, B = Q(I - pe, A, pe == 0), w(I / A) > s - K && E("overflow"), K += w(I / A), I %= A, O.splice(I++, 0, K);
2152
+ }
2153
+ return re(O);
2154
+ }
2155
+ function he($) {
2156
+ var O, P, A, I, K, B, X, ne, ie, pe, W, Z = [], oe, ye, $e, dt;
2157
+ for ($ = te($), oe = $.length, O = y, P = 0, K = h, B = 0; B < oe; ++B)
2158
+ W = $[B], W < 128 && Z.push(S(W));
2159
+ for (A = I = Z.length, I && Z.push(g); A < oe; ) {
2160
+ for (X = s, B = 0; B < oe; ++B)
2161
+ W = $[B], W >= O && W < X && (X = W);
2162
+ for (ye = A + 1, X - O > w((s - P) / ye) && E("overflow"), P += (X - O) * ye, O = X, B = 0; B < oe; ++B)
2163
+ if (W = $[B], W < O && ++P > s && E("overflow"), W == O) {
2164
+ for (ne = P, ie = l; pe = ie <= K ? c : ie >= K + u ? u : ie - K, !(ne < pe); ie += l)
2165
+ dt = ne - pe, $e = l - pe, Z.push(
2166
+ S(V(pe + dt % $e, 0))
2167
+ ), ne = w(dt / $e);
2168
+ Z.push(S(V(ne, 0))), K = Q(P, ye, A == I), P = 0, ++A;
2169
+ }
2170
+ ++P, ++O;
2171
+ }
2172
+ return Z.join("");
2173
+ }
2174
+ function ft($) {
2175
+ return F($, function(O) {
2176
+ return b.test(O) ? Y(O.slice(4).toLowerCase()) : O;
2177
+ });
2178
+ }
2179
+ function Ke($) {
2180
+ return F($, function(O) {
2181
+ return x.test(O) ? "xn--" + he(O) : O;
2182
+ });
2183
+ }
2184
+ if (n = {
2185
+ /**
2186
+ * A string representing the current Punycode.js version number.
2187
+ * @memberOf punycode
2188
+ * @type String
2189
+ */
2190
+ version: "1.4.1",
2191
+ /**
2192
+ * An object of methods to convert from JavaScript's internal character
2193
+ * representation (UCS-2) to Unicode code points, and back.
2194
+ * @see <https://mathiasbynens.be/notes/javascript-encoding>
2195
+ * @memberOf punycode
2196
+ * @type Object
2197
+ */
2198
+ ucs2: {
2199
+ decode: te,
2200
+ encode: re
2201
+ },
2202
+ decode: Y,
2203
+ encode: he,
2204
+ toASCII: Ke,
2205
+ toUnicode: ft
2206
+ }, o && i)
2207
+ if (t.exports == o)
2208
+ i.exports = n;
2209
+ else
2210
+ for (k in n)
2211
+ n.hasOwnProperty(k) && (o[k] = n[k]);
2212
+ else
2213
+ r.punycode = n;
2214
+ })(He);
2215
+ })(at, at.exports);
2216
+ var Oa = at.exports, Ta = Error, Ca = EvalError, Pa = RangeError, ka = ReferenceError, nn = SyntaxError, Ve = TypeError, Ea = URIError, Na = function() {
2217
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
2218
+ return !1;
2219
+ if (typeof Symbol.iterator == "symbol")
2220
+ return !0;
2221
+ var e = {}, r = Symbol("test"), o = Object(r);
2222
+ if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(o) !== "[object Symbol]")
2223
+ return !1;
2224
+ var i = 42;
2225
+ e[r] = i;
2226
+ for (r in e)
2227
+ return !1;
2228
+ if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
2229
+ return !1;
2230
+ var a = Object.getOwnPropertySymbols(e);
2231
+ if (a.length !== 1 || a[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
2232
+ return !1;
2233
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
2234
+ var n = Object.getOwnPropertyDescriptor(e, r);
2235
+ if (n.value !== i || n.enumerable !== !0)
2236
+ return !1;
2237
+ }
2238
+ return !0;
2239
+ }, gr = typeof Symbol < "u" && Symbol, Ra = Na, Aa = function() {
2240
+ return typeof gr != "function" || typeof Symbol != "function" || typeof gr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ra();
2241
+ }, yt = {
2242
+ __proto__: null,
2243
+ foo: {}
2244
+ }, qa = Object, Ia = function() {
2245
+ return { __proto__: yt }.foo === yt.foo && !(yt instanceof qa);
2246
+ }, La = "Function.prototype.bind called on incompatible ", Ua = Object.prototype.toString, Fa = Math.max, _a = "[object Function]", br = function(e, r) {
2247
+ for (var o = [], i = 0; i < e.length; i += 1)
2248
+ o[i] = e[i];
2249
+ for (var a = 0; a < r.length; a += 1)
2250
+ o[a + e.length] = r[a];
2251
+ return o;
2252
+ }, Ha = function(e, r) {
2253
+ for (var o = [], i = r, a = 0; i < e.length; i += 1, a += 1)
2254
+ o[a] = e[i];
2255
+ return o;
2256
+ }, Ba = function(t, e) {
2257
+ for (var r = "", o = 0; o < t.length; o += 1)
2258
+ r += t[o], o + 1 < t.length && (r += e);
2259
+ return r;
2260
+ }, Ma = function(e) {
2261
+ var r = this;
2262
+ if (typeof r != "function" || Ua.apply(r) !== _a)
2263
+ throw new TypeError(La + r);
2264
+ for (var o = Ha(arguments, 1), i, a = function() {
2265
+ if (this instanceof i) {
2266
+ var u = r.apply(
2267
+ this,
2268
+ br(o, arguments)
2269
+ );
2270
+ return Object(u) === u ? u : this;
2271
+ }
2272
+ return r.apply(
2273
+ e,
2274
+ br(o, arguments)
2275
+ );
2276
+ }, n = Fa(0, r.length - o.length), s = [], l = 0; l < n; l++)
2277
+ s[l] = "$" + l;
2278
+ if (i = Function("binder", "return function (" + Ba(s, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
2279
+ var c = function() {
2280
+ };
2281
+ c.prototype = r.prototype, i.prototype = new c(), c.prototype = null;
2282
+ }
2283
+ return i;
2284
+ }, za = Ma, Jt = Function.prototype.bind || za, Wa = Function.prototype.call, Ja = Object.prototype.hasOwnProperty, Ga = Jt, Va = Ga.call(Wa, Ja), T, Qa = Ta, Ka = Ca, Da = Pa, Ya = ka, Ae = nn, Ee = Ve, Xa = Ea, on = Function, mt = function(t) {
2285
+ try {
2286
+ return on('"use strict"; return (' + t + ").constructor;")();
2287
+ } catch {
2288
+ }
2289
+ }, Se = Object.getOwnPropertyDescriptor;
2290
+ if (Se)
2291
+ try {
2292
+ Se({}, "");
2293
+ } catch {
2294
+ Se = null;
2295
+ }
2296
+ var gt = function() {
2297
+ throw new Ee();
2298
+ }, Za = Se ? function() {
2299
+ try {
2300
+ return arguments.callee, gt;
2301
+ } catch {
2302
+ try {
2303
+ return Se(arguments, "callee").get;
2304
+ } catch {
2305
+ return gt;
2306
+ }
2307
+ }
2308
+ }() : gt, Te = Aa(), ei = Ia(), _ = Object.getPrototypeOf || (ei ? function(t) {
2309
+ return t.__proto__;
2310
+ } : null), Pe = {}, ti = typeof Uint8Array > "u" || !_ ? T : _(Uint8Array), Oe = {
2311
+ __proto__: null,
2312
+ "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
2313
+ "%Array%": Array,
2314
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
2315
+ "%ArrayIteratorPrototype%": Te && _ ? _([][Symbol.iterator]()) : T,
2316
+ "%AsyncFromSyncIteratorPrototype%": T,
2317
+ "%AsyncFunction%": Pe,
2318
+ "%AsyncGenerator%": Pe,
2319
+ "%AsyncGeneratorFunction%": Pe,
2320
+ "%AsyncIteratorPrototype%": Pe,
2321
+ "%Atomics%": typeof Atomics > "u" ? T : Atomics,
2322
+ "%BigInt%": typeof BigInt > "u" ? T : BigInt,
2323
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? T : BigInt64Array,
2324
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? T : BigUint64Array,
2325
+ "%Boolean%": Boolean,
2326
+ "%DataView%": typeof DataView > "u" ? T : DataView,
2327
+ "%Date%": Date,
2328
+ "%decodeURI%": decodeURI,
2329
+ "%decodeURIComponent%": decodeURIComponent,
2330
+ "%encodeURI%": encodeURI,
2331
+ "%encodeURIComponent%": encodeURIComponent,
2332
+ "%Error%": Qa,
2333
+ "%eval%": eval,
2334
+ // eslint-disable-line no-eval
2335
+ "%EvalError%": Ka,
2336
+ "%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
2337
+ "%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
2338
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
2339
+ "%Function%": on,
2340
+ "%GeneratorFunction%": Pe,
2341
+ "%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
2342
+ "%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
2343
+ "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
2344
+ "%isFinite%": isFinite,
2345
+ "%isNaN%": isNaN,
2346
+ "%IteratorPrototype%": Te && _ ? _(_([][Symbol.iterator]())) : T,
2347
+ "%JSON%": typeof JSON == "object" ? JSON : T,
2348
+ "%Map%": typeof Map > "u" ? T : Map,
2349
+ "%MapIteratorPrototype%": typeof Map > "u" || !Te || !_ ? T : _((/* @__PURE__ */ new Map())[Symbol.iterator]()),
2350
+ "%Math%": Math,
2351
+ "%Number%": Number,
2352
+ "%Object%": Object,
2353
+ "%parseFloat%": parseFloat,
2354
+ "%parseInt%": parseInt,
2355
+ "%Promise%": typeof Promise > "u" ? T : Promise,
2356
+ "%Proxy%": typeof Proxy > "u" ? T : Proxy,
2357
+ "%RangeError%": Da,
2358
+ "%ReferenceError%": Ya,
2359
+ "%Reflect%": typeof Reflect > "u" ? T : Reflect,
2360
+ "%RegExp%": RegExp,
2361
+ "%Set%": typeof Set > "u" ? T : Set,
2362
+ "%SetIteratorPrototype%": typeof Set > "u" || !Te || !_ ? T : _((/* @__PURE__ */ new Set())[Symbol.iterator]()),
2363
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? T : SharedArrayBuffer,
2364
+ "%String%": String,
2365
+ "%StringIteratorPrototype%": Te && _ ? _(""[Symbol.iterator]()) : T,
2366
+ "%Symbol%": Te ? Symbol : T,
2367
+ "%SyntaxError%": Ae,
2368
+ "%ThrowTypeError%": Za,
2369
+ "%TypedArray%": ti,
2370
+ "%TypeError%": Ee,
2371
+ "%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
2372
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
2373
+ "%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
2374
+ "%Uint32Array%": typeof Uint32Array > "u" ? T : Uint32Array,
2375
+ "%URIError%": Xa,
2376
+ "%WeakMap%": typeof WeakMap > "u" ? T : WeakMap,
2377
+ "%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
2378
+ "%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
2379
+ };
2380
+ if (_)
2381
+ try {
2382
+ null.error;
2383
+ } catch (t) {
2384
+ var ri = _(_(t));
2385
+ Oe["%Error.prototype%"] = ri;
2386
+ }
2387
+ var ni = function t(e) {
2388
+ var r;
2389
+ if (e === "%AsyncFunction%")
2390
+ r = mt("async function () {}");
2391
+ else if (e === "%GeneratorFunction%")
2392
+ r = mt("function* () {}");
2393
+ else if (e === "%AsyncGeneratorFunction%")
2394
+ r = mt("async function* () {}");
2395
+ else if (e === "%AsyncGenerator%") {
2396
+ var o = t("%AsyncGeneratorFunction%");
2397
+ o && (r = o.prototype);
2398
+ } else if (e === "%AsyncIteratorPrototype%") {
2399
+ var i = t("%AsyncGenerator%");
2400
+ i && _ && (r = _(i.prototype));
2401
+ }
2402
+ return Oe[e] = r, r;
2403
+ }, vr = {
2404
+ __proto__: null,
2405
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
2406
+ "%ArrayPrototype%": ["Array", "prototype"],
2407
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
2408
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
2409
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
2410
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
2411
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
2412
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
2413
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
2414
+ "%BooleanPrototype%": ["Boolean", "prototype"],
2415
+ "%DataViewPrototype%": ["DataView", "prototype"],
2416
+ "%DatePrototype%": ["Date", "prototype"],
2417
+ "%ErrorPrototype%": ["Error", "prototype"],
2418
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
2419
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
2420
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
2421
+ "%FunctionPrototype%": ["Function", "prototype"],
2422
+ "%Generator%": ["GeneratorFunction", "prototype"],
2423
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
2424
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
2425
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
2426
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
2427
+ "%JSONParse%": ["JSON", "parse"],
2428
+ "%JSONStringify%": ["JSON", "stringify"],
2429
+ "%MapPrototype%": ["Map", "prototype"],
2430
+ "%NumberPrototype%": ["Number", "prototype"],
2431
+ "%ObjectPrototype%": ["Object", "prototype"],
2432
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
2433
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
2434
+ "%PromisePrototype%": ["Promise", "prototype"],
2435
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
2436
+ "%Promise_all%": ["Promise", "all"],
2437
+ "%Promise_reject%": ["Promise", "reject"],
2438
+ "%Promise_resolve%": ["Promise", "resolve"],
2439
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
2440
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
2441
+ "%RegExpPrototype%": ["RegExp", "prototype"],
2442
+ "%SetPrototype%": ["Set", "prototype"],
2443
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
2444
+ "%StringPrototype%": ["String", "prototype"],
2445
+ "%SymbolPrototype%": ["Symbol", "prototype"],
2446
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
2447
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
2448
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
2449
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
2450
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
2451
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
2452
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
2453
+ "%URIErrorPrototype%": ["URIError", "prototype"],
2454
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
2455
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
2456
+ }, Qe = Jt, it = Va, oi = Qe.call(Function.call, Array.prototype.concat), ai = Qe.call(Function.apply, Array.prototype.splice), xr = Qe.call(Function.call, String.prototype.replace), st = Qe.call(Function.call, String.prototype.slice), ii = Qe.call(Function.call, RegExp.prototype.exec), si = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, li = /\\(\\)?/g, ci = function(e) {
2457
+ var r = st(e, 0, 1), o = st(e, -1);
2458
+ if (r === "%" && o !== "%")
2459
+ throw new Ae("invalid intrinsic syntax, expected closing `%`");
2460
+ if (o === "%" && r !== "%")
2461
+ throw new Ae("invalid intrinsic syntax, expected opening `%`");
2462
+ var i = [];
2463
+ return xr(e, si, function(a, n, s, l) {
2464
+ i[i.length] = s ? xr(l, li, "$1") : n || a;
2465
+ }), i;
2466
+ }, ui = function(e, r) {
2467
+ var o = e, i;
2468
+ if (it(vr, o) && (i = vr[o], o = "%" + i[0] + "%"), it(Oe, o)) {
2469
+ var a = Oe[o];
2470
+ if (a === Pe && (a = ni(o)), typeof a > "u" && !r)
2471
+ throw new Ee("intrinsic " + e + " exists, but is not available. Please file an issue!");
2472
+ return {
2473
+ alias: i,
2474
+ name: o,
2475
+ value: a
2476
+ };
2477
+ }
2478
+ throw new Ae("intrinsic " + e + " does not exist!");
2479
+ }, Le = function(e, r) {
2480
+ if (typeof e != "string" || e.length === 0)
2481
+ throw new Ee("intrinsic name must be a non-empty string");
2482
+ if (arguments.length > 1 && typeof r != "boolean")
2483
+ throw new Ee('"allowMissing" argument must be a boolean');
2484
+ if (ii(/^%?[^%]*%?$/, e) === null)
2485
+ throw new Ae("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
2486
+ var o = ci(e), i = o.length > 0 ? o[0] : "", a = ui("%" + i + "%", r), n = a.name, s = a.value, l = !1, c = a.alias;
2487
+ c && (i = c[0], ai(o, oi([0, 1], c)));
2488
+ for (var u = 1, f = !0; u < o.length; u += 1) {
2489
+ var p = o[u], h = st(p, 0, 1), y = st(p, -1);
2490
+ if ((h === '"' || h === "'" || h === "`" || y === '"' || y === "'" || y === "`") && h !== y)
2491
+ throw new Ae("property names with quotes must have matching quotes");
2492
+ if ((p === "constructor" || !f) && (l = !0), i += "." + p, n = "%" + i + "%", it(Oe, n))
2493
+ s = Oe[n];
2494
+ else if (s != null) {
2495
+ if (!(p in s)) {
2496
+ if (!r)
2497
+ throw new Ee("base intrinsic for " + e + " exists, but the property is not available.");
2498
+ return;
2499
+ }
2500
+ if (Se && u + 1 >= o.length) {
2501
+ var g = Se(s, p);
2502
+ f = !!g, f && "get" in g && !("originalValue" in g.get) ? s = g.get : s = s[p];
2503
+ } else
2504
+ f = it(s, p), s = s[p];
2505
+ f && !l && (Oe[n] = s);
2506
+ }
2507
+ }
2508
+ return s;
2509
+ }, an = { exports: {} }, bt, $r;
2510
+ function Gt() {
2511
+ if ($r) return bt;
2512
+ $r = 1;
2513
+ var t = Le, e = t("%Object.defineProperty%", !0) || !1;
2514
+ if (e)
2515
+ try {
2516
+ e({}, "a", { value: 1 });
2517
+ } catch {
2518
+ e = !1;
2519
+ }
2520
+ return bt = e, bt;
2521
+ }
2522
+ var pi = Le, tt = pi("%Object.getOwnPropertyDescriptor%", !0);
2523
+ if (tt)
2524
+ try {
2525
+ tt([], "length");
2526
+ } catch {
2527
+ tt = null;
2528
+ }
2529
+ var sn = tt, wr = Gt(), fi = nn, Ce = Ve, jr = sn, di = function(e, r, o) {
2530
+ if (!e || typeof e != "object" && typeof e != "function")
2531
+ throw new Ce("`obj` must be an object or a function`");
2532
+ if (typeof r != "string" && typeof r != "symbol")
2533
+ throw new Ce("`property` must be a string or a symbol`");
2534
+ if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
2535
+ throw new Ce("`nonEnumerable`, if provided, must be a boolean or null");
2536
+ if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
2537
+ throw new Ce("`nonWritable`, if provided, must be a boolean or null");
2538
+ if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
2539
+ throw new Ce("`nonConfigurable`, if provided, must be a boolean or null");
2540
+ if (arguments.length > 6 && typeof arguments[6] != "boolean")
2541
+ throw new Ce("`loose`, if provided, must be a boolean");
2542
+ var i = arguments.length > 3 ? arguments[3] : null, a = arguments.length > 4 ? arguments[4] : null, n = arguments.length > 5 ? arguments[5] : null, s = arguments.length > 6 ? arguments[6] : !1, l = !!jr && jr(e, r);
2543
+ if (wr)
2544
+ wr(e, r, {
2545
+ configurable: n === null && l ? l.configurable : !n,
2546
+ enumerable: i === null && l ? l.enumerable : !i,
2547
+ value: o,
2548
+ writable: a === null && l ? l.writable : !a
2549
+ });
2550
+ else if (s || !i && !a && !n)
2551
+ e[r] = o;
2552
+ else
2553
+ throw new fi("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
2554
+ }, kt = Gt(), ln = function() {
2555
+ return !!kt;
2556
+ };
2557
+ ln.hasArrayLengthDefineBug = function() {
2558
+ if (!kt)
2559
+ return null;
2560
+ try {
2561
+ return kt([], "length", { value: 1 }).length !== 1;
2562
+ } catch {
2563
+ return !0;
2564
+ }
2565
+ };
2566
+ var hi = ln, yi = Le, Sr = di, mi = hi(), Or = sn, Tr = Ve, gi = yi("%Math.floor%"), bi = function(e, r) {
2567
+ if (typeof e != "function")
2568
+ throw new Tr("`fn` is not a function");
2569
+ if (typeof r != "number" || r < 0 || r > 4294967295 || gi(r) !== r)
2570
+ throw new Tr("`length` must be a positive 32-bit integer");
2571
+ var o = arguments.length > 2 && !!arguments[2], i = !0, a = !0;
2572
+ if ("length" in e && Or) {
2573
+ var n = Or(e, "length");
2574
+ n && !n.configurable && (i = !1), n && !n.writable && (a = !1);
2575
+ }
2576
+ return (i || a || !o) && (mi ? Sr(
2577
+ /** @type {Parameters<define>[0]} */
2578
+ e,
2579
+ "length",
2580
+ r,
2581
+ !0,
2582
+ !0
2583
+ ) : Sr(
2584
+ /** @type {Parameters<define>[0]} */
2585
+ e,
2586
+ "length",
2587
+ r
2588
+ )), e;
2589
+ };
2590
+ (function(t) {
2591
+ var e = Jt, r = Le, o = bi, i = Ve, a = r("%Function.prototype.apply%"), n = r("%Function.prototype.call%"), s = r("%Reflect.apply%", !0) || e.call(n, a), l = Gt(), c = r("%Math.max%");
2592
+ t.exports = function(p) {
2593
+ if (typeof p != "function")
2594
+ throw new i("a function is required");
2595
+ var h = s(e, n, arguments);
2596
+ return o(
2597
+ h,
2598
+ 1 + c(0, p.length - (arguments.length - 1)),
2599
+ !0
2600
+ );
2601
+ };
2602
+ var u = function() {
2603
+ return s(e, a, arguments);
2604
+ };
2605
+ l ? l(t.exports, "apply", { value: u }) : t.exports.apply = u;
2606
+ })(an);
2607
+ var vi = an.exports, cn = Le, un = vi, xi = un(cn("String.prototype.indexOf")), $i = function(e, r) {
2608
+ var o = cn(e, !!r);
2609
+ return typeof o == "function" && xi(e, ".prototype.") > -1 ? un(o) : o;
2610
+ };
2611
+ const wi = /* @__PURE__ */ Xn(Zn);
2612
+ var Vt = typeof Map == "function" && Map.prototype, vt = Object.getOwnPropertyDescriptor && Vt ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, lt = Vt && vt && typeof vt.get == "function" ? vt.get : null, Cr = Vt && Map.prototype.forEach, Qt = typeof Set == "function" && Set.prototype, xt = Object.getOwnPropertyDescriptor && Qt ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ct = Qt && xt && typeof xt.get == "function" ? xt.get : null, Pr = Qt && Set.prototype.forEach, ji = typeof WeakMap == "function" && WeakMap.prototype, Be = ji ? WeakMap.prototype.has : null, Si = typeof WeakSet == "function" && WeakSet.prototype, Me = Si ? WeakSet.prototype.has : null, Oi = typeof WeakRef == "function" && WeakRef.prototype, kr = Oi ? WeakRef.prototype.deref : null, Ti = Boolean.prototype.valueOf, Ci = Object.prototype.toString, Pi = Function.prototype.toString, ki = String.prototype.match, Kt = String.prototype.slice, ge = String.prototype.replace, Ei = String.prototype.toUpperCase, Er = String.prototype.toLowerCase, pn = RegExp.prototype.test, Nr = Array.prototype.concat, ce = Array.prototype.join, Ni = Array.prototype.slice, Rr = Math.floor, Et = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, $t = Object.getOwnPropertySymbols, Nt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, qe = typeof Symbol == "function" && typeof Symbol.iterator == "object", G = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === qe || !0) ? Symbol.toStringTag : null, fn = Object.prototype.propertyIsEnumerable, Ar = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
2613
+ return t.__proto__;
2614
+ } : null);
2615
+ function qr(t, e) {
2616
+ if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || pn.call(/e/, e))
2617
+ return e;
2618
+ var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
2619
+ if (typeof t == "number") {
2620
+ var o = t < 0 ? -Rr(-t) : Rr(t);
2621
+ if (o !== t) {
2622
+ var i = String(o), a = Kt.call(e, i.length + 1);
2623
+ return ge.call(i, r, "$&_") + "." + ge.call(ge.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
2624
+ }
2625
+ }
2626
+ return ge.call(e, r, "$&_");
2627
+ }
2628
+ var Rt = wi, Ir = Rt.custom, Lr = hn(Ir) ? Ir : null, Ri = function t(e, r, o, i) {
2629
+ var a = r || {};
2630
+ if (me(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
2631
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
2632
+ if (me(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
2633
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
2634
+ var n = me(a, "customInspect") ? a.customInspect : !0;
2635
+ if (typeof n != "boolean" && n !== "symbol")
2636
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
2637
+ if (me(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
2638
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
2639
+ if (me(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
2640
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
2641
+ var s = a.numericSeparator;
2642
+ if (typeof e > "u")
2643
+ return "undefined";
2644
+ if (e === null)
2645
+ return "null";
2646
+ if (typeof e == "boolean")
2647
+ return e ? "true" : "false";
2648
+ if (typeof e == "string")
2649
+ return mn(e, a);
2650
+ if (typeof e == "number") {
2651
+ if (e === 0)
2652
+ return 1 / 0 / e > 0 ? "0" : "-0";
2653
+ var l = String(e);
2654
+ return s ? qr(e, l) : l;
2655
+ }
2656
+ if (typeof e == "bigint") {
2657
+ var c = String(e) + "n";
2658
+ return s ? qr(e, c) : c;
2659
+ }
2660
+ var u = typeof a.depth > "u" ? 5 : a.depth;
2661
+ if (typeof o > "u" && (o = 0), o >= u && u > 0 && typeof e == "object")
2662
+ return At(e) ? "[Array]" : "[Object]";
2663
+ var f = Di(a, o);
2664
+ if (typeof i > "u")
2665
+ i = [];
2666
+ else if (yn(i, e) >= 0)
2667
+ return "[Circular]";
2668
+ function p(L, V, Q) {
2669
+ if (V && (i = Ni.call(i), i.push(V)), Q) {
2670
+ var Y = {
2671
+ depth: a.depth
2672
+ };
2673
+ return me(a, "quoteStyle") && (Y.quoteStyle = a.quoteStyle), t(L, Y, o + 1, i);
2674
+ }
2675
+ return t(L, a, o + 1, i);
2676
+ }
2677
+ if (typeof e == "function" && !Ur(e)) {
2678
+ var h = Bi(e), y = Ye(e, p);
2679
+ return "[Function" + (h ? ": " + h : " (anonymous)") + "]" + (y.length > 0 ? " { " + ce.call(y, ", ") + " }" : "");
2680
+ }
2681
+ if (hn(e)) {
2682
+ var g = qe ? ge.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Nt.call(e);
2683
+ return typeof e == "object" && !qe ? Fe(g) : g;
2684
+ }
2685
+ if (Vi(e)) {
2686
+ for (var b = "<" + Er.call(String(e.nodeName)), x = e.attributes || [], m = 0; m < x.length; m++)
2687
+ b += " " + x[m].name + "=" + dn(Ai(x[m].value), "double", a);
2688
+ return b += ">", e.childNodes && e.childNodes.length && (b += "..."), b += "</" + Er.call(String(e.nodeName)) + ">", b;
2689
+ }
2690
+ if (At(e)) {
2691
+ if (e.length === 0)
2692
+ return "[]";
2693
+ var v = Ye(e, p);
2694
+ return f && !Ki(v) ? "[" + qt(v, f) + "]" : "[ " + ce.call(v, ", ") + " ]";
2695
+ }
2696
+ if (Ii(e)) {
2697
+ var j = Ye(e, p);
2698
+ return !("cause" in Error.prototype) && "cause" in e && !fn.call(e, "cause") ? "{ [" + String(e) + "] " + ce.call(Nr.call("[cause]: " + p(e.cause), j), ", ") + " }" : j.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + ce.call(j, ", ") + " }";
2699
+ }
2700
+ if (typeof e == "object" && n) {
2701
+ if (Lr && typeof e[Lr] == "function" && Rt)
2702
+ return Rt(e, { depth: u - o });
2703
+ if (n !== "symbol" && typeof e.inspect == "function")
2704
+ return e.inspect();
2705
+ }
2706
+ if (Mi(e)) {
2707
+ var w = [];
2708
+ return Cr && Cr.call(e, function(L, V) {
2709
+ w.push(p(V, e, !0) + " => " + p(L, e));
2710
+ }), Fr("Map", lt.call(e), w, f);
2711
+ }
2712
+ if (Ji(e)) {
2713
+ var S = [];
2714
+ return Pr && Pr.call(e, function(L) {
2715
+ S.push(p(L, e));
2716
+ }), Fr("Set", ct.call(e), S, f);
2717
+ }
2718
+ if (zi(e))
2719
+ return wt("WeakMap");
2720
+ if (Gi(e))
2721
+ return wt("WeakSet");
2722
+ if (Wi(e))
2723
+ return wt("WeakRef");
2724
+ if (Ui(e))
2725
+ return Fe(p(Number(e)));
2726
+ if (_i(e))
2727
+ return Fe(p(Et.call(e)));
2728
+ if (Fi(e))
2729
+ return Fe(Ti.call(e));
2730
+ if (Li(e))
2731
+ return Fe(p(String(e)));
2732
+ if (typeof window < "u" && e === window)
2733
+ return "{ [object Window] }";
2734
+ if (typeof globalThis < "u" && e === globalThis || typeof He < "u" && e === He)
2735
+ return "{ [object globalThis] }";
2736
+ if (!qi(e) && !Ur(e)) {
2737
+ var k = Ye(e, p), E = Ar ? Ar(e) === Object.prototype : e instanceof Object || e.constructor === Object, R = e instanceof Object ? "" : "null prototype", F = !E && G && Object(e) === e && G in e ? Kt.call(xe(e), 8, -1) : R ? "Object" : "", te = E || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", re = te + (F || R ? "[" + ce.call(Nr.call([], F || [], R || []), ": ") + "] " : "");
2738
+ return k.length === 0 ? re + "{}" : f ? re + "{" + qt(k, f) + "}" : re + "{ " + ce.call(k, ", ") + " }";
2739
+ }
2740
+ return String(e);
2741
+ };
2742
+ function dn(t, e, r) {
2743
+ var o = (r.quoteStyle || e) === "double" ? '"' : "'";
2744
+ return o + t + o;
2745
+ }
2746
+ function Ai(t) {
2747
+ return ge.call(String(t), /"/g, "&quot;");
2748
+ }
2749
+ function At(t) {
2750
+ return xe(t) === "[object Array]" && (!G || !(typeof t == "object" && G in t));
2751
+ }
2752
+ function qi(t) {
2753
+ return xe(t) === "[object Date]" && (!G || !(typeof t == "object" && G in t));
2754
+ }
2755
+ function Ur(t) {
2756
+ return xe(t) === "[object RegExp]" && (!G || !(typeof t == "object" && G in t));
2757
+ }
2758
+ function Ii(t) {
2759
+ return xe(t) === "[object Error]" && (!G || !(typeof t == "object" && G in t));
2760
+ }
2761
+ function Li(t) {
2762
+ return xe(t) === "[object String]" && (!G || !(typeof t == "object" && G in t));
2763
+ }
2764
+ function Ui(t) {
2765
+ return xe(t) === "[object Number]" && (!G || !(typeof t == "object" && G in t));
2766
+ }
2767
+ function Fi(t) {
2768
+ return xe(t) === "[object Boolean]" && (!G || !(typeof t == "object" && G in t));
2769
+ }
2770
+ function hn(t) {
2771
+ if (qe)
2772
+ return t && typeof t == "object" && t instanceof Symbol;
2773
+ if (typeof t == "symbol")
2774
+ return !0;
2775
+ if (!t || typeof t != "object" || !Nt)
2776
+ return !1;
2777
+ try {
2778
+ return Nt.call(t), !0;
2779
+ } catch {
2780
+ }
2781
+ return !1;
2782
+ }
2783
+ function _i(t) {
2784
+ if (!t || typeof t != "object" || !Et)
2785
+ return !1;
2786
+ try {
2787
+ return Et.call(t), !0;
2788
+ } catch {
2789
+ }
2790
+ return !1;
2791
+ }
2792
+ var Hi = Object.prototype.hasOwnProperty || function(t) {
2793
+ return t in this;
2794
+ };
2795
+ function me(t, e) {
2796
+ return Hi.call(t, e);
2797
+ }
2798
+ function xe(t) {
2799
+ return Ci.call(t);
2800
+ }
2801
+ function Bi(t) {
2802
+ if (t.name)
2803
+ return t.name;
2804
+ var e = ki.call(Pi.call(t), /^function\s*([\w$]+)/);
2805
+ return e ? e[1] : null;
2806
+ }
2807
+ function yn(t, e) {
2808
+ if (t.indexOf)
2809
+ return t.indexOf(e);
2810
+ for (var r = 0, o = t.length; r < o; r++)
2811
+ if (t[r] === e)
2812
+ return r;
2813
+ return -1;
2814
+ }
2815
+ function Mi(t) {
2816
+ if (!lt || !t || typeof t != "object")
2817
+ return !1;
2818
+ try {
2819
+ lt.call(t);
2820
+ try {
2821
+ ct.call(t);
2822
+ } catch {
2823
+ return !0;
2824
+ }
2825
+ return t instanceof Map;
2826
+ } catch {
2827
+ }
2828
+ return !1;
2829
+ }
2830
+ function zi(t) {
2831
+ if (!Be || !t || typeof t != "object")
2832
+ return !1;
2833
+ try {
2834
+ Be.call(t, Be);
2835
+ try {
2836
+ Me.call(t, Me);
2837
+ } catch {
2838
+ return !0;
2839
+ }
2840
+ return t instanceof WeakMap;
2841
+ } catch {
2842
+ }
2843
+ return !1;
2844
+ }
2845
+ function Wi(t) {
2846
+ if (!kr || !t || typeof t != "object")
2847
+ return !1;
2848
+ try {
2849
+ return kr.call(t), !0;
2850
+ } catch {
2851
+ }
2852
+ return !1;
2853
+ }
2854
+ function Ji(t) {
2855
+ if (!ct || !t || typeof t != "object")
2856
+ return !1;
2857
+ try {
2858
+ ct.call(t);
2859
+ try {
2860
+ lt.call(t);
2861
+ } catch {
2862
+ return !0;
2863
+ }
2864
+ return t instanceof Set;
2865
+ } catch {
2866
+ }
2867
+ return !1;
2868
+ }
2869
+ function Gi(t) {
2870
+ if (!Me || !t || typeof t != "object")
2871
+ return !1;
2872
+ try {
2873
+ Me.call(t, Me);
2874
+ try {
2875
+ Be.call(t, Be);
2876
+ } catch {
2877
+ return !0;
2878
+ }
2879
+ return t instanceof WeakSet;
2880
+ } catch {
2881
+ }
2882
+ return !1;
2883
+ }
2884
+ function Vi(t) {
2885
+ return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
2886
+ }
2887
+ function mn(t, e) {
2888
+ if (t.length > e.maxStringLength) {
2889
+ var r = t.length - e.maxStringLength, o = "... " + r + " more character" + (r > 1 ? "s" : "");
2890
+ return mn(Kt.call(t, 0, e.maxStringLength), e) + o;
2891
+ }
2892
+ var i = ge.call(ge.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, Qi);
2893
+ return dn(i, "single", e);
2894
+ }
2895
+ function Qi(t) {
2896
+ var e = t.charCodeAt(0), r = {
2897
+ 8: "b",
2898
+ 9: "t",
2899
+ 10: "n",
2900
+ 12: "f",
2901
+ 13: "r"
2902
+ }[e];
2903
+ return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Ei.call(e.toString(16));
2904
+ }
2905
+ function Fe(t) {
2906
+ return "Object(" + t + ")";
2907
+ }
2908
+ function wt(t) {
2909
+ return t + " { ? }";
2910
+ }
2911
+ function Fr(t, e, r, o) {
2912
+ var i = o ? qt(r, o) : ce.call(r, ", ");
2913
+ return t + " (" + e + ") {" + i + "}";
2914
+ }
2915
+ function Ki(t) {
2916
+ for (var e = 0; e < t.length; e++)
2917
+ if (yn(t[e], `
2918
+ `) >= 0)
2919
+ return !1;
2920
+ return !0;
2921
+ }
2922
+ function Di(t, e) {
2923
+ var r;
2924
+ if (t.indent === " ")
2925
+ r = " ";
2926
+ else if (typeof t.indent == "number" && t.indent > 0)
2927
+ r = ce.call(Array(t.indent + 1), " ");
2928
+ else
2929
+ return null;
2930
+ return {
2931
+ base: r,
2932
+ prev: ce.call(Array(e + 1), r)
2933
+ };
2934
+ }
2935
+ function qt(t, e) {
2936
+ if (t.length === 0)
2937
+ return "";
2938
+ var r = `
2939
+ ` + e.prev + e.base;
2940
+ return r + ce.call(t, "," + r) + `
2941
+ ` + e.prev;
2942
+ }
2943
+ function Ye(t, e) {
2944
+ var r = At(t), o = [];
2945
+ if (r) {
2946
+ o.length = t.length;
2947
+ for (var i = 0; i < t.length; i++)
2948
+ o[i] = me(t, i) ? e(t[i], t) : "";
2949
+ }
2950
+ var a = typeof $t == "function" ? $t(t) : [], n;
2951
+ if (qe) {
2952
+ n = {};
2953
+ for (var s = 0; s < a.length; s++)
2954
+ n["$" + a[s]] = a[s];
2955
+ }
2956
+ for (var l in t)
2957
+ me(t, l) && (r && String(Number(l)) === l && l < t.length || qe && n["$" + l] instanceof Symbol || (pn.call(/[^\w$]/, l) ? o.push(e(l, t) + ": " + e(t[l], t)) : o.push(l + ": " + e(t[l], t))));
2958
+ if (typeof $t == "function")
2959
+ for (var c = 0; c < a.length; c++)
2960
+ fn.call(t, a[c]) && o.push("[" + e(a[c]) + "]: " + e(t[a[c]], t));
2961
+ return o;
2962
+ }
2963
+ var gn = Le, Ue = $i, Yi = Ri, Xi = Ve, Xe = gn("%WeakMap%", !0), Ze = gn("%Map%", !0), Zi = Ue("WeakMap.prototype.get", !0), es = Ue("WeakMap.prototype.set", !0), ts = Ue("WeakMap.prototype.has", !0), rs = Ue("Map.prototype.get", !0), ns = Ue("Map.prototype.set", !0), os = Ue("Map.prototype.has", !0), Dt = function(t, e) {
2964
+ for (var r = t, o; (o = r.next) !== null; r = o)
2965
+ if (o.key === e)
2966
+ return r.next = o.next, o.next = /** @type {NonNullable<typeof list.next>} */
2967
+ t.next, t.next = o, o;
2968
+ }, as = function(t, e) {
2969
+ var r = Dt(t, e);
2970
+ return r && r.value;
2971
+ }, is = function(t, e, r) {
2972
+ var o = Dt(t, e);
2973
+ o ? o.value = r : t.next = /** @type {import('.').ListNode<typeof value>} */
2974
+ {
2975
+ // eslint-disable-line no-param-reassign, no-extra-parens
2976
+ key: e,
2977
+ next: t.next,
2978
+ value: r
2979
+ };
2980
+ }, ss = function(t, e) {
2981
+ return !!Dt(t, e);
2982
+ }, ls = function() {
2983
+ var e, r, o, i = {
2984
+ assert: function(a) {
2985
+ if (!i.has(a))
2986
+ throw new Xi("Side channel does not contain " + Yi(a));
2987
+ },
2988
+ get: function(a) {
2989
+ if (Xe && a && (typeof a == "object" || typeof a == "function")) {
2990
+ if (e)
2991
+ return Zi(e, a);
2992
+ } else if (Ze) {
2993
+ if (r)
2994
+ return rs(r, a);
2995
+ } else if (o)
2996
+ return as(o, a);
2997
+ },
2998
+ has: function(a) {
2999
+ if (Xe && a && (typeof a == "object" || typeof a == "function")) {
3000
+ if (e)
3001
+ return ts(e, a);
3002
+ } else if (Ze) {
3003
+ if (r)
3004
+ return os(r, a);
3005
+ } else if (o)
3006
+ return ss(o, a);
3007
+ return !1;
3008
+ },
3009
+ set: function(a, n) {
3010
+ Xe && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Xe()), es(e, a, n)) : Ze ? (r || (r = new Ze()), ns(r, a, n)) : (o || (o = { key: {}, next: null }), is(o, a, n));
3011
+ }
3012
+ };
3013
+ return i;
3014
+ }, cs = String.prototype.replace, us = /%20/g, jt = {
3015
+ RFC1738: "RFC1738",
3016
+ RFC3986: "RFC3986"
3017
+ }, Yt = {
3018
+ default: jt.RFC3986,
3019
+ formatters: {
3020
+ RFC1738: function(t) {
3021
+ return cs.call(t, us, "+");
3022
+ },
3023
+ RFC3986: function(t) {
3024
+ return String(t);
3025
+ }
3026
+ },
3027
+ RFC1738: jt.RFC1738,
3028
+ RFC3986: jt.RFC3986
3029
+ }, ps = Yt, St = Object.prototype.hasOwnProperty, we = Array.isArray, se = function() {
3030
+ for (var t = [], e = 0; e < 256; ++e)
3031
+ t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
3032
+ return t;
3033
+ }(), fs = function(e) {
3034
+ for (; e.length > 1; ) {
3035
+ var r = e.pop(), o = r.obj[r.prop];
3036
+ if (we(o)) {
3037
+ for (var i = [], a = 0; a < o.length; ++a)
3038
+ typeof o[a] < "u" && i.push(o[a]);
3039
+ r.obj[r.prop] = i;
3040
+ }
3041
+ }
3042
+ }, bn = function(e, r) {
3043
+ for (var o = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, i = 0; i < e.length; ++i)
3044
+ typeof e[i] < "u" && (o[i] = e[i]);
3045
+ return o;
3046
+ }, ds = function t(e, r, o) {
3047
+ if (!r)
3048
+ return e;
3049
+ if (typeof r != "object") {
3050
+ if (we(e))
3051
+ e.push(r);
3052
+ else if (e && typeof e == "object")
3053
+ (o && (o.plainObjects || o.allowPrototypes) || !St.call(Object.prototype, r)) && (e[r] = !0);
3054
+ else
3055
+ return [e, r];
3056
+ return e;
3057
+ }
3058
+ if (!e || typeof e != "object")
3059
+ return [e].concat(r);
3060
+ var i = e;
3061
+ return we(e) && !we(r) && (i = bn(e, o)), we(e) && we(r) ? (r.forEach(function(a, n) {
3062
+ if (St.call(e, n)) {
3063
+ var s = e[n];
3064
+ s && typeof s == "object" && a && typeof a == "object" ? e[n] = t(s, a, o) : e.push(a);
3065
+ } else
3066
+ e[n] = a;
3067
+ }), e) : Object.keys(r).reduce(function(a, n) {
3068
+ var s = r[n];
3069
+ return St.call(a, n) ? a[n] = t(a[n], s, o) : a[n] = s, a;
3070
+ }, i);
3071
+ }, hs = function(e, r) {
3072
+ return Object.keys(r).reduce(function(o, i) {
3073
+ return o[i] = r[i], o;
3074
+ }, e);
3075
+ }, ys = function(t, e, r) {
3076
+ var o = t.replace(/\+/g, " ");
3077
+ if (r === "iso-8859-1")
3078
+ return o.replace(/%[0-9a-f]{2}/gi, unescape);
3079
+ try {
3080
+ return decodeURIComponent(o);
3081
+ } catch {
3082
+ return o;
3083
+ }
3084
+ }, Ot = 1024, ms = function(e, r, o, i, a) {
3085
+ if (e.length === 0)
3086
+ return e;
3087
+ var n = e;
3088
+ if (typeof e == "symbol" ? n = Symbol.prototype.toString.call(e) : typeof e != "string" && (n = String(e)), o === "iso-8859-1")
3089
+ return escape(n).replace(/%u[0-9a-f]{4}/gi, function(h) {
3090
+ return "%26%23" + parseInt(h.slice(2), 16) + "%3B";
3091
+ });
3092
+ for (var s = "", l = 0; l < n.length; l += Ot) {
3093
+ for (var c = n.length >= Ot ? n.slice(l, l + Ot) : n, u = [], f = 0; f < c.length; ++f) {
3094
+ var p = c.charCodeAt(f);
3095
+ if (p === 45 || p === 46 || p === 95 || p === 126 || p >= 48 && p <= 57 || p >= 65 && p <= 90 || p >= 97 && p <= 122 || a === ps.RFC1738 && (p === 40 || p === 41)) {
3096
+ u[u.length] = c.charAt(f);
3097
+ continue;
3098
+ }
3099
+ if (p < 128) {
3100
+ u[u.length] = se[p];
3101
+ continue;
3102
+ }
3103
+ if (p < 2048) {
3104
+ u[u.length] = se[192 | p >> 6] + se[128 | p & 63];
3105
+ continue;
3106
+ }
3107
+ if (p < 55296 || p >= 57344) {
3108
+ u[u.length] = se[224 | p >> 12] + se[128 | p >> 6 & 63] + se[128 | p & 63];
3109
+ continue;
3110
+ }
3111
+ f += 1, p = 65536 + ((p & 1023) << 10 | c.charCodeAt(f) & 1023), u[u.length] = se[240 | p >> 18] + se[128 | p >> 12 & 63] + se[128 | p >> 6 & 63] + se[128 | p & 63];
3112
+ }
3113
+ s += u.join("");
3114
+ }
3115
+ return s;
3116
+ }, gs = function(e) {
3117
+ for (var r = [{ obj: { o: e }, prop: "o" }], o = [], i = 0; i < r.length; ++i)
3118
+ for (var a = r[i], n = a.obj[a.prop], s = Object.keys(n), l = 0; l < s.length; ++l) {
3119
+ var c = s[l], u = n[c];
3120
+ typeof u == "object" && u !== null && o.indexOf(u) === -1 && (r.push({ obj: n, prop: c }), o.push(u));
3121
+ }
3122
+ return fs(r), e;
3123
+ }, bs = function(e) {
3124
+ return Object.prototype.toString.call(e) === "[object RegExp]";
3125
+ }, vs = function(e) {
3126
+ return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
3127
+ }, xs = function(e, r) {
3128
+ return [].concat(e, r);
3129
+ }, $s = function(e, r) {
3130
+ if (we(e)) {
3131
+ for (var o = [], i = 0; i < e.length; i += 1)
3132
+ o.push(r(e[i]));
3133
+ return o;
3134
+ }
3135
+ return r(e);
3136
+ }, vn = {
3137
+ arrayToObject: bn,
3138
+ assign: hs,
3139
+ combine: xs,
3140
+ compact: gs,
3141
+ decode: ys,
3142
+ encode: ms,
3143
+ isBuffer: vs,
3144
+ isRegExp: bs,
3145
+ maybeMap: $s,
3146
+ merge: ds
3147
+ }, xn = ls, rt = vn, ze = Yt, ws = Object.prototype.hasOwnProperty, $n = {
3148
+ brackets: function(e) {
3149
+ return e + "[]";
3150
+ },
3151
+ comma: "comma",
3152
+ indices: function(e, r) {
3153
+ return e + "[" + r + "]";
3154
+ },
3155
+ repeat: function(e) {
3156
+ return e;
3157
+ }
3158
+ }, le = Array.isArray, js = Array.prototype.push, wn = function(t, e) {
3159
+ js.apply(t, le(e) ? e : [e]);
3160
+ }, Ss = Date.prototype.toISOString, _r = ze.default, U = {
3161
+ addQueryPrefix: !1,
3162
+ allowDots: !1,
3163
+ allowEmptyArrays: !1,
3164
+ arrayFormat: "indices",
3165
+ charset: "utf-8",
3166
+ charsetSentinel: !1,
3167
+ delimiter: "&",
3168
+ encode: !0,
3169
+ encodeDotInKeys: !1,
3170
+ encoder: rt.encode,
3171
+ encodeValuesOnly: !1,
3172
+ format: _r,
3173
+ formatter: ze.formatters[_r],
3174
+ // deprecated
3175
+ indices: !1,
3176
+ serializeDate: function(e) {
3177
+ return Ss.call(e);
3178
+ },
3179
+ skipNulls: !1,
3180
+ strictNullHandling: !1
3181
+ }, Os = function(e) {
3182
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
3183
+ }, Tt = {}, Ts = function t(e, r, o, i, a, n, s, l, c, u, f, p, h, y, g, b, x, m) {
3184
+ for (var v = e, j = m, w = 0, S = !1; (j = j.get(Tt)) !== void 0 && !S; ) {
3185
+ var k = j.get(e);
3186
+ if (w += 1, typeof k < "u") {
3187
+ if (k === w)
3188
+ throw new RangeError("Cyclic object value");
3189
+ S = !0;
3190
+ }
3191
+ typeof j.get(Tt) > "u" && (w = 0);
3192
+ }
3193
+ if (typeof u == "function" ? v = u(r, v) : v instanceof Date ? v = h(v) : o === "comma" && le(v) && (v = rt.maybeMap(v, function($) {
3194
+ return $ instanceof Date ? h($) : $;
3195
+ })), v === null) {
3196
+ if (n)
3197
+ return c && !b ? c(r, U.encoder, x, "key", y) : r;
3198
+ v = "";
3199
+ }
3200
+ if (Os(v) || rt.isBuffer(v)) {
3201
+ if (c) {
3202
+ var E = b ? r : c(r, U.encoder, x, "key", y);
3203
+ return [g(E) + "=" + g(c(v, U.encoder, x, "value", y))];
3204
+ }
3205
+ return [g(r) + "=" + g(String(v))];
3206
+ }
3207
+ var R = [];
3208
+ if (typeof v > "u")
3209
+ return R;
3210
+ var F;
3211
+ if (o === "comma" && le(v))
3212
+ b && c && (v = rt.maybeMap(v, c)), F = [{ value: v.length > 0 ? v.join(",") || null : void 0 }];
3213
+ else if (le(u))
3214
+ F = u;
3215
+ else {
3216
+ var te = Object.keys(v);
3217
+ F = f ? te.sort(f) : te;
3218
+ }
3219
+ var re = l ? r.replace(/\./g, "%2E") : r, L = i && le(v) && v.length === 1 ? re + "[]" : re;
3220
+ if (a && le(v) && v.length === 0)
3221
+ return L + "[]";
3222
+ for (var V = 0; V < F.length; ++V) {
3223
+ var Q = F[V], Y = typeof Q == "object" && typeof Q.value < "u" ? Q.value : v[Q];
3224
+ if (!(s && Y === null)) {
3225
+ var he = p && l ? Q.replace(/\./g, "%2E") : Q, ft = le(v) ? typeof o == "function" ? o(L, he) : L : L + (p ? "." + he : "[" + he + "]");
3226
+ m.set(e, w);
3227
+ var Ke = xn();
3228
+ Ke.set(Tt, m), wn(R, t(
3229
+ Y,
3230
+ ft,
3231
+ o,
3232
+ i,
3233
+ a,
3234
+ n,
3235
+ s,
3236
+ l,
3237
+ o === "comma" && b && le(v) ? null : c,
3238
+ u,
3239
+ f,
3240
+ p,
3241
+ h,
3242
+ y,
3243
+ g,
3244
+ b,
3245
+ x,
3246
+ Ke
3247
+ ));
3248
+ }
3249
+ }
3250
+ return R;
3251
+ }, Cs = function(e) {
3252
+ if (!e)
3253
+ return U;
3254
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
3255
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
3256
+ if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
3257
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
3258
+ if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
3259
+ throw new TypeError("Encoder has to be a function.");
3260
+ var r = e.charset || U.charset;
3261
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
3262
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
3263
+ var o = ze.default;
3264
+ if (typeof e.format < "u") {
3265
+ if (!ws.call(ze.formatters, e.format))
3266
+ throw new TypeError("Unknown format option provided.");
3267
+ o = e.format;
3268
+ }
3269
+ var i = ze.formatters[o], a = U.filter;
3270
+ (typeof e.filter == "function" || le(e.filter)) && (a = e.filter);
3271
+ var n;
3272
+ if (e.arrayFormat in $n ? n = e.arrayFormat : "indices" in e ? n = e.indices ? "indices" : "repeat" : n = U.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
3273
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
3274
+ var s = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : U.allowDots : !!e.allowDots;
3275
+ return {
3276
+ addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : U.addQueryPrefix,
3277
+ allowDots: s,
3278
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : U.allowEmptyArrays,
3279
+ arrayFormat: n,
3280
+ charset: r,
3281
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : U.charsetSentinel,
3282
+ commaRoundTrip: e.commaRoundTrip,
3283
+ delimiter: typeof e.delimiter > "u" ? U.delimiter : e.delimiter,
3284
+ encode: typeof e.encode == "boolean" ? e.encode : U.encode,
3285
+ encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : U.encodeDotInKeys,
3286
+ encoder: typeof e.encoder == "function" ? e.encoder : U.encoder,
3287
+ encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : U.encodeValuesOnly,
3288
+ filter: a,
3289
+ format: o,
3290
+ formatter: i,
3291
+ serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : U.serializeDate,
3292
+ skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : U.skipNulls,
3293
+ sort: typeof e.sort == "function" ? e.sort : null,
3294
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : U.strictNullHandling
3295
+ };
3296
+ }, Ps = function(t, e) {
3297
+ var r = t, o = Cs(e), i, a;
3298
+ typeof o.filter == "function" ? (a = o.filter, r = a("", r)) : le(o.filter) && (a = o.filter, i = a);
3299
+ var n = [];
3300
+ if (typeof r != "object" || r === null)
3301
+ return "";
3302
+ var s = $n[o.arrayFormat], l = s === "comma" && o.commaRoundTrip;
3303
+ i || (i = Object.keys(r)), o.sort && i.sort(o.sort);
3304
+ for (var c = xn(), u = 0; u < i.length; ++u) {
3305
+ var f = i[u];
3306
+ o.skipNulls && r[f] === null || wn(n, Ts(
3307
+ r[f],
3308
+ f,
3309
+ s,
3310
+ l,
3311
+ o.allowEmptyArrays,
3312
+ o.strictNullHandling,
3313
+ o.skipNulls,
3314
+ o.encodeDotInKeys,
3315
+ o.encode ? o.encoder : null,
3316
+ o.filter,
3317
+ o.sort,
3318
+ o.allowDots,
3319
+ o.serializeDate,
3320
+ o.format,
3321
+ o.formatter,
3322
+ o.encodeValuesOnly,
3323
+ o.charset,
3324
+ c
3325
+ ));
3326
+ }
3327
+ var p = n.join(o.delimiter), h = o.addQueryPrefix === !0 ? "?" : "";
3328
+ return o.charsetSentinel && (o.charset === "iso-8859-1" ? h += "utf8=%26%2310003%3B&" : h += "utf8=%E2%9C%93&"), p.length > 0 ? h + p : "";
3329
+ }, Ie = vn, It = Object.prototype.hasOwnProperty, ks = Array.isArray, q = {
3330
+ allowDots: !1,
3331
+ allowEmptyArrays: !1,
3332
+ allowPrototypes: !1,
3333
+ allowSparse: !1,
3334
+ arrayLimit: 20,
3335
+ charset: "utf-8",
3336
+ charsetSentinel: !1,
3337
+ comma: !1,
3338
+ decodeDotInKeys: !1,
3339
+ decoder: Ie.decode,
3340
+ delimiter: "&",
3341
+ depth: 5,
3342
+ duplicates: "combine",
3343
+ ignoreQueryPrefix: !1,
3344
+ interpretNumericEntities: !1,
3345
+ parameterLimit: 1e3,
3346
+ parseArrays: !0,
3347
+ plainObjects: !1,
3348
+ strictDepth: !1,
3349
+ strictNullHandling: !1
3350
+ }, Es = function(t) {
3351
+ return t.replace(/&#(\d+);/g, function(e, r) {
3352
+ return String.fromCharCode(parseInt(r, 10));
3353
+ });
3354
+ }, jn = function(t, e) {
3355
+ return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t;
3356
+ }, Ns = "utf8=%26%2310003%3B", Rs = "utf8=%E2%9C%93", As = function(e, r) {
3357
+ var o = { __proto__: null }, i = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
3358
+ i = i.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
3359
+ var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, n = i.split(r.delimiter, a), s = -1, l, c = r.charset;
3360
+ if (r.charsetSentinel)
3361
+ for (l = 0; l < n.length; ++l)
3362
+ n[l].indexOf("utf8=") === 0 && (n[l] === Rs ? c = "utf-8" : n[l] === Ns && (c = "iso-8859-1"), s = l, l = n.length);
3363
+ for (l = 0; l < n.length; ++l)
3364
+ if (l !== s) {
3365
+ var u = n[l], f = u.indexOf("]="), p = f === -1 ? u.indexOf("=") : f + 1, h, y;
3366
+ p === -1 ? (h = r.decoder(u, q.decoder, c, "key"), y = r.strictNullHandling ? null : "") : (h = r.decoder(u.slice(0, p), q.decoder, c, "key"), y = Ie.maybeMap(
3367
+ jn(u.slice(p + 1), r),
3368
+ function(b) {
3369
+ return r.decoder(b, q.decoder, c, "value");
3370
+ }
3371
+ )), y && r.interpretNumericEntities && c === "iso-8859-1" && (y = Es(y)), u.indexOf("[]=") > -1 && (y = ks(y) ? [y] : y);
3372
+ var g = It.call(o, h);
3373
+ g && r.duplicates === "combine" ? o[h] = Ie.combine(o[h], y) : (!g || r.duplicates === "last") && (o[h] = y);
3374
+ }
3375
+ return o;
3376
+ }, qs = function(t, e, r, o) {
3377
+ for (var i = o ? e : jn(e, r), a = t.length - 1; a >= 0; --a) {
3378
+ var n, s = t[a];
3379
+ if (s === "[]" && r.parseArrays)
3380
+ n = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : [].concat(i);
3381
+ else {
3382
+ n = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3383
+ var l = s.charAt(0) === "[" && s.charAt(s.length - 1) === "]" ? s.slice(1, -1) : s, c = r.decodeDotInKeys ? l.replace(/%2E/g, ".") : l, u = parseInt(c, 10);
3384
+ !r.parseArrays && c === "" ? n = { 0: i } : !isNaN(u) && s !== c && String(u) === c && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (n = [], n[u] = i) : c !== "__proto__" && (n[c] = i);
3385
+ }
3386
+ i = n;
3387
+ }
3388
+ return i;
3389
+ }, Is = function(e, r, o, i) {
3390
+ if (e) {
3391
+ var a = o.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, n = /(\[[^[\]]*])/, s = /(\[[^[\]]*])/g, l = o.depth > 0 && n.exec(a), c = l ? a.slice(0, l.index) : a, u = [];
3392
+ if (c) {
3393
+ if (!o.plainObjects && It.call(Object.prototype, c) && !o.allowPrototypes)
3394
+ return;
3395
+ u.push(c);
3396
+ }
3397
+ for (var f = 0; o.depth > 0 && (l = s.exec(a)) !== null && f < o.depth; ) {
3398
+ if (f += 1, !o.plainObjects && It.call(Object.prototype, l[1].slice(1, -1)) && !o.allowPrototypes)
3399
+ return;
3400
+ u.push(l[1]);
3401
+ }
3402
+ if (l) {
3403
+ if (o.strictDepth === !0)
3404
+ throw new RangeError("Input depth exceeded depth option of " + o.depth + " and strictDepth is true");
3405
+ u.push("[" + a.slice(l.index) + "]");
3406
+ }
3407
+ return qs(u, r, o, i);
3408
+ }
3409
+ }, Ls = function(e) {
3410
+ if (!e)
3411
+ return q;
3412
+ if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
3413
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
3414
+ if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
3415
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
3416
+ if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
3417
+ throw new TypeError("Decoder has to be a function.");
3418
+ if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
3419
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
3420
+ var r = typeof e.charset > "u" ? q.charset : e.charset, o = typeof e.duplicates > "u" ? q.duplicates : e.duplicates;
3421
+ if (o !== "combine" && o !== "first" && o !== "last")
3422
+ throw new TypeError("The duplicates option must be either combine, first, or last");
3423
+ var i = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : q.allowDots : !!e.allowDots;
3424
+ return {
3425
+ allowDots: i,
3426
+ allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : q.allowEmptyArrays,
3427
+ allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : q.allowPrototypes,
3428
+ allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : q.allowSparse,
3429
+ arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : q.arrayLimit,
3430
+ charset: r,
3431
+ charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : q.charsetSentinel,
3432
+ comma: typeof e.comma == "boolean" ? e.comma : q.comma,
3433
+ decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : q.decodeDotInKeys,
3434
+ decoder: typeof e.decoder == "function" ? e.decoder : q.decoder,
3435
+ delimiter: typeof e.delimiter == "string" || Ie.isRegExp(e.delimiter) ? e.delimiter : q.delimiter,
3436
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
3437
+ depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : q.depth,
3438
+ duplicates: o,
3439
+ ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
3440
+ interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : q.interpretNumericEntities,
3441
+ parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : q.parameterLimit,
3442
+ parseArrays: e.parseArrays !== !1,
3443
+ plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : q.plainObjects,
3444
+ strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : q.strictDepth,
3445
+ strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : q.strictNullHandling
3446
+ };
3447
+ }, Us = function(t, e) {
3448
+ var r = Ls(e);
3449
+ if (t === "" || t === null || typeof t > "u")
3450
+ return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
3451
+ for (var o = typeof t == "string" ? As(t, r) : t, i = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(o), n = 0; n < a.length; ++n) {
3452
+ var s = a[n], l = Is(s, o[s], r, typeof t == "string");
3453
+ i = Ie.merge(i, l, r);
3454
+ }
3455
+ return r.allowSparse === !0 ? i : Ie.compact(i);
3456
+ }, Fs = Ps, _s = Us, Hs = Yt, nt = {
3457
+ formats: Hs,
3458
+ parse: _s,
3459
+ stringify: Fs
3460
+ }, Bs = Oa;
3461
+ function ae() {
3462
+ this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
3463
+ }
3464
+ var Ms = /^([a-z0-9.+-]+:)/i, zs = /:[0-9]*$/, Ws = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/, Js = [
3465
+ "<",
3466
+ ">",
3467
+ '"',
3468
+ "`",
3469
+ " ",
3470
+ "\r",
3471
+ `
3472
+ `,
3473
+ " "
3474
+ ], Gs = [
3475
+ "{",
3476
+ "}",
3477
+ "|",
3478
+ "\\",
3479
+ "^",
3480
+ "`"
3481
+ ].concat(Js), Lt = ["'"].concat(Gs), Hr = [
3482
+ "%",
3483
+ "/",
3484
+ "?",
3485
+ ";",
3486
+ "#"
3487
+ ].concat(Lt), Br = [
3488
+ "/",
3489
+ "?",
3490
+ "#"
3491
+ ], Vs = 255, Mr = /^[+a-z0-9A-Z_-]{0,63}$/, Qs = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, Ks = {
3492
+ javascript: !0,
3493
+ "javascript:": !0
3494
+ }, Ut = {
3495
+ javascript: !0,
3496
+ "javascript:": !0
3497
+ }, Ne = {
3498
+ http: !0,
3499
+ https: !0,
3500
+ ftp: !0,
3501
+ gopher: !0,
3502
+ file: !0,
3503
+ "http:": !0,
3504
+ "https:": !0,
3505
+ "ftp:": !0,
3506
+ "gopher:": !0,
3507
+ "file:": !0
3508
+ }, Ft = nt;
3509
+ function Xt(t, e, r) {
3510
+ if (t && typeof t == "object" && t instanceof ae)
3511
+ return t;
3512
+ var o = new ae();
3513
+ return o.parse(t, e, r), o;
3514
+ }
3515
+ ae.prototype.parse = function(t, e, r) {
3516
+ if (typeof t != "string")
3517
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
3518
+ var o = t.indexOf("?"), i = o !== -1 && o < t.indexOf("#") ? "?" : "#", a = t.split(i), n = /\\/g;
3519
+ a[0] = a[0].replace(n, "/"), t = a.join(i);
3520
+ var s = t;
3521
+ if (s = s.trim(), !r && t.split("#").length === 1) {
3522
+ var l = Ws.exec(s);
3523
+ if (l)
3524
+ return this.path = s, this.href = s, this.pathname = l[1], l[2] ? (this.search = l[2], e ? this.query = Ft.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : e && (this.search = "", this.query = {}), this;
3525
+ }
3526
+ var c = Ms.exec(s);
3527
+ if (c) {
3528
+ c = c[0];
3529
+ var u = c.toLowerCase();
3530
+ this.protocol = u, s = s.substr(c.length);
3531
+ }
3532
+ if (r || c || s.match(/^\/\/[^@/]+@[^@/]+/)) {
3533
+ var f = s.substr(0, 2) === "//";
3534
+ f && !(c && Ut[c]) && (s = s.substr(2), this.slashes = !0);
3535
+ }
3536
+ if (!Ut[c] && (f || c && !Ne[c])) {
3537
+ for (var p = -1, h = 0; h < Br.length; h++) {
3538
+ var y = s.indexOf(Br[h]);
3539
+ y !== -1 && (p === -1 || y < p) && (p = y);
3540
+ }
3541
+ var g, b;
3542
+ p === -1 ? b = s.lastIndexOf("@") : b = s.lastIndexOf("@", p), b !== -1 && (g = s.slice(0, b), s = s.slice(b + 1), this.auth = decodeURIComponent(g)), p = -1;
3543
+ for (var h = 0; h < Hr.length; h++) {
3544
+ var y = s.indexOf(Hr[h]);
3545
+ y !== -1 && (p === -1 || y < p) && (p = y);
3546
+ }
3547
+ p === -1 && (p = s.length), this.host = s.slice(0, p), s = s.slice(p), this.parseHost(), this.hostname = this.hostname || "";
3548
+ var x = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
3549
+ if (!x)
3550
+ for (var m = this.hostname.split(/\./), h = 0, v = m.length; h < v; h++) {
3551
+ var j = m[h];
3552
+ if (j && !j.match(Mr)) {
3553
+ for (var w = "", S = 0, k = j.length; S < k; S++)
3554
+ j.charCodeAt(S) > 127 ? w += "x" : w += j[S];
3555
+ if (!w.match(Mr)) {
3556
+ var E = m.slice(0, h), R = m.slice(h + 1), F = j.match(Qs);
3557
+ F && (E.push(F[1]), R.unshift(F[2])), R.length && (s = "/" + R.join(".") + s), this.hostname = E.join(".");
3558
+ break;
3559
+ }
3560
+ }
3561
+ }
3562
+ this.hostname.length > Vs ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), x || (this.hostname = Bs.toASCII(this.hostname));
3563
+ var te = this.port ? ":" + this.port : "", re = this.hostname || "";
3564
+ this.host = re + te, this.href += this.host, x && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), s[0] !== "/" && (s = "/" + s));
3565
+ }
3566
+ if (!Ks[u])
3567
+ for (var h = 0, v = Lt.length; h < v; h++) {
3568
+ var L = Lt[h];
3569
+ if (s.indexOf(L) !== -1) {
3570
+ var V = encodeURIComponent(L);
3571
+ V === L && (V = escape(L)), s = s.split(L).join(V);
3572
+ }
3573
+ }
3574
+ var Q = s.indexOf("#");
3575
+ Q !== -1 && (this.hash = s.substr(Q), s = s.slice(0, Q));
3576
+ var Y = s.indexOf("?");
3577
+ if (Y !== -1 ? (this.search = s.substr(Y), this.query = s.substr(Y + 1), e && (this.query = Ft.parse(this.query)), s = s.slice(0, Y)) : e && (this.search = "", this.query = {}), s && (this.pathname = s), Ne[u] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
3578
+ var te = this.pathname || "", he = this.search || "";
3579
+ this.path = te + he;
3580
+ }
3581
+ return this.href = this.format(), this;
3582
+ };
3583
+ function Ds(t) {
3584
+ return typeof t == "string" && (t = Xt(t)), t instanceof ae ? t.format() : ae.prototype.format.call(t);
3585
+ }
3586
+ ae.prototype.format = function() {
3587
+ var t = this.auth || "";
3588
+ t && (t = encodeURIComponent(t), t = t.replace(/%3A/i, ":"), t += "@");
3589
+ var e = this.protocol || "", r = this.pathname || "", o = this.hash || "", i = !1, a = "";
3590
+ this.host ? i = t + this.host : this.hostname && (i = t + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (i += ":" + this.port)), this.query && typeof this.query == "object" && Object.keys(this.query).length && (a = Ft.stringify(this.query, {
3591
+ arrayFormat: "repeat",
3592
+ addQueryPrefix: !1
3593
+ }));
3594
+ var n = this.search || a && "?" + a || "";
3595
+ return e && e.substr(-1) !== ":" && (e += ":"), this.slashes || (!e || Ne[e]) && i !== !1 ? (i = "//" + (i || ""), r && r.charAt(0) !== "/" && (r = "/" + r)) : i || (i = ""), o && o.charAt(0) !== "#" && (o = "#" + o), n && n.charAt(0) !== "?" && (n = "?" + n), r = r.replace(/[?#]/g, function(s) {
3596
+ return encodeURIComponent(s);
3597
+ }), n = n.replace("#", "%23"), e + i + r + n + o;
3598
+ };
3599
+ ae.prototype.resolve = function(t) {
3600
+ return this.resolveObject(Xt(t, !1, !0)).format();
3601
+ };
3602
+ ae.prototype.resolveObject = function(t) {
3603
+ if (typeof t == "string") {
3604
+ var e = new ae();
3605
+ e.parse(t, !1, !0), t = e;
3606
+ }
3607
+ for (var r = new ae(), o = Object.keys(this), i = 0; i < o.length; i++) {
3608
+ var a = o[i];
3609
+ r[a] = this[a];
3610
+ }
3611
+ if (r.hash = t.hash, t.href === "")
3612
+ return r.href = r.format(), r;
3613
+ if (t.slashes && !t.protocol) {
3614
+ for (var n = Object.keys(t), s = 0; s < n.length; s++) {
3615
+ var l = n[s];
3616
+ l !== "protocol" && (r[l] = t[l]);
3617
+ }
3618
+ return Ne[r.protocol] && r.hostname && !r.pathname && (r.pathname = "/", r.path = r.pathname), r.href = r.format(), r;
3619
+ }
3620
+ if (t.protocol && t.protocol !== r.protocol) {
3621
+ if (!Ne[t.protocol]) {
3622
+ for (var c = Object.keys(t), u = 0; u < c.length; u++) {
3623
+ var f = c[u];
3624
+ r[f] = t[f];
3625
+ }
3626
+ return r.href = r.format(), r;
3627
+ }
3628
+ if (r.protocol = t.protocol, !t.host && !Ut[t.protocol]) {
3629
+ for (var v = (t.pathname || "").split("/"); v.length && !(t.host = v.shift()); )
3630
+ ;
3631
+ t.host || (t.host = ""), t.hostname || (t.hostname = ""), v[0] !== "" && v.unshift(""), v.length < 2 && v.unshift(""), r.pathname = v.join("/");
3632
+ } else
3633
+ r.pathname = t.pathname;
3634
+ if (r.search = t.search, r.query = t.query, r.host = t.host || "", r.auth = t.auth, r.hostname = t.hostname || t.host, r.port = t.port, r.pathname || r.search) {
3635
+ var p = r.pathname || "", h = r.search || "";
3636
+ r.path = p + h;
3637
+ }
3638
+ return r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
3639
+ }
3640
+ var y = r.pathname && r.pathname.charAt(0) === "/", g = t.host || t.pathname && t.pathname.charAt(0) === "/", b = g || y || r.host && t.pathname, x = b, m = r.pathname && r.pathname.split("/") || [], v = t.pathname && t.pathname.split("/") || [], j = r.protocol && !Ne[r.protocol];
3641
+ if (j && (r.hostname = "", r.port = null, r.host && (m[0] === "" ? m[0] = r.host : m.unshift(r.host)), r.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && (v[0] === "" ? v[0] = t.host : v.unshift(t.host)), t.host = null), b = b && (v[0] === "" || m[0] === "")), g)
3642
+ r.host = t.host || t.host === "" ? t.host : r.host, r.hostname = t.hostname || t.hostname === "" ? t.hostname : r.hostname, r.search = t.search, r.query = t.query, m = v;
3643
+ else if (v.length)
3644
+ m || (m = []), m.pop(), m = m.concat(v), r.search = t.search, r.query = t.query;
3645
+ else if (t.search != null) {
3646
+ if (j) {
3647
+ r.host = m.shift(), r.hostname = r.host;
3648
+ var w = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
3649
+ w && (r.auth = w.shift(), r.hostname = w.shift(), r.host = r.hostname);
3650
+ }
3651
+ return r.search = t.search, r.query = t.query, (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r;
3652
+ }
3653
+ if (!m.length)
3654
+ return r.pathname = null, r.search ? r.path = "/" + r.search : r.path = null, r.href = r.format(), r;
3655
+ for (var S = m.slice(-1)[0], k = (r.host || t.host || m.length > 1) && (S === "." || S === "..") || S === "", E = 0, R = m.length; R >= 0; R--)
3656
+ S = m[R], S === "." ? m.splice(R, 1) : S === ".." ? (m.splice(R, 1), E++) : E && (m.splice(R, 1), E--);
3657
+ if (!b && !x)
3658
+ for (; E--; E)
3659
+ m.unshift("..");
3660
+ b && m[0] !== "" && (!m[0] || m[0].charAt(0) !== "/") && m.unshift(""), k && m.join("/").substr(-1) !== "/" && m.push("");
3661
+ var F = m[0] === "" || m[0] && m[0].charAt(0) === "/";
3662
+ if (j) {
3663
+ r.hostname = F ? "" : m.length ? m.shift() : "", r.host = r.hostname;
3664
+ var w = r.host && r.host.indexOf("@") > 0 ? r.host.split("@") : !1;
3665
+ w && (r.auth = w.shift(), r.hostname = w.shift(), r.host = r.hostname);
3666
+ }
3667
+ return b = b || r.host && m.length, b && !F && m.unshift(""), m.length > 0 ? r.pathname = m.join("/") : (r.pathname = null, r.path = null), (r.pathname !== null || r.search !== null) && (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r;
3668
+ };
3669
+ ae.prototype.parseHost = function() {
3670
+ var t = this.host, e = zs.exec(t);
3671
+ e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
3672
+ };
3673
+ var Ys = Xt, zr = Ds, Xs = (t) => typeof t == "object" && "log" in t && typeof t.log == "object" && "entries" in t.log && Array.isArray(t.log.entries), Zs = class {
3674
+ constructor(t, e = {}) {
3675
+ this.initCalled = !1, this.entries = [], this.requests = [], this.options = {}, this.options = {
3676
+ harIsAlreadyEncoded: !1,
3677
+ ...e
3678
+ }, this.requests = [], Xs(t) ? this.entries = t.log.entries : this.entries = [
3679
+ {
3680
+ request: t
3681
+ }
3682
+ ];
3683
+ }
3684
+ init() {
3685
+ return this.initCalled = !0, this.requests = this.entries.map(({ request: t }) => {
3686
+ var r;
3687
+ const e = {
3688
+ bodySize: 0,
3689
+ headersSize: 0,
3690
+ headers: [],
3691
+ cookies: [],
3692
+ httpVersion: "HTTP/1.1",
3693
+ queryString: [],
3694
+ postData: {
3695
+ mimeType: ((r = t.postData) == null ? void 0 : r.mimeType) || "application/octet-stream"
3696
+ },
3697
+ ...t
3698
+ };
3699
+ return e.postData && !e.postData.mimeType && (e.postData.mimeType = "application/octet-stream"), this.prepare(e, this.options);
3700
+ }), this;
3701
+ }
3702
+ prepare(t, e) {
3703
+ var u, f, p;
3704
+ const r = {
3705
+ ...t,
3706
+ fullUrl: "",
3707
+ uriObj: {},
3708
+ queryObj: {},
3709
+ headersObj: {},
3710
+ cookiesObj: {},
3711
+ allHeaders: {}
3712
+ };
3713
+ if (r.queryString && r.queryString.length && (r.queryObj = r.queryString.reduce(ir, {})), r.headers && r.headers.length) {
3714
+ const h = /^HTTP\/2/;
3715
+ r.headersObj = r.headers.reduce((y, { name: g, value: b }) => {
3716
+ const x = h.exec(r.httpVersion) ? g.toLocaleLowerCase() : g;
3717
+ return {
3718
+ ...y,
3719
+ [x]: b
3720
+ };
3721
+ }, {});
3722
+ }
3723
+ r.cookies && r.cookies.length && (r.cookiesObj = r.cookies.reduceRight(
3724
+ (h, { name: y, value: g }) => ({
3725
+ ...h,
3726
+ [y]: g
3727
+ }),
3728
+ {}
3729
+ ));
3730
+ const o = (u = r.cookies) == null ? void 0 : u.map(({ name: h, value: y }) => e.harIsAlreadyEncoded ? `${h}=${y}` : `${encodeURIComponent(h)}=${encodeURIComponent(y)}`);
3731
+ switch (o != null && o.length && (r.allHeaders.cookie = o.join("; ")), r.postData.mimeType) {
3732
+ case "multipart/mixed":
3733
+ case "multipart/related":
3734
+ case "multipart/form-data":
3735
+ case "multipart/alternative":
3736
+ if (r.postData.text = "", r.postData.mimeType = "multipart/form-data", (f = r.postData) != null && f.params) {
3737
+ const h = "---011000010111000001101001", y = `${h}--`, g = `\r
3738
+ `, b = (j) => j.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"), x = (j) => j.replace(/\r?\n|\r/g, `\r
3739
+ `), m = [`--${h}`];
3740
+ (p = r.postData) == null || p.params.forEach((j, w) => {
3741
+ const S = j.name, k = j.value || "", E = j.fileName || null, R = j.contentType || "application/octet-stream";
3742
+ E ? (m.push(
3743
+ `Content-Disposition: form-data; name="${b(x(S))}"; filename="${E}"`
3744
+ ), m.push(`Content-Type: ${R}`)) : m.push(`Content-Disposition: form-data; name="${b(x(S))}"`), m.push(""), m.push(x(k)), w !== r.postData.params.length - 1 && m.push(`--${h}`);
3745
+ }), m.push(`--${y}`), r.postData.boundary = h, r.postData.text = m.join(g);
3746
+ const v = J(r.headersObj, "content-type") || "content-type";
3747
+ r.headersObj[v] = `multipart/form-data; boundary=${h}`;
3748
+ }
3749
+ break;
3750
+ case "application/x-www-form-urlencoded":
3751
+ r.postData.params ? (r.postData.paramsObj = r.postData.params.reduce(ir, {}), r.postData.text = nt.stringify(r.postData.paramsObj)) : r.postData.text = "";
3752
+ break;
3753
+ case "text/json":
3754
+ case "text/x-json":
3755
+ case "application/json":
3756
+ case "application/x-json":
3757
+ if (r.postData.mimeType = "application/json", r.postData.text)
3758
+ try {
3759
+ r.postData.jsonObj = JSON.parse(r.postData.text);
3760
+ } catch {
3761
+ r.postData.mimeType = "text/plain";
3762
+ }
3763
+ break;
3764
+ }
3765
+ const i = {
3766
+ ...r.allHeaders,
3767
+ ...r.headersObj
3768
+ }, a = Ys(r.url, !0, !0);
3769
+ r.queryObj = {
3770
+ ...r.queryObj,
3771
+ ...a.query
3772
+ };
3773
+ let n;
3774
+ e.harIsAlreadyEncoded ? n = nt.stringify(r.queryObj, {
3775
+ encode: !1,
3776
+ indices: !1
3777
+ }) : n = nt.stringify(r.queryObj, {
3778
+ indices: !1
3779
+ });
3780
+ const s = {
3781
+ ...a,
3782
+ query: r.queryObj,
3783
+ search: n,
3784
+ path: n ? `${a.pathname}?${n}` : a.pathname
3785
+ }, l = zr({
3786
+ ...a,
3787
+ query: null,
3788
+ search: null
3789
+ }), c = zr({
3790
+ ...a,
3791
+ ...s
3792
+ });
3793
+ return {
3794
+ ...r,
3795
+ allHeaders: i,
3796
+ fullUrl: c,
3797
+ url: l,
3798
+ uriObj: s
3799
+ };
3800
+ }
3801
+ convert(t, e, r) {
3802
+ this.initCalled || this.init(), !r && e && (r = e);
3803
+ const o = Sa[t];
3804
+ if (!o)
3805
+ return !1;
3806
+ const { convert: i } = o.clientsById[e || o.info.default];
3807
+ return this.requests.map((n) => i(n, r));
3808
+ }
3809
+ };
3810
+ const el = ({
3811
+ rootMargin: t = "0px",
3812
+ threshold: e
3813
+ } = {}) => {
3814
+ const [r, o] = ve(!1), i = Vr(null);
3815
+ return Qr(() => {
3816
+ const a = new IntersectionObserver(
3817
+ ([s]) => {
3818
+ s && o(s.isIntersecting);
3819
+ },
3820
+ { rootMargin: t, threshold: e }
3821
+ ), n = i.current;
3822
+ if (n)
3823
+ return a.observe(n), () => a.unobserve(n);
3824
+ }, [t, e]), [i, r];
3825
+ }, tl = ee.Root, Wr = ee.CollapsibleTrigger, rl = ee.CollapsibleContent, nl = typeof window < "u" ? Un : Qr, Zt = ({
3826
+ children: t,
3827
+ maxHeight: e = 250
3828
+ }) => {
3829
+ const r = Vr(null), [o, i] = ve(!1), [a, n] = ve(!1);
3830
+ return nl(() => {
3831
+ const s = r.current;
3832
+ if (!s) return;
3833
+ i(s.scrollHeight > e);
3834
+ const l = new ResizeObserver(() => {
3835
+ i(s.scrollHeight > e);
3836
+ });
3837
+ return l.observe(s), () => l.disconnect();
3838
+ }, [e]), /* @__PURE__ */ d.jsxs(
3839
+ tl,
3840
+ {
3841
+ className: "group",
3842
+ open: a,
3843
+ onOpenChange: n,
3844
+ style: { "--max-height": `${e}px` },
3845
+ children: [
3846
+ /* @__PURE__ */ d.jsxs(
3847
+ rl,
3848
+ {
3849
+ forceMount: !0,
3850
+ className: D(
3851
+ "relative overflow-hidden",
3852
+ !a && o && "max-h-[--max-height]"
3853
+ ),
3854
+ children: [
3855
+ !a && o && /* @__PURE__ */ d.jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-transparent to-zinc-50/90 dark:to-zinc-800/90 z-10" }),
3856
+ /* @__PURE__ */ d.jsx("div", { ref: r, children: t }),
3857
+ !a && o && /* @__PURE__ */ d.jsx(
3858
+ Wr,
3859
+ {
3860
+ className: "absolute inset-0 grid place-items-center z-10",
3861
+ asChild: !0,
3862
+ children: /* @__PURE__ */ d.jsx("div", { children: /* @__PURE__ */ d.jsx(or, { className: "bg-primary/70 border border-accent-foreground/25", children: "Expand code" }) })
3863
+ }
3864
+ )
3865
+ ]
3866
+ }
3867
+ ),
3868
+ o && /* @__PURE__ */ d.jsx(
3869
+ "div",
3870
+ {
3871
+ className: D("flex justify-center w-full mb-2", !a && "hidden"),
3872
+ children: /* @__PURE__ */ d.jsx(Wr, { asChild: !0, children: /* @__PURE__ */ d.jsx(or, { className: "border border-accent-foreground/25", children: "Collapse code" }) })
3873
+ }
3874
+ )
3875
+ ]
3876
+ }
3877
+ );
3878
+ }, ol = ({
3879
+ server: t,
3880
+ servers: e,
3881
+ operation: r
3882
+ }) => {
3883
+ var n, s, l;
3884
+ const o = (n = r.parameters) == null ? void 0 : n.filter((c) => c.in === "header").map((c) => {
3885
+ var u, f;
3886
+ return {
3887
+ name: c.name,
3888
+ defaultValue: ((f = (u = c.examples) == null ? void 0 : u.find((p) => p.value)) == null ? void 0 : f.value) ?? ""
3889
+ };
3890
+ }), i = (s = r.parameters) == null ? void 0 : s.filter((c) => c.in === "query").sort((c, u) => c.required && !u.required ? -1 : 1).map((c) => ({
3891
+ name: c.name,
3892
+ defaultActive: c.required ?? !1,
3893
+ isRequired: c.required ?? !1
3894
+ })), a = (l = r.parameters) == null ? void 0 : l.filter((c) => c.in === "path").map((c) => ({ name: c.name }));
3895
+ return /* @__PURE__ */ d.jsx(
3896
+ Mn,
3897
+ {
3898
+ server: t,
3899
+ servers: e,
3900
+ method: r.method,
3901
+ url: r.path,
3902
+ headers: o,
3903
+ queryParams: i,
3904
+ pathParams: a
3905
+ }
3906
+ );
3907
+ }, er = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3908
+ "div",
3909
+ {
3910
+ className: D(
3911
+ "rounded-lg overflow-hidden border dark:border-transparent",
3912
+ e
3913
+ ),
3914
+ children: t
3915
+ }
3916
+ ), tr = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3917
+ "div",
3918
+ {
3919
+ className: D(
3920
+ "border-b dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
3921
+ e
3922
+ ),
3923
+ children: t
3924
+ }
3925
+ ), rr = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3926
+ "div",
3927
+ {
3928
+ className: D("bg-zinc-50 dark:bg-zinc-800 overflow-auto p-2", e),
3929
+ children: t
3930
+ }
3931
+ ), Sn = ({ children: t, className: e }) => /* @__PURE__ */ d.jsx(
3932
+ "div",
3933
+ {
3934
+ className: D(
3935
+ "border-t dark:border-zinc-600 bg-zinc-100 dark:bg-zinc-700 p-2",
3936
+ e
3937
+ ),
3938
+ children: t
3939
+ }
3940
+ ), Re = (t, e) => {
3941
+ if (t.example !== void 0)
3942
+ return t.example;
3943
+ if (t.examples)
3944
+ return Object.values(t.examples)[0];
3945
+ if (t.default !== void 0)
3946
+ return t.default;
3947
+ if (t.properties || t.type === "object") {
3948
+ const r = {};
3949
+ if (t.properties)
3950
+ for (const [o, i] of Object.entries(t.properties))
3951
+ r[o] = Re(i, o);
3952
+ return r;
3953
+ }
3954
+ if (t.type === "array")
3955
+ return Array.isArray(t.items) ? t.items.map(
3956
+ (r) => Re(r)
3957
+ ) : t.items ? [Re(t.items)] : [];
3958
+ if (t.enum)
3959
+ return t.enum[0];
3960
+ switch (t.type) {
3961
+ case "string":
3962
+ return e || "string";
3963
+ case "number":
3964
+ case "integer":
3965
+ return 0;
3966
+ case "boolean":
3967
+ return !0;
3968
+ case "null":
3969
+ return null;
3970
+ case void 0:
3971
+ default:
3972
+ return {};
3973
+ }
3974
+ }, al = ({ content: t }) => {
3975
+ var o, i;
3976
+ if (!t.length) return null;
3977
+ const e = t.at(0), r = ((i = (o = e == null ? void 0 : e.examples) == null ? void 0 : o.at(0)) == null ? void 0 : i.value) ?? (e != null && e.schema ? Re(e.schema) : "");
3978
+ return /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs(er, { children: [
3979
+ /* @__PURE__ */ d.jsx(tr, { className: "text-xs flex justify-between items-center", children: /* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Request Body Example" }) }),
3980
+ /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
3981
+ Mt,
3982
+ {
3983
+ language: r ? "json" : "plain",
3984
+ noBackground: !0,
3985
+ copyable: !0,
3986
+ className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
3987
+ code: r ? JSON.stringify(r, null, 2) : "No example"
3988
+ }
3989
+ ) }) })
3990
+ ] }) });
3991
+ }, il = ({
3992
+ responses: t,
3993
+ selectedResponse: e,
3994
+ onSelectResponse: r
3995
+ }) => {
3996
+ var o;
3997
+ return /* @__PURE__ */ d.jsx(er, { children: /* @__PURE__ */ d.jsxs(
3998
+ De.Root,
3999
+ {
4000
+ defaultValue: (o = t[0]) == null ? void 0 : o.statusCode,
4001
+ value: e,
4002
+ onValueChange: (i) => r(i),
4003
+ children: [
4004
+ /* @__PURE__ */ d.jsxs(tr, { className: "text-xs flex flex-col gap-2 pb-0", children: [
4005
+ /* @__PURE__ */ d.jsx("span", { className: "font-mono", children: "Example Responses" }),
4006
+ /* @__PURE__ */ d.jsx(De.List, { className: "flex gap-2", children: t.map((i) => /* @__PURE__ */ d.jsx(
4007
+ De.Trigger,
4008
+ {
4009
+ value: i.statusCode,
4010
+ className: D(
4011
+ "text-xs font-mono px-1.5 py-1 pb-px translate-y-px border-b-2 border-transparent rounded-t cursor-pointer",
4012
+ "data-[state=active]:text-primary data-[state=active]:dark:text-inherit data-[state=active]:border-primary",
4013
+ "hover:border-accent-foreground/25"
4014
+ ),
4015
+ children: i.statusCode
4016
+ },
4017
+ i.statusCode
4018
+ )) })
4019
+ ] }),
4020
+ t.map((i) => {
4021
+ var s, l, c;
4022
+ const a = (s = i.content) == null ? void 0 : s.at(0), n = ((c = (l = a == null ? void 0 : a.examples) == null ? void 0 : l.at(0)) == null ? void 0 : c.value) ?? (a != null && a.schema ? Re(a.schema) : "");
4023
+ return /* @__PURE__ */ d.jsxs(De.Content, { value: i.statusCode, children: [
4024
+ /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
4025
+ Mt,
4026
+ {
4027
+ language: n ? "json" : "plain",
4028
+ noBackground: !0,
4029
+ className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
4030
+ code: n ? JSON.stringify(n, null, 2) : "Empty response"
4031
+ }
4032
+ ) }) }),
4033
+ /* @__PURE__ */ d.jsx(Sn, { className: "flex justify-end text-xs", children: i.description })
4034
+ ] }, i.statusCode);
4035
+ })
4036
+ ]
4037
+ }
4038
+ ) });
4039
+ }, sl = (t, e) => {
4040
+ let r;
4041
+ switch (e) {
4042
+ case "shell":
4043
+ r = t.convert("shell", "curl");
4044
+ break;
4045
+ case "js":
4046
+ r = t.convert("javascript", "fetch");
4047
+ break;
4048
+ case "python":
4049
+ r = t.convert("python", "requests");
4050
+ break;
4051
+ case "java":
4052
+ r = t.convert("java", "okhttp");
4053
+ break;
4054
+ case "go":
4055
+ r = t.convert("go", "native");
4056
+ break;
4057
+ case "csharp":
4058
+ r = t.convert("csharp", "httpclient");
4059
+ break;
4060
+ case "kotlin":
4061
+ r = t.convert("kotlin", "okhttp");
4062
+ break;
4063
+ case "objc":
4064
+ r = t.convert("objc", "nsurlsession");
4065
+ break;
4066
+ case "php":
4067
+ r = t.convert("php", "http2");
4068
+ break;
4069
+ case "ruby":
4070
+ r = t.convert("ruby");
4071
+ break;
4072
+ case "swift":
4073
+ r = t.convert("swift");
4074
+ break;
4075
+ default:
4076
+ r = t.convert("shell");
4077
+ break;
4078
+ }
4079
+ return r ? r[0] : "";
4080
+ }, ll = ut(
4081
+ /* GraphQL */
4082
+ `
4083
+ query getServerQuery($input: JSON!, $type: SchemaType!) {
4084
+ schema(input: $input, type: $type) {
4085
+ url
4086
+ servers {
4087
+ url
4088
+ }
4089
+ }
4090
+ }
4091
+ `
4092
+ ), cl = {
4093
+ get: fe.green,
4094
+ post: fe.blue,
4095
+ put: fe.yellow,
4096
+ delete: fe.red,
4097
+ patch: fe.purple,
4098
+ options: fe.indigo,
4099
+ head: fe.gray,
4100
+ trace: fe.gray
4101
+ }, ul = [
4102
+ { value: "shell", label: "cURL" },
4103
+ { value: "js", label: "JavaScript" },
4104
+ { value: "python", label: "Python" },
4105
+ { value: "java", label: "Java" },
4106
+ { value: "go", label: "Go" },
4107
+ { value: "csharp", label: "C#" },
4108
+ { value: "kotlin", label: "Kotlin" },
4109
+ { value: "objc", label: "Objective-C" },
4110
+ { value: "php", label: "PHP" },
4111
+ { value: "ruby", label: "Ruby" },
4112
+ { value: "swift", label: "Swift" }
4113
+ ], pl = ({
4114
+ operation: t,
4115
+ selectedResponse: e,
4116
+ onSelectResponse: r
4117
+ }) => {
4118
+ var m;
4119
+ const { input: o, type: i } = Bt(), a = zt(ll, { input: o, type: i }), n = Ht(a), s = cl[t.method.toLocaleLowerCase()] ?? fe.gray, [l, c] = eo(), [, u] = Gr(), f = l.get("lang") ?? "shell", p = (m = t.requestBody) == null ? void 0 : m.content, h = t.path.split("/").map((v, j, w) => {
4120
+ const k = v.startsWith("{") && v.endsWith("}") || v.startsWith(":") ? v.replace(/[:{}]/g, "") : void 0;
4121
+ return (
4122
+ // eslint-disable-next-line react/no-array-index-key
4123
+ /* @__PURE__ */ d.jsxs(Fn, { children: [
4124
+ k ? /* @__PURE__ */ d.jsx(
4125
+ Xr,
4126
+ {
4127
+ name: k,
4128
+ backgroundOpacity: "0",
4129
+ slug: `${t.slug}-${k.toLocaleLowerCase()}`,
4130
+ children: v
4131
+ }
4132
+ ) : v,
4133
+ j < w.length - 1 ? "/" : null,
4134
+ /* @__PURE__ */ d.jsx("wbr", {})
4135
+ ] }, v + j)
4136
+ );
4137
+ }), { selectedServer: y } = Kr(), g = Jr(() => {
4138
+ var w;
4139
+ const v = (w = p == null ? void 0 : p[0]) != null && w.schema ? Re(p[0].schema) : void 0, j = new Zs({
4140
+ method: t.method.toLocaleUpperCase(),
4141
+ url: (y ?? n.data.schema.url ?? "") + t.path.replaceAll("{", ":").replaceAll("}", ""),
4142
+ postData: v ? {
4143
+ text: JSON.stringify(v, null, 2),
4144
+ mimeType: "application/json"
4145
+ } : {},
4146
+ headers: [],
4147
+ queryString: [],
4148
+ httpVersion: "",
4149
+ cookies: [],
4150
+ headersSize: 0,
4151
+ bodySize: 0
4152
+ });
4153
+ return sl(j, f);
4154
+ }, [
4155
+ p,
4156
+ t.method,
4157
+ t.path,
4158
+ y,
4159
+ n.data.schema.url,
4160
+ f
4161
+ ]), [b, x] = el({ rootMargin: "200px 0px 200px 0px" });
4162
+ return /* @__PURE__ */ d.jsxs(
4163
+ "aside",
4164
+ {
4165
+ ref: b,
4166
+ className: "flex flex-col overflow-hidden sticky top-[--scroll-padding] gap-4",
4167
+ children: [
4168
+ /* @__PURE__ */ d.jsxs(er, { children: [
4169
+ /* @__PURE__ */ d.jsxs(tr, { className: "flex justify-between items-center flex-nowrap py-3 gap-2 text-xs", children: [
4170
+ /* @__PURE__ */ d.jsxs("span", { className: "font-mono break-words", children: [
4171
+ /* @__PURE__ */ d.jsx("span", { className: D("font-semibold", s), children: t.method.toLocaleUpperCase() }),
4172
+ " ",
4173
+ h
4174
+ ] }),
4175
+ x && /* @__PURE__ */ d.jsx(
4176
+ ol,
4177
+ {
4178
+ server: n.data.schema.url ?? "",
4179
+ servers: n.data.schema.servers.map((v) => v.url) ?? [],
4180
+ operation: t
4181
+ }
4182
+ )
4183
+ ] }),
4184
+ x && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
4185
+ /* @__PURE__ */ d.jsx(rr, { className: "p-0", children: /* @__PURE__ */ d.jsx(Zt, { children: /* @__PURE__ */ d.jsx(
4186
+ Mt,
4187
+ {
4188
+ language: f,
4189
+ noBackground: !0,
4190
+ className: "[--scrollbar-color:gray] text-xs max-h-[500px] p-2",
4191
+ code: g
4192
+ }
4193
+ ) }) }),
4194
+ /* @__PURE__ */ d.jsxs(Sn, { className: "flex items-center text-xs gap-2 justify-end py-1", children: [
4195
+ /* @__PURE__ */ d.jsx("span", { children: "Show example in" }),
4196
+ /* @__PURE__ */ d.jsx(
4197
+ Yr,
4198
+ {
4199
+ className: "self-start max-w-[150px]",
4200
+ value: f,
4201
+ onChange: (v) => {
4202
+ u(() => {
4203
+ c((j) => (j.set("lang", v.target.value), j));
4204
+ });
4205
+ },
4206
+ options: ul
4207
+ }
4208
+ )
4209
+ ] })
4210
+ ] })
4211
+ ] }),
4212
+ x && p && /* @__PURE__ */ d.jsx(al, { content: p }),
4213
+ x && t.responses.length > 0 && /* @__PURE__ */ d.jsx(
4214
+ il,
4215
+ {
4216
+ selectedResponse: e,
4217
+ onSelectResponse: r,
4218
+ responses: t.responses
4219
+ }
4220
+ )
4221
+ ]
4222
+ }
4223
+ );
4224
+ }, fl = (t) => Object.entries(t), dl = {
4225
+ AND: /* @__PURE__ */ d.jsx(En, { size: 16, className: "fill-card" }),
4226
+ OR: /* @__PURE__ */ d.jsx(Nn, { size: 16, className: "fill-card" }),
4227
+ ONE: /* @__PURE__ */ d.jsx(Rn, { size: 14, className: "fill-card" })
4228
+ }, hl = {
4229
+ AND: "text-green-500 dark:text-green-300/60",
4230
+ OR: "text-blue-400 dark:text-blue-500",
4231
+ ONE: "text-purple-500 dark:text-purple-300/60"
4232
+ }, yl = ({
4233
+ type: t,
4234
+ isOpen: e,
4235
+ className: r
4236
+ }) => /* @__PURE__ */ d.jsx(
4237
+ "div",
4238
+ {
4239
+ className: D(
4240
+ hl[t],
4241
+ "relative text-sm flex py-2",
4242
+ "before:border-l before:absolute before:-top-2 before:-bottom-2 before:border-border before:border-dashed before:content-['']",
4243
+ r
4244
+ ),
4245
+ children: /* @__PURE__ */ d.jsxs("div", { className: "-translate-x-[7px] flex gap-1 items-center", children: [
4246
+ dl[t],
4247
+ /* @__PURE__ */ d.jsx(
4248
+ "div",
4249
+ {
4250
+ className: D(
4251
+ "translate-y-px mx-px opacity-0 group-hover:opacity-100 transition",
4252
+ !e && "-rotate-90"
4253
+ ),
4254
+ children: /* @__PURE__ */ d.jsx(kn, { size: 16 })
4255
+ }
4256
+ )
4257
+ ] })
4258
+ }
4259
+ ), ml = (t) => {
4260
+ const [e, r] = ve(!0);
4261
+ return /* @__PURE__ */ d.jsxs(
4262
+ ee.Root,
4263
+ {
4264
+ open: e,
4265
+ onOpenChange: () => r((o) => !o),
4266
+ className: "group",
4267
+ children: [
4268
+ /* @__PURE__ */ d.jsx(ee.Trigger, { children: /* @__PURE__ */ d.jsx(yl, { type: t.type, isOpen: e }) }),
4269
+ !e && /* @__PURE__ */ d.jsx("div", { className: "wavy-line bg-border translate-y-1" }),
4270
+ /* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx(Ge, { schema: t.schema, level: t.level + 1 }) })
4271
+ ]
4272
+ }
4273
+ );
4274
+ }, gl = {
4275
+ AND: "All of",
4276
+ OR: "Any of",
4277
+ ONE: "One of"
4278
+ }, bl = ({
4279
+ schemas: t,
4280
+ type: e,
4281
+ isOpen: r,
4282
+ level: o,
4283
+ toggleOpen: i
4284
+ }) => /* @__PURE__ */ d.jsx(ee.Root, { open: r, onOpenChange: i, asChild: !0, children: /* @__PURE__ */ d.jsxs(de, { className: "px-6", children: [
4285
+ /* @__PURE__ */ d.jsxs(ee.Trigger, { className: "flex gap-2 items-center py-2 w-full text-sm text-muted-foreground -translate-x-1.5", children: [
4286
+ r ? /* @__PURE__ */ d.jsx(An, { size: 14 }) : /* @__PURE__ */ d.jsx(qn, { size: 14 }),
4287
+ /* @__PURE__ */ d.jsx("span", { children: gl[e] })
4288
+ ] }),
4289
+ /* @__PURE__ */ d.jsx(ee.Content, { className: "pb-4", children: t.map((a, n) => (
4290
+ // eslint-disable-next-line react/no-array-index-key
4291
+ /* @__PURE__ */ d.jsx(
4292
+ ml,
4293
+ {
4294
+ type: e,
4295
+ schema: a,
4296
+ level: o
4297
+ },
4298
+ n
4299
+ )
4300
+ )) })
4301
+ ] }) }), vl = (t) => t.type === "object" || t.type === "array" && typeof t.items == "object" && (!t.items.type || t.items.type === "object"), _t = (t) => !!(t.oneOf ?? t.allOf ?? t.anyOf), xl = {
4302
+ allOf: "AND",
4303
+ anyOf: "OR",
4304
+ oneOf: "ONE"
4305
+ }, On = ({
4306
+ schema: t,
4307
+ level: e
4308
+ }) => {
4309
+ const [r, o] = ve(!0), i = _n(() => o((a) => !a), []);
4310
+ for (const [a, n] of fl(xl))
4311
+ if (t[a])
4312
+ return /* @__PURE__ */ d.jsx(
4313
+ bl,
4314
+ {
4315
+ schemas: t[a],
4316
+ type: n,
4317
+ isOpen: r,
4318
+ toggleOpen: i,
4319
+ level: e
4320
+ }
4321
+ );
4322
+ }, $l = ({
4323
+ name: t,
4324
+ schema: e,
4325
+ group: r,
4326
+ level: o,
4327
+ defaultOpen: i = !1,
4328
+ showCollapseButton: a = !0
4329
+ }) => {
4330
+ const [n, s] = ve(i);
4331
+ return /* @__PURE__ */ d.jsx("li", { className: "p-4 bg-border/20 hover:bg-border/30", children: /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col gap-1 justify-between text-sm", children: [
4332
+ /* @__PURE__ */ d.jsxs("div", { className: "flex gap-2 items-center", children: [
4333
+ /* @__PURE__ */ d.jsx("code", { children: t }),
4334
+ /* @__PURE__ */ d.jsx("span", { className: "text-muted-foreground", children: e.type === "array" && e.items.type ? /* @__PURE__ */ d.jsxs("span", { children: [
4335
+ e.items.type,
4336
+ "[]"
4337
+ ] }) : Array.isArray(e.type) ? /* @__PURE__ */ d.jsx("span", { children: e.type.join(" | ") }) : /* @__PURE__ */ d.jsx("span", { children: e.type }) }),
4338
+ r === "optional" && /* @__PURE__ */ d.jsx("span", { className: "py-px px-1.5 font-medium border rounded-lg", children: "optional" })
4339
+ ] }),
4340
+ e.description && /* @__PURE__ */ d.jsx(
4341
+ be,
4342
+ {
4343
+ className: D(je, "text-sm leading-normal line-clamp-4"),
4344
+ content: e.description
4345
+ }
4346
+ ),
4347
+ (_t(e) || vl(e)) && /* @__PURE__ */ d.jsxs(
4348
+ ee.Root,
4349
+ {
4350
+ defaultOpen: i,
4351
+ open: n,
4352
+ onOpenChange: () => s(!n),
4353
+ children: [
4354
+ a && /* @__PURE__ */ d.jsx(ee.Trigger, { asChild: !0, children: /* @__PURE__ */ d.jsxs(
4355
+ Dr,
4356
+ {
4357
+ variant: "outline",
4358
+ size: "sm",
4359
+ className: "mt-2 flex gap-1.5",
4360
+ children: [
4361
+ /* @__PURE__ */ d.jsx(In, { size: 18 }),
4362
+ n ? "Hide nested properties" : "Show nested properties"
4363
+ ]
4364
+ }
4365
+ ) }),
4366
+ /* @__PURE__ */ d.jsx(ee.Content, { children: /* @__PURE__ */ d.jsx("div", { className: "mt-2", children: _t(e) ? /* @__PURE__ */ d.jsx(On, { schema: e, level: o + 1 }) : e.type === "object" ? /* @__PURE__ */ d.jsx(Ge, { schema: e, level: o + 1 }) : e.type === "array" && typeof e.items == "object" && /* @__PURE__ */ d.jsx(Ge, { schema: e.items, level: o + 1 }) }) })
4367
+ ]
4368
+ }
4369
+ )
4370
+ ] }) });
4371
+ }, Ge = ({
4372
+ schema: t,
4373
+ level: e = 0,
4374
+ defaultOpen: r = !1
4375
+ }) => {
4376
+ if (!t || Object.keys(t).length === 0)
4377
+ return /* @__PURE__ */ d.jsx(de, { className: "p-4", children: /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground italic", children: "No response specified" }) });
4378
+ const o = (i, a) => {
4379
+ if (_t(i))
4380
+ return /* @__PURE__ */ d.jsx(On, { schema: i, level: a });
4381
+ if (i.type === "array" && i.items) {
4382
+ const n = i.items;
4383
+ return typeof n.type == "string" && ["string", "number", "boolean", "integer"].includes(n.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
4384
+ /* @__PURE__ */ d.jsxs("span", { className: "text-sm text-muted-foreground", children: [
4385
+ n.type,
4386
+ "[]"
4387
+ ] }),
4388
+ i.description && /* @__PURE__ */ d.jsx(
4389
+ be,
4390
+ {
4391
+ className: D(
4392
+ je,
4393
+ "text-sm leading-normal line-clamp-4"
4394
+ ),
4395
+ content: i.description
4396
+ }
4397
+ )
4398
+ ] }) : n.type === "object" ? /* @__PURE__ */ d.jsxs(de, { className: "flex flex-col gap-2 bg-border/30 p-4", children: [
4399
+ /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: "object[]" }),
4400
+ o(n, a + 1)
4401
+ ] }) : o(n, a + 1);
4402
+ }
4403
+ if (i.type === "object" && (!i.properties || Object.keys(i.properties).length === 0))
4404
+ return /* @__PURE__ */ d.jsxs(de, { className: "p-4 flex gap-2 items-center", children: [
4405
+ "name" in i && /* @__PURE__ */ d.jsx(d.Fragment, { children: i.name }),
4406
+ /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: "object" }),
4407
+ i.description && /* @__PURE__ */ d.jsx(
4408
+ be,
4409
+ {
4410
+ className: D(
4411
+ je,
4412
+ "text-sm leading-normal line-clamp-4"
4413
+ ),
4414
+ content: i.description
4415
+ }
4416
+ )
4417
+ ] });
4418
+ if (i.properties) {
4419
+ const n = Zr(
4420
+ Object.entries(i.properties),
4421
+ ([l, c]) => {
4422
+ var u;
4423
+ return c.deprecated ? "deprecated" : (u = i.required) != null && u.includes(l) ? "required" : "optional";
4424
+ }
4425
+ ), s = ["required", "optional", "deprecated"];
4426
+ return /* @__PURE__ */ d.jsx(de, { className: "divide-y overflow-hidden", children: s.map(
4427
+ (l) => n[l] && /* @__PURE__ */ d.jsx("ul", { className: "divide-y", children: n[l].map(([c, u]) => /* @__PURE__ */ d.jsx(
4428
+ $l,
4429
+ {
4430
+ name: c,
4431
+ schema: u,
4432
+ group: l,
4433
+ level: a,
4434
+ defaultOpen: r
4435
+ },
4436
+ c
4437
+ )) }, l)
4438
+ ) });
4439
+ }
4440
+ return typeof i.type == "string" && ["string", "number", "boolean", "integer", "null"].includes(i.type) ? /* @__PURE__ */ d.jsxs(de, { className: "p-4", children: [
4441
+ /* @__PURE__ */ d.jsx("span", { className: "text-sm text-muted-foreground", children: i.type }),
4442
+ i.description && /* @__PURE__ */ d.jsx(
4443
+ be,
4444
+ {
4445
+ className: D(
4446
+ je,
4447
+ "text-sm leading-normal line-clamp-4"
4448
+ ),
4449
+ content: i.description
4450
+ }
4451
+ )
4452
+ ] }) : i.additionalProperties ? /* @__PURE__ */ d.jsxs(de, { className: "my-2", children: [
4453
+ /* @__PURE__ */ d.jsx(Qn, { children: /* @__PURE__ */ d.jsx(Kn, { children: "Additional Properties:" }) }),
4454
+ /* @__PURE__ */ d.jsx(Dn, { children: o(
4455
+ i.additionalProperties,
4456
+ a + 1
4457
+ ) })
4458
+ ] }) : null;
4459
+ };
4460
+ return o(t, e);
4461
+ }, wl = ["path", "query", "header", "cookie"], jl = ({
4462
+ operationFragment: t
4463
+ }) => {
4464
+ var n, s, l;
4465
+ const e = to(Sl, t), r = Zr(
4466
+ e.parameters ?? [],
4467
+ (c) => c.in
4468
+ ), o = e.responses.at(0), [i, a] = ve(o == null ? void 0 : o.statusCode);
4469
+ return /* @__PURE__ */ d.jsxs(
4470
+ "div",
4471
+ {
4472
+ className: "grid grid-cols-1 lg:grid-cols-[4fr_3fr] gap-8 items-start border-b-2 mb-16 pb-16",
4473
+ children: [
4474
+ /* @__PURE__ */ d.jsxs("div", { className: "flex flex-col gap-4", children: [
4475
+ /* @__PURE__ */ d.jsx(_e, { level: 2, id: e.slug, registerSidebarAnchor: !0, children: e.summary }),
4476
+ e.description && /* @__PURE__ */ d.jsx(
4477
+ be,
4478
+ {
4479
+ className: `${je} max-w-full prose-img:max-w-prose`,
4480
+ content: e.description
4481
+ }
4482
+ ),
4483
+ e.parameters && e.parameters.length > 0 && /* @__PURE__ */ d.jsx(d.Fragment, { children: wl.flatMap(
4484
+ (c) => {
4485
+ var u;
4486
+ return (u = r[c]) != null && u.length ? /* @__PURE__ */ d.jsx(
4487
+ so,
4488
+ {
4489
+ id: e.slug,
4490
+ parameters: r[c],
4491
+ group: c
4492
+ },
4493
+ c
4494
+ ) : [];
4495
+ }
4496
+ ) }),
4497
+ oo((l = (s = (n = e.requestBody) == null ? void 0 : n.content) == null ? void 0 : s.at(0)) == null ? void 0 : l.schema, (c) => /* @__PURE__ */ d.jsxs("div", { className: "mt-4 flex flex-col gap-4", children: [
4498
+ /* @__PURE__ */ d.jsx(
4499
+ _e,
4500
+ {
4501
+ level: 3,
4502
+ className: "capitalize",
4503
+ id: `${e.slug}/request-body`,
4504
+ registerSidebarAnchor: !0,
4505
+ children: "Request Body"
4506
+ }
4507
+ ),
4508
+ /* @__PURE__ */ d.jsx(Ge, { schema: c })
4509
+ ] })),
4510
+ e.responses.length > 0 && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
4511
+ /* @__PURE__ */ d.jsx(
4512
+ _e,
4513
+ {
4514
+ level: 3,
4515
+ className: "capitalize mt-8 pt-8 border-t",
4516
+ id: `${e.slug}/responses`,
4517
+ registerSidebarAnchor: !0,
4518
+ children: "Responses"
4519
+ }
4520
+ ),
4521
+ /* @__PURE__ */ d.jsxs(
4522
+ zn,
4523
+ {
4524
+ onValueChange: (c) => a(c),
4525
+ value: i,
4526
+ children: [
4527
+ e.responses.length > 1 && /* @__PURE__ */ d.jsx(Wn, { children: e.responses.map((c) => /* @__PURE__ */ d.jsx(
4528
+ Jn,
4529
+ {
4530
+ value: c.statusCode,
4531
+ title: c.description ?? void 0,
4532
+ children: c.statusCode
4533
+ },
4534
+ c.statusCode
4535
+ )) }),
4536
+ /* @__PURE__ */ d.jsx("ul", { className: "list-none m-0 px-0", children: e.responses.map((c) => {
4537
+ var u, f;
4538
+ return /* @__PURE__ */ d.jsx(
4539
+ Gn,
4540
+ {
4541
+ value: c.statusCode,
4542
+ children: /* @__PURE__ */ d.jsx(
4543
+ Ge,
4544
+ {
4545
+ schema: (f = (u = c.content) == null ? void 0 : u.find((p) => p.schema)) == null ? void 0 : f.schema
4546
+ }
4547
+ )
4548
+ },
4549
+ c.statusCode
4550
+ );
4551
+ }) })
4552
+ ]
4553
+ }
4554
+ )
4555
+ ] })
4556
+ ] }),
4557
+ /* @__PURE__ */ d.jsx(
4558
+ pl,
4559
+ {
4560
+ selectedResponse: i,
4561
+ onSelectResponse: a,
4562
+ operation: e
4563
+ }
4564
+ )
4565
+ ]
4566
+ },
4567
+ e.operationId
4568
+ );
4569
+ }, Sl = ut(
4570
+ /* GraphQL */
4571
+ `
4572
+ fragment OperationsFragment on OperationItem {
4573
+ slug
4574
+ summary
4575
+ method
4576
+ description
4577
+ operationId
4578
+ contentTypes
4579
+ path
4580
+ parameters {
4581
+ name
4582
+ in
4583
+ description
4584
+ required
4585
+ schema
4586
+ style
4587
+ examples {
4588
+ name
4589
+ description
4590
+ externalValue
4591
+ value
4592
+ summary
4593
+ }
4594
+ }
4595
+ requestBody {
4596
+ content {
4597
+ mediaType
4598
+ encoding {
4599
+ name
4600
+ }
4601
+ examples {
4602
+ name
4603
+ description
4604
+ externalValue
4605
+ value
4606
+ summary
4607
+ }
4608
+ schema
4609
+ }
4610
+ description
4611
+ required
4612
+ }
4613
+ responses {
4614
+ statusCode
4615
+ links
4616
+ description
4617
+ content {
4618
+ examples {
4619
+ name
4620
+ description
4621
+ externalValue
4622
+ value
4623
+ summary
4624
+ }
4625
+ mediaType
4626
+ encoding {
4627
+ name
4628
+ }
4629
+ schema
4630
+ }
4631
+ }
4632
+ }
4633
+ `
4634
+ ), Ol = ut(
4635
+ /* GraphQL */
4636
+ `
4637
+ query AllOperations($input: JSON!, $type: SchemaType!) {
4638
+ schema(input: $input, type: $type) {
4639
+ description
4640
+ title
4641
+ url
4642
+ version
4643
+ tags {
4644
+ name
4645
+ description
4646
+ operations {
4647
+ slug
4648
+ ...OperationsFragment
4649
+ }
4650
+ }
4651
+ }
4652
+ }
4653
+ `
4654
+ ), Gl = () => {
4655
+ const { input: t, type: e } = Bt(), r = zt(Ol, { input: t, type: e }), o = Ht(r);
4656
+ return /* @__PURE__ */ d.jsxs("div", { className: "pt-[--padding-content-top]", children: [
4657
+ /* @__PURE__ */ d.jsxs(
4658
+ "div",
4659
+ {
4660
+ className: D(je, "mb-16 max-w-full prose-img:max-w-prose"),
4661
+ children: [
4662
+ /* @__PURE__ */ d.jsx(nr, { children: "Overview" }),
4663
+ /* @__PURE__ */ d.jsx(_e, { level: 1, id: "description", registerSidebarAnchor: !0, children: o.data.schema.title }),
4664
+ /* @__PURE__ */ d.jsx(be, { content: o.data.schema.description ?? "" })
4665
+ ]
4666
+ }
4667
+ ),
4668
+ /* @__PURE__ */ d.jsx("hr", {}),
4669
+ /* @__PURE__ */ d.jsx("div", { className: "my-4 flex justify-end", children: /* @__PURE__ */ d.jsx(no, {}) }),
4670
+ o.data.schema.tags.filter((i) => i.operations.length > 0).map((i) => /* @__PURE__ */ d.jsxs("div", { className: "[content-visibility:auto]", children: [
4671
+ i.name && /* @__PURE__ */ d.jsx(nr, { children: i.name }),
4672
+ i.description && /* @__PURE__ */ d.jsx(
4673
+ be,
4674
+ {
4675
+ className: `${je} max-w-full prose-img:max-w-prose w-full mt-2 mb-12`,
4676
+ content: i.description
4677
+ }
4678
+ ),
4679
+ /* @__PURE__ */ d.jsx("div", { className: "operation mb-12", children: /* @__PURE__ */ d.jsx(Vn, { children: i.operations.map((a) => /* @__PURE__ */ d.jsx(
4680
+ jl,
4681
+ {
4682
+ operationFragment: a
4683
+ },
4684
+ a.slug
4685
+ )) }) })
4686
+ ] }, i.name))
4687
+ ] });
4688
+ };
4689
+ export {
4690
+ Gl as OperationList,
4691
+ Sl as OperationsFragment
4692
+ };
4693
+ //# sourceMappingURL=OperationList-BkNQEsNs.js.map