ghost 4.18.0 → 4.20.1

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 (237) hide show
  1. package/.eslintrc.js +9 -8
  2. package/Gruntfile.js +1 -1
  3. package/PRIVACY.md +3 -0
  4. package/content/adapters/README.md +2 -2
  5. package/core/boot.js +17 -12
  6. package/core/bridge.js +9 -1
  7. package/core/built/assets/{chunk.3.b80d3e1e6b8556aaff3c.js → chunk.3.777d43e2ce954ba8b2f5.js} +25 -25
  8. package/core/built/assets/codemirror/{codemirror-21a09582262987037db73b152fb35f7c.js → codemirror-d25c379b87ec8b33d54ac7149bc0b6ae.js} +14 -14
  9. package/core/built/assets/ghost-dark-20e2892d4f30d0d1183c9ac725ea37d0.css +1 -0
  10. package/core/built/assets/{ghost.min-88d647a008a5b1dd678a89ae1e55c038.js → ghost.min-26e427944e719b616b8dc7fbb3bbd2f9.js} +709 -422
  11. package/core/built/assets/ghost.min-57e46fd3b1145ecf2cbd185a13611f3b.css +1 -0
  12. package/core/built/assets/icons/arrow-left-small.svg +0 -4
  13. package/core/built/assets/icons/paintbrush.svg +10 -1
  14. package/core/built/assets/icons/post.svg +3 -1
  15. package/core/built/assets/img/footer-marketplace-bg-572b6c6486a7e26316954d599eaa9f30.png +0 -0
  16. package/core/built/assets/img/marketing/offers-1-f2e1b653c4d5bb90eea9d7a2862530f9.jpg +0 -0
  17. package/core/built/assets/img/marketing/offers-2-28a225d34cc39d133748431536961d00.jpg +0 -0
  18. package/core/built/assets/img/marketing/offers-3-2094c91ab21a16c37fbe6ec16c140160.jpg +0 -0
  19. package/core/built/assets/img/themes/Alto-f4db5af43ca9771c7ac1f754de3ddf2f.png +0 -0
  20. package/core/built/assets/img/themes/Bulletin-57d45b992ff0e26e0acdce7ed4cccd67.png +0 -0
  21. package/core/built/assets/img/themes/Casper-c7e784d7188cc5d7f097d9b6c97b0263.jpg +0 -0
  22. package/core/built/assets/img/themes/Dawn-be81aa8c8caae8fcfb5d5fbec823fdcc.png +0 -0
  23. package/core/built/assets/img/themes/Digest-d3467ac22a290e1ad3a543014758286e.png +0 -0
  24. package/core/built/assets/img/themes/Dope-6f8e0bbc199ce4af9a60859e9e6a74ad.png +0 -0
  25. package/core/built/assets/img/themes/Ease-9c279ea6cec3c0f1823f81c9dd24b116.png +0 -0
  26. package/core/built/assets/img/themes/Edge-0258906309e11fd075a1d9880aa09b20.png +0 -0
  27. package/core/built/assets/img/themes/Edition-d8f508e93bc24bdf2716ae6f8b3d44f8.png +0 -0
  28. package/core/built/assets/img/themes/Editorial-a25a4a34c04dedd858bd5e05ef388b1c.jpg +0 -0
  29. package/core/built/assets/img/themes/Journal-accf0031bbae0919900a049061e65a04.png +0 -0
  30. package/core/built/assets/img/themes/London-3f07efcee9e5bfb9a33827064eb77e70.jpg +0 -0
  31. package/core/built/assets/img/themes/Massively-06edf00108429f7fb8e65f190fba34fe.jpg +0 -0
  32. package/core/built/assets/img/themes/Ruby-11a53c62015612f4b3aca8f503121225.png +0 -0
  33. package/core/built/assets/img/themes/Wave-86e8044c2d76cb57a9030e4c24ac9520.png +0 -0
  34. package/core/built/assets/simplemde/{simplemde-232f69d126310434489071a1891e6d8b.js → simplemde-3ffc0ec9e9fecf29b9a499db678c9e65.js} +14 -14
  35. package/core/built/assets/{vendor.min-7dc7cf9c92175ebfb9cea95c120ee8a7.js → vendor.min-af502ac4142871500fc424f6a5a254ec.js} +2206 -1859
  36. package/core/frontend/apps/amp/lib/router.js +1 -1
  37. package/core/frontend/helpers/match.js +17 -23
  38. package/core/frontend/meta/author-url.js +1 -1
  39. package/core/frontend/meta/url.js +1 -1
  40. package/core/{server → frontend}/public/favicon.ico +0 -0
  41. package/core/{server → frontend}/public/ghost.css +0 -0
  42. package/core/{server → frontend}/public/ghost.min.css +0 -0
  43. package/core/{server → frontend}/public/robots.txt +0 -0
  44. package/core/{server → frontend}/public/sitemap.xsl +0 -0
  45. package/core/frontend/services/proxy.js +1 -1
  46. package/core/frontend/services/rendering.js +1 -1
  47. package/core/frontend/services/routing/CollectionRouter.js +3 -49
  48. package/core/frontend/services/routing/ParentRouter.js +1 -4
  49. package/core/frontend/services/routing/StaticPagesRouter.js +3 -5
  50. package/core/frontend/services/routing/StaticRoutesRouter.js +4 -6
  51. package/core/frontend/services/routing/TaxonomyRouter.js +4 -5
  52. package/core/frontend/services/routing/controllers/collection.js +2 -2
  53. package/core/frontend/services/routing/controllers/email-post.js +2 -2
  54. package/core/frontend/services/routing/controllers/entry.js +2 -2
  55. package/core/frontend/services/routing/controllers/preview.js +2 -2
  56. package/core/frontend/services/routing/index.js +6 -12
  57. package/core/frontend/services/routing/registry.js +13 -0
  58. package/core/frontend/services/routing/router-manager.js +185 -0
  59. package/core/frontend/services/rss/generate-feed.js +2 -2
  60. package/core/frontend/services/theme-engine/i18n/i18n.js +267 -28
  61. package/core/frontend/services/theme-engine/i18n/index.js +1 -1
  62. package/core/frontend/services/theme-engine/i18n/theme-i18n.js +73 -0
  63. package/core/frontend/web/index.js +1 -0
  64. package/core/{server/web/site → frontend/web}/middleware/handle-image-sizes.js +4 -4
  65. package/core/{server/web/site → frontend/web}/middleware/index.js +0 -0
  66. package/core/{server/web/site → frontend/web}/middleware/redirect-ghost-to-admin.js +3 -3
  67. package/core/{server/web/site → frontend/web}/middleware/serve-favicon.js +6 -6
  68. package/core/{server/web/site → frontend/web}/middleware/serve-public-file.js +2 -2
  69. package/core/{server/web/site → frontend/web}/middleware/static-theme.js +3 -3
  70. package/core/frontend/web/routes.js +13 -0
  71. package/core/{server/web/site/app.js → frontend/web/site.js} +12 -16
  72. package/core/server/adapters/storage/LocalFileStorage.js +35 -39
  73. package/core/server/adapters/storage/index.js +12 -2
  74. package/core/server/api/canary/custom-theme-settings.js +2 -2
  75. package/core/server/api/canary/images.js +1 -1
  76. package/core/server/api/canary/oembed.js +2 -2
  77. package/core/server/api/canary/offers.js +29 -1
  78. package/core/server/api/canary/posts-public.js +6 -2
  79. package/core/server/api/canary/products.js +6 -2
  80. package/core/server/api/canary/tags-public.js +6 -2
  81. package/core/server/api/canary/users.js +9 -4
  82. package/core/server/api/canary/utils/serializers/output/custom-theme-settings.js +2 -2
  83. package/core/server/api/canary/utils/serializers/output/notifications.js +1 -0
  84. package/core/server/api/canary/utils/serializers/output/settings.js +2 -3
  85. package/core/server/api/canary/utils/serializers/output/utils/url.js +1 -1
  86. package/core/server/api/canary/utils/validators/input/oembed.js +4 -1
  87. package/core/server/api/canary/utils/validators/input/passwordreset.js +8 -3
  88. package/core/server/api/canary/utils/validators/input/settings.js +5 -4
  89. package/core/server/api/canary/utils/validators/input/setup.js +6 -2
  90. package/core/server/api/canary/utils/validators/input/users.js +6 -2
  91. package/core/server/api/canary/utils/validators/input/webhooks.js +8 -3
  92. package/core/server/api/v2/images.js +1 -1
  93. package/core/server/api/v2/utils/serializers/output/authentication.js +9 -4
  94. package/core/server/api/v2/utils/serializers/output/notifications.js +1 -0
  95. package/core/server/api/v2/utils/serializers/output/users.js +5 -3
  96. package/core/server/api/v2/utils/serializers/output/utils/url.js +1 -1
  97. package/core/server/api/v2/utils/validators/input/images.js +11 -6
  98. package/core/server/api/v2/utils/validators/input/invitations.js +14 -6
  99. package/core/server/api/v2/utils/validators/input/invites.js +6 -2
  100. package/core/server/api/v2/utils/validators/input/oembed.js +6 -2
  101. package/core/server/api/v2/utils/validators/input/passwordreset.js +8 -3
  102. package/core/server/api/v2/utils/validators/input/settings.js +10 -4
  103. package/core/server/api/v2/utils/validators/input/setup.js +6 -2
  104. package/core/server/api/v2/utils/validators/input/users.js +5 -2
  105. package/core/server/api/v3/authentication.js +6 -2
  106. package/core/server/api/v3/authors-public.js +6 -2
  107. package/core/server/api/v3/email.js +9 -4
  108. package/core/server/api/v3/images.js +1 -1
  109. package/core/server/api/v3/integrations.js +7 -3
  110. package/core/server/api/v3/invites.js +6 -3
  111. package/core/server/api/v3/labels.js +10 -5
  112. package/core/server/api/v3/memberSigninUrls.js +5 -2
  113. package/core/server/api/v3/oembed.js +2 -2
  114. package/core/server/api/v3/pages-public.js +5 -2
  115. package/core/server/api/v3/pages.js +6 -3
  116. package/core/server/api/v3/posts-public.js +5 -3
  117. package/core/server/api/v3/posts.js +7 -3
  118. package/core/server/api/v3/preview.js +5 -3
  119. package/core/server/api/v3/session.js +7 -3
  120. package/core/server/api/v3/settings.js +8 -3
  121. package/core/server/api/v3/slugs.js +5 -4
  122. package/core/server/api/v3/utils/serializers/output/authentication.js +10 -4
  123. package/core/server/api/v3/utils/serializers/output/notifications.js +1 -0
  124. package/core/server/api/v3/utils/serializers/output/settings.js +2 -3
  125. package/core/server/api/v3/utils/serializers/output/users.js +6 -2
  126. package/core/server/api/v3/utils/serializers/output/utils/url.js +1 -1
  127. package/core/server/api/v3/utils/validators/input/images.js +12 -7
  128. package/core/server/api/v3/utils/validators/input/invitations.js +14 -6
  129. package/core/server/api/v3/utils/validators/input/invites.js +6 -2
  130. package/core/server/api/v3/utils/validators/input/oembed.js +6 -2
  131. package/core/server/api/v3/utils/validators/input/passwordreset.js +8 -3
  132. package/core/server/api/v3/utils/validators/input/settings.js +5 -4
  133. package/core/server/api/v3/utils/validators/input/setup.js +6 -2
  134. package/core/server/api/v3/utils/validators/input/users.js +6 -2
  135. package/core/server/api/v3/utils/validators/input/webhooks.js +8 -3
  136. package/core/server/data/exporter/table-lists.js +2 -1
  137. package/core/server/data/importer/handlers/image.js +1 -1
  138. package/core/server/data/importer/importers/image.js +1 -1
  139. package/core/server/data/migrations/init/1-create-tables.js +7 -8
  140. package/core/server/data/migrations/init/2-create-fixtures.js +8 -8
  141. package/core/server/data/migrations/versions/4.19/01-add-active-column-to-offers.js +7 -0
  142. package/core/server/data/migrations/versions/4.19/02-add-offer-redemptions-table.js +8 -0
  143. package/core/server/data/migrations/versions/4.20/01-remove-offer-redemptions-table.js +19 -0
  144. package/core/server/data/migrations/versions/4.20/02-remove-offers-table.js +30 -0
  145. package/core/server/data/migrations/versions/4.20/03-add-offers-table.js +21 -0
  146. package/core/server/data/migrations/versions/4.20/04-add-offer-redemptions-table.js +9 -0
  147. package/core/server/data/migrations/versions/4.20/05-remove-not-null-constraint-from-portal-title.js +41 -0
  148. package/core/server/data/schema/fixtures/utils.js +150 -143
  149. package/core/server/data/schema/schema.js +15 -3
  150. package/core/server/frontend/ghost.min.css +1 -0
  151. package/core/server/lib/image/blog-icon.js +10 -10
  152. package/core/server/lib/image/image-size.js +5 -5
  153. package/core/server/lib/image/image-utils.js +4 -4
  154. package/core/server/lib/image/index.js +1 -2
  155. package/core/server/lib/mobiledoc.js +3 -2
  156. package/core/server/models/action.js +7 -4
  157. package/core/server/models/base/plugins/overrides.js +19 -6
  158. package/core/server/models/custom-theme-setting.js +56 -1
  159. package/core/server/models/index.js +4 -45
  160. package/core/server/models/member.js +5 -0
  161. package/core/server/models/offer-redemption.js +10 -0
  162. package/core/server/models/user.js +2 -1
  163. package/core/server/overrides.js +6 -2
  164. package/core/server/run-update-check.js +0 -3
  165. package/core/server/services/adapter-manager/config.js +1 -0
  166. package/core/server/services/adapter-manager/index.js +9 -5
  167. package/core/server/services/adapter-manager/options-resolver.js +18 -0
  168. package/core/server/services/bulk-email/bulk-email-processor.js +6 -2
  169. package/core/server/services/bulk-email/mailgun.js +1 -1
  170. package/core/server/services/custom-theme-settings.js +10 -4
  171. package/core/server/services/invites/index.js +0 -2
  172. package/core/server/services/invites/invites.js +5 -5
  173. package/core/server/services/mail/GhostMailer.js +18 -10
  174. package/core/server/services/mega/mega.js +3 -3
  175. package/core/server/services/mega/post-email-serializer.js +2 -2
  176. package/core/server/services/members/api.js +3 -4
  177. package/core/server/services/members/emails/signin.js +1 -1
  178. package/core/server/services/members/emails/signup.js +1 -1
  179. package/core/server/services/members/emails/subscribe.js +1 -1
  180. package/core/server/services/members/middleware.js +10 -0
  181. package/core/server/services/members/service.js +2 -1
  182. package/core/server/services/notifications/index.js +1 -1
  183. package/core/server/services/notifications/notifications.js +40 -35
  184. package/core/server/services/oembed.js +4 -9
  185. package/core/server/services/offers/service.js +16 -6
  186. package/core/server/services/permissions/public.js +6 -2
  187. package/core/server/services/route-settings/route-settings.js +1 -1
  188. package/core/server/services/settings/index.js +3 -1
  189. package/core/server/services/settings/settings-bread-service.js +42 -20
  190. package/core/server/services/slack.js +1 -1
  191. package/core/server/services/themes/activate.js +2 -2
  192. package/core/server/services/themes/activation-bridge.js +6 -6
  193. package/core/server/services/themes/storage.js +1 -1
  194. package/core/{frontend → server}/services/url/Queue.js +0 -0
  195. package/core/{frontend → server}/services/url/Resource.js +0 -0
  196. package/core/{frontend → server}/services/url/Resources.js +2 -2
  197. package/core/{frontend → server}/services/url/UrlGenerator.js +14 -14
  198. package/core/{frontend → server}/services/url/UrlService.js +12 -15
  199. package/core/{frontend → server}/services/url/Urls.js +1 -1
  200. package/core/{frontend → server}/services/url/configs/canary.js +0 -0
  201. package/core/{frontend → server}/services/url/configs/v2.js +0 -0
  202. package/core/{frontend → server}/services/url/configs/v3.js +0 -0
  203. package/core/{frontend → server}/services/url/configs/v4.js +0 -0
  204. package/core/{frontend → server}/services/url/index.js +0 -0
  205. package/core/server/services/xmlrpc.js +1 -1
  206. package/core/server/update-check.js +3 -3
  207. package/core/server/web/admin/controller.js +11 -0
  208. package/core/server/web/admin/views/default-prod.html +4 -4
  209. package/core/server/web/admin/views/default.html +4 -4
  210. package/core/server/web/api/app.js +8 -9
  211. package/core/server/web/members/app.js +1 -0
  212. package/core/server/web/oauth/app.js +4 -2
  213. package/core/server/web/parent/backend.js +3 -3
  214. package/core/server/web/parent/frontend.js +2 -2
  215. package/core/server/web/shared/middlewares/api/spam-prevention.js +0 -2
  216. package/core/server/web/shared/middlewares/custom-redirects.js +0 -8
  217. package/core/server/web/shared/middlewares/maintenance.js +1 -1
  218. package/core/server/web/well-known.js +10 -10
  219. package/core/shared/config/defaults.json +2 -2
  220. package/core/shared/config/overrides.json +1 -1
  221. package/core/shared/express.js +10 -0
  222. package/core/shared/html-to-plaintext.js +2 -2
  223. package/core/shared/labs.js +14 -6
  224. package/loggingrc.js +10 -0
  225. package/package.json +60 -57
  226. package/yarn.lock +1317 -914
  227. package/core/built/assets/ghost-dark-13627f10941a7dbb2b12e1d41dc51c34.css +0 -1
  228. package/core/built/assets/ghost.min-d9cbfb4eb2db8915fcd2bf2416218616.css +0 -1
  229. package/core/built/assets/img/themes/London-68501c8ab797de7f2851cf9ea0a28e26.jpg +0 -0
  230. package/core/frontend/services/routing/bootstrap.js +0 -114
  231. package/core/server/public/404-ghost.png +0 -0
  232. package/core/server/public/404-ghost@2x.png +0 -0
  233. package/core/server/web/site/index.js +0 -1
  234. package/core/server/web/site/routes.js +0 -9
  235. package/core/shared/i18n/i18n.js +0 -312
  236. package/core/shared/i18n/index.js +0 -6
  237. package/core/shared/i18n/translations/en.json +0 -675
