twenty-sdk 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/README.md +139 -44
  2. package/dist/HtmlTagToRemoteComponent-Bd5sgek2.js +1 -0
  3. package/dist/HtmlTagToRemoteComponent-DlsAI7JU.mjs +146 -0
  4. package/dist/RatingValues-CT-y6O0b-CsGZSJKO.mjs +402 -0
  5. package/dist/RatingValues-CT-y6O0b-D7JSZAMu.js +1 -0
  6. package/dist/cli/commands/app/app-dev.d.ts +25 -0
  7. package/dist/cli/commands/{app-generate.command.d.ts → app/app-generate.d.ts} +1 -1
  8. package/dist/cli/commands/{app-uninstall.command.d.ts → app/app-uninstall.d.ts} +1 -1
  9. package/dist/cli/commands/app-command.d.ts +2 -0
  10. package/dist/cli/commands/auth/auth-list.d.ts +4 -0
  11. package/dist/cli/commands/auth/auth-login.d.ts +8 -0
  12. package/dist/cli/commands/auth/auth-logout.d.ts +4 -0
  13. package/dist/cli/commands/auth/auth-status.d.ts +5 -0
  14. package/dist/cli/commands/auth/auth-switch.d.ts +7 -0
  15. package/dist/cli/commands/entity/entity-add.d.ts +12 -0
  16. package/dist/cli/commands/logic-function/logic-function-execute.d.ts +10 -0
  17. package/dist/cli/commands/{app-logs.command.d.ts → logic-function/logic-function-logs.d.ts} +1 -1
  18. package/dist/cli/utilities/api/api-service.d.ts +51 -0
  19. package/dist/cli/utilities/build/common/cleanup-removed-files.d.ts +1 -0
  20. package/dist/cli/utilities/build/common/esbuild-result-processor.d.ts +11 -0
  21. package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +37 -0
  22. package/dist/cli/utilities/build/common/file-upload-watcher.d.ts +24 -0
  23. package/dist/cli/utilities/build/common/front-component-build/jsx-transform-to-remote-dom-worker-format-plugin.d.ts +3 -0
  24. package/dist/cli/utilities/build/common/front-component-build/react-globals-plugin.d.ts +2 -0
  25. package/dist/cli/utilities/build/common/front-component-build/types/ParsedImportSpecifier.d.ts +4 -0
  26. package/dist/cli/utilities/build/common/front-component-build/utils/extract-names-from-import-specifier.d.ts +2 -0
  27. package/dist/cli/utilities/build/common/front-component-build/utils/replace-html-tags-with-remote-components.d.ts +1 -0
  28. package/dist/cli/utilities/build/common/front-component-build/utils/unwrap-define-front-component-to-direct-export.d.ts +1 -0
  29. package/dist/cli/utilities/build/common/restartable-watcher-interface.d.ts +25 -0
  30. package/dist/cli/utilities/build/manifest/manifest-build.d.ts +7 -0
  31. package/dist/cli/utilities/build/manifest/manifest-extract-config-from-file.d.ts +5 -0
  32. package/dist/cli/utilities/build/manifest/manifest-extract-config.d.ts +20 -0
  33. package/dist/cli/utilities/build/manifest/manifest-types.d.ts +4 -0
  34. package/dist/cli/utilities/build/manifest/manifest-update-checksums.d.ts +17 -0
  35. package/dist/cli/utilities/build/manifest/manifest-validate.d.ts +6 -0
  36. package/dist/cli/utilities/build/manifest/manifest-watcher.d.ts +12 -0
  37. package/dist/cli/utilities/build/manifest/manifest-writer.d.ts +2 -0
  38. package/dist/cli/{services/generate.service.d.ts → utilities/client/client-service.d.ts} +2 -2
  39. package/dist/cli/{services/config.service.d.ts → utilities/config/config-service.d.ts} +4 -0
  40. package/dist/cli/utilities/dev/dev-mode-orchestrator.d.ts +42 -0
  41. package/dist/cli/utilities/dev/dev-ui-state-manager.d.ts +31 -0
  42. package/dist/cli/utilities/dev/dev-ui-state.d.ts +27 -0
  43. package/dist/cli/utilities/dev/dev-ui.d.ts +4 -0
  44. package/dist/cli/utilities/entity/entity-field-template.d.ts +11 -0
  45. package/dist/cli/utilities/entity/entity-front-component-template.d.ts +4 -0
  46. package/dist/cli/utilities/entity/entity-logic-function-template.d.ts +4 -0
  47. package/dist/cli/{utils/get-new-object-file-content.d.ts → utilities/entity/entity-object-template.d.ts} +1 -1
  48. package/dist/cli/{utils/jsonc-parser.d.ts → utilities/file/file-jsonc.d.ts} +1 -5
  49. package/dist/cli/utilities/file/file-tarball.d.ts +16 -0
  50. package/dist/cli/utilities/file/file-uploader.d.ts +14 -0
  51. package/dist/cli/{utils/get-ts-program-and-diagnostics.d.ts → utilities/typescript/typescript-program.d.ts} +1 -1
  52. package/dist/cli.cjs +280 -179
  53. package/dist/cli.mjs +11094 -9469
  54. package/dist/front-component/host/components/FrontComponentRenderer.d.ts +8 -0
  55. package/dist/front-component/host/generated/host-component-registry.d.ts +4 -0
  56. package/dist/front-component/host/generated/host-index.d.ts +1 -0
  57. package/dist/front-component/index.d.ts +10 -0
  58. package/dist/front-component/remote/components/FrontComponentWorkerEffect.d.ts +8 -0
  59. package/dist/front-component/remote/generated/remote-components.d.ts +44 -0
  60. package/dist/front-component/remote/generated/remote-elements.d.ts +195 -0
  61. package/dist/front-component/remote/generated/remote-index.d.ts +2 -0
  62. package/dist/front-component/remote/mock/mock-front-component.d.ts +3 -0
  63. package/dist/front-component/remote/worker/createRemoteWorker.d.ts +1 -0
  64. package/dist/front-component/remote/worker/remote-worker.d.ts +0 -0
  65. package/dist/front-component/types/HostToWorkerRenderContext.d.ts +3 -0
  66. package/dist/front-component/types/PropertySchema.d.ts +4 -0
  67. package/dist/front-component/types/WorkerExports.d.ts +5 -0
  68. package/dist/front-component-constants/AllowedHtmlElements.d.ts +11 -0
  69. package/dist/front-component-constants/AllowedUiComponents.d.ts +9 -0
  70. package/dist/front-component-constants/CommonHtmlEvents.d.ts +1 -0
  71. package/dist/front-component-constants/EventToReact.d.ts +1 -0
  72. package/dist/front-component-constants/HtmlCommonProperties.d.ts +2 -0
  73. package/dist/front-component-constants/HtmlTagToRemoteComponent.d.ts +1 -0
  74. package/dist/front-component-constants/index.d.ts +8 -0
  75. package/dist/front-component-constants.cjs +1 -0
  76. package/dist/front-component-constants.mjs +77 -0
  77. package/dist/front-component.cjs +328 -0
  78. package/dist/front-component.mjs +42579 -0
  79. package/dist/index.cjs +2 -2
  80. package/dist/index.d.ts +1 -1
  81. package/dist/index.mjs +2183 -242
  82. package/dist/jsx-runtime-C9ldtZbm.mjs +10472 -0
  83. package/dist/jsx-runtime-CfccAQK_.js +54 -0
  84. package/dist/sdk/application/application-config.d.ts +2 -0
  85. package/dist/sdk/application/define-application.d.ts +3 -0
  86. package/dist/sdk/common/types/define-entity.type.d.ts +11 -0
  87. package/dist/sdk/common/utils/create-validation-result.d.ts +5 -0
  88. package/dist/{application → sdk}/fields/composite-fields.d.ts +1 -1
  89. package/dist/sdk/fields/define-field.d.ts +3 -0
  90. package/dist/sdk/fields/validate-fields.d.ts +2 -0
  91. package/dist/sdk/front-components/define-front-component.d.ts +3 -0
  92. package/dist/sdk/front-components/front-component-config.d.ts +5 -0
  93. package/dist/sdk/index.d.ts +22 -0
  94. package/dist/sdk/logic-functions/define-logic-function.d.ts +3 -0
  95. package/dist/sdk/logic-functions/logic-function-config.d.ts +6 -0
  96. package/dist/sdk/logic-functions/triggers/route-payload-type.d.ts +1 -0
  97. package/dist/sdk/objects/define-object.d.ts +3 -0
  98. package/dist/sdk/objects/standard-object-ids.d.ts +1 -0
  99. package/dist/sdk/roles/define-role.d.ts +3 -0
  100. package/dist/sdk/roles/permission-flag-type.d.ts +1 -0
  101. package/dist/types-Bg4PAegr.js +1 -0
  102. package/dist/types-DVJsIqkp.mjs +7 -0
  103. package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-BZ0Penru.js +1 -0
  104. package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-DmLx4uDl.mjs +263 -0
  105. package/dist/vendor/twenty-shared/RatingValues-Bd_cXQ5v.js +1 -0
  106. package/dist/vendor/twenty-shared/RatingValues-CT-y6O0b.mjs +388 -0
  107. package/dist/vendor/twenty-shared/application/applicationType.d.ts +17 -4
  108. package/dist/vendor/twenty-shared/application/applicationType.d.ts.map +1 -1
  109. package/dist/vendor/twenty-shared/application/assetManifestType.d.ts +7 -0
  110. package/dist/vendor/twenty-shared/application/assetManifestType.d.ts.map +1 -0
  111. package/dist/vendor/twenty-shared/application/constants/AssetDirectory.d.ts +2 -0
  112. package/dist/vendor/twenty-shared/application/constants/AssetDirectory.d.ts.map +1 -0
  113. package/dist/vendor/twenty-shared/application/constants/GeneratedDirectory.d.ts +2 -0
  114. package/dist/vendor/twenty-shared/application/constants/GeneratedDirectory.d.ts.map +1 -0
  115. package/dist/vendor/twenty-shared/application/constants/OutputDirectory.d.ts +2 -0
  116. package/dist/vendor/twenty-shared/application/constants/OutputDirectory.d.ts.map +1 -0
  117. package/dist/vendor/twenty-shared/application/enums/syncable-entities.enum.d.ts +8 -0
  118. package/dist/vendor/twenty-shared/application/enums/syncable-entities.enum.d.ts.map +1 -0
  119. package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts +12 -1
  120. package/dist/vendor/twenty-shared/application/fieldManifestType.d.ts.map +1 -1
  121. package/dist/vendor/twenty-shared/application/frontComponentManifestType.d.ts +10 -0
  122. package/dist/vendor/twenty-shared/application/frontComponentManifestType.d.ts.map +1 -0
  123. package/dist/vendor/twenty-shared/application/index.d.ts +11 -5
  124. package/dist/vendor/twenty-shared/application/index.d.ts.map +1 -1
  125. package/dist/vendor/twenty-shared/application/{serverlessFunctionManifestType.d.ts → logicFunctionManifestType.d.ts} +9 -5
  126. package/dist/vendor/twenty-shared/application/logicFunctionManifestType.d.ts.map +1 -0
  127. package/dist/vendor/twenty-shared/application/manifestType.d.ts +20 -0
  128. package/dist/vendor/twenty-shared/application/manifestType.d.ts.map +1 -0
  129. package/dist/vendor/twenty-shared/application/objectFieldManifest.type.d.ts +5 -0
  130. package/dist/vendor/twenty-shared/application/objectFieldManifest.type.d.ts.map +1 -0
  131. package/dist/vendor/twenty-shared/application/objectManifestType.d.ts +2 -2
  132. package/dist/vendor/twenty-shared/application/objectManifestType.d.ts.map +1 -1
  133. package/dist/vendor/twenty-shared/application/roleManifestType.d.ts +3 -18
  134. package/dist/vendor/twenty-shared/application/roleManifestType.d.ts.map +1 -1
  135. package/dist/vendor/twenty-shared/application.cjs +1 -1
  136. package/dist/vendor/twenty-shared/application.mjs +8 -3
  137. package/dist/vendor/twenty-shared/constants/DocumentationBaseUrl.d.ts +2 -0
  138. package/dist/vendor/twenty-shared/constants/DocumentationBaseUrl.d.ts.map +1 -0
  139. package/dist/vendor/twenty-shared/constants/DocumentationDefaultLanguage.d.ts +2 -0
  140. package/dist/vendor/twenty-shared/constants/DocumentationDefaultLanguage.d.ts.map +1 -0
  141. package/dist/vendor/twenty-shared/constants/DocumentationDefaultPath.d.ts +2 -0
  142. package/dist/vendor/twenty-shared/constants/DocumentationDefaultPath.d.ts.map +1 -0
  143. package/dist/vendor/twenty-shared/constants/DocumentationPaths.d.ts +165 -0
  144. package/dist/vendor/twenty-shared/constants/DocumentationPaths.d.ts.map +1 -0
  145. package/dist/vendor/twenty-shared/constants/DocumentationSupportedLanguages.d.ts +3 -0
  146. package/dist/vendor/twenty-shared/constants/DocumentationSupportedLanguages.d.ts.map +1 -0
  147. package/dist/vendor/twenty-shared/constants/FilesFieldMaxNumberOfValues.d.ts +2 -0
  148. package/dist/vendor/twenty-shared/constants/FilesFieldMaxNumberOfValues.d.ts.map +1 -0
  149. package/dist/vendor/twenty-shared/constants/PermissionFlagType.d.ts +1 -0
  150. package/dist/vendor/twenty-shared/constants/PermissionFlagType.d.ts.map +1 -1
  151. package/dist/vendor/twenty-shared/constants/index.d.ts +8 -0
  152. package/dist/vendor/twenty-shared/constants/index.d.ts.map +1 -1
  153. package/dist/vendor/twenty-shared/constants.cjs +1 -1
  154. package/dist/vendor/twenty-shared/constants.mjs +56 -35
  155. package/dist/vendor/twenty-shared/database-events/database-event-payload.type.d.ts +1 -1
  156. package/dist/vendor/twenty-shared/database-events/database-event-payload.type.d.ts.map +1 -1
  157. package/dist/vendor/twenty-shared/database-events/object-record-delete.event.d.ts +4 -0
  158. package/dist/vendor/twenty-shared/database-events/object-record-delete.event.d.ts.map +1 -1
  159. package/dist/vendor/twenty-shared/database-events/object-record-restore.event.d.ts +4 -0
  160. package/dist/vendor/twenty-shared/database-events/object-record-restore.event.d.ts.map +1 -1
  161. package/dist/vendor/twenty-shared/database-events/object-record-update.event.d.ts +3 -3
  162. package/dist/vendor/twenty-shared/database-events/object-record-update.event.d.ts.map +1 -1
  163. package/dist/vendor/twenty-shared/isValidCountryCode-D-UqlXRW.js +4 -0
  164. package/dist/vendor/twenty-shared/{isValidCountryCode-E35rsxfD.mjs → isValidCountryCode-Dyji5s5r.mjs} +2351 -2320
  165. package/dist/vendor/twenty-shared/metadata/MetadataValidationError.d.ts.map +1 -1
  166. package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts +5 -4
  167. package/dist/vendor/twenty-shared/metadata/all-metadata-name.constant.d.ts.map +1 -1
  168. package/dist/vendor/twenty-shared/metadata/index.d.ts +1 -1
  169. package/dist/vendor/twenty-shared/metadata/index.d.ts.map +1 -1
  170. package/dist/vendor/twenty-shared/metadata/standard-object.constant.d.ts +2196 -0
  171. package/dist/vendor/twenty-shared/metadata/standard-object.constant.d.ts.map +1 -0
  172. package/dist/vendor/twenty-shared/metadata.cjs +1 -1
  173. package/dist/vendor/twenty-shared/metadata.mjs +2025 -69
  174. package/dist/vendor/twenty-shared/translations/constants/AppLocales.d.ts +1 -0
  175. package/dist/vendor/twenty-shared/translations/constants/AppLocales.d.ts.map +1 -1
  176. package/dist/vendor/twenty-shared/translations/index.d.ts +1 -0
  177. package/dist/vendor/twenty-shared/translations/index.d.ts.map +1 -1
  178. package/dist/vendor/twenty-shared/translations.cjs +1 -1
  179. package/dist/vendor/twenty-shared/translations.mjs +2 -2
  180. package/dist/vendor/twenty-shared/types/ExtractSerializedRelationProperties.type.d.ts +6 -0
  181. package/dist/vendor/twenty-shared/types/ExtractSerializedRelationProperties.type.d.ts.map +1 -0
  182. package/dist/vendor/twenty-shared/types/FieldMetadataDefaultValue.d.ts +44 -88
  183. package/dist/vendor/twenty-shared/types/FieldMetadataDefaultValue.d.ts.map +1 -1
  184. package/dist/vendor/twenty-shared/types/FieldMetadataOptions.d.ts +2 -1
  185. package/dist/vendor/twenty-shared/types/FieldMetadataOptions.d.ts.map +1 -1
  186. package/dist/vendor/twenty-shared/types/FieldMetadataSettings.d.ts +15 -9
  187. package/dist/vendor/twenty-shared/types/FieldMetadataSettings.d.ts.map +1 -1
  188. package/dist/vendor/twenty-shared/types/FieldMetadataType.d.ts +18 -17
  189. package/dist/vendor/twenty-shared/types/FieldMetadataType.d.ts.map +1 -1
  190. package/dist/vendor/twenty-shared/types/FileCategory.d.ts +12 -0
  191. package/dist/vendor/twenty-shared/types/FileCategory.d.ts.map +1 -0
  192. package/dist/vendor/twenty-shared/types/FileFolder.d.ts +14 -0
  193. package/dist/vendor/twenty-shared/types/FileFolder.d.ts.map +1 -0
  194. package/dist/vendor/twenty-shared/types/IsEmptyObject.type.d.ts +2 -0
  195. package/dist/vendor/twenty-shared/types/IsEmptyObject.type.d.ts.map +1 -0
  196. package/dist/vendor/twenty-shared/types/IsEmptyRecord.type.d.ts +1 -1
  197. package/dist/vendor/twenty-shared/types/IsEmptyRecord.type.d.ts.map +1 -1
  198. package/dist/vendor/twenty-shared/types/IsNever.type.d.ts +2 -0
  199. package/dist/vendor/twenty-shared/types/IsNever.type.d.ts.map +1 -0
  200. package/dist/vendor/twenty-shared/types/IsSerializedRelation.type.d.ts +4 -0
  201. package/dist/vendor/twenty-shared/types/IsSerializedRelation.type.d.ts.map +1 -0
  202. package/dist/vendor/twenty-shared/types/LogicFunctionEvent.d.ts +28 -0
  203. package/dist/vendor/twenty-shared/types/LogicFunctionEvent.d.ts.map +1 -0
  204. package/dist/vendor/twenty-shared/types/ObjectPermissions.d.ts +4 -0
  205. package/dist/vendor/twenty-shared/types/ObjectPermissions.d.ts.map +1 -1
  206. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicate.d.ts +15 -0
  207. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicate.d.ts.map +1 -0
  208. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateGroup.d.ts +11 -0
  209. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateGroup.d.ts.map +1 -0
  210. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateGroupLogicalOperator.d.ts +5 -0
  211. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateGroupLogicalOperator.d.ts.map +1 -0
  212. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateOperand.d.ts +19 -0
  213. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateOperand.d.ts.map +1 -0
  214. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateValue.d.ts +6 -0
  215. package/dist/vendor/twenty-shared/types/RowLevelPermissionPredicateValue.d.ts.map +1 -0
  216. package/dist/vendor/twenty-shared/types/SerializedRelation.type.d.ts +5 -0
  217. package/dist/vendor/twenty-shared/types/SerializedRelation.type.d.ts.map +1 -0
  218. package/dist/vendor/twenty-shared/types/SettingsPath.d.ts +5 -4
  219. package/dist/vendor/twenty-shared/types/SettingsPath.d.ts.map +1 -1
  220. package/dist/vendor/twenty-shared/types/__tests__/extract-serialized-relation-properties.type-test.d.ts +2 -0
  221. package/dist/vendor/twenty-shared/types/__tests__/extract-serialized-relation-properties.type-test.d.ts.map +1 -0
  222. package/dist/vendor/twenty-shared/types/index.d.ts +22 -4
  223. package/dist/vendor/twenty-shared/types/index.d.ts.map +1 -1
  224. package/dist/vendor/twenty-shared/types/page-layout/PageLayoutTabLayoutMode.d.ts +6 -0
  225. package/dist/vendor/twenty-shared/types/page-layout/PageLayoutTabLayoutMode.d.ts.map +1 -0
  226. package/dist/vendor/twenty-shared/types/page-layout/PageLayoutWidgetConditionalDisplay.d.ts +2 -0
  227. package/dist/vendor/twenty-shared/types/page-layout/PageLayoutWidgetConditionalDisplay.d.ts.map +1 -0
  228. package/dist/vendor/twenty-shared/types/page-layout/page-layout-widget-position.type.d.ts +18 -0
  229. package/dist/vendor/twenty-shared/types/page-layout/page-layout-widget-position.type.d.ts.map +1 -0
  230. package/dist/vendor/twenty-shared/types.cjs +1 -1
  231. package/dist/vendor/twenty-shared/types.mjs +85 -76
  232. package/dist/vendor/twenty-shared/utils/array/compareArraysOfObjectsByProperty.d.ts +2 -0
  233. package/dist/vendor/twenty-shared/utils/array/compareArraysOfObjectsByProperty.d.ts.map +1 -0
  234. package/dist/vendor/twenty-shared/utils/files/extractFolderPathFilenameAndTypeOrThrow.util.d.ts +6 -0
  235. package/dist/vendor/twenty-shared/utils/files/extractFolderPathFilenameAndTypeOrThrow.util.d.ts.map +1 -0
  236. package/dist/vendor/twenty-shared/utils/filter/index.d.ts +13 -0
  237. package/dist/vendor/twenty-shared/utils/filter/index.d.ts.map +1 -1
  238. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingArrayFilter.d.ts +7 -0
  239. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingArrayFilter.d.ts.map +1 -0
  240. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingBooleanFilter.d.ts +7 -0
  241. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingBooleanFilter.d.ts.map +1 -0
  242. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingCurrencyFilter.d.ts +10 -0
  243. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingCurrencyFilter.d.ts.map +1 -0
  244. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingDateFilter.d.ts +7 -0
  245. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingDateFilter.d.ts.map +1 -0
  246. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingFloatFilter.d.ts +7 -0
  247. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingFloatFilter.d.ts.map +1 -0
  248. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingMultiSelectFilter.d.ts +7 -0
  249. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingMultiSelectFilter.d.ts.map +1 -0
  250. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRatingFilter.d.ts +7 -0
  251. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRatingFilter.d.ts.map +1 -0
  252. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRawJsonFilter.d.ts +7 -0
  253. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRawJsonFilter.d.ts.map +1 -0
  254. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRichTextV2Filter.d.ts +7 -0
  255. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingRichTextV2Filter.d.ts.map +1 -0
  256. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingSelectFilter.d.ts +7 -0
  257. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingSelectFilter.d.ts.map +1 -0
  258. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingStringFilter.d.ts +7 -0
  259. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingStringFilter.d.ts.map +1 -0
  260. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingTSVectorFilter.d.ts +7 -0
  261. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingTSVectorFilter.d.ts.map +1 -0
  262. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingUUIDFilter.d.ts +7 -0
  263. package/dist/vendor/twenty-shared/utils/filter/utils/isMatchingUUIDFilter.d.ts.map +1 -0
  264. package/dist/vendor/twenty-shared/utils/format/formatToShortNumber.d.ts +2 -0
  265. package/dist/vendor/twenty-shared/utils/format/formatToShortNumber.d.ts.map +1 -0
  266. package/dist/vendor/twenty-shared/utils/index.d.ts +19 -0
  267. package/dist/vendor/twenty-shared/utils/index.d.ts.map +1 -1
  268. package/dist/vendor/twenty-shared/utils/strings/index.d.ts +1 -0
  269. package/dist/vendor/twenty-shared/utils/strings/index.d.ts.map +1 -1
  270. package/dist/vendor/twenty-shared/utils/strings/pascalCase.d.ts +2 -0
  271. package/dist/vendor/twenty-shared/utils/strings/pascalCase.d.ts.map +1 -0
  272. package/dist/vendor/twenty-shared/utils/strings/stringifySafely.d.ts +2 -0
  273. package/dist/vendor/twenty-shared/utils/strings/stringifySafely.d.ts.map +1 -0
  274. package/dist/vendor/twenty-shared/utils/typeguard/isPlainObject.d.ts +2 -0
  275. package/dist/vendor/twenty-shared/utils/typeguard/isPlainObject.d.ts.map +1 -0
  276. package/dist/vendor/twenty-shared/utils/validation/isValidLocale.d.ts +2 -2
  277. package/dist/vendor/twenty-shared/utils/validation/isValidLocale.d.ts.map +1 -1
  278. package/dist/vendor/twenty-shared/utils/validation/normalizeLocale.d.ts +2 -5
  279. package/dist/vendor/twenty-shared/utils/validation/normalizeLocale.d.ts.map +1 -1
  280. package/dist/vendor/twenty-shared/utils.cjs +2 -2
  281. package/dist/vendor/twenty-shared/utils.mjs +994 -522
  282. package/dist/vendor/twenty-shared/workflow/index.d.ts +4 -0
  283. package/dist/vendor/twenty-shared/workflow/index.d.ts.map +1 -1
  284. package/dist/vendor/twenty-shared/workflow/schemas/code-action-schema.d.ts +2 -3
  285. package/dist/vendor/twenty-shared/workflow/schemas/code-action-schema.d.ts.map +1 -1
  286. package/dist/vendor/twenty-shared/workflow/schemas/code-action-settings-schema.d.ts +2 -3
  287. package/dist/vendor/twenty-shared/workflow/schemas/code-action-settings-schema.d.ts.map +1 -1
  288. package/dist/vendor/twenty-shared/workflow/schemas/logic-function-action-schema.d.ts +29 -0
  289. package/dist/vendor/twenty-shared/workflow/schemas/logic-function-action-schema.d.ts.map +1 -0
  290. package/dist/vendor/twenty-shared/workflow/schemas/logic-function-action-settings-schema.d.ts +18 -0
  291. package/dist/vendor/twenty-shared/workflow/schemas/logic-function-action-settings-schema.d.ts.map +1 -0
  292. package/dist/vendor/twenty-shared/workflow/schemas/send-email-action-schema.d.ts +5 -1
  293. package/dist/vendor/twenty-shared/workflow/schemas/send-email-action-schema.d.ts.map +1 -1
  294. package/dist/vendor/twenty-shared/workflow/schemas/send-email-action-settings-schema.d.ts +5 -1
  295. package/dist/vendor/twenty-shared/workflow/schemas/send-email-action-settings-schema.d.ts.map +1 -1
  296. package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts +32 -4
  297. package/dist/vendor/twenty-shared/workflow/schemas/workflow-action-schema.d.ts.map +1 -1
  298. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts +32 -4
  299. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-schema.d.ts.map +1 -1
  300. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts +32 -4
  301. package/dist/vendor/twenty-shared/workflow/schemas/workflow-run-state-schema.d.ts.map +1 -1
  302. package/dist/vendor/twenty-shared/workflow/types/EmailRecipients.d.ts +6 -0
  303. package/dist/vendor/twenty-shared/workflow/types/EmailRecipients.d.ts.map +1 -0
  304. package/dist/vendor/twenty-shared/workflow/utils/variable-path.util.d.ts +12 -0
  305. package/dist/vendor/twenty-shared/workflow/utils/variable-path.util.d.ts.map +1 -0
  306. package/dist/vendor/twenty-shared/workflow.cjs +3 -3
  307. package/dist/vendor/twenty-shared/workflow.mjs +205 -166
  308. package/package.json +39 -15
  309. package/dist/ObjectRecordGroupByDateGranularity-CtpRADP1-Bft-VMSh.mjs +0 -3151
  310. package/dist/ObjectRecordGroupByDateGranularity-CtpRADP1-Duv5iOeZ.js +0 -20
  311. package/dist/application/application-config.d.ts +0 -2
  312. package/dist/application/define-app.d.ts +0 -18
  313. package/dist/application/fields/field.decorator.d.ts +0 -3
  314. package/dist/application/fields/relation.decorator.d.ts +0 -28
  315. package/dist/application/functions/define-function.d.ts +0 -28
  316. package/dist/application/functions/function-config.d.ts +0 -9
  317. package/dist/application/index.d.ts +0 -19
  318. package/dist/application/objects/define-object.d.ts +0 -35
  319. package/dist/application/objects/object.decorator.d.ts +0 -4
  320. package/dist/application/objects/standard-object-ids.d.ts +0 -1
  321. package/dist/application/permission-flag-type.d.ts +0 -1
  322. package/dist/application/role-config.d.ts +0 -2
  323. package/dist/application/roles/define-role.d.ts +0 -26
  324. package/dist/cli/commands/app-add.command.d.ts +0 -13
  325. package/dist/cli/commands/app-dev.command.d.ts +0 -11
  326. package/dist/cli/commands/app-sync.command.d.ts +0 -7
  327. package/dist/cli/commands/app.command.d.ts +0 -10
  328. package/dist/cli/commands/auth.command.d.ts +0 -9
  329. package/dist/cli/services/api.service.d.ts +0 -20
  330. package/dist/cli/utils/config-loader.d.ts +0 -43
  331. package/dist/cli/utils/display-entity-summary.d.ts +0 -2
  332. package/dist/cli/utils/display-errors.d.ts +0 -2
  333. package/dist/cli/utils/display-warnings.d.ts +0 -2
  334. package/dist/cli/utils/get-function-base-file.d.ts +0 -4
  335. package/dist/cli/utils/load-env-variables.d.ts +0 -2
  336. package/dist/cli/utils/load-manifest.d.ts +0 -41
  337. package/dist/cli/utils/validate-manifest.d.ts +0 -22
  338. package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-BwpmSE4s.js +0 -1
  339. package/dist/vendor/twenty-shared/ObjectRecordGroupByDateGranularity-CtpRADP1.mjs +0 -500
  340. package/dist/vendor/twenty-shared/RatingValues-B_wgYyso.js +0 -1
  341. package/dist/vendor/twenty-shared/RatingValues-DNSj7xKA.mjs +0 -224
  342. package/dist/vendor/twenty-shared/application/applicationManifestType.d.ts +0 -12
  343. package/dist/vendor/twenty-shared/application/applicationManifestType.d.ts.map +0 -1
  344. package/dist/vendor/twenty-shared/application/packageJsonType.d.ts +0 -14
  345. package/dist/vendor/twenty-shared/application/packageJsonType.d.ts.map +0 -1
  346. package/dist/vendor/twenty-shared/application/serverlessFunctionManifestType.d.ts.map +0 -1
  347. package/dist/vendor/twenty-shared/isValidCountryCode-WBKj_GIR.js +0 -4
  348. package/dist/vendor/twenty-shared/metadata/standard-object-ids.d.ts +0 -51
  349. package/dist/vendor/twenty-shared/metadata/standard-object-ids.d.ts.map +0 -1
  350. /package/dist/cli/{types/api-response.types.d.ts → utilities/api/api-response-type.d.ts} +0 -0
  351. /package/dist/cli/{constants → utilities/config}/current-execution-directory.d.ts +0 -0
  352. /package/dist/cli/{utils/convert-to-label.d.ts → utilities/entity/entity-label.d.ts} +0 -0
  353. /package/dist/cli/{utils/get-role-base-file.d.ts → utilities/entity/entity-role-template.d.ts} +0 -0
  354. /package/dist/cli/{utils/find-path-file.d.ts → utilities/file/file-find.d.ts} +0 -0
  355. /package/dist/cli/{utils/format-path.d.ts → utilities/file/file-path.d.ts} +0 -0
  356. /package/dist/cli/{utils/format-and-warn-ts-diagnostics.d.ts → utilities/typescript/typescript-diagnostics.d.ts} +0 -0
  357. /package/dist/{application → sdk/common/types}/syncable-entity-options.type.d.ts +0 -0
  358. /package/dist/{application → sdk}/fields/field-type.d.ts +0 -0
  359. /package/dist/{application → sdk}/fields/on-delete-action.d.ts +0 -0
  360. /package/dist/{application → sdk}/fields/relation-type.d.ts +0 -0
  361. /package/dist/{application/functions → sdk/logic-functions}/triggers/cron-payload-type.d.ts +0 -0
  362. /package/dist/{application/functions → sdk/logic-functions}/triggers/database-event-payload-type.d.ts +0 -0
package/dist/cli.cjs CHANGED
@@ -1,120 +1,21 @@
1
1
  #!/usr/bin/env node
2
- "use strict";const J0=require("chalk"),Ii=require("commander"),Q0=require("util"),z0=require("fs-extra"),Y0=require("inquirer"),ke=require("path"),H0=require("lodash.camelcase"),K0=require("lodash.kebabcase"),_i=require("uuid"),kn=require("./ObjectRecordGroupByDateGranularity-CtpRADP1-Duv5iOeZ.js"),X0=require("axios"),Z0=require("graphql-sse"),ev=require("os"),tv=require("fast-glob"),nv=require("jiti"),rv=require("url"),iv=require("jsonc-parser"),sv=require("chokidar"),ov=require("@genql/cli");var Xs=typeof document<"u"?document.currentScript:null;const vr=n=>n&&n.__esModule?n:{default:n};function xi(n){if(n&&n.__esModule)return n;const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}return i.default=n,Object.freeze(i)}const F=vr(J0),Ie=xi(z0),$n=vr(Y0),yt=xi(ke),av=vr(H0),Ti=vr(K0),Zs=vr(X0),uv=xi(ev),cv=xi(sv),vt=process.env.INIT_CWD||process.cwd(),lv=({data:n})=>`import { defineObject } from 'twenty-sdk';
2
+ "use strict";var fy=Object.create;var hc=Object.defineProperty;var py=Object.getOwnPropertyDescriptor;var dy=Object.getOwnPropertyNames;var hy=Object.getPrototypeOf,gy=Object.prototype.hasOwnProperty;var my=(n,r,i,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of dy(r))!gy.call(n,u)&&u!==i&&hc(n,u,{get:()=>r[u],enumerable:!(o=py(r,u))||o.enumerable});return n};var gc=(n,r,i)=>(i=n!=null?fy(hy(n)):{},my(r||!n||!n.__esModule?hc(i,"default",{value:n,enumerable:!0}):i,n));const ge=require("path"),yy=require("chalk"),Fc=require("fs-extra"),vy=require("crypto"),_y=require("node:fs/promises"),B=require("./jsx-runtime-CfccAQK_.js"),xy=require("@sniptt/guards"),Ty=require("lodash.camelcase"),mc=require("./RatingValues-CT-y6O0b-D7JSZAMu.js"),Dc=require("./HtmlTagToRemoteComponent-Bd5sgek2.js"),wy=require("fs/promises"),Ey=require("esbuild"),gn=require("./types-Bg4PAegr.js"),Sy=require("chokidar"),Ay=require("os"),Iy=require("axios"),by=require("fs"),Ny=require("graphql-sse"),Oy=require("typescript"),Ry=require("module"),Pc=require("fast-glob"),Cy=require("@genql/cli"),Ly=require("inquirer"),pi=require("uuid"),kc=require("commander"),Fy=require("util"),di=n=>n&&n.__esModule?n:{default:n};function wn(n){if(n&&n.__esModule)return n;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}return r.default=n,Object.freeze(r)}const we=wn(ge),R=di(yy),de=wn(Fc),Uc=di(vy),Dy=wn(_y),Py=di(Ty),ky=wn(wy),Mc=wn(Ey),$c=di(Sy),Bc=wn(Ay),Mr=di(Iy),yc=wn(by),ui=wn(Oy),zt=di(Ly);var mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Uy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}const Ht=process.env.INIT_CWD||process.cwd(),Pi=n=>n&&!n?.startsWith("/")?ge.join(Ht,n):n,My=async(n,r,i)=>{const o=new Set(i),u=r.filter(f=>!o.has(f));for(const f of u){const g=f.replace(/\.tsx?$/,".mjs"),v=we.default.join(n,g),w=`${v}.map`;await de.remove(v),await de.remove(w)}},$y=async({result:n,appPath:r,fileFolder:i,lastChecksums:o,onFileBuilt:u})=>{const f=Object.keys(n.metafile?.outputs??{}).filter(g=>g.endsWith(".mjs"));for(const g of f){const v=we.default.resolve(g),w=we.default.relative(r,v),b=n.metafile?.outputs?.[g]?.entryPoint||"",O=we.default.relative(r,b),D=await de.readFile(v),P=Uc.default.createHash("md5").update(D).digest("hex");o.get(w)!==P&&(o.set(w,P),u&&await u({fileFolder:i,builtPath:w,sourcePath:O,checksum:P}))}},By=n=>xy.isNonEmptyString(n)?n[0].toUpperCase()+n.slice(1):"",jy=n=>By(Py.default(n)),Wy=n=>typeof n=="object"&&n!==null&&!Array.isArray(n),Gy="RemoteComponents",Vy=()=>{const n=Object.keys(Dc.HTML_TAG_TO_REMOTE_COMPONENT).join("|");return new RegExp(`(<\\/?)\\b(${n})\\b(?=[\\s>\\/>])`,"g")},qy=Vy(),Jy=n=>n.replace(qy,(r,i,o)=>{const u=Dc.HTML_TAG_TO_REMOTE_COMPONENT[o];return B.Tr(u)?`${i}${Gy}.${u}`:r}),zy=/import\s*\{\s*defineFrontComponent\s*\}\s*from\s*['"][^'"]+['"];?\n?/g,vc=/export\s+default\s+defineFrontComponent\s*\(\s*\{[^}]*component\s*:\s*(\w+)[^}]*\}\s*\)\s*;?/s,Qy=n=>{let r=n.replace(zy,"");const i=r.match(vc);if(i){const o=i[1],u=new RegExp(`export\\s+(const|function)\\s+${o}\\b`);r=r.replace(u,`$1 ${o}`),r=r.replace(vc,`export default globalThis.jsx(${o}, {});`)}return r},Hy={name:"jsx-transform-to-remote-dom-worker-format-plugin",setup:n=>{n.onLoad({filter:/\.tsx$/},async({path:r})=>{try{const i=await Dy.readFile(r,"utf8"),o=Jy(i);return{contents:`var RemoteComponents = globalThis.RemoteComponents;
3
+ ${Qy(o)}`,loader:"tsx"}}catch(i){return{errors:[{text:`Failed to transform front component: ${i instanceof Error?i.message:String(i)}`,location:{file:r}}]}}})}},Yy=/^(\w+)\s+as\s+(\w+)$/,Xy=n=>{const r=n.trim(),i=r.match(Yy);if(B.Tr(i)){const[,o,u]=i;return{originalName:o,aliasName:u}}return{originalName:r,aliasName:r}},_c=/import\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]*)\})?\s*from\s*['"]react['"];?/g,Ky=/^react(\/jsx-runtime)?$/,Zy=`
4
+ export var jsx = globalThis.jsx;
5
+ export var jsxs = globalThis.jsxs;
6
+ export var Fragment = globalThis.React.Fragment;
7
+ `.trim(),ev=n=>{const r=new Set;let i;for(;B.Tr(i=_c.exec(n));){const o=i[1],u=i[2];o&&r.add("default"),u&&u.split(",").filter(f=>f.trim()).forEach(f=>{const{originalName:g}=Xy(f);r.add(g)})}return _c.lastIndex=0,r},tv=n=>{const r=[];for(const i of n)i==="default"?r.push("export default globalThis.React;"):r.push(`export var ${i} = globalThis.React.${i};`);return r.join(`
8
+ `)},nv={name:"react-globals",setup:async n=>{const r=new Map;n.onStart(()=>{r.clear()}),n.onResolve({filter:Ky},async({importer:i,path:o})=>{if(i&&!r.has(i))try{const u=await ky.readFile(i,"utf-8");r.set(i,ev(u))}catch{r.set(i,new Set)}return{path:o,namespace:"react-globals",pluginData:{importer:i}}}),n.onLoad({filter:/.*/,namespace:"react-globals"},({pluginData:i,path:o})=>{const u=i?.importer||"",f=r.get(u)||new Set;return o==="react/jsx-runtime"?{contents:Zy,loader:"js"}:o==="react"?{contents:tv(f),loader:"js"}:null})}},La="public",iv="TWENTY_API_KEY",rv="TWENTY_API_URL",vn=".twenty/output";var De=(n=>(n.Object="object",n.Field="field",n.LogicFunction="logicFunction",n.FrontComponent="frontComponent",n.Role="role",n))(De||{});const sv=["path","fs","crypto","stream","util","os","url","http","https","events","buffer","querystring","assert","zlib","net","tls","child_process","worker_threads","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"],av=["react-dom","twenty-sdk","twenty-sdk/*","twenty-shared","twenty-shared/*"];class jc{constructor(r){this.esBuildContext=null,this.isRestarting=!1,this.lastChecksums=new Map,this.buildCompletePromise=Promise.resolve(),this.resolveBuildComplete=null,this.appPath=r.appPath,this.sourcePaths=r.sourcePaths,this.watchMode=r.watch??!0,this.onFileBuilt=r.handleFileBuilt,this.onBuildError=r.handleBuildError,this.config=r.config}shouldRestart(r){const i=this.sourcePaths.sort().join(","),o=[...r].sort().join(",");return i!==o}async start(){this.sourcePaths.length>0&&await this.createContext()}async close(){await this.esBuildContext?.dispose(),this.esBuildContext=null}async restart(r){if(!this.isRestarting){this.isRestarting=!0;try{await this.close();const i=we.default.join(this.appPath,vn);await My(i,this.sourcePaths,r),this.sourcePaths=r,this.lastChecksums.clear(),this.sourcePaths.length>0&&await this.createContext()}finally{this.isRestarting=!1}}}async createContext(){const r=we.default.join(this.appPath,vn),i={};for(const f of this.sourcePaths){const g=f.replace(/\.tsx?$/,"");i[g]=we.default.join(this.appPath,f)}const o=this,u=[...this.config.extraPlugins??[],{name:"build-notifications",setup:f=>{f.onEnd(async g=>{try{if(g.errors.length>0){g.errors[0].text.includes("Could not resolve")||await this.onBuildError?.(g.errors.map(v=>({error:v.text,location:v.location})));return}await $y({result:g,appPath:this.appPath,fileFolder:this.config.fileFolder,lastChecksums:o.lastChecksums,onFileBuilt:o.onFileBuilt})}finally{o.resolveBuildComplete?.()}})}}];this.esBuildContext=await Mc.context({entryPoints:i,bundle:!0,splitting:!1,format:"esm",platform:this.config.platform,outdir:r,outExtension:{".js":".mjs"},external:this.config.externalModules,tsconfig:we.default.join(this.appPath,"tsconfig.json"),jsx:this.config.jsx,sourcemap:!0,metafile:!0,logLevel:"silent",minify:this.config.minify,plugins:u}),this.buildCompletePromise=new Promise(f=>{this.resolveBuildComplete=f}),await this.esBuildContext.rebuild(),await this.buildCompletePromise,this.watchMode&&await this.esBuildContext.watch()}}const ov={name:"external-patterns",setup:n=>{n.onResolve({filter:/(?:^|\/)generated(?:\/|$)/},r=>({path:r.path,external:!0}))}},uv=n=>new jc({...n,config:{externalModules:sv,fileFolder:gn.i.BuiltLogicFunction,platform:"node",extraPlugins:[ov]}}),cv=n=>new jc({...n,config:{externalModules:av,fileFolder:gn.i.BuiltFrontComponent,jsx:"automatic",extraPlugins:[nv,Hy]}});class lv{constructor(r){this.watcher=null,this.appPath=r.appPath,this.handleChangeDetected=r.handleChangeDetected}async start(){this.watcher=$c.default.watch(this.appPath,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",async(r,i)=>{if(r==="addDir")return;const o=ge.relative(this.appPath,i),u=o.startsWith("node_modules")||o.startsWith("generated")||o.startsWith("dist"),f=o.startsWith(La),g=["package.json","yarn.lock"].includes(o),v=o.endsWith(".ts")||o.endsWith(".tsx"),w=o.startsWith(".");(u||!v||w)&&!f&&!g||this.handleChangeDetected(o,r)})}async close(){await this.watcher?.close()}}const fv=({manifest:n,builtFileInfos:r})=>{let i=structuredClone(n);for(const[o,{fileFolder:u,checksum:f}]of r.entries()){const g=ge.relative(vn,o);if(u===gn.i.BuiltLogicFunction){const v=i.logicFunctions,w=v.findIndex(b=>b.builtHandlerPath===g);if(w===-1)continue;i={...i,logicFunctions:v.map((b,O)=>O===w?{...b,builtHandlerChecksum:f}:b)}}if(u===gn.i.PublicAsset){const v=i.publicAssets,w=v.findIndex(b=>b.filePath===g);if(w===-1)continue;i={...i,publicAssets:v.map((b,O)=>O===w?{...b,checksum:f}:b)};continue}if(u===gn.i.BuiltFrontComponent){const v=i.frontComponents,w=v.findIndex(b=>b.builtComponentPath===g)??-1;if(w===-1)continue;i={...i,frontComponents:v.map((b,O)=>O===w?{...b,builtComponentChecksum:f}:b)}}u===gn.i.Source&&(g==="package.json"&&(i.application.packageJsonChecksum=f),g==="yarn.lock"&&(i.application.yarnLockChecksum=f))}return i},pv=async(n,r)=>{const i=we.default.join(n,vn);await de.ensureDir(i);const o=we.default.join(i,"manifest.json");return await de.writeJSON(o,r,{spaces:2}),o},Jt="default",Vr=class Vr{constructor(){this.configPath=we.join(Bc.homedir(),".twenty","config.json")}static setActiveWorkspace(r){this.activeWorkspace=r??Jt}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Vr.getActiveWorkspace()}async readRawConfig(){await de.ensureFile(this.configPath);const r=await de.readFile(this.configPath,"utf8");return JSON.parse(r||"{}")}async getConfig(){return this.getConfigForWorkspace(this.getActiveWorkspaceName())}async getConfigForWorkspace(r){const i=this.getDefaultConfig();try{const o=await this.readRawConfig(),u=r===Jt&&!o.profiles?.[Jt]?o:o.profiles?.[r],f=u?.apiUrl??i.apiUrl,g=u?.apiKey;return{apiUrl:f,apiKey:g}}catch{return i}}async setConfig(r){const i=await this.readRawConfig(),o=this.getActiveWorkspaceName();i.profiles||(i.profiles={});const u=i.profiles[o]||{apiUrl:""};i.profiles[o]={...u,...r},await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}async clearConfig(){const r=await this.readRawConfig(),i=this.getActiveWorkspaceName();if(r.profiles||(r.profiles={}),r.profiles[i]&&delete r.profiles[i],i===Jt){const o=this.getDefaultConfig();delete r.apiKey,r.apiUrl=o.apiUrl}await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(r,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}async getAvailableWorkspaces(){try{const r=await this.readRawConfig(),i=new Set;return i.add(Jt),r.profiles&&Object.keys(r.profiles).forEach(o=>i.add(o)),Array.from(i).sort()}catch{return[Jt]}}async getDefaultWorkspace(){try{return(await this.readRawConfig()).defaultWorkspace??Jt}catch{return Jt}}async setDefaultWorkspace(r){const i=await this.readRawConfig();i.defaultWorkspace=r,await de.ensureDir(we.dirname(this.configPath)),await de.writeFile(this.configPath,JSON.stringify(i,null,2))}};Vr.activeWorkspace=Jt;let je=Vr;function ue(n,r){if(!!!n)throw new Error(r)}function Xt(n){return typeof n=="object"&&n!==null}function ji(n,r){if(!!!n)throw new Error(r??"Unexpected invariant triggered.")}const dv=/\r\n|[\n\r]/g;function ba(n,r){let i=0,o=1;for(const u of n.body.matchAll(dv)){if(typeof u.index=="number"||ji(!1),u.index>=r)break;i=u.index+u[0].length,o+=1}return{line:o,column:r+1-i}}function hv(n){return Wc(n.source,ba(n.source,n.start))}function Wc(n,r){const i=n.locationOffset.column-1,o="".padStart(i)+n.body,u=r.line-1,f=n.locationOffset.line-1,g=r.line+f,v=r.line===1?i:0,w=r.column+v,b=`${n.name}:${g}:${w}
9
+ `,O=o.split(/\r\n|[\n\r]/g),D=O[u];if(D.length>120){const P=Math.floor(w/80),M=w%80,$=[];for(let he=0;he<D.length;he+=80)$.push(D.slice(he,he+80));return b+xc([[`${g} |`,$[0]],...$.slice(1,P+1).map(he=>["|",he]),["|","^".padStart(M)],["|",$[P+1]]])}return b+xc([[`${g-1} |`,O[u-1]],[`${g} |`,D],["|","^".padStart(w)],[`${g+1} |`,O[u+1]]])}function xc(n){const r=n.filter(([o,u])=>u!==void 0),i=Math.max(...r.map(([o])=>o.length));return r.map(([o,u])=>o.padStart(i)+(u?" "+u:"")).join(`
10
+ `)}function gv(n){const r=n[0];return r==null||"kind"in r||"length"in r?{nodes:r,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:r}class fe extends Error{constructor(r,...i){var o,u,f;const{nodes:g,source:v,positions:w,path:b,originalError:O,extensions:D}=gv(i);super(r),this.name="GraphQLError",this.path=b??void 0,this.originalError=O??void 0,this.nodes=Tc(Array.isArray(g)?g:g?[g]:void 0);const P=Tc((o=this.nodes)===null||o===void 0?void 0:o.map($=>$.loc).filter($=>$!=null));this.source=v??(P==null||(u=P[0])===null||u===void 0?void 0:u.source),this.positions=w??P?.map($=>$.start),this.locations=w&&v?w.map($=>ba(v,$)):P?.map($=>ba($.source,$.start));const M=Xt(O?.extensions)?O?.extensions:void 0;this.extensions=(f=D??M)!==null&&f!==void 0?f:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),O!=null&&O.stack?Object.defineProperty(this,"stack",{value:O.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,fe):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let r=this.message;if(this.nodes)for(const i of this.nodes)i.loc&&(r+=`
3
11
 
4
- export default defineObject({
5
- universalIdentifier: '${_i.v4()}',
6
- nameSingular: '${n.nameSingular}',
7
- namePlural: '${n.namePlural}',
8
- labelSingular: '${n.labelSingular}',
9
- labelPlural: '${n.labelPlural}',
10
- icon: 'IconBox',
11
- fields: [
12
- // Add your fields here using defineField helper
13
- // Example:
14
- // {
15
- // universalIdentifier: '...',
16
- // type: FieldMetadataType.TEXT,
17
- // name: 'description',
18
- // label: 'Description',
19
- // },
20
- ],
21
- });
22
- `,fv=({name:n,universalIdentifier:i=_i.v4()})=>{const r=Ti.default(n),a=_i.v4();return`import { defineFunction } from 'twenty-sdk';
12
+ `+hv(i.loc));else if(this.source&&this.locations)for(const i of this.locations)r+=`
23
13
 
24
- // Handler function - rename and implement your logic
25
- export const handler = async (params: {
26
- a: string;
27
- b: number;
28
- }): Promise<{ message: string }> => {
29
- const { a, b } = params;
30
-
31
- // Replace with your own logic
32
- const message = \`Hello, input: \${a} and \${b}\`;
33
-
34
- return { message };
35
- };
36
-
37
- export default defineFunction({
38
- universalIdentifier: '${i}',
39
- name: '${r}',
40
- description: 'Add a description for your function',
41
- timeoutSeconds: 5,
42
- handler,
43
- triggers: [
44
- // Add your triggers here
45
- // Route trigger example:
46
- // {
47
- // universalIdentifier: '${a}',
48
- // type: 'route',
49
- // path: '/${r}',
50
- // httpMethod: 'POST',
51
- // isAuthRequired: true,
52
- // },
53
- // Cron trigger example:
54
- // {
55
- // universalIdentifier: '...',
56
- // type: 'cron',
57
- // pattern: '0 0 * * *', // Daily at midnight
58
- // },
59
- // Database event trigger example:
60
- // {
61
- // universalIdentifier: '...',
62
- // type: 'databaseEvent',
63
- // eventName: 'objectName.created',
64
- // },
65
- ],
66
- });
67
- `},pv=({name:n,universalIdentifier:i=_i.v4()})=>{const r=Ti.default(n);return`import { defineRole } from 'twenty-sdk';
68
-
69
- export const ${r.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
70
- '${i}';
71
-
72
- export default defineRole({
73
- universalIdentifier: ${r.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER,
74
- label: '${n}',
75
- description: 'Add a description for your role',
76
- canReadAllObjectRecords: true,
77
- canUpdateAllObjectRecords: true,
78
- canSoftDeleteAllObjectRecords: true,
79
- canDestroyAllObjectRecords: false,
80
- });
81
- `};var pr={exports:{}};/**
82
- * @license
83
- * Lodash <https://lodash.com/>
84
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
85
- * Released under MIT license <https://lodash.com/license>
86
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
87
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
88
- */var hv=pr.exports,Hu;function dv(){return Hu||(Hu=1,function(n,i){(function(){var r,a="4.17.21",u=200,p="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",v="Expected a function",I="Invalid `variable` option passed into `_.template`",N="__lodash_hash_undefined__",R=500,O="__lodash_placeholder__",M=1,Z=2,ce=4,W=1,Te=2,fe=1,ve=2,tn=4,ye=8,Ne=16,Re=32,Qe=64,Ue=128,nn=256,x=512,G=30,ze="...",Li=800,Zc=16,yo=1,el=2,tl=3,rn=1/0,Bt=9007199254740991,nl=17976931348623157e292,Er=NaN,Tt=4294967295,rl=Tt-1,il=Tt>>>1,sl=[["ary",Ue],["bind",fe],["bindKey",ve],["curry",ye],["curryRight",Ne],["flip",x],["partial",Re],["partialRight",Qe],["rearg",nn]],yn="[object Arguments]",Ir="[object Array]",ol="[object AsyncFunction]",Wn="[object Boolean]",jn="[object Date]",al="[object DOMException]",xr="[object Error]",Ar="[object Function]",_o="[object GeneratorFunction]",ct="[object Map]",qn="[object Number]",ul="[object Null]",bt="[object Object]",To="[object Promise]",cl="[object Proxy]",Jn="[object RegExp]",lt="[object Set]",Qn="[object String]",Nr="[object Symbol]",ll="[object Undefined]",zn="[object WeakMap]",fl="[object WeakSet]",Yn="[object ArrayBuffer]",_n="[object DataView]",Ri="[object Float32Array]",Ci="[object Float64Array]",Di="[object Int8Array]",Fi="[object Int16Array]",ki="[object Int32Array]",Ui="[object Uint8Array]",$i="[object Uint8ClampedArray]",Pi="[object Uint16Array]",Mi="[object Uint32Array]",pl=/\b__p \+= '';/g,hl=/\b(__p \+=) '' \+/g,dl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wo=/&(?:amp|lt|gt|quot|#39);/g,Eo=/[&<>"']/g,gl=RegExp(wo.source),ml=RegExp(Eo.source),vl=/<%-([\s\S]+?)%>/g,yl=/<%([\s\S]+?)%>/g,Io=/<%=([\s\S]+?)%>/g,_l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tl=/^\w*$/,wl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bi=/[\\^$.*+?()[\]{}|]/g,El=RegExp(Bi.source),Gi=/^\s+/,Il=/\s/,xl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Al=/\{\n\/\* \[wrapped with (.+)\] \*/,Nl=/,? & /,bl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Sl=/[()=,{}\[\]\/\s]/,Ol=/\\(\\)?/g,Ll=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,xo=/\w*$/,Rl=/^[-+]0x[0-9a-f]+$/i,Cl=/^0b[01]+$/i,Dl=/^\[object .+?Constructor\]$/,Fl=/^0o[0-7]+$/i,kl=/^(?:0|[1-9]\d*)$/,Ul=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,br=/($^)/,$l=/['\n\r\u2028\u2029\\]/g,Sr="\\ud800-\\udfff",Pl="\\u0300-\\u036f",Ml="\\ufe20-\\ufe2f",Bl="\\u20d0-\\u20ff",Ao=Pl+Ml+Bl,No="\\u2700-\\u27bf",bo="a-z\\xdf-\\xf6\\xf8-\\xff",Gl="\\xac\\xb1\\xd7\\xf7",Vl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wl="\\u2000-\\u206f",jl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",So="A-Z\\xc0-\\xd6\\xd8-\\xde",Oo="\\ufe0e\\ufe0f",Lo=Gl+Vl+Wl+jl,Vi="['’]",ql="["+Sr+"]",Ro="["+Lo+"]",Or="["+Ao+"]",Co="\\d+",Jl="["+No+"]",Do="["+bo+"]",Fo="[^"+Sr+Lo+Co+No+bo+So+"]",Wi="\\ud83c[\\udffb-\\udfff]",Ql="(?:"+Or+"|"+Wi+")",ko="[^"+Sr+"]",ji="(?:\\ud83c[\\udde6-\\uddff]){2}",qi="[\\ud800-\\udbff][\\udc00-\\udfff]",Tn="["+So+"]",Uo="\\u200d",$o="(?:"+Do+"|"+Fo+")",zl="(?:"+Tn+"|"+Fo+")",Po="(?:"+Vi+"(?:d|ll|m|re|s|t|ve))?",Mo="(?:"+Vi+"(?:D|LL|M|RE|S|T|VE))?",Bo=Ql+"?",Go="["+Oo+"]?",Yl="(?:"+Uo+"(?:"+[ko,ji,qi].join("|")+")"+Go+Bo+")*",Hl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Kl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vo=Go+Bo+Yl,Xl="(?:"+[Jl,ji,qi].join("|")+")"+Vo,Zl="(?:"+[ko+Or+"?",Or,ji,qi,ql].join("|")+")",ef=RegExp(Vi,"g"),tf=RegExp(Or,"g"),Ji=RegExp(Wi+"(?="+Wi+")|"+Zl+Vo,"g"),nf=RegExp([Tn+"?"+Do+"+"+Po+"(?="+[Ro,Tn,"$"].join("|")+")",zl+"+"+Mo+"(?="+[Ro,Tn+$o,"$"].join("|")+")",Tn+"?"+$o+"+"+Po,Tn+"+"+Mo,Kl,Hl,Co,Xl].join("|"),"g"),rf=RegExp("["+Uo+Sr+Ao+Oo+"]"),sf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,of=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],af=-1,ue={};ue[Ri]=ue[Ci]=ue[Di]=ue[Fi]=ue[ki]=ue[Ui]=ue[$i]=ue[Pi]=ue[Mi]=!0,ue[yn]=ue[Ir]=ue[Yn]=ue[Wn]=ue[_n]=ue[jn]=ue[xr]=ue[Ar]=ue[ct]=ue[qn]=ue[bt]=ue[Jn]=ue[lt]=ue[Qn]=ue[zn]=!1;var ae={};ae[yn]=ae[Ir]=ae[Yn]=ae[_n]=ae[Wn]=ae[jn]=ae[Ri]=ae[Ci]=ae[Di]=ae[Fi]=ae[ki]=ae[ct]=ae[qn]=ae[bt]=ae[Jn]=ae[lt]=ae[Qn]=ae[Nr]=ae[Ui]=ae[$i]=ae[Pi]=ae[Mi]=!0,ae[xr]=ae[Ar]=ae[zn]=!1;var uf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},cf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},lf={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ff={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pf=parseFloat,hf=parseInt,Wo=typeof kn.commonjsGlobal=="object"&&kn.commonjsGlobal&&kn.commonjsGlobal.Object===Object&&kn.commonjsGlobal,df=typeof self=="object"&&self&&self.Object===Object&&self,be=Wo||df||Function("return this")(),Qi=i&&!i.nodeType&&i,sn=Qi&&!0&&n&&!n.nodeType&&n,jo=sn&&sn.exports===Qi,zi=jo&&Wo.process,Ye=function(){try{var g=sn&&sn.require&&sn.require("util").types;return g||zi&&zi.binding&&zi.binding("util")}catch{}}(),qo=Ye&&Ye.isArrayBuffer,Jo=Ye&&Ye.isDate,Qo=Ye&&Ye.isMap,zo=Ye&&Ye.isRegExp,Yo=Ye&&Ye.isSet,Ho=Ye&&Ye.isTypedArray;function Ge(g,_,y){switch(y.length){case 0:return g.call(_);case 1:return g.call(_,y[0]);case 2:return g.call(_,y[0],y[1]);case 3:return g.call(_,y[0],y[1],y[2])}return g.apply(_,y)}function gf(g,_,y,L){for(var B=-1,ee=g==null?0:g.length;++B<ee;){var we=g[B];_(L,we,y(we),g)}return L}function He(g,_){for(var y=-1,L=g==null?0:g.length;++y<L&&_(g[y],y,g)!==!1;);return g}function mf(g,_){for(var y=g==null?0:g.length;y--&&_(g[y],y,g)!==!1;);return g}function Ko(g,_){for(var y=-1,L=g==null?0:g.length;++y<L;)if(!_(g[y],y,g))return!1;return!0}function Gt(g,_){for(var y=-1,L=g==null?0:g.length,B=0,ee=[];++y<L;){var we=g[y];_(we,y,g)&&(ee[B++]=we)}return ee}function Lr(g,_){var y=g==null?0:g.length;return!!y&&wn(g,_,0)>-1}function Yi(g,_,y){for(var L=-1,B=g==null?0:g.length;++L<B;)if(y(_,g[L]))return!0;return!1}function le(g,_){for(var y=-1,L=g==null?0:g.length,B=Array(L);++y<L;)B[y]=_(g[y],y,g);return B}function Vt(g,_){for(var y=-1,L=_.length,B=g.length;++y<L;)g[B+y]=_[y];return g}function Hi(g,_,y,L){var B=-1,ee=g==null?0:g.length;for(L&&ee&&(y=g[++B]);++B<ee;)y=_(y,g[B],B,g);return y}function vf(g,_,y,L){var B=g==null?0:g.length;for(L&&B&&(y=g[--B]);B--;)y=_(y,g[B],B,g);return y}function Ki(g,_){for(var y=-1,L=g==null?0:g.length;++y<L;)if(_(g[y],y,g))return!0;return!1}var yf=Xi("length");function _f(g){return g.split("")}function Tf(g){return g.match(bl)||[]}function Xo(g,_,y){var L;return y(g,function(B,ee,we){if(_(B,ee,we))return L=ee,!1}),L}function Rr(g,_,y,L){for(var B=g.length,ee=y+(L?1:-1);L?ee--:++ee<B;)if(_(g[ee],ee,g))return ee;return-1}function wn(g,_,y){return _===_?Cf(g,_,y):Rr(g,Zo,y)}function wf(g,_,y,L){for(var B=y-1,ee=g.length;++B<ee;)if(L(g[B],_))return B;return-1}function Zo(g){return g!==g}function ea(g,_){var y=g==null?0:g.length;return y?es(g,_)/y:Er}function Xi(g){return function(_){return _==null?r:_[g]}}function Zi(g){return function(_){return g==null?r:g[_]}}function ta(g,_,y,L,B){return B(g,function(ee,we,se){y=L?(L=!1,ee):_(y,ee,we,se)}),y}function Ef(g,_){var y=g.length;for(g.sort(_);y--;)g[y]=g[y].value;return g}function es(g,_){for(var y,L=-1,B=g.length;++L<B;){var ee=_(g[L]);ee!==r&&(y=y===r?ee:y+ee)}return y}function ts(g,_){for(var y=-1,L=Array(g);++y<g;)L[y]=_(y);return L}function If(g,_){return le(_,function(y){return[y,g[y]]})}function na(g){return g&&g.slice(0,oa(g)+1).replace(Gi,"")}function Ve(g){return function(_){return g(_)}}function ns(g,_){return le(_,function(y){return g[y]})}function Hn(g,_){return g.has(_)}function ra(g,_){for(var y=-1,L=g.length;++y<L&&wn(_,g[y],0)>-1;);return y}function ia(g,_){for(var y=g.length;y--&&wn(_,g[y],0)>-1;);return y}function xf(g,_){for(var y=g.length,L=0;y--;)g[y]===_&&++L;return L}var Af=Zi(uf),Nf=Zi(cf);function bf(g){return"\\"+ff[g]}function Sf(g,_){return g==null?r:g[_]}function En(g){return rf.test(g)}function Of(g){return sf.test(g)}function Lf(g){for(var _,y=[];!(_=g.next()).done;)y.push(_.value);return y}function rs(g){var _=-1,y=Array(g.size);return g.forEach(function(L,B){y[++_]=[B,L]}),y}function sa(g,_){return function(y){return g(_(y))}}function Wt(g,_){for(var y=-1,L=g.length,B=0,ee=[];++y<L;){var we=g[y];(we===_||we===O)&&(g[y]=O,ee[B++]=y)}return ee}function Cr(g){var _=-1,y=Array(g.size);return g.forEach(function(L){y[++_]=L}),y}function Rf(g){var _=-1,y=Array(g.size);return g.forEach(function(L){y[++_]=[L,L]}),y}function Cf(g,_,y){for(var L=y-1,B=g.length;++L<B;)if(g[L]===_)return L;return-1}function Df(g,_,y){for(var L=y+1;L--;)if(g[L]===_)return L;return L}function In(g){return En(g)?kf(g):yf(g)}function ft(g){return En(g)?Uf(g):_f(g)}function oa(g){for(var _=g.length;_--&&Il.test(g.charAt(_)););return _}var Ff=Zi(lf);function kf(g){for(var _=Ji.lastIndex=0;Ji.test(g);)++_;return _}function Uf(g){return g.match(Ji)||[]}function $f(g){return g.match(nf)||[]}var Pf=function g(_){_=_==null?be:xn.defaults(be.Object(),_,xn.pick(be,of));var y=_.Array,L=_.Date,B=_.Error,ee=_.Function,we=_.Math,se=_.Object,is=_.RegExp,Mf=_.String,Ke=_.TypeError,Dr=y.prototype,Bf=ee.prototype,An=se.prototype,Fr=_["__core-js_shared__"],kr=Bf.toString,ie=An.hasOwnProperty,Gf=0,aa=function(){var e=/[^.]+$/.exec(Fr&&Fr.keys&&Fr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ur=An.toString,Vf=kr.call(se),Wf=be._,jf=is("^"+kr.call(ie).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$r=jo?_.Buffer:r,jt=_.Symbol,Pr=_.Uint8Array,ua=$r?$r.allocUnsafe:r,Mr=sa(se.getPrototypeOf,se),ca=se.create,la=An.propertyIsEnumerable,Br=Dr.splice,fa=jt?jt.isConcatSpreadable:r,Kn=jt?jt.iterator:r,on=jt?jt.toStringTag:r,Gr=function(){try{var e=fn(se,"defineProperty");return e({},"",{}),e}catch{}}(),qf=_.clearTimeout!==be.clearTimeout&&_.clearTimeout,Jf=L&&L.now!==be.Date.now&&L.now,Qf=_.setTimeout!==be.setTimeout&&_.setTimeout,Vr=we.ceil,Wr=we.floor,ss=se.getOwnPropertySymbols,zf=$r?$r.isBuffer:r,pa=_.isFinite,Yf=Dr.join,Hf=sa(se.keys,se),Ee=we.max,Oe=we.min,Kf=L.now,Xf=_.parseInt,ha=we.random,Zf=Dr.reverse,os=fn(_,"DataView"),Xn=fn(_,"Map"),as=fn(_,"Promise"),Nn=fn(_,"Set"),Zn=fn(_,"WeakMap"),er=fn(se,"create"),jr=Zn&&new Zn,bn={},ep=pn(os),tp=pn(Xn),np=pn(as),rp=pn(Nn),ip=pn(Zn),qr=jt?jt.prototype:r,tr=qr?qr.valueOf:r,da=qr?qr.toString:r;function l(e){if(he(e)&&!V(e)&&!(e instanceof z)){if(e instanceof Xe)return e;if(ie.call(e,"__wrapped__"))return gu(e)}return new Xe(e)}var Sn=function(){function e(){}return function(t){if(!pe(t))return{};if(ca)return ca(t);e.prototype=t;var s=new e;return e.prototype=r,s}}();function Jr(){}function Xe(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}l.templateSettings={escape:vl,evaluate:yl,interpolate:Io,variable:"",imports:{_:l}},l.prototype=Jr.prototype,l.prototype.constructor=l,Xe.prototype=Sn(Jr.prototype),Xe.prototype.constructor=Xe;function z(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Tt,this.__views__=[]}function sp(){var e=new z(this.__wrapped__);return e.__actions__=$e(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=$e(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=$e(this.__views__),e}function op(){if(this.__filtered__){var e=new z(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function ap(){var e=this.__wrapped__.value(),t=this.__dir__,s=V(e),o=t<0,c=s?e.length:0,f=_h(0,c,this.__views__),h=f.start,d=f.end,m=d-h,T=o?d:h-1,w=this.__iteratees__,A=w.length,S=0,D=Oe(m,this.__takeCount__);if(!s||!o&&c==m&&D==m)return Pa(e,this.__actions__);var U=[];e:for(;m--&&S<D;){T+=t;for(var q=-1,$=e[T];++q<A;){var Q=w[q],H=Q.iteratee,qe=Q.type,Fe=H($);if(qe==el)$=Fe;else if(!Fe){if(qe==yo)continue e;break e}}U[S++]=$}return U}z.prototype=Sn(Jr.prototype),z.prototype.constructor=z;function an(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function up(){this.__data__=er?er(null):{},this.size=0}function cp(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function lp(e){var t=this.__data__;if(er){var s=t[e];return s===N?r:s}return ie.call(t,e)?t[e]:r}function fp(e){var t=this.__data__;return er?t[e]!==r:ie.call(t,e)}function pp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=er&&t===r?N:t,this}an.prototype.clear=up,an.prototype.delete=cp,an.prototype.get=lp,an.prototype.has=fp,an.prototype.set=pp;function St(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function hp(){this.__data__=[],this.size=0}function dp(e){var t=this.__data__,s=Qr(t,e);if(s<0)return!1;var o=t.length-1;return s==o?t.pop():Br.call(t,s,1),--this.size,!0}function gp(e){var t=this.__data__,s=Qr(t,e);return s<0?r:t[s][1]}function mp(e){return Qr(this.__data__,e)>-1}function vp(e,t){var s=this.__data__,o=Qr(s,e);return o<0?(++this.size,s.push([e,t])):s[o][1]=t,this}St.prototype.clear=hp,St.prototype.delete=dp,St.prototype.get=gp,St.prototype.has=mp,St.prototype.set=vp;function Ot(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var o=e[t];this.set(o[0],o[1])}}function yp(){this.size=0,this.__data__={hash:new an,map:new(Xn||St),string:new an}}function _p(e){var t=si(this,e).delete(e);return this.size-=t?1:0,t}function Tp(e){return si(this,e).get(e)}function wp(e){return si(this,e).has(e)}function Ep(e,t){var s=si(this,e),o=s.size;return s.set(e,t),this.size+=s.size==o?0:1,this}Ot.prototype.clear=yp,Ot.prototype.delete=_p,Ot.prototype.get=Tp,Ot.prototype.has=wp,Ot.prototype.set=Ep;function un(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Ot;++t<s;)this.add(e[t])}function Ip(e){return this.__data__.set(e,N),this}function xp(e){return this.__data__.has(e)}un.prototype.add=un.prototype.push=Ip,un.prototype.has=xp;function pt(e){var t=this.__data__=new St(e);this.size=t.size}function Ap(){this.__data__=new St,this.size=0}function Np(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function bp(e){return this.__data__.get(e)}function Sp(e){return this.__data__.has(e)}function Op(e,t){var s=this.__data__;if(s instanceof St){var o=s.__data__;if(!Xn||o.length<u-1)return o.push([e,t]),this.size=++s.size,this;s=this.__data__=new Ot(o)}return s.set(e,t),this.size=s.size,this}pt.prototype.clear=Ap,pt.prototype.delete=Np,pt.prototype.get=bp,pt.prototype.has=Sp,pt.prototype.set=Op;function ga(e,t){var s=V(e),o=!s&&hn(e),c=!s&&!o&&Yt(e),f=!s&&!o&&!c&&Cn(e),h=s||o||c||f,d=h?ts(e.length,Mf):[],m=d.length;for(var T in e)(t||ie.call(e,T))&&!(h&&(T=="length"||c&&(T=="offset"||T=="parent")||f&&(T=="buffer"||T=="byteLength"||T=="byteOffset")||Dt(T,m)))&&d.push(T);return d}function ma(e){var t=e.length;return t?e[ys(0,t-1)]:r}function Lp(e,t){return oi($e(e),cn(t,0,e.length))}function Rp(e){return oi($e(e))}function us(e,t,s){(s!==r&&!ht(e[t],s)||s===r&&!(t in e))&&Lt(e,t,s)}function nr(e,t,s){var o=e[t];(!(ie.call(e,t)&&ht(o,s))||s===r&&!(t in e))&&Lt(e,t,s)}function Qr(e,t){for(var s=e.length;s--;)if(ht(e[s][0],t))return s;return-1}function Cp(e,t,s,o){return qt(e,function(c,f,h){t(o,c,s(c),h)}),o}function va(e,t){return e&&Et(t,xe(t),e)}function Dp(e,t){return e&&Et(t,Me(t),e)}function Lt(e,t,s){t=="__proto__"&&Gr?Gr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function cs(e,t){for(var s=-1,o=t.length,c=y(o),f=e==null;++s<o;)c[s]=f?r:Ws(e,t[s]);return c}function cn(e,t,s){return e===e&&(s!==r&&(e=e<=s?e:s),t!==r&&(e=e>=t?e:t)),e}function Ze(e,t,s,o,c,f){var h,d=t&M,m=t&Z,T=t&ce;if(s&&(h=c?s(e,o,c,f):s(e)),h!==r)return h;if(!pe(e))return e;var w=V(e);if(w){if(h=wh(e),!d)return $e(e,h)}else{var A=Le(e),S=A==Ar||A==_o;if(Yt(e))return Ga(e,d);if(A==bt||A==yn||S&&!c){if(h=m||S?{}:ou(e),!d)return m?lh(e,Dp(h,e)):ch(e,va(h,e))}else{if(!ae[A])return c?e:{};h=Eh(e,A,d)}}f||(f=new pt);var D=f.get(e);if(D)return D;f.set(e,h),ku(e)?e.forEach(function($){h.add(Ze($,t,s,$,e,f))}):Du(e)&&e.forEach(function($,Q){h.set(Q,Ze($,t,s,Q,e,f))});var U=T?m?Os:Ss:m?Me:xe,q=w?r:U(e);return He(q||e,function($,Q){q&&(Q=$,$=e[Q]),nr(h,Q,Ze($,t,s,Q,e,f))}),h}function Fp(e){var t=xe(e);return function(s){return ya(s,e,t)}}function ya(e,t,s){var o=s.length;if(e==null)return!o;for(e=se(e);o--;){var c=s[o],f=t[c],h=e[c];if(h===r&&!(c in e)||!f(h))return!1}return!0}function _a(e,t,s){if(typeof e!="function")throw new Ke(v);return cr(function(){e.apply(r,s)},t)}function rr(e,t,s,o){var c=-1,f=Lr,h=!0,d=e.length,m=[],T=t.length;if(!d)return m;s&&(t=le(t,Ve(s))),o?(f=Yi,h=!1):t.length>=u&&(f=Hn,h=!1,t=new un(t));e:for(;++c<d;){var w=e[c],A=s==null?w:s(w);if(w=o||w!==0?w:0,h&&A===A){for(var S=T;S--;)if(t[S]===A)continue e;m.push(w)}else f(t,A,o)||m.push(w)}return m}var qt=Ja(wt),Ta=Ja(fs,!0);function kp(e,t){var s=!0;return qt(e,function(o,c,f){return s=!!t(o,c,f),s}),s}function zr(e,t,s){for(var o=-1,c=e.length;++o<c;){var f=e[o],h=t(f);if(h!=null&&(d===r?h===h&&!je(h):s(h,d)))var d=h,m=f}return m}function Up(e,t,s,o){var c=e.length;for(s=j(s),s<0&&(s=-s>c?0:c+s),o=o===r||o>c?c:j(o),o<0&&(o+=c),o=s>o?0:$u(o);s<o;)e[s++]=t;return e}function wa(e,t){var s=[];return qt(e,function(o,c,f){t(o,c,f)&&s.push(o)}),s}function Se(e,t,s,o,c){var f=-1,h=e.length;for(s||(s=xh),c||(c=[]);++f<h;){var d=e[f];t>0&&s(d)?t>1?Se(d,t-1,s,o,c):Vt(c,d):o||(c[c.length]=d)}return c}var ls=Qa(),Ea=Qa(!0);function wt(e,t){return e&&ls(e,t,xe)}function fs(e,t){return e&&Ea(e,t,xe)}function Yr(e,t){return Gt(t,function(s){return Ft(e[s])})}function ln(e,t){t=Qt(t,e);for(var s=0,o=t.length;e!=null&&s<o;)e=e[It(t[s++])];return s&&s==o?e:r}function Ia(e,t,s){var o=t(e);return V(e)?o:Vt(o,s(e))}function Ce(e){return e==null?e===r?ll:ul:on&&on in se(e)?yh(e):Rh(e)}function ps(e,t){return e>t}function $p(e,t){return e!=null&&ie.call(e,t)}function Pp(e,t){return e!=null&&t in se(e)}function Mp(e,t,s){return e>=Oe(t,s)&&e<Ee(t,s)}function hs(e,t,s){for(var o=s?Yi:Lr,c=e[0].length,f=e.length,h=f,d=y(f),m=1/0,T=[];h--;){var w=e[h];h&&t&&(w=le(w,Ve(t))),m=Oe(w.length,m),d[h]=!s&&(t||c>=120&&w.length>=120)?new un(h&&w):r}w=e[0];var A=-1,S=d[0];e:for(;++A<c&&T.length<m;){var D=w[A],U=t?t(D):D;if(D=s||D!==0?D:0,!(S?Hn(S,U):o(T,U,s))){for(h=f;--h;){var q=d[h];if(!(q?Hn(q,U):o(e[h],U,s)))continue e}S&&S.push(U),T.push(D)}}return T}function Bp(e,t,s,o){return wt(e,function(c,f,h){t(o,s(c),f,h)}),o}function ir(e,t,s){t=Qt(t,e),e=lu(e,t);var o=e==null?e:e[It(tt(t))];return o==null?r:Ge(o,e,s)}function xa(e){return he(e)&&Ce(e)==yn}function Gp(e){return he(e)&&Ce(e)==Yn}function Vp(e){return he(e)&&Ce(e)==jn}function sr(e,t,s,o,c){return e===t?!0:e==null||t==null||!he(e)&&!he(t)?e!==e&&t!==t:Wp(e,t,s,o,sr,c)}function Wp(e,t,s,o,c,f){var h=V(e),d=V(t),m=h?Ir:Le(e),T=d?Ir:Le(t);m=m==yn?bt:m,T=T==yn?bt:T;var w=m==bt,A=T==bt,S=m==T;if(S&&Yt(e)){if(!Yt(t))return!1;h=!0,w=!1}if(S&&!w)return f||(f=new pt),h||Cn(e)?ru(e,t,s,o,c,f):mh(e,t,m,s,o,c,f);if(!(s&W)){var D=w&&ie.call(e,"__wrapped__"),U=A&&ie.call(t,"__wrapped__");if(D||U){var q=D?e.value():e,$=U?t.value():t;return f||(f=new pt),c(q,$,s,o,f)}}return S?(f||(f=new pt),vh(e,t,s,o,c,f)):!1}function jp(e){return he(e)&&Le(e)==ct}function ds(e,t,s,o){var c=s.length,f=c,h=!o;if(e==null)return!f;for(e=se(e);c--;){var d=s[c];if(h&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<f;){d=s[c];var m=d[0],T=e[m],w=d[1];if(h&&d[2]){if(T===r&&!(m in e))return!1}else{var A=new pt;if(o)var S=o(T,w,m,e,t,A);if(!(S===r?sr(w,T,W|Te,o,A):S))return!1}}return!0}function Aa(e){if(!pe(e)||Nh(e))return!1;var t=Ft(e)?jf:Dl;return t.test(pn(e))}function qp(e){return he(e)&&Ce(e)==Jn}function Jp(e){return he(e)&&Le(e)==lt}function Qp(e){return he(e)&&pi(e.length)&&!!ue[Ce(e)]}function Na(e){return typeof e=="function"?e:e==null?Be:typeof e=="object"?V(e)?Oa(e[0],e[1]):Sa(e):zu(e)}function gs(e){if(!ur(e))return Hf(e);var t=[];for(var s in se(e))ie.call(e,s)&&s!="constructor"&&t.push(s);return t}function zp(e){if(!pe(e))return Lh(e);var t=ur(e),s=[];for(var o in e)o=="constructor"&&(t||!ie.call(e,o))||s.push(o);return s}function ms(e,t){return e<t}function ba(e,t){var s=-1,o=Pe(e)?y(e.length):[];return qt(e,function(c,f,h){o[++s]=t(c,f,h)}),o}function Sa(e){var t=Rs(e);return t.length==1&&t[0][2]?uu(t[0][0],t[0][1]):function(s){return s===e||ds(s,e,t)}}function Oa(e,t){return Ds(e)&&au(t)?uu(It(e),t):function(s){var o=Ws(s,e);return o===r&&o===t?js(s,e):sr(t,o,W|Te)}}function Hr(e,t,s,o,c){e!==t&&ls(t,function(f,h){if(c||(c=new pt),pe(f))Yp(e,t,h,s,Hr,o,c);else{var d=o?o(ks(e,h),f,h+"",e,t,c):r;d===r&&(d=f),us(e,h,d)}},Me)}function Yp(e,t,s,o,c,f,h){var d=ks(e,s),m=ks(t,s),T=h.get(m);if(T){us(e,s,T);return}var w=f?f(d,m,s+"",e,t,h):r,A=w===r;if(A){var S=V(m),D=!S&&Yt(m),U=!S&&!D&&Cn(m);w=m,S||D||U?V(d)?w=d:de(d)?w=$e(d):D?(A=!1,w=Ga(m,!0)):U?(A=!1,w=Va(m,!0)):w=[]:lr(m)||hn(m)?(w=d,hn(d)?w=Pu(d):(!pe(d)||Ft(d))&&(w=ou(m))):A=!1}A&&(h.set(m,w),c(w,m,o,f,h),h.delete(m)),us(e,s,w)}function La(e,t){var s=e.length;if(s)return t+=t<0?s:0,Dt(t,s)?e[t]:r}function Ra(e,t,s){t.length?t=le(t,function(f){return V(f)?function(h){return ln(h,f.length===1?f[0]:f)}:f}):t=[Be];var o=-1;t=le(t,Ve(k()));var c=ba(e,function(f,h,d){var m=le(t,function(T){return T(f)});return{criteria:m,index:++o,value:f}});return Ef(c,function(f,h){return uh(f,h,s)})}function Hp(e,t){return Ca(e,t,function(s,o){return js(e,o)})}function Ca(e,t,s){for(var o=-1,c=t.length,f={};++o<c;){var h=t[o],d=ln(e,h);s(d,h)&&or(f,Qt(h,e),d)}return f}function Kp(e){return function(t){return ln(t,e)}}function vs(e,t,s,o){var c=o?wf:wn,f=-1,h=t.length,d=e;for(e===t&&(t=$e(t)),s&&(d=le(e,Ve(s)));++f<h;)for(var m=0,T=t[f],w=s?s(T):T;(m=c(d,w,m,o))>-1;)d!==e&&Br.call(d,m,1),Br.call(e,m,1);return e}function Da(e,t){for(var s=e?t.length:0,o=s-1;s--;){var c=t[s];if(s==o||c!==f){var f=c;Dt(c)?Br.call(e,c,1):ws(e,c)}}return e}function ys(e,t){return e+Wr(ha()*(t-e+1))}function Xp(e,t,s,o){for(var c=-1,f=Ee(Vr((t-e)/(s||1)),0),h=y(f);f--;)h[o?f:++c]=e,e+=s;return h}function _s(e,t){var s="";if(!e||t<1||t>Bt)return s;do t%2&&(s+=e),t=Wr(t/2),t&&(e+=e);while(t);return s}function J(e,t){return Us(cu(e,t,Be),e+"")}function Zp(e){return ma(Dn(e))}function eh(e,t){var s=Dn(e);return oi(s,cn(t,0,s.length))}function or(e,t,s,o){if(!pe(e))return e;t=Qt(t,e);for(var c=-1,f=t.length,h=f-1,d=e;d!=null&&++c<f;){var m=It(t[c]),T=s;if(m==="__proto__"||m==="constructor"||m==="prototype")return e;if(c!=h){var w=d[m];T=o?o(w,m,d):r,T===r&&(T=pe(w)?w:Dt(t[c+1])?[]:{})}nr(d,m,T),d=d[m]}return e}var Fa=jr?function(e,t){return jr.set(e,t),e}:Be,th=Gr?function(e,t){return Gr(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:Be;function nh(e){return oi(Dn(e))}function et(e,t,s){var o=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var f=y(c);++o<c;)f[o]=e[o+t];return f}function rh(e,t){var s;return qt(e,function(o,c,f){return s=t(o,c,f),!s}),!!s}function Kr(e,t,s){var o=0,c=e==null?o:e.length;if(typeof t=="number"&&t===t&&c<=il){for(;o<c;){var f=o+c>>>1,h=e[f];h!==null&&!je(h)&&(s?h<=t:h<t)?o=f+1:c=f}return c}return Ts(e,t,Be,s)}function Ts(e,t,s,o){var c=0,f=e==null?0:e.length;if(f===0)return 0;t=s(t);for(var h=t!==t,d=t===null,m=je(t),T=t===r;c<f;){var w=Wr((c+f)/2),A=s(e[w]),S=A!==r,D=A===null,U=A===A,q=je(A);if(h)var $=o||U;else T?$=U&&(o||S):d?$=U&&S&&(o||!D):m?$=U&&S&&!D&&(o||!q):D||q?$=!1:$=o?A<=t:A<t;$?c=w+1:f=w}return Oe(f,rl)}function ka(e,t){for(var s=-1,o=e.length,c=0,f=[];++s<o;){var h=e[s],d=t?t(h):h;if(!s||!ht(d,m)){var m=d;f[c++]=h===0?0:h}}return f}function Ua(e){return typeof e=="number"?e:je(e)?Er:+e}function We(e){if(typeof e=="string")return e;if(V(e))return le(e,We)+"";if(je(e))return da?da.call(e):"";var t=e+"";return t=="0"&&1/e==-rn?"-0":t}function Jt(e,t,s){var o=-1,c=Lr,f=e.length,h=!0,d=[],m=d;if(s)h=!1,c=Yi;else if(f>=u){var T=t?null:dh(e);if(T)return Cr(T);h=!1,c=Hn,m=new un}else m=t?[]:d;e:for(;++o<f;){var w=e[o],A=t?t(w):w;if(w=s||w!==0?w:0,h&&A===A){for(var S=m.length;S--;)if(m[S]===A)continue e;t&&m.push(A),d.push(w)}else c(m,A,s)||(m!==d&&m.push(A),d.push(w))}return d}function ws(e,t){return t=Qt(t,e),e=lu(e,t),e==null||delete e[It(tt(t))]}function $a(e,t,s,o){return or(e,t,s(ln(e,t)),o)}function Xr(e,t,s,o){for(var c=e.length,f=o?c:-1;(o?f--:++f<c)&&t(e[f],f,e););return s?et(e,o?0:f,o?f+1:c):et(e,o?f+1:0,o?c:f)}function Pa(e,t){var s=e;return s instanceof z&&(s=s.value()),Hi(t,function(o,c){return c.func.apply(c.thisArg,Vt([o],c.args))},s)}function Es(e,t,s){var o=e.length;if(o<2)return o?Jt(e[0]):[];for(var c=-1,f=y(o);++c<o;)for(var h=e[c],d=-1;++d<o;)d!=c&&(f[c]=rr(f[c]||h,e[d],t,s));return Jt(Se(f,1),t,s)}function Ma(e,t,s){for(var o=-1,c=e.length,f=t.length,h={};++o<c;){var d=o<f?t[o]:r;s(h,e[o],d)}return h}function Is(e){return de(e)?e:[]}function xs(e){return typeof e=="function"?e:Be}function Qt(e,t){return V(e)?e:Ds(e,t)?[e]:du(ne(e))}var ih=J;function zt(e,t,s){var o=e.length;return s=s===r?o:s,!t&&s>=o?e:et(e,t,s)}var Ba=qf||function(e){return be.clearTimeout(e)};function Ga(e,t){if(t)return e.slice();var s=e.length,o=ua?ua(s):new e.constructor(s);return e.copy(o),o}function As(e){var t=new e.constructor(e.byteLength);return new Pr(t).set(new Pr(e)),t}function sh(e,t){var s=t?As(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function oh(e){var t=new e.constructor(e.source,xo.exec(e));return t.lastIndex=e.lastIndex,t}function ah(e){return tr?se(tr.call(e)):{}}function Va(e,t){var s=t?As(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function Wa(e,t){if(e!==t){var s=e!==r,o=e===null,c=e===e,f=je(e),h=t!==r,d=t===null,m=t===t,T=je(t);if(!d&&!T&&!f&&e>t||f&&h&&m&&!d&&!T||o&&h&&m||!s&&m||!c)return 1;if(!o&&!f&&!T&&e<t||T&&s&&c&&!o&&!f||d&&s&&c||!h&&c||!m)return-1}return 0}function uh(e,t,s){for(var o=-1,c=e.criteria,f=t.criteria,h=c.length,d=s.length;++o<h;){var m=Wa(c[o],f[o]);if(m){if(o>=d)return m;var T=s[o];return m*(T=="desc"?-1:1)}}return e.index-t.index}function ja(e,t,s,o){for(var c=-1,f=e.length,h=s.length,d=-1,m=t.length,T=Ee(f-h,0),w=y(m+T),A=!o;++d<m;)w[d]=t[d];for(;++c<h;)(A||c<f)&&(w[s[c]]=e[c]);for(;T--;)w[d++]=e[c++];return w}function qa(e,t,s,o){for(var c=-1,f=e.length,h=-1,d=s.length,m=-1,T=t.length,w=Ee(f-d,0),A=y(w+T),S=!o;++c<w;)A[c]=e[c];for(var D=c;++m<T;)A[D+m]=t[m];for(;++h<d;)(S||c<f)&&(A[D+s[h]]=e[c++]);return A}function $e(e,t){var s=-1,o=e.length;for(t||(t=y(o));++s<o;)t[s]=e[s];return t}function Et(e,t,s,o){var c=!s;s||(s={});for(var f=-1,h=t.length;++f<h;){var d=t[f],m=o?o(s[d],e[d],d,s,e):r;m===r&&(m=e[d]),c?Lt(s,d,m):nr(s,d,m)}return s}function ch(e,t){return Et(e,Cs(e),t)}function lh(e,t){return Et(e,iu(e),t)}function Zr(e,t){return function(s,o){var c=V(s)?gf:Cp,f=t?t():{};return c(s,e,k(o,2),f)}}function On(e){return J(function(t,s){var o=-1,c=s.length,f=c>1?s[c-1]:r,h=c>2?s[2]:r;for(f=e.length>3&&typeof f=="function"?(c--,f):r,h&&De(s[0],s[1],h)&&(f=c<3?r:f,c=1),t=se(t);++o<c;){var d=s[o];d&&e(t,d,o,f)}return t})}function Ja(e,t){return function(s,o){if(s==null)return s;if(!Pe(s))return e(s,o);for(var c=s.length,f=t?c:-1,h=se(s);(t?f--:++f<c)&&o(h[f],f,h)!==!1;);return s}}function Qa(e){return function(t,s,o){for(var c=-1,f=se(t),h=o(t),d=h.length;d--;){var m=h[e?d:++c];if(s(f[m],m,f)===!1)break}return t}}function fh(e,t,s){var o=t&fe,c=ar(e);function f(){var h=this&&this!==be&&this instanceof f?c:e;return h.apply(o?s:this,arguments)}return f}function za(e){return function(t){t=ne(t);var s=En(t)?ft(t):r,o=s?s[0]:t.charAt(0),c=s?zt(s,1).join(""):t.slice(1);return o[e]()+c}}function Ln(e){return function(t){return Hi(Ju(qu(t).replace(ef,"")),e,"")}}function ar(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var s=Sn(e.prototype),o=e.apply(s,t);return pe(o)?o:s}}function ph(e,t,s){var o=ar(e);function c(){for(var f=arguments.length,h=y(f),d=f,m=Rn(c);d--;)h[d]=arguments[d];var T=f<3&&h[0]!==m&&h[f-1]!==m?[]:Wt(h,m);if(f-=T.length,f<s)return Za(e,t,ei,c.placeholder,r,h,T,r,r,s-f);var w=this&&this!==be&&this instanceof c?o:e;return Ge(w,this,h)}return c}function Ya(e){return function(t,s,o){var c=se(t);if(!Pe(t)){var f=k(s,3);t=xe(t),s=function(d){return f(c[d],d,c)}}var h=e(t,s,o);return h>-1?c[f?t[h]:h]:r}}function Ha(e){return Ct(function(t){var s=t.length,o=s,c=Xe.prototype.thru;for(e&&t.reverse();o--;){var f=t[o];if(typeof f!="function")throw new Ke(v);if(c&&!h&&ii(f)=="wrapper")var h=new Xe([],!0)}for(o=h?o:s;++o<s;){f=t[o];var d=ii(f),m=d=="wrapper"?Ls(f):r;m&&Fs(m[0])&&m[1]==(Ue|ye|Re|nn)&&!m[4].length&&m[9]==1?h=h[ii(m[0])].apply(h,m[3]):h=f.length==1&&Fs(f)?h[d]():h.thru(f)}return function(){var T=arguments,w=T[0];if(h&&T.length==1&&V(w))return h.plant(w).value();for(var A=0,S=s?t[A].apply(this,T):w;++A<s;)S=t[A].call(this,S);return S}})}function ei(e,t,s,o,c,f,h,d,m,T){var w=t&Ue,A=t&fe,S=t&ve,D=t&(ye|Ne),U=t&x,q=S?r:ar(e);function $(){for(var Q=arguments.length,H=y(Q),qe=Q;qe--;)H[qe]=arguments[qe];if(D)var Fe=Rn($),Je=xf(H,Fe);if(o&&(H=ja(H,o,c,D)),f&&(H=qa(H,f,h,D)),Q-=Je,D&&Q<T){var ge=Wt(H,Fe);return Za(e,t,ei,$.placeholder,s,H,ge,d,m,T-Q)}var dt=A?s:this,Ut=S?dt[e]:e;return Q=H.length,d?H=Ch(H,d):U&&Q>1&&H.reverse(),w&&m<Q&&(H.length=m),this&&this!==be&&this instanceof $&&(Ut=q||ar(Ut)),Ut.apply(dt,H)}return $}function Ka(e,t){return function(s,o){return Bp(s,e,t(o),{})}}function ti(e,t){return function(s,o){var c;if(s===r&&o===r)return t;if(s!==r&&(c=s),o!==r){if(c===r)return o;typeof s=="string"||typeof o=="string"?(s=We(s),o=We(o)):(s=Ua(s),o=Ua(o)),c=e(s,o)}return c}}function Ns(e){return Ct(function(t){return t=le(t,Ve(k())),J(function(s){var o=this;return e(t,function(c){return Ge(c,o,s)})})})}function ni(e,t){t=t===r?" ":We(t);var s=t.length;if(s<2)return s?_s(t,e):t;var o=_s(t,Vr(e/In(t)));return En(t)?zt(ft(o),0,e).join(""):o.slice(0,e)}function hh(e,t,s,o){var c=t&fe,f=ar(e);function h(){for(var d=-1,m=arguments.length,T=-1,w=o.length,A=y(w+m),S=this&&this!==be&&this instanceof h?f:e;++T<w;)A[T]=o[T];for(;m--;)A[T++]=arguments[++d];return Ge(S,c?s:this,A)}return h}function Xa(e){return function(t,s,o){return o&&typeof o!="number"&&De(t,s,o)&&(s=o=r),t=kt(t),s===r?(s=t,t=0):s=kt(s),o=o===r?t<s?1:-1:kt(o),Xp(t,s,o,e)}}function ri(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=nt(t),s=nt(s)),e(t,s)}}function Za(e,t,s,o,c,f,h,d,m,T){var w=t&ye,A=w?h:r,S=w?r:h,D=w?f:r,U=w?r:f;t|=w?Re:Qe,t&=~(w?Qe:Re),t&tn||(t&=-4);var q=[e,t,c,D,A,U,S,d,m,T],$=s.apply(r,q);return Fs(e)&&fu($,q),$.placeholder=o,pu($,e,t)}function bs(e){var t=we[e];return function(s,o){if(s=nt(s),o=o==null?0:Oe(j(o),292),o&&pa(s)){var c=(ne(s)+"e").split("e"),f=t(c[0]+"e"+(+c[1]+o));return c=(ne(f)+"e").split("e"),+(c[0]+"e"+(+c[1]-o))}return t(s)}}var dh=Nn&&1/Cr(new Nn([,-0]))[1]==rn?function(e){return new Nn(e)}:Ys;function eu(e){return function(t){var s=Le(t);return s==ct?rs(t):s==lt?Rf(t):If(t,e(t))}}function Rt(e,t,s,o,c,f,h,d){var m=t&ve;if(!m&&typeof e!="function")throw new Ke(v);var T=o?o.length:0;if(T||(t&=-97,o=c=r),h=h===r?h:Ee(j(h),0),d=d===r?d:j(d),T-=c?c.length:0,t&Qe){var w=o,A=c;o=c=r}var S=m?r:Ls(e),D=[e,t,s,o,c,w,A,f,h,d];if(S&&Oh(D,S),e=D[0],t=D[1],s=D[2],o=D[3],c=D[4],d=D[9]=D[9]===r?m?0:e.length:Ee(D[9]-T,0),!d&&t&(ye|Ne)&&(t&=-25),!t||t==fe)var U=fh(e,t,s);else t==ye||t==Ne?U=ph(e,t,d):(t==Re||t==(fe|Re))&&!c.length?U=hh(e,t,s,o):U=ei.apply(r,D);var q=S?Fa:fu;return pu(q(U,D),e,t)}function tu(e,t,s,o){return e===r||ht(e,An[s])&&!ie.call(o,s)?t:e}function nu(e,t,s,o,c,f){return pe(e)&&pe(t)&&(f.set(t,e),Hr(e,t,r,nu,f),f.delete(t)),e}function gh(e){return lr(e)?r:e}function ru(e,t,s,o,c,f){var h=s&W,d=e.length,m=t.length;if(d!=m&&!(h&&m>d))return!1;var T=f.get(e),w=f.get(t);if(T&&w)return T==t&&w==e;var A=-1,S=!0,D=s&Te?new un:r;for(f.set(e,t),f.set(t,e);++A<d;){var U=e[A],q=t[A];if(o)var $=h?o(q,U,A,t,e,f):o(U,q,A,e,t,f);if($!==r){if($)continue;S=!1;break}if(D){if(!Ki(t,function(Q,H){if(!Hn(D,H)&&(U===Q||c(U,Q,s,o,f)))return D.push(H)})){S=!1;break}}else if(!(U===q||c(U,q,s,o,f))){S=!1;break}}return f.delete(e),f.delete(t),S}function mh(e,t,s,o,c,f,h){switch(s){case _n:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Yn:return!(e.byteLength!=t.byteLength||!f(new Pr(e),new Pr(t)));case Wn:case jn:case qn:return ht(+e,+t);case xr:return e.name==t.name&&e.message==t.message;case Jn:case Qn:return e==t+"";case ct:var d=rs;case lt:var m=o&W;if(d||(d=Cr),e.size!=t.size&&!m)return!1;var T=h.get(e);if(T)return T==t;o|=Te,h.set(e,t);var w=ru(d(e),d(t),o,c,f,h);return h.delete(e),w;case Nr:if(tr)return tr.call(e)==tr.call(t)}return!1}function vh(e,t,s,o,c,f){var h=s&W,d=Ss(e),m=d.length,T=Ss(t),w=T.length;if(m!=w&&!h)return!1;for(var A=m;A--;){var S=d[A];if(!(h?S in t:ie.call(t,S)))return!1}var D=f.get(e),U=f.get(t);if(D&&U)return D==t&&U==e;var q=!0;f.set(e,t),f.set(t,e);for(var $=h;++A<m;){S=d[A];var Q=e[S],H=t[S];if(o)var qe=h?o(H,Q,S,t,e,f):o(Q,H,S,e,t,f);if(!(qe===r?Q===H||c(Q,H,s,o,f):qe)){q=!1;break}$||($=S=="constructor")}if(q&&!$){var Fe=e.constructor,Je=t.constructor;Fe!=Je&&"constructor"in e&&"constructor"in t&&!(typeof Fe=="function"&&Fe instanceof Fe&&typeof Je=="function"&&Je instanceof Je)&&(q=!1)}return f.delete(e),f.delete(t),q}function Ct(e){return Us(cu(e,r,yu),e+"")}function Ss(e){return Ia(e,xe,Cs)}function Os(e){return Ia(e,Me,iu)}var Ls=jr?function(e){return jr.get(e)}:Ys;function ii(e){for(var t=e.name+"",s=bn[t],o=ie.call(bn,t)?s.length:0;o--;){var c=s[o],f=c.func;if(f==null||f==e)return c.name}return t}function Rn(e){var t=ie.call(l,"placeholder")?l:e;return t.placeholder}function k(){var e=l.iteratee||Qs;return e=e===Qs?Na:e,arguments.length?e(arguments[0],arguments[1]):e}function si(e,t){var s=e.__data__;return Ah(t)?s[typeof t=="string"?"string":"hash"]:s.map}function Rs(e){for(var t=xe(e),s=t.length;s--;){var o=t[s],c=e[o];t[s]=[o,c,au(c)]}return t}function fn(e,t){var s=Sf(e,t);return Aa(s)?s:r}function yh(e){var t=ie.call(e,on),s=e[on];try{e[on]=r;var o=!0}catch{}var c=Ur.call(e);return o&&(t?e[on]=s:delete e[on]),c}var Cs=ss?function(e){return e==null?[]:(e=se(e),Gt(ss(e),function(t){return la.call(e,t)}))}:Hs,iu=ss?function(e){for(var t=[];e;)Vt(t,Cs(e)),e=Mr(e);return t}:Hs,Le=Ce;(os&&Le(new os(new ArrayBuffer(1)))!=_n||Xn&&Le(new Xn)!=ct||as&&Le(as.resolve())!=To||Nn&&Le(new Nn)!=lt||Zn&&Le(new Zn)!=zn)&&(Le=function(e){var t=Ce(e),s=t==bt?e.constructor:r,o=s?pn(s):"";if(o)switch(o){case ep:return _n;case tp:return ct;case np:return To;case rp:return lt;case ip:return zn}return t});function _h(e,t,s){for(var o=-1,c=s.length;++o<c;){var f=s[o],h=f.size;switch(f.type){case"drop":e+=h;break;case"dropRight":t-=h;break;case"take":t=Oe(t,e+h);break;case"takeRight":e=Ee(e,t-h);break}}return{start:e,end:t}}function Th(e){var t=e.match(Al);return t?t[1].split(Nl):[]}function su(e,t,s){t=Qt(t,e);for(var o=-1,c=t.length,f=!1;++o<c;){var h=It(t[o]);if(!(f=e!=null&&s(e,h)))break;e=e[h]}return f||++o!=c?f:(c=e==null?0:e.length,!!c&&pi(c)&&Dt(h,c)&&(V(e)||hn(e)))}function wh(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&ie.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function ou(e){return typeof e.constructor=="function"&&!ur(e)?Sn(Mr(e)):{}}function Eh(e,t,s){var o=e.constructor;switch(t){case Yn:return As(e);case Wn:case jn:return new o(+e);case _n:return sh(e,s);case Ri:case Ci:case Di:case Fi:case ki:case Ui:case $i:case Pi:case Mi:return Va(e,s);case ct:return new o;case qn:case Qn:return new o(e);case Jn:return oh(e);case lt:return new o;case Nr:return ah(e)}}function Ih(e,t){var s=t.length;if(!s)return e;var o=s-1;return t[o]=(s>1?"& ":"")+t[o],t=t.join(s>2?", ":" "),e.replace(xl,`{
89
- /* [wrapped with `+t+`] */
90
- `)}function xh(e){return V(e)||hn(e)||!!(fa&&e&&e[fa])}function Dt(e,t){var s=typeof e;return t=t??Bt,!!t&&(s=="number"||s!="symbol"&&kl.test(e))&&e>-1&&e%1==0&&e<t}function De(e,t,s){if(!pe(s))return!1;var o=typeof t;return(o=="number"?Pe(s)&&Dt(t,s.length):o=="string"&&t in s)?ht(s[t],e):!1}function Ds(e,t){if(V(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||je(e)?!0:Tl.test(e)||!_l.test(e)||t!=null&&e in se(t)}function Ah(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Fs(e){var t=ii(e),s=l[t];if(typeof s!="function"||!(t in z.prototype))return!1;if(e===s)return!0;var o=Ls(s);return!!o&&e===o[0]}function Nh(e){return!!aa&&aa in e}var bh=Fr?Ft:Ks;function ur(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||An;return e===s}function au(e){return e===e&&!pe(e)}function uu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==r||e in se(s))}}function Sh(e){var t=li(e,function(o){return s.size===R&&s.clear(),o}),s=t.cache;return t}function Oh(e,t){var s=e[1],o=t[1],c=s|o,f=c<(fe|ve|Ue),h=o==Ue&&s==ye||o==Ue&&s==nn&&e[7].length<=t[8]||o==(Ue|nn)&&t[7].length<=t[8]&&s==ye;if(!(f||h))return e;o&fe&&(e[2]=t[2],c|=s&fe?0:tn);var d=t[3];if(d){var m=e[3];e[3]=m?ja(m,d,t[4]):d,e[4]=m?Wt(e[3],O):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?qa(m,d,t[6]):d,e[6]=m?Wt(e[5],O):t[6]),d=t[7],d&&(e[7]=d),o&Ue&&(e[8]=e[8]==null?t[8]:Oe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Lh(e){var t=[];if(e!=null)for(var s in se(e))t.push(s);return t}function Rh(e){return Ur.call(e)}function cu(e,t,s){return t=Ee(t===r?e.length-1:t,0),function(){for(var o=arguments,c=-1,f=Ee(o.length-t,0),h=y(f);++c<f;)h[c]=o[t+c];c=-1;for(var d=y(t+1);++c<t;)d[c]=o[c];return d[t]=s(h),Ge(e,this,d)}}function lu(e,t){return t.length<2?e:ln(e,et(t,0,-1))}function Ch(e,t){for(var s=e.length,o=Oe(t.length,s),c=$e(e);o--;){var f=t[o];e[o]=Dt(f,s)?c[f]:r}return e}function ks(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var fu=hu(Fa),cr=Qf||function(e,t){return be.setTimeout(e,t)},Us=hu(th);function pu(e,t,s){var o=t+"";return Us(e,Ih(o,Dh(Th(o),s)))}function hu(e){var t=0,s=0;return function(){var o=Kf(),c=Zc-(o-s);if(s=o,c>0){if(++t>=Li)return arguments[0]}else t=0;return e.apply(r,arguments)}}function oi(e,t){var s=-1,o=e.length,c=o-1;for(t=t===r?o:t;++s<t;){var f=ys(s,c),h=e[f];e[f]=e[s],e[s]=h}return e.length=t,e}var du=Sh(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wl,function(s,o,c,f){t.push(c?f.replace(Ol,"$1"):o||s)}),t});function It(e){if(typeof e=="string"||je(e))return e;var t=e+"";return t=="0"&&1/e==-rn?"-0":t}function pn(e){if(e!=null){try{return kr.call(e)}catch{}try{return e+""}catch{}}return""}function Dh(e,t){return He(sl,function(s){var o="_."+s[0];t&s[1]&&!Lr(e,o)&&e.push(o)}),e.sort()}function gu(e){if(e instanceof z)return e.clone();var t=new Xe(e.__wrapped__,e.__chain__);return t.__actions__=$e(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Fh(e,t,s){(s?De(e,t,s):t===r)?t=1:t=Ee(j(t),0);var o=e==null?0:e.length;if(!o||t<1)return[];for(var c=0,f=0,h=y(Vr(o/t));c<o;)h[f++]=et(e,c,c+=t);return h}function kh(e){for(var t=-1,s=e==null?0:e.length,o=0,c=[];++t<s;){var f=e[t];f&&(c[o++]=f)}return c}function Uh(){var e=arguments.length;if(!e)return[];for(var t=y(e-1),s=arguments[0],o=e;o--;)t[o-1]=arguments[o];return Vt(V(s)?$e(s):[s],Se(t,1))}var $h=J(function(e,t){return de(e)?rr(e,Se(t,1,de,!0)):[]}),Ph=J(function(e,t){var s=tt(t);return de(s)&&(s=r),de(e)?rr(e,Se(t,1,de,!0),k(s,2)):[]}),Mh=J(function(e,t){var s=tt(t);return de(s)&&(s=r),de(e)?rr(e,Se(t,1,de,!0),r,s):[]});function Bh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),et(e,t<0?0:t,o)):[]}function Gh(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,et(e,0,t<0?0:t)):[]}function Vh(e,t){return e&&e.length?Xr(e,k(t,3),!0,!0):[]}function Wh(e,t){return e&&e.length?Xr(e,k(t,3),!0):[]}function jh(e,t,s,o){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&De(e,t,s)&&(s=0,o=c),Up(e,t,s,o)):[]}function mu(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=Ee(o+c,0)),Rr(e,k(t,3),c)}function vu(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o-1;return s!==r&&(c=j(s),c=s<0?Ee(o+c,0):Oe(c,o-1)),Rr(e,k(t,3),c,!0)}function yu(e){var t=e==null?0:e.length;return t?Se(e,1):[]}function qh(e){var t=e==null?0:e.length;return t?Se(e,rn):[]}function Jh(e,t){var s=e==null?0:e.length;return s?(t=t===r?1:j(t),Se(e,t)):[]}function Qh(e){for(var t=-1,s=e==null?0:e.length,o={};++t<s;){var c=e[t];o[c[0]]=c[1]}return o}function _u(e){return e&&e.length?e[0]:r}function zh(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=s==null?0:j(s);return c<0&&(c=Ee(o+c,0)),wn(e,t,c)}function Yh(e){var t=e==null?0:e.length;return t?et(e,0,-1):[]}var Hh=J(function(e){var t=le(e,Is);return t.length&&t[0]===e[0]?hs(t):[]}),Kh=J(function(e){var t=tt(e),s=le(e,Is);return t===tt(s)?t=r:s.pop(),s.length&&s[0]===e[0]?hs(s,k(t,2)):[]}),Xh=J(function(e){var t=tt(e),s=le(e,Is);return t=typeof t=="function"?t:r,t&&s.pop(),s.length&&s[0]===e[0]?hs(s,r,t):[]});function Zh(e,t){return e==null?"":Yf.call(e,t)}function tt(e){var t=e==null?0:e.length;return t?e[t-1]:r}function ed(e,t,s){var o=e==null?0:e.length;if(!o)return-1;var c=o;return s!==r&&(c=j(s),c=c<0?Ee(o+c,0):Oe(c,o-1)),t===t?Df(e,t,c):Rr(e,Zo,c,!0)}function td(e,t){return e&&e.length?La(e,j(t)):r}var nd=J(Tu);function Tu(e,t){return e&&e.length&&t&&t.length?vs(e,t):e}function rd(e,t,s){return e&&e.length&&t&&t.length?vs(e,t,k(s,2)):e}function id(e,t,s){return e&&e.length&&t&&t.length?vs(e,t,r,s):e}var sd=Ct(function(e,t){var s=e==null?0:e.length,o=cs(e,t);return Da(e,le(t,function(c){return Dt(c,s)?+c:c}).sort(Wa)),o});function od(e,t){var s=[];if(!(e&&e.length))return s;var o=-1,c=[],f=e.length;for(t=k(t,3);++o<f;){var h=e[o];t(h,o,e)&&(s.push(h),c.push(o))}return Da(e,c),s}function $s(e){return e==null?e:Zf.call(e)}function ad(e,t,s){var o=e==null?0:e.length;return o?(s&&typeof s!="number"&&De(e,t,s)?(t=0,s=o):(t=t==null?0:j(t),s=s===r?o:j(s)),et(e,t,s)):[]}function ud(e,t){return Kr(e,t)}function cd(e,t,s){return Ts(e,t,k(s,2))}function ld(e,t){var s=e==null?0:e.length;if(s){var o=Kr(e,t);if(o<s&&ht(e[o],t))return o}return-1}function fd(e,t){return Kr(e,t,!0)}function pd(e,t,s){return Ts(e,t,k(s,2),!0)}function hd(e,t){var s=e==null?0:e.length;if(s){var o=Kr(e,t,!0)-1;if(ht(e[o],t))return o}return-1}function dd(e){return e&&e.length?ka(e):[]}function gd(e,t){return e&&e.length?ka(e,k(t,2)):[]}function md(e){var t=e==null?0:e.length;return t?et(e,1,t):[]}function vd(e,t,s){return e&&e.length?(t=s||t===r?1:j(t),et(e,0,t<0?0:t)):[]}function yd(e,t,s){var o=e==null?0:e.length;return o?(t=s||t===r?1:j(t),t=o-t,et(e,t<0?0:t,o)):[]}function _d(e,t){return e&&e.length?Xr(e,k(t,3),!1,!0):[]}function Td(e,t){return e&&e.length?Xr(e,k(t,3)):[]}var wd=J(function(e){return Jt(Se(e,1,de,!0))}),Ed=J(function(e){var t=tt(e);return de(t)&&(t=r),Jt(Se(e,1,de,!0),k(t,2))}),Id=J(function(e){var t=tt(e);return t=typeof t=="function"?t:r,Jt(Se(e,1,de,!0),r,t)});function xd(e){return e&&e.length?Jt(e):[]}function Ad(e,t){return e&&e.length?Jt(e,k(t,2)):[]}function Nd(e,t){return t=typeof t=="function"?t:r,e&&e.length?Jt(e,r,t):[]}function Ps(e){if(!(e&&e.length))return[];var t=0;return e=Gt(e,function(s){if(de(s))return t=Ee(s.length,t),!0}),ts(t,function(s){return le(e,Xi(s))})}function wu(e,t){if(!(e&&e.length))return[];var s=Ps(e);return t==null?s:le(s,function(o){return Ge(t,r,o)})}var bd=J(function(e,t){return de(e)?rr(e,t):[]}),Sd=J(function(e){return Es(Gt(e,de))}),Od=J(function(e){var t=tt(e);return de(t)&&(t=r),Es(Gt(e,de),k(t,2))}),Ld=J(function(e){var t=tt(e);return t=typeof t=="function"?t:r,Es(Gt(e,de),r,t)}),Rd=J(Ps);function Cd(e,t){return Ma(e||[],t||[],nr)}function Dd(e,t){return Ma(e||[],t||[],or)}var Fd=J(function(e){var t=e.length,s=t>1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,wu(e,s)});function Eu(e){var t=l(e);return t.__chain__=!0,t}function kd(e,t){return t(e),e}function ai(e,t){return t(e)}var Ud=Ct(function(e){var t=e.length,s=t?e[0]:0,o=this.__wrapped__,c=function(f){return cs(f,e)};return t>1||this.__actions__.length||!(o instanceof z)||!Dt(s)?this.thru(c):(o=o.slice(s,+s+(t?1:0)),o.__actions__.push({func:ai,args:[c],thisArg:r}),new Xe(o,this.__chain__).thru(function(f){return t&&!f.length&&f.push(r),f}))});function $d(){return Eu(this)}function Pd(){return new Xe(this.value(),this.__chain__)}function Md(){this.__values__===r&&(this.__values__=Uu(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Bd(){return this}function Gd(e){for(var t,s=this;s instanceof Jr;){var o=gu(s);o.__index__=0,o.__values__=r,t?c.__wrapped__=o:t=o;var c=o;s=s.__wrapped__}return c.__wrapped__=e,t}function Vd(){var e=this.__wrapped__;if(e instanceof z){var t=e;return this.__actions__.length&&(t=new z(this)),t=t.reverse(),t.__actions__.push({func:ai,args:[$s],thisArg:r}),new Xe(t,this.__chain__)}return this.thru($s)}function Wd(){return Pa(this.__wrapped__,this.__actions__)}var jd=Zr(function(e,t,s){ie.call(e,s)?++e[s]:Lt(e,s,1)});function qd(e,t,s){var o=V(e)?Ko:kp;return s&&De(e,t,s)&&(t=r),o(e,k(t,3))}function Jd(e,t){var s=V(e)?Gt:wa;return s(e,k(t,3))}var Qd=Ya(mu),zd=Ya(vu);function Yd(e,t){return Se(ui(e,t),1)}function Hd(e,t){return Se(ui(e,t),rn)}function Kd(e,t,s){return s=s===r?1:j(s),Se(ui(e,t),s)}function Iu(e,t){var s=V(e)?He:qt;return s(e,k(t,3))}function xu(e,t){var s=V(e)?mf:Ta;return s(e,k(t,3))}var Xd=Zr(function(e,t,s){ie.call(e,s)?e[s].push(t):Lt(e,s,[t])});function Zd(e,t,s,o){e=Pe(e)?e:Dn(e),s=s&&!o?j(s):0;var c=e.length;return s<0&&(s=Ee(c+s,0)),hi(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&wn(e,t,s)>-1}var eg=J(function(e,t,s){var o=-1,c=typeof t=="function",f=Pe(e)?y(e.length):[];return qt(e,function(h){f[++o]=c?Ge(t,h,s):ir(h,t,s)}),f}),tg=Zr(function(e,t,s){Lt(e,s,t)});function ui(e,t){var s=V(e)?le:ba;return s(e,k(t,3))}function ng(e,t,s,o){return e==null?[]:(V(t)||(t=t==null?[]:[t]),s=o?r:s,V(s)||(s=s==null?[]:[s]),Ra(e,t,s))}var rg=Zr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function ig(e,t,s){var o=V(e)?Hi:ta,c=arguments.length<3;return o(e,k(t,4),s,c,qt)}function sg(e,t,s){var o=V(e)?vf:ta,c=arguments.length<3;return o(e,k(t,4),s,c,Ta)}function og(e,t){var s=V(e)?Gt:wa;return s(e,fi(k(t,3)))}function ag(e){var t=V(e)?ma:Zp;return t(e)}function ug(e,t,s){(s?De(e,t,s):t===r)?t=1:t=j(t);var o=V(e)?Lp:eh;return o(e,t)}function cg(e){var t=V(e)?Rp:nh;return t(e)}function lg(e){if(e==null)return 0;if(Pe(e))return hi(e)?In(e):e.length;var t=Le(e);return t==ct||t==lt?e.size:gs(e).length}function fg(e,t,s){var o=V(e)?Ki:rh;return s&&De(e,t,s)&&(t=r),o(e,k(t,3))}var pg=J(function(e,t){if(e==null)return[];var s=t.length;return s>1&&De(e,t[0],t[1])?t=[]:s>2&&De(t[0],t[1],t[2])&&(t=[t[0]]),Ra(e,Se(t,1),[])}),ci=Jf||function(){return be.Date.now()};function hg(e,t){if(typeof t!="function")throw new Ke(v);return e=j(e),function(){if(--e<1)return t.apply(this,arguments)}}function Au(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Rt(e,Ue,r,r,r,r,t)}function Nu(e,t){var s;if(typeof t!="function")throw new Ke(v);return e=j(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var Ms=J(function(e,t,s){var o=fe;if(s.length){var c=Wt(s,Rn(Ms));o|=Re}return Rt(e,o,t,s,c)}),bu=J(function(e,t,s){var o=fe|ve;if(s.length){var c=Wt(s,Rn(bu));o|=Re}return Rt(t,o,e,s,c)});function Su(e,t,s){t=s?r:t;var o=Rt(e,ye,r,r,r,r,r,t);return o.placeholder=Su.placeholder,o}function Ou(e,t,s){t=s?r:t;var o=Rt(e,Ne,r,r,r,r,r,t);return o.placeholder=Ou.placeholder,o}function Lu(e,t,s){var o,c,f,h,d,m,T=0,w=!1,A=!1,S=!0;if(typeof e!="function")throw new Ke(v);t=nt(t)||0,pe(s)&&(w=!!s.leading,A="maxWait"in s,f=A?Ee(nt(s.maxWait)||0,t):f,S="trailing"in s?!!s.trailing:S);function D(ge){var dt=o,Ut=c;return o=c=r,T=ge,h=e.apply(Ut,dt),h}function U(ge){return T=ge,d=cr(Q,t),w?D(ge):h}function q(ge){var dt=ge-m,Ut=ge-T,Yu=t-dt;return A?Oe(Yu,f-Ut):Yu}function $(ge){var dt=ge-m,Ut=ge-T;return m===r||dt>=t||dt<0||A&&Ut>=f}function Q(){var ge=ci();if($(ge))return H(ge);d=cr(Q,q(ge))}function H(ge){return d=r,S&&o?D(ge):(o=c=r,h)}function qe(){d!==r&&Ba(d),T=0,o=m=c=d=r}function Fe(){return d===r?h:H(ci())}function Je(){var ge=ci(),dt=$(ge);if(o=arguments,c=this,m=ge,dt){if(d===r)return U(m);if(A)return Ba(d),d=cr(Q,t),D(m)}return d===r&&(d=cr(Q,t)),h}return Je.cancel=qe,Je.flush=Fe,Je}var dg=J(function(e,t){return _a(e,1,t)}),gg=J(function(e,t,s){return _a(e,nt(t)||0,s)});function mg(e){return Rt(e,x)}function li(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new Ke(v);var s=function(){var o=arguments,c=t?t.apply(this,o):o[0],f=s.cache;if(f.has(c))return f.get(c);var h=e.apply(this,o);return s.cache=f.set(c,h)||f,h};return s.cache=new(li.Cache||Ot),s}li.Cache=Ot;function fi(e){if(typeof e!="function")throw new Ke(v);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function vg(e){return Nu(2,e)}var yg=ih(function(e,t){t=t.length==1&&V(t[0])?le(t[0],Ve(k())):le(Se(t,1),Ve(k()));var s=t.length;return J(function(o){for(var c=-1,f=Oe(o.length,s);++c<f;)o[c]=t[c].call(this,o[c]);return Ge(e,this,o)})}),Bs=J(function(e,t){var s=Wt(t,Rn(Bs));return Rt(e,Re,r,t,s)}),Ru=J(function(e,t){var s=Wt(t,Rn(Ru));return Rt(e,Qe,r,t,s)}),_g=Ct(function(e,t){return Rt(e,nn,r,r,r,t)});function Tg(e,t){if(typeof e!="function")throw new Ke(v);return t=t===r?t:j(t),J(e,t)}function wg(e,t){if(typeof e!="function")throw new Ke(v);return t=t==null?0:Ee(j(t),0),J(function(s){var o=s[t],c=zt(s,0,t);return o&&Vt(c,o),Ge(e,this,c)})}function Eg(e,t,s){var o=!0,c=!0;if(typeof e!="function")throw new Ke(v);return pe(s)&&(o="leading"in s?!!s.leading:o,c="trailing"in s?!!s.trailing:c),Lu(e,t,{leading:o,maxWait:t,trailing:c})}function Ig(e){return Au(e,1)}function xg(e,t){return Bs(xs(t),e)}function Ag(){if(!arguments.length)return[];var e=arguments[0];return V(e)?e:[e]}function Ng(e){return Ze(e,ce)}function bg(e,t){return t=typeof t=="function"?t:r,Ze(e,ce,t)}function Sg(e){return Ze(e,M|ce)}function Og(e,t){return t=typeof t=="function"?t:r,Ze(e,M|ce,t)}function Lg(e,t){return t==null||ya(e,t,xe(t))}function ht(e,t){return e===t||e!==e&&t!==t}var Rg=ri(ps),Cg=ri(function(e,t){return e>=t}),hn=xa(function(){return arguments}())?xa:function(e){return he(e)&&ie.call(e,"callee")&&!la.call(e,"callee")},V=y.isArray,Dg=qo?Ve(qo):Gp;function Pe(e){return e!=null&&pi(e.length)&&!Ft(e)}function de(e){return he(e)&&Pe(e)}function Fg(e){return e===!0||e===!1||he(e)&&Ce(e)==Wn}var Yt=zf||Ks,kg=Jo?Ve(Jo):Vp;function Ug(e){return he(e)&&e.nodeType===1&&!lr(e)}function $g(e){if(e==null)return!0;if(Pe(e)&&(V(e)||typeof e=="string"||typeof e.splice=="function"||Yt(e)||Cn(e)||hn(e)))return!e.length;var t=Le(e);if(t==ct||t==lt)return!e.size;if(ur(e))return!gs(e).length;for(var s in e)if(ie.call(e,s))return!1;return!0}function Pg(e,t){return sr(e,t)}function Mg(e,t,s){s=typeof s=="function"?s:r;var o=s?s(e,t):r;return o===r?sr(e,t,r,s):!!o}function Gs(e){if(!he(e))return!1;var t=Ce(e);return t==xr||t==al||typeof e.message=="string"&&typeof e.name=="string"&&!lr(e)}function Bg(e){return typeof e=="number"&&pa(e)}function Ft(e){if(!pe(e))return!1;var t=Ce(e);return t==Ar||t==_o||t==ol||t==cl}function Cu(e){return typeof e=="number"&&e==j(e)}function pi(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Bt}function pe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function he(e){return e!=null&&typeof e=="object"}var Du=Qo?Ve(Qo):jp;function Gg(e,t){return e===t||ds(e,t,Rs(t))}function Vg(e,t,s){return s=typeof s=="function"?s:r,ds(e,t,Rs(t),s)}function Wg(e){return Fu(e)&&e!=+e}function jg(e){if(bh(e))throw new B(p);return Aa(e)}function qg(e){return e===null}function Jg(e){return e==null}function Fu(e){return typeof e=="number"||he(e)&&Ce(e)==qn}function lr(e){if(!he(e)||Ce(e)!=bt)return!1;var t=Mr(e);if(t===null)return!0;var s=ie.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&kr.call(s)==Vf}var Vs=zo?Ve(zo):qp;function Qg(e){return Cu(e)&&e>=-Bt&&e<=Bt}var ku=Yo?Ve(Yo):Jp;function hi(e){return typeof e=="string"||!V(e)&&he(e)&&Ce(e)==Qn}function je(e){return typeof e=="symbol"||he(e)&&Ce(e)==Nr}var Cn=Ho?Ve(Ho):Qp;function zg(e){return e===r}function Yg(e){return he(e)&&Le(e)==zn}function Hg(e){return he(e)&&Ce(e)==fl}var Kg=ri(ms),Xg=ri(function(e,t){return e<=t});function Uu(e){if(!e)return[];if(Pe(e))return hi(e)?ft(e):$e(e);if(Kn&&e[Kn])return Lf(e[Kn]());var t=Le(e),s=t==ct?rs:t==lt?Cr:Dn;return s(e)}function kt(e){if(!e)return e===0?e:0;if(e=nt(e),e===rn||e===-rn){var t=e<0?-1:1;return t*nl}return e===e?e:0}function j(e){var t=kt(e),s=t%1;return t===t?s?t-s:t:0}function $u(e){return e?cn(j(e),0,Tt):0}function nt(e){if(typeof e=="number")return e;if(je(e))return Er;if(pe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=pe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=na(e);var s=Cl.test(e);return s||Fl.test(e)?hf(e.slice(2),s?2:8):Rl.test(e)?Er:+e}function Pu(e){return Et(e,Me(e))}function Zg(e){return e?cn(j(e),-Bt,Bt):e===0?e:0}function ne(e){return e==null?"":We(e)}var em=On(function(e,t){if(ur(t)||Pe(t)){Et(t,xe(t),e);return}for(var s in t)ie.call(t,s)&&nr(e,s,t[s])}),Mu=On(function(e,t){Et(t,Me(t),e)}),di=On(function(e,t,s,o){Et(t,Me(t),e,o)}),tm=On(function(e,t,s,o){Et(t,xe(t),e,o)}),nm=Ct(cs);function rm(e,t){var s=Sn(e);return t==null?s:va(s,t)}var im=J(function(e,t){e=se(e);var s=-1,o=t.length,c=o>2?t[2]:r;for(c&&De(t[0],t[1],c)&&(o=1);++s<o;)for(var f=t[s],h=Me(f),d=-1,m=h.length;++d<m;){var T=h[d],w=e[T];(w===r||ht(w,An[T])&&!ie.call(e,T))&&(e[T]=f[T])}return e}),sm=J(function(e){return e.push(r,nu),Ge(Bu,r,e)});function om(e,t){return Xo(e,k(t,3),wt)}function am(e,t){return Xo(e,k(t,3),fs)}function um(e,t){return e==null?e:ls(e,k(t,3),Me)}function cm(e,t){return e==null?e:Ea(e,k(t,3),Me)}function lm(e,t){return e&&wt(e,k(t,3))}function fm(e,t){return e&&fs(e,k(t,3))}function pm(e){return e==null?[]:Yr(e,xe(e))}function hm(e){return e==null?[]:Yr(e,Me(e))}function Ws(e,t,s){var o=e==null?r:ln(e,t);return o===r?s:o}function dm(e,t){return e!=null&&su(e,t,$p)}function js(e,t){return e!=null&&su(e,t,Pp)}var gm=Ka(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=Ur.call(t)),e[t]=s},Js(Be)),mm=Ka(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=Ur.call(t)),ie.call(e,t)?e[t].push(s):e[t]=[s]},k),vm=J(ir);function xe(e){return Pe(e)?ga(e):gs(e)}function Me(e){return Pe(e)?ga(e,!0):zp(e)}function ym(e,t){var s={};return t=k(t,3),wt(e,function(o,c,f){Lt(s,t(o,c,f),o)}),s}function _m(e,t){var s={};return t=k(t,3),wt(e,function(o,c,f){Lt(s,c,t(o,c,f))}),s}var Tm=On(function(e,t,s){Hr(e,t,s)}),Bu=On(function(e,t,s,o){Hr(e,t,s,o)}),wm=Ct(function(e,t){var s={};if(e==null)return s;var o=!1;t=le(t,function(f){return f=Qt(f,e),o||(o=f.length>1),f}),Et(e,Os(e),s),o&&(s=Ze(s,M|Z|ce,gh));for(var c=t.length;c--;)ws(s,t[c]);return s});function Em(e,t){return Gu(e,fi(k(t)))}var Im=Ct(function(e,t){return e==null?{}:Hp(e,t)});function Gu(e,t){if(e==null)return{};var s=le(Os(e),function(o){return[o]});return t=k(t),Ca(e,s,function(o,c){return t(o,c[0])})}function xm(e,t,s){t=Qt(t,e);var o=-1,c=t.length;for(c||(c=1,e=r);++o<c;){var f=e==null?r:e[It(t[o])];f===r&&(o=c,f=s),e=Ft(f)?f.call(e):f}return e}function Am(e,t,s){return e==null?e:or(e,t,s)}function Nm(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:or(e,t,s,o)}var Vu=eu(xe),Wu=eu(Me);function bm(e,t,s){var o=V(e),c=o||Yt(e)||Cn(e);if(t=k(t,4),s==null){var f=e&&e.constructor;c?s=o?new f:[]:pe(e)?s=Ft(f)?Sn(Mr(e)):{}:s={}}return(c?He:wt)(e,function(h,d,m){return t(s,h,d,m)}),s}function Sm(e,t){return e==null?!0:ws(e,t)}function Om(e,t,s){return e==null?e:$a(e,t,xs(s))}function Lm(e,t,s,o){return o=typeof o=="function"?o:r,e==null?e:$a(e,t,xs(s),o)}function Dn(e){return e==null?[]:ns(e,xe(e))}function Rm(e){return e==null?[]:ns(e,Me(e))}function Cm(e,t,s){return s===r&&(s=t,t=r),s!==r&&(s=nt(s),s=s===s?s:0),t!==r&&(t=nt(t),t=t===t?t:0),cn(nt(e),t,s)}function Dm(e,t,s){return t=kt(t),s===r?(s=t,t=0):s=kt(s),e=nt(e),Mp(e,t,s)}function Fm(e,t,s){if(s&&typeof s!="boolean"&&De(e,t,s)&&(t=s=r),s===r&&(typeof t=="boolean"?(s=t,t=r):typeof e=="boolean"&&(s=e,e=r)),e===r&&t===r?(e=0,t=1):(e=kt(e),t===r?(t=e,e=0):t=kt(t)),e>t){var o=e;e=t,t=o}if(s||e%1||t%1){var c=ha();return Oe(e+c*(t-e+pf("1e-"+((c+"").length-1))),t)}return ys(e,t)}var km=Ln(function(e,t,s){return t=t.toLowerCase(),e+(s?ju(t):t)});function ju(e){return qs(ne(e).toLowerCase())}function qu(e){return e=ne(e),e&&e.replace(Ul,Af).replace(tf,"")}function Um(e,t,s){e=ne(e),t=We(t);var o=e.length;s=s===r?o:cn(j(s),0,o);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function $m(e){return e=ne(e),e&&ml.test(e)?e.replace(Eo,Nf):e}function Pm(e){return e=ne(e),e&&El.test(e)?e.replace(Bi,"\\$&"):e}var Mm=Ln(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Bm=Ln(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Gm=za("toLowerCase");function Vm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;if(!t||o>=t)return e;var c=(t-o)/2;return ni(Wr(c),s)+e+ni(Vr(c),s)}function Wm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;return t&&o<t?e+ni(t-o,s):e}function jm(e,t,s){e=ne(e),t=j(t);var o=t?In(e):0;return t&&o<t?ni(t-o,s)+e:e}function qm(e,t,s){return s||t==null?t=0:t&&(t=+t),Xf(ne(e).replace(Gi,""),t||0)}function Jm(e,t,s){return(s?De(e,t,s):t===r)?t=1:t=j(t),_s(ne(e),t)}function Qm(){var e=arguments,t=ne(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var zm=Ln(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function Ym(e,t,s){return s&&typeof s!="number"&&De(e,t,s)&&(t=s=r),s=s===r?Tt:s>>>0,s?(e=ne(e),e&&(typeof t=="string"||t!=null&&!Vs(t))&&(t=We(t),!t&&En(e))?zt(ft(e),0,s):e.split(t,s)):[]}var Hm=Ln(function(e,t,s){return e+(s?" ":"")+qs(t)});function Km(e,t,s){return e=ne(e),s=s==null?0:cn(j(s),0,e.length),t=We(t),e.slice(s,s+t.length)==t}function Xm(e,t,s){var o=l.templateSettings;s&&De(e,t,s)&&(t=r),e=ne(e),t=di({},t,o,tu);var c=di({},t.imports,o.imports,tu),f=xe(c),h=ns(c,f),d,m,T=0,w=t.interpolate||br,A="__p += '",S=is((t.escape||br).source+"|"+w.source+"|"+(w===Io?Ll:br).source+"|"+(t.evaluate||br).source+"|$","g"),D="//# sourceURL="+(ie.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++af+"]")+`
91
- `;e.replace(S,function($,Q,H,qe,Fe,Je){return H||(H=qe),A+=e.slice(T,Je).replace($l,bf),Q&&(d=!0,A+=`' +
92
- __e(`+Q+`) +
93
- '`),Fe&&(m=!0,A+=`';
94
- `+Fe+`;
95
- __p += '`),H&&(A+=`' +
96
- ((__t = (`+H+`)) == null ? '' : __t) +
97
- '`),T=Je+$.length,$}),A+=`';
98
- `;var U=ie.call(t,"variable")&&t.variable;if(!U)A=`with (obj) {
99
- `+A+`
100
- }
101
- `;else if(Sl.test(U))throw new B(I);A=(m?A.replace(pl,""):A).replace(hl,"$1").replace(dl,"$1;"),A="function("+(U||"obj")+`) {
102
- `+(U?"":`obj || (obj = {});
103
- `)+"var __t, __p = ''"+(d?", __e = _.escape":"")+(m?`, __j = Array.prototype.join;
104
- function print() { __p += __j.call(arguments, '') }
105
- `:`;
106
- `)+A+`return __p
107
- }`;var q=Qu(function(){return ee(f,D+"return "+A).apply(r,h)});if(q.source=A,Gs(q))throw q;return q}function Zm(e){return ne(e).toLowerCase()}function e0(e){return ne(e).toUpperCase()}function t0(e,t,s){if(e=ne(e),e&&(s||t===r))return na(e);if(!e||!(t=We(t)))return e;var o=ft(e),c=ft(t),f=ra(o,c),h=ia(o,c)+1;return zt(o,f,h).join("")}function n0(e,t,s){if(e=ne(e),e&&(s||t===r))return e.slice(0,oa(e)+1);if(!e||!(t=We(t)))return e;var o=ft(e),c=ia(o,ft(t))+1;return zt(o,0,c).join("")}function r0(e,t,s){if(e=ne(e),e&&(s||t===r))return e.replace(Gi,"");if(!e||!(t=We(t)))return e;var o=ft(e),c=ra(o,ft(t));return zt(o,c).join("")}function i0(e,t){var s=G,o=ze;if(pe(t)){var c="separator"in t?t.separator:c;s="length"in t?j(t.length):s,o="omission"in t?We(t.omission):o}e=ne(e);var f=e.length;if(En(e)){var h=ft(e);f=h.length}if(s>=f)return e;var d=s-In(o);if(d<1)return o;var m=h?zt(h,0,d).join(""):e.slice(0,d);if(c===r)return m+o;if(h&&(d+=m.length-d),Vs(c)){if(e.slice(d).search(c)){var T,w=m;for(c.global||(c=is(c.source,ne(xo.exec(c))+"g")),c.lastIndex=0;T=c.exec(w);)var A=T.index;m=m.slice(0,A===r?d:A)}}else if(e.indexOf(We(c),d)!=d){var S=m.lastIndexOf(c);S>-1&&(m=m.slice(0,S))}return m+o}function s0(e){return e=ne(e),e&&gl.test(e)?e.replace(wo,Ff):e}var o0=Ln(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),qs=za("toUpperCase");function Ju(e,t,s){return e=ne(e),t=s?r:t,t===r?Of(e)?$f(e):Tf(e):e.match(t)||[]}var Qu=J(function(e,t){try{return Ge(e,r,t)}catch(s){return Gs(s)?s:new B(s)}}),a0=Ct(function(e,t){return He(t,function(s){s=It(s),Lt(e,s,Ms(e[s],e))}),e});function u0(e){var t=e==null?0:e.length,s=k();return e=t?le(e,function(o){if(typeof o[1]!="function")throw new Ke(v);return[s(o[0]),o[1]]}):[],J(function(o){for(var c=-1;++c<t;){var f=e[c];if(Ge(f[0],this,o))return Ge(f[1],this,o)}})}function c0(e){return Fp(Ze(e,M))}function Js(e){return function(){return e}}function l0(e,t){return e==null||e!==e?t:e}var f0=Ha(),p0=Ha(!0);function Be(e){return e}function Qs(e){return Na(typeof e=="function"?e:Ze(e,M))}function h0(e){return Sa(Ze(e,M))}function d0(e,t){return Oa(e,Ze(t,M))}var g0=J(function(e,t){return function(s){return ir(s,e,t)}}),m0=J(function(e,t){return function(s){return ir(e,s,t)}});function zs(e,t,s){var o=xe(t),c=Yr(t,o);s==null&&!(pe(t)&&(c.length||!o.length))&&(s=t,t=e,e=this,c=Yr(t,xe(t)));var f=!(pe(s)&&"chain"in s)||!!s.chain,h=Ft(e);return He(c,function(d){var m=t[d];e[d]=m,h&&(e.prototype[d]=function(){var T=this.__chain__;if(f||T){var w=e(this.__wrapped__),A=w.__actions__=$e(this.__actions__);return A.push({func:m,args:arguments,thisArg:e}),w.__chain__=T,w}return m.apply(e,Vt([this.value()],arguments))})}),e}function v0(){return be._===this&&(be._=Wf),this}function Ys(){}function y0(e){return e=j(e),J(function(t){return La(t,e)})}var _0=Ns(le),T0=Ns(Ko),w0=Ns(Ki);function zu(e){return Ds(e)?Xi(It(e)):Kp(e)}function E0(e){return function(t){return e==null?r:ln(e,t)}}var I0=Xa(),x0=Xa(!0);function Hs(){return[]}function Ks(){return!1}function A0(){return{}}function N0(){return""}function b0(){return!0}function S0(e,t){if(e=j(e),e<1||e>Bt)return[];var s=Tt,o=Oe(e,Tt);t=k(t),e-=Tt;for(var c=ts(o,t);++s<e;)t(s);return c}function O0(e){return V(e)?le(e,It):je(e)?[e]:$e(du(ne(e)))}function L0(e){var t=++Gf;return ne(e)+t}var R0=ti(function(e,t){return e+t},0),C0=bs("ceil"),D0=ti(function(e,t){return e/t},1),F0=bs("floor");function k0(e){return e&&e.length?zr(e,Be,ps):r}function U0(e,t){return e&&e.length?zr(e,k(t,2),ps):r}function $0(e){return ea(e,Be)}function P0(e,t){return ea(e,k(t,2))}function M0(e){return e&&e.length?zr(e,Be,ms):r}function B0(e,t){return e&&e.length?zr(e,k(t,2),ms):r}var G0=ti(function(e,t){return e*t},1),V0=bs("round"),W0=ti(function(e,t){return e-t},0);function j0(e){return e&&e.length?es(e,Be):0}function q0(e,t){return e&&e.length?es(e,k(t,2)):0}return l.after=hg,l.ary=Au,l.assign=em,l.assignIn=Mu,l.assignInWith=di,l.assignWith=tm,l.at=nm,l.before=Nu,l.bind=Ms,l.bindAll=a0,l.bindKey=bu,l.castArray=Ag,l.chain=Eu,l.chunk=Fh,l.compact=kh,l.concat=Uh,l.cond=u0,l.conforms=c0,l.constant=Js,l.countBy=jd,l.create=rm,l.curry=Su,l.curryRight=Ou,l.debounce=Lu,l.defaults=im,l.defaultsDeep=sm,l.defer=dg,l.delay=gg,l.difference=$h,l.differenceBy=Ph,l.differenceWith=Mh,l.drop=Bh,l.dropRight=Gh,l.dropRightWhile=Vh,l.dropWhile=Wh,l.fill=jh,l.filter=Jd,l.flatMap=Yd,l.flatMapDeep=Hd,l.flatMapDepth=Kd,l.flatten=yu,l.flattenDeep=qh,l.flattenDepth=Jh,l.flip=mg,l.flow=f0,l.flowRight=p0,l.fromPairs=Qh,l.functions=pm,l.functionsIn=hm,l.groupBy=Xd,l.initial=Yh,l.intersection=Hh,l.intersectionBy=Kh,l.intersectionWith=Xh,l.invert=gm,l.invertBy=mm,l.invokeMap=eg,l.iteratee=Qs,l.keyBy=tg,l.keys=xe,l.keysIn=Me,l.map=ui,l.mapKeys=ym,l.mapValues=_m,l.matches=h0,l.matchesProperty=d0,l.memoize=li,l.merge=Tm,l.mergeWith=Bu,l.method=g0,l.methodOf=m0,l.mixin=zs,l.negate=fi,l.nthArg=y0,l.omit=wm,l.omitBy=Em,l.once=vg,l.orderBy=ng,l.over=_0,l.overArgs=yg,l.overEvery=T0,l.overSome=w0,l.partial=Bs,l.partialRight=Ru,l.partition=rg,l.pick=Im,l.pickBy=Gu,l.property=zu,l.propertyOf=E0,l.pull=nd,l.pullAll=Tu,l.pullAllBy=rd,l.pullAllWith=id,l.pullAt=sd,l.range=I0,l.rangeRight=x0,l.rearg=_g,l.reject=og,l.remove=od,l.rest=Tg,l.reverse=$s,l.sampleSize=ug,l.set=Am,l.setWith=Nm,l.shuffle=cg,l.slice=ad,l.sortBy=pg,l.sortedUniq=dd,l.sortedUniqBy=gd,l.split=Ym,l.spread=wg,l.tail=md,l.take=vd,l.takeRight=yd,l.takeRightWhile=_d,l.takeWhile=Td,l.tap=kd,l.throttle=Eg,l.thru=ai,l.toArray=Uu,l.toPairs=Vu,l.toPairsIn=Wu,l.toPath=O0,l.toPlainObject=Pu,l.transform=bm,l.unary=Ig,l.union=wd,l.unionBy=Ed,l.unionWith=Id,l.uniq=xd,l.uniqBy=Ad,l.uniqWith=Nd,l.unset=Sm,l.unzip=Ps,l.unzipWith=wu,l.update=Om,l.updateWith=Lm,l.values=Dn,l.valuesIn=Rm,l.without=bd,l.words=Ju,l.wrap=xg,l.xor=Sd,l.xorBy=Od,l.xorWith=Ld,l.zip=Rd,l.zipObject=Cd,l.zipObjectDeep=Dd,l.zipWith=Fd,l.entries=Vu,l.entriesIn=Wu,l.extend=Mu,l.extendWith=di,zs(l,l),l.add=R0,l.attempt=Qu,l.camelCase=km,l.capitalize=ju,l.ceil=C0,l.clamp=Cm,l.clone=Ng,l.cloneDeep=Sg,l.cloneDeepWith=Og,l.cloneWith=bg,l.conformsTo=Lg,l.deburr=qu,l.defaultTo=l0,l.divide=D0,l.endsWith=Um,l.eq=ht,l.escape=$m,l.escapeRegExp=Pm,l.every=qd,l.find=Qd,l.findIndex=mu,l.findKey=om,l.findLast=zd,l.findLastIndex=vu,l.findLastKey=am,l.floor=F0,l.forEach=Iu,l.forEachRight=xu,l.forIn=um,l.forInRight=cm,l.forOwn=lm,l.forOwnRight=fm,l.get=Ws,l.gt=Rg,l.gte=Cg,l.has=dm,l.hasIn=js,l.head=_u,l.identity=Be,l.includes=Zd,l.indexOf=zh,l.inRange=Dm,l.invoke=vm,l.isArguments=hn,l.isArray=V,l.isArrayBuffer=Dg,l.isArrayLike=Pe,l.isArrayLikeObject=de,l.isBoolean=Fg,l.isBuffer=Yt,l.isDate=kg,l.isElement=Ug,l.isEmpty=$g,l.isEqual=Pg,l.isEqualWith=Mg,l.isError=Gs,l.isFinite=Bg,l.isFunction=Ft,l.isInteger=Cu,l.isLength=pi,l.isMap=Du,l.isMatch=Gg,l.isMatchWith=Vg,l.isNaN=Wg,l.isNative=jg,l.isNil=Jg,l.isNull=qg,l.isNumber=Fu,l.isObject=pe,l.isObjectLike=he,l.isPlainObject=lr,l.isRegExp=Vs,l.isSafeInteger=Qg,l.isSet=ku,l.isString=hi,l.isSymbol=je,l.isTypedArray=Cn,l.isUndefined=zg,l.isWeakMap=Yg,l.isWeakSet=Hg,l.join=Zh,l.kebabCase=Mm,l.last=tt,l.lastIndexOf=ed,l.lowerCase=Bm,l.lowerFirst=Gm,l.lt=Kg,l.lte=Xg,l.max=k0,l.maxBy=U0,l.mean=$0,l.meanBy=P0,l.min=M0,l.minBy=B0,l.stubArray=Hs,l.stubFalse=Ks,l.stubObject=A0,l.stubString=N0,l.stubTrue=b0,l.multiply=G0,l.nth=td,l.noConflict=v0,l.noop=Ys,l.now=ci,l.pad=Vm,l.padEnd=Wm,l.padStart=jm,l.parseInt=qm,l.random=Fm,l.reduce=ig,l.reduceRight=sg,l.repeat=Jm,l.replace=Qm,l.result=xm,l.round=V0,l.runInContext=g,l.sample=ag,l.size=lg,l.snakeCase=zm,l.some=fg,l.sortedIndex=ud,l.sortedIndexBy=cd,l.sortedIndexOf=ld,l.sortedLastIndex=fd,l.sortedLastIndexBy=pd,l.sortedLastIndexOf=hd,l.startCase=Hm,l.startsWith=Km,l.subtract=W0,l.sum=j0,l.sumBy=q0,l.template=Xm,l.times=S0,l.toFinite=kt,l.toInteger=j,l.toLength=$u,l.toLower=Zm,l.toNumber=nt,l.toSafeInteger=Zg,l.toString=ne,l.toUpper=e0,l.trim=t0,l.trimEnd=n0,l.trimStart=r0,l.truncate=i0,l.unescape=s0,l.uniqueId=L0,l.upperCase=o0,l.upperFirst=qs,l.each=Iu,l.eachRight=xu,l.first=_u,zs(l,function(){var e={};return wt(l,function(t,s){ie.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=a,He(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),He(["drop","take"],function(e,t){z.prototype[e]=function(s){s=s===r?1:Ee(j(s),0);var o=this.__filtered__&&!t?new z(this):this.clone();return o.__filtered__?o.__takeCount__=Oe(s,o.__takeCount__):o.__views__.push({size:Oe(s,Tt),type:e+(o.__dir__<0?"Right":"")}),o},z.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),He(["filter","map","takeWhile"],function(e,t){var s=t+1,o=s==yo||s==tl;z.prototype[e]=function(c){var f=this.clone();return f.__iteratees__.push({iteratee:k(c,3),type:s}),f.__filtered__=f.__filtered__||o,f}}),He(["head","last"],function(e,t){var s="take"+(t?"Right":"");z.prototype[e]=function(){return this[s](1).value()[0]}}),He(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");z.prototype[e]=function(){return this.__filtered__?new z(this):this[s](1)}}),z.prototype.compact=function(){return this.filter(Be)},z.prototype.find=function(e){return this.filter(e).head()},z.prototype.findLast=function(e){return this.reverse().find(e)},z.prototype.invokeMap=J(function(e,t){return typeof e=="function"?new z(this):this.map(function(s){return ir(s,e,t)})}),z.prototype.reject=function(e){return this.filter(fi(k(e)))},z.prototype.slice=function(e,t){e=j(e);var s=this;return s.__filtered__&&(e>0||t<0)?new z(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=j(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},z.prototype.toArray=function(){return this.take(Tt)},wt(z.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),c=l[o?"take"+(t=="last"?"Right":""):t],f=o||/^find/.test(t);c&&(l.prototype[t]=function(){var h=this.__wrapped__,d=o?[1]:arguments,m=h instanceof z,T=d[0],w=m||V(h),A=function(Q){var H=c.apply(l,Vt([Q],d));return o&&S?H[0]:H};w&&s&&typeof T=="function"&&T.length!=1&&(m=w=!1);var S=this.__chain__,D=!!this.__actions__.length,U=f&&!S,q=m&&!D;if(!f&&w){h=q?h:new z(this);var $=e.apply(h,d);return $.__actions__.push({func:ai,args:[A],thisArg:r}),new Xe($,S)}return U&&q?e.apply(this,d):($=this.thru(A),U?o?$.value()[0]:$.value():$)})}),He(["pop","push","shift","sort","splice","unshift"],function(e){var t=Dr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(o&&!this.__chain__){var f=this.value();return t.apply(V(f)?f:[],c)}return this[s](function(h){return t.apply(V(h)?h:[],c)})}}),wt(z.prototype,function(e,t){var s=l[t];if(s){var o=s.name+"";ie.call(bn,o)||(bn[o]=[]),bn[o].push({name:t,func:s})}}),bn[ei(r,ve).name]=[{name:"wrapper",func:r}],z.prototype.clone=sp,z.prototype.reverse=op,z.prototype.value=ap,l.prototype.at=Ud,l.prototype.chain=$d,l.prototype.commit=Pd,l.prototype.next=Md,l.prototype.plant=Gd,l.prototype.reverse=Vd,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Wd,l.prototype.first=l.prototype.head,Kn&&(l.prototype[Kn]=Bd),l},xn=Pf();sn?((sn.exports=xn)._=xn,Qi._=xn):be._=xn}).call(hv)}(pr,pr.exports)),pr.exports}var gv=dv();const Ku=n=>{const i=gv.startCase(n).toLowerCase();return i.charAt(0).toUpperCase()+i.slice(1)},mv="src/app";var wi=(n=>(n.AGENT="agent",n.OBJECT="object",n.FUNCTION="function",n.ROLE="role",n))(wi||{});const vv=n=>Object.values(wi).includes(n);class yv{async execute(i,r){try{const a=r?ke.join(vt,r):ke.join(vt,mv);await Ie.ensureDir(a);const u=i??await this.getEntity();if(u==="object"){const p=await this.getObjectData(),v=p.nameSingular,I=`${av.default(v)}.object.ts`,N=lv({data:p,name:v}),R=ke.join(a,I);await Ie.writeFile(R,N),console.log(F.default.green("✓ Created object:"),F.default.cyan(R.replace(vt+"/","")));return}if(u==="function"){const p=await this.getEntityName(u),v=`${Ti.default(p)}.function.ts`,I=fv({name:p}),N=ke.join(a,v);await Ie.writeFile(N,I),console.log(F.default.green("✓ Created function:"),F.default.cyan(N.replace(vt+"/","")));return}if(u==="role"){const p=await this.getEntityName(u),v=`${Ti.default(p)}.role.ts`,I=pv({name:p}),N=ke.join(a,v);await Ie.writeFile(N,I),console.log(F.default.green("✓ Created role:"),F.default.cyan(N.replace(vt+"/","")));return}}catch(a){console.error(F.default.red("Add new entity failed:"),a instanceof Error?a.message:a),process.exit(1)}}async getEntity(){const{entity:i}=await $n.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:["function","object","role"]}]);return i}async getEntityName(i){const{name:r}=await $n.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${i}:`,default:"",validate:a=>a.length===0?`${i} name is required`:/^[a-z0-9-]+$/.test(a)?!0:"Name must contain only lowercase letters, numbers, and hyphens"}]);return r}async getObjectData(){return $n.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(i,r)=>i.trim()===r?.nameSingular.trim()?"Name plural must be different from name singular":!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:i=>Ku(i.nameSingular),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:i=>Ku(i.namePlural),validate:i=>!i||i.trim().length===0?"Please enter a non empty string":!0}])}}function te(n,i){if(!!!n)throw new Error(i)}function Mt(n){return typeof n=="object"&&n!==null}function yr(n,i){if(!!!n)throw new Error(i??"Unexpected invariant triggered.")}const _v=/\r\n|[\n\r]/g;function ro(n,i){let r=0,a=1;for(const u of n.body.matchAll(_v)){if(typeof u.index=="number"||yr(!1),u.index>=i)break;r=u.index+u[0].length,a+=1}return{line:a,column:i+1-r}}function Tv(n){return uc(n.source,ro(n.source,n.start))}function uc(n,i){const r=n.locationOffset.column-1,a="".padStart(r)+n.body,u=i.line-1,p=n.locationOffset.line-1,v=i.line+p,I=i.line===1?r:0,N=i.column+I,R=`${n.name}:${v}:${N}
108
- `,O=a.split(/\r\n|[\n\r]/g),M=O[u];if(M.length>120){const Z=Math.floor(N/80),ce=N%80,W=[];for(let Te=0;Te<M.length;Te+=80)W.push(M.slice(Te,Te+80));return R+Xu([[`${v} |`,W[0]],...W.slice(1,Z+1).map(Te=>["|",Te]),["|","^".padStart(ce)],["|",W[Z+1]]])}return R+Xu([[`${v-1} |`,O[u-1]],[`${v} |`,M],["|","^".padStart(N)],[`${v+1} |`,O[u+1]]])}function Xu(n){const i=n.filter(([a,u])=>u!==void 0),r=Math.max(...i.map(([a])=>a.length));return i.map(([a,u])=>a.padStart(r)+(u?" "+u:"")).join(`
109
- `)}function wv(n){const i=n[0];return i==null||"kind"in i||"length"in i?{nodes:i,source:n[1],positions:n[2],path:n[3],originalError:n[4],extensions:n[5]}:i}class re extends Error{constructor(i,...r){var a,u,p;const{nodes:v,source:I,positions:N,path:R,originalError:O,extensions:M}=wv(r);super(i),this.name="GraphQLError",this.path=R??void 0,this.originalError=O??void 0,this.nodes=Zu(Array.isArray(v)?v:v?[v]:void 0);const Z=Zu((a=this.nodes)===null||a===void 0?void 0:a.map(W=>W.loc).filter(W=>W!=null));this.source=I??(Z==null||(u=Z[0])===null||u===void 0?void 0:u.source),this.positions=N??Z?.map(W=>W.start),this.locations=N&&I?N.map(W=>ro(I,W)):Z?.map(W=>ro(W.source,W.start));const ce=Mt(O?.extensions)?O?.extensions:void 0;this.extensions=(p=M??ce)!==null&&p!==void 0?p:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),O!=null&&O.stack?Object.defineProperty(this,"stack",{value:O.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,re):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let i=this.message;if(this.nodes)for(const r of this.nodes)r.loc&&(i+=`
110
-
111
- `+Tv(r.loc));else if(this.source&&this.locations)for(const r of this.locations)i+=`
112
-
113
- `+uc(this.source,r);return i}toJSON(){const i={message:this.message};return this.locations!=null&&(i.locations=this.locations),this.path!=null&&(i.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(i.extensions=this.extensions),i}}function Zu(n){return n===void 0||n.length===0?void 0:n}function Ae(n,i,r){return new re(`Syntax Error: ${r}`,{source:n,positions:[i]})}class Ev{constructor(i,r,a){this.start=i.start,this.end=r.end,this.startToken=i,this.endToken=r,this.source=a}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class cc{constructor(i,r,a,u,p,v){this.kind=i,this.start=r,this.end=a,this.line=u,this.column=p,this.value=v,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const lc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Iv=new Set(Object.keys(lc));function ec(n){const i=n?.kind;return typeof i=="string"&&Iv.has(i)}var $t;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})($t||($t={}));var X;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(X||(X={}));var b;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(b||(b={}));function io(n){return n===9||n===32}function gr(n){return n>=48&&n<=57}function fc(n){return n>=97&&n<=122||n>=65&&n<=90}function co(n){return fc(n)||n===95}function pc(n){return fc(n)||gr(n)||n===95}function xv(n){var i;let r=Number.MAX_SAFE_INTEGER,a=null,u=-1;for(let v=0;v<n.length;++v){var p;const I=n[v],N=Av(I);N!==I.length&&(a=(p=a)!==null&&p!==void 0?p:v,u=v,v!==0&&N<r&&(r=N))}return n.map((v,I)=>I===0?v:v.slice(r)).slice((i=a)!==null&&i!==void 0?i:0,u+1)}function Av(n){let i=0;for(;i<n.length&&io(n.charCodeAt(i));)++i;return i}function Nv(n){if(n==="")return!0;let i=!0,r=!1,a=!0,u=!1;for(let p=0;p<n.length;++p)switch(n.codePointAt(p)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(i&&!u)return!1;u=!0,i=!0,r=!1;break;case 9:case 32:r||(r=i);break;default:a&&(a=r),i=!1}return!(i||a&&u)}function bv(n,i){const r=n.replace(/"""/g,'\\"""'),a=r.split(/\r\n|[\n\r]/g),u=a.length===1,p=a.length>1&&a.slice(1).every(ce=>ce.length===0||io(ce.charCodeAt(0))),v=r.endsWith('\\"""'),I=n.endsWith('"')&&!v,N=n.endsWith("\\"),R=I||N,O=!u||n.length>70||R||p||v;let M="";const Z=u&&io(n.charCodeAt(0));return(O&&!Z||p)&&(M+=`
114
- `),M+=r,(O||R)&&(M+=`
115
- `),'"""'+M+'"""'}var E;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(E||(E={}));class Sv{constructor(i){const r=new cc(E.SOF,0,0,0,0);this.source=i,this.lastToken=r,this.token=r,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let i=this.token;if(i.kind!==E.EOF)do if(i.next)i=i.next;else{const r=Lv(this,i.end);i.next=r,r.prev=i,i=r}while(i.kind===E.COMMENT);return i}}function Ov(n){return n===E.BANG||n===E.DOLLAR||n===E.AMP||n===E.PAREN_L||n===E.PAREN_R||n===E.SPREAD||n===E.COLON||n===E.EQUALS||n===E.AT||n===E.BRACKET_L||n===E.BRACKET_R||n===E.BRACE_L||n===E.PIPE||n===E.BRACE_R}function Mn(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function Ai(n,i){return hc(n.charCodeAt(i))&&dc(n.charCodeAt(i+1))}function hc(n){return n>=55296&&n<=56319}function dc(n){return n>=56320&&n<=57343}function gn(n,i){const r=n.source.body.codePointAt(i);if(r===void 0)return E.EOF;if(r>=32&&r<=126){const a=String.fromCodePoint(r);return a==='"'?`'"'`:`"${a}"`}return"U+"+r.toString(16).toUpperCase().padStart(4,"0")}function _e(n,i,r,a,u){const p=n.line,v=1+r-n.lineStart;return new cc(i,r,a,p,v,u)}function Lv(n,i){const r=n.source.body,a=r.length;let u=i;for(;u<a;){const p=r.charCodeAt(u);switch(p){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:r.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return Rv(n,u);case 33:return _e(n,E.BANG,u,u+1);case 36:return _e(n,E.DOLLAR,u,u+1);case 38:return _e(n,E.AMP,u,u+1);case 40:return _e(n,E.PAREN_L,u,u+1);case 41:return _e(n,E.PAREN_R,u,u+1);case 46:if(r.charCodeAt(u+1)===46&&r.charCodeAt(u+2)===46)return _e(n,E.SPREAD,u,u+3);break;case 58:return _e(n,E.COLON,u,u+1);case 61:return _e(n,E.EQUALS,u,u+1);case 64:return _e(n,E.AT,u,u+1);case 91:return _e(n,E.BRACKET_L,u,u+1);case 93:return _e(n,E.BRACKET_R,u,u+1);case 123:return _e(n,E.BRACE_L,u,u+1);case 124:return _e(n,E.PIPE,u,u+1);case 125:return _e(n,E.BRACE_R,u,u+1);case 34:return r.charCodeAt(u+1)===34&&r.charCodeAt(u+2)===34?$v(n,u):Dv(n,u)}if(gr(p)||p===45)return Cv(n,u,p);if(co(p))return Pv(n,u);throw Ae(n.source,u,p===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Mn(p)||Ai(r,u)?`Unexpected character: ${gn(n,u)}.`:`Invalid character: ${gn(n,u)}.`)}return _e(n,E.EOF,a,a)}function Rv(n,i){const r=n.source.body,a=r.length;let u=i+1;for(;u<a;){const p=r.charCodeAt(u);if(p===10||p===13)break;if(Mn(p))++u;else if(Ai(r,u))u+=2;else break}return _e(n,E.COMMENT,i,u,r.slice(i+1,u))}function Cv(n,i,r){const a=n.source.body;let u=i,p=r,v=!1;if(p===45&&(p=a.charCodeAt(++u)),p===48){if(p=a.charCodeAt(++u),gr(p))throw Ae(n.source,u,`Invalid number, unexpected digit after 0: ${gn(n,u)}.`)}else u=eo(n,u,p),p=a.charCodeAt(u);if(p===46&&(v=!0,p=a.charCodeAt(++u),u=eo(n,u,p),p=a.charCodeAt(u)),(p===69||p===101)&&(v=!0,p=a.charCodeAt(++u),(p===43||p===45)&&(p=a.charCodeAt(++u)),u=eo(n,u,p),p=a.charCodeAt(u)),p===46||co(p))throw Ae(n.source,u,`Invalid number, expected digit but got: ${gn(n,u)}.`);return _e(n,v?E.FLOAT:E.INT,i,u,a.slice(i,u))}function eo(n,i,r){if(!gr(r))throw Ae(n.source,i,`Invalid number, expected digit but got: ${gn(n,i)}.`);const a=n.source.body;let u=i+1;for(;gr(a.charCodeAt(u));)++u;return u}function Dv(n,i){const r=n.source.body,a=r.length;let u=i+1,p=u,v="";for(;u<a;){const I=r.charCodeAt(u);if(I===34)return v+=r.slice(p,u),_e(n,E.STRING,i,u+1,v);if(I===92){v+=r.slice(p,u);const N=r.charCodeAt(u+1)===117?r.charCodeAt(u+2)===123?Fv(n,u):kv(n,u):Uv(n,u);v+=N.value,u+=N.size,p=u;continue}if(I===10||I===13)break;if(Mn(I))++u;else if(Ai(r,u))u+=2;else throw Ae(n.source,u,`Invalid character within String: ${gn(n,u)}.`)}throw Ae(n.source,u,"Unterminated string.")}function Fv(n,i){const r=n.source.body;let a=0,u=3;for(;u<12;){const p=r.charCodeAt(i+u++);if(p===125){if(u<5||!Mn(a))break;return{value:String.fromCodePoint(a),size:u}}if(a=a<<4|hr(p),a<0)break}throw Ae(n.source,i,`Invalid Unicode escape sequence: "${r.slice(i,i+u)}".`)}function kv(n,i){const r=n.source.body,a=tc(r,i+2);if(Mn(a))return{value:String.fromCodePoint(a),size:6};if(hc(a)&&r.charCodeAt(i+6)===92&&r.charCodeAt(i+7)===117){const u=tc(r,i+8);if(dc(u))return{value:String.fromCodePoint(a,u),size:12}}throw Ae(n.source,i,`Invalid Unicode escape sequence: "${r.slice(i,i+6)}".`)}function tc(n,i){return hr(n.charCodeAt(i))<<12|hr(n.charCodeAt(i+1))<<8|hr(n.charCodeAt(i+2))<<4|hr(n.charCodeAt(i+3))}function hr(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Uv(n,i){const r=n.source.body;switch(r.charCodeAt(i+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
116
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Ae(n.source,i,`Invalid character escape sequence: "${r.slice(i,i+2)}".`)}function $v(n,i){const r=n.source.body,a=r.length;let u=n.lineStart,p=i+3,v=p,I="";const N=[];for(;p<a;){const R=r.charCodeAt(p);if(R===34&&r.charCodeAt(p+1)===34&&r.charCodeAt(p+2)===34){I+=r.slice(v,p),N.push(I);const O=_e(n,E.BLOCK_STRING,i,p+3,xv(N).join(`
117
- `));return n.line+=N.length-1,n.lineStart=u,O}if(R===92&&r.charCodeAt(p+1)===34&&r.charCodeAt(p+2)===34&&r.charCodeAt(p+3)===34){I+=r.slice(v,p),v=p+1,p+=4;continue}if(R===10||R===13){I+=r.slice(v,p),N.push(I),R===13&&r.charCodeAt(p+1)===10?p+=2:++p,I="",v=p,u=p;continue}if(Mn(R))++p;else if(Ai(r,p))p+=2;else throw Ae(n.source,p,`Invalid character within String: ${gn(n,p)}.`)}throw Ae(n.source,p,"Unterminated string.")}function Pv(n,i){const r=n.source.body,a=r.length;let u=i+1;for(;u<a;){const p=r.charCodeAt(u);if(pc(p))++u;else break}return _e(n,E.NAME,i,u,r.slice(i,u))}const Mv=10,gc=2;function P(n){return Ni(n,[])}function Ni(n,i){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Bv(n,i);default:return String(n)}}function Bv(n,i){if(n===null)return"null";if(i.includes(n))return"[Circular]";const r=[...i,n];if(Gv(n)){const a=n.toJSON();if(a!==n)return typeof a=="string"?a:Ni(a,r)}else if(Array.isArray(n))return Wv(n,r);return Vv(n,r)}function Gv(n){return typeof n.toJSON=="function"}function Vv(n,i){const r=Object.entries(n);return r.length===0?"{}":i.length>gc?"["+jv(n)+"]":"{ "+r.map(([u,p])=>u+": "+Ni(p,i)).join(", ")+" }"}function Wv(n,i){if(n.length===0)return"[]";if(i.length>gc)return"[Array]";const r=Math.min(Mv,n.length),a=n.length-r,u=[];for(let p=0;p<r;++p)u.push(Ni(n[p],i));return a===1?u.push("... 1 more item"):a>1&&u.push(`... ${a} more items`),"["+u.join(", ")+"]"}function jv(n){const i=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(i==="Object"&&typeof n.constructor=="function"){const r=n.constructor.name;if(typeof r=="string"&&r!=="")return r}return i}const Nt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(i,r){return i instanceof r}:function(i,r){if(i instanceof r)return!0;if(typeof i=="object"&&i!==null){var a;const u=r.prototype[Symbol.toStringTag],p=Symbol.toStringTag in i?i[Symbol.toStringTag]:(a=i.constructor)===null||a===void 0?void 0:a.name;if(u===p){const v=P(i);throw new Error(`Cannot use ${u} "${v}" from another module or realm.
14
+ `+Wc(this.source,i);return r}toJSON(){const r={message:this.message};return this.locations!=null&&(r.locations=this.locations),this.path!=null&&(r.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(r.extensions=this.extensions),r}}function Tc(n){return n===void 0||n.length===0?void 0:n}function ke(n,r,i){return new fe(`Syntax Error: ${i}`,{source:n,positions:[r]})}class mv{constructor(r,i,o){this.start=r.start,this.end=i.end,this.startToken=r,this.endToken=i,this.source=o}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Gc{constructor(r,i,o,u,f,g){this.kind=r,this.start=i,this.end=o,this.line=u,this.column=f,this.value=g,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Vc={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},yv=new Set(Object.keys(Vc));function wc(n){const r=n?.kind;return typeof r=="string"&&yv.has(r)}var Qt;(function(n){n.QUERY="query",n.MUTATION="mutation",n.SUBSCRIPTION="subscription"})(Qt||(Qt={}));var se;(function(n){n.QUERY="QUERY",n.MUTATION="MUTATION",n.SUBSCRIPTION="SUBSCRIPTION",n.FIELD="FIELD",n.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",n.FRAGMENT_SPREAD="FRAGMENT_SPREAD",n.INLINE_FRAGMENT="INLINE_FRAGMENT",n.VARIABLE_DEFINITION="VARIABLE_DEFINITION",n.SCHEMA="SCHEMA",n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.FIELD_DEFINITION="FIELD_DEFINITION",n.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.ENUM_VALUE="ENUM_VALUE",n.INPUT_OBJECT="INPUT_OBJECT",n.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(se||(se={}));var N;(function(n){n.NAME="Name",n.DOCUMENT="Document",n.OPERATION_DEFINITION="OperationDefinition",n.VARIABLE_DEFINITION="VariableDefinition",n.SELECTION_SET="SelectionSet",n.FIELD="Field",n.ARGUMENT="Argument",n.FRAGMENT_SPREAD="FragmentSpread",n.INLINE_FRAGMENT="InlineFragment",n.FRAGMENT_DEFINITION="FragmentDefinition",n.VARIABLE="Variable",n.INT="IntValue",n.FLOAT="FloatValue",n.STRING="StringValue",n.BOOLEAN="BooleanValue",n.NULL="NullValue",n.ENUM="EnumValue",n.LIST="ListValue",n.OBJECT="ObjectValue",n.OBJECT_FIELD="ObjectField",n.DIRECTIVE="Directive",n.NAMED_TYPE="NamedType",n.LIST_TYPE="ListType",n.NON_NULL_TYPE="NonNullType",n.SCHEMA_DEFINITION="SchemaDefinition",n.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",n.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",n.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",n.FIELD_DEFINITION="FieldDefinition",n.INPUT_VALUE_DEFINITION="InputValueDefinition",n.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",n.UNION_TYPE_DEFINITION="UnionTypeDefinition",n.ENUM_TYPE_DEFINITION="EnumTypeDefinition",n.ENUM_VALUE_DEFINITION="EnumValueDefinition",n.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",n.DIRECTIVE_DEFINITION="DirectiveDefinition",n.SCHEMA_EXTENSION="SchemaExtension",n.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",n.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",n.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",n.UNION_TYPE_EXTENSION="UnionTypeExtension",n.ENUM_TYPE_EXTENSION="EnumTypeExtension",n.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(N||(N={}));function Na(n){return n===9||n===32}function Bi(n){return n>=48&&n<=57}function qc(n){return n>=97&&n<=122||n>=65&&n<=90}function Fa(n){return qc(n)||n===95}function Jc(n){return qc(n)||Bi(n)||n===95}function vv(n){var r;let i=Number.MAX_SAFE_INTEGER,o=null,u=-1;for(let g=0;g<n.length;++g){var f;const v=n[g],w=_v(v);w!==v.length&&(o=(f=o)!==null&&f!==void 0?f:g,u=g,g!==0&&w<i&&(i=w))}return n.map((g,v)=>v===0?g:g.slice(i)).slice((r=o)!==null&&r!==void 0?r:0,u+1)}function _v(n){let r=0;for(;r<n.length&&Na(n.charCodeAt(r));)++r;return r}function xv(n){if(n==="")return!0;let r=!0,i=!1,o=!0,u=!1;for(let f=0;f<n.length;++f)switch(n.codePointAt(f)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(r&&!u)return!1;u=!0,r=!0,i=!1;break;case 9:case 32:i||(i=r);break;default:o&&(o=i),r=!1}return!(r||o&&u)}function Tv(n,r){const i=n.replace(/"""/g,'\\"""'),o=i.split(/\r\n|[\n\r]/g),u=o.length===1,f=o.length>1&&o.slice(1).every(M=>M.length===0||Na(M.charCodeAt(0))),g=i.endsWith('\\"""'),v=n.endsWith('"')&&!g,w=n.endsWith("\\"),b=v||w,O=!u||n.length>70||b||f||g;let D="";const P=u&&Na(n.charCodeAt(0));return(O&&!P||f)&&(D+=`
15
+ `),D+=i,(O||b)&&(D+=`
16
+ `),'"""'+D+'"""'}var A;(function(n){n.SOF="<SOF>",n.EOF="<EOF>",n.BANG="!",n.DOLLAR="$",n.AMP="&",n.PAREN_L="(",n.PAREN_R=")",n.SPREAD="...",n.COLON=":",n.EQUALS="=",n.AT="@",n.BRACKET_L="[",n.BRACKET_R="]",n.BRACE_L="{",n.PIPE="|",n.BRACE_R="}",n.NAME="Name",n.INT="Int",n.FLOAT="Float",n.STRING="String",n.BLOCK_STRING="BlockString",n.COMMENT="Comment"})(A||(A={}));class wv{constructor(r){const i=new Gc(A.SOF,0,0,0,0);this.source=r,this.lastToken=i,this.token=i,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let r=this.token;if(r.kind!==A.EOF)do if(r.next)r=r.next;else{const i=Sv(this,r.end);r.next=i,i.prev=r,r=i}while(r.kind===A.COMMENT);return r}}function Ev(n){return n===A.BANG||n===A.DOLLAR||n===A.AMP||n===A.PAREN_L||n===A.PAREN_R||n===A.SPREAD||n===A.COLON||n===A.EQUALS||n===A.AT||n===A.BRACKET_L||n===A.BRACKET_R||n===A.BRACE_L||n===A.PIPE||n===A.BRACE_R}function hi(n){return n>=0&&n<=55295||n>=57344&&n<=1114111}function qr(n,r){return zc(n.charCodeAt(r))&&Qc(n.charCodeAt(r+1))}function zc(n){return n>=55296&&n<=56319}function Qc(n){return n>=56320&&n<=57343}function Bn(n,r){const i=n.source.body.codePointAt(r);if(i===void 0)return A.EOF;if(i>=32&&i<=126){const o=String.fromCodePoint(i);return o==='"'?`'"'`:`"${o}"`}return"U+"+i.toString(16).toUpperCase().padStart(4,"0")}function Re(n,r,i,o,u){const f=n.line,g=1+i-n.lineStart;return new Gc(r,i,o,f,g,u)}function Sv(n,r){const i=n.source.body,o=i.length;let u=r;for(;u<o;){const f=i.charCodeAt(u);switch(f){case 65279:case 9:case 32:case 44:++u;continue;case 10:++u,++n.line,n.lineStart=u;continue;case 13:i.charCodeAt(u+1)===10?u+=2:++u,++n.line,n.lineStart=u;continue;case 35:return Av(n,u);case 33:return Re(n,A.BANG,u,u+1);case 36:return Re(n,A.DOLLAR,u,u+1);case 38:return Re(n,A.AMP,u,u+1);case 40:return Re(n,A.PAREN_L,u,u+1);case 41:return Re(n,A.PAREN_R,u,u+1);case 46:if(i.charCodeAt(u+1)===46&&i.charCodeAt(u+2)===46)return Re(n,A.SPREAD,u,u+3);break;case 58:return Re(n,A.COLON,u,u+1);case 61:return Re(n,A.EQUALS,u,u+1);case 64:return Re(n,A.AT,u,u+1);case 91:return Re(n,A.BRACKET_L,u,u+1);case 93:return Re(n,A.BRACKET_R,u,u+1);case 123:return Re(n,A.BRACE_L,u,u+1);case 124:return Re(n,A.PIPE,u,u+1);case 125:return Re(n,A.BRACE_R,u,u+1);case 34:return i.charCodeAt(u+1)===34&&i.charCodeAt(u+2)===34?Cv(n,u):bv(n,u)}if(Bi(f)||f===45)return Iv(n,u,f);if(Fa(f))return Lv(n,u);throw ke(n.source,u,f===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:hi(f)||qr(i,u)?`Unexpected character: ${Bn(n,u)}.`:`Invalid character: ${Bn(n,u)}.`)}return Re(n,A.EOF,o,o)}function Av(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(f===10||f===13)break;if(hi(f))++u;else if(qr(i,u))u+=2;else break}return Re(n,A.COMMENT,r,u,i.slice(r+1,u))}function Iv(n,r,i){const o=n.source.body;let u=r,f=i,g=!1;if(f===45&&(f=o.charCodeAt(++u)),f===48){if(f=o.charCodeAt(++u),Bi(f))throw ke(n.source,u,`Invalid number, unexpected digit after 0: ${Bn(n,u)}.`)}else u=Ta(n,u,f),f=o.charCodeAt(u);if(f===46&&(g=!0,f=o.charCodeAt(++u),u=Ta(n,u,f),f=o.charCodeAt(u)),(f===69||f===101)&&(g=!0,f=o.charCodeAt(++u),(f===43||f===45)&&(f=o.charCodeAt(++u)),u=Ta(n,u,f),f=o.charCodeAt(u)),f===46||Fa(f))throw ke(n.source,u,`Invalid number, expected digit but got: ${Bn(n,u)}.`);return Re(n,g?A.FLOAT:A.INT,r,u,o.slice(r,u))}function Ta(n,r,i){if(!Bi(i))throw ke(n.source,r,`Invalid number, expected digit but got: ${Bn(n,r)}.`);const o=n.source.body;let u=r+1;for(;Bi(o.charCodeAt(u));)++u;return u}function bv(n,r){const i=n.source.body,o=i.length;let u=r+1,f=u,g="";for(;u<o;){const v=i.charCodeAt(u);if(v===34)return g+=i.slice(f,u),Re(n,A.STRING,r,u+1,g);if(v===92){g+=i.slice(f,u);const w=i.charCodeAt(u+1)===117?i.charCodeAt(u+2)===123?Nv(n,u):Ov(n,u):Rv(n,u);g+=w.value,u+=w.size,f=u;continue}if(v===10||v===13)break;if(hi(v))++u;else if(qr(i,u))u+=2;else throw ke(n.source,u,`Invalid character within String: ${Bn(n,u)}.`)}throw ke(n.source,u,"Unterminated string.")}function Nv(n,r){const i=n.source.body;let o=0,u=3;for(;u<12;){const f=i.charCodeAt(r+u++);if(f===125){if(u<5||!hi(o))break;return{value:String.fromCodePoint(o),size:u}}if(o=o<<4|Ui(f),o<0)break}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+u)}".`)}function Ov(n,r){const i=n.source.body,o=Ec(i,r+2);if(hi(o))return{value:String.fromCodePoint(o),size:6};if(zc(o)&&i.charCodeAt(r+6)===92&&i.charCodeAt(r+7)===117){const u=Ec(i,r+8);if(Qc(u))return{value:String.fromCodePoint(o,u),size:12}}throw ke(n.source,r,`Invalid Unicode escape sequence: "${i.slice(r,r+6)}".`)}function Ec(n,r){return Ui(n.charCodeAt(r))<<12|Ui(n.charCodeAt(r+1))<<8|Ui(n.charCodeAt(r+2))<<4|Ui(n.charCodeAt(r+3))}function Ui(n){return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:-1}function Rv(n,r){const i=n.source.body;switch(i.charCodeAt(r+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
17
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw ke(n.source,r,`Invalid character escape sequence: "${i.slice(r,r+2)}".`)}function Cv(n,r){const i=n.source.body,o=i.length;let u=n.lineStart,f=r+3,g=f,v="";const w=[];for(;f<o;){const b=i.charCodeAt(f);if(b===34&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34){v+=i.slice(g,f),w.push(v);const O=Re(n,A.BLOCK_STRING,r,f+3,vv(w).join(`
18
+ `));return n.line+=w.length-1,n.lineStart=u,O}if(b===92&&i.charCodeAt(f+1)===34&&i.charCodeAt(f+2)===34&&i.charCodeAt(f+3)===34){v+=i.slice(g,f),g=f+1,f+=4;continue}if(b===10||b===13){v+=i.slice(g,f),w.push(v),b===13&&i.charCodeAt(f+1)===10?f+=2:++f,v="",g=f,u=f;continue}if(hi(b))++f;else if(qr(i,f))f+=2;else throw ke(n.source,f,`Invalid character within String: ${Bn(n,f)}.`)}throw ke(n.source,f,"Unterminated string.")}function Lv(n,r){const i=n.source.body,o=i.length;let u=r+1;for(;u<o;){const f=i.charCodeAt(u);if(Jc(f))++u;else break}return Re(n,A.NAME,r,u,i.slice(r,u))}const Fv=10,Hc=2;function J(n){return Jr(n,[])}function Jr(n,r){switch(typeof n){case"string":return JSON.stringify(n);case"function":return n.name?`[function ${n.name}]`:"[function]";case"object":return Dv(n,r);default:return String(n)}}function Dv(n,r){if(n===null)return"null";if(r.includes(n))return"[Circular]";const i=[...r,n];if(Pv(n)){const o=n.toJSON();if(o!==n)return typeof o=="string"?o:Jr(o,i)}else if(Array.isArray(n))return Uv(n,i);return kv(n,i)}function Pv(n){return typeof n.toJSON=="function"}function kv(n,r){const i=Object.entries(n);return i.length===0?"{}":r.length>Hc?"["+Mv(n)+"]":"{ "+i.map(([u,f])=>u+": "+Jr(f,r)).join(", ")+" }"}function Uv(n,r){if(n.length===0)return"[]";if(r.length>Hc)return"[Array]";const i=Math.min(Fv,n.length),o=n.length-i,u=[];for(let f=0;f<i;++f)u.push(Jr(n[f],r));return o===1?u.push("... 1 more item"):o>1&&u.push(`... ${o} more items`),"["+u.join(", ")+"]"}function Mv(n){const r=Object.prototype.toString.call(n).replace(/^\[object /,"").replace(/]$/,"");if(r==="Object"&&typeof n.constructor=="function"){const i=n.constructor.name;if(typeof i=="string"&&i!=="")return i}return r}const kt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(r,i){return r instanceof i}:function(r,i){if(r instanceof i)return!0;if(typeof r=="object"&&r!==null){var o;const u=i.prototype[Symbol.toStringTag],f=Symbol.toStringTag in r?r[Symbol.toStringTag]:(o=r.constructor)===null||o===void 0?void 0:o.name;if(u===f){const g=J(r);throw new Error(`Cannot use ${u} "${g}" from another module or realm.
118
19
 
119
20
  Ensure that there is only one instance of "graphql" in the node_modules
120
21
  directory. If different versions of "graphql" are the dependencies of other
@@ -125,39 +26,39 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
125
26
  Duplicate "graphql" modules cannot be used at the same time since different
126
27
  versions may have different capabilities and behavior. The data from one
127
28
  version used in the function from another could produce confusing and
128
- spurious results.`)}}return!1};class mc{constructor(i,r="GraphQL request",a={line:1,column:1}){typeof i=="string"||te(!1,`Body must be a string. Received: ${P(i)}.`),this.body=i,this.name=r,this.locationOffset=a,this.locationOffset.line>0||te(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||te(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function qv(n){return Nt(n,mc)}function Jv(n,i){const r=new Qv(n,i);r.expectToken(E.SOF);const a=r.parseValueLiteral(!1);return r.expectToken(E.EOF),a}class Qv{constructor(i,r={}){const a=qv(i)?i:new mc(i);this._lexer=new Sv(a),this._options=r,this._tokenCounter=0}parseName(){const i=this.expectToken(E.NAME);return this.node(i,{kind:b.NAME,value:i.value})}parseDocument(){return this.node(this._lexer.token,{kind:b.DOCUMENT,definitions:this.many(E.SOF,this.parseDefinition,E.EOF)})}parseDefinition(){if(this.peek(E.BRACE_L))return this.parseOperationDefinition();const i=this.peekDescription(),r=i?this._lexer.lookahead():this._lexer.token;if(r.kind===E.NAME){switch(r.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(i)throw Ae(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(r.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(r)}parseOperationDefinition(){const i=this._lexer.token;if(this.peek(E.BRACE_L))return this.node(i,{kind:b.OPERATION_DEFINITION,operation:$t.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const r=this.parseOperationType();let a;return this.peek(E.NAME)&&(a=this.parseName()),this.node(i,{kind:b.OPERATION_DEFINITION,operation:r,name:a,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const i=this.expectToken(E.NAME);switch(i.value){case"query":return $t.QUERY;case"mutation":return $t.MUTATION;case"subscription":return $t.SUBSCRIPTION}throw this.unexpected(i)}parseVariableDefinitions(){return this.optionalMany(E.PAREN_L,this.parseVariableDefinition,E.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:b.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(E.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(E.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const i=this._lexer.token;return this.expectToken(E.DOLLAR),this.node(i,{kind:b.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:b.SELECTION_SET,selections:this.many(E.BRACE_L,this.parseSelection,E.BRACE_R)})}parseSelection(){return this.peek(E.SPREAD)?this.parseFragment():this.parseField()}parseField(){const i=this._lexer.token,r=this.parseName();let a,u;return this.expectOptionalToken(E.COLON)?(a=r,u=this.parseName()):u=r,this.node(i,{kind:b.FIELD,alias:a,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(E.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(i){const r=i?this.parseConstArgument:this.parseArgument;return this.optionalMany(E.PAREN_L,r,E.PAREN_R)}parseArgument(i=!1){const r=this._lexer.token,a=this.parseName();return this.expectToken(E.COLON),this.node(r,{kind:b.ARGUMENT,name:a,value:this.parseValueLiteral(i)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const i=this._lexer.token;this.expectToken(E.SPREAD);const r=this.expectOptionalKeyword("on");return!r&&this.peek(E.NAME)?this.node(i,{kind:b.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(i,{kind:b.INLINE_FRAGMENT,typeCondition:r?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const i=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(i,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(i,{kind:b.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(i){const r=this._lexer.token;switch(r.kind){case E.BRACKET_L:return this.parseList(i);case E.BRACE_L:return this.parseObject(i);case E.INT:return this.advanceLexer(),this.node(r,{kind:b.INT,value:r.value});case E.FLOAT:return this.advanceLexer(),this.node(r,{kind:b.FLOAT,value:r.value});case E.STRING:case E.BLOCK_STRING:return this.parseStringLiteral();case E.NAME:switch(this.advanceLexer(),r.value){case"true":return this.node(r,{kind:b.BOOLEAN,value:!0});case"false":return this.node(r,{kind:b.BOOLEAN,value:!1});case"null":return this.node(r,{kind:b.NULL});default:return this.node(r,{kind:b.ENUM,value:r.value})}case E.DOLLAR:if(i)if(this.expectToken(E.DOLLAR),this._lexer.token.kind===E.NAME){const a=this._lexer.token.value;throw Ae(this._lexer.source,r.start,`Unexpected variable "$${a}" in constant value.`)}else throw this.unexpected(r);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const i=this._lexer.token;return this.advanceLexer(),this.node(i,{kind:b.STRING,value:i.value,block:i.kind===E.BLOCK_STRING})}parseList(i){const r=()=>this.parseValueLiteral(i);return this.node(this._lexer.token,{kind:b.LIST,values:this.any(E.BRACKET_L,r,E.BRACKET_R)})}parseObject(i){const r=()=>this.parseObjectField(i);return this.node(this._lexer.token,{kind:b.OBJECT,fields:this.any(E.BRACE_L,r,E.BRACE_R)})}parseObjectField(i){const r=this._lexer.token,a=this.parseName();return this.expectToken(E.COLON),this.node(r,{kind:b.OBJECT_FIELD,name:a,value:this.parseValueLiteral(i)})}parseDirectives(i){const r=[];for(;this.peek(E.AT);)r.push(this.parseDirective(i));return r}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(i){const r=this._lexer.token;return this.expectToken(E.AT),this.node(r,{kind:b.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(i)})}parseTypeReference(){const i=this._lexer.token;let r;if(this.expectOptionalToken(E.BRACKET_L)){const a=this.parseTypeReference();this.expectToken(E.BRACKET_R),r=this.node(i,{kind:b.LIST_TYPE,type:a})}else r=this.parseNamedType();return this.expectOptionalToken(E.BANG)?this.node(i,{kind:b.NON_NULL_TYPE,type:r}):r}parseNamedType(){return this.node(this._lexer.token,{kind:b.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(E.STRING)||this.peek(E.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("schema");const a=this.parseConstDirectives(),u=this.many(E.BRACE_L,this.parseOperationTypeDefinition,E.BRACE_R);return this.node(i,{kind:b.SCHEMA_DEFINITION,description:r,directives:a,operationTypes:u})}parseOperationTypeDefinition(){const i=this._lexer.token,r=this.parseOperationType();this.expectToken(E.COLON);const a=this.parseNamedType();return this.node(i,{kind:b.OPERATION_TYPE_DEFINITION,operation:r,type:a})}parseScalarTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("scalar");const a=this.parseName(),u=this.parseConstDirectives();return this.node(i,{kind:b.SCALAR_TYPE_DEFINITION,description:r,name:a,directives:u})}parseObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("type");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),v=this.parseFieldsDefinition();return this.node(i,{kind:b.OBJECT_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:v})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(E.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(E.BRACE_L,this.parseFieldDefinition,E.BRACE_R)}parseFieldDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName(),u=this.parseArgumentDefs();this.expectToken(E.COLON);const p=this.parseTypeReference(),v=this.parseConstDirectives();return this.node(i,{kind:b.FIELD_DEFINITION,description:r,name:a,arguments:u,type:p,directives:v})}parseArgumentDefs(){return this.optionalMany(E.PAREN_L,this.parseInputValueDef,E.PAREN_R)}parseInputValueDef(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseName();this.expectToken(E.COLON);const u=this.parseTypeReference();let p;this.expectOptionalToken(E.EQUALS)&&(p=this.parseConstValueLiteral());const v=this.parseConstDirectives();return this.node(i,{kind:b.INPUT_VALUE_DEFINITION,description:r,name:a,type:u,defaultValue:p,directives:v})}parseInterfaceTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("interface");const a=this.parseName(),u=this.parseImplementsInterfaces(),p=this.parseConstDirectives(),v=this.parseFieldsDefinition();return this.node(i,{kind:b.INTERFACE_TYPE_DEFINITION,description:r,name:a,interfaces:u,directives:p,fields:v})}parseUnionTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("union");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseUnionMemberTypes();return this.node(i,{kind:b.UNION_TYPE_DEFINITION,description:r,name:a,directives:u,types:p})}parseUnionMemberTypes(){return this.expectOptionalToken(E.EQUALS)?this.delimitedMany(E.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("enum");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseEnumValuesDefinition();return this.node(i,{kind:b.ENUM_TYPE_DEFINITION,description:r,name:a,directives:u,values:p})}parseEnumValuesDefinition(){return this.optionalMany(E.BRACE_L,this.parseEnumValueDefinition,E.BRACE_R)}parseEnumValueDefinition(){const i=this._lexer.token,r=this.parseDescription(),a=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(i,{kind:b.ENUM_VALUE_DEFINITION,description:r,name:a,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Ae(this._lexer.source,this._lexer.token.start,`${gi(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("input");const a=this.parseName(),u=this.parseConstDirectives(),p=this.parseInputFieldsDefinition();return this.node(i,{kind:b.INPUT_OBJECT_TYPE_DEFINITION,description:r,name:a,directives:u,fields:p})}parseInputFieldsDefinition(){return this.optionalMany(E.BRACE_L,this.parseInputValueDef,E.BRACE_R)}parseTypeSystemExtension(){const i=this._lexer.lookahead();if(i.kind===E.NAME)switch(i.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(i)}parseSchemaExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const r=this.parseConstDirectives(),a=this.optionalMany(E.BRACE_L,this.parseOperationTypeDefinition,E.BRACE_R);if(r.length===0&&a.length===0)throw this.unexpected();return this.node(i,{kind:b.SCHEMA_EXTENSION,directives:r,operationTypes:a})}parseScalarTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const r=this.parseName(),a=this.parseConstDirectives();if(a.length===0)throw this.unexpected();return this.node(i,{kind:b.SCALAR_TYPE_EXTENSION,name:r,directives:a})}parseObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:b.OBJECT_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseInterfaceTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const r=this.parseName(),a=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),p=this.parseFieldsDefinition();if(a.length===0&&u.length===0&&p.length===0)throw this.unexpected();return this.node(i,{kind:b.INTERFACE_TYPE_EXTENSION,name:r,interfaces:a,directives:u,fields:p})}parseUnionTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.UNION_TYPE_EXTENSION,name:r,directives:a,types:u})}parseEnumTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.ENUM_TYPE_EXTENSION,name:r,directives:a,values:u})}parseInputObjectTypeExtension(){const i=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const r=this.parseName(),a=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(a.length===0&&u.length===0)throw this.unexpected();return this.node(i,{kind:b.INPUT_OBJECT_TYPE_EXTENSION,name:r,directives:a,fields:u})}parseDirectiveDefinition(){const i=this._lexer.token,r=this.parseDescription();this.expectKeyword("directive"),this.expectToken(E.AT);const a=this.parseName(),u=this.parseArgumentDefs(),p=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const v=this.parseDirectiveLocations();return this.node(i,{kind:b.DIRECTIVE_DEFINITION,description:r,name:a,arguments:u,repeatable:p,locations:v})}parseDirectiveLocations(){return this.delimitedMany(E.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const i=this._lexer.token,r=this.parseName();if(Object.prototype.hasOwnProperty.call(X,r.value))return r;throw this.unexpected(i)}node(i,r){return this._options.noLocation!==!0&&(r.loc=new Ev(i,this._lexer.lastToken,this._lexer.source)),r}peek(i){return this._lexer.token.kind===i}expectToken(i){const r=this._lexer.token;if(r.kind===i)return this.advanceLexer(),r;throw Ae(this._lexer.source,r.start,`Expected ${vc(i)}, found ${gi(r)}.`)}expectOptionalToken(i){return this._lexer.token.kind===i?(this.advanceLexer(),!0):!1}expectKeyword(i){const r=this._lexer.token;if(r.kind===E.NAME&&r.value===i)this.advanceLexer();else throw Ae(this._lexer.source,r.start,`Expected "${i}", found ${gi(r)}.`)}expectOptionalKeyword(i){const r=this._lexer.token;return r.kind===E.NAME&&r.value===i?(this.advanceLexer(),!0):!1}unexpected(i){const r=i??this._lexer.token;return Ae(this._lexer.source,r.start,`Unexpected ${gi(r)}.`)}any(i,r,a){this.expectToken(i);const u=[];for(;!this.expectOptionalToken(a);)u.push(r.call(this));return u}optionalMany(i,r,a){if(this.expectOptionalToken(i)){const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}return[]}many(i,r,a){this.expectToken(i);const u=[];do u.push(r.call(this));while(!this.expectOptionalToken(a));return u}delimitedMany(i,r){this.expectOptionalToken(i);const a=[];do a.push(r.call(this));while(this.expectOptionalToken(i));return a}advanceLexer(){const{maxTokens:i}=this._options,r=this._lexer.advance();if(i!==void 0&&r.kind!==E.EOF&&(++this._tokenCounter,this._tokenCounter>i))throw Ae(this._lexer.source,r.start,`Document contains more that ${i} tokens. Parsing aborted.`)}}function gi(n){const i=n.value;return vc(n.kind)+(i!=null?` "${i}"`:"")}function vc(n){return Ov(n)?`"${n}"`:n}const zv=5;function Yv(n,i){const[r,a]=i?[n,i]:[void 0,n];let u=" Did you mean ";r&&(u+=r+" ");const p=a.map(N=>`"${N}"`);switch(p.length){case 0:return"";case 1:return u+p[0]+"?";case 2:return u+p[0]+" or "+p[1]+"?"}const v=p.slice(0,zv),I=v.pop();return u+v.join(", ")+", or "+I+"?"}function nc(n){return n}function yc(n,i){const r=Object.create(null);for(const a of n)r[i(a)]=a;return r}function dn(n,i,r){const a=Object.create(null);for(const u of n)a[i(u)]=r(u);return a}function bi(n,i){const r=Object.create(null);for(const a of Object.keys(n))r[a]=i(n[a],a);return r}function Hv(n,i){let r=0,a=0;for(;r<n.length&&a<i.length;){let u=n.charCodeAt(r),p=i.charCodeAt(a);if(mi(u)&&mi(p)){let v=0;do++r,v=v*10+u-so,u=n.charCodeAt(r);while(mi(u)&&v>0);let I=0;do++a,I=I*10+p-so,p=i.charCodeAt(a);while(mi(p)&&I>0);if(v<I)return-1;if(v>I)return 1}else{if(u<p)return-1;if(u>p)return 1;++r,++a}}return n.length-i.length}const so=48,Kv=57;function mi(n){return!isNaN(n)&&so<=n&&n<=Kv}function Xv(n,i){const r=Object.create(null),a=new Zv(n),u=Math.floor(n.length*.4)+1;for(const p of i){const v=a.measure(p,u);v!==void 0&&(r[p]=v)}return Object.keys(r).sort((p,v)=>{const I=r[p]-r[v];return I!==0?I:Hv(p,v)})}class Zv{constructor(i){this._input=i,this._inputLowerCase=i.toLowerCase(),this._inputArray=rc(this._inputLowerCase),this._rows=[new Array(i.length+1).fill(0),new Array(i.length+1).fill(0),new Array(i.length+1).fill(0)]}measure(i,r){if(this._input===i)return 0;const a=i.toLowerCase();if(this._inputLowerCase===a)return 1;let u=rc(a),p=this._inputArray;if(u.length<p.length){const O=u;u=p,p=O}const v=u.length,I=p.length;if(v-I>r)return;const N=this._rows;for(let O=0;O<=I;O++)N[0][O]=O;for(let O=1;O<=v;O++){const M=N[(O-1)%3],Z=N[O%3];let ce=Z[0]=O;for(let W=1;W<=I;W++){const Te=u[O-1]===p[W-1]?0:1;let fe=Math.min(M[W]+1,Z[W-1]+1,M[W-1]+Te);if(O>1&&W>1&&u[O-1]===p[W-2]&&u[O-2]===p[W-1]){const ve=N[(O-2)%3][W-2];fe=Math.min(fe,ve+1)}fe<ce&&(ce=fe),Z[W]=fe}if(ce>r)return}const R=N[v%3][I];return R<=r?R:void 0}}function rc(n){const i=n.length,r=new Array(i);for(let a=0;a<i;++a)r[a]=n.charCodeAt(a);return r}function ut(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const i=Object.create(null);for(const[r,a]of Object.entries(n))i[r]=a;return i}function ey(n){return`"${n.replace(ty,ny)}"`}const ty=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ny(n){return ry[n.charCodeAt(0)]}const ry=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],iy=Object.freeze({});function sy(n,i,r=lc){const a=new Map;for(const ve of Object.values(b))a.set(ve,oy(i,ve));let u,p=Array.isArray(n),v=[n],I=-1,N=[],R=n,O,M;const Z=[],ce=[];do{I++;const ve=I===v.length,tn=ve&&N.length!==0;if(ve){if(O=ce.length===0?void 0:Z[Z.length-1],R=M,M=ce.pop(),tn)if(p){R=R.slice();let Ne=0;for(const[Re,Qe]of N){const Ue=Re-Ne;Qe===null?(R.splice(Ue,1),Ne++):R[Ue]=Qe}}else{R=Object.defineProperties({},Object.getOwnPropertyDescriptors(R));for(const[Ne,Re]of N)R[Ne]=Re}I=u.index,v=u.keys,N=u.edits,p=u.inArray,u=u.prev}else if(M){if(O=p?I:v[I],R=M[O],R==null)continue;Z.push(O)}let ye;if(!Array.isArray(R)){var W,Te;ec(R)||te(!1,`Invalid AST Node: ${P(R)}.`);const Ne=ve?(W=a.get(R.kind))===null||W===void 0?void 0:W.leave:(Te=a.get(R.kind))===null||Te===void 0?void 0:Te.enter;if(ye=Ne?.call(i,R,O,M,Z,ce),ye===iy)break;if(ye===!1){if(!ve){Z.pop();continue}}else if(ye!==void 0&&(N.push([O,ye]),!ve))if(ec(ye))R=ye;else{Z.pop();continue}}if(ye===void 0&&tn&&N.push([O,R]),ve)Z.pop();else{var fe;u={inArray:p,index:I,keys:v,edits:N,prev:u},p=Array.isArray(R),v=p?R:(fe=r[R.kind])!==null&&fe!==void 0?fe:[],I=-1,N=[],M&&ce.push(M),M=R}}while(u!==void 0);return N.length!==0?N[N.length-1][1]:n}function oy(n,i){const r=n[i];return typeof r=="object"?r:typeof r=="function"?{enter:r,leave:void 0}:{enter:n.enter,leave:n.leave}}function ot(n){return sy(n,uy)}const ay=80,uy={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>C(n.definitions,`
29
+ spurious results.`)}}return!1};class Yc{constructor(r,i="GraphQL request",o={line:1,column:1}){typeof r=="string"||ue(!1,`Body must be a string. Received: ${J(r)}.`),this.body=r,this.name=i,this.locationOffset=o,this.locationOffset.line>0||ue(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||ue(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function $v(n){return kt(n,Yc)}function Bv(n,r){const i=new jv(n,r);i.expectToken(A.SOF);const o=i.parseValueLiteral(!1);return i.expectToken(A.EOF),o}class jv{constructor(r,i={}){const o=$v(r)?r:new Yc(r);this._lexer=new wv(o),this._options=i,this._tokenCounter=0}parseName(){const r=this.expectToken(A.NAME);return this.node(r,{kind:N.NAME,value:r.value})}parseDocument(){return this.node(this._lexer.token,{kind:N.DOCUMENT,definitions:this.many(A.SOF,this.parseDefinition,A.EOF)})}parseDefinition(){if(this.peek(A.BRACE_L))return this.parseOperationDefinition();const r=this.peekDescription(),i=r?this._lexer.lookahead():this._lexer.token;if(i.kind===A.NAME){switch(i.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(r)throw ke(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(i.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(i)}parseOperationDefinition(){const r=this._lexer.token;if(this.peek(A.BRACE_L))return this.node(r,{kind:N.OPERATION_DEFINITION,operation:Qt.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const i=this.parseOperationType();let o;return this.peek(A.NAME)&&(o=this.parseName()),this.node(r,{kind:N.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const r=this.expectToken(A.NAME);switch(r.value){case"query":return Qt.QUERY;case"mutation":return Qt.MUTATION;case"subscription":return Qt.SUBSCRIPTION}throw this.unexpected(r)}parseVariableDefinitions(){return this.optionalMany(A.PAREN_L,this.parseVariableDefinition,A.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:N.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(A.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(A.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const r=this._lexer.token;return this.expectToken(A.DOLLAR),this.node(r,{kind:N.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:N.SELECTION_SET,selections:this.many(A.BRACE_L,this.parseSelection,A.BRACE_R)})}parseSelection(){return this.peek(A.SPREAD)?this.parseFragment():this.parseField()}parseField(){const r=this._lexer.token,i=this.parseName();let o,u;return this.expectOptionalToken(A.COLON)?(o=i,u=this.parseName()):u=i,this.node(r,{kind:N.FIELD,alias:o,name:u,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(A.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(r){const i=r?this.parseConstArgument:this.parseArgument;return this.optionalMany(A.PAREN_L,i,A.PAREN_R)}parseArgument(r=!1){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.ARGUMENT,name:o,value:this.parseValueLiteral(r)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const r=this._lexer.token;this.expectToken(A.SPREAD);const i=this.expectOptionalKeyword("on");return!i&&this.peek(A.NAME)?this.node(r,{kind:N.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(r,{kind:N.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const r=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(r,{kind:N.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(r){const i=this._lexer.token;switch(i.kind){case A.BRACKET_L:return this.parseList(r);case A.BRACE_L:return this.parseObject(r);case A.INT:return this.advanceLexer(),this.node(i,{kind:N.INT,value:i.value});case A.FLOAT:return this.advanceLexer(),this.node(i,{kind:N.FLOAT,value:i.value});case A.STRING:case A.BLOCK_STRING:return this.parseStringLiteral();case A.NAME:switch(this.advanceLexer(),i.value){case"true":return this.node(i,{kind:N.BOOLEAN,value:!0});case"false":return this.node(i,{kind:N.BOOLEAN,value:!1});case"null":return this.node(i,{kind:N.NULL});default:return this.node(i,{kind:N.ENUM,value:i.value})}case A.DOLLAR:if(r)if(this.expectToken(A.DOLLAR),this._lexer.token.kind===A.NAME){const o=this._lexer.token.value;throw ke(this._lexer.source,i.start,`Unexpected variable "$${o}" in constant value.`)}else throw this.unexpected(i);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const r=this._lexer.token;return this.advanceLexer(),this.node(r,{kind:N.STRING,value:r.value,block:r.kind===A.BLOCK_STRING})}parseList(r){const i=()=>this.parseValueLiteral(r);return this.node(this._lexer.token,{kind:N.LIST,values:this.any(A.BRACKET_L,i,A.BRACKET_R)})}parseObject(r){const i=()=>this.parseObjectField(r);return this.node(this._lexer.token,{kind:N.OBJECT,fields:this.any(A.BRACE_L,i,A.BRACE_R)})}parseObjectField(r){const i=this._lexer.token,o=this.parseName();return this.expectToken(A.COLON),this.node(i,{kind:N.OBJECT_FIELD,name:o,value:this.parseValueLiteral(r)})}parseDirectives(r){const i=[];for(;this.peek(A.AT);)i.push(this.parseDirective(r));return i}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(r){const i=this._lexer.token;return this.expectToken(A.AT),this.node(i,{kind:N.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(r)})}parseTypeReference(){const r=this._lexer.token;let i;if(this.expectOptionalToken(A.BRACKET_L)){const o=this.parseTypeReference();this.expectToken(A.BRACKET_R),i=this.node(r,{kind:N.LIST_TYPE,type:o})}else i=this.parseNamedType();return this.expectOptionalToken(A.BANG)?this.node(r,{kind:N.NON_NULL_TYPE,type:i}):i}parseNamedType(){return this.node(this._lexer.token,{kind:N.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(A.STRING)||this.peek(A.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");const o=this.parseConstDirectives(),u=this.many(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);return this.node(r,{kind:N.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:u})}parseOperationTypeDefinition(){const r=this._lexer.token,i=this.parseOperationType();this.expectToken(A.COLON);const o=this.parseNamedType();return this.node(r,{kind:N.OPERATION_TYPE_DEFINITION,operation:i,type:o})}parseScalarTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");const o=this.parseName(),u=this.parseConstDirectives();return this.node(r,{kind:N.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:u})}parseObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(A.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseFieldDefinition,A.BRACE_R)}parseFieldDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName(),u=this.parseArgumentDefs();this.expectToken(A.COLON);const f=this.parseTypeReference(),g=this.parseConstDirectives();return this.node(r,{kind:N.FIELD_DEFINITION,description:i,name:o,arguments:u,type:f,directives:g})}parseArgumentDefs(){return this.optionalMany(A.PAREN_L,this.parseInputValueDef,A.PAREN_R)}parseInputValueDef(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(A.COLON);const u=this.parseTypeReference();let f;this.expectOptionalToken(A.EQUALS)&&(f=this.parseConstValueLiteral());const g=this.parseConstDirectives();return this.node(r,{kind:N.INPUT_VALUE_DEFINITION,description:i,name:o,type:u,defaultValue:f,directives:g})}parseInterfaceTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");const o=this.parseName(),u=this.parseImplementsInterfaces(),f=this.parseConstDirectives(),g=this.parseFieldsDefinition();return this.node(r,{kind:N.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:u,directives:f,fields:g})}parseUnionTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseUnionMemberTypes();return this.node(r,{kind:N.UNION_TYPE_DEFINITION,description:i,name:o,directives:u,types:f})}parseUnionMemberTypes(){return this.expectOptionalToken(A.EQUALS)?this.delimitedMany(A.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseEnumValuesDefinition();return this.node(r,{kind:N.ENUM_TYPE_DEFINITION,description:i,name:o,directives:u,values:f})}parseEnumValuesDefinition(){return this.optionalMany(A.BRACE_L,this.parseEnumValueDefinition,A.BRACE_R)}parseEnumValueDefinition(){const r=this._lexer.token,i=this.parseDescription(),o=this.parseEnumValueName(),u=this.parseConstDirectives();return this.node(r,{kind:N.ENUM_VALUE_DEFINITION,description:i,name:o,directives:u})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw ke(this._lexer.source,this._lexer.token.start,`${$r(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");const o=this.parseName(),u=this.parseConstDirectives(),f=this.parseInputFieldsDefinition();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:u,fields:f})}parseInputFieldsDefinition(){return this.optionalMany(A.BRACE_L,this.parseInputValueDef,A.BRACE_R)}parseTypeSystemExtension(){const r=this._lexer.lookahead();if(r.kind===A.NAME)switch(r.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(r)}parseSchemaExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const i=this.parseConstDirectives(),o=this.optionalMany(A.BRACE_L,this.parseOperationTypeDefinition,A.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCHEMA_EXTENSION,directives:i,operationTypes:o})}parseScalarTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const i=this.parseName(),o=this.parseConstDirectives();if(o.length===0)throw this.unexpected();return this.node(r,{kind:N.SCALAR_TYPE_EXTENSION,name:i,directives:o})}parseObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseInterfaceTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const i=this.parseName(),o=this.parseImplementsInterfaces(),u=this.parseConstDirectives(),f=this.parseFieldsDefinition();if(o.length===0&&u.length===0&&f.length===0)throw this.unexpected();return this.node(r,{kind:N.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:u,fields:f})}parseUnionTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseUnionMemberTypes();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.UNION_TYPE_EXTENSION,name:i,directives:o,types:u})}parseEnumTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseEnumValuesDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.ENUM_TYPE_EXTENSION,name:i,directives:o,values:u})}parseInputObjectTypeExtension(){const r=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const i=this.parseName(),o=this.parseConstDirectives(),u=this.parseInputFieldsDefinition();if(o.length===0&&u.length===0)throw this.unexpected();return this.node(r,{kind:N.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:u})}parseDirectiveDefinition(){const r=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(A.AT);const o=this.parseName(),u=this.parseArgumentDefs(),f=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const g=this.parseDirectiveLocations();return this.node(r,{kind:N.DIRECTIVE_DEFINITION,description:i,name:o,arguments:u,repeatable:f,locations:g})}parseDirectiveLocations(){return this.delimitedMany(A.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const r=this._lexer.token,i=this.parseName();if(Object.prototype.hasOwnProperty.call(se,i.value))return i;throw this.unexpected(r)}node(r,i){return this._options.noLocation!==!0&&(i.loc=new mv(r,this._lexer.lastToken,this._lexer.source)),i}peek(r){return this._lexer.token.kind===r}expectToken(r){const i=this._lexer.token;if(i.kind===r)return this.advanceLexer(),i;throw ke(this._lexer.source,i.start,`Expected ${Xc(r)}, found ${$r(i)}.`)}expectOptionalToken(r){return this._lexer.token.kind===r?(this.advanceLexer(),!0):!1}expectKeyword(r){const i=this._lexer.token;if(i.kind===A.NAME&&i.value===r)this.advanceLexer();else throw ke(this._lexer.source,i.start,`Expected "${r}", found ${$r(i)}.`)}expectOptionalKeyword(r){const i=this._lexer.token;return i.kind===A.NAME&&i.value===r?(this.advanceLexer(),!0):!1}unexpected(r){const i=r??this._lexer.token;return ke(this._lexer.source,i.start,`Unexpected ${$r(i)}.`)}any(r,i,o){this.expectToken(r);const u=[];for(;!this.expectOptionalToken(o);)u.push(i.call(this));return u}optionalMany(r,i,o){if(this.expectOptionalToken(r)){const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}return[]}many(r,i,o){this.expectToken(r);const u=[];do u.push(i.call(this));while(!this.expectOptionalToken(o));return u}delimitedMany(r,i){this.expectOptionalToken(r);const o=[];do o.push(i.call(this));while(this.expectOptionalToken(r));return o}advanceLexer(){const{maxTokens:r}=this._options,i=this._lexer.advance();if(r!==void 0&&i.kind!==A.EOF&&(++this._tokenCounter,this._tokenCounter>r))throw ke(this._lexer.source,i.start,`Document contains more that ${r} tokens. Parsing aborted.`)}}function $r(n){const r=n.value;return Xc(n.kind)+(r!=null?` "${r}"`:"")}function Xc(n){return Ev(n)?`"${n}"`:n}const Wv=5;function Gv(n,r){const[i,o]=r?[n,r]:[void 0,n];let u=" Did you mean ";i&&(u+=i+" ");const f=o.map(w=>`"${w}"`);switch(f.length){case 0:return"";case 1:return u+f[0]+"?";case 2:return u+f[0]+" or "+f[1]+"?"}const g=f.slice(0,Wv),v=g.pop();return u+g.join(", ")+", or "+v+"?"}function Sc(n){return n}function Kc(n,r){const i=Object.create(null);for(const o of n)i[r(o)]=o;return i}function $n(n,r,i){const o=Object.create(null);for(const u of n)o[r(u)]=i(u);return o}function zr(n,r){const i=Object.create(null);for(const o of Object.keys(n))i[o]=r(n[o],o);return i}function Vv(n,r){let i=0,o=0;for(;i<n.length&&o<r.length;){let u=n.charCodeAt(i),f=r.charCodeAt(o);if(Br(u)&&Br(f)){let g=0;do++i,g=g*10+u-Oa,u=n.charCodeAt(i);while(Br(u)&&g>0);let v=0;do++o,v=v*10+f-Oa,f=r.charCodeAt(o);while(Br(f)&&v>0);if(g<v)return-1;if(g>v)return 1}else{if(u<f)return-1;if(u>f)return 1;++i,++o}}return n.length-r.length}const Oa=48,qv=57;function Br(n){return!isNaN(n)&&Oa<=n&&n<=qv}function Jv(n,r){const i=Object.create(null),o=new zv(n),u=Math.floor(n.length*.4)+1;for(const f of r){const g=o.measure(f,u);g!==void 0&&(i[f]=g)}return Object.keys(i).sort((f,g)=>{const v=i[f]-i[g];return v!==0?v:Vv(f,g)})}class zv{constructor(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=Ac(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}measure(r,i){if(this._input===r)return 0;const o=r.toLowerCase();if(this._inputLowerCase===o)return 1;let u=Ac(o),f=this._inputArray;if(u.length<f.length){const O=u;u=f,f=O}const g=u.length,v=f.length;if(g-v>i)return;const w=this._rows;for(let O=0;O<=v;O++)w[0][O]=O;for(let O=1;O<=g;O++){const D=w[(O-1)%3],P=w[O%3];let M=P[0]=O;for(let $=1;$<=v;$++){const he=u[O-1]===f[$-1]?0:1;let ae=Math.min(D[$]+1,P[$-1]+1,D[$-1]+he);if(O>1&&$>1&&u[O-1]===f[$-2]&&u[O-2]===f[$-1]){const me=w[(O-2)%3][$-2];ae=Math.min(ae,me+1)}ae<M&&(M=ae),P[$]=ae}if(M>i)return}const b=w[g%3][v];return b<=i?b:void 0}}function Ac(n){const r=n.length,i=new Array(r);for(let o=0;o<r;++o)i[o]=n.charCodeAt(o);return i}function _t(n){if(n==null)return Object.create(null);if(Object.getPrototypeOf(n)===null)return n;const r=Object.create(null);for(const[i,o]of Object.entries(n))r[i]=o;return r}function Qv(n){return`"${n.replace(Hv,Yv)}"`}const Hv=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Yv(n){return Xv[n.charCodeAt(0)]}const Xv=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Kv=Object.freeze({});function Zv(n,r,i=Vc){const o=new Map;for(const me of Object.values(N))o.set(me,e_(r,me));let u,f=Array.isArray(n),g=[n],v=-1,w=[],b=n,O,D;const P=[],M=[];do{v++;const me=v===g.length,Ye=me&&w.length!==0;if(me){if(O=M.length===0?void 0:P[P.length-1],b=D,D=M.pop(),Ye)if(f){b=b.slice();let L=0;for(const[ee,H]of w){const ce=ee-L;H===null?(b.splice(ce,1),L++):b[ce]=H}}else{b=Object.defineProperties({},Object.getOwnPropertyDescriptors(b));for(const[L,ee]of w)b[L]=ee}v=u.index,g=u.keys,w=u.edits,f=u.inArray,u=u.prev}else if(D){if(O=f?v:g[v],b=D[O],b==null)continue;P.push(O)}let xe;if(!Array.isArray(b)){var $,he;wc(b)||ue(!1,`Invalid AST Node: ${J(b)}.`);const L=me?($=o.get(b.kind))===null||$===void 0?void 0:$.leave:(he=o.get(b.kind))===null||he===void 0?void 0:he.enter;if(xe=L?.call(r,b,O,D,P,M),xe===Kv)break;if(xe===!1){if(!me){P.pop();continue}}else if(xe!==void 0&&(w.push([O,xe]),!me))if(wc(xe))b=xe;else{P.pop();continue}}if(xe===void 0&&Ye&&w.push([O,b]),me)P.pop();else{var ae;u={inArray:f,index:v,keys:g,edits:w,prev:u},f=Array.isArray(b),g=f?b:(ae=i[b.kind])!==null&&ae!==void 0?ae:[],v=-1,w=[],D&&M.push(D),D=b}}while(u!==void 0);return w.length!==0?w[w.length-1][1]:n}function e_(n,r){const i=n[r];return typeof i=="object"?i:typeof i=="function"?{enter:i,leave:void 0}:{enter:n.enter,leave:n.leave}}function yt(n){return Zv(n,n_)}const t_=80,n_={Name:{leave:n=>n.value},Variable:{leave:n=>"$"+n.name},Document:{leave:n=>k(n.definitions,`
129
30
 
130
- `)},OperationDefinition:{leave(n){const i=Y("(",C(n.variableDefinitions,", "),")"),r=C([n.operation,C([n.name,i]),C(n.directives," ")]," ");return(r==="query"?"":r+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:i,defaultValue:r,directives:a})=>n+": "+i+Y(" = ",r)+Y(" ",C(a," "))},SelectionSet:{leave:({selections:n})=>gt(n)},Field:{leave({alias:n,name:i,arguments:r,directives:a,selectionSet:u}){const p=Y("",n,": ")+i;let v=p+Y("(",C(r,", "),")");return v.length>ay&&(v=p+Y(`(
131
- `,yi(C(r,`
31
+ `)},OperationDefinition:{leave(n){const r=ne("(",k(n.variableDefinitions,", "),")"),i=k([n.operation,k([n.name,r]),k(n.directives," ")]," ");return(i==="query"?"":i+" ")+n.selectionSet}},VariableDefinition:{leave:({variable:n,type:r,defaultValue:i,directives:o})=>n+": "+r+ne(" = ",i)+ne(" ",k(o," "))},SelectionSet:{leave:({selections:n})=>bt(n)},Field:{leave({alias:n,name:r,arguments:i,directives:o,selectionSet:u}){const f=ne("",n,": ")+r;let g=f+ne("(",k(i,", "),")");return g.length>t_&&(g=f+ne(`(
32
+ `,Gr(k(i,`
132
33
  `)),`
133
- )`)),C([v,C(a," "),u]," ")}},Argument:{leave:({name:n,value:i})=>n+": "+i},FragmentSpread:{leave:({name:n,directives:i})=>"..."+n+Y(" ",C(i," "))},InlineFragment:{leave:({typeCondition:n,directives:i,selectionSet:r})=>C(["...",Y("on ",n),C(i," "),r]," ")},FragmentDefinition:{leave:({name:n,typeCondition:i,variableDefinitions:r,directives:a,selectionSet:u})=>`fragment ${n}${Y("(",C(r,", "),")")} on ${i} ${Y("",C(a," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:i})=>i?bv(n):ey(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+C(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+C(n,", ")+"}"},ObjectField:{leave:({name:n,value:i})=>n+": "+i},Directive:{leave:({name:n,arguments:i})=>"@"+n+Y("(",C(i,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:i,operationTypes:r})=>Y("",n,`
134
- `)+C(["schema",C(i," "),gt(r)]," ")},OperationTypeDefinition:{leave:({operation:n,type:i})=>n+": "+i},ScalarTypeDefinition:{leave:({description:n,name:i,directives:r})=>Y("",n,`
135
- `)+C(["scalar",i,C(r," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:i,interfaces:r,directives:a,fields:u})=>Y("",n,`
136
- `)+C(["type",i,Y("implements ",C(r," & ")),C(a," "),gt(u)]," ")},FieldDefinition:{leave:({description:n,name:i,arguments:r,type:a,directives:u})=>Y("",n,`
137
- `)+i+(ic(r)?Y(`(
138
- `,yi(C(r,`
34
+ )`)),k([g,k(o," "),u]," ")}},Argument:{leave:({name:n,value:r})=>n+": "+r},FragmentSpread:{leave:({name:n,directives:r})=>"..."+n+ne(" ",k(r," "))},InlineFragment:{leave:({typeCondition:n,directives:r,selectionSet:i})=>k(["...",ne("on ",n),k(r," "),i]," ")},FragmentDefinition:{leave:({name:n,typeCondition:r,variableDefinitions:i,directives:o,selectionSet:u})=>`fragment ${n}${ne("(",k(i,", "),")")} on ${r} ${ne("",k(o," ")," ")}`+u},IntValue:{leave:({value:n})=>n},FloatValue:{leave:({value:n})=>n},StringValue:{leave:({value:n,block:r})=>r?Tv(n):Qv(n)},BooleanValue:{leave:({value:n})=>n?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:n})=>n},ListValue:{leave:({values:n})=>"["+k(n,", ")+"]"},ObjectValue:{leave:({fields:n})=>"{"+k(n,", ")+"}"},ObjectField:{leave:({name:n,value:r})=>n+": "+r},Directive:{leave:({name:n,arguments:r})=>"@"+n+ne("(",k(r,", "),")")},NamedType:{leave:({name:n})=>n},ListType:{leave:({type:n})=>"["+n+"]"},NonNullType:{leave:({type:n})=>n+"!"},SchemaDefinition:{leave:({description:n,directives:r,operationTypes:i})=>ne("",n,`
35
+ `)+k(["schema",k(r," "),bt(i)]," ")},OperationTypeDefinition:{leave:({operation:n,type:r})=>n+": "+r},ScalarTypeDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
36
+ `)+k(["scalar",r,k(i," ")]," ")},ObjectTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
37
+ `)+k(["type",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},FieldDefinition:{leave:({description:n,name:r,arguments:i,type:o,directives:u})=>ne("",n,`
38
+ `)+r+(Ic(i)?ne(`(
39
+ `,Gr(k(i,`
139
40
  `)),`
140
- )`):Y("(",C(r,", "),")"))+": "+a+Y(" ",C(u," "))},InputValueDefinition:{leave:({description:n,name:i,type:r,defaultValue:a,directives:u})=>Y("",n,`
141
- `)+C([i+": "+r,Y("= ",a),C(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:i,interfaces:r,directives:a,fields:u})=>Y("",n,`
142
- `)+C(["interface",i,Y("implements ",C(r," & ")),C(a," "),gt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:i,directives:r,types:a})=>Y("",n,`
143
- `)+C(["union",i,C(r," "),Y("= ",C(a," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:i,directives:r,values:a})=>Y("",n,`
144
- `)+C(["enum",i,C(r," "),gt(a)]," ")},EnumValueDefinition:{leave:({description:n,name:i,directives:r})=>Y("",n,`
145
- `)+C([i,C(r," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:i,directives:r,fields:a})=>Y("",n,`
146
- `)+C(["input",i,C(r," "),gt(a)]," ")},DirectiveDefinition:{leave:({description:n,name:i,arguments:r,repeatable:a,locations:u})=>Y("",n,`
147
- `)+"directive @"+i+(ic(r)?Y(`(
148
- `,yi(C(r,`
41
+ )`):ne("(",k(i,", "),")"))+": "+o+ne(" ",k(u," "))},InputValueDefinition:{leave:({description:n,name:r,type:i,defaultValue:o,directives:u})=>ne("",n,`
42
+ `)+k([r+": "+i,ne("= ",o),k(u," ")]," ")},InterfaceTypeDefinition:{leave:({description:n,name:r,interfaces:i,directives:o,fields:u})=>ne("",n,`
43
+ `)+k(["interface",r,ne("implements ",k(i," & ")),k(o," "),bt(u)]," ")},UnionTypeDefinition:{leave:({description:n,name:r,directives:i,types:o})=>ne("",n,`
44
+ `)+k(["union",r,k(i," "),ne("= ",k(o," | "))]," ")},EnumTypeDefinition:{leave:({description:n,name:r,directives:i,values:o})=>ne("",n,`
45
+ `)+k(["enum",r,k(i," "),bt(o)]," ")},EnumValueDefinition:{leave:({description:n,name:r,directives:i})=>ne("",n,`
46
+ `)+k([r,k(i," ")]," ")},InputObjectTypeDefinition:{leave:({description:n,name:r,directives:i,fields:o})=>ne("",n,`
47
+ `)+k(["input",r,k(i," "),bt(o)]," ")},DirectiveDefinition:{leave:({description:n,name:r,arguments:i,repeatable:o,locations:u})=>ne("",n,`
48
+ `)+"directive @"+r+(Ic(i)?ne(`(
49
+ `,Gr(k(i,`
149
50
  `)),`
150
- )`):Y("(",C(r,", "),")"))+(a?" repeatable":"")+" on "+C(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:i})=>C(["extend schema",C(n," "),gt(i)]," ")},ScalarTypeExtension:{leave:({name:n,directives:i})=>C(["extend scalar",n,C(i," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:i,directives:r,fields:a})=>C(["extend type",n,Y("implements ",C(i," & ")),C(r," "),gt(a)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:i,directives:r,fields:a})=>C(["extend interface",n,Y("implements ",C(i," & ")),C(r," "),gt(a)]," ")},UnionTypeExtension:{leave:({name:n,directives:i,types:r})=>C(["extend union",n,C(i," "),Y("= ",C(r," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:i,values:r})=>C(["extend enum",n,C(i," "),gt(r)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:i,fields:r})=>C(["extend input",n,C(i," "),gt(r)]," ")}};function C(n,i=""){var r;return(r=n?.filter(a=>a).join(i))!==null&&r!==void 0?r:""}function gt(n){return Y(`{
151
- `,yi(C(n,`
51
+ )`):ne("(",k(i,", "),")"))+(o?" repeatable":"")+" on "+k(u," | ")},SchemaExtension:{leave:({directives:n,operationTypes:r})=>k(["extend schema",k(n," "),bt(r)]," ")},ScalarTypeExtension:{leave:({name:n,directives:r})=>k(["extend scalar",n,k(r," ")]," ")},ObjectTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend type",n,ne("implements ",k(r," & ")),k(i," "),bt(o)]," ")},InterfaceTypeExtension:{leave:({name:n,interfaces:r,directives:i,fields:o})=>k(["extend interface",n,ne("implements ",k(r," & ")),k(i," "),bt(o)]," ")},UnionTypeExtension:{leave:({name:n,directives:r,types:i})=>k(["extend union",n,k(r," "),ne("= ",k(i," | "))]," ")},EnumTypeExtension:{leave:({name:n,directives:r,values:i})=>k(["extend enum",n,k(r," "),bt(i)]," ")},InputObjectTypeExtension:{leave:({name:n,directives:r,fields:i})=>k(["extend input",n,k(r," "),bt(i)]," ")}};function k(n,r=""){var i;return(i=n?.filter(o=>o).join(r))!==null&&i!==void 0?i:""}function bt(n){return ne(`{
52
+ `,Gr(k(n,`
152
53
  `)),`
153
- }`)}function Y(n,i,r=""){return i!=null&&i!==""?n+i+r:""}function yi(n){return Y(" ",n.replace(/\n/g,`
154
- `))}function ic(n){var i;return(i=n?.some(r=>r.includes(`
155
- `)))!==null&&i!==void 0?i:!1}function oo(n,i){switch(n.kind){case b.NULL:return null;case b.INT:return parseInt(n.value,10);case b.FLOAT:return parseFloat(n.value);case b.STRING:case b.ENUM:case b.BOOLEAN:return n.value;case b.LIST:return n.values.map(r=>oo(r,i));case b.OBJECT:return dn(n.fields,r=>r.name.value,r=>oo(r.value,i));case b.VARIABLE:return i?.[n.name.value]}}function _t(n){if(n!=null||te(!1,"Must provide name."),typeof n=="string"||te(!1,"Expected name to be a string."),n.length===0)throw new re("Expected name to be a non-empty string.");for(let i=1;i<n.length;++i)if(!pc(n.charCodeAt(i)))throw new re(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!co(n.charCodeAt(0)))throw new re(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function cy(n){if(n==="true"||n==="false"||n==="null")throw new re(`Enum values cannot be named: ${n}`);return _t(n)}function _c(n){return Bn(n)||Pt(n)||it(n)||Kt(n)||Xt(n)||Zt(n)||_r(n)||Ht(n)}function Bn(n){return Nt(n,mn)}function Pt(n){return Nt(n,en)}function ly(n){if(!Pt(n))throw new Error(`Expected ${P(n)} to be a GraphQL Object type.`);return n}function it(n){return Nt(n,Rc)}function fy(n){if(!it(n))throw new Error(`Expected ${P(n)} to be a GraphQL Interface type.`);return n}function Kt(n){return Nt(n,Cc)}function Xt(n){return Nt(n,Si)}function Zt(n){return Nt(n,Dc)}function _r(n){return Nt(n,rt)}function Ht(n){return Nt(n,K)}function Tc(n){return Bn(n)||Xt(n)||Zt(n)||lo(n)&&Tc(n.ofType)}function wc(n){return Bn(n)||Pt(n)||it(n)||Kt(n)||Xt(n)||lo(n)&&wc(n.ofType)}function Ec(n){return Bn(n)||Xt(n)}function py(n){return it(n)||Kt(n)}class rt{constructor(i){_c(i)||te(!1,`Expected ${P(i)} to be a GraphQL type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class K{constructor(i){Ic(i)||te(!1,`Expected ${P(i)} to be a GraphQL nullable type.`),this.ofType=i}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function lo(n){return _r(n)||Ht(n)}function Ic(n){return _c(n)&&!Ht(n)}function hy(n){if(!Ic(n))throw new Error(`Expected ${P(n)} to be a GraphQL nullable type.`);return n}function dy(n){if(n){let i=n;for(;lo(i);)i=i.ofType;return i}}function xc(n){return typeof n=="function"?n():n}function Ac(n){return typeof n=="function"?n():n}class mn{constructor(i){var r,a,u,p;const v=(r=i.parseValue)!==null&&r!==void 0?r:nc;this.name=_t(i.name),this.description=i.description,this.specifiedByURL=i.specifiedByURL,this.serialize=(a=i.serialize)!==null&&a!==void 0?a:nc,this.parseValue=v,this.parseLiteral=(u=i.parseLiteral)!==null&&u!==void 0?u:(I,N)=>v(oo(I,N)),this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(p=i.extensionASTNodes)!==null&&p!==void 0?p:[],i.specifiedByURL==null||typeof i.specifiedByURL=="string"||te(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${P(i.specifiedByURL)}.`),i.serialize==null||typeof i.serialize=="function"||te(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),i.parseLiteral&&(typeof i.parseValue=="function"&&typeof i.parseLiteral=="function"||te(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class en{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.isTypeOf=i.isTypeOf,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=()=>bc(i),this._interfaces=()=>Nc(i),i.isTypeOf==null||typeof i.isTypeOf=="function"||te(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${P(i.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Nc(n){var i;const r=xc((i=n.interfaces)!==null&&i!==void 0?i:[]);return Array.isArray(r)||te(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),r}function bc(n){const i=Ac(n.fields);return Pn(i)||te(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),bi(i,(r,a)=>{var u;Pn(r)||te(!1,`${n.name}.${a} field config must be an object.`),r.resolve==null||typeof r.resolve=="function"||te(!1,`${n.name}.${a} field resolver must be a function if provided, but got: ${P(r.resolve)}.`);const p=(u=r.args)!==null&&u!==void 0?u:{};return Pn(p)||te(!1,`${n.name}.${a} args must be an object with argument names as keys.`),{name:_t(a),description:r.description,type:r.type,args:Sc(p),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}})}function Sc(n){return Object.entries(n).map(([i,r])=>({name:_t(i),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}))}function Pn(n){return Mt(n)&&!Array.isArray(n)}function Oc(n){return bi(n,i=>({description:i.description,type:i.type,args:Lc(i.args),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}function Lc(n){return dn(n,i=>i.name,i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}))}class Rc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=bc.bind(void 0,i),this._interfaces=Nc.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||te(!1,`${this.name} must provide "resolveType" as a function, but got: ${P(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Oc(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Cc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.resolveType=i.resolveType,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._types=gy.bind(void 0,i),i.resolveType==null||typeof i.resolveType=="function"||te(!1,`${this.name} must provide "resolveType" as a function, but got: ${P(i.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function gy(n){const i=xc(n.types);return Array.isArray(i)||te(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),i}class Si{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._values=my(this.name,i.values),this._valueLookup=new Map(this._values.map(a=>[a.value,a])),this._nameLookup=yc(this._values,a=>a.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(i){return this._nameLookup[i]}serialize(i){const r=this._valueLookup.get(i);if(r===void 0)throw new re(`Enum "${this.name}" cannot represent value: ${P(i)}`);return r.name}parseValue(i){if(typeof i!="string"){const a=P(i);throw new re(`Enum "${this.name}" cannot represent non-string value: ${a}.`+vi(this,a))}const r=this.getValue(i);if(r==null)throw new re(`Value "${i}" does not exist in "${this.name}" enum.`+vi(this,i));return r.value}parseLiteral(i,r){if(i.kind!==b.ENUM){const u=ot(i);throw new re(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+vi(this,u),{nodes:i})}const a=this.getValue(i.value);if(a==null){const u=ot(i);throw new re(`Value "${u}" does not exist in "${this.name}" enum.`+vi(this,u),{nodes:i})}return a.value}toConfig(){const i=dn(this.getValues(),r=>r.name,r=>({description:r.description,value:r.value,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vi(n,i){const r=n.getValues().map(u=>u.name),a=Xv(i,r);return Yv("the enum value",a)}function my(n,i){return Pn(i)||te(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map(([r,a])=>(Pn(a)||te(!1,`${n}.${r} must refer to an object with a "value" key representing an internal value but got: ${P(a)}.`),{name:cy(r),description:a.description,value:a.value!==void 0?a.value:r,deprecationReason:a.deprecationReason,extensions:ut(a.extensions),astNode:a.astNode}))}class Dc{constructor(i){var r;this.name=_t(i.name),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._fields=vy.bind(void 0,i)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const i=bi(this.getFields(),r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}));return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function vy(n){const i=Ac(n.fields);return Pn(i)||te(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),bi(i,(r,a)=>(!("resolve"in r)||te(!1,`${n.name}.${a} field has a resolve property, but Input Types cannot define resolvers.`),{name:_t(a),description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:ut(r.extensions),astNode:r.astNode}))}const to=2147483647,no=-2147483648,yy=new mn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isInteger(r))throw new re(`Int cannot represent non-integer value: ${P(i)}`);if(r>to||r<no)throw new re("Int cannot represent non 32-bit signed integer value: "+P(i));return r},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new re(`Int cannot represent non-integer value: ${P(n)}`);if(n>to||n<no)throw new re(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==b.INT)throw new re(`Int cannot represent non-integer value: ${ot(n)}`,{nodes:n});const i=parseInt(n.value,10);if(i>to||i<no)throw new re(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return i}}),_y=new mn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i?1:0;let r=i;if(typeof i=="string"&&i!==""&&(r=Number(i)),typeof r!="number"||!Number.isFinite(r))throw new re(`Float cannot represent non numeric value: ${P(i)}`);return r},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new re(`Float cannot represent non numeric value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.FLOAT&&n.kind!==b.INT)throw new re(`Float cannot represent non numeric value: ${ot(n)}`,n);return parseFloat(n.value)}}),me=new mn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(typeof i=="boolean")return i?"true":"false";if(typeof i=="number"&&Number.isFinite(i))return i.toString();throw new re(`String cannot represent value: ${P(n)}`)},parseValue(n){if(typeof n!="string")throw new re(`String cannot represent a non string value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.STRING)throw new re(`String cannot represent a non string value: ${ot(n)}`,{nodes:n});return n.value}}),st=new mn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const i=Tr(n);if(typeof i=="boolean")return i;if(Number.isFinite(i))return i!==0;throw new re(`Boolean cannot represent a non boolean value: ${P(i)}`)},parseValue(n){if(typeof n!="boolean")throw new re(`Boolean cannot represent a non boolean value: ${P(n)}`);return n},parseLiteral(n){if(n.kind!==b.BOOLEAN)throw new re(`Boolean cannot represent a non boolean value: ${ot(n)}`,{nodes:n});return n.value}}),Fc=new mn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const i=Tr(n);if(typeof i=="string")return i;if(Number.isInteger(i))return String(i);throw new re(`ID cannot represent value: ${P(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new re(`ID cannot represent value: ${P(n)}`)},parseLiteral(n){if(n.kind!==b.STRING&&n.kind!==b.INT)throw new re("ID cannot represent a non-string and non-integer value: "+ot(n),{nodes:n});return n.value}}),kc=Object.freeze([me,yy,_y,st,Fc]);function Ty(n){return kc.some(({name:i})=>n.name===i)}function Tr(n){if(Mt(n)){if(typeof n.valueOf=="function"){const i=n.valueOf();if(!Mt(i))return i}if(typeof n.toJSON=="function")return n.toJSON()}return n}function wy(n){return Nt(n,Gn)}class Gn{constructor(i){var r,a;this.name=_t(i.name),this.description=i.description,this.locations=i.locations,this.isRepeatable=(r=i.isRepeatable)!==null&&r!==void 0?r:!1,this.extensions=ut(i.extensions),this.astNode=i.astNode,Array.isArray(i.locations)||te(!1,`@${i.name} locations must be an Array.`);const u=(a=i.args)!==null&&a!==void 0?a:{};Mt(u)&&!Array.isArray(u)||te(!1,`@${i.name} args must be an object with argument names as keys.`),this.args=Sc(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:Lc(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Ey=new Gn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[X.FIELD,X.FRAGMENT_SPREAD,X.INLINE_FRAGMENT],args:{if:{type:new K(st),description:"Included when true."}}}),Iy=new Gn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[X.FIELD,X.FRAGMENT_SPREAD,X.INLINE_FRAGMENT],args:{if:{type:new K(st),description:"Skipped when true."}}}),Uc="No longer supported",xy=new Gn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[X.FIELD_DEFINITION,X.ARGUMENT_DEFINITION,X.INPUT_FIELD_DEFINITION,X.ENUM_VALUE],args:{reason:{type:me,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Uc}}}),Ay=new Gn({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[X.SCALAR],args:{url:{type:new K(me),description:"The URL that specifies the behavior of this scalar."}}}),$c=Object.freeze([Ey,Iy,xy,Ay]);function Ny(n){return $c.some(({name:i})=>i===n.name)}function by(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function Un(n,i){if(Ht(i)){const r=Un(n,i.ofType);return r?.kind===b.NULL?null:r}if(n===null)return{kind:b.NULL};if(n===void 0)return null;if(_r(i)){const r=i.ofType;if(by(n)){const a=[];for(const u of n){const p=Un(u,r);p!=null&&a.push(p)}return{kind:b.LIST,values:a}}return Un(n,r)}if(Zt(i)){if(!Mt(n))return null;const r=[];for(const a of Object.values(i.getFields())){const u=Un(n[a.name],a.type);u&&r.push({kind:b.OBJECT_FIELD,name:{kind:b.NAME,value:a.name},value:u})}return{kind:b.OBJECT,fields:r}}if(Ec(i)){const r=i.serialize(n);if(r==null)return null;if(typeof r=="boolean")return{kind:b.BOOLEAN,value:r};if(typeof r=="number"&&Number.isFinite(r)){const a=String(r);return sc.test(a)?{kind:b.INT,value:a}:{kind:b.FLOAT,value:a}}if(typeof r=="string")return Xt(i)?{kind:b.ENUM,value:r}:i===Fc&&sc.test(r)?{kind:b.INT,value:r}:{kind:b.STRING,value:r};throw new TypeError(`Cannot convert value to AST: ${P(r)}.`)}yr(!1,"Unexpected input type: "+P(i))}const sc=/^-?(?:0|[1-9][0-9]*)$/,fo=new en({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:me,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new K(new rt(new K(xt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new K(xt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:xt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:xt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new K(new rt(new K(Pc))),resolve:n=>n.getDirectives()}})}),Pc=new en({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
54
+ }`)}function ne(n,r,i=""){return r!=null&&r!==""?n+r+i:""}function Gr(n){return ne(" ",n.replace(/\n/g,`
55
+ `))}function Ic(n){var r;return(r=n?.some(i=>i.includes(`
56
+ `)))!==null&&r!==void 0?r:!1}function Ra(n,r){switch(n.kind){case N.NULL:return null;case N.INT:return parseInt(n.value,10);case N.FLOAT:return parseFloat(n.value);case N.STRING:case N.ENUM:case N.BOOLEAN:return n.value;case N.LIST:return n.values.map(i=>Ra(i,r));case N.OBJECT:return $n(n.fields,i=>i.name.value,i=>Ra(i.value,r));case N.VARIABLE:return r?.[n.name.value]}}function Ot(n){if(n!=null||ue(!1,"Must provide name."),typeof n=="string"||ue(!1,"Expected name to be a string."),n.length===0)throw new fe("Expected name to be a non-empty string.");for(let r=1;r<n.length;++r)if(!Jc(n.charCodeAt(r)))throw new fe(`Names must only contain [_a-zA-Z0-9] but "${n}" does not.`);if(!Fa(n.charCodeAt(0)))throw new fe(`Names must start with [_a-zA-Z] but "${n}" does not.`);return n}function i_(n){if(n==="true"||n==="false"||n==="null")throw new fe(`Enum values cannot be named: ${n}`);return Ot(n)}function Zc(n){return gi(n)||Yt(n)||gt(n)||_n(n)||xn(n)||Tn(n)||Wi(n)||yn(n)}function gi(n){return kt(n,jn)}function Yt(n){return kt(n,En)}function r_(n){if(!Yt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Object type.`);return n}function gt(n){return kt(n,fl)}function s_(n){if(!gt(n))throw new Error(`Expected ${J(n)} to be a GraphQL Interface type.`);return n}function _n(n){return kt(n,pl)}function xn(n){return kt(n,Qr)}function Tn(n){return kt(n,dl)}function Wi(n){return kt(n,ht)}function yn(n){return kt(n,re)}function el(n){return gi(n)||xn(n)||Tn(n)||Da(n)&&el(n.ofType)}function tl(n){return gi(n)||Yt(n)||gt(n)||_n(n)||xn(n)||Da(n)&&tl(n.ofType)}function nl(n){return gi(n)||xn(n)}function a_(n){return gt(n)||_n(n)}class ht{constructor(r){Zc(r)||ue(!1,`Expected ${J(r)} to be a GraphQL type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class re{constructor(r){il(r)||ue(!1,`Expected ${J(r)} to be a GraphQL nullable type.`),this.ofType=r}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function Da(n){return Wi(n)||yn(n)}function il(n){return Zc(n)&&!yn(n)}function o_(n){if(!il(n))throw new Error(`Expected ${J(n)} to be a GraphQL nullable type.`);return n}function u_(n){if(n){let r=n;for(;Da(r);)r=r.ofType;return r}}function rl(n){return typeof n=="function"?n():n}function sl(n){return typeof n=="function"?n():n}class jn{constructor(r){var i,o,u,f;const g=(i=r.parseValue)!==null&&i!==void 0?i:Sc;this.name=Ot(r.name),this.description=r.description,this.specifiedByURL=r.specifiedByURL,this.serialize=(o=r.serialize)!==null&&o!==void 0?o:Sc,this.parseValue=g,this.parseLiteral=(u=r.parseLiteral)!==null&&u!==void 0?u:(v,w)=>g(Ra(v,w)),this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(f=r.extensionASTNodes)!==null&&f!==void 0?f:[],r.specifiedByURL==null||typeof r.specifiedByURL=="string"||ue(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${J(r.specifiedByURL)}.`),r.serialize==null||typeof r.serialize=="function"||ue(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||ue(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class En{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=()=>ol(r),this._interfaces=()=>al(r),r.isTypeOf==null||typeof r.isTypeOf=="function"||ue(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${J(r.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function al(n){var r;const i=rl((r=n.interfaces)!==null&&r!==void 0?r:[]);return Array.isArray(i)||ue(!1,`${n.name} interfaces must be an Array or a function which returns an Array.`),i}function ol(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>{var u;li(i)||ue(!1,`${n.name}.${o} field config must be an object.`),i.resolve==null||typeof i.resolve=="function"||ue(!1,`${n.name}.${o} field resolver must be a function if provided, but got: ${J(i.resolve)}.`);const f=(u=i.args)!==null&&u!==void 0?u:{};return li(f)||ue(!1,`${n.name}.${o} args must be an object with argument names as keys.`),{name:Ot(o),description:i.description,type:i.type,args:ul(f),resolve:i.resolve,subscribe:i.subscribe,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}})}function ul(n){return Object.entries(n).map(([r,i])=>({name:Ot(r),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}function li(n){return Xt(n)&&!Array.isArray(n)}function cl(n){return zr(n,r=>({description:r.description,type:r.type,args:ll(r.args),resolve:r.resolve,subscribe:r.subscribe,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}function ll(n){return $n(n,r=>r.name,r=>({description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions,astNode:r.astNode}))}class fl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=ol.bind(void 0,r),this._interfaces=al.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:cl(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class pl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.resolveType=r.resolveType,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._types=c_.bind(void 0,r),r.resolveType==null||typeof r.resolveType=="function"||ue(!1,`${this.name} must provide "resolveType" as a function, but got: ${J(r.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function c_(n){const r=rl(n.types);return Array.isArray(r)||ue(!1,`Must provide Array of types or a function which returns such an array for Union ${n.name}.`),r}class Qr{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._values=l_(this.name,r.values),this._valueLookup=new Map(this._values.map(o=>[o.value,o])),this._nameLookup=Kc(this._values,o=>o.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(r){return this._nameLookup[r]}serialize(r){const i=this._valueLookup.get(r);if(i===void 0)throw new fe(`Enum "${this.name}" cannot represent value: ${J(r)}`);return i.name}parseValue(r){if(typeof r!="string"){const o=J(r);throw new fe(`Enum "${this.name}" cannot represent non-string value: ${o}.`+jr(this,o))}const i=this.getValue(r);if(i==null)throw new fe(`Value "${r}" does not exist in "${this.name}" enum.`+jr(this,r));return i.value}parseLiteral(r,i){if(r.kind!==N.ENUM){const u=yt(r);throw new fe(`Enum "${this.name}" cannot represent non-enum value: ${u}.`+jr(this,u),{nodes:r})}const o=this.getValue(r.value);if(o==null){const u=yt(r);throw new fe(`Value "${u}" does not exist in "${this.name}" enum.`+jr(this,u),{nodes:r})}return o.value}toConfig(){const r=$n(this.getValues(),i=>i.name,i=>({description:i.description,value:i.value,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function jr(n,r){const i=n.getValues().map(u=>u.name),o=Jv(r,i);return Gv("the enum value",o)}function l_(n,r){return li(r)||ue(!1,`${n} values must be an object with value names as keys.`),Object.entries(r).map(([i,o])=>(li(o)||ue(!1,`${n}.${i} must refer to an object with a "value" key representing an internal value but got: ${J(o)}.`),{name:i_(i),description:o.description,value:o.value!==void 0?o.value:i,deprecationReason:o.deprecationReason,extensions:_t(o.extensions),astNode:o.astNode}))}class dl{constructor(r){var i;this.name=Ot(r.name),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._fields=f_.bind(void 0,r)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const r=zr(this.getFields(),i=>({description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:i.extensions,astNode:i.astNode}));return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function f_(n){const r=sl(n.fields);return li(r)||ue(!1,`${n.name} fields must be an object with field names as keys or a function which returns such an object.`),zr(r,(i,o)=>(!("resolve"in i)||ue(!1,`${n.name}.${o} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ot(o),description:i.description,type:i.type,defaultValue:i.defaultValue,deprecationReason:i.deprecationReason,extensions:_t(i.extensions),astNode:i.astNode}))}const wa=2147483647,Ea=-2147483648,p_=new jn({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isInteger(i))throw new fe(`Int cannot represent non-integer value: ${J(r)}`);if(i>wa||i<Ea)throw new fe("Int cannot represent non 32-bit signed integer value: "+J(r));return i},parseValue(n){if(typeof n!="number"||!Number.isInteger(n))throw new fe(`Int cannot represent non-integer value: ${J(n)}`);if(n>wa||n<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n}`);return n},parseLiteral(n){if(n.kind!==N.INT)throw new fe(`Int cannot represent non-integer value: ${yt(n)}`,{nodes:n});const r=parseInt(n.value,10);if(r>wa||r<Ea)throw new fe(`Int cannot represent non 32-bit signed integer value: ${n.value}`,{nodes:n});return r}}),d_=new jn({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r?1:0;let i=r;if(typeof r=="string"&&r!==""&&(i=Number(r)),typeof i!="number"||!Number.isFinite(i))throw new fe(`Float cannot represent non numeric value: ${J(r)}`);return i},parseValue(n){if(typeof n!="number"||!Number.isFinite(n))throw new fe(`Float cannot represent non numeric value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.FLOAT&&n.kind!==N.INT)throw new fe(`Float cannot represent non numeric value: ${yt(n)}`,n);return parseFloat(n.value)}}),Oe=new jn({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(typeof r=="boolean")return r?"true":"false";if(typeof r=="number"&&Number.isFinite(r))return r.toString();throw new fe(`String cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n!="string")throw new fe(`String cannot represent a non string value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.STRING)throw new fe(`String cannot represent a non string value: ${yt(n)}`,{nodes:n});return n.value}}),mt=new jn({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(n){const r=Gi(n);if(typeof r=="boolean")return r;if(Number.isFinite(r))return r!==0;throw new fe(`Boolean cannot represent a non boolean value: ${J(r)}`)},parseValue(n){if(typeof n!="boolean")throw new fe(`Boolean cannot represent a non boolean value: ${J(n)}`);return n},parseLiteral(n){if(n.kind!==N.BOOLEAN)throw new fe(`Boolean cannot represent a non boolean value: ${yt(n)}`,{nodes:n});return n.value}}),hl=new jn({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize(n){const r=Gi(n);if(typeof r=="string")return r;if(Number.isInteger(r))return String(r);throw new fe(`ID cannot represent value: ${J(n)}`)},parseValue(n){if(typeof n=="string")return n;if(typeof n=="number"&&Number.isInteger(n))return n.toString();throw new fe(`ID cannot represent value: ${J(n)}`)},parseLiteral(n){if(n.kind!==N.STRING&&n.kind!==N.INT)throw new fe("ID cannot represent a non-string and non-integer value: "+yt(n),{nodes:n});return n.value}}),gl=Object.freeze([Oe,p_,d_,mt,hl]);function h_(n){return gl.some(({name:r})=>n.name===r)}function Gi(n){if(Xt(n)){if(typeof n.valueOf=="function"){const r=n.valueOf();if(!Xt(r))return r}if(typeof n.toJSON=="function")return n.toJSON()}return n}function g_(n){return kt(n,mi)}class mi{constructor(r){var i,o;this.name=Ot(r.name),this.description=r.description,this.locations=r.locations,this.isRepeatable=(i=r.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=_t(r.extensions),this.astNode=r.astNode,Array.isArray(r.locations)||ue(!1,`@${r.name} locations must be an Array.`);const u=(o=r.args)!==null&&o!==void 0?o:{};Xt(u)&&!Array.isArray(u)||ue(!1,`@${r.name} args must be an object with argument names as keys.`),this.args=ul(u)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:ll(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const m_=new mi({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Included when true."}}}),y_=new mi({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[se.FIELD,se.FRAGMENT_SPREAD,se.INLINE_FRAGMENT],args:{if:{type:new re(mt),description:"Skipped when true."}}}),ml="No longer supported",v_=new mi({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[se.FIELD_DEFINITION,se.ARGUMENT_DEFINITION,se.INPUT_FIELD_DEFINITION,se.ENUM_VALUE],args:{reason:{type:Oe,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:ml}}}),__=new mi({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[se.SCALAR],args:{url:{type:new re(Oe),description:"The URL that specifies the behavior of this scalar."}}}),yl=Object.freeze([m_,y_,v_,__]);function x_(n){return yl.some(({name:r})=>r===n.name)}function T_(n){return typeof n=="object"&&typeof n?.[Symbol.iterator]=="function"}function ci(n,r){if(yn(r)){const i=ci(n,r.ofType);return i?.kind===N.NULL?null:i}if(n===null)return{kind:N.NULL};if(n===void 0)return null;if(Wi(r)){const i=r.ofType;if(T_(n)){const o=[];for(const u of n){const f=ci(u,i);f!=null&&o.push(f)}return{kind:N.LIST,values:o}}return ci(n,i)}if(Tn(r)){if(!Xt(n))return null;const i=[];for(const o of Object.values(r.getFields())){const u=ci(n[o.name],o.type);u&&i.push({kind:N.OBJECT_FIELD,name:{kind:N.NAME,value:o.name},value:u})}return{kind:N.OBJECT,fields:i}}if(nl(r)){const i=r.serialize(n);if(i==null)return null;if(typeof i=="boolean")return{kind:N.BOOLEAN,value:i};if(typeof i=="number"&&Number.isFinite(i)){const o=String(i);return bc.test(o)?{kind:N.INT,value:o}:{kind:N.FLOAT,value:o}}if(typeof i=="string")return xn(r)?{kind:N.ENUM,value:i}:r===hl&&bc.test(i)?{kind:N.INT,value:i}:{kind:N.STRING,value:i};throw new TypeError(`Cannot convert value to AST: ${J(i)}.`)}ji(!1,"Unexpected input type: "+J(r))}const bc=/^-?(?:0|[1-9][0-9]*)$/,Pa=new En({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:Oe,resolve:n=>n.description},types:{description:"A list of all types supported by this server.",type:new re(new ht(new re(Pt))),resolve(n){return Object.values(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new re(Pt),resolve:n=>n.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Pt,resolve:n=>n.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Pt,resolve:n=>n.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new re(new ht(new re(vl))),resolve:n=>n.getDirectives()}})}),vl=new En({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
156
57
 
157
- In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},isRepeatable:{type:new K(st),resolve:n=>n.isRepeatable},locations:{type:new K(new rt(new K(Mc))),resolve:n=>n.locations},args:{type:new K(new rt(new K(Oi))),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}}})}),Mc=new Si({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:X.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:X.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:X.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:X.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:X.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:X.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:X.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:X.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:X.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:X.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:X.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:X.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:X.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:X.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:X.UNION,description:"Location adjacent to a union definition."},ENUM:{value:X.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:X.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:X.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:X.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),xt=new en({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new K(Vc),resolve(n){if(Bn(n))return oe.SCALAR;if(Pt(n))return oe.OBJECT;if(it(n))return oe.INTERFACE;if(Kt(n))return oe.UNION;if(Xt(n))return oe.ENUM;if(Zt(n))return oe.INPUT_OBJECT;if(_r(n))return oe.LIST;if(Ht(n))return oe.NON_NULL;yr(!1,`Unexpected type: "${P(n)}".`)}},name:{type:me,resolve:n=>"name"in n?n.name:void 0},description:{type:me,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:me,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new rt(new K(Bc)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Pt(n)||it(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},interfaces:{type:new rt(new K(xt)),resolve(n){if(Pt(n)||it(n))return n.getInterfaces()}},possibleTypes:{type:new rt(new K(xt)),resolve(n,i,r,{schema:a}){if(py(n))return a.getPossibleTypes(n)}},enumValues:{type:new rt(new K(Gc)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Xt(n)){const r=n.getValues();return i?r:r.filter(a=>a.deprecationReason==null)}}},inputFields:{type:new rt(new K(Oi)),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){if(Zt(n)){const r=Object.values(n.getFields());return i?r:r.filter(a=>a.deprecationReason==null)}}},ofType:{type:xt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),Bc=new en({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},args:{type:new K(new rt(new K(Oi))),args:{includeDeprecated:{type:st,defaultValue:!1}},resolve(n,{includeDeprecated:i}){return i?n.args:n.args.filter(r=>r.deprecationReason==null)}},type:{type:new K(xt),resolve:n=>n.type},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})}),Oi=new en({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},type:{type:new K(xt),resolve:n=>n.type},defaultValue:{type:me,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:i,defaultValue:r}=n,a=Un(r,i);return a?ot(a):null}},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})}),Gc=new en({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new K(me),resolve:n=>n.name},description:{type:me,resolve:n=>n.description},isDeprecated:{type:new K(st),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:me,resolve:n=>n.deprecationReason}})});var oe;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(oe||(oe={}));const Vc=new Si({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:oe.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:oe.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:oe.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:oe.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:oe.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:oe.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:oe.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:oe.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new K(fo);new K(me);new K(me);const Wc=Object.freeze([fo,Pc,Mc,xt,Bc,Oi,Gc,Vc]);function Sy(n){return Wc.some(({name:i})=>n.name===i)}class Oy{constructor(i){var r,a;this.__validationErrors=i.assumeValid===!0?[]:void 0,Mt(i)||te(!1,"Must provide configuration object."),!i.types||Array.isArray(i.types)||te(!1,`"types" must be Array if provided but got: ${P(i.types)}.`),!i.directives||Array.isArray(i.directives)||te(!1,`"directives" must be Array if provided but got: ${P(i.directives)}.`),this.description=i.description,this.extensions=ut(i.extensions),this.astNode=i.astNode,this.extensionASTNodes=(r=i.extensionASTNodes)!==null&&r!==void 0?r:[],this._queryType=i.query,this._mutationType=i.mutation,this._subscriptionType=i.subscription,this._directives=(a=i.directives)!==null&&a!==void 0?a:$c;const u=new Set(i.types);if(i.types!=null)for(const p of i.types)u.delete(p),mt(p,u);this._queryType!=null&&mt(this._queryType,u),this._mutationType!=null&&mt(this._mutationType,u),this._subscriptionType!=null&&mt(this._subscriptionType,u);for(const p of this._directives)if(wy(p))for(const v of p.args)mt(v.type,u);mt(fo,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const p of u){if(p==null)continue;const v=p.name;if(v||te(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[v]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${v}".`);if(this._typeMap[v]=p,it(p)){for(const I of p.getInterfaces())if(it(I)){let N=this._implementationsMap[I.name];N===void 0&&(N=this._implementationsMap[I.name]={objects:[],interfaces:[]}),N.interfaces.push(p)}}else if(Pt(p)){for(const I of p.getInterfaces())if(it(I)){let N=this._implementationsMap[I.name];N===void 0&&(N=this._implementationsMap[I.name]={objects:[],interfaces:[]}),N.objects.push(p)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(i){switch(i){case $t.QUERY:return this.getQueryType();case $t.MUTATION:return this.getMutationType();case $t.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(i){return this.getTypeMap()[i]}getPossibleTypes(i){return Kt(i)?i.getTypes():this.getImplementations(i).objects}getImplementations(i){const r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}}isSubType(i,r){let a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),Kt(i))for(const u of i.getTypes())a[u.name]=!0;else{const u=this.getImplementations(i);for(const p of u.objects)a[p.name]=!0;for(const p of u.interfaces)a[p.name]=!0}this._subTypeMap[i.name]=a}return a[r.name]!==void 0}getDirectives(){return this._directives}getDirective(i){return this.getDirectives().find(r=>r.name===i)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function mt(n,i){const r=dy(n);if(!i.has(r)){if(i.add(r),Kt(r))for(const a of r.getTypes())mt(a,i);else if(Pt(r)||it(r)){for(const a of r.getInterfaces())mt(a,i);for(const a of Object.values(r.getFields())){mt(a.type,i);for(const u of a.args)mt(u.type,i)}}else if(Zt(r))for(const a of Object.values(r.getFields()))mt(a.type,i)}return i}function dr(n,i,r){if(n){if(n.kind===b.VARIABLE){n.name.value;return}if(Ht(i))return n.kind===b.NULL?void 0:dr(n,i.ofType,r);if(n.kind===b.NULL)return null;if(_r(i)){const a=i.ofType;if(n.kind===b.LIST){const p=[];for(const v of n.values)if(oc(v,r)){if(Ht(a))return;p.push(null)}else{const I=dr(v,a,r);if(I===void 0)return;p.push(I)}return p}const u=dr(n,a,r);return u===void 0?void 0:[u]}if(Zt(i)){if(n.kind!==b.OBJECT)return;const a=Object.create(null),u=yc(n.fields,p=>p.name.value);for(const p of Object.values(i.getFields())){const v=u[p.name];if(!v||oc(v.value,r)){if(p.defaultValue!==void 0)a[p.name]=p.defaultValue;else if(Ht(p.type))return;continue}const I=dr(v.value,p.type,r);if(I===void 0)return;a[p.name]=I}return a}if(Ec(i)){let a;try{a=i.parseLiteral(n,r)}catch{return}return a===void 0?void 0:a}yr(!1,"Unexpected input type: "+P(i))}}function oc(n,i){return n.kind===b.VARIABLE&&i==null}function Ly(n){const i={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},r=i.descriptions?"description":"",a=i.specifiedByUrl?"specifiedByURL":"",u=i.directiveIsRepeatable?"isRepeatable":"",p=i.schemaDescription?r:"";function v(I){return i.inputValueDeprecation?I:""}return`
58
+ In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isRepeatable:{type:new re(mt),resolve:n=>n.isRepeatable},locations:{type:new re(new ht(new re(_l))),resolve:n=>n.locations},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}}})}),_l=new Qr({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:se.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:se.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:se.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:se.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:se.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:se.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:se.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:se.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:se.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:se.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:se.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:se.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:se.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:se.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:se.UNION,description:"Location adjacent to a union definition."},ENUM:{value:se.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:se.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:se.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:se.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Pt=new En({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new re(wl),resolve(n){if(gi(n))return ve.SCALAR;if(Yt(n))return ve.OBJECT;if(gt(n))return ve.INTERFACE;if(_n(n))return ve.UNION;if(xn(n))return ve.ENUM;if(Tn(n))return ve.INPUT_OBJECT;if(Wi(n))return ve.LIST;if(yn(n))return ve.NON_NULL;ji(!1,`Unexpected type: "${J(n)}".`)}},name:{type:Oe,resolve:n=>"name"in n?n.name:void 0},description:{type:Oe,resolve:n=>"description"in n?n.description:void 0},specifiedByURL:{type:Oe,resolve:n=>"specifiedByURL"in n?n.specifiedByURL:void 0},fields:{type:new ht(new re(xl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Yt(n)||gt(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},interfaces:{type:new ht(new re(Pt)),resolve(n){if(Yt(n)||gt(n))return n.getInterfaces()}},possibleTypes:{type:new ht(new re(Pt)),resolve(n,r,i,{schema:o}){if(a_(n))return o.getPossibleTypes(n)}},enumValues:{type:new ht(new re(Tl)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(xn(n)){const i=n.getValues();return r?i:i.filter(o=>o.deprecationReason==null)}}},inputFields:{type:new ht(new re(Hr)),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){if(Tn(n)){const i=Object.values(n.getFields());return r?i:i.filter(o=>o.deprecationReason==null)}}},ofType:{type:Pt,resolve:n=>"ofType"in n?n.ofType:void 0}})}),xl=new En({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},args:{type:new re(new ht(new re(Hr))),args:{includeDeprecated:{type:mt,defaultValue:!1}},resolve(n,{includeDeprecated:r}){return r?n.args:n.args.filter(i=>i.deprecationReason==null)}},type:{type:new re(Pt),resolve:n=>n.type},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Hr=new En({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},type:{type:new re(Pt),resolve:n=>n.type},defaultValue:{type:Oe,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(n){const{type:r,defaultValue:i}=n,o=ci(i,r);return o?yt(o):null}},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})}),Tl=new En({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new re(Oe),resolve:n=>n.name},description:{type:Oe,resolve:n=>n.description},isDeprecated:{type:new re(mt),resolve:n=>n.deprecationReason!=null},deprecationReason:{type:Oe,resolve:n=>n.deprecationReason}})});var ve;(function(n){n.SCALAR="SCALAR",n.OBJECT="OBJECT",n.INTERFACE="INTERFACE",n.UNION="UNION",n.ENUM="ENUM",n.INPUT_OBJECT="INPUT_OBJECT",n.LIST="LIST",n.NON_NULL="NON_NULL"})(ve||(ve={}));const wl=new Qr({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:ve.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:ve.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:ve.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:ve.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:ve.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:ve.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:ve.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:ve.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});new re(Pa);new re(Oe);new re(Oe);const El=Object.freeze([Pa,vl,_l,Pt,xl,Hr,Tl,wl]);function w_(n){return El.some(({name:r})=>n.name===r)}class E_{constructor(r){var i,o;this.__validationErrors=r.assumeValid===!0?[]:void 0,Xt(r)||ue(!1,"Must provide configuration object."),!r.types||Array.isArray(r.types)||ue(!1,`"types" must be Array if provided but got: ${J(r.types)}.`),!r.directives||Array.isArray(r.directives)||ue(!1,`"directives" must be Array if provided but got: ${J(r.directives)}.`),this.description=r.description,this.extensions=_t(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=(i=r.extensionASTNodes)!==null&&i!==void 0?i:[],this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(o=r.directives)!==null&&o!==void 0?o:yl;const u=new Set(r.types);if(r.types!=null)for(const f of r.types)u.delete(f),Nt(f,u);this._queryType!=null&&Nt(this._queryType,u),this._mutationType!=null&&Nt(this._mutationType,u),this._subscriptionType!=null&&Nt(this._subscriptionType,u);for(const f of this._directives)if(g_(f))for(const g of f.args)Nt(g.type,u);Nt(Pa,u),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const f of u){if(f==null)continue;const g=f.name;if(g||ue(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[g]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${g}".`);if(this._typeMap[g]=f,gt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.interfaces.push(f)}}else if(Yt(f)){for(const v of f.getInterfaces())if(gt(v)){let w=this._implementationsMap[v.name];w===void 0&&(w=this._implementationsMap[v.name]={objects:[],interfaces:[]}),w.objects.push(f)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(r){switch(r){case Qt.QUERY:return this.getQueryType();case Qt.MUTATION:return this.getMutationType();case Qt.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(r){return this.getTypeMap()[r]}getPossibleTypes(r){return _n(r)?r.getTypes():this.getImplementations(r).objects}getImplementations(r){const i=this._implementationsMap[r.name];return i??{objects:[],interfaces:[]}}isSubType(r,i){let o=this._subTypeMap[r.name];if(o===void 0){if(o=Object.create(null),_n(r))for(const u of r.getTypes())o[u.name]=!0;else{const u=this.getImplementations(r);for(const f of u.objects)o[f.name]=!0;for(const f of u.interfaces)o[f.name]=!0}this._subTypeMap[r.name]=o}return o[i.name]!==void 0}getDirectives(){return this._directives}getDirective(r){return this.getDirectives().find(i=>i.name===r)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Nt(n,r){const i=u_(n);if(!r.has(i)){if(r.add(i),_n(i))for(const o of i.getTypes())Nt(o,r);else if(Yt(i)||gt(i)){for(const o of i.getInterfaces())Nt(o,r);for(const o of Object.values(i.getFields())){Nt(o.type,r);for(const u of o.args)Nt(u.type,r)}}else if(Tn(i))for(const o of Object.values(i.getFields()))Nt(o.type,r)}return r}function Mi(n,r,i){if(n){if(n.kind===N.VARIABLE){n.name.value;return}if(yn(r))return n.kind===N.NULL?void 0:Mi(n,r.ofType,i);if(n.kind===N.NULL)return null;if(Wi(r)){const o=r.ofType;if(n.kind===N.LIST){const f=[];for(const g of n.values)if(Nc(g,i)){if(yn(o))return;f.push(null)}else{const v=Mi(g,o,i);if(v===void 0)return;f.push(v)}return f}const u=Mi(n,o,i);return u===void 0?void 0:[u]}if(Tn(r)){if(n.kind!==N.OBJECT)return;const o=Object.create(null),u=Kc(n.fields,f=>f.name.value);for(const f of Object.values(r.getFields())){const g=u[f.name];if(!g||Nc(g.value,i)){if(f.defaultValue!==void 0)o[f.name]=f.defaultValue;else if(yn(f.type))return;continue}const v=Mi(g.value,f.type,i);if(v===void 0)return;o[f.name]=v}return o}if(nl(r)){let o;try{o=r.parseLiteral(n,i)}catch{return}return o===void 0?void 0:o}ji(!1,"Unexpected input type: "+J(r))}}function Nc(n,r){return n.kind===N.VARIABLE&&r==null}function S_(n){const r={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...n},i=r.descriptions?"description":"",o=r.specifiedByUrl?"specifiedByURL":"",u=r.directiveIsRepeatable?"isRepeatable":"",f=r.schemaDescription?i:"";function g(v){return r.inputValueDeprecation?v:""}return`
158
59
  query IntrospectionQuery {
159
60
  __schema {
160
- ${p}
61
+ ${f}
161
62
  queryType { name }
162
63
  mutationType { name }
163
64
  subscriptionType { name }
@@ -166,10 +67,10 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
166
67
  }
167
68
  directives {
168
69
  name
169
- ${r}
70
+ ${i}
170
71
  ${u}
171
72
  locations
172
- args${v("(includeDeprecated: true)")} {
73
+ args${g("(includeDeprecated: true)")} {
173
74
  ...InputValue
174
75
  }
175
76
  }
@@ -179,12 +80,12 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
179
80
  fragment FullType on __Type {
180
81
  kind
181
82
  name
182
- ${r}
183
- ${a}
83
+ ${i}
84
+ ${o}
184
85
  fields(includeDeprecated: true) {
185
86
  name
186
- ${r}
187
- args${v("(includeDeprecated: true)")} {
87
+ ${i}
88
+ args${g("(includeDeprecated: true)")} {
188
89
  ...InputValue
189
90
  }
190
91
  type {
@@ -193,7 +94,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
193
94
  isDeprecated
194
95
  deprecationReason
195
96
  }
196
- inputFields${v("(includeDeprecated: true)")} {
97
+ inputFields${g("(includeDeprecated: true)")} {
197
98
  ...InputValue
198
99
  }
199
100
  interfaces {
@@ -201,7 +102,7 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
201
102
  }
202
103
  enumValues(includeDeprecated: true) {
203
104
  name
204
- ${r}
105
+ ${i}
205
106
  isDeprecated
206
107
  deprecationReason
207
108
  }
@@ -212,11 +113,11 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
212
113
 
213
114
  fragment InputValue on __InputValue {
214
115
  name
215
- ${r}
116
+ ${i}
216
117
  type { ...TypeRef }
217
118
  defaultValue
218
- ${v("isDeprecated")}
219
- ${v("deprecationReason")}
119
+ ${g("isDeprecated")}
120
+ ${g("deprecationReason")}
220
121
  }
221
122
 
222
123
  fragment TypeRef on __Type {
@@ -259,64 +160,93 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
259
160
  }
260
161
  }
261
162
  }
262
- `}function Ry(n,i){Mt(n)&&Mt(n.__schema)||te(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${P(n)}.`);const r=n.__schema,a=dn(r.types,x=>x.name,x=>Z(x));for(const x of[...kc,...Wc])a[x.name]&&(a[x.name]=x);const u=r.queryType?O(r.queryType):null,p=r.mutationType?O(r.mutationType):null,v=r.subscriptionType?O(r.subscriptionType):null,I=r.directives?r.directives.map(nn):[];return new Oy({description:r.description,query:u,mutation:p,subscription:v,types:Object.values(a),directives:I,assumeValid:void 0});function N(x){if(x.kind===oe.LIST){const G=x.ofType;if(!G)throw new Error("Decorated type deeper than introspection query.");return new rt(N(G))}if(x.kind===oe.NON_NULL){const G=x.ofType;if(!G)throw new Error("Decorated type deeper than introspection query.");const ze=N(G);return new K(hy(ze))}return R(x)}function R(x){const G=x.name;if(!G)throw new Error(`Unknown type reference: ${P(x)}.`);const ze=a[G];if(!ze)throw new Error(`Invalid or incomplete schema, unknown type: ${G}. Ensure that a full introspection query is used in order to build a client schema.`);return ze}function O(x){return ly(R(x))}function M(x){return fy(R(x))}function Z(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case oe.SCALAR:return ce(x);case oe.OBJECT:return Te(x);case oe.INTERFACE:return fe(x);case oe.UNION:return ve(x);case oe.ENUM:return tn(x);case oe.INPUT_OBJECT:return ye(x)}const G=P(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${G}.`)}function ce(x){return new mn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function W(x){if(x.interfaces===null&&x.kind===oe.INTERFACE)return[];if(!x.interfaces){const G=P(x);throw new Error(`Introspection result missing interfaces: ${G}.`)}return x.interfaces.map(M)}function Te(x){return new en({name:x.name,description:x.description,interfaces:()=>W(x),fields:()=>Ne(x)})}function fe(x){return new Rc({name:x.name,description:x.description,interfaces:()=>W(x),fields:()=>Ne(x)})}function ve(x){if(!x.possibleTypes){const G=P(x);throw new Error(`Introspection result missing possibleTypes: ${G}.`)}return new Cc({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function tn(x){if(!x.enumValues){const G=P(x);throw new Error(`Introspection result missing enumValues: ${G}.`)}return new Si({name:x.name,description:x.description,values:dn(x.enumValues,G=>G.name,G=>({description:G.description,deprecationReason:G.deprecationReason}))})}function ye(x){if(!x.inputFields){const G=P(x);throw new Error(`Introspection result missing inputFields: ${G}.`)}return new Dc({name:x.name,description:x.description,fields:()=>Qe(x.inputFields)})}function Ne(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${P(x)}.`);return dn(x.fields,G=>G.name,Re)}function Re(x){const G=N(x.type);if(!wc(G)){const ze=P(G);throw new Error(`Introspection must provide output type for fields, but received: ${ze}.`)}if(!x.args){const ze=P(x);throw new Error(`Introspection result missing field args: ${ze}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:G,args:Qe(x.args)}}function Qe(x){return dn(x,G=>G.name,Ue)}function Ue(x){const G=N(x.type);if(!Tc(G)){const Li=P(G);throw new Error(`Introspection must provide input type for arguments, but received: ${Li}.`)}const ze=x.defaultValue!=null?dr(Jv(x.defaultValue),G):void 0;return{description:x.description,type:G,defaultValue:ze,deprecationReason:x.deprecationReason}}function nn(x){if(!x.args){const G=P(x);throw new Error(`Introspection result missing directive args: ${G}.`)}if(!x.locations){const G=P(x);throw new Error(`Introspection result missing directive locations: ${G}.`)}return new Gn({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:Qe(x.args)})}}function Cy(n){return Fy(n,i=>!Ny(i),Dy)}function Dy(n){return!Ty(n)&&!Sy(n)}function Fy(n,i,r){const a=n.getDirectives().filter(i),u=Object.values(n.getTypeMap()).filter(r);return[ky(n),...a.map(p=>jy(p)),...u.map(p=>$y(p))].filter(Boolean).join(`
163
+ `}function A_(n,r){Xt(n)&&Xt(n.__schema)||ue(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${J(n)}.`);const i=n.__schema,o=$n(i.types,x=>x.name,x=>P(x));for(const x of[...gl,...El])o[x.name]&&(o[x.name]=x);const u=i.queryType?O(i.queryType):null,f=i.mutationType?O(i.mutationType):null,g=i.subscriptionType?O(i.subscriptionType):null,v=i.directives?i.directives.map(qe):[];return new E_({description:i.description,query:u,mutation:f,subscription:g,types:Object.values(o),directives:v,assumeValid:void 0});function w(x){if(x.kind===ve.LIST){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");return new ht(w(q))}if(x.kind===ve.NON_NULL){const q=x.ofType;if(!q)throw new Error("Decorated type deeper than introspection query.");const Se=w(q);return new re(o_(Se))}return b(x)}function b(x){const q=x.name;if(!q)throw new Error(`Unknown type reference: ${J(x)}.`);const Se=o[q];if(!Se)throw new Error(`Invalid or incomplete schema, unknown type: ${q}. Ensure that a full introspection query is used in order to build a client schema.`);return Se}function O(x){return r_(b(x))}function D(x){return s_(b(x))}function P(x){if(x!=null&&x.name!=null&&x.kind!=null)switch(x.kind){case ve.SCALAR:return M(x);case ve.OBJECT:return he(x);case ve.INTERFACE:return ae(x);case ve.UNION:return me(x);case ve.ENUM:return Ye(x);case ve.INPUT_OBJECT:return xe(x)}const q=J(x);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${q}.`)}function M(x){return new jn({name:x.name,description:x.description,specifiedByURL:x.specifiedByURL})}function $(x){if(x.interfaces===null&&x.kind===ve.INTERFACE)return[];if(!x.interfaces){const q=J(x);throw new Error(`Introspection result missing interfaces: ${q}.`)}return x.interfaces.map(D)}function he(x){return new En({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function ae(x){return new fl({name:x.name,description:x.description,interfaces:()=>$(x),fields:()=>L(x)})}function me(x){if(!x.possibleTypes){const q=J(x);throw new Error(`Introspection result missing possibleTypes: ${q}.`)}return new pl({name:x.name,description:x.description,types:()=>x.possibleTypes.map(O)})}function Ye(x){if(!x.enumValues){const q=J(x);throw new Error(`Introspection result missing enumValues: ${q}.`)}return new Qr({name:x.name,description:x.description,values:$n(x.enumValues,q=>q.name,q=>({description:q.description,deprecationReason:q.deprecationReason}))})}function xe(x){if(!x.inputFields){const q=J(x);throw new Error(`Introspection result missing inputFields: ${q}.`)}return new dl({name:x.name,description:x.description,fields:()=>H(x.inputFields)})}function L(x){if(!x.fields)throw new Error(`Introspection result missing fields: ${J(x)}.`);return $n(x.fields,q=>q.name,ee)}function ee(x){const q=w(x.type);if(!tl(q)){const Se=J(q);throw new Error(`Introspection must provide output type for fields, but received: ${Se}.`)}if(!x.args){const Se=J(x);throw new Error(`Introspection result missing field args: ${Se}.`)}return{description:x.description,deprecationReason:x.deprecationReason,type:q,args:H(x.args)}}function H(x){return $n(x,q=>q.name,ce)}function ce(x){const q=w(x.type);if(!el(q)){const xt=J(q);throw new Error(`Introspection must provide input type for arguments, but received: ${xt}.`)}const Se=x.defaultValue!=null?Mi(Bv(x.defaultValue),q):void 0;return{description:x.description,type:q,defaultValue:Se,deprecationReason:x.deprecationReason}}function qe(x){if(!x.args){const q=J(x);throw new Error(`Introspection result missing directive args: ${q}.`)}if(!x.locations){const q=J(x);throw new Error(`Introspection result missing directive locations: ${q}.`)}return new mi({name:x.name,description:x.description,isRepeatable:x.isRepeatable,locations:x.locations.slice(),args:H(x.args)})}}function I_(n){return N_(n,r=>!x_(r),b_)}function b_(n){return!h_(n)&&!w_(n)}function N_(n,r,i){const o=n.getDirectives().filter(r),u=Object.values(n.getTypeMap()).filter(i);return[O_(n),...o.map(f=>M_(f)),...u.map(f=>C_(f))].filter(Boolean).join(`
263
164
 
264
- `)}function ky(n){if(n.description==null&&Uy(n))return;const i=[],r=n.getQueryType();r&&i.push(` query: ${r.name}`);const a=n.getMutationType();a&&i.push(` mutation: ${a.name}`);const u=n.getSubscriptionType();return u&&i.push(` subscription: ${u.name}`),at(n)+`schema {
265
- ${i.join(`
165
+ `)}function O_(n){if(n.description==null&&R_(n))return;const r=[],i=n.getQueryType();i&&r.push(` query: ${i.name}`);const o=n.getMutationType();o&&r.push(` mutation: ${o.name}`);const u=n.getSubscriptionType();return u&&r.push(` subscription: ${u.name}`),vt(n)+`schema {
166
+ ${r.join(`
266
167
  `)}
267
- }`}function Uy(n){const i=n.getQueryType();if(i&&i.name!=="Query")return!1;const r=n.getMutationType();if(r&&r.name!=="Mutation")return!1;const a=n.getSubscriptionType();return!(a&&a.name!=="Subscription")}function $y(n){if(Bn(n))return Py(n);if(Pt(n))return My(n);if(it(n))return By(n);if(Kt(n))return Gy(n);if(Xt(n))return Vy(n);if(Zt(n))return Wy(n);yr(!1,"Unexpected type: "+P(n))}function Py(n){return at(n)+`scalar ${n.name}`+qy(n)}function jc(n){const i=n.getInterfaces();return i.length?" implements "+i.map(r=>r.name).join(" & "):""}function My(n){return at(n)+`type ${n.name}`+jc(n)+qc(n)}function By(n){return at(n)+`interface ${n.name}`+jc(n)+qc(n)}function Gy(n){const i=n.getTypes(),r=i.length?" = "+i.join(" | "):"";return at(n)+"union "+n.name+r}function Vy(n){const i=n.getValues().map((r,a)=>at(r," ",!a)+" "+r.name+ho(r.deprecationReason));return at(n)+`enum ${n.name}`+po(i)}function Wy(n){const i=Object.values(n.getFields()).map((r,a)=>at(r," ",!a)+" "+ao(r));return at(n)+`input ${n.name}`+po(i)}function qc(n){const i=Object.values(n.getFields()).map((r,a)=>at(r," ",!a)+" "+r.name+Jc(r.args," ")+": "+String(r.type)+ho(r.deprecationReason));return po(i)}function po(n){return n.length!==0?` {
168
+ }`}function R_(n){const r=n.getQueryType();if(r&&r.name!=="Query")return!1;const i=n.getMutationType();if(i&&i.name!=="Mutation")return!1;const o=n.getSubscriptionType();return!(o&&o.name!=="Subscription")}function C_(n){if(gi(n))return L_(n);if(Yt(n))return F_(n);if(gt(n))return D_(n);if(_n(n))return P_(n);if(xn(n))return k_(n);if(Tn(n))return U_(n);ji(!1,"Unexpected type: "+J(n))}function L_(n){return vt(n)+`scalar ${n.name}`+$_(n)}function Sl(n){const r=n.getInterfaces();return r.length?" implements "+r.map(i=>i.name).join(" & "):""}function F_(n){return vt(n)+`type ${n.name}`+Sl(n)+Al(n)}function D_(n){return vt(n)+`interface ${n.name}`+Sl(n)+Al(n)}function P_(n){const r=n.getTypes(),i=r.length?" = "+r.join(" | "):"";return vt(n)+"union "+n.name+i}function k_(n){const r=n.getValues().map((i,o)=>vt(i," ",!o)+" "+i.name+Ua(i.deprecationReason));return vt(n)+`enum ${n.name}`+ka(r)}function U_(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+Ca(i));return vt(n)+`input ${n.name}`+ka(r)}function Al(n){const r=Object.values(n.getFields()).map((i,o)=>vt(i," ",!o)+" "+i.name+Il(i.args," ")+": "+String(i.type)+Ua(i.deprecationReason));return ka(r)}function ka(n){return n.length!==0?` {
268
169
  `+n.join(`
269
170
  `)+`
270
- }`:""}function Jc(n,i=""){return n.length===0?"":n.every(r=>!r.description)?"("+n.map(ao).join(", ")+")":`(
271
- `+n.map((r,a)=>at(r," "+i,!a)+" "+i+ao(r)).join(`
171
+ }`:""}function Il(n,r=""){return n.length===0?"":n.every(i=>!i.description)?"("+n.map(Ca).join(", ")+")":`(
172
+ `+n.map((i,o)=>vt(i," "+r,!o)+" "+r+Ca(i)).join(`
272
173
  `)+`
273
- `+i+")"}function ao(n){const i=Un(n.defaultValue,n.type);let r=n.name+": "+String(n.type);return i&&(r+=` = ${ot(i)}`),r+ho(n.deprecationReason)}function jy(n){return at(n)+"directive @"+n.name+Jc(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function ho(n){return n==null?"":n!==Uc?` @deprecated(reason: ${ot({kind:b.STRING,value:n})})`:" @deprecated"}function qy(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${ot({kind:b.STRING,value:n.specifiedByURL})})`}function at(n,i="",r=!0){const{description:a}=n;if(a==null)return"";const u=ot({kind:b.STRING,value:a,block:Nv(a)});return(i&&!r?`
274
- `+i:i)+u.replace(/\n/g,`
275
- `+i)+`
276
- `}const fr="default",Ei=class Ei{constructor(){this.configPath=yt.join(uv.homedir(),".twenty","config.json")}static setActiveWorkspace(i){this.activeWorkspace=i??fr}static getActiveWorkspace(){return this.activeWorkspace}getActiveWorkspaceName(){return Ei.getActiveWorkspace()}async readRawConfig(){await Ie.ensureFile(this.configPath);const i=await Ie.readFile(this.configPath,"utf8");return JSON.parse(i||"{}")}async getConfig(){const i=this.getDefaultConfig();try{const r=await this.readRawConfig(),a=this.getActiveWorkspaceName(),u=a===fr&&!r.profiles?.[fr]?r:r.profiles?.[a],p=u?.apiUrl??i.apiUrl,v=u?.apiKey;return{apiUrl:p,apiKey:v}}catch{return i}}async setConfig(i){const r=await this.readRawConfig(),a=this.getActiveWorkspaceName();r.profiles||(r.profiles={});const u=r.profiles[a]||{apiUrl:""};r.profiles[a]={...u,...i},await Ie.ensureDir(yt.dirname(this.configPath)),await Ie.writeFile(this.configPath,JSON.stringify(r,null,2))}async clearConfig(){const i=await this.readRawConfig(),r=this.getActiveWorkspaceName();if(i.profiles||(i.profiles={}),i.profiles[r]&&delete i.profiles[r],r===fr){const a=this.getDefaultConfig();delete i.apiKey,i.apiUrl=a.apiUrl}await Ie.ensureDir(yt.dirname(this.configPath)),await Ie.writeFile(this.configPath,JSON.stringify(i,null,2))}getDefaultConfig(){return{apiUrl:"http://localhost:3000"}}};Ei.activeWorkspace=fr;let At=Ei;class Vn{constructor(){this.configService=new At,this.client=Zs.default.create(),this.client.interceptors.request.use(async i=>{const r=await this.configService.getConfig();return i.baseURL=r.apiUrl,r.apiKey&&(i.headers.Authorization=`Bearer ${r.apiKey}`),i}),this.client.interceptors.response.use(i=>i,i=>{throw i.response?.status===401?console.error(F.default.red("Authentication failed. Please run `twenty auth login` first.")):i.response?.status===403?console.error(F.default.red("Access denied. Check your API key and workspace permissions.")):i.code==="ECONNREFUSED"&&console.error(F.default.red("Cannot connect to Twenty server. Is it running?")),i})}async validateAuth(){try{const r=await this.client.post("/metadata",{query:`
174
+ `+r+")"}function Ca(n){const r=ci(n.defaultValue,n.type);let i=n.name+": "+String(n.type);return r&&(i+=` = ${yt(r)}`),i+Ua(n.deprecationReason)}function M_(n){return vt(n)+"directive @"+n.name+Il(n.args)+(n.isRepeatable?" repeatable":"")+" on "+n.locations.join(" | ")}function Ua(n){return n==null?"":n!==ml?` @deprecated(reason: ${yt({kind:N.STRING,value:n})})`:" @deprecated"}function $_(n){return n.specifiedByURL==null?"":` @specifiedBy(url: ${yt({kind:N.STRING,value:n.specifiedByURL})})`}function vt(n,r="",i=!0){const{description:o}=n;if(o==null)return"";const u=yt({kind:N.STRING,value:o,block:xv(o)});return(r&&!i?`
175
+ `+r:r)+u.replace(/\n/g,`
176
+ `+r)+`
177
+ `}class Kt{constructor(r){const{disableInterceptors:i=!1}=r||{};this.configService=new je,this.client=Mr.default.create(),this.client.interceptors.request.use(async o=>{const u=await this.configService.getConfig();return o.baseURL=u.apiUrl,u.apiKey&&(o.headers.Authorization=`Bearer ${u.apiKey}`),o}),!i&&this.client.interceptors.response.use(o=>o,o=>{throw o.response?.status===401?console.error(R.default.red("Authentication failed. Please run `twenty auth:login` first.")):o.response?.status===403?console.error(R.default.red("Access denied. Check your API key and workspace permissions.")):o.code==="ECONNREFUSED"&&console.error(R.default.red("Cannot connect to Twenty server. Is it running?")),o})}async validateAuth(){try{const i=await this.client.post("/metadata",{query:`
277
178
  query CurrentWorkspace {
278
179
  currentWorkspace {
279
180
  id
280
181
  }
281
182
  }
282
- `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return r.status===200&&!r.data.errors}catch{return!1}}async syncApplication({packageJson:i,yarnLock:r,manifest:a}){try{const u=`
283
- mutation SyncApplication($manifest: JSON!, $packageJson: JSON!, $yarnLock: String!) {
284
- syncApplication(manifest: $manifest, packageJson: $packageJson, yarnLock: $yarnLock)
183
+ `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return{authValid:i.status===200&&!i.data.errors,serverUp:i.status===200}}catch{return{authValid:!1,serverUp:!1}}}async checkApplicationExist(r){try{const o=await this.client.post("/metadata",{query:`
184
+ query CheckApplicationExist($universalIdentifier: UUID!) {
185
+ checkApplicationExist(universalIdentifier: $universalIdentifier)
186
+ }
187
+ `,variables:{universalIdentifier:r}},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return o.data.errors?{success:!1,error:o.data.errors[0]}:{success:!0,data:o.data.data.checkApplicationExist,message:"Successfully find application"}}catch(i){return{success:!1,error:i}}}async createApplication(r){try{const i=`
188
+ mutation CreateOneApplication($input: CreateApplicationInput!) {
189
+ createOneApplication(input: $input) {
190
+ id
191
+ universalIdentifier
192
+ }
193
+ }
194
+ `,o={input:{universalIdentifier:r.application.universalIdentifier,name:r.application.displayName,version:"0.0.1",sourcePath:"cli-sync"}},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]}:{success:!0,data:u.data.data.createOneApplication,message:`Successfully create application: ${r.application.displayName}`}}catch(i){return{success:!1,error:i}}}async syncApplication(r){try{const i=`
195
+ mutation SyncApplication($manifest: JSON!) {
196
+ syncApplication(manifest: $manifest)
285
197
  }
286
- `,p={manifest:a,yarnLock:r,packageJson:i},v=await this.client.post("/metadata",{query:u,variables:p},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return v.data.errors?{success:!1,error:v.data.errors[0]}:{success:!0,data:v.data.data.syncApplication,message:`Successfully synced application: ${i.name}`}}catch(u){return{success:!1,error:u}}}async uninstallApplication(i){try{const r=`
198
+ `,o={manifest:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]}:{success:!0,data:u.data.data.syncApplication,message:`Successfully synced application: ${r.application.displayName}`}}catch(i){return{success:!1,error:i}}}async uninstallApplication(r){try{const i=`
287
199
  mutation UninstallApplication($universalIdentifier: String!) {
288
200
  uninstallApplication(universalIdentifier: $universalIdentifier)
289
201
  }
290
- `,a={universalIdentifier:i},u=await this.client.post("/metadata",{query:r,variables:a},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(r){if(Zs.default.isAxiosError(r)&&r.response)return{success:!1,error:r.response.data?.errors?.[0]?.message||r.message};throw r}}async getSchema(){try{const i=Ly(),r=await this.client.post("/graphql",{query:i},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(r.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(r.data.errors)}`};const a=Ry(r.data.data);return{success:!0,data:Cy(a),message:"Successfully load schema"}}catch(i){if(Zs.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw i}}async subscribeToLogs({applicationUniversalIdentifier:i,functionUniversalIdentifier:r,functionName:a}){const u=await this.configService.getConfig(),p=Z0.createClient({url:u.apiUrl+"/graphql",headers:{Authorization:`Bearer ${u.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),v=`
291
- subscription SubscribeToLogs($input: ServerlessFunctionLogsInput!) {
292
- serverlessFunctionLogs(input: $input) {
202
+ `,o={universalIdentifier:r},u=await this.client.post("/metadata",{query:i,variables:o},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return u.data.errors?{success:!1,error:u.data.errors[0]?.message||"Failed to delete application"}:{success:!0,data:u.data.data.uninstallApplication,message:"Successfully uninstalled application"}}catch(i){if(Mr.default.isAxiosError(i)&&i.response)return{success:!1,error:i.response.data?.errors?.[0]?.message||i.message};throw i}}async getSchema(){try{const r=S_(),i=await this.client.post("/graphql",{query:r},{headers:{"Content-Type":"application/json",Accept:"*/*"}});if(i.data.errors)return{success:!1,error:`GraphQL introspection errors: ${JSON.stringify(i.data.errors)}`};const o=A_(i.data.data);return{success:!0,data:I_(o),message:"Successfully load schema"}}catch(r){if(Mr.default.isAxiosError(r)&&r.response)return{success:!1,error:r.response.data.errors[0]?.message||"Failed to load graphql Schema"};throw r}}async findLogicFunctions(){try{const i=await this.client.post("/metadata",{query:`
203
+ query FindManyLogicFunctions {
204
+ findManyLogicFunctions {
205
+ id
206
+ name
207
+ universalIdentifier
208
+ applicationId
209
+ }
210
+ }
211
+ `},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return i.data.errors?{success:!1,error:i.data.errors[0]?.message||"Failed to fetch functions"}:{success:!0,data:i.data.data.findManyLogicFunctions}}catch(r){return{success:!1,error:r}}}async executeLogicFunction({functionId:r,payload:i}){try{const o=`
212
+ mutation ExecuteOneLogicFunction($input: ExecuteLogicFunctionInput!) {
213
+ executeOneLogicFunction(input: $input) {
214
+ data
293
215
  logs
216
+ duration
217
+ status
218
+ error
294
219
  }
295
220
  }
296
- `,I={input:{applicationUniversalIdentifier:i,universalIdentifier:r,name:a}};p.subscribe({query:v,variables:I},{next:({data:N})=>console.log(N?.serverlessFunctionLogs.logs),error:N=>console.error(N),complete:()=>console.log("Completed")})}}const Qc=()=>nv.createJiti(rv.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:Xs&&Xs.tagName.toUpperCase()==="SCRIPT"&&Xs.src||new URL("cli.cjs",document.baseURI).href),{moduleCache:!1,fsCache:!1,interopDefault:!0}),zc=(n,i)=>{if(n.default!==void 0&&(!i||i(n.default)))return n.default;for(const[r,a]of Object.entries(n))if(r!=="default"&&a!=null&&typeof a=="object"&&!Array.isArray(a)&&(!i||i(a)))return a},go=async n=>{const i=Qc();try{const r=await i.import(n),a=zc(r);if(!a)throw new Error(`Config file ${n} must export a config object (default export or any named object export)`);return a}catch(r){throw r instanceof Error?new Error(`Failed to load config from ${n}: ${r.message}`):r}},Jy=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Qy=(n,i,r,a)=>{const u=Jy(i),p=[new RegExp(`import\\s*\\{[^}]*\\b${u}\\b[^}]*\\}\\s*from\\s*['"]([^'"]+)['"]`),new RegExp(`import\\s*\\{[^}]*\\w+\\s+as\\s+${u}[^}]*\\}\\s*from\\s*['"]([^'"]+)['"]`),new RegExp(`import\\s+${u}\\s+from\\s*['"]([^'"]+)['"]`)];for(const v of p){const I=n.match(v);if(I){const N=I[1],R=yt.default.dirname(r),O=yt.default.resolve(R,N),M=yt.default.relative(a,O);return(M.endsWith(".ts")?M:`${M}.ts`).replace(/\\/g,"/")}}return null},zy=async(n,i)=>{const r=Qc();try{const a=await r.import(n),p=zc(a,O=>typeof O=="object"&&O!==null&&"handler"in O&&typeof O.handler=="function");if(!p)throw new Error(`Function file ${n} must export a config object with a "handler" property`);const v=p.handler.name;if(!v)throw new Error(`Handler function in ${n} must be a named function`);const I=await Ie.readFile(n,"utf8"),R=Qy(I,v,n,i)??yt.default.relative(i,n).replace(/\\/g,"/");return{config:p,handlerName:v,handlerPath:R}}catch(a){throw a instanceof Error?new Error(`Failed to load function module from ${n}: ${a.message}`):a}},ac=async(n,i)=>{const r=yt.default.join(n,i);if(await Ie.pathExists(r))return r;throw new Error(`${i} not found in ${n}`)};class uo extends Error{constructor(i,r,a){super(i),this.parseErrors=r,this.filePath=a,this.name="JsoncParseError"}}const Yy=(n,i={})=>{const r=[],a=iv.parse(n,r,{allowTrailingComma:i.allowTrailingComma??!0,disallowComments:i.disallowComments??!1,allowEmptyContent:i.allowEmptyContent??!1});if(r.length>0){const u=r.map(p=>`Line ${p.offset}: ${p.error}`);throw new uo(`JSONC parse errors:
297
- ${u.join(`
298
- `)}`,r)}return a},Hy=async n=>await Ie.readFile(n,"utf8"),Ky=async(n,i={})=>{try{const r=await Ie.readFile(n,"utf8");return Yy(r,i)}catch(r){throw r instanceof uo?new uo(r.message,r.parseErrors,n):new Error(`Failed to read file ${n}: ${r}`)}};class mo extends Error{constructor(i){const r=i.map(a=>` • ${a.path}: ${a.message}`).join(`
299
- `);super(`Manifest validation failed:
300
- ${r}`),this.errors=i,this.name="ManifestValidationError"}}const Xy=n=>{const i=[];if(n.application?.universalIdentifier&&i.push({id:n.application.universalIdentifier,location:"application"}),n.application?.applicationVariables)for(const[r,a]of Object.entries(n.application.applicationVariables))a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`application.variables.${r}`});for(const r of n.objects??[]){r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`objects/${r.nameSingular}`});for(const a of r.fields??[])a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`objects/${r.nameSingular}.fields.${a.label}`})}for(const r of n.serverlessFunctions??[]){r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`functions/${r.name??r.handlerName}`});for(const a of r.triggers??[])a.universalIdentifier&&i.push({id:a.universalIdentifier,location:`functions/${r.name??r.handlerName}.triggers.${a.type}`})}for(const r of n.roles??[])r.universalIdentifier&&i.push({id:r.universalIdentifier,location:`roles/${r.label}`});return i},Zy=n=>{const i=new Map;for(const{id:r,location:a}of n){const u=i.get(r)??[];u.push(a),i.set(r,u)}return Array.from(i.entries()).filter(([r,a])=>a.length>1).map(([r,a])=>({id:r,locations:a}))},e_=(n,i)=>{if(!n){i.push({path:"application",message:"Application config is required"});return}n.universalIdentifier||i.push({path:"application",message:"Application must have a universalIdentifier"})},t_=(n,i)=>{for(const r of n){const a=`objects/${r.nameSingular??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Object must have a universalIdentifier"}),r.nameSingular||i.push({path:a,message:"Object must have a nameSingular"}),r.namePlural||i.push({path:a,message:"Object must have a namePlural"});for(const u of r.fields??[]){const p=`${a}.fields.${u.label??"unknown"}`;u.universalIdentifier||i.push({path:p,message:"Field must have a universalIdentifier"}),u.type||i.push({path:p,message:"Field must have a type"}),u.label||i.push({path:p,message:"Field must have a label"}),(u.type===kn.s.SELECT||u.type===kn.s.MULTI_SELECT)&&(!u.options||u.options.length===0)&&i.push({path:p,message:"SELECT/MULTI_SELECT field must have options"})}}},n_=(n,i)=>{for(const r of n){const a=`functions/${r.name??r.handlerName??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Function must have a universalIdentifier"});for(const u of r.triggers??[]){const p=`${a}.triggers.${u.type??"unknown"}`;if(u.universalIdentifier||i.push({path:p,message:"Trigger must have a universalIdentifier"}),!u.type){i.push({path:p,message:"Trigger must have a type"});continue}switch(u.type){case"route":u.path||i.push({path:p,message:"Route trigger must have a path"}),u.httpMethod||i.push({path:p,message:"Route trigger must have an httpMethod"});break;case"cron":u.pattern||i.push({path:p,message:"Cron trigger must have a pattern"});break;case"databaseEvent":u.eventName||i.push({path:p,message:"Database event trigger must have an eventName"});break}}}},r_=(n,i)=>{for(const r of n){const a=`roles/${r.label??"unknown"}`;r.universalIdentifier||i.push({path:a,message:"Role must have a universalIdentifier"}),r.label||i.push({path:a,message:"Role must have a label"})}},i_=n=>{const i=[],r=[];e_(n.application,i),t_(n.objects??[],i),n_(n.serverlessFunctions??[],i),r_(n.roles??[],i);const a=Xy(n),u=Zy(a);for(const p of u)i.push({path:p.locations.join(", "),message:`Duplicate universalIdentifier: ${p.id}`});return(!n.objects||n.objects.length===0)&&r.push({message:"No objects defined in src/app/objects/"}),(!n.serverlessFunctions||n.serverlessFunctions.length===0)&&r.push({message:"No functions defined in src/app/functions/"}),{isValid:i.length===0,errors:i,warnings:r}},s_=async n=>{const i=yt.default.join(n,"src","app");if(!await Ie.pathExists(i))throw new Error(`Missing src/app/ folder in ${n}.
301
- Create it with: mkdir -p src/app`);const r=yt.default.join(n,"src","app","application.config.ts");if(!await Ie.pathExists(r))throw new Error("Missing src/app/application.config.ts")},vo=(n,i)=>ke.relative(i,n).split(ke.sep).join(ke.posix.sep),wr=async(n,i)=>tv.glob(n,{cwd:i,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**"]}),o_=async n=>{const i=await wr(["src/app/**/*.object.ts"],n),r=[];for(const a of i)try{const u=await go(a);r.push(u)}catch(u){const p=vo(a,n);throw new Error(`Failed to load object from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},a_=async n=>{const i=await wr(["src/app/**/*.function.ts"],n),r=[];for(const a of i)try{const{config:u,handlerName:p,handlerPath:v}=await zy(a,n),I=u,N={universalIdentifier:I.universalIdentifier,name:I.name,description:I.description,timeoutSeconds:I.timeoutSeconds,triggers:I.triggers??[],handlerPath:v,handlerName:p};r.push(N)}catch(u){const p=vo(a,n);throw new Error(`Failed to load function from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},u_=async n=>{const i=await wr(["src/app/**/*.role.ts"],n),r=[];for(const a of i)try{const u=await go(a);r.push(u)}catch(u){const p=vo(a,n);throw new Error(`Failed to load role from ${p}: ${u instanceof Error?u.message:String(u)}`)}return r},c_=async n=>{const i={},r=await wr(["src/**/*.ts","generated/**/*.ts"],n);for(const a of r){const p=ke.relative(n,a).split(ke.sep),v=await Ie.readFile(a,"utf8");let I=i;for(let N=0;N<p.length;N++){const R=p[N];N===p.length-1?I[R]=v:(I[R]=I[R]??{},I=I[R])}}return i},l_=async n=>{const i=await wr(["src/**/*.ts"],n),r=/from\s+['"][^'"]*\/generated(?:\/[^'"]*)?['"]|from\s+['"]generated['"]/,a=/require\s*\(\s*['"][^'"]*\/generated(?:\/[^'"]*)?['"]\s*\)|require\s*\(\s*['"]generated['"]\s*\)/;for(const u of i){const p=await Ie.readFile(u,"utf8");if(r.test(p)||a.test(p))return!0}return!1},mr=async n=>{await s_(n);const i=await Ky(await ac(n,"package.json")),r=await Hy(await ac(n,"yarn.lock")),a=yt.default.join(n,"src","app","application.config.ts"),u=await go(a),[p,v,I,N,R]=await Promise.all([o_(n),a_(n),u_(n),c_(n),l_(n)]),O={application:u,objects:p,serverlessFunctions:v,roles:I,sources:N},M=i_({application:u,objects:p,serverlessFunctions:v,roles:I});if(!M.isValid)throw new mo(M.errors);return{packageJson:i,yarnLock:r,manifest:O,shouldGenerate:R,warnings:M.warnings}};class f_{constructor(){this.apiService=new Vn}async execute({appPath:i=vt,askForConfirmation:r}){try{console.log(F.default.blue("🚀 Uninstall Twenty Application")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(""),r&&!await this.confirmationPrompt()&&(console.error(F.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:a}=await mr(i),u=await this.apiService.uninstallApplication(a.application.universalIdentifier);return u.success===!1?console.error(F.default.red("❌ Uninstall failed:"),u.error):console.log(F.default.green("✅ Application uninstalled successfully")),u}catch(a){throw console.error(F.default.red("Uninstall failed:"),a instanceof Error?a.message:a),a}}async confirmationPrompt(){const{confirmation:i}=await $n.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return i}}const Yc=n=>{const i=n.application.displayName??"Application";console.log(F.default.green(` ✓ Loaded "${i}"`)),console.log(F.default.green(` ✓ Found ${n.objects.length} object(s)`)),console.log(F.default.green(` ✓ Found ${n.serverlessFunctions.length} function(s)`)),console.log(F.default.green(` ✓ Found ${n.roles?.length??"no"} role(s)`))},Hc=n=>{if(!(!n||n.length===0)){console.log("");for(const i of n){const r=i.path?`${i.path}: `:"";console.log(F.default.yellow(` ⚠ ${r}${i.message}`))}}},Kc=n=>{console.log(F.default.red(`
302
- Manifest validation failed:
303
- `));for(const i of n.errors)console.log(F.default.red(` • ${i.path}: ${i.message}`));console.log("")};class p_{constructor(){this.apiService=new Vn}async execute(i){const r=i.appPath??vt,a=parseInt(i.debounce,10);this.logStartupInfo(r,a),await this.synchronize(r);const u=this.setupFileWatcher(r,a);this.setupGracefulShutdown(u)}async synchronize(i){try{const{manifest:r,packageJson:a,yarnLock:u,warnings:p}=await mr(i);Yc(r),Hc(p),await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u}),console.log(F.default.green(" ✓ Synced with server"))}catch(r){r instanceof mo?Kc(r):console.error(F.default.red(" ✗ Sync failed:"),r instanceof Error?r.message:r)}}logStartupInfo(i,r){console.log(F.default.blue("🚀 Starting Twenty Application Development Mode")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(F.default.gray(`⏱️ Debounce: ${r}ms`)),console.log("")}setupFileWatcher(i,r){const a=cv.watch(i,{ignored:/node_modules|\.git/,persistent:!0});let u=null;const p=()=>{u&&clearTimeout(u),u=setTimeout(async()=>{console.log(F.default.blue("🔄 Changes detected, syncing...")),await this.synchronize(i),console.log(F.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)"))},r)};return a.on("change",()=>{p()}),console.log(F.default.gray("👀 Watching for changes... (Press Ctrl+C to stop)")),a}setupGracefulShutdown(i){process.on("SIGINT",()=>{console.log(F.default.yellow(`
304
- 🛑 Stopping development mode...`)),i.close(),process.exit(0)})}}const h_="TWENTY_API_KEY",d_="TWENTY_API_URL",g_="generated";class Xc{constructor(){this.configService=new At,this.apiService=new Vn}async generateClient(i){const r=ke.join(i,g_);console.log(F.default.blue("📦 Generating Twenty client...")),console.log(F.default.gray(`📁 Output Path: ${r}`)),console.log("");const a=await this.configService.getConfig(),u=a.apiUrl,p=a.apiKey;if(!u||!p){console.log(F.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(F.default.gray(`API URL: ${u}`)),console.log(F.default.gray(`Output: ${r}`));const v=await this.apiService.getSchema();if(!v.success)return;const{data:I}=v,N=ke.resolve(r);await ov.generate({schema:I,output:N,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(N),console.log(F.default.green("✓ Client generated successfully!")),console.log(F.default.gray(`Generated files at: ${r}`))}async injectTwentyClient(i){const r=`
221
+ `,u={input:{id:r,payload:i}},f=await this.client.post("/metadata",{query:o,variables:u},{headers:{"Content-Type":"application/json",Accept:"*/*"}});return f.data.errors?{success:!1,error:f.data.errors[0]?.message||"Failed to execute logic function"}:{success:!0,data:f.data.data.executeOneLogicFunction}}catch(o){return{success:!1,error:o}}}async subscribeToLogs({applicationUniversalIdentifier:r,functionUniversalIdentifier:i,functionName:o}){const u=await this.configService.getConfig(),f=Ny.createClient({url:u.apiUrl+"/graphql",headers:{Authorization:`Bearer ${u.apiKey}`,"Content-Type":"application/json",Accept:"text/event-stream"}}),g=`
222
+ subscription SubscribeToLogs($input: LogicFunctionLogsInput!) {
223
+ logicFunctionLogs(input: $input) {
224
+ logs
225
+ }
226
+ }
227
+ `,v={input:{applicationUniversalIdentifier:r,universalIdentifier:i,name:o}};f.subscribe({query:g,variables:v},{next:({data:w})=>console.log(w?.logicFunctionLogs.logs),error:w=>console.error(w),complete:()=>console.log("Completed")})}async uploadFile({filePath:r,builtHandlerPath:i,fileFolder:o,applicationUniversalIdentifier:u}){try{const f=we.resolve(r);if(!yc.existsSync(f))return{success:!1,error:`File not found: ${f}`};const g=we.basename(f),v=yc.readFileSync(f),w=this.getMimeType(g),b=`
228
+ mutation UploadApplicationFile($file: Upload!, $applicationUniversalIdentifier: String!, $fileFolder: FileFolder!, $filePath: String!) {
229
+ uploadApplicationFile(file: $file, applicationUniversalIdentifier: $applicationUniversalIdentifier, fileFolder: $fileFolder, filePath: $filePath)
230
+ { path }
231
+ }
232
+ `,O=jy(o),D=JSON.stringify({query:b,variables:{file:null,applicationUniversalIdentifier:u,filePath:i,fileFolder:O}}),P=JSON.stringify({0:["variables.file"]}),M=new FormData;M.append("operations",D),M.append("map",P),M.append("0",new Blob([new Uint8Array(v)],{type:w}),g);const $=await this.client.post("/graphql",M);return $.data.errors?{success:!1,error:$.data.errors[0]?.message||"Failed to upload file"}:{success:!0,data:$.data.data.uploadApplicationFile,message:`Successfully uploaded ${g}`}}catch(f){return Mr.default.isAxiosError(f)&&f.response?{success:!1,error:f.response.data?.errors?.[0]?.message||f.message}:{success:!1,error:f}}}getMimeType(r){const i=we.extname(r).toLowerCase();return{".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".gif":"image/gif",".webp":"image/webp",".svg":"image/svg+xml",".bmp":"image/bmp",".ico":"image/x-icon",".pdf":"application/pdf",".doc":"application/msword",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".xls":"application/vnd.ms-excel",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",".ppt":"application/vnd.ms-powerpoint",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".txt":"text/plain",".csv":"text/csv",".json":"application/json",".xml":"application/xml",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".mp3":"audio/mpeg",".mp4":"video/mp4",".avi":"video/x-msvideo",".mov":"video/quicktime",".js":"application/javascript",".ts":"application/typescript",".jsx":"application/javascript",".tsx":"application/typescript",".html":"text/html",".css":"text/css"}[i]||"application/octet-stream"}}class B_{constructor(r){this.apiService=new Kt,this.applicationUniversalIdentifier=r.applicationUniversalIdentifier,this.appPath=r.appPath}async uploadFile({builtPath:r,fileFolder:i}){const o=ge.relative(vn,r);return await this.apiService.uploadFile({filePath:we.default.join(this.appPath,r),builtHandlerPath:o,fileFolder:i,applicationUniversalIdentifier:this.applicationUniversalIdentifier})}}var bl=(n=>(n.DefineApplication="defineApplication",n.DefineField="defineField",n.DefineLogicFunction="defineLogicFunction",n.DefineObject="defineObject",n.DefineRole="defineRole",n.DefineFrontComponent="defineFrontComponent",n))(bl||{}),hn=(n=>(n.Application="application",n.Fields="fields",n.LogicFunctions="logicFunctions",n.Objects="objects",n.Roles="roles",n.FrontComponents="frontComponents",n.PublicAssets="publicAssets",n))(hn||{});const j_={defineApplication:"application",defineField:"fields",defineLogicFunction:"logicFunctions",defineObject:"objects",defineRole:"roles",defineFrontComponent:"frontComponents"},W_=n=>{if(!ui.isCallExpression(n))return;const r=n.expression;if(ui.isIdentifier(r)&&Object.values(bl).includes(r.text))return r.text},G_=n=>{const r=ui.createSourceFile("temp.ts",n,ui.ScriptTarget.Latest,!0),i=[];ui.forEachChild(r,o=>{i.push(o)});for(const o of i)if(ui.isExportAssignment(o)){if(o.isExportEquals||!o.expression)return;const u=W_(o.expression);if(u)return u}},oi=async({filePath:n,appPath:r})=>{const i=await V_({filePath:n,appPath:r});return q_(i,n)},V_=async({filePath:n,appPath:r})=>{const i=we.default.join(r,"tsconfig.json"),o=await de.pathExists(i),u=Ry.createRequire(we.default.join(r,"package.json"));let f,g;try{f=we.default.dirname(u.resolve("react/package.json")),g=we.default.dirname(u.resolve("react-dom/package.json"))}catch{}const w=(await Mc.build({entryPoints:[n],bundle:!0,write:!1,format:"cjs",platform:"node",target:"node18",jsx:"automatic",tsconfig:o?i:void 0,alias:{...f&&{react:f},...g&&{"react-dom":g}},logLevel:"silent"})).outputFiles[0].text,b=await de.mkdtemp(we.default.join(Bc.default.tmpdir(),"twenty-manifest-")),O=we.default.join(b,"module.cjs");try{return await de.writeFile(O,w),require(O)}finally{await de.remove(b)}},q_=(n,r)=>{if(B.Tr(n.default)&&Wy(n.default))return n.default;throw new Error(`Config file ${r} must export a config object default export`)},J_=async n=>await Pc.glob(["**/*.ts","**/*.tsx"],{cwd:n,absolute:!0,ignore:["**/node_modules/**","**/*.d.ts","**/dist/**","**/.twenty/**"],onlyFiles:!0}),z_=async n=>await Pc.glob([`${La}/**/*`],{cwd:n,onlyFiles:!0}),Q_=async(n,r)=>{const i={};for(const o of r){const f=ge.relative(n,o).split(ge.sep),g=await de.readFile(o,"utf8");let v=i;for(let w=0;w<f.length;w++){const b=f[w];w===f.length-1?v[b]=g:(v[b]=v[b]??{},v=v[b])}}return i},Yr=async n=>{const r=await J_(n),i=[];let o;const u=[],f=[],g=[],v=[],w=[],b=[],O=[],D=[],P=[],M=[],$=[],he=[],ae=[];for(const L of r){const ee=await Fc.readFile(L,"utf-8"),H=ge.relative(n,L),ce=G_(ee);if(!ce)continue;switch(j_[ce]){case hn.Application:{const x=await oi({appPath:n,filePath:L});o={...x.config,yarnLockChecksum:null,packageJsonChecksum:null},i.push(...x.errors),O.push(H);break}case hn.Objects:{const x=await oi({appPath:n,filePath:L});u.push(x.config),i.push(...x.errors),D.push(H);break}case hn.Fields:{const x=await oi({appPath:n,filePath:L});f.push(x.config),i.push(...x.errors),P.push(H);break}case hn.Roles:{const x=await oi({appPath:n,filePath:L});g.push(x.config),i.push(...x.errors),M.push(H);break}case hn.LogicFunctions:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{handler:q,...Se}=x.config,xt=ge.relative(n,L),Zt={...Se,handlerName:"default.handler",sourceHandlerPath:xt,builtHandlerPath:xt.replace(/\.tsx?$/,".mjs"),builtHandlerChecksum:null};v.push(Zt),$.push(H);break}case hn.FrontComponents:{const x=await oi({appPath:n,filePath:L});i.push(...x.errors);const{component:q,...Se}=x.config,xt=ge.relative(n,L),Zt={...Se,componentName:q.name,sourceComponentPath:xt,builtComponentPath:xt.replace(/\.tsx?$/,".mjs"),builtComponentChecksum:null};w.push(Zt),he.push(H);break}case hn.PublicAssets:break;default:B.ln()}}const me=await z_(n);for(const L of me)b.push({filePath:L,fileName:ge.basename(L),fileType:ge.extname(L).replace(/^\./,""),checksum:null}),ae.push(ge.relative(n,L));return o||i.push("Cannot build application, please export default defineApplication() to define an application"),{manifest:o?{application:o,objects:u,fields:f,roles:g,logicFunctions:v,frontComponents:w,publicAssets:b,sources:await Q_(n,r)}:null,filePaths:{application:O,objects:D,fields:P,roles:M,logicFunctions:$,frontComponents:he,publicAssets:ae},errors:i}},H_=n=>{const r=new Set,i=new Set;for(const o of n)r.has(o)?i.add(o):r.add(o);return Array.from(i)},Nl=n=>{const r=[];if(!n)return[];for(const[i,o]of Object.entries(n))i==="universalIdentifier"&&typeof o=="string"&&r.push(o),typeof o=="object"&&r.push(...Nl(o));return r},Y_=n=>{const r=[],i=[],o=H_(Nl(n));return o.length>0&&r.push(`Duplicate universal identifiers: ${o.join(", ")}`),B.Zo(n.objects)||i.push("No object defined"),B.Zo(n.logicFunctions)||i.push("No logic function defined"),B.Zo(n.frontComponents)||i.push("No front component defined"),{errors:r,warnings:i,isValid:r.length===0}};class X_{constructor(r){this.builtFileInfos=new Map,this.fileUploader=null,this.apiService=new Kt({disableInterceptors:!0}),this.activeUploads=new Set,this.syncTimer=null,this.isSyncing=!1,this.serverReady=!1,this.serverErrorLogged=!1,this.appPath=r.appPath,this.debounceMs=r.debounceMs??200,this.handleManifestBuilt=r.handleManifestBuilt,this.uiStateManager=r.uiStateManager}async checkServer(){const r=await this.apiService.validateAuth();if(!r.serverUp){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Cannot reach server",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Cannot connect to Twenty server. Is it running?"}),this.serverErrorLogged=!0);return}if(!r.authValid){this.serverErrorLogged||(this.uiStateManager.addEvent({message:"Authentication failed",status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:'Cannot authenticate. Check your credentials are correct with "yarn auth:login"'}),this.serverErrorLogged=!0);return}this.serverErrorLogged=!1,this.serverReady=!0}async handleChangeDetected(r,i){this.serverReady||await this.checkServer(),this.serverReady&&(this.uiStateManager.addEvent({message:`Change detected: ${r}`,status:"info"}),i==="unlink"?this.uiStateManager.removeEntity(r):this.uiStateManager.updateFileStatus(r,"building"),this.scheduleSync())}handleFileBuildError(r){this.uiStateManager.addEvent({message:"Build failed:",status:"error"});for(const i of r)this.uiStateManager.addEvent({message:i.error,status:"error"})}handleFileBuilt({fileFolder:r,builtPath:i,sourcePath:o,checksum:u}){this.uiStateManager.addEvent({message:`Successfully built ${i}`,status:"success"}),this.builtFileInfos.set(i,{checksum:u,builtPath:i,sourcePath:o,fileFolder:r}),this.fileUploader&&this.uploadFile(i,o,r),this.scheduleSync()}uploadFile(r,i,o){this.uiStateManager.addEvent({message:`Uploading ${r}`,status:"info"}),this.uiStateManager.updateFileStatus(i,"uploading");const u=this.fileUploader.uploadFile({builtPath:r,fileFolder:o}).then(f=>{f.success?(this.uiStateManager.addEvent({message:`Successfully uploaded ${r}`,status:"success"}),this.uiStateManager.updateFileStatus(i,"success")):this.uiStateManager.addEvent({message:`Failed to upload ${r}: ${f.error}`,status:"error"})}).catch(f=>{this.uiStateManager.addEvent({message:`Upload failed for ${r}: ${f}`,status:"error"})}).finally(()=>{this.activeUploads.delete(u)});this.activeUploads.add(u)}cancelPendingSync(){this.syncTimer&&(clearTimeout(this.syncTimer),this.syncTimer=null)}scheduleSync(){this.cancelPendingSync(),this.syncTimer=setTimeout(()=>{this.syncTimer=null,this.performSync()},this.debounceMs)}async performSync(){if(!this.isSyncing){this.isSyncing=!0;try{this.uiStateManager.addEvent({message:"Building manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"building"});const r=await Yr(this.appPath);if(r.errors.length>0||!r.manifest){for(const f of r.errors)this.uiStateManager.addEvent({message:f,status:"error"});this.uiStateManager.updateManifestState({manifestStatus:"error",error:r.errors[r.errors.length-1]});return}const i=Y_(r.manifest);if(!i.isValid){for(const f of i.errors)this.uiStateManager.addEvent({message:f,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:f});return}if(this.uiStateManager.updateManifestState({appName:r.manifest.application.displayName}),this.uiStateManager.updateAllFilesTypes({manifestFilePaths:r.filePaths}),i.warnings.length>0)for(const f of i.warnings)this.uiStateManager.addEvent({message:`⚠ ${f}`,status:"warning"});if(this.uiStateManager.addEvent({message:"Successfully built manifest",status:"success"}),await this.handleManifestBuilt(r),!this.fileUploader){const f=await this.apiService.checkApplicationExist(r.manifest.application.universalIdentifier);if(!f.success){this.uiStateManager.addEvent({message:`Failed to check if application ${r.manifest.application.universalIdentifier} already exists`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:"Failed to check if application already exists"});return}if(!f.data){this.uiStateManager.addEvent({message:"Creating application",status:"info"});const v=await this.apiService.createApplication(r.manifest);if(v.success)this.uiStateManager.addEvent({message:"Application created",status:"success"});else{this.uiStateManager.addEvent({message:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error",error:`Application creation failed with error ${JSON.stringify(v.error,null,2)}`});return}}this.fileUploader=new B_({appPath:this.appPath,applicationUniversalIdentifier:r.manifest.application.universalIdentifier});for(const[v,{fileFolder:w,sourcePath:b}]of this.builtFileInfos.entries())this.uploadFile(v,b,w)}for(;this.activeUploads.size>0;)await Promise.all(this.activeUploads);const o=fv({manifest:r.manifest,builtFileInfos:this.builtFileInfos});this.uiStateManager.addEvent({message:"Manifest checksums set",status:"info"}),await pv(this.appPath,o),this.uiStateManager.addEvent({message:"Manifest saved to output directory",status:"info"}),this.uiStateManager.addEvent({message:"Syncing manifest",status:"info"}),this.uiStateManager.updateManifestState({manifestStatus:"syncing"});const u=await this.apiService.syncApplication(o);this.uiStateManager.updateAllFilesStatus("success"),u.success?(this.uiStateManager.addEvent({message:"✓ Synced",status:"success"}),this.uiStateManager.updateManifestState({manifestStatus:"synced"})):(this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(u.error,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"}))}catch(r){this.uiStateManager.addEvent({message:`Sync failed with error ${JSON.stringify(r,null,2)}`,status:"error"}),this.uiStateManager.updateManifestState({manifestStatus:"error"})}finally{this.isSyncing=!1}}}}const K_={pending:["building","uploading","success"],building:["pending","uploading","success"],uploading:["pending","success"],success:["pending","building","uploading"]};class Z_{constructor({appPath:r,frontendUrl:i}){this.eventIdCounter=0,this.listeners=new Set,this.state={appPath:r,frontendUrl:i,appName:null,appDescription:null,appUniversalIdentifier:null,manifestStatus:"idle",entities:new Map,events:[]}}getSnapshot(){return this.state}subscribe(r){return this.listeners.add(r),r(this.getSnapshot()),()=>this.listeners.delete(r)}notify(){for(const r of this.listeners)r(this.state)}addEvent({message:r,status:i="info"}){const o={id:++this.eventIdCounter,timestamp:new Date,message:r.slice(0,5e3),status:i};this.state={...this.state,events:[...this.state.events.slice(-201),o]},this.notify()}updateManifestState({manifestStatus:r,appName:i,error:o}){this.state={...this.state,...r?{manifestStatus:r}:{},...i?{appName:i}:{},...o?{error:o.slice(0,5e3)}:{error:void 0}},this.notify()}convertEntityTypeToSyncableEntity(r){switch(r){case"objects":return De.Object;case"fields":return De.Field;case"logicFunctions":return De.LogicFunction;case"frontComponents":return De.FrontComponent;case"roles":return De.Role;default:return}}updateAllFilesTypes({manifestFilePaths:r}){const i=new Map;Object.entries(r).forEach(([u,f])=>{f.forEach(g=>{const v=this.convertEntityTypeToSyncableEntity(u);v&&i.set(g,v)})});const o=new Map(this.state.entities);for(const[u,f]of o)o.set(u,{...f,type:i.get(u)});this.state={...this.state,entities:o},this.notify()}updateAllFilesStatus(r){const i=new Map(this.state.entities);for(const[o,u]of i)i.set(o,{...u,status:r});this.state={...this.state,entities:i},this.notify()}removeEntity(r){const i=new Map(this.state.entities);i.delete(r),this.state={...this.state,entities:i}}updateFileStatus(r,i){const o=new Map(this.state.entities),u=o.get(r);u?.status&&!K_[u.status].find(f=>f===i)||(o.set(r,u?{...u,status:i}:{name:r,path:r,status:i}),this.state={...this.state,entities:o},this.notify())}}const Sa=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],Oc=["↑","⇡","↟","⤒"],Wr={pending:"○",success:"✓"},ki={pending:"gray",building:"yellow",uploading:"cyan",success:"green"},Ol={[De.Object]:"Objects",[De.Field]:"Fields",[De.LogicFunction]:"Logic functions",[De.FrontComponent]:"Front components",[De.Role]:"Roles"},Rl=Object.keys(Ol),ex={info:"gray",success:"green",error:"red",warning:"yellow"},tx=n=>{const r=new Map;for(const i of Rl)r.set(i,[]);for(const i of n.values()){if(!i.type)continue;const o=r.get(i.type)??[];o.push(i),r.set(i.type,o)}return r},nx=n=>n.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ix=(n,r=40)=>{if(n.length<=r)return n;const i=n.split("/");return i.length<=2?n:`.../${i.slice(-2).join("/")}`},rx=n=>!n.frontendUrl||!n.appUniversalIdentifier?null:`${n.frontendUrl}/settings/applications`,sx=async n=>{const[r,i]=await Promise.all([import("react"),import("ink")]),{useState:o,useEffect:u}=r,{render:f,Box:g,Text:v,Static:w}=i,b=(L,ee=80)=>{const[H,ce]=o(0);return u(()=>{const qe=setInterval(()=>{ce(x=>(x+1)%L.length)},ee);return()=>clearInterval(qe)},[L.length,ee]),L[H]},O=({event:L})=>{const ee=ex[L.status],H=nx(L.timestamp);return B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[H," "]}),B.jsxRuntimeExports.jsx(v,{color:ee,children:L.message})]})},D=({status:L})=>{const ee=b(Sa,200),H=b(Oc,200),ce={building:ee,uploading:H,pending:Wr.pending,success:Wr.success};return B.jsxRuntimeExports.jsxs(v,{color:ki[L],children:[ce[L]," "]})},P=({entity:L})=>B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(D,{status:L.status}),B.jsxRuntimeExports.jsx(v,{children:L.name}),L.path!==L.name&&B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[" (",ix(L.path),")"]})]}),M=({type:L,entities:ee})=>ee.length===0?null:B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",marginTop:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,dimColor:!0,children:Ol[L]}),ee.map(H=>B.jsxRuntimeExports.jsx(P,{entity:H},H.path))]}),$={synced:{color:"green",icon:"✓",text:"Synced"},building:{color:"yellow",icon:"spinner",text:"Building..."},syncing:{color:"yellow",icon:"spinner",text:"Syncing..."},error:{color:"red",icon:null,text:"Error"},idle:{color:"gray",icon:null,text:"Idle"}},he=({snapshot:L})=>{const ee=b(Sa,80),H=$[L.manifestStatus],ce=H.icon==="spinner"?ee:H.icon;return B.jsxRuntimeExports.jsxs(v,{color:H.color,children:[ce?`${ce} `:"",H.text,L.error&&`: ${L.error}`]})},ae=({snapshot:L})=>{const ee=tx(L.entities),H=rx(L);return B.jsxRuntimeExports.jsxs(g,{flexDirection:"column",borderStyle:"classic",borderColor:"gray",paddingX:1,children:[B.jsxRuntimeExports.jsx(v,{bold:!0,color:"cyan",children:"Application"}),B.jsxRuntimeExports.jsxs(g,{marginLeft:2,flexDirection:"column",children:[B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Name: "}),B.jsxRuntimeExports.jsx(v,{bold:!0,children:L.appName??"Loading..."})]}),L.appDescription&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Description: "}),B.jsxRuntimeExports.jsx(v,{children:L.appDescription})]}),B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Status: "}),B.jsxRuntimeExports.jsx(he,{snapshot:L})]}),H&&B.jsxRuntimeExports.jsxs(g,{children:[B.jsxRuntimeExports.jsx(v,{dimColor:!0,children:"Open:"}),B.jsxRuntimeExports.jsxs(v,{bold:!0,color:"cyan",children:[" ",H]})]})]}),B.jsxRuntimeExports.jsx(g,{marginLeft:2,flexDirection:"column",children:Rl.map(ce=>{const qe=ee.get(ce)??[];return B.jsxRuntimeExports.jsx(M,{type:ce,entities:qe},ce)})})]})},me=()=>B.jsxRuntimeExports.jsx(g,{marginTop:1,children:B.jsxRuntimeExports.jsxs(v,{dimColor:!0,children:[B.jsxRuntimeExports.jsx(v,{color:ki.pending,children:Wr.pending})," ","pending ",B.jsxRuntimeExports.jsx(v,{color:ki.building,children:Sa[0]})," ","building ",B.jsxRuntimeExports.jsx(v,{color:ki.uploading,children:Oc[0]})," ","uploading"," ",B.jsxRuntimeExports.jsx(v,{color:ki.success,children:Wr.success})," ","success"]})}),Ye=()=>{const[L,ee]=o(n.getSnapshot());return u(()=>n.subscribe(ee),[]),B.jsxRuntimeExports.jsxs(B.jsxRuntimeExports.Fragment,{children:[B.jsxRuntimeExports.jsx(w,{items:L.events,children:H=>B.jsxRuntimeExports.jsx(O,{event:H},H.id)}),B.jsxRuntimeExports.jsxs(g,{marginTop:1,flexDirection:"column",children:[B.jsxRuntimeExports.jsx(ae,{snapshot:L}),B.jsxRuntimeExports.jsx(me,{})]})]})},{unmount:xe}=f(B.jsxRuntimeExports.jsx(Ye,{}));return{unmount:xe}};class Rc{constructor(r){this.watcher=null,this.appPath=r.appPath,this.fileFolder=r.fileFolder,this.watchPaths=r.watchPaths,this.handleFileBuilt=r.handleFileBuilt}async start(){const r=this.watchPaths.map(i=>ge.join(this.appPath,i));for(const i of r)if(!await de.pathExists(i))return;this.watcher=$c.default.watch(r,{awaitWriteFinish:{stabilityThreshold:100,pollInterval:50},usePolling:!0}),this.watcher.on("all",(i,o)=>{i!=="addDir"&&((i==="add"||i==="change")&&this.copyAndNotify(o),i==="unlink"&&this.handleUnlink(o))})}async close(){await this.watcher?.close()}async copyAndNotify(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.ensureDir(ge.dirname(u)),await de.copy(r,u);const f=await de.readFile(u),g=Uc.default.createHash("md5").update(f).digest("hex");this.handleFileBuilt({fileFolder:this.fileFolder,builtPath:o,sourcePath:i,checksum:g})}async handleUnlink(r){const i=ge.relative(this.appPath,r),o=ge.join(vn,i),u=ge.join(this.appPath,o);await de.remove(u)}}class ax{constructor(){this.appPath="",this.orchestrator=null,this.manifestWatcher=null,this.logicFunctionsWatcher=null,this.frontComponentsWatcher=null,this.assetWatcher=null,this.dependencyWatcher=null,this.watchersStarted=!1,this.uiStateManager=null,this.unmountUI=null}async execute(r){this.appPath=r.appPath??Ht,await this.cleanOutputDir(),this.uiStateManager=new Z_({appPath:this.appPath,frontendUrl:process.env.FRONTEND_URL});const{unmount:i}=await sx(this.uiStateManager);this.unmountUI=i,this.orchestrator=new X_({appPath:this.appPath,handleManifestBuilt:this.handleWatcherRestarts.bind(this),uiStateManager:this.uiStateManager}),await this.startManifestWatcher(),this.setupGracefulShutdown()}async cleanOutputDir(){const r=we.default.join(this.appPath,vn);await de.ensureDir(r),await de.emptyDir(r)}async startManifestWatcher(){this.manifestWatcher=new lv({appPath:this.appPath,handleChangeDetected:this.orchestrator.handleChangeDetected.bind(this.orchestrator)}),await this.manifestWatcher.start()}async handleWatcherRestarts(r){const{logicFunctions:i,frontComponents:o}=r.filePaths;if(!this.watchersStarted){this.watchersStarted=!0,await this.startFileWatchers(i,o);return}this.logicFunctionsWatcher?.shouldRestart(i)&&await this.logicFunctionsWatcher.restart(i),this.frontComponentsWatcher?.shouldRestart(o)&&await this.frontComponentsWatcher.restart(o)}async startFileWatchers(r,i){await Promise.all([this.startLogicFunctionsWatcher(r),this.startFrontComponentsWatcher(i),this.startAssetWatcher(),this.startDependencyWatcher()])}async startLogicFunctionsWatcher(r){this.logicFunctionsWatcher=uv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.logicFunctionsWatcher.start()}async startFrontComponentsWatcher(r){this.frontComponentsWatcher=cv({appPath:this.appPath,sourcePaths:r,handleBuildError:this.orchestrator.handleFileBuildError.bind(this.orchestrator),handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.frontComponentsWatcher.start()}async startAssetWatcher(){this.assetWatcher=new Rc({appPath:this.appPath,fileFolder:gn.i.PublicAsset,watchPaths:[La],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),await this.assetWatcher.start()}async startDependencyWatcher(){this.dependencyWatcher=new Rc({appPath:this.appPath,fileFolder:gn.i.Source,watchPaths:["package.json","yarn.lock"],handleFileBuilt:this.orchestrator.handleFileBuilt.bind(this.orchestrator)}),this.dependencyWatcher.start()}setupGracefulShutdown(){const r=async()=>{this.unmountUI?.(),await Promise.all([this.manifestWatcher?.close(),this.logicFunctionsWatcher?.close(),this.frontComponentsWatcher?.close(),this.assetWatcher?.close(),this.dependencyWatcher?.close()]),process.exit(0)};process.on("SIGINT",()=>void r()),process.on("SIGTERM",()=>void r())}}const ox="generated";class ux{constructor(){this.configService=new je,this.apiService=new Kt}async generate(r){const i=ge.join(r,ox);console.log(R.default.blue("📦 Generating Twenty client...")),console.log(R.default.gray(`📁 Output Path: ${i}`)),console.log("");const o=await this.configService.getConfig(),u=o.apiUrl,f=o.apiKey;if(!u||!f){console.log(R.default.yellow("⚠️ Skipping Client generation: API URL or token not configured"));return}console.log(R.default.gray(`API URL: ${u}`)),console.log(R.default.gray(`Output: ${i}`));const g=await this.apiService.getSchema();if(!g.success)return;const{data:v}=g,w=ge.resolve(i);await Cy.generate({schema:v,output:w,scalarTypes:{DateTime:"string",JSON:"Record<string, unknown>",UUID:"string"}}),await this.injectTwentyClient(w),console.log(R.default.green("✓ Client generated successfully!")),console.log(R.default.gray(`Generated files at: ${i}`))}async injectTwentyClient(r){const i=`
305
233
 
306
234
  // ----------------------------------------------------
307
235
  // ✨ Custom Twenty client (auto-injected)
308
236
  // ----------------------------------------------------
309
237
 
310
238
  const defaultOptions: ClientOptions = {
311
- url: \`\${process.env.${d_}}/graphql\`,
239
+ url: \`\${process.env.${rv}}/graphql\`,
312
240
  headers: {
313
241
  'Content-Type': 'application/json',
314
- Authorization: \`Bearer \${process.env.${h_}}\`,
242
+ Authorization: \`Bearer \${process.env.${iv}}\`,
315
243
  },
316
244
  }
317
245
 
318
246
  export default class Twenty {
319
247
  private client: Client;
248
+ private apiUrl: string;
249
+ private authorizationToken: string;
320
250
 
321
251
  constructor(options?: ClientOptions) {
322
252
  const merged: ClientOptions = {
@@ -329,6 +259,8 @@ export default class Twenty {
329
259
  };
330
260
 
331
261
  this.client = createClient(merged);
262
+ this.apiUrl = merged.url;
263
+ this.authorizationToken = merged.headers.Authorization;
332
264
  }
333
265
 
334
266
  query<R extends QueryGenqlSelection>(request: R & { __name?: string }) {
@@ -338,6 +270,175 @@ export default class Twenty {
338
270
  mutation<R extends MutationGenqlSelection>(request: R & { __name?: string }) {
339
271
  return this.client.mutation(request);
340
272
  }
273
+
274
+ async uploadFile(
275
+ fileBuffer: Buffer,
276
+ filename: string,
277
+ contentType: string = 'application/octet-stream',
278
+ fileFolder: string = 'Attachment',
279
+ ): Promise<{ path: string; token: string }> {
280
+ const form = new FormData();
281
+
282
+ form.append('operations', JSON.stringify({
283
+ query: \`mutation UploadFile($file: Upload!, $fileFolder: FileFolder) {
284
+ uploadFile(file: $file, fileFolder: $fileFolder) { path token }
285
+ }\`,
286
+ variables: { file: null, fileFolder },
287
+ }));
288
+ form.append('map', JSON.stringify({ '0': ['variables.file'] }));
289
+ form.append('0', new Blob([fileBuffer], { type: contentType }), filename);
290
+
291
+
292
+ const response = await fetch(\`\${this.apiUrl}/graphql\`, {
293
+ method: 'POST',
294
+ headers: {
295
+ Authorization: this.authorizationToken,
296
+ },
297
+ body: form,
298
+ });
299
+
300
+ const result = await response.json();
301
+
302
+ if (result.errors) {
303
+ throw new GenqlError(result.errors, result.data);
304
+ }
305
+
306
+ return result.data.uploadFile;
307
+ }
308
+ }
309
+
310
+ `;await de.appendFile(ge.join(r,"index.ts"),i)}}class cx{constructor(){this.clientService=new ux}async execute(r=Ht){try{await this.clientService.generate(r)}catch(i){throw console.error(R.default.red("Generate Twenty client failed:"),i instanceof Error?i.message:i),i}}}class lx{constructor(){this.apiService=new Kt}async execute({appPath:r=Ht,askForConfirmation:i}){try{console.log(R.default.blue("🚀 Uninstall Twenty Application")),console.log(R.default.gray(`📁 App Path: ${r}`)),console.log(""),i&&!await this.confirmationPrompt()&&(console.error(R.default.red("⛔️ Aborting uninstall")),process.exit(1));const{manifest:o}=await Yr(r);if(!o)return{success:!1,error:"Build failed"};const u=await this.apiService.uninstallApplication(o.application.universalIdentifier);return u.success===!1?console.error(R.default.red("❌ Uninstall failed:"),u.error):console.log(R.default.green("✅ Application uninstalled successfully")),u}catch(o){throw console.error(R.default.red("Uninstall failed:"),o instanceof Error?o.message:o),o}}async confirmationPrompt(){const{confirmation:r}=await zt.default.prompt([{type:"confirm",name:"confirmation",message:"Are you sure you want to uninstall this application?",default:!1}]);return r}}class fx{constructor(){this.configService=new je}async execute(){try{const r=await this.configService.getAvailableWorkspaces(),i=await this.configService.getDefaultWorkspace();if(r.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}console.log(R.default.blue(`Available workspaces:
311
+ `));for(const o of r){const u=await this.configService.getConfigForWorkspace(o),f=!!u.apiKey,v=o===i?R.default.green(" (default)"):"",w=f?R.default.green("●"):R.default.gray("○");console.log(` ${w} ${o}${v}`),console.log(R.default.gray(` API URL: ${u.apiUrl}`))}console.log(""),console.log(R.default.gray("● = authenticated, ○ = no credentials")),console.log(R.default.gray("Use `twenty auth:switch <workspace>` to change default"))}catch(r){console.error(R.default.red("List failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class px{constructor(){this.configService=new je,this.apiService=new Kt}async execute(r){try{let{apiKey:i,apiUrl:o}=r;const u=await this.configService.getConfig();if(o||(o=(await zt.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:v=>{try{return new URL(v),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),i||(i=(await zt.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:v=>v.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:o,apiKey:i}),(await this.apiService.validateAuth()).authValid){const g=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully authenticated with Twenty (workspace: ${g})`))}else console.log(R.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(i){console.error(R.default.red("Login failed:"),i instanceof Error?i.message:i),process.exit(1)}}}class dx{constructor(){this.configService=new je}async execute(){try{await this.configService.clearConfig();const r=je.getActiveWorkspace();console.log(R.default.green(`✓ Successfully logged out (workspace: ${r})`))}catch(r){console.error(R.default.red("Logout failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class hx{constructor(){this.configService=new je,this.apiService=new Kt}async execute(){try{const r=je.getActiveWorkspace(),i=await this.configService.getConfig();if(console.log(R.default.blue("Authentication Status:")),console.log(`Workspace: ${r}`),console.log(`API URL: ${i.apiUrl}`),console.log(`API Key: ${i.apiKey?"***"+i.apiKey.slice(-4):"Not set"}`),i.apiKey){const o=await this.apiService.validateAuth();console.log(`Status: ${o.authValid?R.default.green("✓ Valid"):R.default.red("✗ Invalid")}`)}else console.log(`Status: ${R.default.yellow("⚠ Not authenticated")}`)}catch(r){console.error(R.default.red("Status check failed:"),r instanceof Error?r.message:r),process.exit(1)}}}class gx{constructor(){this.apiService=new Kt}async execute({appPath:r=Ht,functionUniversalIdentifier:i,functionName:o,payload:u="{}"}){try{let f;try{f=JSON.parse(u)}catch{console.error(R.default.red("Invalid JSON payload. Please provide valid JSON.")),process.exit(1)}const{manifest:g}=await Yr(r);g||(console.error(R.default.red("Failed to build manifest.")),process.exit(1));const v=await this.apiService.findLogicFunctions();v.success||(console.error(R.default.red("Failed to fetch functions:"),v.error instanceof Error?v.error.message:v.error),process.exit(1));const w=v.data.filter(M=>M.universalIdentifier&&this.belongsToApplication(M,g)),b=w.find(M=>i?M.universalIdentifier===i:o?M.name===o:!1);if(!b){const M=i||o;console.error(R.default.red(`Function "${M}" not found in application.`)),console.log(""),w.length>0?(console.log(R.default.cyan("Available functions:")),w.forEach($=>{console.log(` - ${R.default.white($.name)} (${$.universalIdentifier})`)})):console.log(R.default.yellow("No functions found for this application. Have you synced your app with `yarn app:sync`?")),process.exit(1)}console.log(R.default.blue(`🚀 Executing function "${b.name}"...`)),console.log(R.default.gray(` Payload: ${JSON.stringify(f)}`)),console.log("");const O=await this.apiService.executeLogicFunction({functionId:b.id,payload:f});O.success||(console.error(R.default.red("Execution failed:"),O.error instanceof Error?O.error.message:O.error),process.exit(1));const D=O.data;console.log(R.default.cyan("─".repeat(60))),console.log(R.default.cyan("Execution Result")),console.log(R.default.cyan("─".repeat(60)));const P=D.status==="SUCCESS"?R.default.green:R.default.red;console.log(`${R.default.bold("Status:")} ${P(D.status)}`),console.log(`${R.default.bold("Duration:")} ${D.duration}ms`),B.Tr(D.data)&&(console.log(""),console.log(R.default.bold("Data:")),console.log(R.default.white(JSON.stringify(D.data,null,2)))),D.error&&(console.log(""),console.log(R.default.bold.red("Error:")),console.log(R.default.red(` Type: ${D.error.errorType}`)),console.log(R.default.red(` Message: ${D.error.errorMessage}`)),D.error.stackTrace&&(console.log(""),console.log(R.default.gray("Stack trace:")),console.log(R.default.gray(D.error.stackTrace)))),D.logs&&(console.log(""),console.log(R.default.bold("Logs:")),console.log(R.default.gray(D.logs))),console.log(R.default.cyan("─".repeat(60))),D.status!=="SUCCESS"&&process.exit(1)}catch(f){console.error(R.default.red("Execution failed:"),f instanceof Error?f.message:f),process.exit(1)}}belongsToApplication(r,i){return i.logicFunctions.some(o=>o.universalIdentifier===r.universalIdentifier)}}class mx{constructor(){this.apiService=new Kt}async execute({appPath:r=Ht,functionUniversalIdentifier:i,functionName:o}){try{const{manifest:u}=await Yr(r);u||process.exit(1),this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:i,functionName:o}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:i,functionName:o})}catch(u){console.error(R.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:r,functionUniversalIdentifier:i,functionName:o}){const u=r??"Twenty Application",f=i||o?`function "${i||o}"`:"functions";console.log(R.default.blue(`🚀 Watching ${u} ${f} logs:`)),console.log("")}}class yx{constructor(){this.configService=new je,this.apiService=new Kt}async execute(r){try{let{workspace:i}=r;const o=await this.configService.getAvailableWorkspaces(),u=await this.configService.getDefaultWorkspace();if(o.length===0){console.log(R.default.yellow("⚠ No workspaces configured. Use `twenty auth:login` to create one."));return}if(!i){const v=o.map(b=>({name:b===u?`${b} (current default)`:b,value:b}));i=(await zt.default.prompt([{type:"list",name:"workspace",message:"Select a workspace to set as default:",choices:v,default:u}])).workspace}if(o.includes(i)||(console.log(R.default.red(`✗ Workspace "${i}" not found. Available workspaces: ${o.join(", ")}`)),process.exit(1)),i===u){console.log(R.default.blue(`ℹ "${i}" is already the default workspace.`));return}await this.configService.setDefaultWorkspace(i),je.setActiveWorkspace(i);const g=!!(await this.configService.getConfig()).apiKey;console.log(R.default.green(`✓ Switched default workspace to "${i}"`)),g?(await this.apiService.validateAuth()).authValid?console.log(R.default.green("✓ Authentication is valid")):console.log(R.default.yellow("⚠ Authentication credentials exist but are invalid. Run `twenty auth:login` to re-authenticate.")):console.log(R.default.yellow("⚠ No credentials configured for this workspace. Run `twenty auth:login` to authenticate."))}catch(i){console.error(R.default.red("Switch failed:"),i instanceof Error?i.message:i),process.exit(1)}}}var Aa,Cc;function vx(){if(Cc)return Aa;Cc=1;var n="[object Symbol]",r=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,o="\\ud800-\\udfff",u="\\u0300-\\u036f\\ufe20-\\ufe23",f="\\u20d0-\\u20f0",g="\\u2700-\\u27bf",v="a-z\\xdf-\\xf6\\xf8-\\xff",w="\\xac\\xb1\\xd7\\xf7",b="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O="\\u2000-\\u206f",D=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",P="A-Z\\xc0-\\xd6\\xd8-\\xde",M="\\ufe0e\\ufe0f",$=w+b+O+D,he="['’]",ae="["+$+"]",me="["+u+f+"]",Ye="\\d+",xe="["+g+"]",L="["+v+"]",ee="[^"+o+$+Ye+g+v+P+"]",H="\\ud83c[\\udffb-\\udfff]",ce="(?:"+me+"|"+H+")",qe="[^"+o+"]",x="(?:\\ud83c[\\udde6-\\uddff]){2}",q="[\\ud800-\\udbff][\\udc00-\\udfff]",Se="["+P+"]",xt="\\u200d",Zt="(?:"+L+"|"+ee+")",Vi="(?:"+Se+"|"+ee+")",qi="(?:"+he+"(?:d|ll|m|re|s|t|ve))?",Ji="(?:"+he+"(?:D|LL|M|RE|S|T|VE))?",Rt=ce+"?",Tt="["+M+"]?",Xr="(?:"+xt+"(?:"+[qe,x,q].join("|")+")"+Tt+Rt+")*",Wn=Tt+Rt+Xr,st="(?:"+[xe,x,q].join("|")+")"+Wn,Kr=RegExp(he,"g"),Zr=RegExp(me,"g"),es=RegExp([Se+"?"+L+"+"+qi+"(?="+[ae,Se,"$"].join("|")+")",Vi+"+"+Ji+"(?="+[ae,Se+Zt,"$"].join("|")+")",Se+"?"+Zt+"+"+qi,Se+"+"+Ji,Ye,st].join("|"),"g"),en=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Gn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"ss"},ts=typeof mn=="object"&&mn&&mn.Object===Object&&mn,Sn=typeof self=="object"&&self&&self.Object===Object&&self,An=ts||Sn||Function("return this")();function ns(W,Ce,Ct,Hi){for(var On=-1,_i=W?W.length:0;++On<_i;)Ct=Ce(Ct,W[On],On,W);return Ct}function Vn(W){return W.match(r)||[]}function qn(W){return function(Ce){return W?.[Ce]}}var zi=qn(Gn);function Xe(W){return en.test(W)}function In(W){return W.match(es)||[]}var is=Object.prototype,wt=is.toString,vi=An.Symbol,Qi=vi?vi.prototype:void 0,tn=Qi?Qi.toString:void 0;function Ke(W){if(typeof W=="string")return W;if(rs(W))return tn?tn.call(W):"";var Ce=W+"";return Ce=="0"&&1/W==-1/0?"-0":Ce}function bn(W){return function(Ce){return ns(rn(ss(Ce).replace(Kr,"")),W,"")}}function Jn(W){return!!W&&typeof W=="object"}function rs(W){return typeof W=="symbol"||Jn(W)&&wt.call(W)==n}function nn(W){return W==null?"":Ke(W)}function ss(W){return W=nn(W),W&&W.replace(i,zi).replace(Zr,"")}var Nn=bn(function(W,Ce,Ct){return W+(Ct?"-":"")+Ce.toLowerCase()});function rn(W,Ce,Ct){return W=nn(W),Ce=Ce,Ce===void 0?Xe(W)?In(W):Vn(W):W.match(Ce)||[]}return Aa=Nn,Aa}var _x=vx();const fi=Uy(_x),xx=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineFrontComponent } from 'twenty-sdk';
312
+
313
+ // React component - implement your UI here
314
+ const Component = () => {
315
+ return (
316
+ <div style={{ padding: '20px', fontFamily: 'sans-serif' }}>
317
+ <h1>My new component!</h1>
318
+ <p>This is your front component: ${i}</p>
319
+ </div>
320
+ );
321
+ };
322
+
323
+ export default defineFrontComponent({
324
+ universalIdentifier: '${r}',
325
+ name: '${i}',
326
+ description: 'Add a description for your front component',
327
+ component: Component,
328
+ });
329
+ `},Tx=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n),o=pi.v4();return`import { defineLogicFunction } from 'twenty-sdk';
330
+
331
+ // Logic function handler - rename and implement your logic
332
+ const handler = async (params: {
333
+ a: string;
334
+ b: number;
335
+ }): Promise<{ message: string }> => {
336
+ const { a, b } = params;
337
+
338
+ // Replace with your own logic
339
+ const message = \`Hello, input: \${a} and \${b}\`;
340
+
341
+ return { message };
342
+ };
343
+
344
+ export default defineLogicFunction({
345
+ universalIdentifier: '${r}',
346
+ name: '${i}',
347
+ description: 'Add a description for your logic function',
348
+ timeoutSeconds: 5,
349
+ handler,
350
+ triggers: [
351
+ // Add your triggers here
352
+ // Route trigger example:
353
+ // {
354
+ // universalIdentifier: '${o}',
355
+ // type: 'route',
356
+ // path: '/${i}',
357
+ // httpMethod: 'POST',
358
+ // isAuthRequired: true,
359
+ // },
360
+ // Cron trigger example:
361
+ // {
362
+ // universalIdentifier: '...',
363
+ // type: 'cron',
364
+ // pattern: '0 0 * * *', // Daily at midnight
365
+ // },
366
+ // Database event trigger example:
367
+ // {
368
+ // universalIdentifier: '...',
369
+ // type: 'databaseEvent',
370
+ // eventName: 'objectName.created',
371
+ // },
372
+ ],
373
+ });
374
+ `};var $i={exports:{}};/**
375
+ * @license
376
+ * Lodash <https://lodash.com/>
377
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
378
+ * Released under MIT license <https://lodash.com/license>
379
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
380
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
381
+ */var wx=$i.exports,Lc;function Ex(){return Lc||(Lc=1,function(n,r){(function(){var i,o="4.17.21",u=200,f="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",g="Expected a function",v="Invalid `variable` option passed into `_.template`",w="__lodash_hash_undefined__",b=500,O="__lodash_placeholder__",D=1,P=2,M=4,$=1,he=2,ae=1,me=2,Ye=4,xe=8,L=16,ee=32,H=64,ce=128,qe=256,x=512,q=30,Se="...",xt=800,Zt=16,Vi=1,qi=2,Ji=3,Rt=1/0,Tt=9007199254740991,Xr=17976931348623157e292,Wn=NaN,st=4294967295,Kr=st-1,Zr=st>>>1,es=[["ary",ce],["bind",ae],["bindKey",me],["curry",xe],["curryRight",L],["flip",x],["partial",ee],["partialRight",H],["rearg",qe]],en="[object Arguments]",Gn="[object Array]",ts="[object AsyncFunction]",Sn="[object Boolean]",An="[object Date]",ns="[object DOMException]",Vn="[object Error]",qn="[object Function]",zi="[object GeneratorFunction]",Xe="[object Map]",In="[object Number]",is="[object Null]",wt="[object Object]",vi="[object Promise]",Qi="[object Proxy]",tn="[object RegExp]",Ke="[object Set]",bn="[object String]",Jn="[object Symbol]",rs="[object Undefined]",nn="[object WeakMap]",ss="[object WeakSet]",Nn="[object ArrayBuffer]",rn="[object DataView]",W="[object Float32Array]",Ce="[object Float64Array]",Ct="[object Int8Array]",Hi="[object Int16Array]",On="[object Int32Array]",_i="[object Uint8Array]",as="[object Uint8ClampedArray]",os="[object Uint16Array]",us="[object Uint32Array]",Cl=/\b__p \+= '';/g,Ll=/\b(__p \+=) '' \+/g,Fl=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ma=/&(?:amp|lt|gt|quot|#39);/g,$a=/[&<>"']/g,Dl=RegExp(Ma.source),Pl=RegExp($a.source),kl=/<%-([\s\S]+?)%>/g,Ul=/<%([\s\S]+?)%>/g,Ba=/<%=([\s\S]+?)%>/g,Ml=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$l=/^\w*$/,Bl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cs=/[\\^$.*+?()[\]{}|]/g,jl=RegExp(cs.source),ls=/^\s+/,Wl=/\s/,Gl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vl=/\{\n\/\* \[wrapped with (.+)\] \*/,ql=/,? & /,Jl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zl=/[()=,{}\[\]\/\s]/,Ql=/\\(\\)?/g,Hl=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ja=/\w*$/,Yl=/^[-+]0x[0-9a-f]+$/i,Xl=/^0b[01]+$/i,Kl=/^\[object .+?Constructor\]$/,Zl=/^0o[0-7]+$/i,ef=/^(?:0|[1-9]\d*)$/,tf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yi=/($^)/,nf=/['\n\r\u2028\u2029\\]/g,Xi="\\ud800-\\udfff",rf="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",af="\\u20d0-\\u20ff",Wa=rf+sf+af,Ga="\\u2700-\\u27bf",Va="a-z\\xdf-\\xf6\\xf8-\\xff",of="\\xac\\xb1\\xd7\\xf7",uf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",cf="\\u2000-\\u206f",lf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ja="\\ufe0e\\ufe0f",za=of+uf+cf+lf,fs="['’]",ff="["+Xi+"]",Qa="["+za+"]",Ki="["+Wa+"]",Ha="\\d+",pf="["+Ga+"]",Ya="["+Va+"]",Xa="[^"+Xi+za+Ha+Ga+Va+qa+"]",ps="\\ud83c[\\udffb-\\udfff]",df="(?:"+Ki+"|"+ps+")",Ka="[^"+Xi+"]",ds="(?:\\ud83c[\\udde6-\\uddff]){2}",hs="[\\ud800-\\udbff][\\udc00-\\udfff]",zn="["+qa+"]",Za="\\u200d",eo="(?:"+Ya+"|"+Xa+")",hf="(?:"+zn+"|"+Xa+")",to="(?:"+fs+"(?:d|ll|m|re|s|t|ve))?",no="(?:"+fs+"(?:D|LL|M|RE|S|T|VE))?",io=df+"?",ro="["+Ja+"]?",gf="(?:"+Za+"(?:"+[Ka,ds,hs].join("|")+")"+ro+io+")*",mf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",so=ro+io+gf,vf="(?:"+[pf,ds,hs].join("|")+")"+so,_f="(?:"+[Ka+Ki+"?",Ki,ds,hs,ff].join("|")+")",xf=RegExp(fs,"g"),Tf=RegExp(Ki,"g"),gs=RegExp(ps+"(?="+ps+")|"+_f+so,"g"),wf=RegExp([zn+"?"+Ya+"+"+to+"(?="+[Qa,zn,"$"].join("|")+")",hf+"+"+no+"(?="+[Qa,zn+eo,"$"].join("|")+")",zn+"?"+eo+"+"+to,zn+"+"+no,yf,mf,Ha,vf].join("|"),"g"),Ef=RegExp("["+Za+Xi+Wa+Ja+"]"),Sf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Af=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],If=-1,Te={};Te[W]=Te[Ce]=Te[Ct]=Te[Hi]=Te[On]=Te[_i]=Te[as]=Te[os]=Te[us]=!0,Te[en]=Te[Gn]=Te[Nn]=Te[Sn]=Te[rn]=Te[An]=Te[Vn]=Te[qn]=Te[Xe]=Te[In]=Te[wt]=Te[tn]=Te[Ke]=Te[bn]=Te[nn]=!1;var _e={};_e[en]=_e[Gn]=_e[Nn]=_e[rn]=_e[Sn]=_e[An]=_e[W]=_e[Ce]=_e[Ct]=_e[Hi]=_e[On]=_e[Xe]=_e[In]=_e[wt]=_e[tn]=_e[Ke]=_e[bn]=_e[Jn]=_e[_i]=_e[as]=_e[os]=_e[us]=!0,_e[Vn]=_e[qn]=_e[nn]=!1;var bf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Nf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Of={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Rf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cf=parseFloat,Lf=parseInt,ao=typeof mn=="object"&&mn&&mn.Object===Object&&mn,Ff=typeof self=="object"&&self&&self.Object===Object&&self,Ue=ao||Ff||Function("return this")(),ms=r&&!r.nodeType&&r,Rn=ms&&!0&&n&&!n.nodeType&&n,oo=Rn&&Rn.exports===ms,ys=oo&&ao.process,at=function(){try{var m=Rn&&Rn.require&&Rn.require("util").types;return m||ys&&ys.binding&&ys.binding("util")}catch{}}(),uo=at&&at.isArrayBuffer,co=at&&at.isDate,lo=at&&at.isMap,fo=at&&at.isRegExp,po=at&&at.isSet,ho=at&&at.isTypedArray;function Ze(m,T,_){switch(_.length){case 0:return m.call(T);case 1:return m.call(T,_[0]);case 2:return m.call(T,_[0],_[1]);case 3:return m.call(T,_[0],_[1],_[2])}return m.apply(T,_)}function Df(m,T,_,F){for(var z=-1,oe=m==null?0:m.length;++z<oe;){var Le=m[z];T(F,Le,_(Le),m)}return F}function ot(m,T){for(var _=-1,F=m==null?0:m.length;++_<F&&T(m[_],_,m)!==!1;);return m}function Pf(m,T){for(var _=m==null?0:m.length;_--&&T(m[_],_,m)!==!1;);return m}function go(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(!T(m[_],_,m))return!1;return!0}function sn(m,T){for(var _=-1,F=m==null?0:m.length,z=0,oe=[];++_<F;){var Le=m[_];T(Le,_,m)&&(oe[z++]=Le)}return oe}function Zi(m,T){var _=m==null?0:m.length;return!!_&&Qn(m,T,0)>-1}function vs(m,T,_){for(var F=-1,z=m==null?0:m.length;++F<z;)if(_(T,m[F]))return!0;return!1}function Ee(m,T){for(var _=-1,F=m==null?0:m.length,z=Array(F);++_<F;)z[_]=T(m[_],_,m);return z}function an(m,T){for(var _=-1,F=T.length,z=m.length;++_<F;)m[z+_]=T[_];return m}function _s(m,T,_,F){var z=-1,oe=m==null?0:m.length;for(F&&oe&&(_=m[++z]);++z<oe;)_=T(_,m[z],z,m);return _}function kf(m,T,_,F){var z=m==null?0:m.length;for(F&&z&&(_=m[--z]);z--;)_=T(_,m[z],z,m);return _}function xs(m,T){for(var _=-1,F=m==null?0:m.length;++_<F;)if(T(m[_],_,m))return!0;return!1}var Uf=Ts("length");function Mf(m){return m.split("")}function $f(m){return m.match(Jl)||[]}function mo(m,T,_){var F;return _(m,function(z,oe,Le){if(T(z,oe,Le))return F=oe,!1}),F}function er(m,T,_,F){for(var z=m.length,oe=_+(F?1:-1);F?oe--:++oe<z;)if(T(m[oe],oe,m))return oe;return-1}function Qn(m,T,_){return T===T?Xf(m,T,_):er(m,yo,_)}function Bf(m,T,_,F){for(var z=_-1,oe=m.length;++z<oe;)if(F(m[z],T))return z;return-1}function yo(m){return m!==m}function vo(m,T){var _=m==null?0:m.length;return _?Es(m,T)/_:Wn}function Ts(m){return function(T){return T==null?i:T[m]}}function ws(m){return function(T){return m==null?i:m[T]}}function _o(m,T,_,F,z){return z(m,function(oe,Le,ye){_=F?(F=!1,oe):T(_,oe,Le,ye)}),_}function jf(m,T){var _=m.length;for(m.sort(T);_--;)m[_]=m[_].value;return m}function Es(m,T){for(var _,F=-1,z=m.length;++F<z;){var oe=T(m[F]);oe!==i&&(_=_===i?oe:_+oe)}return _}function Ss(m,T){for(var _=-1,F=Array(m);++_<m;)F[_]=T(_);return F}function Wf(m,T){return Ee(T,function(_){return[_,m[_]]})}function xo(m){return m&&m.slice(0,So(m)+1).replace(ls,"")}function et(m){return function(T){return m(T)}}function As(m,T){return Ee(T,function(_){return m[_]})}function xi(m,T){return m.has(T)}function To(m,T){for(var _=-1,F=m.length;++_<F&&Qn(T,m[_],0)>-1;);return _}function wo(m,T){for(var _=m.length;_--&&Qn(T,m[_],0)>-1;);return _}function Gf(m,T){for(var _=m.length,F=0;_--;)m[_]===T&&++F;return F}var Vf=ws(bf),qf=ws(Nf);function Jf(m){return"\\"+Rf[m]}function zf(m,T){return m==null?i:m[T]}function Hn(m){return Ef.test(m)}function Qf(m){return Sf.test(m)}function Hf(m){for(var T,_=[];!(T=m.next()).done;)_.push(T.value);return _}function Is(m){var T=-1,_=Array(m.size);return m.forEach(function(F,z){_[++T]=[z,F]}),_}function Eo(m,T){return function(_){return m(T(_))}}function on(m,T){for(var _=-1,F=m.length,z=0,oe=[];++_<F;){var Le=m[_];(Le===T||Le===O)&&(m[_]=O,oe[z++]=_)}return oe}function tr(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=F}),_}function Yf(m){var T=-1,_=Array(m.size);return m.forEach(function(F){_[++T]=[F,F]}),_}function Xf(m,T,_){for(var F=_-1,z=m.length;++F<z;)if(m[F]===T)return F;return-1}function Kf(m,T,_){for(var F=_+1;F--;)if(m[F]===T)return F;return F}function Yn(m){return Hn(m)?ep(m):Uf(m)}function Et(m){return Hn(m)?tp(m):Mf(m)}function So(m){for(var T=m.length;T--&&Wl.test(m.charAt(T)););return T}var Zf=ws(Of);function ep(m){for(var T=gs.lastIndex=0;gs.test(m);)++T;return T}function tp(m){return m.match(gs)||[]}function np(m){return m.match(wf)||[]}var ip=function m(T){T=T==null?Ue:Xn.defaults(Ue.Object(),T,Xn.pick(Ue,Af));var _=T.Array,F=T.Date,z=T.Error,oe=T.Function,Le=T.Math,ye=T.Object,bs=T.RegExp,rp=T.String,ut=T.TypeError,nr=_.prototype,sp=oe.prototype,Kn=ye.prototype,ir=T["__core-js_shared__"],rr=sp.toString,pe=Kn.hasOwnProperty,ap=0,Ao=function(){var e=/[^.]+$/.exec(ir&&ir.keys&&ir.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),sr=Kn.toString,op=rr.call(ye),up=Ue._,cp=bs("^"+rr.call(pe).replace(cs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ar=oo?T.Buffer:i,un=T.Symbol,or=T.Uint8Array,Io=ar?ar.allocUnsafe:i,ur=Eo(ye.getPrototypeOf,ye),bo=ye.create,No=Kn.propertyIsEnumerable,cr=nr.splice,Oo=un?un.isConcatSpreadable:i,Ti=un?un.iterator:i,Cn=un?un.toStringTag:i,lr=function(){try{var e=kn(ye,"defineProperty");return e({},"",{}),e}catch{}}(),lp=T.clearTimeout!==Ue.clearTimeout&&T.clearTimeout,fp=F&&F.now!==Ue.Date.now&&F.now,pp=T.setTimeout!==Ue.setTimeout&&T.setTimeout,fr=Le.ceil,pr=Le.floor,Ns=ye.getOwnPropertySymbols,dp=ar?ar.isBuffer:i,Ro=T.isFinite,hp=nr.join,gp=Eo(ye.keys,ye),Fe=Le.max,$e=Le.min,mp=F.now,yp=T.parseInt,Co=Le.random,vp=nr.reverse,Os=kn(T,"DataView"),wi=kn(T,"Map"),Rs=kn(T,"Promise"),Zn=kn(T,"Set"),Ei=kn(T,"WeakMap"),Si=kn(ye,"create"),dr=Ei&&new Ei,ei={},_p=Un(Os),xp=Un(wi),Tp=Un(Rs),wp=Un(Zn),Ep=Un(Ei),hr=un?un.prototype:i,Ai=hr?hr.valueOf:i,Lo=hr?hr.toString:i;function l(e){if(Ie(e)&&!Q(e)&&!(e instanceof te)){if(e instanceof ct)return e;if(pe.call(e,"__wrapped__"))return Fu(e)}return new ct(e)}var ti=function(){function e(){}return function(t){if(!Ae(t))return{};if(bo)return bo(t);e.prototype=t;var s=new e;return e.prototype=i,s}}();function gr(){}function ct(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}l.templateSettings={escape:kl,evaluate:Ul,interpolate:Ba,variable:"",imports:{_:l}},l.prototype=gr.prototype,l.prototype.constructor=l,ct.prototype=ti(gr.prototype),ct.prototype.constructor=ct;function te(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=st,this.__views__=[]}function Sp(){var e=new te(this.__wrapped__);return e.__actions__=Je(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Je(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Je(this.__views__),e}function Ap(){if(this.__filtered__){var e=new te(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Ip(){var e=this.__wrapped__.value(),t=this.__dir__,s=Q(e),a=t<0,c=s?e.length:0,p=Md(0,c,this.__views__),d=p.start,h=p.end,y=h-d,E=a?h:d-1,S=this.__iteratees__,I=S.length,C=0,U=$e(y,this.__takeCount__);if(!s||!a&&c==y&&U==y)return nu(e,this.__actions__);var G=[];e:for(;y--&&C<U;){E+=t;for(var X=-1,V=e[E];++X<I;){var Z=S[X],ie=Z.iteratee,it=Z.type,Ve=ie(V);if(it==qi)V=Ve;else if(!Ve){if(it==Vi)continue e;break e}}G[C++]=V}return G}te.prototype=ti(gr.prototype),te.prototype.constructor=te;function Ln(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function bp(){this.__data__=Si?Si(null):{},this.size=0}function Np(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Op(e){var t=this.__data__;if(Si){var s=t[e];return s===w?i:s}return pe.call(t,e)?t[e]:i}function Rp(e){var t=this.__data__;return Si?t[e]!==i:pe.call(t,e)}function Cp(e,t){var s=this.__data__;return this.size+=this.has(e)?0:1,s[e]=Si&&t===i?w:t,this}Ln.prototype.clear=bp,Ln.prototype.delete=Np,Ln.prototype.get=Op,Ln.prototype.has=Rp,Ln.prototype.set=Cp;function Ut(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Lp(){this.__data__=[],this.size=0}function Fp(e){var t=this.__data__,s=mr(t,e);if(s<0)return!1;var a=t.length-1;return s==a?t.pop():cr.call(t,s,1),--this.size,!0}function Dp(e){var t=this.__data__,s=mr(t,e);return s<0?i:t[s][1]}function Pp(e){return mr(this.__data__,e)>-1}function kp(e,t){var s=this.__data__,a=mr(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Ut.prototype.clear=Lp,Ut.prototype.delete=Fp,Ut.prototype.get=Dp,Ut.prototype.has=Pp,Ut.prototype.set=kp;function Mt(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t<s;){var a=e[t];this.set(a[0],a[1])}}function Up(){this.size=0,this.__data__={hash:new Ln,map:new(wi||Ut),string:new Ln}}function Mp(e){var t=Nr(this,e).delete(e);return this.size-=t?1:0,t}function $p(e){return Nr(this,e).get(e)}function Bp(e){return Nr(this,e).has(e)}function jp(e,t){var s=Nr(this,e),a=s.size;return s.set(e,t),this.size+=s.size==a?0:1,this}Mt.prototype.clear=Up,Mt.prototype.delete=Mp,Mt.prototype.get=$p,Mt.prototype.has=Bp,Mt.prototype.set=jp;function Fn(e){var t=-1,s=e==null?0:e.length;for(this.__data__=new Mt;++t<s;)this.add(e[t])}function Wp(e){return this.__data__.set(e,w),this}function Gp(e){return this.__data__.has(e)}Fn.prototype.add=Fn.prototype.push=Wp,Fn.prototype.has=Gp;function St(e){var t=this.__data__=new Ut(e);this.size=t.size}function Vp(){this.__data__=new Ut,this.size=0}function qp(e){var t=this.__data__,s=t.delete(e);return this.size=t.size,s}function Jp(e){return this.__data__.get(e)}function zp(e){return this.__data__.has(e)}function Qp(e,t){var s=this.__data__;if(s instanceof Ut){var a=s.__data__;if(!wi||a.length<u-1)return a.push([e,t]),this.size=++s.size,this;s=this.__data__=new Mt(a)}return s.set(e,t),this.size=s.size,this}St.prototype.clear=Vp,St.prototype.delete=qp,St.prototype.get=Jp,St.prototype.has=zp,St.prototype.set=Qp;function Fo(e,t){var s=Q(e),a=!s&&Mn(e),c=!s&&!a&&dn(e),p=!s&&!a&&!c&&si(e),d=s||a||c||p,h=d?Ss(e.length,rp):[],y=h.length;for(var E in e)(t||pe.call(e,E))&&!(d&&(E=="length"||c&&(E=="offset"||E=="parent")||p&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||Wt(E,y)))&&h.push(E);return h}function Do(e){var t=e.length;return t?e[js(0,t-1)]:i}function Hp(e,t){return Or(Je(e),Dn(t,0,e.length))}function Yp(e){return Or(Je(e))}function Cs(e,t,s){(s!==i&&!At(e[t],s)||s===i&&!(t in e))&&$t(e,t,s)}function Ii(e,t,s){var a=e[t];(!(pe.call(e,t)&&At(a,s))||s===i&&!(t in e))&&$t(e,t,s)}function mr(e,t){for(var s=e.length;s--;)if(At(e[s][0],t))return s;return-1}function Xp(e,t,s,a){return cn(e,function(c,p,d){t(a,c,s(c),d)}),a}function Po(e,t){return e&&Ft(t,Pe(t),e)}function Kp(e,t){return e&&Ft(t,Qe(t),e)}function $t(e,t,s){t=="__proto__"&&lr?lr(e,t,{configurable:!0,enumerable:!0,value:s,writable:!0}):e[t]=s}function Ls(e,t){for(var s=-1,a=t.length,c=_(a),p=e==null;++s<a;)c[s]=p?i:pa(e,t[s]);return c}function Dn(e,t,s){return e===e&&(s!==i&&(e=e<=s?e:s),t!==i&&(e=e>=t?e:t)),e}function lt(e,t,s,a,c,p){var d,h=t&D,y=t&P,E=t&M;if(s&&(d=c?s(e,a,c,p):s(e)),d!==i)return d;if(!Ae(e))return e;var S=Q(e);if(S){if(d=Bd(e),!h)return Je(e,d)}else{var I=Be(e),C=I==qn||I==zi;if(dn(e))return su(e,h);if(I==wt||I==en||C&&!c){if(d=y||C?{}:Su(e),!h)return y?Od(e,Kp(d,e)):Nd(e,Po(d,e))}else{if(!_e[I])return c?e:{};d=jd(e,I,h)}}p||(p=new St);var U=p.get(e);if(U)return U;p.set(e,d),Zu(e)?e.forEach(function(V){d.add(lt(V,t,s,V,e,p))}):Xu(e)&&e.forEach(function(V,Z){d.set(Z,lt(V,t,s,Z,e,p))});var G=E?y?Ks:Xs:y?Qe:Pe,X=S?i:G(e);return ot(X||e,function(V,Z){X&&(Z=V,V=e[Z]),Ii(d,Z,lt(V,t,s,Z,e,p))}),d}function Zp(e){var t=Pe(e);return function(s){return ko(s,e,t)}}function ko(e,t,s){var a=s.length;if(e==null)return!a;for(e=ye(e);a--;){var c=s[a],p=t[c],d=e[c];if(d===i&&!(c in e)||!p(d))return!1}return!0}function Uo(e,t,s){if(typeof e!="function")throw new ut(g);return Fi(function(){e.apply(i,s)},t)}function bi(e,t,s,a){var c=-1,p=Zi,d=!0,h=e.length,y=[],E=t.length;if(!h)return y;s&&(t=Ee(t,et(s))),a?(p=vs,d=!1):t.length>=u&&(p=xi,d=!1,t=new Fn(t));e:for(;++c<h;){var S=e[c],I=s==null?S:s(S);if(S=a||S!==0?S:0,d&&I===I){for(var C=E;C--;)if(t[C]===I)continue e;y.push(S)}else p(t,I,a)||y.push(S)}return y}var cn=lu(Lt),Mo=lu(Ds,!0);function ed(e,t){var s=!0;return cn(e,function(a,c,p){return s=!!t(a,c,p),s}),s}function yr(e,t,s){for(var a=-1,c=e.length;++a<c;){var p=e[a],d=t(p);if(d!=null&&(h===i?d===d&&!nt(d):s(d,h)))var h=d,y=p}return y}function td(e,t,s,a){var c=e.length;for(s=Y(s),s<0&&(s=-s>c?0:c+s),a=a===i||a>c?c:Y(a),a<0&&(a+=c),a=s>a?0:tc(a);s<a;)e[s++]=t;return e}function $o(e,t){var s=[];return cn(e,function(a,c,p){t(a,c,p)&&s.push(a)}),s}function Me(e,t,s,a,c){var p=-1,d=e.length;for(s||(s=Gd),c||(c=[]);++p<d;){var h=e[p];t>0&&s(h)?t>1?Me(h,t-1,s,a,c):an(c,h):a||(c[c.length]=h)}return c}var Fs=fu(),Bo=fu(!0);function Lt(e,t){return e&&Fs(e,t,Pe)}function Ds(e,t){return e&&Bo(e,t,Pe)}function vr(e,t){return sn(t,function(s){return Gt(e[s])})}function Pn(e,t){t=fn(t,e);for(var s=0,a=t.length;e!=null&&s<a;)e=e[Dt(t[s++])];return s&&s==a?e:i}function jo(e,t,s){var a=t(e);return Q(e)?a:an(a,s(e))}function We(e){return e==null?e===i?rs:is:Cn&&Cn in ye(e)?Ud(e):Yd(e)}function Ps(e,t){return e>t}function nd(e,t){return e!=null&&pe.call(e,t)}function id(e,t){return e!=null&&t in ye(e)}function rd(e,t,s){return e>=$e(t,s)&&e<Fe(t,s)}function ks(e,t,s){for(var a=s?vs:Zi,c=e[0].length,p=e.length,d=p,h=_(p),y=1/0,E=[];d--;){var S=e[d];d&&t&&(S=Ee(S,et(t))),y=$e(S.length,y),h[d]=!s&&(t||c>=120&&S.length>=120)?new Fn(d&&S):i}S=e[0];var I=-1,C=h[0];e:for(;++I<c&&E.length<y;){var U=S[I],G=t?t(U):U;if(U=s||U!==0?U:0,!(C?xi(C,G):a(E,G,s))){for(d=p;--d;){var X=h[d];if(!(X?xi(X,G):a(e[d],G,s)))continue e}C&&C.push(G),E.push(U)}}return E}function sd(e,t,s,a){return Lt(e,function(c,p,d){t(a,s(c),p,d)}),a}function Ni(e,t,s){t=fn(t,e),e=Nu(e,t);var a=e==null?e:e[Dt(pt(t))];return a==null?i:Ze(a,e,s)}function Wo(e){return Ie(e)&&We(e)==en}function ad(e){return Ie(e)&&We(e)==Nn}function od(e){return Ie(e)&&We(e)==An}function Oi(e,t,s,a,c){return e===t?!0:e==null||t==null||!Ie(e)&&!Ie(t)?e!==e&&t!==t:ud(e,t,s,a,Oi,c)}function ud(e,t,s,a,c,p){var d=Q(e),h=Q(t),y=d?Gn:Be(e),E=h?Gn:Be(t);y=y==en?wt:y,E=E==en?wt:E;var S=y==wt,I=E==wt,C=y==E;if(C&&dn(e)){if(!dn(t))return!1;d=!0,S=!1}if(C&&!S)return p||(p=new St),d||si(e)?Tu(e,t,s,a,c,p):Pd(e,t,y,s,a,c,p);if(!(s&$)){var U=S&&pe.call(e,"__wrapped__"),G=I&&pe.call(t,"__wrapped__");if(U||G){var X=U?e.value():e,V=G?t.value():t;return p||(p=new St),c(X,V,s,a,p)}}return C?(p||(p=new St),kd(e,t,s,a,c,p)):!1}function cd(e){return Ie(e)&&Be(e)==Xe}function Us(e,t,s,a){var c=s.length,p=c,d=!a;if(e==null)return!p;for(e=ye(e);c--;){var h=s[c];if(d&&h[2]?h[1]!==e[h[0]]:!(h[0]in e))return!1}for(;++c<p;){h=s[c];var y=h[0],E=e[y],S=h[1];if(d&&h[2]){if(E===i&&!(y in e))return!1}else{var I=new St;if(a)var C=a(E,S,y,e,t,I);if(!(C===i?Oi(S,E,$|he,a,I):C))return!1}}return!0}function Go(e){if(!Ae(e)||qd(e))return!1;var t=Gt(e)?cp:Kl;return t.test(Un(e))}function ld(e){return Ie(e)&&We(e)==tn}function fd(e){return Ie(e)&&Be(e)==Ke}function pd(e){return Ie(e)&&Pr(e.length)&&!!Te[We(e)]}function Vo(e){return typeof e=="function"?e:e==null?He:typeof e=="object"?Q(e)?zo(e[0],e[1]):Jo(e):pc(e)}function Ms(e){if(!Li(e))return gp(e);var t=[];for(var s in ye(e))pe.call(e,s)&&s!="constructor"&&t.push(s);return t}function dd(e){if(!Ae(e))return Hd(e);var t=Li(e),s=[];for(var a in e)a=="constructor"&&(t||!pe.call(e,a))||s.push(a);return s}function $s(e,t){return e<t}function qo(e,t){var s=-1,a=ze(e)?_(e.length):[];return cn(e,function(c,p,d){a[++s]=t(c,p,d)}),a}function Jo(e){var t=ea(e);return t.length==1&&t[0][2]?Iu(t[0][0],t[0][1]):function(s){return s===e||Us(s,e,t)}}function zo(e,t){return na(e)&&Au(t)?Iu(Dt(e),t):function(s){var a=pa(s,e);return a===i&&a===t?da(s,e):Oi(t,a,$|he)}}function _r(e,t,s,a,c){e!==t&&Fs(t,function(p,d){if(c||(c=new St),Ae(p))hd(e,t,d,s,_r,a,c);else{var h=a?a(ra(e,d),p,d+"",e,t,c):i;h===i&&(h=p),Cs(e,d,h)}},Qe)}function hd(e,t,s,a,c,p,d){var h=ra(e,s),y=ra(t,s),E=d.get(y);if(E){Cs(e,s,E);return}var S=p?p(h,y,s+"",e,t,d):i,I=S===i;if(I){var C=Q(y),U=!C&&dn(y),G=!C&&!U&&si(y);S=y,C||U||G?Q(h)?S=h:be(h)?S=Je(h):U?(I=!1,S=su(y,!0)):G?(I=!1,S=au(y,!0)):S=[]:Di(y)||Mn(y)?(S=h,Mn(h)?S=nc(h):(!Ae(h)||Gt(h))&&(S=Su(y))):I=!1}I&&(d.set(y,S),c(S,y,a,p,d),d.delete(y)),Cs(e,s,S)}function Qo(e,t){var s=e.length;if(s)return t+=t<0?s:0,Wt(t,s)?e[t]:i}function Ho(e,t,s){t.length?t=Ee(t,function(p){return Q(p)?function(d){return Pn(d,p.length===1?p[0]:p)}:p}):t=[He];var a=-1;t=Ee(t,et(j()));var c=qo(e,function(p,d,h){var y=Ee(t,function(E){return E(p)});return{criteria:y,index:++a,value:p}});return jf(c,function(p,d){return bd(p,d,s)})}function gd(e,t){return Yo(e,t,function(s,a){return da(e,a)})}function Yo(e,t,s){for(var a=-1,c=t.length,p={};++a<c;){var d=t[a],h=Pn(e,d);s(h,d)&&Ri(p,fn(d,e),h)}return p}function md(e){return function(t){return Pn(t,e)}}function Bs(e,t,s,a){var c=a?Bf:Qn,p=-1,d=t.length,h=e;for(e===t&&(t=Je(t)),s&&(h=Ee(e,et(s)));++p<d;)for(var y=0,E=t[p],S=s?s(E):E;(y=c(h,S,y,a))>-1;)h!==e&&cr.call(h,y,1),cr.call(e,y,1);return e}function Xo(e,t){for(var s=e?t.length:0,a=s-1;s--;){var c=t[s];if(s==a||c!==p){var p=c;Wt(c)?cr.call(e,c,1):Vs(e,c)}}return e}function js(e,t){return e+pr(Co()*(t-e+1))}function yd(e,t,s,a){for(var c=-1,p=Fe(fr((t-e)/(s||1)),0),d=_(p);p--;)d[a?p:++c]=e,e+=s;return d}function Ws(e,t){var s="";if(!e||t<1||t>Tt)return s;do t%2&&(s+=e),t=pr(t/2),t&&(e+=e);while(t);return s}function K(e,t){return sa(bu(e,t,He),e+"")}function vd(e){return Do(ai(e))}function _d(e,t){var s=ai(e);return Or(s,Dn(t,0,s.length))}function Ri(e,t,s,a){if(!Ae(e))return e;t=fn(t,e);for(var c=-1,p=t.length,d=p-1,h=e;h!=null&&++c<p;){var y=Dt(t[c]),E=s;if(y==="__proto__"||y==="constructor"||y==="prototype")return e;if(c!=d){var S=h[y];E=a?a(S,y,h):i,E===i&&(E=Ae(S)?S:Wt(t[c+1])?[]:{})}Ii(h,y,E),h=h[y]}return e}var Ko=dr?function(e,t){return dr.set(e,t),e}:He,xd=lr?function(e,t){return lr(e,"toString",{configurable:!0,enumerable:!1,value:ga(t),writable:!0})}:He;function Td(e){return Or(ai(e))}function ft(e,t,s){var a=-1,c=e.length;t<0&&(t=-t>c?0:c+t),s=s>c?c:s,s<0&&(s+=c),c=t>s?0:s-t>>>0,t>>>=0;for(var p=_(c);++a<c;)p[a]=e[a+t];return p}function wd(e,t){var s;return cn(e,function(a,c,p){return s=t(a,c,p),!s}),!!s}function xr(e,t,s){var a=0,c=e==null?a:e.length;if(typeof t=="number"&&t===t&&c<=Zr){for(;a<c;){var p=a+c>>>1,d=e[p];d!==null&&!nt(d)&&(s?d<=t:d<t)?a=p+1:c=p}return c}return Gs(e,t,He,s)}function Gs(e,t,s,a){var c=0,p=e==null?0:e.length;if(p===0)return 0;t=s(t);for(var d=t!==t,h=t===null,y=nt(t),E=t===i;c<p;){var S=pr((c+p)/2),I=s(e[S]),C=I!==i,U=I===null,G=I===I,X=nt(I);if(d)var V=a||G;else E?V=G&&(a||C):h?V=G&&C&&(a||!U):y?V=G&&C&&!U&&(a||!X):U||X?V=!1:V=a?I<=t:I<t;V?c=S+1:p=S}return $e(p,Kr)}function Zo(e,t){for(var s=-1,a=e.length,c=0,p=[];++s<a;){var d=e[s],h=t?t(d):d;if(!s||!At(h,y)){var y=h;p[c++]=d===0?0:d}}return p}function eu(e){return typeof e=="number"?e:nt(e)?Wn:+e}function tt(e){if(typeof e=="string")return e;if(Q(e))return Ee(e,tt)+"";if(nt(e))return Lo?Lo.call(e):"";var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function ln(e,t,s){var a=-1,c=Zi,p=e.length,d=!0,h=[],y=h;if(s)d=!1,c=vs;else if(p>=u){var E=t?null:Fd(e);if(E)return tr(E);d=!1,c=xi,y=new Fn}else y=t?[]:h;e:for(;++a<p;){var S=e[a],I=t?t(S):S;if(S=s||S!==0?S:0,d&&I===I){for(var C=y.length;C--;)if(y[C]===I)continue e;t&&y.push(I),h.push(S)}else c(y,I,s)||(y!==h&&y.push(I),h.push(S))}return h}function Vs(e,t){return t=fn(t,e),e=Nu(e,t),e==null||delete e[Dt(pt(t))]}function tu(e,t,s,a){return Ri(e,t,s(Pn(e,t)),a)}function Tr(e,t,s,a){for(var c=e.length,p=a?c:-1;(a?p--:++p<c)&&t(e[p],p,e););return s?ft(e,a?0:p,a?p+1:c):ft(e,a?p+1:0,a?c:p)}function nu(e,t){var s=e;return s instanceof te&&(s=s.value()),_s(t,function(a,c){return c.func.apply(c.thisArg,an([a],c.args))},s)}function qs(e,t,s){var a=e.length;if(a<2)return a?ln(e[0]):[];for(var c=-1,p=_(a);++c<a;)for(var d=e[c],h=-1;++h<a;)h!=c&&(p[c]=bi(p[c]||d,e[h],t,s));return ln(Me(p,1),t,s)}function iu(e,t,s){for(var a=-1,c=e.length,p=t.length,d={};++a<c;){var h=a<p?t[a]:i;s(d,e[a],h)}return d}function Js(e){return be(e)?e:[]}function zs(e){return typeof e=="function"?e:He}function fn(e,t){return Q(e)?e:na(e,t)?[e]:Lu(le(e))}var Ed=K;function pn(e,t,s){var a=e.length;return s=s===i?a:s,!t&&s>=a?e:ft(e,t,s)}var ru=lp||function(e){return Ue.clearTimeout(e)};function su(e,t){if(t)return e.slice();var s=e.length,a=Io?Io(s):new e.constructor(s);return e.copy(a),a}function Qs(e){var t=new e.constructor(e.byteLength);return new or(t).set(new or(e)),t}function Sd(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Ad(e){var t=new e.constructor(e.source,ja.exec(e));return t.lastIndex=e.lastIndex,t}function Id(e){return Ai?ye(Ai.call(e)):{}}function au(e,t){var s=t?Qs(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function ou(e,t){if(e!==t){var s=e!==i,a=e===null,c=e===e,p=nt(e),d=t!==i,h=t===null,y=t===t,E=nt(t);if(!h&&!E&&!p&&e>t||p&&d&&y&&!h&&!E||a&&d&&y||!s&&y||!c)return 1;if(!a&&!p&&!E&&e<t||E&&s&&c&&!a&&!p||h&&s&&c||!d&&c||!y)return-1}return 0}function bd(e,t,s){for(var a=-1,c=e.criteria,p=t.criteria,d=c.length,h=s.length;++a<d;){var y=ou(c[a],p[a]);if(y){if(a>=h)return y;var E=s[a];return y*(E=="desc"?-1:1)}}return e.index-t.index}function uu(e,t,s,a){for(var c=-1,p=e.length,d=s.length,h=-1,y=t.length,E=Fe(p-d,0),S=_(y+E),I=!a;++h<y;)S[h]=t[h];for(;++c<d;)(I||c<p)&&(S[s[c]]=e[c]);for(;E--;)S[h++]=e[c++];return S}function cu(e,t,s,a){for(var c=-1,p=e.length,d=-1,h=s.length,y=-1,E=t.length,S=Fe(p-h,0),I=_(S+E),C=!a;++c<S;)I[c]=e[c];for(var U=c;++y<E;)I[U+y]=t[y];for(;++d<h;)(C||c<p)&&(I[U+s[d]]=e[c++]);return I}function Je(e,t){var s=-1,a=e.length;for(t||(t=_(a));++s<a;)t[s]=e[s];return t}function Ft(e,t,s,a){var c=!s;s||(s={});for(var p=-1,d=t.length;++p<d;){var h=t[p],y=a?a(s[h],e[h],h,s,e):i;y===i&&(y=e[h]),c?$t(s,h,y):Ii(s,h,y)}return s}function Nd(e,t){return Ft(e,ta(e),t)}function Od(e,t){return Ft(e,wu(e),t)}function wr(e,t){return function(s,a){var c=Q(s)?Df:Xp,p=t?t():{};return c(s,e,j(a,2),p)}}function ni(e){return K(function(t,s){var a=-1,c=s.length,p=c>1?s[c-1]:i,d=c>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(c--,p):i,d&&Ge(s[0],s[1],d)&&(p=c<3?i:p,c=1),t=ye(t);++a<c;){var h=s[a];h&&e(t,h,a,p)}return t})}function lu(e,t){return function(s,a){if(s==null)return s;if(!ze(s))return e(s,a);for(var c=s.length,p=t?c:-1,d=ye(s);(t?p--:++p<c)&&a(d[p],p,d)!==!1;);return s}}function fu(e){return function(t,s,a){for(var c=-1,p=ye(t),d=a(t),h=d.length;h--;){var y=d[e?h:++c];if(s(p[y],y,p)===!1)break}return t}}function Rd(e,t,s){var a=t&ae,c=Ci(e);function p(){var d=this&&this!==Ue&&this instanceof p?c:e;return d.apply(a?s:this,arguments)}return p}function pu(e){return function(t){t=le(t);var s=Hn(t)?Et(t):i,a=s?s[0]:t.charAt(0),c=s?pn(s,1).join(""):t.slice(1);return a[e]()+c}}function ii(e){return function(t){return _s(lc(cc(t).replace(xf,"")),e,"")}}function Ci(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var s=ti(e.prototype),a=e.apply(s,t);return Ae(a)?a:s}}function Cd(e,t,s){var a=Ci(e);function c(){for(var p=arguments.length,d=_(p),h=p,y=ri(c);h--;)d[h]=arguments[h];var E=p<3&&d[0]!==y&&d[p-1]!==y?[]:on(d,y);if(p-=E.length,p<s)return yu(e,t,Er,c.placeholder,i,d,E,i,i,s-p);var S=this&&this!==Ue&&this instanceof c?a:e;return Ze(S,this,d)}return c}function du(e){return function(t,s,a){var c=ye(t);if(!ze(t)){var p=j(s,3);t=Pe(t),s=function(h){return p(c[h],h,c)}}var d=e(t,s,a);return d>-1?c[p?t[d]:d]:i}}function hu(e){return jt(function(t){var s=t.length,a=s,c=ct.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new ut(g);if(c&&!d&&br(p)=="wrapper")var d=new ct([],!0)}for(a=d?a:s;++a<s;){p=t[a];var h=br(p),y=h=="wrapper"?Zs(p):i;y&&ia(y[0])&&y[1]==(ce|xe|ee|qe)&&!y[4].length&&y[9]==1?d=d[br(y[0])].apply(d,y[3]):d=p.length==1&&ia(p)?d[h]():d.thru(p)}return function(){var E=arguments,S=E[0];if(d&&E.length==1&&Q(S))return d.plant(S).value();for(var I=0,C=s?t[I].apply(this,E):S;++I<s;)C=t[I].call(this,C);return C}})}function Er(e,t,s,a,c,p,d,h,y,E){var S=t&ce,I=t&ae,C=t&me,U=t&(xe|L),G=t&x,X=C?i:Ci(e);function V(){for(var Z=arguments.length,ie=_(Z),it=Z;it--;)ie[it]=arguments[it];if(U)var Ve=ri(V),rt=Gf(ie,Ve);if(a&&(ie=uu(ie,a,c,U)),p&&(ie=cu(ie,p,d,U)),Z-=rt,U&&Z<E){var Ne=on(ie,Ve);return yu(e,t,Er,V.placeholder,s,ie,Ne,h,y,E-Z)}var It=I?s:this,qt=C?It[e]:e;return Z=ie.length,h?ie=Xd(ie,h):G&&Z>1&&ie.reverse(),S&&y<Z&&(ie.length=y),this&&this!==Ue&&this instanceof V&&(qt=X||Ci(qt)),qt.apply(It,ie)}return V}function gu(e,t){return function(s,a){return sd(s,e,t(a),{})}}function Sr(e,t){return function(s,a){var c;if(s===i&&a===i)return t;if(s!==i&&(c=s),a!==i){if(c===i)return a;typeof s=="string"||typeof a=="string"?(s=tt(s),a=tt(a)):(s=eu(s),a=eu(a)),c=e(s,a)}return c}}function Hs(e){return jt(function(t){return t=Ee(t,et(j())),K(function(s){var a=this;return e(t,function(c){return Ze(c,a,s)})})})}function Ar(e,t){t=t===i?" ":tt(t);var s=t.length;if(s<2)return s?Ws(t,e):t;var a=Ws(t,fr(e/Yn(t)));return Hn(t)?pn(Et(a),0,e).join(""):a.slice(0,e)}function Ld(e,t,s,a){var c=t&ae,p=Ci(e);function d(){for(var h=-1,y=arguments.length,E=-1,S=a.length,I=_(S+y),C=this&&this!==Ue&&this instanceof d?p:e;++E<S;)I[E]=a[E];for(;y--;)I[E++]=arguments[++h];return Ze(C,c?s:this,I)}return d}function mu(e){return function(t,s,a){return a&&typeof a!="number"&&Ge(t,s,a)&&(s=a=i),t=Vt(t),s===i?(s=t,t=0):s=Vt(s),a=a===i?t<s?1:-1:Vt(a),yd(t,s,a,e)}}function Ir(e){return function(t,s){return typeof t=="string"&&typeof s=="string"||(t=dt(t),s=dt(s)),e(t,s)}}function yu(e,t,s,a,c,p,d,h,y,E){var S=t&xe,I=S?d:i,C=S?i:d,U=S?p:i,G=S?i:p;t|=S?ee:H,t&=~(S?H:ee),t&Ye||(t&=-4);var X=[e,t,c,U,I,G,C,h,y,E],V=s.apply(i,X);return ia(e)&&Ou(V,X),V.placeholder=a,Ru(V,e,t)}function Ys(e){var t=Le[e];return function(s,a){if(s=dt(s),a=a==null?0:$e(Y(a),292),a&&Ro(s)){var c=(le(s)+"e").split("e"),p=t(c[0]+"e"+(+c[1]+a));return c=(le(p)+"e").split("e"),+(c[0]+"e"+(+c[1]-a))}return t(s)}}var Fd=Zn&&1/tr(new Zn([,-0]))[1]==Rt?function(e){return new Zn(e)}:va;function vu(e){return function(t){var s=Be(t);return s==Xe?Is(t):s==Ke?Yf(t):Wf(t,e(t))}}function Bt(e,t,s,a,c,p,d,h){var y=t&me;if(!y&&typeof e!="function")throw new ut(g);var E=a?a.length:0;if(E||(t&=-97,a=c=i),d=d===i?d:Fe(Y(d),0),h=h===i?h:Y(h),E-=c?c.length:0,t&H){var S=a,I=c;a=c=i}var C=y?i:Zs(e),U=[e,t,s,a,c,S,I,p,d,h];if(C&&Qd(U,C),e=U[0],t=U[1],s=U[2],a=U[3],c=U[4],h=U[9]=U[9]===i?y?0:e.length:Fe(U[9]-E,0),!h&&t&(xe|L)&&(t&=-25),!t||t==ae)var G=Rd(e,t,s);else t==xe||t==L?G=Cd(e,t,h):(t==ee||t==(ae|ee))&&!c.length?G=Ld(e,t,s,a):G=Er.apply(i,U);var X=C?Ko:Ou;return Ru(X(G,U),e,t)}function _u(e,t,s,a){return e===i||At(e,Kn[s])&&!pe.call(a,s)?t:e}function xu(e,t,s,a,c,p){return Ae(e)&&Ae(t)&&(p.set(t,e),_r(e,t,i,xu,p),p.delete(t)),e}function Dd(e){return Di(e)?i:e}function Tu(e,t,s,a,c,p){var d=s&$,h=e.length,y=t.length;if(h!=y&&!(d&&y>h))return!1;var E=p.get(e),S=p.get(t);if(E&&S)return E==t&&S==e;var I=-1,C=!0,U=s&he?new Fn:i;for(p.set(e,t),p.set(t,e);++I<h;){var G=e[I],X=t[I];if(a)var V=d?a(X,G,I,t,e,p):a(G,X,I,e,t,p);if(V!==i){if(V)continue;C=!1;break}if(U){if(!xs(t,function(Z,ie){if(!xi(U,ie)&&(G===Z||c(G,Z,s,a,p)))return U.push(ie)})){C=!1;break}}else if(!(G===X||c(G,X,s,a,p))){C=!1;break}}return p.delete(e),p.delete(t),C}function Pd(e,t,s,a,c,p,d){switch(s){case rn:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Nn:return!(e.byteLength!=t.byteLength||!p(new or(e),new or(t)));case Sn:case An:case In:return At(+e,+t);case Vn:return e.name==t.name&&e.message==t.message;case tn:case bn:return e==t+"";case Xe:var h=Is;case Ke:var y=a&$;if(h||(h=tr),e.size!=t.size&&!y)return!1;var E=d.get(e);if(E)return E==t;a|=he,d.set(e,t);var S=Tu(h(e),h(t),a,c,p,d);return d.delete(e),S;case Jn:if(Ai)return Ai.call(e)==Ai.call(t)}return!1}function kd(e,t,s,a,c,p){var d=s&$,h=Xs(e),y=h.length,E=Xs(t),S=E.length;if(y!=S&&!d)return!1;for(var I=y;I--;){var C=h[I];if(!(d?C in t:pe.call(t,C)))return!1}var U=p.get(e),G=p.get(t);if(U&&G)return U==t&&G==e;var X=!0;p.set(e,t),p.set(t,e);for(var V=d;++I<y;){C=h[I];var Z=e[C],ie=t[C];if(a)var it=d?a(ie,Z,C,t,e,p):a(Z,ie,C,e,t,p);if(!(it===i?Z===ie||c(Z,ie,s,a,p):it)){X=!1;break}V||(V=C=="constructor")}if(X&&!V){var Ve=e.constructor,rt=t.constructor;Ve!=rt&&"constructor"in e&&"constructor"in t&&!(typeof Ve=="function"&&Ve instanceof Ve&&typeof rt=="function"&&rt instanceof rt)&&(X=!1)}return p.delete(e),p.delete(t),X}function jt(e){return sa(bu(e,i,ku),e+"")}function Xs(e){return jo(e,Pe,ta)}function Ks(e){return jo(e,Qe,wu)}var Zs=dr?function(e){return dr.get(e)}:va;function br(e){for(var t=e.name+"",s=ei[t],a=pe.call(ei,t)?s.length:0;a--;){var c=s[a],p=c.func;if(p==null||p==e)return c.name}return t}function ri(e){var t=pe.call(l,"placeholder")?l:e;return t.placeholder}function j(){var e=l.iteratee||ma;return e=e===ma?Vo:e,arguments.length?e(arguments[0],arguments[1]):e}function Nr(e,t){var s=e.__data__;return Vd(t)?s[typeof t=="string"?"string":"hash"]:s.map}function ea(e){for(var t=Pe(e),s=t.length;s--;){var a=t[s],c=e[a];t[s]=[a,c,Au(c)]}return t}function kn(e,t){var s=zf(e,t);return Go(s)?s:i}function Ud(e){var t=pe.call(e,Cn),s=e[Cn];try{e[Cn]=i;var a=!0}catch{}var c=sr.call(e);return a&&(t?e[Cn]=s:delete e[Cn]),c}var ta=Ns?function(e){return e==null?[]:(e=ye(e),sn(Ns(e),function(t){return No.call(e,t)}))}:_a,wu=Ns?function(e){for(var t=[];e;)an(t,ta(e)),e=ur(e);return t}:_a,Be=We;(Os&&Be(new Os(new ArrayBuffer(1)))!=rn||wi&&Be(new wi)!=Xe||Rs&&Be(Rs.resolve())!=vi||Zn&&Be(new Zn)!=Ke||Ei&&Be(new Ei)!=nn)&&(Be=function(e){var t=We(e),s=t==wt?e.constructor:i,a=s?Un(s):"";if(a)switch(a){case _p:return rn;case xp:return Xe;case Tp:return vi;case wp:return Ke;case Ep:return nn}return t});function Md(e,t,s){for(var a=-1,c=s.length;++a<c;){var p=s[a],d=p.size;switch(p.type){case"drop":e+=d;break;case"dropRight":t-=d;break;case"take":t=$e(t,e+d);break;case"takeRight":e=Fe(e,t-d);break}}return{start:e,end:t}}function $d(e){var t=e.match(Vl);return t?t[1].split(ql):[]}function Eu(e,t,s){t=fn(t,e);for(var a=-1,c=t.length,p=!1;++a<c;){var d=Dt(t[a]);if(!(p=e!=null&&s(e,d)))break;e=e[d]}return p||++a!=c?p:(c=e==null?0:e.length,!!c&&Pr(c)&&Wt(d,c)&&(Q(e)||Mn(e)))}function Bd(e){var t=e.length,s=new e.constructor(t);return t&&typeof e[0]=="string"&&pe.call(e,"index")&&(s.index=e.index,s.input=e.input),s}function Su(e){return typeof e.constructor=="function"&&!Li(e)?ti(ur(e)):{}}function jd(e,t,s){var a=e.constructor;switch(t){case Nn:return Qs(e);case Sn:case An:return new a(+e);case rn:return Sd(e,s);case W:case Ce:case Ct:case Hi:case On:case _i:case as:case os:case us:return au(e,s);case Xe:return new a;case In:case bn:return new a(e);case tn:return Ad(e);case Ke:return new a;case Jn:return Id(e)}}function Wd(e,t){var s=t.length;if(!s)return e;var a=s-1;return t[a]=(s>1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(Gl,`{
382
+ /* [wrapped with `+t+`] */
383
+ `)}function Gd(e){return Q(e)||Mn(e)||!!(Oo&&e&&e[Oo])}function Wt(e,t){var s=typeof e;return t=t??Tt,!!t&&(s=="number"||s!="symbol"&&ef.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e,t,s){if(!Ae(s))return!1;var a=typeof t;return(a=="number"?ze(s)&&Wt(t,s.length):a=="string"&&t in s)?At(s[t],e):!1}function na(e,t){if(Q(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||nt(e)?!0:$l.test(e)||!Ml.test(e)||t!=null&&e in ye(t)}function Vd(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function ia(e){var t=br(e),s=l[t];if(typeof s!="function"||!(t in te.prototype))return!1;if(e===s)return!0;var a=Zs(s);return!!a&&e===a[0]}function qd(e){return!!Ao&&Ao in e}var Jd=ir?Gt:xa;function Li(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Kn;return e===s}function Au(e){return e===e&&!Ae(e)}function Iu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==i||e in ye(s))}}function zd(e){var t=Fr(e,function(a){return s.size===b&&s.clear(),a}),s=t.cache;return t}function Qd(e,t){var s=e[1],a=t[1],c=s|a,p=c<(ae|me|ce),d=a==ce&&s==xe||a==ce&&s==qe&&e[7].length<=t[8]||a==(ce|qe)&&t[7].length<=t[8]&&s==xe;if(!(p||d))return e;a&ae&&(e[2]=t[2],c|=s&ae?0:Ye);var h=t[3];if(h){var y=e[3];e[3]=y?uu(y,h,t[4]):h,e[4]=y?on(e[3],O):t[4]}return h=t[5],h&&(y=e[5],e[5]=y?cu(y,h,t[6]):h,e[6]=y?on(e[5],O):t[6]),h=t[7],h&&(e[7]=h),a&ce&&(e[8]=e[8]==null?t[8]:$e(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=c,e}function Hd(e){var t=[];if(e!=null)for(var s in ye(e))t.push(s);return t}function Yd(e){return sr.call(e)}function bu(e,t,s){return t=Fe(t===i?e.length-1:t,0),function(){for(var a=arguments,c=-1,p=Fe(a.length-t,0),d=_(p);++c<p;)d[c]=a[t+c];c=-1;for(var h=_(t+1);++c<t;)h[c]=a[c];return h[t]=s(d),Ze(e,this,h)}}function Nu(e,t){return t.length<2?e:Pn(e,ft(t,0,-1))}function Xd(e,t){for(var s=e.length,a=$e(t.length,s),c=Je(e);a--;){var p=t[a];e[a]=Wt(p,s)?c[p]:i}return e}function ra(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ou=Cu(Ko),Fi=pp||function(e,t){return Ue.setTimeout(e,t)},sa=Cu(xd);function Ru(e,t,s){var a=t+"";return sa(e,Wd(a,Kd($d(a),s)))}function Cu(e){var t=0,s=0;return function(){var a=mp(),c=Zt-(a-s);if(s=a,c>0){if(++t>=xt)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Or(e,t){var s=-1,a=e.length,c=a-1;for(t=t===i?a:t;++s<t;){var p=js(s,c),d=e[p];e[p]=e[s],e[s]=d}return e.length=t,e}var Lu=zd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Bl,function(s,a,c,p){t.push(c?p.replace(Ql,"$1"):a||s)}),t});function Dt(e){if(typeof e=="string"||nt(e))return e;var t=e+"";return t=="0"&&1/e==-Rt?"-0":t}function Un(e){if(e!=null){try{return rr.call(e)}catch{}try{return e+""}catch{}}return""}function Kd(e,t){return ot(es,function(s){var a="_."+s[0];t&s[1]&&!Zi(e,a)&&e.push(a)}),e.sort()}function Fu(e){if(e instanceof te)return e.clone();var t=new ct(e.__wrapped__,e.__chain__);return t.__actions__=Je(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Zd(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Fe(Y(t),0);var a=e==null?0:e.length;if(!a||t<1)return[];for(var c=0,p=0,d=_(fr(a/t));c<a;)d[p++]=ft(e,c,c+=t);return d}function eh(e){for(var t=-1,s=e==null?0:e.length,a=0,c=[];++t<s;){var p=e[t];p&&(c[a++]=p)}return c}function th(){var e=arguments.length;if(!e)return[];for(var t=_(e-1),s=arguments[0],a=e;a--;)t[a-1]=arguments[a];return an(Q(s)?Je(s):[s],Me(t,1))}var nh=K(function(e,t){return be(e)?bi(e,Me(t,1,be,!0)):[]}),ih=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),j(s,2)):[]}),rh=K(function(e,t){var s=pt(t);return be(s)&&(s=i),be(e)?bi(e,Me(t,1,be,!0),i,s):[]});function sh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),ft(e,t<0?0:t,a)):[]}function ah(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,0,t<0?0:t)):[]}function oh(e,t){return e&&e.length?Tr(e,j(t,3),!0,!0):[]}function uh(e,t){return e&&e.length?Tr(e,j(t,3),!0):[]}function ch(e,t,s,a){var c=e==null?0:e.length;return c?(s&&typeof s!="number"&&Ge(e,t,s)&&(s=0,a=c),td(e,t,s,a)):[]}function Du(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),er(e,j(t,3),c)}function Pu(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a-1;return s!==i&&(c=Y(s),c=s<0?Fe(a+c,0):$e(c,a-1)),er(e,j(t,3),c,!0)}function ku(e){var t=e==null?0:e.length;return t?Me(e,1):[]}function lh(e){var t=e==null?0:e.length;return t?Me(e,Rt):[]}function fh(e,t){var s=e==null?0:e.length;return s?(t=t===i?1:Y(t),Me(e,t)):[]}function ph(e){for(var t=-1,s=e==null?0:e.length,a={};++t<s;){var c=e[t];a[c[0]]=c[1]}return a}function Uu(e){return e&&e.length?e[0]:i}function dh(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=s==null?0:Y(s);return c<0&&(c=Fe(a+c,0)),Qn(e,t,c)}function hh(e){var t=e==null?0:e.length;return t?ft(e,0,-1):[]}var gh=K(function(e){var t=Ee(e,Js);return t.length&&t[0]===e[0]?ks(t):[]}),mh=K(function(e){var t=pt(e),s=Ee(e,Js);return t===pt(s)?t=i:s.pop(),s.length&&s[0]===e[0]?ks(s,j(t,2)):[]}),yh=K(function(e){var t=pt(e),s=Ee(e,Js);return t=typeof t=="function"?t:i,t&&s.pop(),s.length&&s[0]===e[0]?ks(s,i,t):[]});function vh(e,t){return e==null?"":hp.call(e,t)}function pt(e){var t=e==null?0:e.length;return t?e[t-1]:i}function _h(e,t,s){var a=e==null?0:e.length;if(!a)return-1;var c=a;return s!==i&&(c=Y(s),c=c<0?Fe(a+c,0):$e(c,a-1)),t===t?Kf(e,t,c):er(e,yo,c,!0)}function xh(e,t){return e&&e.length?Qo(e,Y(t)):i}var Th=K(Mu);function Mu(e,t){return e&&e.length&&t&&t.length?Bs(e,t):e}function wh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,j(s,2)):e}function Eh(e,t,s){return e&&e.length&&t&&t.length?Bs(e,t,i,s):e}var Sh=jt(function(e,t){var s=e==null?0:e.length,a=Ls(e,t);return Xo(e,Ee(t,function(c){return Wt(c,s)?+c:c}).sort(ou)),a});function Ah(e,t){var s=[];if(!(e&&e.length))return s;var a=-1,c=[],p=e.length;for(t=j(t,3);++a<p;){var d=e[a];t(d,a,e)&&(s.push(d),c.push(a))}return Xo(e,c),s}function aa(e){return e==null?e:vp.call(e)}function Ih(e,t,s){var a=e==null?0:e.length;return a?(s&&typeof s!="number"&&Ge(e,t,s)?(t=0,s=a):(t=t==null?0:Y(t),s=s===i?a:Y(s)),ft(e,t,s)):[]}function bh(e,t){return xr(e,t)}function Nh(e,t,s){return Gs(e,t,j(s,2))}function Oh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t);if(a<s&&At(e[a],t))return a}return-1}function Rh(e,t){return xr(e,t,!0)}function Ch(e,t,s){return Gs(e,t,j(s,2),!0)}function Lh(e,t){var s=e==null?0:e.length;if(s){var a=xr(e,t,!0)-1;if(At(e[a],t))return a}return-1}function Fh(e){return e&&e.length?Zo(e):[]}function Dh(e,t){return e&&e.length?Zo(e,j(t,2)):[]}function Ph(e){var t=e==null?0:e.length;return t?ft(e,1,t):[]}function kh(e,t,s){return e&&e.length?(t=s||t===i?1:Y(t),ft(e,0,t<0?0:t)):[]}function Uh(e,t,s){var a=e==null?0:e.length;return a?(t=s||t===i?1:Y(t),t=a-t,ft(e,t<0?0:t,a)):[]}function Mh(e,t){return e&&e.length?Tr(e,j(t,3),!1,!0):[]}function $h(e,t){return e&&e.length?Tr(e,j(t,3)):[]}var Bh=K(function(e){return ln(Me(e,1,be,!0))}),jh=K(function(e){var t=pt(e);return be(t)&&(t=i),ln(Me(e,1,be,!0),j(t,2))}),Wh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,ln(Me(e,1,be,!0),i,t)});function Gh(e){return e&&e.length?ln(e):[]}function Vh(e,t){return e&&e.length?ln(e,j(t,2)):[]}function qh(e,t){return t=typeof t=="function"?t:i,e&&e.length?ln(e,i,t):[]}function oa(e){if(!(e&&e.length))return[];var t=0;return e=sn(e,function(s){if(be(s))return t=Fe(s.length,t),!0}),Ss(t,function(s){return Ee(e,Ts(s))})}function $u(e,t){if(!(e&&e.length))return[];var s=oa(e);return t==null?s:Ee(s,function(a){return Ze(t,i,a)})}var Jh=K(function(e,t){return be(e)?bi(e,t):[]}),zh=K(function(e){return qs(sn(e,be))}),Qh=K(function(e){var t=pt(e);return be(t)&&(t=i),qs(sn(e,be),j(t,2))}),Hh=K(function(e){var t=pt(e);return t=typeof t=="function"?t:i,qs(sn(e,be),i,t)}),Yh=K(oa);function Xh(e,t){return iu(e||[],t||[],Ii)}function Kh(e,t){return iu(e||[],t||[],Ri)}var Zh=K(function(e){var t=e.length,s=t>1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,$u(e,s)});function Bu(e){var t=l(e);return t.__chain__=!0,t}function eg(e,t){return t(e),e}function Rr(e,t){return t(e)}var tg=jt(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,c=function(p){return Ls(p,e)};return t>1||this.__actions__.length||!(a instanceof te)||!Wt(s)?this.thru(c):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:Rr,args:[c],thisArg:i}),new ct(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function ng(){return Bu(this)}function ig(){return new ct(this.value(),this.__chain__)}function rg(){this.__values__===i&&(this.__values__=ec(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function sg(){return this}function ag(e){for(var t,s=this;s instanceof gr;){var a=Fu(s);a.__index__=0,a.__values__=i,t?c.__wrapped__=a:t=a;var c=a;s=s.__wrapped__}return c.__wrapped__=e,t}function og(){var e=this.__wrapped__;if(e instanceof te){var t=e;return this.__actions__.length&&(t=new te(this)),t=t.reverse(),t.__actions__.push({func:Rr,args:[aa],thisArg:i}),new ct(t,this.__chain__)}return this.thru(aa)}function ug(){return nu(this.__wrapped__,this.__actions__)}var cg=wr(function(e,t,s){pe.call(e,s)?++e[s]:$t(e,s,1)});function lg(e,t,s){var a=Q(e)?go:ed;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}function fg(e,t){var s=Q(e)?sn:$o;return s(e,j(t,3))}var pg=du(Du),dg=du(Pu);function hg(e,t){return Me(Cr(e,t),1)}function gg(e,t){return Me(Cr(e,t),Rt)}function mg(e,t,s){return s=s===i?1:Y(s),Me(Cr(e,t),s)}function ju(e,t){var s=Q(e)?ot:cn;return s(e,j(t,3))}function Wu(e,t){var s=Q(e)?Pf:Mo;return s(e,j(t,3))}var yg=wr(function(e,t,s){pe.call(e,s)?e[s].push(t):$t(e,s,[t])});function vg(e,t,s,a){e=ze(e)?e:ai(e),s=s&&!a?Y(s):0;var c=e.length;return s<0&&(s=Fe(c+s,0)),kr(e)?s<=c&&e.indexOf(t,s)>-1:!!c&&Qn(e,t,s)>-1}var _g=K(function(e,t,s){var a=-1,c=typeof t=="function",p=ze(e)?_(e.length):[];return cn(e,function(d){p[++a]=c?Ze(t,d,s):Ni(d,t,s)}),p}),xg=wr(function(e,t,s){$t(e,s,t)});function Cr(e,t){var s=Q(e)?Ee:qo;return s(e,j(t,3))}function Tg(e,t,s,a){return e==null?[]:(Q(t)||(t=t==null?[]:[t]),s=a?i:s,Q(s)||(s=s==null?[]:[s]),Ho(e,t,s))}var wg=wr(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Eg(e,t,s){var a=Q(e)?_s:_o,c=arguments.length<3;return a(e,j(t,4),s,c,cn)}function Sg(e,t,s){var a=Q(e)?kf:_o,c=arguments.length<3;return a(e,j(t,4),s,c,Mo)}function Ag(e,t){var s=Q(e)?sn:$o;return s(e,Dr(j(t,3)))}function Ig(e){var t=Q(e)?Do:vd;return t(e)}function bg(e,t,s){(s?Ge(e,t,s):t===i)?t=1:t=Y(t);var a=Q(e)?Hp:_d;return a(e,t)}function Ng(e){var t=Q(e)?Yp:Td;return t(e)}function Og(e){if(e==null)return 0;if(ze(e))return kr(e)?Yn(e):e.length;var t=Be(e);return t==Xe||t==Ke?e.size:Ms(e).length}function Rg(e,t,s){var a=Q(e)?xs:wd;return s&&Ge(e,t,s)&&(t=i),a(e,j(t,3))}var Cg=K(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Ge(e,t[0],t[1])?t=[]:s>2&&Ge(t[0],t[1],t[2])&&(t=[t[0]]),Ho(e,Me(t,1),[])}),Lr=fp||function(){return Ue.Date.now()};function Lg(e,t){if(typeof t!="function")throw new ut(g);return e=Y(e),function(){if(--e<1)return t.apply(this,arguments)}}function Gu(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Bt(e,ce,i,i,i,i,t)}function Vu(e,t){var s;if(typeof t!="function")throw new ut(g);return e=Y(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var ua=K(function(e,t,s){var a=ae;if(s.length){var c=on(s,ri(ua));a|=ee}return Bt(e,a,t,s,c)}),qu=K(function(e,t,s){var a=ae|me;if(s.length){var c=on(s,ri(qu));a|=ee}return Bt(t,a,e,s,c)});function Ju(e,t,s){t=s?i:t;var a=Bt(e,xe,i,i,i,i,i,t);return a.placeholder=Ju.placeholder,a}function zu(e,t,s){t=s?i:t;var a=Bt(e,L,i,i,i,i,i,t);return a.placeholder=zu.placeholder,a}function Qu(e,t,s){var a,c,p,d,h,y,E=0,S=!1,I=!1,C=!0;if(typeof e!="function")throw new ut(g);t=dt(t)||0,Ae(s)&&(S=!!s.leading,I="maxWait"in s,p=I?Fe(dt(s.maxWait)||0,t):p,C="trailing"in s?!!s.trailing:C);function U(Ne){var It=a,qt=c;return a=c=i,E=Ne,d=e.apply(qt,It),d}function G(Ne){return E=Ne,h=Fi(Z,t),S?U(Ne):d}function X(Ne){var It=Ne-y,qt=Ne-E,dc=t-It;return I?$e(dc,p-qt):dc}function V(Ne){var It=Ne-y,qt=Ne-E;return y===i||It>=t||It<0||I&&qt>=p}function Z(){var Ne=Lr();if(V(Ne))return ie(Ne);h=Fi(Z,X(Ne))}function ie(Ne){return h=i,C&&a?U(Ne):(a=c=i,d)}function it(){h!==i&&ru(h),E=0,a=y=c=h=i}function Ve(){return h===i?d:ie(Lr())}function rt(){var Ne=Lr(),It=V(Ne);if(a=arguments,c=this,y=Ne,It){if(h===i)return G(y);if(I)return ru(h),h=Fi(Z,t),U(y)}return h===i&&(h=Fi(Z,t)),d}return rt.cancel=it,rt.flush=Ve,rt}var Fg=K(function(e,t){return Uo(e,1,t)}),Dg=K(function(e,t,s){return Uo(e,dt(t)||0,s)});function Pg(e){return Bt(e,x)}function Fr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new ut(g);var s=function(){var a=arguments,c=t?t.apply(this,a):a[0],p=s.cache;if(p.has(c))return p.get(c);var d=e.apply(this,a);return s.cache=p.set(c,d)||p,d};return s.cache=new(Fr.Cache||Mt),s}Fr.Cache=Mt;function Dr(e){if(typeof e!="function")throw new ut(g);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function kg(e){return Vu(2,e)}var Ug=Ed(function(e,t){t=t.length==1&&Q(t[0])?Ee(t[0],et(j())):Ee(Me(t,1),et(j()));var s=t.length;return K(function(a){for(var c=-1,p=$e(a.length,s);++c<p;)a[c]=t[c].call(this,a[c]);return Ze(e,this,a)})}),ca=K(function(e,t){var s=on(t,ri(ca));return Bt(e,ee,i,t,s)}),Hu=K(function(e,t){var s=on(t,ri(Hu));return Bt(e,H,i,t,s)}),Mg=jt(function(e,t){return Bt(e,qe,i,i,i,t)});function $g(e,t){if(typeof e!="function")throw new ut(g);return t=t===i?t:Y(t),K(e,t)}function Bg(e,t){if(typeof e!="function")throw new ut(g);return t=t==null?0:Fe(Y(t),0),K(function(s){var a=s[t],c=pn(s,0,t);return a&&an(c,a),Ze(e,this,c)})}function jg(e,t,s){var a=!0,c=!0;if(typeof e!="function")throw new ut(g);return Ae(s)&&(a="leading"in s?!!s.leading:a,c="trailing"in s?!!s.trailing:c),Qu(e,t,{leading:a,maxWait:t,trailing:c})}function Wg(e){return Gu(e,1)}function Gg(e,t){return ca(zs(t),e)}function Vg(){if(!arguments.length)return[];var e=arguments[0];return Q(e)?e:[e]}function qg(e){return lt(e,M)}function Jg(e,t){return t=typeof t=="function"?t:i,lt(e,M,t)}function zg(e){return lt(e,D|M)}function Qg(e,t){return t=typeof t=="function"?t:i,lt(e,D|M,t)}function Hg(e,t){return t==null||ko(e,t,Pe(t))}function At(e,t){return e===t||e!==e&&t!==t}var Yg=Ir(Ps),Xg=Ir(function(e,t){return e>=t}),Mn=Wo(function(){return arguments}())?Wo:function(e){return Ie(e)&&pe.call(e,"callee")&&!No.call(e,"callee")},Q=_.isArray,Kg=uo?et(uo):ad;function ze(e){return e!=null&&Pr(e.length)&&!Gt(e)}function be(e){return Ie(e)&&ze(e)}function Zg(e){return e===!0||e===!1||Ie(e)&&We(e)==Sn}var dn=dp||xa,em=co?et(co):od;function tm(e){return Ie(e)&&e.nodeType===1&&!Di(e)}function nm(e){if(e==null)return!0;if(ze(e)&&(Q(e)||typeof e=="string"||typeof e.splice=="function"||dn(e)||si(e)||Mn(e)))return!e.length;var t=Be(e);if(t==Xe||t==Ke)return!e.size;if(Li(e))return!Ms(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function im(e,t){return Oi(e,t)}function rm(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Oi(e,t,i,s):!!a}function la(e){if(!Ie(e))return!1;var t=We(e);return t==Vn||t==ns||typeof e.message=="string"&&typeof e.name=="string"&&!Di(e)}function sm(e){return typeof e=="number"&&Ro(e)}function Gt(e){if(!Ae(e))return!1;var t=We(e);return t==qn||t==zi||t==ts||t==Qi}function Yu(e){return typeof e=="number"&&e==Y(e)}function Pr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Tt}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Xu=lo?et(lo):cd;function am(e,t){return e===t||Us(e,t,ea(t))}function om(e,t,s){return s=typeof s=="function"?s:i,Us(e,t,ea(t),s)}function um(e){return Ku(e)&&e!=+e}function cm(e){if(Jd(e))throw new z(f);return Go(e)}function lm(e){return e===null}function fm(e){return e==null}function Ku(e){return typeof e=="number"||Ie(e)&&We(e)==In}function Di(e){if(!Ie(e)||We(e)!=wt)return!1;var t=ur(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&rr.call(s)==op}var fa=fo?et(fo):ld;function pm(e){return Yu(e)&&e>=-Tt&&e<=Tt}var Zu=po?et(po):fd;function kr(e){return typeof e=="string"||!Q(e)&&Ie(e)&&We(e)==bn}function nt(e){return typeof e=="symbol"||Ie(e)&&We(e)==Jn}var si=ho?et(ho):pd;function dm(e){return e===i}function hm(e){return Ie(e)&&Be(e)==nn}function gm(e){return Ie(e)&&We(e)==ss}var mm=Ir($s),ym=Ir(function(e,t){return e<=t});function ec(e){if(!e)return[];if(ze(e))return kr(e)?Et(e):Je(e);if(Ti&&e[Ti])return Hf(e[Ti]());var t=Be(e),s=t==Xe?Is:t==Ke?tr:ai;return s(e)}function Vt(e){if(!e)return e===0?e:0;if(e=dt(e),e===Rt||e===-Rt){var t=e<0?-1:1;return t*Xr}return e===e?e:0}function Y(e){var t=Vt(e),s=t%1;return t===t?s?t-s:t:0}function tc(e){return e?Dn(Y(e),0,st):0}function dt(e){if(typeof e=="number")return e;if(nt(e))return Wn;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xo(e);var s=Xl.test(e);return s||Zl.test(e)?Lf(e.slice(2),s?2:8):Yl.test(e)?Wn:+e}function nc(e){return Ft(e,Qe(e))}function vm(e){return e?Dn(Y(e),-Tt,Tt):e===0?e:0}function le(e){return e==null?"":tt(e)}var _m=ni(function(e,t){if(Li(t)||ze(t)){Ft(t,Pe(t),e);return}for(var s in t)pe.call(t,s)&&Ii(e,s,t[s])}),ic=ni(function(e,t){Ft(t,Qe(t),e)}),Ur=ni(function(e,t,s,a){Ft(t,Qe(t),e,a)}),xm=ni(function(e,t,s,a){Ft(t,Pe(t),e,a)}),Tm=jt(Ls);function wm(e,t){var s=ti(e);return t==null?s:Po(s,t)}var Em=K(function(e,t){e=ye(e);var s=-1,a=t.length,c=a>2?t[2]:i;for(c&&Ge(t[0],t[1],c)&&(a=1);++s<a;)for(var p=t[s],d=Qe(p),h=-1,y=d.length;++h<y;){var E=d[h],S=e[E];(S===i||At(S,Kn[E])&&!pe.call(e,E))&&(e[E]=p[E])}return e}),Sm=K(function(e){return e.push(i,xu),Ze(rc,i,e)});function Am(e,t){return mo(e,j(t,3),Lt)}function Im(e,t){return mo(e,j(t,3),Ds)}function bm(e,t){return e==null?e:Fs(e,j(t,3),Qe)}function Nm(e,t){return e==null?e:Bo(e,j(t,3),Qe)}function Om(e,t){return e&&Lt(e,j(t,3))}function Rm(e,t){return e&&Ds(e,j(t,3))}function Cm(e){return e==null?[]:vr(e,Pe(e))}function Lm(e){return e==null?[]:vr(e,Qe(e))}function pa(e,t,s){var a=e==null?i:Pn(e,t);return a===i?s:a}function Fm(e,t){return e!=null&&Eu(e,t,nd)}function da(e,t){return e!=null&&Eu(e,t,id)}var Dm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),e[t]=s},ga(He)),Pm=gu(function(e,t,s){t!=null&&typeof t.toString!="function"&&(t=sr.call(t)),pe.call(e,t)?e[t].push(s):e[t]=[s]},j),km=K(Ni);function Pe(e){return ze(e)?Fo(e):Ms(e)}function Qe(e){return ze(e)?Fo(e,!0):dd(e)}function Um(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){$t(s,t(a,c,p),a)}),s}function Mm(e,t){var s={};return t=j(t,3),Lt(e,function(a,c,p){$t(s,c,t(a,c,p))}),s}var $m=ni(function(e,t,s){_r(e,t,s)}),rc=ni(function(e,t,s,a){_r(e,t,s,a)}),Bm=jt(function(e,t){var s={};if(e==null)return s;var a=!1;t=Ee(t,function(p){return p=fn(p,e),a||(a=p.length>1),p}),Ft(e,Ks(e),s),a&&(s=lt(s,D|P|M,Dd));for(var c=t.length;c--;)Vs(s,t[c]);return s});function jm(e,t){return sc(e,Dr(j(t)))}var Wm=jt(function(e,t){return e==null?{}:gd(e,t)});function sc(e,t){if(e==null)return{};var s=Ee(Ks(e),function(a){return[a]});return t=j(t),Yo(e,s,function(a,c){return t(a,c[0])})}function Gm(e,t,s){t=fn(t,e);var a=-1,c=t.length;for(c||(c=1,e=i);++a<c;){var p=e==null?i:e[Dt(t[a])];p===i&&(a=c,p=s),e=Gt(p)?p.call(e):p}return e}function Vm(e,t,s){return e==null?e:Ri(e,t,s)}function qm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:Ri(e,t,s,a)}var ac=vu(Pe),oc=vu(Qe);function Jm(e,t,s){var a=Q(e),c=a||dn(e)||si(e);if(t=j(t,4),s==null){var p=e&&e.constructor;c?s=a?new p:[]:Ae(e)?s=Gt(p)?ti(ur(e)):{}:s={}}return(c?ot:Lt)(e,function(d,h,y){return t(s,d,h,y)}),s}function zm(e,t){return e==null?!0:Vs(e,t)}function Qm(e,t,s){return e==null?e:tu(e,t,zs(s))}function Hm(e,t,s,a){return a=typeof a=="function"?a:i,e==null?e:tu(e,t,zs(s),a)}function ai(e){return e==null?[]:As(e,Pe(e))}function Ym(e){return e==null?[]:As(e,Qe(e))}function Xm(e,t,s){return s===i&&(s=t,t=i),s!==i&&(s=dt(s),s=s===s?s:0),t!==i&&(t=dt(t),t=t===t?t:0),Dn(dt(e),t,s)}function Km(e,t,s){return t=Vt(t),s===i?(s=t,t=0):s=Vt(s),e=dt(e),rd(e,t,s)}function Zm(e,t,s){if(s&&typeof s!="boolean"&&Ge(e,t,s)&&(t=s=i),s===i&&(typeof t=="boolean"?(s=t,t=i):typeof e=="boolean"&&(s=e,e=i)),e===i&&t===i?(e=0,t=1):(e=Vt(e),t===i?(t=e,e=0):t=Vt(t)),e>t){var a=e;e=t,t=a}if(s||e%1||t%1){var c=Co();return $e(e+c*(t-e+Cf("1e-"+((c+"").length-1))),t)}return js(e,t)}var e0=ii(function(e,t,s){return t=t.toLowerCase(),e+(s?uc(t):t)});function uc(e){return ha(le(e).toLowerCase())}function cc(e){return e=le(e),e&&e.replace(tf,Vf).replace(Tf,"")}function t0(e,t,s){e=le(e),t=tt(t);var a=e.length;s=s===i?a:Dn(Y(s),0,a);var c=s;return s-=t.length,s>=0&&e.slice(s,c)==t}function n0(e){return e=le(e),e&&Pl.test(e)?e.replace($a,qf):e}function i0(e){return e=le(e),e&&jl.test(e)?e.replace(cs,"\\$&"):e}var r0=ii(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),s0=ii(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),a0=pu("toLowerCase");function o0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;if(!t||a>=t)return e;var c=(t-a)/2;return Ar(pr(c),s)+e+Ar(fr(c),s)}function u0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?e+Ar(t-a,s):e}function c0(e,t,s){e=le(e),t=Y(t);var a=t?Yn(e):0;return t&&a<t?Ar(t-a,s)+e:e}function l0(e,t,s){return s||t==null?t=0:t&&(t=+t),yp(le(e).replace(ls,""),t||0)}function f0(e,t,s){return(s?Ge(e,t,s):t===i)?t=1:t=Y(t),Ws(le(e),t)}function p0(){var e=arguments,t=le(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var d0=ii(function(e,t,s){return e+(s?"_":"")+t.toLowerCase()});function h0(e,t,s){return s&&typeof s!="number"&&Ge(e,t,s)&&(t=s=i),s=s===i?st:s>>>0,s?(e=le(e),e&&(typeof t=="string"||t!=null&&!fa(t))&&(t=tt(t),!t&&Hn(e))?pn(Et(e),0,s):e.split(t,s)):[]}var g0=ii(function(e,t,s){return e+(s?" ":"")+ha(t)});function m0(e,t,s){return e=le(e),s=s==null?0:Dn(Y(s),0,e.length),t=tt(t),e.slice(s,s+t.length)==t}function y0(e,t,s){var a=l.templateSettings;s&&Ge(e,t,s)&&(t=i),e=le(e),t=Ur({},t,a,_u);var c=Ur({},t.imports,a.imports,_u),p=Pe(c),d=As(c,p),h,y,E=0,S=t.interpolate||Yi,I="__p += '",C=bs((t.escape||Yi).source+"|"+S.source+"|"+(S===Ba?Hl:Yi).source+"|"+(t.evaluate||Yi).source+"|$","g"),U="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++If+"]")+`
384
+ `;e.replace(C,function(V,Z,ie,it,Ve,rt){return ie||(ie=it),I+=e.slice(E,rt).replace(nf,Jf),Z&&(h=!0,I+=`' +
385
+ __e(`+Z+`) +
386
+ '`),Ve&&(y=!0,I+=`';
387
+ `+Ve+`;
388
+ __p += '`),ie&&(I+=`' +
389
+ ((__t = (`+ie+`)) == null ? '' : __t) +
390
+ '`),E=rt+V.length,V}),I+=`';
391
+ `;var G=pe.call(t,"variable")&&t.variable;if(!G)I=`with (obj) {
392
+ `+I+`
341
393
  }
394
+ `;else if(zl.test(G))throw new z(v);I=(y?I.replace(Cl,""):I).replace(Ll,"$1").replace(Fl,"$1;"),I="function("+(G||"obj")+`) {
395
+ `+(G?"":`obj || (obj = {});
396
+ `)+"var __t, __p = ''"+(h?", __e = _.escape":"")+(y?`, __j = Array.prototype.join;
397
+ function print() { __p += __j.call(arguments, '') }
398
+ `:`;
399
+ `)+I+`return __p
400
+ }`;var X=fc(function(){return oe(p,U+"return "+I).apply(i,d)});if(X.source=I,la(X))throw X;return X}function v0(e){return le(e).toLowerCase()}function _0(e){return le(e).toUpperCase()}function x0(e,t,s){if(e=le(e),e&&(s||t===i))return xo(e);if(!e||!(t=tt(t)))return e;var a=Et(e),c=Et(t),p=To(a,c),d=wo(a,c)+1;return pn(a,p,d).join("")}function T0(e,t,s){if(e=le(e),e&&(s||t===i))return e.slice(0,So(e)+1);if(!e||!(t=tt(t)))return e;var a=Et(e),c=wo(a,Et(t))+1;return pn(a,0,c).join("")}function w0(e,t,s){if(e=le(e),e&&(s||t===i))return e.replace(ls,"");if(!e||!(t=tt(t)))return e;var a=Et(e),c=To(a,Et(t));return pn(a,c).join("")}function E0(e,t){var s=q,a=Se;if(Ae(t)){var c="separator"in t?t.separator:c;s="length"in t?Y(t.length):s,a="omission"in t?tt(t.omission):a}e=le(e);var p=e.length;if(Hn(e)){var d=Et(e);p=d.length}if(s>=p)return e;var h=s-Yn(a);if(h<1)return a;var y=d?pn(d,0,h).join(""):e.slice(0,h);if(c===i)return y+a;if(d&&(h+=y.length-h),fa(c)){if(e.slice(h).search(c)){var E,S=y;for(c.global||(c=bs(c.source,le(ja.exec(c))+"g")),c.lastIndex=0;E=c.exec(S);)var I=E.index;y=y.slice(0,I===i?h:I)}}else if(e.indexOf(tt(c),h)!=h){var C=y.lastIndexOf(c);C>-1&&(y=y.slice(0,C))}return y+a}function S0(e){return e=le(e),e&&Dl.test(e)?e.replace(Ma,Zf):e}var A0=ii(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),ha=pu("toUpperCase");function lc(e,t,s){return e=le(e),t=s?i:t,t===i?Qf(e)?np(e):$f(e):e.match(t)||[]}var fc=K(function(e,t){try{return Ze(e,i,t)}catch(s){return la(s)?s:new z(s)}}),I0=jt(function(e,t){return ot(t,function(s){s=Dt(s),$t(e,s,ua(e[s],e))}),e});function b0(e){var t=e==null?0:e.length,s=j();return e=t?Ee(e,function(a){if(typeof a[1]!="function")throw new ut(g);return[s(a[0]),a[1]]}):[],K(function(a){for(var c=-1;++c<t;){var p=e[c];if(Ze(p[0],this,a))return Ze(p[1],this,a)}})}function N0(e){return Zp(lt(e,D))}function ga(e){return function(){return e}}function O0(e,t){return e==null||e!==e?t:e}var R0=hu(),C0=hu(!0);function He(e){return e}function ma(e){return Vo(typeof e=="function"?e:lt(e,D))}function L0(e){return Jo(lt(e,D))}function F0(e,t){return zo(e,lt(t,D))}var D0=K(function(e,t){return function(s){return Ni(s,e,t)}}),P0=K(function(e,t){return function(s){return Ni(e,s,t)}});function ya(e,t,s){var a=Pe(t),c=vr(t,a);s==null&&!(Ae(t)&&(c.length||!a.length))&&(s=t,t=e,e=this,c=vr(t,Pe(t)));var p=!(Ae(s)&&"chain"in s)||!!s.chain,d=Gt(e);return ot(c,function(h){var y=t[h];e[h]=y,d&&(e.prototype[h]=function(){var E=this.__chain__;if(p||E){var S=e(this.__wrapped__),I=S.__actions__=Je(this.__actions__);return I.push({func:y,args:arguments,thisArg:e}),S.__chain__=E,S}return y.apply(e,an([this.value()],arguments))})}),e}function k0(){return Ue._===this&&(Ue._=up),this}function va(){}function U0(e){return e=Y(e),K(function(t){return Qo(t,e)})}var M0=Hs(Ee),$0=Hs(go),B0=Hs(xs);function pc(e){return na(e)?Ts(Dt(e)):md(e)}function j0(e){return function(t){return e==null?i:Pn(e,t)}}var W0=mu(),G0=mu(!0);function _a(){return[]}function xa(){return!1}function V0(){return{}}function q0(){return""}function J0(){return!0}function z0(e,t){if(e=Y(e),e<1||e>Tt)return[];var s=st,a=$e(e,st);t=j(t),e-=st;for(var c=Ss(a,t);++s<e;)t(s);return c}function Q0(e){return Q(e)?Ee(e,Dt):nt(e)?[e]:Je(Lu(le(e)))}function H0(e){var t=++ap;return le(e)+t}var Y0=Sr(function(e,t){return e+t},0),X0=Ys("ceil"),K0=Sr(function(e,t){return e/t},1),Z0=Ys("floor");function ey(e){return e&&e.length?yr(e,He,Ps):i}function ty(e,t){return e&&e.length?yr(e,j(t,2),Ps):i}function ny(e){return vo(e,He)}function iy(e,t){return vo(e,j(t,2))}function ry(e){return e&&e.length?yr(e,He,$s):i}function sy(e,t){return e&&e.length?yr(e,j(t,2),$s):i}var ay=Sr(function(e,t){return e*t},1),oy=Ys("round"),uy=Sr(function(e,t){return e-t},0);function cy(e){return e&&e.length?Es(e,He):0}function ly(e,t){return e&&e.length?Es(e,j(t,2)):0}return l.after=Lg,l.ary=Gu,l.assign=_m,l.assignIn=ic,l.assignInWith=Ur,l.assignWith=xm,l.at=Tm,l.before=Vu,l.bind=ua,l.bindAll=I0,l.bindKey=qu,l.castArray=Vg,l.chain=Bu,l.chunk=Zd,l.compact=eh,l.concat=th,l.cond=b0,l.conforms=N0,l.constant=ga,l.countBy=cg,l.create=wm,l.curry=Ju,l.curryRight=zu,l.debounce=Qu,l.defaults=Em,l.defaultsDeep=Sm,l.defer=Fg,l.delay=Dg,l.difference=nh,l.differenceBy=ih,l.differenceWith=rh,l.drop=sh,l.dropRight=ah,l.dropRightWhile=oh,l.dropWhile=uh,l.fill=ch,l.filter=fg,l.flatMap=hg,l.flatMapDeep=gg,l.flatMapDepth=mg,l.flatten=ku,l.flattenDeep=lh,l.flattenDepth=fh,l.flip=Pg,l.flow=R0,l.flowRight=C0,l.fromPairs=ph,l.functions=Cm,l.functionsIn=Lm,l.groupBy=yg,l.initial=hh,l.intersection=gh,l.intersectionBy=mh,l.intersectionWith=yh,l.invert=Dm,l.invertBy=Pm,l.invokeMap=_g,l.iteratee=ma,l.keyBy=xg,l.keys=Pe,l.keysIn=Qe,l.map=Cr,l.mapKeys=Um,l.mapValues=Mm,l.matches=L0,l.matchesProperty=F0,l.memoize=Fr,l.merge=$m,l.mergeWith=rc,l.method=D0,l.methodOf=P0,l.mixin=ya,l.negate=Dr,l.nthArg=U0,l.omit=Bm,l.omitBy=jm,l.once=kg,l.orderBy=Tg,l.over=M0,l.overArgs=Ug,l.overEvery=$0,l.overSome=B0,l.partial=ca,l.partialRight=Hu,l.partition=wg,l.pick=Wm,l.pickBy=sc,l.property=pc,l.propertyOf=j0,l.pull=Th,l.pullAll=Mu,l.pullAllBy=wh,l.pullAllWith=Eh,l.pullAt=Sh,l.range=W0,l.rangeRight=G0,l.rearg=Mg,l.reject=Ag,l.remove=Ah,l.rest=$g,l.reverse=aa,l.sampleSize=bg,l.set=Vm,l.setWith=qm,l.shuffle=Ng,l.slice=Ih,l.sortBy=Cg,l.sortedUniq=Fh,l.sortedUniqBy=Dh,l.split=h0,l.spread=Bg,l.tail=Ph,l.take=kh,l.takeRight=Uh,l.takeRightWhile=Mh,l.takeWhile=$h,l.tap=eg,l.throttle=jg,l.thru=Rr,l.toArray=ec,l.toPairs=ac,l.toPairsIn=oc,l.toPath=Q0,l.toPlainObject=nc,l.transform=Jm,l.unary=Wg,l.union=Bh,l.unionBy=jh,l.unionWith=Wh,l.uniq=Gh,l.uniqBy=Vh,l.uniqWith=qh,l.unset=zm,l.unzip=oa,l.unzipWith=$u,l.update=Qm,l.updateWith=Hm,l.values=ai,l.valuesIn=Ym,l.without=Jh,l.words=lc,l.wrap=Gg,l.xor=zh,l.xorBy=Qh,l.xorWith=Hh,l.zip=Yh,l.zipObject=Xh,l.zipObjectDeep=Kh,l.zipWith=Zh,l.entries=ac,l.entriesIn=oc,l.extend=ic,l.extendWith=Ur,ya(l,l),l.add=Y0,l.attempt=fc,l.camelCase=e0,l.capitalize=uc,l.ceil=X0,l.clamp=Xm,l.clone=qg,l.cloneDeep=zg,l.cloneDeepWith=Qg,l.cloneWith=Jg,l.conformsTo=Hg,l.deburr=cc,l.defaultTo=O0,l.divide=K0,l.endsWith=t0,l.eq=At,l.escape=n0,l.escapeRegExp=i0,l.every=lg,l.find=pg,l.findIndex=Du,l.findKey=Am,l.findLast=dg,l.findLastIndex=Pu,l.findLastKey=Im,l.floor=Z0,l.forEach=ju,l.forEachRight=Wu,l.forIn=bm,l.forInRight=Nm,l.forOwn=Om,l.forOwnRight=Rm,l.get=pa,l.gt=Yg,l.gte=Xg,l.has=Fm,l.hasIn=da,l.head=Uu,l.identity=He,l.includes=vg,l.indexOf=dh,l.inRange=Km,l.invoke=km,l.isArguments=Mn,l.isArray=Q,l.isArrayBuffer=Kg,l.isArrayLike=ze,l.isArrayLikeObject=be,l.isBoolean=Zg,l.isBuffer=dn,l.isDate=em,l.isElement=tm,l.isEmpty=nm,l.isEqual=im,l.isEqualWith=rm,l.isError=la,l.isFinite=sm,l.isFunction=Gt,l.isInteger=Yu,l.isLength=Pr,l.isMap=Xu,l.isMatch=am,l.isMatchWith=om,l.isNaN=um,l.isNative=cm,l.isNil=fm,l.isNull=lm,l.isNumber=Ku,l.isObject=Ae,l.isObjectLike=Ie,l.isPlainObject=Di,l.isRegExp=fa,l.isSafeInteger=pm,l.isSet=Zu,l.isString=kr,l.isSymbol=nt,l.isTypedArray=si,l.isUndefined=dm,l.isWeakMap=hm,l.isWeakSet=gm,l.join=vh,l.kebabCase=r0,l.last=pt,l.lastIndexOf=_h,l.lowerCase=s0,l.lowerFirst=a0,l.lt=mm,l.lte=ym,l.max=ey,l.maxBy=ty,l.mean=ny,l.meanBy=iy,l.min=ry,l.minBy=sy,l.stubArray=_a,l.stubFalse=xa,l.stubObject=V0,l.stubString=q0,l.stubTrue=J0,l.multiply=ay,l.nth=xh,l.noConflict=k0,l.noop=va,l.now=Lr,l.pad=o0,l.padEnd=u0,l.padStart=c0,l.parseInt=l0,l.random=Zm,l.reduce=Eg,l.reduceRight=Sg,l.repeat=f0,l.replace=p0,l.result=Gm,l.round=oy,l.runInContext=m,l.sample=Ig,l.size=Og,l.snakeCase=d0,l.some=Rg,l.sortedIndex=bh,l.sortedIndexBy=Nh,l.sortedIndexOf=Oh,l.sortedLastIndex=Rh,l.sortedLastIndexBy=Ch,l.sortedLastIndexOf=Lh,l.startCase=g0,l.startsWith=m0,l.subtract=uy,l.sum=cy,l.sumBy=ly,l.template=y0,l.times=z0,l.toFinite=Vt,l.toInteger=Y,l.toLength=tc,l.toLower=v0,l.toNumber=dt,l.toSafeInteger=vm,l.toString=le,l.toUpper=_0,l.trim=x0,l.trimEnd=T0,l.trimStart=w0,l.truncate=E0,l.unescape=S0,l.uniqueId=H0,l.upperCase=A0,l.upperFirst=ha,l.each=ju,l.eachRight=Wu,l.first=Uu,ya(l,function(){var e={};return Lt(l,function(t,s){pe.call(l.prototype,s)||(e[s]=t)}),e}(),{chain:!1}),l.VERSION=o,ot(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),ot(["drop","take"],function(e,t){te.prototype[e]=function(s){s=s===i?1:Fe(Y(s),0);var a=this.__filtered__&&!t?new te(this):this.clone();return a.__filtered__?a.__takeCount__=$e(s,a.__takeCount__):a.__views__.push({size:$e(s,st),type:e+(a.__dir__<0?"Right":"")}),a},te.prototype[e+"Right"]=function(s){return this.reverse()[e](s).reverse()}}),ot(["filter","map","takeWhile"],function(e,t){var s=t+1,a=s==Vi||s==Ji;te.prototype[e]=function(c){var p=this.clone();return p.__iteratees__.push({iteratee:j(c,3),type:s}),p.__filtered__=p.__filtered__||a,p}}),ot(["head","last"],function(e,t){var s="take"+(t?"Right":"");te.prototype[e]=function(){return this[s](1).value()[0]}}),ot(["initial","tail"],function(e,t){var s="drop"+(t?"":"Right");te.prototype[e]=function(){return this.__filtered__?new te(this):this[s](1)}}),te.prototype.compact=function(){return this.filter(He)},te.prototype.find=function(e){return this.filter(e).head()},te.prototype.findLast=function(e){return this.reverse().find(e)},te.prototype.invokeMap=K(function(e,t){return typeof e=="function"?new te(this):this.map(function(s){return Ni(s,e,t)})}),te.prototype.reject=function(e){return this.filter(Dr(j(e)))},te.prototype.slice=function(e,t){e=Y(e);var s=this;return s.__filtered__&&(e>0||t<0)?new te(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=Y(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},te.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},te.prototype.toArray=function(){return this.take(st)},Lt(te.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),c=l[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);c&&(l.prototype[t]=function(){var d=this.__wrapped__,h=a?[1]:arguments,y=d instanceof te,E=h[0],S=y||Q(d),I=function(Z){var ie=c.apply(l,an([Z],h));return a&&C?ie[0]:ie};S&&s&&typeof E=="function"&&E.length!=1&&(y=S=!1);var C=this.__chain__,U=!!this.__actions__.length,G=p&&!C,X=y&&!U;if(!p&&S){d=X?d:new te(this);var V=e.apply(d,h);return V.__actions__.push({func:Rr,args:[I],thisArg:i}),new ct(V,C)}return G&&X?e.apply(this,h):(V=this.thru(I),G?a?V.value()[0]:V.value():V)})}),ot(["pop","push","shift","sort","splice","unshift"],function(e){var t=nr[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var c=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(Q(p)?p:[],c)}return this[s](function(d){return t.apply(Q(d)?d:[],c)})}}),Lt(te.prototype,function(e,t){var s=l[t];if(s){var a=s.name+"";pe.call(ei,a)||(ei[a]=[]),ei[a].push({name:t,func:s})}}),ei[Er(i,me).name]=[{name:"wrapper",func:i}],te.prototype.clone=Sp,te.prototype.reverse=Ap,te.prototype.value=Ip,l.prototype.at=tg,l.prototype.chain=ng,l.prototype.commit=ig,l.prototype.next=rg,l.prototype.plant=ag,l.prototype.reverse=og,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=ug,l.prototype.first=l.prototype.head,Ti&&(l.prototype[Ti]=sg),l},Xn=ip();Rn?((Rn.exports=Xn)._=Xn,ms._=Xn):Ue._=Xn}).call(wx)}($i,$i.exports)),$i.exports}var Sx=Ex();const Ia=n=>{const r=Sx.startCase(n).toLowerCase();return r.charAt(0).toUpperCase()+r.slice(1)},Ax=({data:n})=>`import { defineObject } from 'twenty-sdk';
401
+
402
+ export default defineObject({
403
+ universalIdentifier: '${pi.v4()}',
404
+ nameSingular: '${n.nameSingular}',
405
+ namePlural: '${n.namePlural}',
406
+ labelSingular: '${n.labelSingular}',
407
+ labelPlural: '${n.labelPlural}',
408
+ icon: 'IconBox',
409
+ fields: [
410
+ // Add your fields here using defineField helper
411
+ // Example:
412
+ // {
413
+ // universalIdentifier: '...',
414
+ // type: FieldMetadataType.TEXT,
415
+ // name: 'description',
416
+ // label: 'Description',
417
+ // },
418
+ ],
419
+ });
420
+ `,Ix=({name:n,universalIdentifier:r=pi.v4()})=>{const i=fi(n);return`import { defineRole } from 'twenty-sdk';
342
421
 
343
- `;await Ie.appendFile(ke.join(i,"index.ts"),r)}}class m_{constructor(){this.apiService=new Vn,this.generateService=new Xc}async execute(i=vt){try{return console.log(F.default.blue("🚀 Syncing Twenty Application")),console.log(F.default.gray(`📁 App Path: ${i}`)),console.log(""),await this.synchronize({appPath:i})}catch(r){throw console.error(F.default.red("Sync failed:"),r instanceof Error?r.message:r),r}}async synchronize({appPath:i}){try{const{manifest:r,packageJson:a,yarnLock:u,shouldGenerate:p,warnings:v}=await mr(i);Yc(r),Hc(v);let I=await this.apiService.syncApplication({manifest:r,packageJson:a,yarnLock:u});if(p){await this.generateService.generateClient(i);const{manifest:N}=await mr(i);I=await this.apiService.syncApplication({manifest:N,packageJson:a,yarnLock:u})}return I.success===!1?console.error(F.default.red("❌ Serverless functions Sync failed:"),I.error):console.log(F.default.green("✅ Serverless functions synced successfully")),I}catch(r){throw r instanceof mo&&Kc(r),r}}}const Fn=n=>n&&!n?.startsWith("/")?ke.join(vt,n):n;class v_{constructor(){this.generateService=new Xc}async execute(i=vt){try{await this.generateService.generateClient(i)}catch(r){throw console.error(F.default.red("Generate Twenty client failed:"),r instanceof Error?r.message:r),r}}}class y_{constructor(){this.apiService=new Vn}async execute({appPath:i=vt,functionUniversalIdentifier:r,functionName:a}){try{const{manifest:u}=await mr(i);this.logWatchInfo({appName:u.application.displayName,functionUniversalIdentifier:r,functionName:a}),await this.apiService.subscribeToLogs({applicationUniversalIdentifier:u.application.universalIdentifier,functionUniversalIdentifier:r,functionName:a})}catch(u){console.error(F.default.red("Watch logs failed:"),u instanceof Error?u.message:u),process.exit(1)}}logWatchInfo({appName:i,functionUniversalIdentifier:r,functionName:a}){const u=i??"Twenty Application",p=r||a?`function "${r||a}"`:"functions";console.log(F.default.blue(`🚀 Watching ${u} ${p} logs:`)),console.log("")}}Q0.inspect.defaultOptions.depth=10;class __{constructor(){this.devCommand=new p_,this.syncCommand=new m_,this.uninstallCommand=new f_,this.addCommand=new yv,this.generateCommand=new v_,this.logsCommand=new y_}getCommand(){const i=new Ii.Command("app");return i.description("Application development commands"),i.command("dev [appPath]").description("Watch and sync local application changes").option("-d, --debounce <ms>","Debounce delay in milliseconds","1000").action(async(r,a)=>{await this.devCommand.execute({...a,appPath:Fn(r)})}),i.command("sync [appPath]").description("Sync application to Twenty").action(async r=>{try{(await this.syncCommand.execute(Fn(r))).success||process.exit(1)}catch{process.exit(1)}}),i.command("uninstall [appPath]").description("Uninstall application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:Fn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("delete [appPath]",{hidden:!0}).description("Delete application from Twenty").action(async r=>{try{(await this.uninstallCommand.execute({appPath:Fn(r),askForConfirmation:!0})).success||process.exit(1)}catch{process.exit(1)}}),i.command("add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(wi).join("|")})`).action(async(r,a)=>{r&&!vv(r)&&(console.error(F.default.red(`Invalid entity type "${r}". Must be one of: ${Object.values(wi).join("|")}`)),process.exit(1)),await this.addCommand.execute(r,a?.path)}),i.command("generate [appPath]").description("Generate Twenty client").action(async r=>{await this.generateCommand.execute(Fn(r))}),i.command("logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(r,a)=>{await this.logsCommand.execute({...a,appPath:Fn(r)})}),i}}class T_{constructor(){this.configService=new At,this.apiService=new Vn}getCommand(){const i=new Ii.Command("auth");return i.description("Authentication commands"),i.command("login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async r=>{await this.login(r)}),i.command("logout").description("Remove authentication credentials").action(async()=>{await this.logout()}),i.command("status").description("Check authentication status").action(async()=>{await this.status()}),i}async login(i){try{let{apiKey:r,apiUrl:a}=i;const u=await this.configService.getConfig();if(a||(a=(await $n.default.prompt([{type:"input",name:"apiUrl",message:"Twenty API URL:",default:u.apiUrl,validate:I=>{try{return new URL(I),!0}catch{return"Please enter a valid URL"}}}])).apiUrl),r||(r=(await $n.default.prompt([{type:"password",name:"apiKey",message:"API Key:",mask:"*",validate:I=>I.length>0||"API key is required"}])).apiKey),await this.configService.setConfig({apiUrl:a,apiKey:r}),await this.apiService.validateAuth()){const v=At.getActiveWorkspace();console.log(F.default.green(`✓ Successfully authenticated with Twenty (workspace: ${v})`))}else console.log(F.default.red("✗ Authentication failed. Please check your credentials.")),process.exit(1)}catch(r){console.error(F.default.red("Login failed:"),r instanceof Error?r.message:r),process.exit(1)}}async logout(){try{await this.configService.clearConfig();const i=At.getActiveWorkspace();console.log(F.default.green(`✓ Successfully logged out (workspace: ${i})`))}catch(i){console.error(F.default.red("Logout failed:"),i instanceof Error?i.message:i),process.exit(1)}}async status(){try{const i=At.getActiveWorkspace(),r=await this.configService.getConfig();if(console.log(F.default.blue("Authentication Status:")),console.log(`Workspace: ${i}`),console.log(`API URL: ${r.apiUrl}`),console.log(`API Key: ${r.apiKey?"***"+r.apiKey.slice(-4):"Not set"}`),r.apiKey){const a=await this.apiService.validateAuth();console.log(`Status: ${a?F.default.green("✓ Valid"):F.default.red("✗ Invalid")}`)}else console.log(`Status: ${F.default.yellow("⚠ Not authenticated")}`)}catch(i){console.error(F.default.red("Status check failed:"),i instanceof Error?i.message:i),process.exit(1)}}}const w_="0.3.1",E_={version:w_},vn=new Ii.Command;vn.name("twenty").description("CLI for Twenty application development").version(E_.version);vn.option("--workspace <name>","Use a specific workspace configuration","default");vn.hook("preAction",n=>{const r=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;At.setActiveWorkspace(r),console.log(F.default.gray(`👩‍💻 Workspace - ${At.getActiveWorkspace()}`))});vn.addCommand(new T_().getCommand());vn.addCommand(new __().getCommand());vn.exitOverride();try{vn.parse()}catch(n){n instanceof Ii.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(F.default.red("Error:"),n.message),process.exit(1))}
422
+ export const ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER =
423
+ '${r}';
424
+
425
+ export default defineRole({
426
+ universalIdentifier: ${i.toUpperCase().replace(/-/g,"_")}_ROLE_UNIVERSAL_IDENTIFIER,
427
+ label: '${n}',
428
+ description: 'Add a description for your role',
429
+ canReadAllObjectRecords: true,
430
+ canUpdateAllObjectRecords: true,
431
+ canSoftDeleteAllObjectRecords: true,
432
+ canDestroyAllObjectRecords: false,
433
+ });
434
+ `},bx=({data:n})=>{const r=pi.v4(),i=n.description?`
435
+ description: '${n.description}',`:"";return`import { defineField, FieldType } from 'twenty-sdk';
436
+
437
+ export default defineField({
438
+ universalIdentifier: '${r}',
439
+ name: '${n.name}',
440
+ label: '${n.label}',
441
+ type: FieldMetadataType.${n.type},
442
+ objectUniversalIdentifier: '${n.objectUniversalIdentifier}',${i}
443
+ });
444
+ `},Nx="src";class Ox{async execute(r,i){try{const o=r??await this.getEntity(),u=this.getFolderName(o),f=i?ge.join(Ht,i):ge.join(Ht,Nx,u);await de.ensureDir(f);const{name:g,file:v}=await this.getEntityData(o),w=ge.join(f,this.getFileName(g,o));if(await de.pathExists(w)){const{overwrite:b}=await this.handleFileExist();if(!b)return}await de.writeFile(w,v),console.log(R.default.green(`✓ Created ${u}:`),R.default.cyan(ge.relative(Ht,w)))}catch(o){console.error(R.default.red("Add new entity failed:"),o instanceof Error?o.message:o),process.exit(1)}}async getEntityData(r){switch(r){case De.Object:{const i=await this.getObjectData(),o=i.nameSingular,u=Ax({data:i});return{name:o,file:u}}case De.Field:{const i=await this.getFieldData(),o=i.name,u=bx({data:i});return{name:o,file:u}}case De.LogicFunction:{const i=await this.getEntityName(r),o=Tx({name:i});return{name:i,file:o}}case De.FrontComponent:{const i=await this.getEntityName(r),o=xx({name:i});return{name:i,file:o}}case De.Role:{const i=await this.getEntityName(r),o=Ix({name:i});return{name:i,file:o}}default:B.ln()}}async getEntity(){const{entity:r}=await zt.default.prompt([{type:"select",name:"entity",message:"What entity do you want to create?",default:"",choices:Object.values(De)}]);return r}async handleFileExist(){return await zt.default.prompt([{type:"confirm",name:"overwrite",message:"File already exists. Do you want to overwrite it?",default:!1}])}async getEntityName(r){const{name:i}=await zt.default.prompt([{type:"input",name:"name",message:`Enter a name for your new ${r}:`,default:"",validate:o=>o.length===0?`${r} name is required`:!0}]);return i}async getFieldData(){return zt.default.prompt([{type:"input",name:"name",message:"Enter a name for your field:",default:"",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"label",message:"Enter a label for your field:",default:r=>Ia(r.name),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"select",name:"type",message:"Select the field type:",choices:Object.values(mc.s),default:mc.s.TEXT},{type:"input",name:"objectUniversalIdentifier",message:"Enter the universalIdentifier of the object this field belongs to:",default:"fill-later",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"description",message:"Enter a description for your field (optional):",default:""}])}async getObjectData(){return zt.default.prompt([{type:"input",name:"nameSingular",message:"Enter a name singular for your object (eg: company):",default:"",validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"namePlural",message:"Enter a name plural for your object (eg: companies):",default:"",validate:(r,i)=>r.trim()===i?.nameSingular.trim()?"Name plural must be different from name singular":!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelSingular",message:"Enter a label singular for your object:",default:r=>Ia(r.nameSingular),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0},{type:"input",name:"labelPlural",message:"Enter a label plural for your object:",default:r=>Ia(r.namePlural),validate:r=>!r||r.trim().length===0?"Please enter a non empty string":!0}])}getFolderName(r){return`${fi(r)}s`}getFileName(r,i){switch(i){case De.FrontComponent:return`${fi(r)}.tsx`;default:return`${fi(r)}.ts`}}}const Rx=n=>{const r=new fx,i=new px,o=new dx,u=new hx,f=new yx;n.command("auth:login").description("Authenticate with Twenty").option("--api-key <key>","API key for authentication").option("--api-url <url>","Twenty API URL").action(async P=>{await i.execute(P)}),n.command("auth:logout").description("Remove authentication credentials").action(async()=>{await o.execute()}),n.command("auth:status").description("Check authentication status").action(async()=>{await u.execute()}),n.command("auth:switch [workspace]").description("Switch the default workspace for authentication").action(async P=>{await f.execute({workspace:P})}),n.command("auth:list").description("List all configured workspaces").action(async()=>{await r.execute()});const g=new ax,v=new lx,w=new Ox,b=new cx,O=new mx,D=new gx;n.command("app:dev [appPath]").description("Watch and sync local application changes").action(async P=>{await g.execute({appPath:Pi(P)})}),n.command("app:uninstall [appPath]").description("Uninstall application from Twenty").action(async P=>{try{const M=await v.execute({appPath:Pi(P),askForConfirmation:!0});process.exit(M.success?0:1)}catch{process.exit(1)}}),n.command("entity:add [entityType]").option("--path <path>","Path in which the entity should be created.").description(`Add a new entity to your application (${Object.values(De).join("|")})`).action(async(P,M)=>{await w.execute(P,M?.path)}),n.command("app:generate [appPath]").description("Generate Twenty client").action(async P=>{await b.execute(Pi(P))}),n.command("function:logs [appPath]").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Only show logs for the function with this universal ID").option("-n, --functionName <functionName>","Only show logs for the function with this name").description("Watch application function logs").action(async(P,M)=>{await O.execute({...M,appPath:Pi(P)})}),n.command("function:execute [appPath]").option("-p, --payload <payload>","JSON payload to send to the function","{}").option("-u, --functionUniversalIdentifier <functionUniversalIdentifier>","Universal ID of the function to execute").option("-n, --functionName <functionName>","Name of the function to execute").description("Execute a logic function with a JSON payload").action(async(P,M)=>{!M?.functionUniversalIdentifier&&!M?.functionName&&(console.error(R.default.red("Error: Either --functionName (-n) or --functionUniversalIdentifier (-u) is required.")),process.exit(1)),await D.execute({...M,payload:M?.payload??"{}",appPath:Pi(P)})})},Cx="0.4.0",Lx={version:Cx};Fy.inspect.defaultOptions.depth=10;const yi=new kc.Command;yi.name("twenty").description("CLI for Twenty application development").version(Lx.version);yi.option("--workspace <name>","Use a specific workspace configuration (overrides the default set by auth:switch)");yi.hook("preAction",async n=>{let i=(n.optsWithGlobals?n.optsWithGlobals():n.opts()).workspace;i||(i=await new je().getDefaultWorkspace()),je.setActiveWorkspace(i),console.log(R.default.gray(`👩‍💻 Workspace - ${je.getActiveWorkspace()}`))});Rx(yi);yi.exitOverride();try{yi.parse()}catch(n){n instanceof kc.CommanderError&&process.exit(n.exitCode),n instanceof Error&&(console.error(R.default.red("Error:"),n.message),process.exit(1))}