package/.eslintrc.js CHANGED
@@ -44,15 +44,15 @@ module.exports = {
44
44
  files: 'core/frontend/**',
45
45
  rules: {
46
46
  'ghost/node/no-restricted-require': ['off', [
47
+ // If we make the frontend entirely independent, these have to be solved too
48
+ // {
49
+ // name: path.resolve(__dirname, 'core/shared/**'),
50
+ // message: 'Invalid require of core/shared from core/frontend.'
51
+ // },
47
52
  // These are critical refactoring issues that we need to tackle ASAP
48
53
  {
49
- name: path.resolve(__dirname, 'core/server/**'),
54
+ name: [path.resolve(__dirname, 'core/server/**')],
50
55
  message: 'Invalid require of core/server from core/frontend.'
51
- },
52
- // If we make the frontend entirely independent, these have to be solved too
53
- {
54
- name: path.resolve(__dirname, 'core/shared/**'),
55
- message: 'Invalid require of core/shared from core/frontend.'
56
56
  }
57
57
  ]]
58
58
  }
@@ -60,9 +60,10 @@ module.exports = {
60
60
  {
61
61
  files: 'core/server/**',
62
62
  rules: {
63
- 'ghost/node/no-restricted-require': ['off', [
63
+ 'ghost/node/no-restricted-require': ['warn', [
64
64
  {
65
- name: path.resolve(__dirname, 'core/frontend/**'),
65
+ // Throw an error for all requires of the frontend, _except_ the url service which will be moved soon
66
+ name: [path.resolve(__dirname, 'core/frontend/**')],
66
67
  message: 'Invalid require of core/frontend from core/server.'
67
68
  }
68
69
  ]]
package/Gruntfile.js CHANGED
@@ -219,7 +219,7 @@ module.exports = function (grunt) {
219
219
  ]
220
220
  },
221
221
  files: {
222
- 'core/server/public/ghost.min.css': 'core/server/public/ghost.css'
222
+ 'core/server/frontend/ghost.min.css': 'core/frontend/public/ghost.css'
223
223
  }
224
224
  }
225
225
  },
package/PRIVACY.md CHANGED
@@ -22,6 +22,9 @@ All of the information and code related to this service is available in the [upd
22
22
 
23
23
  Ghost uses a number of third party services for specific functionality within Ghost.
24
24
 
25
+ ### UNPKG
26
+ To easily load member functionality for membership features, Ghost leverages [UNPKG](https://unpkg.com) to provide a CDN for drop-in script known as Portal. If member signups are disabled, no CDN will be injected.
27
+
25
28
  ### Gravatar
26
29
 
27
30
  To automatically populate your profile picture, Ghost pings [Gravatar](http://gravatar.com) to see if your email address is associated with a profile there. If it is, we pull in your profile picture. If not: nothing happens.
@@ -1,8 +1,8 @@
1
1
  # Content / Adapters
2
2
 
3
3
 
4
- An adapter is a way to override a default behaviour in Ghost.
5
- The default behaviour in Ghost is as following:
4
+ An adapter is a way to override a default behavior in Ghost.
5
+ The default behavior in Ghost is as following:
6
6
 
7
7
  ### LocalFileStorage
8
8
  By default Ghost will upload your images to the `content/images` folder.
package/core/boot.js CHANGED
@@ -16,14 +16,19 @@ const debug = require('@tryghost/debug')('boot');
16
16
  * Helper class to create consistent log messages
17
17
  */
18
18
  class BootLogger {
19
- constructor(logging, startTime) {
19
+ constructor(logging, metrics, startTime) {
20
20
  this.logging = logging;
21
+ this.metrics = metrics;
21
22
  this.startTime = startTime;
22
23
  }
23
24
  log(message) {
24
25
  let {logging, startTime} = this;
25
26
  logging.info(`Ghost ${message} in ${(Date.now() - startTime) / 1000}s`);
26
27
  }
28
+ metric(name) {
29
+ let {metrics, startTime} = this;
30
+ metrics.metric(name, Date.now() - startTime);
31
+ }
27
32
  }
28
33
 
29
34
  /**
@@ -85,9 +90,9 @@ async function initCore({ghostServer, config}) {
85
90
  await settings.syncEmailSettings(config.get('hostSettings:emailVerification:verified'));
86
91
  debug('End: settings');
87
92
 
88
- // The URLService is a core part of Ghost, which depends on models. It needs moving from the frontend to make this clear.
93
+ // The URLService is a core part of Ghost, which depends on models.
89
94
  debug('Begin: Url Service');
90
- const urlService = require('./frontend/services/url');
95
+ const urlService = require('./server/services/url');
91
96
  // Note: there is no await here, we do not wait for the url service to finish
92
97
  // We can return, but the site will remain in (the shared, not global) maintenance mode until this finishes
93
98
  // This is managed on request: https://github.com/TryGhost/Ghost/blob/main/core/server/web/shared/middlewares/maintenance.js#L13
@@ -117,6 +122,9 @@ async function initServicesForFrontend() {
117
122
  debug('End: Routing Settings');
118
123
 
119
124
  debug('Begin: Themes');
125
+ // customThemSettingsService.api must be initialized before any theme activation occurs
126
+ const customThemeSettingsService = require('./server/services/custom-theme-settings');
127
+ customThemeSettingsService.init();
120
128
  const themeService = require('./server/services/themes');
121
129
  await themeService.init();
122
130
  debug('End: Themes');
@@ -150,7 +158,7 @@ async function initExpressApps() {
150
158
 
151
159
  /**
152
160
  * Dynamic routing is generated from the routes.yaml file
153
- * When Ghost's DB and core are loaded, we can access this file and call routing.bootstrap.start
161
+ * When Ghost's DB and core are loaded, we can access this file and call routing.routingManager.start
154
162
  * However this _must_ happen after the express Apps are loaded, hence why this is here and not in initFrontend
155
163
  * Routing is currently tightly coupled between the frontend and backend
156
164
  */
@@ -165,7 +173,7 @@ async function initDynamicRouting() {
165
173
  const routeSettings = await routeSettingsService.loadRouteSettings();
166
174
  debug(`Frontend API Version: ${apiVersion}`);
167
175
 
168
- routing.bootstrap.start(apiVersion, routeSettings);
176
+ routing.routerManager.start(apiVersion, routeSettings);
169
177
  const getRoutesHash = () => routeSettingsService.api.getCurrentHash();
170
178
 
171
179
  const settings = require('./server/services/settings');
@@ -286,6 +294,7 @@ async function bootGhost() {
286
294
  let config;
287
295
  let ghostServer;
288
296
  let logging;
297
+ let metrics;
289
298
 
290
299
  // These require their own try-catch block and error format, because we can't log an error if logging isn't working
291
300
  try {
@@ -298,7 +307,8 @@ async function bootGhost() {
298
307
  // Logging is used absolutely everywhere
299
308
  debug('Begin: Load logging');
300
309
  logging = require('@tryghost/logging');
301
- bootLogger = new BootLogger(logging, startTime);
310
+ metrics = require('@tryghost/metrics');
311
+ bootLogger = new BootLogger(logging, metrics, startTime);
302
312
  debug('End: Load logging');
303
313
 
304
314
  // At this point logging is required, so we can handle errors better
@@ -320,12 +330,6 @@ async function bootGhost() {
320
330
  require('./shared/sentry');
321
331
  debug('End: Load sentry');
322
332
 
323
- // I18n is basically used to colocate all of our error message strings & required to log server start messages
324
- debug('Begin: i18n');
325
- const i18n = require('./shared/i18n');
326
- i18n.init();
327
- debug('End: i18n');
328
-
329
333
  // Step 2 - Start server with minimal app in global maintenance mode
330
334
  debug('Begin: load server + minimal app');
331
335
  const rootApp = require('./app');
@@ -359,6 +363,7 @@ async function bootGhost() {
359
363
 
360
364
  // Step 6 - We are technically done here - let everyone know!
361
365
  bootLogger.log('booted');
366
+ bootLogger.metric('boot-time');
362
367
  notifyServerReady();
363
368
 
364
369
  // Step 7 - Init our background services, we don't wait for this to finish
package/core/bridge.js CHANGED
@@ -16,6 +16,7 @@ const config = require('./shared/config');
16
16
  const logging = require('@tryghost/logging');
17
17
  const tpl = require('@tryghost/tpl');
18
18
  const themeEngine = require('./frontend/services/theme-engine');
19
+ const routerManager = require('./frontend/services/routing').routerManager;
19
20
  const settingsCache = require('./shared/settings-cache');
20
21
 
21
22
  // Listen to settings.lang.edited, similar to the member service and models/base/listeners
@@ -35,6 +36,13 @@ class Bridge {
35
36
  debug('Active theme init18n');
36
37
  this.getActiveTheme().initI18n({locale: model.get('value')});
37
38
  });
39
+
40
+ // NOTE: eventually this event should somehow be listened on and handled by the URL Service
41
+ // for now this eliminates the need for the frontend routing to listen to
42
+ // server events
43
+ events.on('settings.timezone.edited', (model) => {
44
+ routerManager.handleTimezoneEdit(model);
45
+ });
38
46
  }
39
47
 
40
48
  getActiveTheme() {
@@ -80,7 +88,7 @@ class Bridge {
80
88
  reloadFrontend() {
81
89
  const apiVersion = this.getFrontendApiVersion();
82
90
  debug('reload frontend', apiVersion);
83
- const siteApp = require('./server/web/site/app');
91
+ const siteApp = require('./frontend/web/site');
84
92
  siteApp.reload({apiVersion});
85
93
  }
86
94
  }
@@ -1,8 +1,8 @@
1
- (window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[3],{440:function(t,e,n){"use strict"
1
+ (window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[3],{604:function(t,e,n){"use strict"
2
2
  n.r(e),n.d(e,"Integrations",(function(){return G})),n.d(e,"Span",(function(){return W.a})),n.d(e,"Transaction",(function(){return J.a})),n.d(e,"registerRequestInstrumentation",(function(){return A})),n.d(e,"defaultRequestInstrumentationOptions",(function(){return R})),n.d(e,"SpanStatus",(function(){return u.a})),n.d(e,"IdleTransaction",(function(){return c.b})),n.d(e,"startIdleTransaction",(function(){return o.b})),n.d(e,"addExtensionMethods",(function(){return o.a})),n.d(e,"extractTraceparentData",(function(){return d.b})),n.d(e,"getActiveTransaction",(function(){return d.c})),n.d(e,"hasTracingEnabled",(function(){return d.d})),n.d(e,"stripUrlQueryAndFragment",(function(){return s.k})),n.d(e,"TRACEPARENT_REGEXP",(function(){return d.a}))
3
3
  var i={}
4
4
  n.r(i),n.d(i,"Express",(function(){return q})),n.d(i,"Postgres",(function(){return L})),n.d(i,"Mysql",(function(){return z})),n.d(i,"Mongo",(function(){return Y}))
5
- var a=n(0),r=n(11),s=n(5),o=n(444),c=n(445),u=n(443),d=n(442),p=Object(s.f)(),l=n(10),m=n(50),h=n(22),f=function(t,e,n){var i
5
+ var a=n(0),r=n(18),s=n(5),o=n(608),c=n(609),u=n(607),d=n(606),p=Object(s.f)(),l=n(17),m=n(83),h=n(33),f=function(t,e,n){var i
6
6
  return function(a){e.value>=0&&(a||n)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},v=function(t,e){return{name:t,value:null!=e?e:-1,delta:0,entries:[],id:"v2-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12)}},g=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){if("first-input"===t&&!("PerformanceEventTiming"in self))return
7
7
  var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}))
8
8
  return n.observe({type:t,buffered:!0}),n}}catch(t){}},_=function(t,e){var n=function(i){"pagehide"!==i.type&&"hidden"!==Object(s.f)().document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))}
@@ -46,7 +46,7 @@ if(n){var i=Object(d.e)(m.b),a=Object(d.e)(n.startTime)
46
46
  r.a.log("[Measurements] Adding FID"),t._measurements.fid={value:e.value},t._measurements["mark.fid"]={value:i+a}}}))},t}()
47
47
  function E(t){var e=t.transaction,n=t.entry,i=t.event,a=t.timeOrigin,r=t.eventEnd,s=t.description,o=r?n[r]:n[i+"End"],c=n[i+"Start"]
48
48
  c&&o&&x(e,{op:"browser",description:null!=s?s:i,startTimestamp:a+Object(d.e)(c),endTimestamp:a+Object(d.e)(o)})}function x(t,e){var n=e.startTimestamp,i=Object(a.d)(e,["startTimestamp"])
49
- return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(a.a)({startTimestamp:n},i))}function I(t){return"number"==typeof t&&isFinite(t)}var C=n(9),k=n(56),w=n(4),R={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
49
+ return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(a.a)({startTimestamp:n},i))}function I(t){return"number"==typeof t&&isFinite(t)}var C=n(12),k=n(91),w=n(4),R={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
50
50
  function A(t){var e=Object(a.a)(Object(a.a)({},R),t),n=e.traceFetch,i=e.traceXHR,r=e.tracingOrigins,s=e.shouldCreateSpanForRequest,o={},c=function(t){if(o[t])return o[t]
51
51
  var e=r
52
52
  return o[t]=e.some((function(e){return Object(C.a)(t,e)}))&&!Object(C.a)(t,"sentry_key"),o[t]},p=c
@@ -115,15 +115,15 @@ return t.call.apply(t,Object(a.e)([this],u.slice(0,-1),[function(t,e){var n
115
115
  null===(n=v)||void 0===n||n.finish(),p(t,e)}]))}}))}},t.prototype._getSpanContextFromOperationArguments=function(t,e,n){var i={collectionName:t.collectionName,dbName:t.dbName,namespace:t.namespace},r={op:"db",description:e,data:i},s=U[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations
116
116
  if(!s||!o)return r
117
117
  try{if("mapReduce"===e){var c=Object(a.c)(n,2),u=c[0],d=c[1]
118
- i[s[0]]="string"==typeof u?u:u.name||"<anonymous>",i[s[1]]="string"==typeof d?d:d.name||"<anonymous>"}else for(var p=0;p<s.length;p++)i[s[p]]=JSON.stringify(n[p])}catch(t){}return r},t.id="Mongo",t}(),W=n(446),J=n(447),G=Object(a.a)(Object(a.a)({},i),{BrowserTracing:D})
119
- Object(o.a)()},442:function(t,e,n){"use strict"
118
+ i[s[0]]="string"==typeof u?u:u.name||"<anonymous>",i[s[1]]="string"==typeof d?d:d.name||"<anonymous>"}else for(var p=0;p<s.length;p++)i[s[p]]=JSON.stringify(n[p])}catch(t){}return r},t.id="Mongo",t}(),W=n(610),J=n(611),G=Object(a.a)(Object(a.a)({},i),{BrowserTracing:D})
119
+ Object(o.a)()},606:function(t,e,n){"use strict"
120
120
  n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return o})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return u}))
121
- var i=n(441),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
121
+ var i=n(605),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
122
122
  function r(t){var e
123
123
  return void 0===t&&(t=null===(e=Object(i.b)().getClient())||void 0===e?void 0:e.getOptions()),!!t&&("tracesSampleRate"in t||"tracesSampler"in t)}function s(t){var e=t.match(a)
124
124
  if(e){var n=void 0
125
125
  return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}}function o(t){var e,n
126
- return void 0===t&&(t=Object(i.b)()),null===(n=null===(e=t)||void 0===e?void 0:e.getScope())||void 0===n?void 0:n.getTransaction()}function c(t){return t/1e3}function u(t){return 1e3*t}},443:function(t,e,n){"use strict"
126
+ return void 0===t&&(t=Object(i.b)()),null===(n=null===(e=t)||void 0===e?void 0:e.getScope())||void 0===n?void 0:n.getTransaction()}function c(t){return t/1e3}function u(t){return 1e3*t}},607:function(t,e,n){"use strict"
127
127
  var i
128
128
  n.d(e,"a",(function(){return i})),function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(i||(i={})),function(t){t.fromHttpCode=function(e){if(e<400)return t.Ok
129
129
  if(e>=400&&e<500)switch(e){case 401:return t.Unauthenticated
@@ -135,18 +135,18 @@ case 429:return t.ResourceExhausted
135
135
  default:return t.InvalidArgument}if(e>=500&&e<600)switch(e){case 501:return t.Unimplemented
136
136
  case 503:return t.Unavailable
137
137
  case 504:return t.DeadlineExceeded
138
- default:return t.InternalError}return t.UnknownError}}(i||(i={}))},444:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return v}))
139
- var i=n(0),a=n(441),r=n(57),s=n(11),o=n(10),c=n(449),u=n(445),d=n(447),p=n(442)
138
+ default:return t.InternalError}return t.UnknownError}}(i||(i={}))},608:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return v}))
139
+ var i=n(0),a=n(605),r=n(92),s=n(18),o=n(17),c=n(613),u=n(609),d=n(611),p=n(606)
140
140
  function l(){var t=this.getScope()
141
141
  if(t){var e=t.getSpan()
142
- if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function m(t,e,n){return Object(p.d)()?void 0!==t.sampled?(t.setMetadata({transactionSampling:{method:r.a.Explicit}}),t):("function"==typeof e.tracesSampler?(i=e.tracesSampler(n),t.setMetadata({transactionSampling:{method:r.a.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,t.setMetadata({transactionSampling:{method:r.a.Inheritance}})):(i=e.tracesSampleRate,t.setMetadata({transactionSampling:{method:r.a.Rate,rate:Number(i)}})),function(t){return isNaN(t)||"number"!=typeof t&&"boolean"!=typeof t?(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(t)+" of type "+JSON.stringify(typeof t)+"."),!1):!(t<0||t>1)||(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+t+"."),!1)}(i)?i?(t.sampled=Math.random()<i,t.sampled?(s.a.log("[Tracing] starting "+t.op+" transaction - "+t.name),t):(s.a.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),t)):(s.a.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(s.a.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)):(t.sampled=!1,t)
142
+ if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function m(t,e,n){return Object(p.d)(e)?void 0!==t.sampled?(t.setMetadata({transactionSampling:{method:r.a.Explicit}}),t):("function"==typeof e.tracesSampler?(i=e.tracesSampler(n),t.setMetadata({transactionSampling:{method:r.a.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,t.setMetadata({transactionSampling:{method:r.a.Inheritance}})):(i=e.tracesSampleRate,t.setMetadata({transactionSampling:{method:r.a.Rate,rate:Number(i)}})),function(t){return isNaN(t)||"number"!=typeof t&&"boolean"!=typeof t?(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(t)+" of type "+JSON.stringify(typeof t)+"."),!1):!(t<0||t>1)||(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+t+"."),!1)}(i)?i?(t.sampled=Math.random()<i,t.sampled?(s.a.log("[Tracing] starting "+t.op+" transaction - "+t.name),t):(s.a.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),t)):(s.a.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(s.a.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)):(t.sampled=!1,t)
143
143
  var i}function h(t,e){var n,a,r=(null===(n=this.getClient())||void 0===n?void 0:n.getOptions())||{},s=new d.a(t,this)
144
144
  return(s=m(s,r,Object(i.a)({parentSampled:t.parentSampled,transactionContext:t},e))).sampled&&s.initSpanRecorder(null===(a=r._experiments)||void 0===a?void 0:a.maxSpans),s}function f(t,e,n,a,r){var s,o,c=(null===(s=t.getClient())||void 0===s?void 0:s.getOptions())||{},d=new u.b(e,t,n,a)
145
145
  return(d=m(d,c,Object(i.a)({parentSampled:e.parentSampled,transactionContext:e},r))).sampled&&d.initSpanRecorder(null===(o=c._experiments)||void 0===o?void 0:o.maxSpans),d}function v(){var e;(e=Object(a.d)()).__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=h),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=l)),Object(o.b)()&&function(){var e=Object(a.d)()
146
146
  if(e.__SENTRY__){var n={mongodb:function(){return new(Object(o.a)(t,"./integrations/mongo").Mongo)},mongoose:function(){return new(Object(o.a)(t,"./integrations/mongo").Mongo)({mongoose:!0})},mysql:function(){return new(Object(o.a)(t,"./integrations/mysql").Mysql)},pg:function(){return new(Object(o.a)(t,"./integrations/postgres").Postgres)}},r=Object.keys(n).filter((function(t){return!!Object(o.c)(t)})).map((function(t){try{return n[t]()}catch(t){return}})).filter((function(t){return t}))
147
- r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(31)(t))},445:function(t,e,n){"use strict"
147
+ r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(48)(t))},609:function(t,e,n){"use strict"
148
148
  n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return p}))
149
- var i=n(0),a=n(50),r=n(11),s=n(446),o=n(443),c=n(447),u=1e3,d=function(t){function e(e,n,i,a){void 0===i&&(i="")
149
+ var i=n(0),a=n(83),r=n(18),s=n(610),o=n(607),c=n(611),u=1e3,d=function(t){function e(e,n,i,a){void 0===i&&(i="")
150
150
  var r=t.call(this,a)||this
151
151
  return r._pushActivity=e,r._popActivity=n,r.transactionSpanId=i,r}return Object(i.b)(e,t),e.prototype.add=function(e){var n=this
152
152
  e.spanId!==this.transactionSpanId&&(e.finish=function(t){e.endTimestamp="number"==typeof t?t:Object(a.e)(),n._popActivity(e.spanId)},void 0===e.endTimestamp&&this._pushActivity(e.spanId)),t.prototype.add.call(this,e)},e}(s.b),p=function(t){function e(e,n,i,a){void 0===i&&(i=u),void 0===a&&(a=!1)
@@ -164,9 +164,9 @@ setTimeout((function(){e._finished||e.finish(i)}),n)}},e.prototype._beat=functio
164
164
  t===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(r.a.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(o.a.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},e.prototype._pingHeartbeat=function(){var t=this
165
165
  r.a.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),setTimeout((function(){t._beat()}),5e3)},e}(c.a)
166
166
  function l(t){if(t){var e=t.getScope()
167
- e&&e.getTransaction()&&e.setSpan(void 0)}}},446:function(t,e,n){"use strict"
167
+ e&&e.getTransaction()&&e.setSpan(void 0)}}},610:function(t,e,n){"use strict"
168
168
  n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}))
169
- var i=n(0),a=n(5),r=n(50),s=n(7),o=n(443),c=function(){function t(t){void 0===t&&(t=1e3),this.spans=[],this._maxlen=t}return t.prototype.add=function(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)},t}(),u=function(){function t(t){if(this.traceId=Object(a.l)(),this.spanId=Object(a.l)().substring(16),this.startTimestamp=Object(r.e)(),this.tags={},this.data={},!t)return this
169
+ var i=n(0),a=n(5),r=n(83),s=n(7),o=n(607),c=function(){function t(t){void 0===t&&(t=1e3),this.spans=[],this._maxlen=t}return t.prototype.add=function(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)},t}(),u=function(){function t(t){if(this.traceId=Object(a.l)(),this.spanId=Object(a.l)().substring(16),this.startTimestamp=Object(r.e)(),this.tags={},this.data={},!t)return this
170
170
  t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}return t.prototype.child=function(t){return this.startChild(t)},t.prototype.startChild=function(e){var n=new t(Object(i.a)(Object(i.a)({},e),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}))
171
171
  return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},t.prototype.setTag=function(t,e){var n
172
172
  return this.tags=Object(i.a)(Object(i.a)({},this.tags),((n={})[t]=e,n)),this},t.prototype.setData=function(t,e){var n
@@ -174,20 +174,20 @@ return this.data=Object(i.a)(Object(i.a)({},this.data),((n={})[t]=e,n)),this},t.
174
174
  var e=o.a.fromHttpCode(t)
175
175
  return e!==o.a.UnknownError&&this.setStatus(e),this},t.prototype.isSuccess=function(){return this.status===o.a.Ok},t.prototype.finish=function(t){this.endTimestamp="number"==typeof t?t:Object(r.e)()},t.prototype.toTraceparent=function(){var t=""
176
176
  return void 0!==this.sampled&&(t=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+t},t.prototype.toContext=function(){return Object(s.a)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},t.prototype.updateWithContext=function(t){var e,n,i,a,r
177
- return this.data=null!=(e=t.data)?e:{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=null!=(n=t.spanId)?n:this.spanId,this.startTimestamp=null!=(i=t.startTimestamp)?i:this.startTimestamp,this.status=t.status,this.tags=null!=(a=t.tags)?a:{},this.traceId=null!=(r=t.traceId)?r:this.traceId,this},t.prototype.getTraceContext=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},t.prototype.toJSON=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},t}()},447:function(t,e,n){"use strict"
177
+ return this.data=null!=(e=t.data)?e:{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=null!=(n=t.spanId)?n:this.spanId,this.startTimestamp=null!=(i=t.startTimestamp)?i:this.startTimestamp,this.status=t.status,this.tags=null!=(a=t.tags)?a:{},this.traceId=null!=(r=t.traceId)?r:this.traceId,this},t.prototype.getTraceContext=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},t.prototype.toJSON=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},t}()},611:function(t,e,n){"use strict"
178
178
  n.d(e,"a",(function(){return d}))
179
- var i=n(0),a=n(441),r=n(53),s=n(4),o=n(11),c=n(7),u=n(446),d=function(t){function e(e,n){var i=t.call(this,e)||this
180
- return i._measurements={},i._hub=Object(a.b)(),Object(s.g)(n,a.a)&&(i._hub=n),i.name=e.name||"",i.metadata=e.metadata||{},i._trimEnd=e.trimEnd,i.transaction=i,i}return Object(i.b)(e,t),e.prototype.setName=function(t){this.name=t},e.prototype.initSpanRecorder=function(t){void 0===t&&(t=1e3),this.spanRecorder||(this.spanRecorder=new u.b(t)),this.spanRecorder.add(this)},e.prototype.setMeasurements=function(t){this._measurements=Object(i.a)({},t)},e.prototype.setMetadata=function(t){this.metadata=Object(i.a)(Object(i.a)({},this.metadata),t)},e.prototype.finish=function(e){var n,i,a,s=this
181
- if(void 0===this.endTimestamp){if(this.name||(o.a.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),t.prototype.finish.call(this,e),!0!==this.sampled)return o.a.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(null===(a=null===(n=this._hub.getClient())||void 0===n?void 0:(i=n.getTransport()).recordLostEvent)||void 0===a||a.call(i,r.a.SampleRate,"transaction"))
182
- var c=this.spanRecorder?this.spanRecorder.spans.filter((function(t){return t!==s&&t.endTimestamp})):[]
183
- this._trimEnd&&c.length>0&&(this.endTimestamp=c.reduce((function(t,e){return t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t})).endTimestamp)
184
- var u={contexts:{trace:this.getTraceContext()},spans:c,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata}
185
- return Object.keys(this._measurements).length>0&&(o.a.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),u.measurements=this._measurements),o.a.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(u)}},e.prototype.toContext=function(){var e=t.prototype.toContext.call(this)
179
+ var i=n(0),a=n(605),r=n(88),s=n(4),o=n(18),c=n(7),u=n(610),d=function(t){function e(e,n){var i=t.call(this,e)||this
180
+ return i._measurements={},i._hub=Object(a.b)(),Object(s.g)(n,a.a)&&(i._hub=n),i.name=e.name||"",i.metadata=e.metadata||{},i._trimEnd=e.trimEnd,i.transaction=i,i}return Object(i.b)(e,t),e.prototype.setName=function(t){this.name=t},e.prototype.initSpanRecorder=function(t){void 0===t&&(t=1e3),this.spanRecorder||(this.spanRecorder=new u.b(t)),this.spanRecorder.add(this)},e.prototype.setMeasurements=function(t){this._measurements=Object(i.a)({},t)},e.prototype.setMetadata=function(t){this.metadata=Object(i.a)(Object(i.a)({},this.metadata),t)},e.prototype.finish=function(e){var n,i,a,s,c,u=this
181
+ if(void 0===this.endTimestamp){if(this.name||(o.a.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),t.prototype.finish.call(this,e),!0!==this.sampled)return o.a.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(null===(c=null===(a=null===(n=this._hub.getClient())||void 0===n?void 0:(i=n).getTransport)||void 0===a?void 0:(s=a.call(i)).recordLostEvent)||void 0===c||c.call(s,r.a.SampleRate,"transaction"))
182
+ var d=this.spanRecorder?this.spanRecorder.spans.filter((function(t){return t!==u&&t.endTimestamp})):[]
183
+ this._trimEnd&&d.length>0&&(this.endTimestamp=d.reduce((function(t,e){return t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t})).endTimestamp)
184
+ var p={contexts:{trace:this.getTraceContext()},spans:d,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata}
185
+ return Object.keys(this._measurements).length>0&&(o.a.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),p.measurements=this._measurements),o.a.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(p)}},e.prototype.toContext=function(){var e=t.prototype.toContext.call(this)
186
186
  return Object(c.a)(Object(i.a)(Object(i.a)({},e),{name:this.name,trimEnd:this._trimEnd}))},e.prototype.updateWithContext=function(e){var n
187
- return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},449:function(t,e,n){"use strict"
187
+ return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},613:function(t,e,n){"use strict"
188
188
  n.d(e,"a",(function(){return o}))
189
- var i=n(56),a=n(11),r=n(443),s=n(442)
189
+ var i=n(91),a=n(18),r=n(607),s=n(606)
190
190
  function o(){Object(i.a)({callback:c,type:"error"}),Object(i.a)({callback:c,type:"unhandledrejection"})}function c(){var t=Object(s.c)()
191
191
  t&&(a.a.log("[Tracing] Transaction: "+r.a.InternalError+" -> Global error occured"),t.setStatus(r.a.InternalError))}}}])
192
192
 
193
- //# sourceMappingURL=chunk.3.b80d3e1e6b8556aaff3c.map
193
+ //# sourceMappingURL=chunk.3.777d43e2ce954ba8b2f5.map
@@ -317,7 +317,7 @@ return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBo
317
317
  if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[]
318
318
  if(n){t.measure.width=i
319
319
  for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],u=a[l+1]
320
- Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Hr(t.map,r,n),s=o.node,u=o.start,c=o.end,d=o.collapse
320
+ Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),o=function(e,t,r,n){var i,o=Hr(t.map,r,n),s=o.node,u=o.start,c=o.end,d=o.collapse
321
321
  if(3==s.nodeType){for(var f=0;f<4;f++){for(;u&&ne(t.line.text.charAt(o.coverStart+u));)--u
322
322
  for(;o.coverStart+c<o.coverEnd&&ne(t.line.text.charAt(o.coverStart+c));)++c
323
323
  if((i=a&&l<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Ir(L(s,u,c).getClientRects(),n)).left||i.right||0==u)break
@@ -328,7 +328,7 @@ var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDP
328
328
  return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var h
329
329
  u>0&&(d=n="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==n?h.length-1:0]:s.getBoundingClientRect()}if(a&&l<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0]
330
330
  i=p?{left:p.left,right:p.left+nn(e.display),top:p.top,bottom:p.bottom}:Pr}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var w=b?y[b-1]:0,x=y[b],k={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:x}
331
- return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=g,k.rbottom=m),k}(e,t,r,n)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var zr,Pr={left:0,right:0,top:0,bottom:0}
331
+ return i.left||i.right||(k.bogus=!0),e.options.singleCursorHeightPerLine||(k.rtop=g,k.rbottom=m),k}(e,t,r,n),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var zr,Pr={left:0,right:0,top:0,bottom:0}
332
332
  function Hr(e,t,r){for(var n,i,o,a,l,s,u=0;u<e.length;u+=3)if(l=e[u],s=e[u+1],t<l?(i=0,o=1,a="left"):t<s?o=1+(i=t-l):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-l)-1,t>=s&&(a="right")),null!=i){if(n=e[u+2],l==s&&r==(n.insertLeft?"left":"right")&&(a=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],a="left"
333
333
  if("right"==r&&i==s-l)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],a="right"
334
334
  break}return{node:n,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function Ir(e,t){var r=Pr
@@ -503,15 +503,15 @@ e.updatedDisplay&&Tn(t),e.barMeasure=Fn(t),r.maxLineChanged&&!t.options.lineWrap
503
503
  null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&En(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1)
504
504
  var r=e.focus&&e.focus==D()
505
505
  e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&jn(t,e.barMeasure),e.updatedDisplay&&ci(t,e.barMeasure),e.selectionChanged&&xn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&kn(e.cm)}function Qn(e){var t=e.cm,r=t.display,n=t.doc
506
- e.updatedDisplay&&li(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&In(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&En(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null
507
- if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-kr(e.display))+"px;\n height: "+(t.bottom-t.top+Lr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;")
508
- e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i
506
+ if(e.updatedDisplay&&li(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&In(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&En(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=function(e,t,r,n){var i
509
507
  null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t)
510
508
  for(var o=0;o<5;o++){var a=!1,l=qr(e,t),s=r&&r!=t?qr(e,r):l,u=An(e,i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-n,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+n}),c=e.doc.scrollTop,d=e.doc.scrollLeft
511
- if(null!=u.scrollTop&&(Hn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(En(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,lt(n,e.scrollToPos.from),lt(n,e.scrollToPos.to),e.scrollToPos.margin))
512
- var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers
513
- if(i)for(var a=0;a<i.length;++a)i[a].lines.length||pe(i[a],"hide")
514
- if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&pe(o[l],"unhide")
509
+ if(null!=u.scrollTop&&(Hn(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(En(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,lt(n,e.scrollToPos.from),lt(n,e.scrollToPos.to),e.scrollToPos.margin)
510
+ !function(e,t){if(!ge(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null
511
+ if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-kr(e.display))+"px;\n height: "+(t.bottom-t.top+Lr(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;")
512
+ e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers
513
+ if(o)for(var l=0;l<o.length;++l)o[l].lines.length||pe(o[l],"hide")
514
+ if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&pe(a[s],"unhide")
515
515
  r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Jn(e,t){if(e.curOp)return t()
516
516
  qn(e)
517
517
  try{return t()}finally{_n(e)}}function ei(e,t){return function(){if(e.curOp)return t.apply(e,arguments)
@@ -1057,7 +1057,7 @@ a&&lr(e,"electricInput",e,i.head.line)}}}function Da(e){for(var t=[],r=[],n=0;n<
1057
1057
  r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function za(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function Pa(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;")
1058
1058
  return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),za(e),t}function Ha(e,t,r,n,i){var o=t,a=r,l=qe(e,t.line)
1059
1059
  function s(n){var o,a
1060
- if(null==(o=i?function(e,t,r,n){var i=ue(t,e.doc.direction)
1060
+ if(o=i?function(e,t,r,n){var i=ue(t,e.doc.direction)
1061
1061
  if(!i)return Zo(t,r,n)
1062
1062
  r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after")
1063
1063
  var o=le(i,r.ch,r.sticky),a=i[o]
@@ -1070,7 +1070,7 @@ if(a.from<=u&&u<a.to)return o(u,l)
1070
1070
  if(u=l?a.from:s(a.to,-1),n.begin<=u&&u<n.end)return o(u,l)}},g=p(o+n,n,c)
1071
1071
  if(g)return g
1072
1072
  var m=n>0?c.end:s(c.begin,-1)
1073
- return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,l,t,r):Zo(l,t,r))){if(n||(a=t.line+r)<e.first||a>=e.first+e.size||(t=new et(a,t.ch,t.sticky),!(l=qe(e,a))))return!1
1073
+ return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,l,t,r):Zo(l,t,r),null==o){if(n||(a=t.line+r)<e.first||a>=e.first+e.size||(t=new et(a,t.ch,t.sticky),!(l=qe(e,a))))return!1
1074
1074
  t=Qo(i,e.cm,l,t.line,r)}else t=o
1075
1075
  return!0}if("char"==n)s()
1076
1076
  else if("column"==n)s(!0)
@@ -1409,8 +1409,8 @@ if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTa
1409
1409
  if("="==i)return o="equals",null
1410
1410
  if("<"==i){t.tokenize=d,t.state=y,t.tagName=t.tagStart=null
1411
1411
  var a=t.tokenize(e,t)
1412
- return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(r=i,(n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=f
1413
- break}return"string"}).isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d
1412
+ return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(r=i,n=function(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=f
1413
+ break}return"string"},n.isInAttribute=!0,n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=d
1414
1414
  break}r.next()}return e}}function p(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=p(e+1),r.tokenize(t,r)
1415
1415
  if(">"==n){if(1==e){r.tokenize=d
1416
1416
  break}return r.tokenize=p(e-1),r.tokenize(t,r)}}return"meta"}}function g(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(s.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function m(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var r;;){if(!e.context)return
@@ -1436,4 +1436,4 @@ if(!a||!a.hasOwnProperty(o[2]))break
1436
1436
  i=i.prev}for(;i&&i.prev&&!i.startOfLine;)i=i.prev
1437
1437
  return i?i.indent+l:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:s.htmlMode?"html":"xml",helperType:s.htmlMode?"html":"xml",skipAttribute:function(e){e.state==L&&(e.state=C)}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}))
1438
1438
 
1439
- //# sourceMappingURL=codemirror-21a09582262987037db73b152fb35f7c.map
1439
+ //# sourceMappingURL=codemirror-d25c379b87ec8b33d54ac7149bc0b6ae.map