ghost 6.53.0 → 6.54.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.
- package/components/ghost-storage-base-3.0.0.tgz +0 -0
- package/components/tryghost-adapter-base-cache-0.2.0.tgz +0 -0
- package/components/tryghost-adapter-base-scheduling-0.2.0.tgz +0 -0
- package/components/tryghost-adapter-base-sso-0.1.1.tgz +0 -0
- package/components/tryghost-admin-api-schema-0.0.0.tgz +0 -0
- package/components/tryghost-custom-field-types-0.0.0.tgz +0 -0
- package/components/tryghost-i18n-0.0.0.tgz +0 -0
- package/components/tryghost-kg-converters-1.2.3.tgz +0 -0
- package/components/tryghost-kg-default-nodes-2.1.3.tgz +0 -0
- package/components/tryghost-kg-lexical-html-renderer-1.4.3.tgz +0 -0
- package/core/boot.js +9 -6
- package/core/built/admin/assets/Combination-CJG7Flp-.js +41 -0
- package/core/built/admin/assets/Growth-BTP1LthE.js +3 -0
- package/core/built/admin/assets/Newsletters-CSEX0myc.js +1 -0
- package/core/built/admin/assets/Overview-BjACEsJF.js +1 -0
- package/core/built/admin/assets/{PolarAngleAxis-pciQ0MOy.js → PolarAngleAxis-BGjf7sBu.js} +1 -1
- package/core/built/admin/assets/{RadialBarChart-DWmw2PcX.js → RadialBarChart-zeFf9mBz.js} +1 -1
- package/core/built/admin/assets/Web-CxxxjCcv.js +2 -0
- package/core/built/admin/assets/account-migration-BklF2I_I.js +1 -0
- package/core/built/admin/assets/activitypub/{account-migration-BPZG37DJ.js → account-migration-CNovr6W-.js} +13 -13
- package/core/built/admin/assets/activitypub/activitypub.js +8 -8
- package/core/built/admin/assets/activitypub/{avatar-ZYco0ITb.js → avatar-B3DEDB1l.js} +10 -10
- package/core/built/admin/assets/activitypub/{avatar-flipboard-D541lc4F.js → avatar-flipboard-Cqrg0XMx.js} +3 -3
- package/core/built/admin/assets/activitypub/{bluesky-sharing-NOHUtHjl.js → bluesky-sharing-Ceslb1_M.js} +38 -37
- package/core/built/admin/assets/activitypub/{chunk-KS7C4IRE-B-GOFDPZ.js → chunk-KS7C4IRE-D4HEcEwi.js} +716 -710
- package/core/built/admin/assets/activitypub/{content-formatters-bwrp4iEO.js → content-formatters-BpQARh28.js} +229 -181
- package/core/built/admin/assets/activitypub/{copy-C7m7ovHw.js → copy-D9UWIAan.js} +2 -2
- package/core/built/admin/assets/activitypub/{dist-BqkDUQxJ2.js → dist-ByFmDSNP2.js} +64 -63
- package/core/built/admin/assets/activitypub/{dist-B5ira32t.js → dist-DHAjBcV3.js} +5 -5
- package/core/built/admin/assets/activitypub/{domain-iqE4YXwD.js → domain-C1qQvJ8C.js} +33 -33
- package/core/built/admin/assets/activitypub/{edit-profile-B8MFYh28.js → edit-profile-BcH-jEfM.js} +46 -45
- package/core/built/admin/assets/activitypub/{explore-BbdKodp3.js → explore-AxwBh9dI.js} +20 -20
- package/core/built/admin/assets/activitypub/{feed-Cl3A5owG.js → feed-BaOlbh7a.js} +15 -15
- package/core/built/admin/assets/activitypub/{field-DL6WyR-c.js → field-B7mYYQpN.js} +13 -13
- package/core/built/admin/assets/activitypub/{hash-6G3DzwL9.js → hash-BC9Q0N4c.js} +2 -2
- package/core/built/admin/assets/activitypub/{inbox-YmhuBice.js → inbox-DQ4ZnC1m.js} +2 -2
- package/core/built/admin/assets/activitypub/inbox-vXez-5uJ.js +1221 -0
- package/core/built/admin/assets/activitypub/{label-DGbLjDvE.js → label-Chv5T8bw.js} +6 -6
- package/core/built/admin/assets/activitypub/layout-CziktJXo.js +1 -0
- package/core/built/admin/assets/activitypub/{moderation-qnBtk1zS.js → moderation-DtSM2i1I.js} +32 -31
- package/core/built/admin/assets/activitypub/{note-C7ZRoSJv.js → note-Dckp4S-2.js} +21 -21
- package/core/built/admin/assets/activitypub/{notifications-DiEA4b1o.js → notifications-CG5T22vg.js} +17 -17
- package/core/built/admin/assets/activitypub/{onboarding-_JVgEwgV.js → onboarding-BFDkzeR2.js} +2 -2
- package/core/built/admin/assets/activitypub/{onboarding-DG4zu3qM.js → onboarding-D6rcBdPe.js} +5 -5
- package/core/built/admin/assets/activitypub/{preferences-B3FtocnP.js → preferences-D_799jdl.js} +1607 -1606
- package/core/built/admin/assets/activitypub/{profile-D8ZJfYXB.js → profile-D2JfXBQl.js} +264 -263
- package/core/built/admin/assets/activitypub/{reply-C1vggenw.js → reply-CpdMeAO5.js} +2 -2
- package/core/built/admin/assets/activitypub/{routes-BOii-V9n.js → routes-CCHe2dQp.js} +1317 -1298
- package/core/built/admin/assets/activitypub/{separator-1gNokN5S.js → separator-BI1FLsYM.js} +4 -4
- package/core/built/admin/assets/activitypub/{settings--9Sb0nbl.js → settings-kx-9Enkz.js} +14 -14
- package/core/built/admin/assets/activitypub/{site-fkMmqv0V.js → site-x4_IjVJ0.js} +10 -10
- package/core/built/admin/assets/activitypub/{step-1-QhivSMw2.js → step-1-DIDg4aHb.js} +15 -15
- package/core/built/admin/assets/activitypub/{step-2-pMk9YwqD.js → step-2-BfGe8BYt.js} +7 -7
- package/core/built/admin/assets/activitypub/{step-3-DvmVC1fo.js → step-3-mE9spAqw.js} +12 -12
- package/core/built/admin/assets/activitypub/{tabs-Dc0FEEYD.js → tabs-CyPRQQ1N.js} +241 -237
- package/core/built/admin/assets/activitypub/{topic-filter-CuDyM5bD.js → topic-filter-DLHBZT93.js} +4 -4
- package/core/built/admin/assets/activitypub/use-activity-pub-queries-VzbN99u_.js +1957 -0
- package/core/built/admin/assets/activitypub/{use-navigate-with-base-path-Drx1kdAK.js → use-navigate-with-base-path-CAwXTmqH.js} +165 -175
- package/core/built/admin/assets/activitypub/{use-reply-chain-data-BHkCHcW5.js → use-reply-chain-data-BAB6fNGt.js} +8 -8
- package/core/built/admin/assets/activitypub/users-BLeiOTHc.js +1464 -0
- package/core/built/admin/assets/activitypub/{x-BHCEe-c2.js → x-C8tAnXly.js} +2 -2
- package/core/built/admin/assets/{audience-adiFehTD.js → audience-X_XsZivI.js} +1 -1
- package/core/built/admin/assets/{automated-emails-UWM02CMr.js → automated-emails-of1MvVsv.js} +1 -1
- package/core/built/admin/assets/automations-B7-y3dXt.js +1 -0
- package/core/built/admin/assets/automations-DRFjW5fw.js +1 -0
- package/core/built/admin/assets/{avatar-flipboard-Lz3F9fNT.js → avatar-flipboard-C6Kj3Awu.js} +1 -1
- package/core/built/admin/assets/bluesky-sharing-BbbjWdzs.js +1 -0
- package/core/built/admin/assets/box-BWbhXh21.js +1 -0
- package/core/built/admin/assets/breadcrumb-B-M9Ip_2.js +1 -0
- package/core/built/admin/assets/card-DGoDJzrn.js +1 -0
- package/core/built/admin/assets/{chart-ChpW-NzQ.js → chart-BuRT2Y6p.js} +14 -14
- package/core/built/admin/assets/chart-helpers-xiSsW8r0.js +1 -0
- package/core/built/admin/assets/checkbox-EhJKHFdZ.js +1 -0
- package/core/built/admin/assets/{chunk.432.c2caa0b20f03e71d1a35.js → chunk.211.6f7328d63c41536451b3.js} +2025 -2819
- package/core/built/admin/assets/{chunk.432.c2caa0b20f03e71d1a35.js.LICENSE.txt → chunk.211.6f7328d63c41536451b3.js.LICENSE.txt} +1 -62
- package/core/built/admin/assets/{chunk.831.0703a12e49f51cec3f3a.js → chunk.361.3cdb584b973959e52ccc.js} +78 -85
- package/core/built/admin/assets/chunk.524.8365cd9280405c0f6216.js +25 -0
- package/core/built/admin/assets/chunk.582.61d078937e6102769f2c.js +27 -0
- package/core/built/admin/assets/code-editor-view-CZtJFGhR.js +1 -0
- package/core/built/admin/assets/comments-CvyXxOyN.js +1 -0
- package/core/built/admin/assets/container-BYz2Ed39.js +1 -0
- package/core/built/admin/assets/data-list-16rkJYYi.js +1 -0
- package/core/built/admin/assets/date-range-select-CTlyo8zW.js +1 -0
- package/core/built/admin/assets/disabled-sources-indicator-qs2GfLvl.js +1 -0
- package/core/built/admin/assets/{dist-DJ6c4_De.js → dist-2Tnz2Yfq.js} +1 -1
- package/core/built/admin/assets/{dist-CsekE4FL.js → dist-CQJY6SVY.js} +1 -1
- package/core/built/admin/assets/dist-CjY-f5Z1.js +1 -0
- package/core/built/admin/assets/dist-DGzPJ_bO.js +4 -0
- package/core/built/admin/assets/dist-DIC8yz5C.js +1 -0
- package/core/built/admin/assets/{dist-BbGrW05X.js → dist-DyViJwIy.js} +1 -1
- package/core/built/admin/assets/dist-Ndy-PuGN.js +1 -0
- package/core/built/admin/assets/dist-P_ohUlTi.js +1 -0
- package/core/built/admin/assets/domain-CPNXKVOV.js +1 -0
- package/core/built/admin/assets/dropzone-BmCXnw6J.js +5 -0
- package/core/built/admin/assets/edit-profile-SGrJve5M.js +1 -0
- package/core/built/admin/assets/editor-BOG2YPUm.js +8 -0
- package/core/built/admin/assets/empty-indicator-oX1u1Pkn.js +1 -0
- package/core/built/admin/assets/esm-CFX93H5M.js +2 -0
- package/core/built/admin/assets/explore-CUYLv9G9.js +1 -0
- package/core/built/admin/assets/feed-CPdJMttL.js +1 -0
- package/core/built/admin/assets/field-D0XISCK2.js +1 -0
- package/core/built/admin/assets/{filter-sources-v39ihhhV.js → filter-sources-Bieps75g.js} +1 -1
- package/core/built/admin/assets/filters-CuB-A7ma.js +1 -0
- package/core/built/admin/assets/filters-bXkkWro8.js +1 -0
- package/core/built/admin/assets/framework-provider-CmtnPXIT.js +4 -0
- package/core/built/admin/assets/{ghost-b57f077997b739a8ae9a70772dc016cb.js → ghost-05f9a7182ed56903dba05878a5b8422b.js} +46 -41
- package/core/built/admin/assets/ghost-dark-c8d0ab7f515b2010c173e23e9b32ea8a.css +1 -0
- package/core/built/admin/assets/gift-link-modal-su8MsRdg.js +1 -0
- package/core/built/admin/assets/{gift-links-CY3GwiVi.js → gift-links-nBxJjZiQ.js} +1 -1
- package/core/built/admin/assets/growth-Ba6S5FQX.js +1 -0
- package/core/built/admin/assets/hooks-BApwwBE0.js +2 -0
- package/core/built/admin/assets/{inbox-TEISAmth.js → inbox-Xx1CdnfO.js} +38 -38
- package/core/built/admin/assets/index-D8PbzuT9.css +1 -0
- package/core/built/admin/assets/index-ukW_0Uie.js +67 -0
- package/core/built/admin/assets/inline-EMAm3okk.js +1 -0
- package/core/built/admin/assets/input-group-CGOXcy4l.js +1 -0
- package/core/built/admin/assets/input-surface-BpAjZXY5.js +1 -0
- package/core/built/admin/assets/{react-dom-C6aoWSfl.js → jsx-runtime-DX3WBWVO.js} +1 -1
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.js +5 -2
- package/core/built/admin/assets/koenig-lexical/koenig-lexical.umd.js +2 -2
- package/core/built/admin/assets/{koenig-lexical-Di7b48ED.js → koenig-lexical-B61IALf5.js} +2 -2
- package/core/built/admin/assets/kpi-card-BlZaG1Lo.js +1 -0
- package/core/built/admin/assets/kpi-card-DCdlyaSS.js +1 -0
- package/core/built/admin/assets/kpi-helpers-DpAuS1Nb.js +1 -0
- package/core/built/admin/assets/kpi-tabs-Dme44bQS.js +1 -0
- package/core/built/admin/assets/label-dSs5aepE.js +1 -0
- package/core/built/admin/assets/label-picker-Uq91atex.js +1 -0
- package/core/built/admin/assets/{labels-GbxlXWtf.js → labels-Cyayfd-e.js} +1 -1
- package/core/built/admin/assets/layout-WUcz6tu1.js +1 -0
- package/core/built/admin/assets/limit-service-9fwD33lU.js +20 -0
- package/core/built/admin/assets/link-helpers-tOlxmuH5.js +1 -0
- package/core/built/admin/assets/list-page-B6ANtzkd.js +1 -0
- package/core/built/admin/assets/mailchimp-Ds_NQ04w.svg +9 -0
- package/core/built/admin/assets/member-custom-fields-NCzrMuba.js +1 -0
- package/core/built/admin/assets/member-detail-DPWDtYnN.js +1 -0
- package/core/built/admin/assets/members-B9rO7qr4.js +10 -0
- package/core/built/admin/assets/modals-CxRaan1J.js +31 -0
- package/core/built/admin/assets/moderation-D8zon60E.js +1 -0
- package/core/built/admin/assets/multi-select-combobox-1wYm3nle.js +1 -0
- package/core/built/admin/assets/newsletter-DbYMRxRS.js +1 -0
- package/core/built/admin/assets/{newsletters-DZm3yLj8.js → newsletters-D1jbtV-h.js} +1 -1
- package/core/built/admin/assets/note-PiWPnnrh.js +1 -0
- package/core/built/admin/assets/notifications-DEgqqB9G.js +1 -0
- package/core/built/admin/assets/nql-lang-B7faUf8D.js +19 -0
- package/core/built/admin/assets/{offers-D11QtPXX.js → offers-CrY6nSRR.js} +1 -1
- package/core/built/admin/assets/onboarding-route-BzF6HeVn.js +1 -0
- package/core/built/admin/assets/overview-DixLeIqY.js +1 -0
- package/core/built/admin/assets/page-header-op0eN36I.js +1 -0
- package/core/built/admin/assets/{pages-BnObVRrf.js → pages-BbNWFcGj.js} +1 -1
- package/core/built/admin/assets/pintura-CXOmq-5H.svg +15 -0
- package/core/built/admin/assets/post-analytics-WwRDEnrV.js +1 -0
- package/core/built/admin/assets/post-analytics-header-DsMoLx0R.js +1 -0
- package/core/built/admin/assets/{post-analytics-provider-DSfBCtnj.js → post-analytics-provider-BJCPLMIb.js} +1 -1
- package/core/built/admin/assets/post-share-modal-Dx-MEjhI.js +1 -0
- package/core/built/admin/assets/{posts-CwH8VJvB.js → posts-EWpZIjkr.js} +1 -1
- package/core/built/admin/assets/preferences-D7-j6A4C.js +5 -0
- package/core/built/admin/assets/profile-Dl69QPp0.js +1 -0
- package/core/built/admin/assets/{referrers-nxR52jPI.js → referrers-BCfFYSHc.js} +1 -1
- package/core/built/admin/assets/router-provider-C1R4AZ2o.js +1 -0
- package/core/built/admin/assets/select-C1qDZnW4.js +1 -0
- package/core/built/admin/assets/settings-BbmC_Iqq.js +4 -0
- package/core/built/admin/assets/settings-H6HxFgfI.js +1 -0
- package/core/built/admin/assets/shade-app-B3heOAfz-CGXQwWeO.js +3 -0
- package/core/built/admin/assets/share-modal-BJCadJyp.js +1 -0
- package/core/built/admin/assets/social-urls-BPL1nADp.js +8 -0
- package/core/built/admin/assets/sort-button-DyYlfYp7.js +1 -0
- package/core/built/admin/assets/source-icon-_ubRDbg_.js +1 -0
- package/core/built/admin/assets/stack-xiN0eQ6Z.js +1 -0
- package/core/built/admin/assets/stats-BQZMGMvn.js +1 -0
- package/core/built/admin/assets/stats-view-Doei-qCX.js +1 -0
- package/core/built/admin/assets/step-1-IKiLBPoC.js +1 -0
- package/core/built/admin/assets/step-2-jJ41PsDN.js +1 -0
- package/core/built/admin/assets/step-3-CaqFAEqf.js +2 -0
- package/core/built/admin/assets/switch-t-WyENU2.js +1 -0
- package/core/built/admin/assets/table-DxUL78jU.js +1 -0
- package/core/built/admin/assets/tabs-BQcJQ1ke.js +1 -0
- package/core/built/admin/assets/tags-CNujGwkT.js +1 -0
- package/core/built/admin/assets/text-DwtjwGkh.js +1 -0
- package/core/built/admin/assets/textarea-Bjccvh_E.js +1 -0
- package/core/built/admin/assets/{tiers-EghDzCKc.js → tiers-BgYLWRJv.js} +1 -1
- package/core/built/admin/assets/toggle-group-BeEpQ69p.js +1 -0
- package/core/built/admin/assets/topic-filter-Bb5MOD-1.js +1 -0
- package/core/built/admin/assets/{use-analytics-data-0l_OHtnR.js → use-analytics-data-Cds6XDjg.js} +1 -1
- package/core/built/admin/assets/use-filter-params-DjXkhO54.js +1 -0
- package/core/built/admin/assets/use-growth-stats-D8uf98-G.js +1 -0
- package/core/built/admin/assets/{use-post-referrers-DwI31Ril.js → use-post-referrers-CRtgyuXB.js} +1 -1
- package/core/built/admin/assets/use-reply-chain-data-DbKYX50v.js +1 -0
- package/core/built/admin/assets/use-simple-pagination-DC01kpo0.js +1 -0
- package/core/built/admin/assets/{use-tinybird-query-DvZBBMG7.js → use-tinybird-query-C7bQRJWw.js} +1 -1
- package/core/built/admin/assets/{use-tinybird-token-CQtebkvU.js → use-tinybird-token-Az4tam7_.js} +1 -1
- package/core/built/admin/assets/{users-Pc8IRjk9.js → users-CcSCQFcQ.js} +1 -1
- package/core/built/admin/assets/virtual-list-Dhuh9fGx.js +1 -0
- package/core/built/admin/assets/web-LtHNiNBV.js +1 -0
- package/core/built/admin/index.html +22 -22
- package/core/frontend/apps/private-blogging/index.js +1 -1
- package/core/frontend/apps/private-blogging/lib/middleware.js +1 -1
- package/core/frontend/helpers/split.js +2 -1
- package/core/frontend/meta/asset-url.js +1 -1
- package/core/frontend/meta/author-image.js +1 -1
- package/core/frontend/meta/blog-logo.js +1 -1
- package/core/frontend/meta/canonical-url.js +1 -1
- package/core/frontend/meta/cover-image.js +1 -1
- package/core/frontend/meta/get-meta.js +1 -1
- package/core/frontend/meta/og-image.js +1 -1
- package/core/frontend/meta/paginated-url.js +1 -1
- package/core/frontend/meta/twitter-image.js +1 -1
- package/core/frontend/meta/url.js +1 -1
- package/core/frontend/services/assets-minification/admin-auth-assets.js +1 -1
- package/core/frontend/services/llms/handler.js +1 -1
- package/core/frontend/services/proxy.js +42 -3
- package/core/frontend/services/routing/collection-router.js +1 -1
- package/core/frontend/services/routing/controllers/email-post.js +1 -1
- package/core/frontend/services/routing/controllers/entry/markdown.js +1 -1
- package/core/frontend/services/routing/controllers/entry/markdown.ts +1 -1
- package/core/frontend/services/routing/controllers/entry.js +1 -1
- package/core/frontend/services/routing/controllers/entry.ts +1 -1
- package/core/frontend/services/routing/controllers/previews.js +6 -7
- package/core/frontend/services/routing/controllers/unsubscribe.js +7 -3
- package/core/frontend/services/routing/email-router.js +1 -1
- package/core/frontend/services/routing/events.js +12 -0
- package/core/frontend/services/routing/middleware/page-param.js +1 -1
- package/core/frontend/services/routing/parent-router.js +1 -1
- package/core/frontend/services/routing/preview-router.js +1 -1
- package/core/frontend/services/routing/router-manager.js +4 -8
- package/core/frontend/services/routing/rss-router.js +1 -1
- package/core/frontend/services/routing/static-pages-router.js +1 -1
- package/core/frontend/services/routing/static-routes-router.js +1 -1
- package/core/frontend/services/routing/taxonomy-router.js +1 -1
- package/core/frontend/services/rss/generate-feed.js +1 -1
- package/core/frontend/services/sitemap/base-site-map-generator.js +23 -4
- package/core/frontend/services/sitemap/site-map-index-generator.js +1 -1
- package/core/frontend/services/sitemap/site-map-manager.js +14 -8
- package/core/frontend/services/sitemap/utils.js +1 -1
- package/core/frontend/services/theme-engine/middleware/update-global-template-options.js +1 -1
- package/core/frontend/services/theme-engine/middleware/update-local-template-options.js +1 -1
- package/core/frontend/utils/images.js +1 -1
- package/core/frontend/web/middleware/admin-toolbar.js +1 -1
- package/core/frontend/web/middleware/handle-image-sizes.js +2 -2
- package/core/frontend/web/middleware/redirect-ghost-to-admin.js +1 -1
- package/core/frontend/web/routers/serve-favicon.js +1 -1
- package/core/frontend/web/routers/serve-public-file.js +1 -1
- package/core/frontend/web/site.js +5 -5
- package/core/server/adapters/cache/AdapterCacheMemoryTTL.js +2 -2
- package/core/server/adapters/cache/MemoryCache.js +2 -2
- package/core/server/adapters/cache/Redis.js +1 -1
- package/core/server/adapters/cache/index.js +1 -1
- package/core/server/adapters/lib/redis/AdapterCacheRedis.js +2 -2
- package/core/server/adapters/route-settings/FileStore.js +2 -8
- package/core/server/adapters/route-settings/FileStore.ts +1 -6
- package/core/server/adapters/route-settings/S3RouteSettingsStore.js +206 -0
- package/core/server/adapters/route-settings/S3RouteSettingsStore.ts +199 -0
- package/core/server/adapters/route-settings/utils.js +13 -0
- package/core/server/adapters/route-settings/utils.ts +7 -0
- package/core/server/adapters/scheduling/deps.d.ts +0 -2
- package/core/server/adapters/scheduling/error-capture.js +76 -0
- package/core/server/adapters/scheduling/error-capture.ts +91 -0
- package/core/server/adapters/scheduling/utils.js +18 -34
- package/core/server/adapters/scheduling/utils.ts +36 -0
- package/core/server/adapters/storage/LocalFilesStorage.js +13 -11
- package/core/server/adapters/storage/LocalFilesStorage.ts +24 -0
- package/core/server/adapters/storage/LocalImagesStorage.js +14 -12
- package/core/server/adapters/storage/LocalImagesStorage.ts +24 -0
- package/core/server/adapters/storage/LocalMediaStorage.js +13 -11
- package/core/server/adapters/storage/LocalMediaStorage.ts +24 -0
- package/core/server/adapters/storage/LocalStorageBase.js +107 -167
- package/core/server/adapters/storage/LocalStorageBase.ts +342 -0
- package/core/server/adapters/storage/S3Storage.js +2 -2
- package/core/server/adapters/storage/S3Storage.ts +1 -1
- package/core/server/adapters/storage/utils.js +36 -50
- package/core/server/adapters/storage/utils.ts +60 -0
- package/core/server/api/endpoints/authentication.js +1 -1
- package/core/server/api/endpoints/db.js +6 -0
- package/core/server/api/endpoints/featurebase.js +1 -1
- package/core/server/api/endpoints/files.js +2 -2
- package/core/server/api/endpoints/images.js +2 -2
- package/core/server/api/endpoints/libraries.d.ts +0 -1
- package/core/server/api/endpoints/media.js +8 -5
- package/core/server/api/endpoints/member-custom-fields.js +4 -1
- package/core/server/api/endpoints/member-custom-fields.ts +4 -1
- package/core/server/api/endpoints/members.js +25 -28
- package/core/server/api/endpoints/pages.js +6 -1
- package/core/server/api/endpoints/posts.js +28 -3
- package/core/server/api/endpoints/search-index-public.js +4 -3
- package/core/server/api/endpoints/search-index.js +5 -4
- package/core/server/api/endpoints/settings-public.js +1 -1
- package/core/server/api/endpoints/settings.js +3 -1
- package/core/server/api/endpoints/utils/serializers/input/utils/url.js +9 -1
- package/core/server/api/endpoints/utils/serializers/output/default.js +7 -0
- package/core/server/api/endpoints/utils/serializers/output/files.js +1 -1
- package/core/server/api/endpoints/utils/serializers/output/mappers/comments.js +4 -1
- package/core/server/api/endpoints/utils/serializers/output/media.js +1 -1
- package/core/server/api/endpoints/utils/serializers/output/member-custom-fields.js +7 -4
- package/core/server/api/endpoints/utils/serializers/output/member-custom-fields.ts +8 -4
- package/core/server/api/endpoints/utils/serializers/output/members.js +27 -106
- package/core/server/api/endpoints/utils/serializers/output/pages.js +7 -0
- package/core/server/api/endpoints/utils/serializers/output/posts.js +13 -0
- package/core/server/api/endpoints/utils/serializers/output/utils/url.js +1 -1
- package/core/server/api/endpoints/utils/validators/input/members.js +2 -52
- package/core/server/data/db/backup.js +1 -1
- package/core/server/data/exporter/export-filename.js +2 -1
- package/core/server/data/importer/handlers/image.js +3 -3
- package/core/server/data/importer/import-manager.js +6 -4
- package/core/server/data/importer/importers/content-file-importer.js +2 -2
- package/core/server/data/importer/importers/data/revue-subscriber-importer.js +6 -10
- package/core/server/data/importer/importers/json-to-html.js +24 -4
- package/core/server/data/migrations/utils/schema.js +4 -2
- package/core/server/data/migrations/versions/6.54/2026-07-19-16-59-00-add-content-import-permission.js +10 -0
- package/core/server/data/migrations/versions/6.54/2026-07-20-13-59-21-drop-email-tracked-sent-count-from-automation-action-revisions.js +7 -0
- package/core/server/data/migrations/versions/6.54/2026-07-21-01-58-20-add-automation-run-steps-poller-index.js +3 -0
- package/core/server/data/migrations/versions/6.54/2026-07-21-21-08-15-add-automated-email-recipients-mailgun-message-id-index.js +3 -0
- package/core/server/data/migrations/versions/6.54/2026-07-22-10-41-08-add-click-tracking-to-automated-email-recipients.js +13 -0
- package/core/server/data/migrations/versions/6.54/2026-07-22-15-10-30-add-email-clicked-count-to-automation-action-revisions.js +7 -0
- package/core/server/data/migrations/versions/6.54/2026-07-23-10-24-18-add-automation-action-revision-to-redirects.js +9 -0
- package/core/server/data/schema/commands.js +37 -3
- package/core/server/data/schema/fixtures/fixtures.json +7 -0
- package/core/server/data/schema/lib/default-index-name.js +20 -0
- package/core/server/data/schema/schema.js +40 -17
- package/core/server/data/seeders/data-generator.js +4 -2
- package/core/server/lib/image/image-size.js +7 -23
- package/core/server/lib/image/image-utils.js +16 -2
- package/core/server/lib/image/index.js +4 -4
- package/core/server/lib/lexical.js +3 -3
- package/core/server/lib/mobiledoc.js +2 -2
- package/core/server/lib/request-external.js +1 -1
- package/core/server/lib/validate-password.js +1 -1
- package/core/server/models/action.js +9 -0
- package/core/server/models/base/plugins/generate-slug.js +1 -1
- package/core/server/models/collection.js +1 -1
- package/core/server/models/custom-theme-setting.js +1 -1
- package/core/server/models/member.js +73 -0
- package/core/server/models/newsletter.js +1 -1
- package/core/server/models/post.js +19 -5
- package/core/server/models/posts-meta.js +1 -1
- package/core/server/models/redirect.js +1 -1
- package/core/server/models/settings.js +1 -1
- package/core/server/models/snippet.js +1 -1
- package/core/server/models/tag.js +1 -1
- package/core/server/models/user.js +47 -71
- package/core/server/models/welcome-email-automated-email.js +1 -1
- package/core/server/services/activitypub/activity-pub-service-wrapper.js +1 -1
- package/core/server/services/adapter-manager/adapter-manager.js +5 -1
- package/core/server/services/adapter-manager/adapter-manager.ts +7 -2
- package/core/server/services/adapter-manager/index.js +18 -15
- package/core/server/services/adapter-manager/index.ts +23 -17
- package/core/server/services/adapter-manager/utils.js +124 -14
- package/core/server/services/adapter-manager/utils.ts +130 -14
- package/core/server/services/api-version-compatibility/mw-version-rewrites.js +1 -1
- package/core/server/services/audience-feedback/index.js +1 -1
- package/core/server/services/auth/passwordreset.js +1 -1
- package/core/server/services/auth/session/express-session.js +1 -1
- package/core/server/services/auth/session/index.js +2 -2
- package/core/server/services/auth/session/session-service.js +29 -2
- package/core/server/services/automations/automations-api.js +8 -25
- package/core/server/services/automations/automations-api.ts +8 -37
- package/core/server/services/automations/automations-repository.ts +16 -0
- package/core/server/services/automations/database-automations-repository.js +37 -4
- package/core/server/services/automations/database-automations-repository.ts +41 -4
- package/core/server/services/automations/poll.js +16 -12
- package/core/server/services/automations/poll.ts +17 -15
- package/core/server/services/automations/service.js +1 -1
- package/core/server/services/automations/service.ts +3 -13
- package/core/server/services/automations/welcome-email-automation-poll.js +2 -1
- package/core/server/services/comments/comments-service-emails.js +4 -1
- package/core/server/services/comments/index.js +1 -1
- package/core/server/services/custom-redirects/index.js +2 -2
- package/core/server/services/email-analytics/email-analytics-service-wrapper.js +14 -13
- package/core/server/services/email-analytics/email-analytics-service.js +1 -1
- package/core/server/services/email-analytics/events/start-email-analytics-job-event.js +11 -15
- package/core/server/services/email-analytics/events/start-email-analytics-job-event.ts +15 -0
- package/core/server/services/email-analytics/index.js +2 -3
- package/core/server/services/email-analytics/index.ts +1 -2
- package/core/server/services/email-analytics/jobs/email-analytics-job-scheduler.js +1 -6
- package/core/server/services/email-analytics/jobs/email-analytics-job-scheduler.ts +0 -9
- package/core/server/services/email-analytics/jobs/fetch-latest/index.js +1 -1
- package/core/server/services/email-analytics/jobs/index.js +0 -2
- package/core/server/services/email-service/email-service-wrapper.js +1 -1
- package/core/server/services/email-service/email-service.js +20 -4
- package/core/server/services/explore-ping/explore-ping-service.js +24 -39
- package/core/server/services/explore-ping/explore-ping-service.ts +198 -0
- package/core/server/services/explore-ping/index.js +11 -11
- package/core/server/services/explore-ping/index.ts +42 -0
- package/core/server/services/gifts/gift-reminder-scheduler.js +1 -1
- package/core/server/services/gifts/gift-reminder-scheduler.ts +1 -1
- package/core/server/services/gifts/gift-service-wrapper.js +1 -1
- package/core/server/services/identity-tokens/identity-token-service-wrapper.js +1 -1
- package/core/server/services/indexnow-ping/constants.js +30 -0
- package/core/server/services/indexnow-ping/constants.ts +32 -0
- package/core/server/services/indexnow-ping/index.js +29 -253
- package/core/server/services/indexnow-ping/index.ts +37 -0
- package/core/server/services/indexnow-ping/indexnow-ping-service.js +229 -0
- package/core/server/services/indexnow-ping/indexnow-ping-service.ts +319 -0
- package/core/server/services/invites/index.js +1 -1
- package/core/server/services/lib/mailgun-client.js +3 -3
- package/core/server/services/link-redirection/index.js +2 -2
- package/core/server/services/link-redirection/link-redirect-repository.js +1 -1
- package/core/server/services/link-redirection/link-redirect.js +12 -13
- package/core/server/services/link-redirection/link-redirect.ts +22 -0
- package/core/server/services/link-redirection/link-redirects-service.js +1 -1
- package/core/server/services/link-tracking/full-post-link.js +2 -2
- package/core/server/services/link-tracking/index.js +1 -1
- package/core/server/services/mail/ghost-mailer.js +1 -1
- package/core/server/services/mail/index.js +1 -1
- package/core/server/services/media-inliner/external-media-inliner.js +2 -2
- package/core/server/services/media-inliner/service.js +4 -3
- package/core/server/services/member-attribution/index.js +1 -1
- package/core/server/services/member-welcome-emails/service.js +1 -1
- package/core/server/services/members/api.js +8 -2
- package/core/server/services/members/import-export/config.js +30 -0
- package/core/server/services/members/import-export/config.ts +34 -0
- package/core/server/services/members/import-export/csv/index.js +10 -0
- package/core/server/services/members/import-export/csv/index.ts +2 -0
- package/core/server/services/members/import-export/csv/parse.js +64 -0
- package/core/server/services/members/import-export/csv/parse.ts +69 -0
- package/core/server/services/members/import-export/csv/serialize.js +13 -0
- package/core/server/services/members/import-export/csv/serialize.ts +18 -0
- package/core/server/services/members/import-export/export/exporter.js +202 -0
- package/core/server/services/members/import-export/export/exporter.ts +325 -0
- package/core/server/services/members/import-export/import/completion-email.js +65 -0
- package/core/server/services/members/import-export/import/completion-email.ts +119 -0
- package/core/server/services/members/import-export/import/importer.js +276 -0
- package/core/server/services/members/import-export/import/importer.ts +430 -0
- package/core/server/services/members/import-export/import/reader.js +32 -0
- package/core/server/services/members/import-export/import/reader.ts +33 -0
- package/core/server/services/members/import-export/import/row.js +33 -0
- package/core/server/services/members/import-export/import/row.ts +52 -0
- package/core/server/services/members/import-export/import/spool.js +30 -0
- package/core/server/services/members/import-export/import/spool.ts +38 -0
- package/core/server/services/members/import-export/index.js +90 -0
- package/core/server/services/members/import-export/index.ts +118 -0
- package/core/server/services/members/members-api/controllers/router-controller.js +7 -0
- package/core/server/services/members/members-api/members-api.js +4 -2
- package/core/server/services/members/members-api/repositories/event-repository.js +13 -2
- package/core/server/services/members/members-api/services/member-bread-service.js +42 -19
- package/core/server/services/members/middleware.js +1 -1
- package/core/server/services/members/service.js +28 -17
- package/core/server/services/members/stripe-connect.js +1 -1
- package/core/server/services/members-custom-fields/actions.js +3 -0
- package/core/server/services/members-custom-fields/actions.ts +6 -2
- package/core/server/services/members-custom-fields/config.js +34 -0
- package/core/server/services/members-custom-fields/config.ts +38 -0
- package/core/server/services/members-custom-fields/definitions-service.js +156 -21
- package/core/server/services/members-custom-fields/definitions-service.ts +170 -25
- package/core/server/services/members-custom-fields/index.js +16 -3
- package/core/server/services/members-custom-fields/index.ts +17 -3
- package/core/server/services/members-custom-fields/values-service.js +56 -10
- package/core/server/services/members-custom-fields/values-service.ts +62 -10
- package/core/server/services/mentions/mention-sending-service.js +22 -2
- package/core/server/services/mentions/service.js +21 -5
- package/core/server/services/newsletters/index.js +1 -1
- package/core/server/services/oembed/oembed-service.js +122 -33
- package/core/server/services/oembed/service.js +4 -2
- package/core/server/services/offers/service.js +1 -1
- package/core/server/services/post-scheduling/index.js +4 -3
- package/core/server/services/post-scheduling/index.ts +4 -3
- package/core/server/services/post-scheduling/post-scheduling.js +1 -1
- package/core/server/services/post-scheduling/post-scheduling.ts +1 -1
- package/core/server/services/posts/post-email-handler.js +13 -6
- package/core/server/services/posts/post-scheduling.js +1 -1
- package/core/server/services/posts/posts-exporter.js +6 -4
- package/core/server/services/posts/posts-service-instance.js +1 -1
- package/core/server/services/posts/posts-service.js +4 -4
- package/core/server/services/posts-public/service.js +1 -1
- package/core/server/services/public-config/site.js +1 -1
- package/core/server/services/recommendations/recommendation-service-wrapper.js +1 -1
- package/core/server/services/recommendations/service/libraries.d.ts +0 -2
- package/core/server/services/route-settings/dynamic-routing-service.js +2 -3
- package/core/server/services/route-settings/index.js +1 -1
- package/core/server/services/route-settings/route-settings-parser.js +134 -124
- package/core/server/services/route-settings/route-settings-parser.ts +160 -125
- package/core/server/services/route-settings/validation-errors.js +178 -0
- package/core/server/services/route-settings/validation-errors.ts +196 -0
- package/core/server/services/settings/settings-service.js +2 -2
- package/core/server/services/settings-helpers/index.js +1 -1
- package/core/server/services/slack-notifications/service.js +1 -1
- package/core/server/services/slack-ping/constants.js +16 -0
- package/core/server/services/slack-ping/constants.ts +15 -0
- package/core/server/services/slack-ping/index.js +26 -204
- package/core/server/services/slack-ping/index.ts +35 -0
- package/core/server/services/slack-ping/slack-ping-service.js +214 -0
- package/core/server/services/slack-ping/slack-ping-service.ts +296 -0
- package/core/server/services/staff/index.js +1 -1
- package/core/server/services/stats/posts-stats-service.js +1 -1
- package/core/server/services/stats/service.js +1 -1
- package/core/server/services/stripe/service.js +1 -1
- package/core/server/services/tags-public/service.js +1 -1
- package/core/server/services/themes/storage.js +9 -0
- package/core/server/services/themes/theme-storage.js +1 -1
- package/core/server/services/themes/validate.js +1 -1
- package/core/server/services/update-check/index.js +1 -1
- package/core/server/services/url/lazy-url-service.js +66 -6
- package/core/server/services/url/lazy-url-service.ts +73 -6
- package/core/server/services/url/url-generator.js +1 -1
- package/core/server/services/url/url-service-facade.js +68 -3
- package/core/server/services/url/url-service-facade.ts +79 -4
- package/core/server/services/url/url-service.js +1 -1
- package/core/server/services/url/urls.js +1 -1
- package/core/server/services/webhooks/index.js +19 -2
- package/core/server/services/webhooks/listen.js +6 -11
- package/core/server/services/webhooks/payload.js +1 -3
- package/core/server/services/webhooks/serialize.js +16 -1
- package/core/server/web/admin/app.js +1 -1
- package/core/server/web/admin/middleware/redirect-admin-urls.js +1 -1
- package/core/server/web/api/endpoints/admin/routes.js +1 -0
- package/core/server/web/api/middleware/cors.js +1 -1
- package/core/server/web/api/middleware/upload.js +4 -0
- package/core/server/web/gift-preview/controller.js +1 -1
- package/core/server/web/shared/middleware/redirect-amp-urls.js +1 -1
- package/core/server/web/shared/middleware/uncapitalise.js +2 -2
- package/core/server/web/shared/middleware/url-redirects.js +1 -1
- package/core/shared/config/defaults.json +10 -2
- package/core/shared/config/overrides.json +4 -0
- package/core/shared/express.js +6 -1
- package/core/shared/labs.js +2 -1
- package/core/shared/url-utils.js +19 -15
- package/core/shared/url-utils.ts +20 -0
- package/ghost.js +0 -1
- package/package.json +30 -35
- package/pnpm-lock.yaml +681 -2789
- package/pnpm-workspace.yaml +31 -17
- package/components/tryghost-adapter-base-scheduling-0.0.0.tgz +0 -0
- package/components/tryghost-adapter-base-sso-0.0.0.tgz +0 -0
- package/core/built/admin/assets/Combination--5EZGaDs.js +0 -43
- package/core/built/admin/assets/Growth-C0NoKcHQ.js +0 -3
- package/core/built/admin/assets/Newsletters-Ed8kDjdy.js +0 -1
- package/core/built/admin/assets/Overview-CArPgRZt.js +0 -1
- package/core/built/admin/assets/Web-CjjYoVM3.js +0 -2
- package/core/built/admin/assets/account-migration-mfa5mNI9.js +0 -1
- package/core/built/admin/assets/activitypub/inbox-B3rjKMTv.js +0 -1221
- package/core/built/admin/assets/activitypub/layout-jcurg3rU.js +0 -1
- package/core/built/admin/assets/activitypub/use-activity-pub-queries-yqGRcnLn.js +0 -2569
- package/core/built/admin/assets/activitypub/users-CfyHIsTG.js +0 -1316
- package/core/built/admin/assets/automations-DkUnxNdv.js +0 -1
- package/core/built/admin/assets/automations-vjXofmV_.js +0 -1
- package/core/built/admin/assets/bluesky-sharing-T-pO3RcP.js +0 -1
- package/core/built/admin/assets/breadcrumb-CekPYTCn.js +0 -1
- package/core/built/admin/assets/button--i2uMDDn.js +0 -4
- package/core/built/admin/assets/card-CSWz_BXq.js +0 -1
- package/core/built/admin/assets/chart-helpers-C_4Ka_vT.js +0 -1
- package/core/built/admin/assets/chunk.524.8ce2c741473e2f0929dc.js +0 -25
- package/core/built/admin/assets/chunk.582.453459d6228d2955408b.js +0 -27
- package/core/built/admin/assets/code-editor-view-BfkwQto2.js +0 -1
- package/core/built/admin/assets/command-K75Jzs0G.js +0 -1
- package/core/built/admin/assets/comments-BEIi1DH-.js +0 -1
- package/core/built/admin/assets/container-BNXvlcjA.js +0 -1
- package/core/built/admin/assets/data-list-BmK5QMab.js +0 -1
- package/core/built/admin/assets/date-range-select-5sKzwbt7.js +0 -1
- package/core/built/admin/assets/disabled-sources-indicator-L_ssJTNr.js +0 -1
- package/core/built/admin/assets/dist-BBIJuyPg.js +0 -1
- package/core/built/admin/assets/dist-BHE0dp6o.js +0 -1
- package/core/built/admin/assets/dist-CT46_f_J.js +0 -1
- package/core/built/admin/assets/dist-DW0QXQO3.js +0 -1
- package/core/built/admin/assets/dist-DxFLceO5.js +0 -1
- package/core/built/admin/assets/dist-QcACAOAD.js +0 -1
- package/core/built/admin/assets/dist-duxRDcQu.js +0 -177
- package/core/built/admin/assets/domain-CLaPZ9Rc.js +0 -1
- package/core/built/admin/assets/dropzone-E0bSX4_a.js +0 -5
- package/core/built/admin/assets/edit-profile-DqNPKaA4.js +0 -1
- package/core/built/admin/assets/editor-CkLXQDRp.js +0 -8
- package/core/built/admin/assets/empty-indicator-BTtOlgIo.js +0 -1
- package/core/built/admin/assets/esm-TSfGW7nz.js +0 -2
- package/core/built/admin/assets/explore-BEstLxKr.js +0 -1
- package/core/built/admin/assets/feed-C58p2voG.js +0 -1
- package/core/built/admin/assets/field-BSbDUHPv.js +0 -1
- package/core/built/admin/assets/filters-BgYv8Gt7.js +0 -1
- package/core/built/admin/assets/filters-DvenFkmK.js +0 -1
- package/core/built/admin/assets/framework-provider-jQktxm9P.js +0 -4
- package/core/built/admin/assets/ghost-dark-8590dea6cd695ff90f27d262c4464538.css +0 -1
- package/core/built/admin/assets/gift-link-modal-BPjXkEFt.js +0 -1
- package/core/built/admin/assets/growth-D4JNiVTe.js +0 -1
- package/core/built/admin/assets/hooks-Cjxexi_I.js +0 -2
- package/core/built/admin/assets/index-BacwlcOy.js +0 -67
- package/core/built/admin/assets/index-DxRNHH0o.css +0 -1
- package/core/built/admin/assets/inline-C22rnPro.js +0 -1
- package/core/built/admin/assets/input-group-CKfrILLP.js +0 -1
- package/core/built/admin/assets/jsx-runtime-CtMZ-PAS.js +0 -1
- package/core/built/admin/assets/kpi-card-DZxQKAIb.js +0 -1
- package/core/built/admin/assets/kpi-card-FidQ5zg3.js +0 -1
- package/core/built/admin/assets/kpi-helpers-C5T8Vaf1.js +0 -1
- package/core/built/admin/assets/kpi-tabs-_VRK6hGV.js +0 -1
- package/core/built/admin/assets/label-Cza7hPgn.js +0 -1
- package/core/built/admin/assets/label-picker-DgC_zLaw.js +0 -1
- package/core/built/admin/assets/layout-BxsXnKFX.js +0 -1
- package/core/built/admin/assets/limit-service-CTurluJQ.js +0 -20
- package/core/built/admin/assets/link-helpers-C3Gqy2cz.js +0 -1
- package/core/built/admin/assets/list-page-BtqCnow_.js +0 -1
- package/core/built/admin/assets/member-custom-fields-9uXFBqSt.js +0 -1
- package/core/built/admin/assets/member-detail-Dq6ZDIxo.js +0 -1
- package/core/built/admin/assets/members-CUWD9jal.js +0 -10
- package/core/built/admin/assets/modals-CIdwHVga.js +0 -31
- package/core/built/admin/assets/moderation-DTt04UDA.js +0 -1
- package/core/built/admin/assets/newsletter-cC8vcc9h.js +0 -1
- package/core/built/admin/assets/note-DZU0IY9e.js +0 -1
- package/core/built/admin/assets/notifications-NoHpBHJ4.js +0 -1
- package/core/built/admin/assets/nql-lang-CvCSOQG3.js +0 -19
- package/core/built/admin/assets/onboarding-route-Deg2hNm8.js +0 -1
- package/core/built/admin/assets/overview-BQPt_9w3.js +0 -1
- package/core/built/admin/assets/page-header-D6bEqPo2.js +0 -1
- package/core/built/admin/assets/post-analytics-header-BPw_B2_D.js +0 -1
- package/core/built/admin/assets/post-analytics-kp2_--XO.js +0 -1
- package/core/built/admin/assets/post-share-modal-Cave3Z4W.js +0 -1
- package/core/built/admin/assets/preferences-C7h3j_uy.js +0 -5
- package/core/built/admin/assets/profile-B2x4q2oB.js +0 -1
- package/core/built/admin/assets/router-provider-5fsX1CYn.js +0 -1
- package/core/built/admin/assets/select-PhPjIBBT.js +0 -1
- package/core/built/admin/assets/settings-D5P9Gwgo.js +0 -6
- package/core/built/admin/assets/settings-zUOzQV5I.js +0 -1
- package/core/built/admin/assets/share-modal-EfpfbuWF.js +0 -1
- package/core/built/admin/assets/social-urls-DgAF08Xc.js +0 -18
- package/core/built/admin/assets/sort-button-WOQYJm2H.js +0 -1
- package/core/built/admin/assets/source-icon-hm8Cj-Gx.js +0 -1
- package/core/built/admin/assets/stats-CnQDb62m.js +0 -1
- package/core/built/admin/assets/stats-view-CCfTJgSe.js +0 -1
- package/core/built/admin/assets/step-1-BGlhY4DS.js +0 -1
- package/core/built/admin/assets/step-2-D3sDEyFH.js +0 -1
- package/core/built/admin/assets/step-3-CvZoUdsc.js +0 -2
- package/core/built/admin/assets/switch-CNjkOmwz.js +0 -1
- package/core/built/admin/assets/table-C5nZYPnW.js +0 -1
- package/core/built/admin/assets/tabs-dtOcExye.js +0 -1
- package/core/built/admin/assets/tags-Dhm0FB_g.js +0 -1
- package/core/built/admin/assets/textarea-CeKw3wmV.js +0 -1
- package/core/built/admin/assets/toggle-group-DfhZIMTW.js +0 -1
- package/core/built/admin/assets/topic-filter-Cxe1Il41.js +0 -1
- package/core/built/admin/assets/typeof-Ca-duI-z.js +0 -1
- package/core/built/admin/assets/use-filter-params-Bub6BqNy.js +0 -1
- package/core/built/admin/assets/use-growth-stats-BJORomv0.js +0 -1
- package/core/built/admin/assets/use-reply-chain-data-B89YjVoo.js +0 -1
- package/core/built/admin/assets/use-simple-pagination-BL2SYXKi.js +0 -1
- package/core/built/admin/assets/virtual-list-DNJOSK9I.js +0 -1
- package/core/built/admin/assets/web-BHUE3YQc.js +0 -1
- package/core/server/adapters/scheduling/scheduling-base.js +0 -5
- package/core/server/adapters/sso/SSOBase.js +0 -5
- package/core/server/adapters/storage/index.js +0 -17
- package/core/server/services/mail/templates/newsletter.html +0 -876
- package/core/server/services/members/exporter/query.js +0 -206
- package/core/server/services/members/importer/index.js +0 -30
- package/core/server/services/members/importer/labels.js +0 -125
- package/core/server/services/members/importer/members-csv-importer.js +0 -502
- /package/core/server/services/members/{importer → import-export/import}/email-template.js +0 -0
- /package/core/server/services/members/{importer/members-csv-importer-stripe-utils.js → import-export/import/stripe-utils.js} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-Q1p9iXwH.js","./rolldown-runtime-DAXXjFlN.js","./dist-BnFdlebk.js","./dist-CbHbGtQ-.js","./dist-DG78yroX.js","./dist-DDY6GRVz.js","./dist-DCk0UkGx.js","./dist-DyViJwIy.js","./dist-pHiOxyxa.js","./dist-t6AXpf_4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,o as t,t as n}from"./rolldown-runtime-DAXXjFlN.js";import{t as r}from"./react-Bb3IsNbi.js";import{n as i,t as a}from"./jsx-runtime-DX3WBWVO.js";import{g as o,n as s,o as c,r as l}from"./framework-provider-CmtnPXIT.js";import{_ as u,f as d,h as f,m as p,n as m,p as h,r as g,t as _,u as v,y}from"./hooks-BApwwBE0.js";import{n as b}from"./dist-Ndy-PuGN.js";import{d as x,r as S,u as C}from"./Combination-CJG7Flp-.js";import{c as w,g as T,h as E}from"./automated-emails-of1MvVsv.js";import{a as D,i as O,n as k,r as A,t as j}from"./offers-CrY6nSRR.js";import{n as M}from"./posts-EWpZIjkr.js";import{t as ee}from"./preload-helper-DYl5dUZ5.js";import{a as N,c as P,f as F,o as I,x as L}from"./dist-DGzPJ_bO.js";import{t as R}from"./box-BWbhXh21.js";import{$ as z,B as te,C as B,D as ne,E as re,F as ie,Ft as ae,G as oe,H as se,Ht as V,I as ce,It as le,J as ue,K as de,Kt as fe,L as pe,Lt as me,Mt as he,N as ge,Nt as _e,O as ve,P as ye,Pt as be,Q as xe,Rt as Se,S as Ce,St as we,T as Te,U as Ee,Ut as H,W as De,Wt as Oe,X as ke,Zt as Ae,_ as je,a as Me,an as Ne,at as Pe,b as Fe,bt as Ie,c as Le,cn as Re,d as ze,dn as Be,dt as Ve,f as He,fn as Ue,ft as We,g as Ge,i as Ke,it as qe,k as Je,l as Ye,ln as U,lt as Xe,m as Ze,mt as Qe,n as $e,nt as et,on as tt,ot as nt,pn as rt,pt as it,q as at,qt as ot,r as st,rt as ct,sn as lt,st as ut,t as dt,tt as ft,un as pt,ut as mt,v as ht,w as gt,wt as _t,x as vt,xt as yt,y as bt,yt as xt,zt as St}from"./social-urls-BPL1nADp.js";import{t as Ct}from"./inline-EMAm3okk.js";import{t as wt}from"./stack-xiN0eQ6Z.js";import{t as Tt}from"./text-DwtjwGkh.js";import{i as Et,r as Dt}from"./shade-app-B3heOAfz-CGXQwWeO.js";import{r as Ot}from"./dist-CQJY6SVY.js";import{t as kt}from"./dist-P_ohUlTi.js";import{o as At}from"./dist-CjY-f5Z1.js";import{n as jt,r as Mt,t as Nt}from"./esm-CFX93H5M.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./tabs-BQcJQ1ke.js";import{t as W}from"./switch-t-WyENU2.js";import{t as Rt}from"./dist-JLOy8o0Q.js";import{t as zt}from"./input-surface-BpAjZXY5.js";import{t as Bt}from"./dropzone-BmCXnw6J.js";import{a as Vt,i as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./select-C1qDZnW4.js";import{a as Jt,i as Yt,n as Xt,o as Zt,r as Qt,t as $t}from"./breadcrumb-B-M9Ip_2.js";import{t as en}from"./checkbox-EhJKHFdZ.js";import{a as tn,c as nn,i as G,l as rn,n as an,o as K,r as q,s as on,t as J}from"./field-D0XISCK2.js";import{t as sn}from"./textarea-Bjccvh_E.js";import{a as cn,i as ln,n as un,r as dn,t as fn}from"./input-group-CGOXcy4l.js";import{t as pn}from"./multi-select-combobox-1wYm3nle.js";import{a as mn,c as hn,n as gn,r as _n,s as vn,t as yn}from"./table-DxUL78jU.js";import{n as bn,t as xn}from"./toggle-group-BeEpQ69p.js";import{_ as Sn,c as Cn,d as wn,f as Tn,g as En,h as Dn,m as On,o as kn,p as An,s as jn,t as Mn,u as Nn}from"./users-CcSCQFcQ.js";import{$i as Pn,$o as Fn,$r as In,$t as Ln,An as Rn,Ao as zn,Bi as Bn,Bo as Vn,Cn as Hn,Cs as Un,Dn as Wn,Ei as Gn,Fi as Kn,Fs as qn,Gn as Jn,Gr as Yn,Hi as Xn,Is as Zn,Ji as Qn,Jn as $n,Jo as er,Jt as tr,Ki as nr,Kr as rr,Li as ir,Ls as ar,Ma as or,No as sr,Nr as cr,On as Y,Po as lr,Ps as ur,Qi as dr,Qr as fr,Qt as pr,Ri as mr,Rn as hr,Si as gr,Sn as _r,To as vr,Vi as yr,Wa as br,Wo as xr,Xi as Sr,Xn as Cr,Xr as wr,Xt as Tr,Yi as Er,Yr as Dr,Yt as Or,Zo as kr,Zr as Ar,Zt as jr,_n as Mr,_o as Nr,_r as Pr,_s as Fr,aa as Ir,an as Lr,ao as Rr,bi as zr,bn as Br,br as Vr,co as Hr,da as Ur,ds as Wr,en as Gr,er as Kr,es as qr,fs as Jr,go as Yr,gr as Xr,ha as Zr,ho as Qr,hr as $r,ia as ei,in as ti,ja as ni,la as ri,mo as ii,nn as ai,on as oi,pr as si,qn as ci,qo as li,qr as ui,rn as di,rr as X,ti as fi,tn as pi,vn as mi,vr as hi,wa as gi,wn as _i,wo as vi,ws as yi,x as bi,xi,xn as Si,yi as Ci,yn as wi,ys as Ti,zi as Ei,zn as Di}from"./index-ukW_0Uie.js";import{G as Oi}from"./dist-BnFdlebk.js";import{t as ki}from"./page-header-op0eN36I.js";import{i as Ai,n as ji,r as Mi}from"./newsletters-D1jbtV-h.js";import{t as Ni}from"./nql-lang-B7faUf8D.js";import{a as Pi,o as Fi,r as Ii}from"./tiers-BgYLWRJv.js";var Z=t(r(),1),Q=a(),Li=I(`size-full`,{variants:{device:{desktop:`px-8`,mobile:`h-[775px] w-[380px] rounded-3xl bg-surface-elevated p-2 shadow-xl`}},defaultVariants:{device:`desktop`}}),Ri=I(`size-full overflow-hidden`,{variants:{device:{desktop:`rounded-t-xs shadow-sm`,mobile:`overflow-auto rounded-2xl border border-border-default`}},defaultVariants:{device:`desktop`}}),zi=Z.forwardRef(({children:e,className:t,device:n=`desktop`,...r},i)=>(0,Q.jsx)(`div`,{ref:i,className:P(Li({device:n}),t),...r,children:(0,Q.jsx)(`div`,{className:Ri({device:n}),children:e})}));zi.displayName=`PreviewChrome`;var Bi=`Radio`,[Vi,Hi]=Ot(Bi),[Ui,Wi]=Vi(Bi);function Gi(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=Z.useState(null),[p,m]=Z.useState(null),h={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,hasConsumerStoppedPropagationRef:Z.useRef(!1),isFormControl:d?!!a||!!d.closest(`form`):!0,bubbleInput:p,setBubbleInput:m,onCheck:()=>s?.()};return(0,Q.jsx)(Ui,{scope:t,...h,children:$i(u)?u(h):r})}var Ki=`RadioTrigger`,qi=Z.forwardRef(({__scopeRadio:e,onClick:t,...n},r)=>{let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,hasConsumerStoppedPropagationRef:l,isFormControl:u,bubbleInput:d}=Wi(Ki,e),f=N(r,s);return(0,Q.jsx)(kt.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":ea(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:x(t,e=>{i||c(),d&&u&&(l.current=e.isPropagationStopped(),l.current||e.stopPropagation())})})});qi.displayName=Ki;var Ji=Z.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i,required:a,disabled:o,value:s,onCheck:c,form:l,...u}=e;return(0,Q.jsx)(Gi,{__scopeRadio:n,checked:i,disabled:o,required:a,onCheck:c,name:r,form:l,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(qi,{...u,ref:t,__scopeRadio:n}),e&&(0,Q.jsx)(Qi,{__scopeRadio:n})]})})});Ji.displayName=Bi;var Yi=`RadioIndicator`,Xi=Z.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=Wi(Yi,n);return(0,Q.jsx)(S,{present:r||a.checked,children:(0,Q.jsx)(kt.span,{"data-state":ea(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});Xi.displayName=Yi;var Zi=`RadioBubbleInput`,Qi=Z.forwardRef(({__scopeRadio:e,...t},n)=>{let{control:r,checked:i,required:a,disabled:o,name:s,value:c,form:l,bubbleInput:u,setBubbleInput:d,hasConsumerStoppedPropagationRef:f}=Wi(Zi,e),p=N(n,d),m=Rt(i),h=At(r);Z.useEffect(()=>{let e=u;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!f.current;if(m!==i&&n){let t=new Event(`click`,{bubbles:r});n.call(e,i),e.dispatchEvent(t)}},[u,m,i,f]);let g=Z.useRef(i);return(0,Q.jsx)(kt.input,{type:`radio`,"aria-hidden":!0,defaultChecked:g.current,required:a,disabled:o,name:s,value:c,form:l,...t,tabIndex:-1,ref:p,style:{...t.style,...h,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});Qi.displayName=Zi;function $i(e){return typeof e==`function`}function ea(e){return e?`checked`:`unchecked`}var ta=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],na=`RadioGroup`,[ra,ia]=Ot(na,[xi,Hi]),aa=xi(),oa=Hi(),[sa,ca]=ra(na),la=Z.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=aa(n),m=gr(l),[h,g]=C({prop:a,defaultProp:i??null,onChange:d,caller:na});return(0,Q.jsx)(sa,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,Q.jsx)(zr,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,Q.jsx)(kt.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});la.displayName=na;var ua=`RadioGroupItem`,da=`RadioGroupItemProvider`,fa=`RadioGroupItemTrigger`,pa=`RadioGroupItemBubbleInput`;function ma(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=ca(da,t),s=oa(t),c=o.disabled||r;return(0,Q.jsx)(Gi,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}var ha=Z.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e,i=aa(n),a=oa(n),{checked:o,disabled:s}=Wi(fa,a.__scopeRadio),c=Z.useRef(null),l=N(t,c),u=Z.useRef(!1);return Z.useEffect(()=>{let e=e=>{ta.includes(e.key)&&(u.current=!0)},t=()=>u.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,Q.jsx)(Ci,{asChild:!0,...i,focusable:!s,active:o,children:(0,Q.jsx)(qi,{...a,...r,ref:l,onKeyDown:x(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:x(r.onFocus,()=>{u.current&&c.current?.click()})})})});ha.displayName=fa;var ga=Z.forwardRef((e,t)=>{let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,Q.jsx)(ma,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ha,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,Q.jsx)(_a,{__scopeRadioGroup:n})]})})});ga.displayName=ua;var _a=Z.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Q.jsx)(Qi,{...oa(n),...r,ref:t})});_a.displayName=pa;var va=`RadioGroupIndicator`,ya=Z.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Q.jsx)(Xi,{...oa(n),...r,ref:t})});ya.displayName=va;var ba=Z.forwardRef(({className:e,...t},n)=>(0,Q.jsx)(la,{ref:n,className:P(`grid gap-3`,e),"data-slot":`radio-group`,...t}));ba.displayName=la.displayName;var xa=I([zt(`self`),`peer grid size-4 shrink-0 place-content-center rounded-full p-0 text-primary enabled:hover:bg-interactive-hover`],{variants:{indicator:{dot:``,check:`data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground enabled:data-[state=checked]:hover:bg-primary`}},defaultVariants:{indicator:`dot`}}),Sa=Z.forwardRef(({className:e,indicator:t=`dot`,...n},r)=>(0,Q.jsx)(ga,{ref:r,className:P(xa({indicator:t}),e),"data-slot":`radio-group-item`,...n,children:(0,Q.jsx)(ya,{className:`grid place-content-center`,"data-slot":`radio-group-indicator`,children:t===`check`?(0,Q.jsx)(qr,{className:`size-2.5 stroke-4`}):(0,Q.jsx)(`span`,{className:`size-2 rounded-full bg-current`,"data-slot":`radio-group-dot`})})}));Sa.displayName=ga.displayName;var Ca=n(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),wa=n(((e,t)=>{var n=`2.0.0`,r=256;t.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:r-6,MAX_SAFE_INTEGER:2**53-1||9007199254740991,RELEASE_TYPES:[`major`,`premajor`,`minor`,`preminor`,`patch`,`prepatch`,`prerelease`],SEMVER_SPEC_VERSION:n,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}})),Ta=n(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=wa(),a=Ca();e=t.exports={};var o=e.re=[],s=e.safeRe=[],c=e.src=[],l=e.safeSrc=[],u=e.t={},d=0,f=`[a-zA-Z0-9-]`,p=[[`\\s`,1],[`\\d`,i],[f,r]],m=e=>{for(let[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},h=(e,t,n)=>{let r=m(t),i=d++;a(e,i,t),u[e]=i,c[i]=t,l[i]=r,o[i]=new RegExp(t,n?`g`:void 0),s[i]=new RegExp(r,n?`g`:void 0)};h(`NUMERICIDENTIFIER`,`0|[1-9]\\d*`),h(`NUMERICIDENTIFIERLOOSE`,`\\d+`),h(`NONNUMERICIDENTIFIER`,`\\d*[a-zA-Z-]${f}*`),h(`MAINVERSION`,`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h(`MAINVERSIONLOOSE`,`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASEIDENTIFIER`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h(`PRERELEASEIDENTIFIERLOOSE`,`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h(`PRERELEASE`,`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h(`PRERELEASELOOSE`,`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h(`BUILDIDENTIFIER`,`${f}+`),h(`BUILD`,`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h(`FULLPLAIN`,`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h(`FULL`,`^${c[u.FULLPLAIN]}$`),h(`LOOSEPLAIN`,`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h(`LOOSE`,`^${c[u.LOOSEPLAIN]}$`),h(`GTLT`,`((?:<|>)?=?)`),h(`XRANGEIDENTIFIERLOOSE`,`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h(`XRANGEIDENTIFIER`,`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h(`XRANGEPLAIN`,`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h(`XRANGEPLAINLOOSE`,`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h(`XRANGE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h(`XRANGELOOSE`,`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h(`COERCEPLAIN`,`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h(`COERCE`,`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h(`COERCEFULL`,c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),h(`COERCERTL`,c[u.COERCE],!0),h(`COERCERTLFULL`,c[u.COERCEFULL],!0),h(`LONETILDE`,`(?:~>?)`),h(`TILDETRIM`,`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace=`$1~`,h(`TILDE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h(`TILDELOOSE`,`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h(`LONECARET`,`(?:\\^)`),h(`CARETTRIM`,`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace=`$1^`,h(`CARET`,`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h(`CARETLOOSE`,`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h(`COMPARATORLOOSE`,`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h(`COMPARATOR`,`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h(`COMPARATORTRIM`,`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace=`$1$2$3`,h(`HYPHENRANGE`,`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h(`HYPHENRANGELOOSE`,`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h(`STAR`,`(<|>)?=?\\s*\\*`),h(`GTE0`,`^\\s*>=\\s*0\\.0\\.0\\s*$`),h(`GTE0PRE`,`^\\s*>=\\s*0\\.0\\.0-0\\s*$`)})),Ea=n(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Da=n(((e,t)=>{var n=/^[0-9]+$/,r=(e,t)=>{if(typeof e==`number`&&typeof t==`number`)return e===t?0:e<t?-1:1;let r=n.test(e),i=n.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};t.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}})),Oa=n(((e,t)=>{var n=Ca(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=wa(),{safeRe:a,t:o}=Ta(),s=Ea(),{compareIdentifiers:c}=Da(),l=(e,t)=>{let n=t.split(`.`);if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(c(e[t],n[t])!==0)return!1;return!0};t.exports=class e{constructor(t,c){if(c=s(c),t instanceof e){if(t.loose===!!c.loose&&t.includePrerelease===!!c.includePrerelease)return t;t=t.version}else if(typeof t!=`string`)throw TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>r)throw TypeError(`version is longer than ${r} characters`);n(`SemVer`,t,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;let l=t.trim().match(c.loose?a[o.LOOSE]:a[o.FULL]);if(!l)throw TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);l[4]?this.prerelease=l[4].split(`.`).map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split(`.`):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(`.`)}`),this.version}toString(){return this.version}compare(t){if(n(`SemVer.compare`,this.version,this.options,t),!(t instanceof e)){if(typeof t==`string`&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:+(this.patch>t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let e=this.prerelease[r],i=t.prerelease[r];if(n(`prerelease compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let e=this.build[r],i=t.build[r];if(n(`build compare`,r,e,i),e===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(e===void 0)return-1;if(e===i)continue;return c(e,i)}while(++r)}inc(e,t,n){if(e.startsWith(`pre`)){if(!t&&n===!1)throw Error(`invalid increment argument: identifier is empty`);if(t){let e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t,n);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t,n);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t,n),this.inc(`pre`,t,n);break;case`release`:if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case`major`:(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case`minor`:(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case`patch`:this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case`pre`:{let e=+!!Number(n);if(this.prerelease.length===0)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)typeof this.prerelease[r]==`number`&&(this.prerelease[r]++,r=-2);if(r===-1){if(t===this.prerelease.join(`.`)&&n===!1)throw Error(`invalid increment argument: identifier already exists`);this.prerelease.push(e)}}if(t){let r=[t,e];if(n===!1&&(r=[t]),l(this.prerelease,t)){let e=this.prerelease[t.split(`.`).length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(`.`)}`),this}}})),ka=t(n(((e,t)=>{var n=Oa();t.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}}))(),1);function Aa(e){if(!e)return``;let t=e.indexOf(`+`),n=t===-1?``:e.slice(t+1),r=t===-1?e:e.slice(0,t);if(n&&n!==`moya`){let e=n.split(`.`),t=e[e.length-1];if(t&&/^[0-9a-f]{7,40}$/.test(t))return`https://github.com/TryGhost/Ghost/commit/${t}`}try{let e=(0,ka.default)(r,{includePrerelease:!0})?.prerelease;if(e&&e.length>0){let t=String(e[0]).split(`-`)[1];return t?.startsWith(`g`)?`https://github.com/TryGhost/Ghost/commit/${t.slice(1)}`:``}}catch{return``}return`https://github.com/TryGhost/Ghost/releases/tag/v${r}`}function ja(e,t){let n=!!e.match?.(/production/i);return!!(n&&t!==`mysql8`||!n&&t===`mysql5`)}function Ma({label:e,version:t}){let n=Aa(t);return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`strong`,{children:[e,`:`]}),` `,n?(0,Q.jsx)(`a`,{className:`text-green`,href:n,rel:`noopener noreferrer`,target:`_blank`,children:t}):t]})}var Na=H.create(()=>{let{updateRoute:e}=V(),t=xt().config,n=et();function r(){return new Date().getFullYear()}function i(){return!!t.enableDeveloperExperiments}function a(){return!t.hostSettings?.siteId}return(0,Q.jsx)(Ie,{afterClose:()=>{e(``)},cancelLabel:``,footer:(0,Q.jsx)(Q.Fragment,{}),topRightContent:`close`,width:540,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 pb-7`,children:[(0,Q.jsx)(fe,{className:`h-auto w-[120px] dark:invert`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[n?.message&&(0,Q.jsxs)(`div`,{className:`gh-prose-links mb-4 rounded-sm border border-green p-5`,children:[(0,Q.jsx)(`strong`,{children:`Update available!`}),(0,Q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:n.message}})]}),(0,Q.jsx)(Ma,{label:`Version`,version:t.version}),a()&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`strong`,{children:`Environment:`}),` `,t.environment]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`strong`,{children:`Database:`}),` `,t.database]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`strong`,{children:`Mail:`}),` `,t.mail?t.mail:`Native`]})]}),i()&&(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`strong`,{children:`Developer experiments:`}),` Enabled`]}),a()&&ja(t.environment,t.database)&&(0,Q.jsxs)(`div`,{className:`text-red-500 dark:text-red-400`,children:[`You are running an unsupported database in production. Please `,(0,Q.jsx)(`a`,{href:`https://ghost.org/docs/faq/supported-databases/`,rel:`noopener noreferrer`,target:`_blank`,children:`upgrade to MySQL 8`}),`.`]})]}),(0,Q.jsx)(Jn,{}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`a`,{className:`flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400`,href:`https://ghost.org/docs/`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Q.jsx)(Wr,{className:`size-4`}),` User documentation`]}),(0,Q.jsxs)(`a`,{className:`flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400`,href:`https://forum.ghost.org/`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Q.jsx)(li,{className:`size-4`}),` Get help with Ghost`]}),(0,Q.jsxs)(`a`,{className:`flex items-center gap-2 hover:text-grey-900 dark:hover:text-grey-400`,href:`https://ghost.org/docs/contributing/`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Q.jsx)(Vn,{className:`size-4`}),` Get involved`]})]}),(0,Q.jsx)(Jn,{}),(0,Q.jsxs)(`p`,{className:`max-w-[460px] text-sm`,children:[`Copyright © 2013 – `,r(),` Ghost Foundation, released under the `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://github.com/TryGhost/Ghost/blob/main/LICENSE`,rel:`noopener noreferrer`,target:`_blank`,children:`MIT license`}),`. `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost`}),` is a registered trademark of `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/trademark/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Foundation Ltd`}),`.`]})]})})}),Pa=H.create(()=>{let e=Oe(),{updateRoute:t}=V(),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)({name:``}),{mutateAsync:o}=ut(),s=De(),c=h();return(0,Z.useEffect)(()=>{s?.isLimited(`customIntegrations`)&&s.errorIfWouldGoOverLimit(`customIntegrations`).catch(n=>{n instanceof Ee&&(H.show(ke,{prompt:n.message||`Your current plan doesn't support more custom integrations.`,onOk:()=>t({route:`/pro`,isExternal:!0})}),e.remove(),t(`integrations`))})},[s,e,t]),(0,Q.jsx)(Ie,{afterClose:()=>{t(`integrations`)},okLabel:`Add`,okVariant:`default`,size:`sm`,testId:`add-integration-modal`,title:`Add integration`,onOk:async()=>{if(!n){a({name:`Name is required`});return}try{let r=await o({name:n});e.remove(),t({route:`integrations/${r.integrations[0].id}`})}catch(e){c(e)}},children:(0,Q.jsx)(`div`,{className:`mt-5`,children:(0,Q.jsx)(tn,{className:`gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:(0,Q.jsxs)(J,{"data-invalid":!!i.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`integration-name`,children:`Name`}),(0,Q.jsx)(X,{"aria-invalid":!!i.name||void 0,id:`integration-name`,maxLength:191,placeholder:`Custom integration`,value:n,autoFocus:!0,onChange:e=>r(e.target.value),onInput:()=>i.name&&a({name:``})}),i.name&&(0,Q.jsx)(G,{children:i.name})]})})})})}),Fa=H.create(()=>{let e=Oe(),{updateRoute:t}=V(),n=se(`automations`)?`emails`:`newsletters`,r=h(),[i,a]=(0,Z.useState)(!0),[o,s]=(0,Z.useState)(null),{data:c}=bi({searchParams:{filter:`newsletters.status:active+email_disabled:0`,limit:`1`,page:`1`,include:`newsletters,labels`}}),{mutateAsync:l}=ji(),{formState:u,updateForm:d,saveState:f,handleSave:p,errors:m,clearError:g}=T({initialState:{name:``,description:``,optInExistingSubscribers:!0},onSave:async()=>{let e=await l({name:u.name,description:u.description,opt_in_existing:u.optInExistingSubscribers,feedback_enabled:!0});t({route:`newsletters/${e.newsletters[0].id}`})},onSaveError:r,onValidate:()=>{let e={};return u.name||(e.name=`A name is required for your newsletter`),e}}),_=De();(0,Z.useEffect)(()=>{if(!_){a(!1);return}_.errorIfWouldGoOverLimit(`newsletters`).catch(e=>{if(e instanceof Ee)s(e);else throw e}).finally(()=>{a(!1)})},[_]);let v=c?.meta?.pagination.total;return(0,Z.useEffect)(()=>{o&&(H.show(ke,{prompt:o.message||`Your current plan doesn't support more newsletters.`,onOk:()=>t({route:`/pro`,isExternal:!0})}),e.remove(),t(n))},[o,e,n,t]),i||o?null:(0,Q.jsx)(Ie,{afterClose:()=>{t(n)},backDropClick:!1,okDisabled:f===`saving`,okLabel:`Create`,okLoading:f===`saving`,okVariant:`default`,size:`sm`,testId:`add-newsletter-modal`,title:`Create newsletter`,onOk:async()=>{await p()&&e.remove()},children:(0,Q.jsxs)(tn,{className:`mt-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!m.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-name`,children:`Name`}),(0,Q.jsx)(X,{"aria-invalid":!!m.name||void 0,id:`newsletter-name`,maxLength:191,placeholder:`Weekly roundup`,value:u.name,autoFocus:!0,onChange:e=>d(t=>({...t,name:e.target.value})),onKeyDown:()=>g(`name`)}),m.name&&(0,Q.jsx)(G,{children:m.name})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`newsletter-description`,children:`Description`}),(0,Q.jsx)(sn,{className:`border-transparent bg-muted`,id:`newsletter-description`,maxLength:2e3,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value}))})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`opt-in-existing-subscribers`,children:`Opt-in existing subscribers`}),(0,Q.jsx)(q,{children:u.optInExistingSubscribers?`This newsletter will be available to all members. Your ${v===void 0?``:F(v)} existing subscriber${c?.meta?.pagination.total===1?``:`s`} will also be opted-in to receive it.`:`The newsletter will be available to all new members. Existing members won’t be subscribed, but may visit their account area to opt-in to future emails.`})]}),(0,Q.jsx)(W,{checked:u.optInExistingSubscribers,id:`opt-in-existing-subscribers`,onCheckedChange:e=>d(t=>({...t,optInExistingSubscribers:e}))})]})]})})}),Ia=H.create(()=>{let e=H.useModal(),{updateRoute:t}=V(),{data:{integrations:n}={integrations:[]}}=nt(),r=n.find(({slug:e})=>e===`ghost-core-content`)?.api_keys?.find(e=>e.type===`content`);return(0,Q.jsxs)(Ie,{afterClose:()=>{t(`integrations`)},cancelLabel:``,footer:(0,Q.jsxs)(`div`,{className:`mx-8 flex w-full items-center justify-between`,children:[(0,Q.jsx)(cr,{variant:`outline`,asChild:!0,children:(0,Q.jsxs)(`a`,{href:`https://ghost.org/docs/content-api/`,rel:`noopener noreferrer`,target:`_blank`,children:[`Open docs `,(0,Q.jsx)(sr,{className:`size-3`})]})}),(0,Q.jsx)(cr,{type:`button`,onClick:()=>{t(`integrations`),e.remove()},children:`Close`})]}),testId:`content-api-modal`,title:``,stickyFooter:!0,children:[(0,Q.jsx)(mt,{detail:`Access your content programmatically`,icon:(0,Q.jsx)(Vn,{className:`size-14`}),title:`Content API`}),(0,Q.jsxs)(`div`,{className:`mt-7`,children:[(0,Q.jsx)(`p`,{className:`mb-6 text-grey-700`,children:`This key provides read-only access to your published content. For full read/write access, create a custom integration.`}),(0,Q.jsx)(Qe,{keys:[{id:`content-api-key`,label:`Content API key`,text:r?.secret},{id:`api-url`,label:`API URL`,text:window.location.origin+d().subdir}]})]})]})}),La=H.create(({recommendation:e,animate:t})=>{let n=Oe(),{updateRoute:r,route:i}=V(),{mutateAsync:a}=pe(),o=h(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:d,clearError:f,setErrors:p}=T({initialState:{...e},onSave:async e=>{await a(e),n.remove(),b.success(`Recommendation added`),ye(`Recommendation Added`,{oneClickSubscribe:e.one_click_subscribe}),r(`recommendations`)},onSaveError:o,onValidate:e=>ce(e)}),m=`Add`,g=!1;u===`saving`?g=!0:u===`saved`&&(m=`Added`);let _=(0,Q.jsxs)(cr,{size:`sm`,type:`button`,variant:`ghost`,onClick:()=>{u!==`saving`&&(n.remove(),H.show(Ba,{pathName:i,animate:!1,recommendation:{...s}}))},children:[(0,Q.jsx)(Un,{}),`Back`]});return(0,Q.jsx)(Ie,{afterClose:()=>{r(`recommendations`)},animate:t??!0,backDropClick:!1,cancelLabel:`Cancel`,dirty:!0,leftButton:_,okLabel:m,okLoading:g,okVariant:`default`,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,stickyFooter:!0,onCancel:()=>{u!==`saving`&&(n.remove(),r(`recommendations`))},onOk:async()=>{if(u!==`saving`){b.dismiss();try{await l({force:!0})}catch{b.error(`Something went wrong when adding this recommendation, please try again.`)}}},children:(0,Q.jsx)(ie,{clearError:f,errors:d,formState:s,setErrors:p,showURL:!1,updateForm:c})})}),Ra=e=>ge(e).save||``,za=function(e,t){try{new URL(t).hostname.includes(`.`)?delete e.url:e.url=`Enter a valid URL`}catch{e.url=`Enter a valid URL`}return e},Ba=H.create(({searchParams:e,recommendation:t,animate:n})=>{let[r,i]=(0,Z.useState)(!1),a=Oe(),{updateRoute:o}=V(),{mutateAsync:s}=te(),c=t?``:e?.get(`url`)??``,{save:l}=c?ge(c):{save:``},u=Z.useRef(!1),[d,p]=Z.useState(!!l),{formState:m,updateForm:h,handleSave:g,errors:_,saveState:v,clearError:y}=T({initialState:t??{title:``,url:l||``,description:``,excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let e=new URL(m.url),t=e.hostname.replace(`www.`,``),n={...m,url:e.toString()},{recommendations:r=[]}=await s(e);if(!r||r.length===0)return;let i=r[0];if(i.id)throw new f(`A recommendation with this URL already exists.`);n.title=i.title??t,n.excerpt=i.excerpt??n.excerpt,n.featured_image=i.featured_image??n.featured_image??null,n.favicon=i.favicon??n.favicon??null,n.one_click_subscribe=i.one_click_subscribe??n.one_click_subscribe??!1,n.description=n.excerpt||null,a.remove(),H.show(La,{animate:!1,recommendation:n})},onValidate:()=>{let e={};return za(e,m.url),d&&p(Object.keys(e).length===0),e}}),x=Z.useCallback(async()=>{if(v!==`saving`){b.dismiss();try{if(await g({force:!0}))return}catch(e){let t=e instanceof f?e.message:`Something went wrong while checking this URL, please try again.`;b.error(t)}d&&p(!1)}},[g,v,d,p]);return Z.useEffect(()=>{d&&!u.current&&(u.current=!0,x())},[d,x]),(0,Z.useEffect)(()=>{r&&(x(),i(!1))},[m]),d?(0,Q.jsx)(Ie,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,footer:!1,header:!1,size:`sm`,children:(0,Q.jsx)(`div`,{className:`flex flex-col items-center justify-center p-8`,children:(0,Q.jsx)(`div`,{className:`flex h-64 items-center justify-center`,children:(0,Q.jsx)(Kr,{size:`lg`})})})}):(0,Q.jsxs)(Ie,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,okLabel:`Next`,okLoading:v===`saving`,okVariant:`default`,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,onOk:x,children:[(0,Q.jsxs)(`p`,{className:`mt-4`,children:[`You can recommend `,(0,Q.jsx)(`strong`,{children:`any site`}),` your audience will find valuable, not just those published on Ghost.`]}),(0,Q.jsx)(tn,{className:`mt-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:(0,Q.jsxs)(J,{"data-invalid":!!_.url||void 0,children:[(0,Q.jsx)(K,{htmlFor:`recommendation-url`,children:`URL`}),(0,Q.jsx)(X,{"aria-invalid":!!_.url||void 0,id:`recommendation-url`,maxLength:2e3,placeholder:`https://www.example.com`,value:m.url,autoFocus:!0,onBlur:()=>{let e=Ra(m.url);h(t=>({...t,url:e}))},onChange:e=>{y?.(`url`),h(t=>({...t,url:e.target.value}))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),h(e=>({...e,url:Ra(m.url)})),i(!0))}}),_.url?(0,Q.jsx)(G,{children:_.url}):(0,Q.jsxs)(q,{children:[`Need inspiration? `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://www.ghost.org/explore`,rel:`noopener noreferrer`,target:`_blank`,children:`Explore thousands of sites`}),` to recommend`]})]})})]})});function Va(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),e(...r)},t)}}var Ha=({generateContent:e,updateContent:t,className:n,height:r,width:i,parentClassName:a,testId:o,addDelay:s=!1})=>{let[c,u]=(0,Z.useState)(0),d=[(0,Z.useRef)(null),(0,Z.useRef)(null)],[f,p]=(0,Z.useState)(0);return(0,Z.useEffect)(()=>{let t=+(c===0),n=d[t].current;if(n){e(n);let r=()=>{s?setTimeout(()=>{u(t)},500):u(t)};return n.addEventListener(`load`,r),()=>{n.removeEventListener(`load`,r)}}},[e]),(0,Z.useEffect)(()=>{let e=d[c].current,t=Va(()=>{p(e?.contentWindow?.scrollY||0)},250);return e?.contentWindow?.addEventListener(`scroll`,t),()=>{e?.contentWindow?.removeEventListener(`scroll`,t)}},[c,d]),(0,Z.useEffect)(()=>{let e=d[c].current;if(e)try{e.contentWindow?.scrollTo(0,f)}catch(e){l(e)}},[f,c,d]),(0,Z.useEffect)(()=>{t&&d.forEach(({current:e})=>{e&&t(e)})},[t]),(0,Q.jsxs)(`div`,{className:a,"data-testid":o,children:[(0,Q.jsx)(`iframe`,{ref:d[0],className:`${n} ${c===0?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===0,frameBorder:`0`,height:r,title:`Buffered Preview 1`,width:i}),(0,Q.jsx)(`iframe`,{ref:d[1],className:`${n} ${c===1?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===1,frameBorder:`0`,height:r,title:`Buffered Preview 2`,width:i})]})},Ua=(e,t,n)=>{let r=new URLSearchParams;return r.append(`announcement_bg`,e||`accent`),r.append(`announcement`,t||``),n&&n.length>0&&r.append(`announcement_vis`,n?.join(`,`)||``),r.toString()},Wa=({announcementBackgroundColor:e,announcementContent:t,url:n,visibility:r})=>{let i=(0,Z.useMemo)(()=>r,[r?.join(`,`)]);return(0,Q.jsx)(Ha,{addDelay:!0,className:`absolute -top-px -left-px size-[calc(110%_+_3px)] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[calc(130%_+_3px)] max-[1600px]:scale-[.76923]`,generateContent:(0,Z.useCallback)(r=>{if(!n)return;let a=new URL(n);a.searchParams.set(`admin_toolbar`,`0`),fetch(a.toString(),{method:`POST`,headers:{"Content-Type":`text/html;charset=utf-8`,"x-ghost-preview":Ua(e,t,i),Accept:`text/html`},mode:`cors`,credentials:`include`}).then(e=>e.text()).then(e=>{let t=new DOMParser().parseFromString(e,`text/html`),n=t.querySelector(`style`);n.innerHTML=`${n.innerHTML}\n\nhtml { pointer-events: none; }`;let i=(t.doctype?new XMLSerializer().serializeToString(t.doctype):``)+t.documentElement.outerHTML;r.contentDocument?.open(),r.contentDocument?.write(i),r.contentDocument?.close()}).catch(()=>{})},[e,t,n,i]),height:`100%`,parentClassName:`relative h-full w-full overflow-hidden`,testId:`announcement-bar-preview-iframe`,width:`100%`})},Ga=({title:e,value:t,swatches:n,size:r=`md`,onChange:i})=>(0,Q.jsxs)(wt,{gap:`sm`,children:[e&&(0,Q.jsx)(Tt,{weight:`semibold`,children:e}),(0,Q.jsx)(yt,{size:r,swatches:n,value:t,onSelect:i})]}),Ka=({value:e,onChange:t,singleParagraph:n=!0,...r})=>{let i=(0,Z.useCallback)(n=>{let r=new DOMParser().parseFromString(n,`text/html`);r.querySelectorAll(`*`).forEach(e=>{e.style.removeProperty(`white-space`),e.getAttribute(`style`)||e.removeAttribute(`style`)}),r.body.innerHTML!==e&&t?.(r.body.innerHTML)},[e,t]);return(0,Q.jsx)(Je,{...r,singleParagraph:n,children:t=>(0,Q.jsx)(t.HtmlOutputPlugin,{html:e,setHtml:i})})},qa=({title:e,hideTitle:t,error:n,hint:r,value:i,clearBg:a=!1,className:o=``,containerClassName:s=``,hintClassName:c=``,unstyled:l=!1,...u})=>{let d=l?``:L(zt(`within`),`flex min-h-8 items-center py-1.5 md:min-h-[var(--control-height)]`,a?`bg-transparent`:`px-3`,n&&`border-destructive`,e&&!t&&!a&&`mt-2`,o);return(0,Q.jsxs)(`div`,{className:`flex flex-col ${s}`,children:[e&&(0,Q.jsx)(K,{className:t?`sr-only`:void 0,children:e}),(0,Q.jsx)(`div`,{className:d,children:(0,Q.jsx)(Ka,{...u,value:i})}),r&&(0,Q.jsx)(q,{className:L(`mt-1`,n&&`text-destructive`,c),children:r})]})},Ja={1:`3xl`,2:`2xl`,3:`xl`,4:`lg`,5:`md`,6:`md`},Ya={1:`text-4xl`,2:`md:text-3xl`,3:`md:text-2xl`,4:`md:text-xl`,5:`md:text-lg`,6:`text-base`},Xa={1:`supertight`,2:`heading`,3:`heading`,4:`heading`,5:`supertight`,6:`body`},Za=({testId:e,title:t,titleHeadingLevel:n=4,size:r=`full`,width:i,height:a,sidebar:o=``,preview:s,dirty:c=!1,cancelLabel:l=`Cancel`,okLabel:u=`OK`,okVariant:d=`default`,previewToolbar:f=!0,leftToolbar:p=!0,rightToolbar:m=!0,deviceSelector:h,siteLink:g,previewToolbarURLs:_,previewBgColor:v=`grey`,previewToolbarTabs:y,previewToolbarBreadcrumbs:b,buttonsDisabled:x,sidebarButtons:S,sidebarHeader:C,sidebarPadding:w=!0,sidebarContentClasses:T,enableCMDS:E=!0,backDropClick:D,onCancel:O,onOk:k,afterClose:A})=>{let j=Oe(),{setGlobalDirtyState:M}=Et(),{confirm:ee,dialogProps:N}=St();if((0,Z.useEffect)(()=>{M(c)},[c,M]),(0,Z.useEffect)(()=>{if(k){let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),k())};if(E)return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}}}),f){let e=(0,Q.jsx)(Q.Fragment,{});_?e=_:y?e=y:b&&(e=b);let t=``;v===`grey`?t=`bg-preview-canvas`:v===`greygradient`&&(t=`bg-gradient-to-tr from-preview-gradient-start to-preview-gradient-end`);let n=P(`absolute inset-y-0 right-[400px] left-0 flex w-full min-w-100 grow flex-col overflow-y-auto`,t),r;g&&(r=(0,Q.jsx)(R,{className:`ml-3 border-l border-border-strong`,children:(0,Q.jsxs)(`a`,{className:`ml-3 flex items-center gap-1`,href:g,rel:`noopener noreferrer`,target:`_blank`,children:[`View site `,(0,Q.jsx)(sr,{className:`size-3`})]})})),s=(0,Q.jsxs)(R,{className:n,children:[f&&(0,Q.jsxs)(Ct,{as:`header`,className:`relative h-[80px] shrink-0 px-8 py-5`,"data-testid":`design-toolbar`,justify:`center`,children:[p&&(0,Q.jsx)(Ct,{align:`center`,className:`absolute left-8 h-full`,children:e}),m&&(0,Q.jsxs)(Ct,{align:`center`,className:`absolute right-8 h-full`,children:[h,r]})]}),(0,Q.jsx)(Ct,{align:`center`,className:`grow text-muted-foreground`,justify:`center`,children:s})]})}let F=O||(()=>{ee(c,()=>{j.remove(),A?.()})});return(0,Q.jsxs)(Ie,{afterClose:A,animate:!1,backDropClick:D,dirty:c,footer:!1,height:a,padding:!1,size:r,testId:e,title:``,width:i,hideXOnMobile:!0,children:[(0,Q.jsxs)(Ct,{align:`stretch`,className:`h-full grow`,gap:`none`,children:[(0,Q.jsx)(R,{className:P(`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex`,v===`grey`?`bg-preview-canvas`:`bg-surface-panel`),children:s}),o&&(0,Q.jsxs)(R,{className:`relative flex size-full flex-col border-l border-border-default bg-surface-elevated-2 [@media(min-width:801px)]:w-auto [@media(min-width:801px)]:basis-[400px]`,children:[C||(0,Q.jsxs)(Ct,{align:`center`,className:`max-h-[82px] px-7 py-6`,gap:`md`,justify:`between`,children:[(0,Q.jsx)(Tt,{as:`h${n}`,className:Ya[n],leading:Xa[n],size:Ja[n],tone:n===6?`secondary`:`primary`,weight:n===6?`semibold`:`bold`,children:t}),S||(0,Q.jsxs)(Ct,{gap:`md`,children:[(0,Q.jsx)(cr,{className:`font-semibold`,disabled:x,type:`button`,variant:`ghost`,onClick:F,children:l}),(0,Q.jsx)(cr,{disabled:x,type:`button`,variant:d,onClick:k,children:u})]})]}),(0,Q.jsx)(R,{className:P(`flex flex-col justify-between overflow-y-auto`,!C&&`absolute inset-x-0 top-[80px] bottom-0 grow`,w&&`p-7 pt-0`,T),children:o})]})]}),(0,Q.jsx)(Se,{...N})]})},Qa=({announcementContent:e,announcementTextHandler:t,accentColor:n,announcementBackgroundColor:r,toggleColorSwatch:i,toggleVisibility:a,visibility:o=[],paidMembersEnabled:s,onBlur:c})=>{let l=[{label:`Public visitors`,onChange:e=>{a(`visitors`,e)},value:`visitors`,checked:o.includes(`visitors`)},{label:`Free members`,onChange:e=>{a(`free_members`,e)},value:`free_members`,checked:o.includes(`free_members`)},...s?[{label:`Paid members`,onChange:e=>{a(`paid_members`,e)},value:`paid_members`,checked:o.includes(`paid_members`)}]:[]];return(0,Q.jsxs)(tn,{className:`mb-10 gap-8`,children:[(0,Q.jsx)(qa,{nodes:`MINIMAL_NODES`,placeholder:`Highlight breaking news, offers or updates`,title:`Announcement`,value:e,onBlur:c,onChange:t}),(0,Q.jsx)(Ga,{size:`lg`,swatches:[{hex:`#08090c`,title:`Dark`,value:`dark`},{hex:`#ffffff`,title:`Light`,value:`light`},{hex:n||`#ffdd00`,title:`Accent`,value:`accent`}],title:`Background color`,value:r,onChange:e=>{e!==null&&i(e)}}),(0,Q.jsxs)(rn,{children:[(0,Q.jsx)(on,{variant:`label`,children:`Visibility`}),(0,Q.jsx)(tn,{"data-slot":`checkbox-group`,children:l.map(e=>(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(en,{checked:e.checked,id:`announcement-${e.value}`,onCheckedChange:t=>e.onChange(t===!0)}),(0,Q.jsx)(K,{htmlFor:`announcement-${e.value}`,children:e.label})]},e.value))})]})]})},$a=H.create(()=>{let{siteData:e}=xt(),{localSettings:t,updateSetting:n,handleSave:r,okProps:i}=ve({savingDelay:500}),[a]=Hn(t,[`announcement_content`]),[o]=Hn(t,[`accent_color`]),[s]=Hn(t,[`announcement_background`]),[c]=Hn(t,[`announcement_visibility`]),[l]=Hn(t,[`paid_members_enabled`]),u=JSON.parse(c?.toString()||`[]`),{updateRoute:d}=V(),[f,p]=(0,Z.useState)(`homepage`),[m,h]=(0,Z.useState)(`desktop`),g=e=>{n(`announcement_background`,e)},_=(e,t)=>{let r=u.indexOf(e);r===-1&&t?u.push(e):u.splice(r,1),n(`announcement_visibility`,JSON.stringify(u))},v=(0,Z.useRef)(ne(e=>{n(`announcement_content`,e)},500)),y=(0,Q.jsx)(Qa,{accentColor:o,announcementBackgroundColor:s,announcementContent:a,announcementTextHandler:e=>{v.current(e)},paidMembersEnabled:l,toggleColorSwatch:g,toggleVisibility:_,visibility:c,onBlur:()=>{}}),{data:{posts:[x]}={posts:[]}}=M({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),S=e=>{x&&p(e)},C=wi(e);switch(f){case`homepage`:C=wi(e);break;case`post`:C=x.url;break}let w=(0,Q.jsx)(Wa,{announcementBackgroundColor:s,announcementContent:a,url:C,visibility:u}),T=m===`desktop`?(0,Q.jsx)(zi,{"data-testid":`preview-desktop`,device:`desktop`,children:w}):(0,Q.jsx)(zi,{"data-testid":`preview-mobile`,device:`mobile`,children:w}),E=x?(0,Q.jsx)(Lt,{value:f,variant:`button-sm`,onValueChange:S,children:(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`homepage`,children:`Homepage`}),(0,Q.jsx)(Pt,{value:`post`,children:`Post`})]})}):void 0,D=(0,Q.jsxs)(xn,{type:`single`,value:m,onValueChange:e=>{(e===`desktop`||e===`mobile`)&&h(e)},children:[(0,Q.jsx)(bn,{"aria-label":`Desktop`,value:`desktop`,children:(0,Q.jsx)(Hr,{})}),(0,Q.jsx)(bn,{"aria-label":`Mobile`,value:`mobile`,children:(0,Q.jsx)(ri,{})})]});return(0,Q.jsx)(Za,{afterClose:()=>{d(`announcement-bar`)},buttonsDisabled:i.disabled,cancelLabel:`Close`,deviceSelector:D,dirty:!1,okLabel:i.label||`Save`,okVariant:i.variant,preview:T,previewBgColor:`greygradient`,previewToolbarTabs:E,sidebar:y,testId:`announcement-bar-modal`,title:`Announcement`,titleHeadingLevel:5,onOk:async()=>{await r({fakeWhenUnchanged:!0})||b.error(`An error occurred while saving your changes. Please try again.`)}})}),eo=t(w(),1),to=[{label:`Global`,options:[{value:`site.changed`,label:`Site changed (rebuild)`}]},{label:`Posts`,options:[{value:`post.added`,label:`Post created`},{value:`post.deleted`,label:`Post deleted`},{value:`post.edited`,label:`Post updated`},{value:`post.published`,label:`Post published`},{value:`post.published.edited`,label:`Published post updated`},{value:`post.unpublished`,label:`Post unpublished`},{value:`post.scheduled`,label:`Post scheduled`},{value:`post.unscheduled`,label:`Post unscheduled`},{value:`post.tag.attached`,label:`Tag added to post`},{value:`post.tag.detached`,label:`Tag removed from post`}]},{label:`Pages`,options:[{value:`page.added`,label:`Page created`},{value:`page.deleted`,label:`Page deleted`},{value:`page.edited`,label:`Page updated`},{value:`page.published`,label:`Page published`},{value:`page.published.edited`,label:`Published page updated`},{value:`page.unpublished`,label:`Page unpublished`},{value:`page.tag.attached`,label:`Tag added to page`},{value:`page.tag.detached`,label:`Tag removed from page`}]},{label:`Tags`,options:[{value:`tag.added`,label:`Tag created`},{value:`tag.edited`,label:`Tag updated`},{value:`tag.deleted`,label:`Tag deleted`}]},{label:`Members`,options:[{value:`member.added`,label:`Member added`},{value:`member.edited`,label:`Member updated`},{value:`member.deleted`,label:`Member deleted`}]}],no=e=>to.flatMap(({options:e})=>e).find(t=>t.value===e)?.label,ro=m({method:`POST`,path:()=>`/webhooks/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:Pe,emberUpdateType:`createOrUpdate`,update:(e,t)=>t&&{...t,integrations:t.integrations.map(t=>{let n=e.webhooks[0];return n.integration_id===t.id?{...t,webhooks:[...t.webhooks||[],n]}:t})}}}),io=m({method:`PUT`,path:e=>`/webhooks/${e.id}/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:Pe,emberUpdateType:`createOrUpdate`,update:(e,t)=>t&&{...t,integrations:t.integrations.map(t=>({...t,webhooks:t.webhooks?.map(t=>t.id===e.webhooks[0].id?e.webhooks[0]:t)}))}}}),ao=m({method:`DELETE`,path:e=>`/webhooks/${e}/`,updateQueries:{dataType:Pe,emberUpdateType:`createOrUpdate`,update:(e,t,n)=>({...t,integrations:t.integrations.map(e=>({...e,webhooks:e.webhooks?.filter(e=>e.id!==n)}))})}}),oo=H.create(({webhook:e,integrationId:t})=>{let n=Z.useId(),r=Oe(),{mutateAsync:i}=ro(),{mutateAsync:a}=io(),o=h(),{formState:s,updateForm:c,handleSave:l,errors:u,clearError:d}=T({initialState:e||{},onSave:async()=>{s.id?await a(s):await i({...s,integration_id:t})},onSaveError:o,onValidate:()=>{let e={};return s.name||(e.name=`Enter a name`),s.event||(e.event=`Select an event`),s.target_url||(e.target_url=`Enter a target URL`),s.target_url&&!eo.default.isURL(s.target_url,{require_tld:!1})&&(e.target_url=`Enter a valid URL`),e}});return(0,Q.jsx)(Ie,{okLabel:e?`Update`:`Add`,okVariant:`default`,size:`sm`,testId:`webhook-modal`,title:`Add webhook`,formSheet:!0,onOk:async()=>{await l()&&r.remove()},children:(0,Q.jsx)(`div`,{className:`mt-5`,children:(0,Q.jsxs)(tn,{className:`gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!u.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`webhook-name`,children:`Name`}),(0,Q.jsx)(X,{"aria-invalid":!!u.name||void 0,id:`webhook-name`,maxLength:191,placeholder:`Custom webhook`,value:s.name??``,onChange:e=>c(t=>({...t,name:e.target.value})),onKeyDown:()=>d(`name`)}),u.name&&(0,Q.jsx)(G,{children:u.name})]}),(0,Q.jsxs)(J,{"data-invalid":!!u.event||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Event`}),(0,Q.jsxs)(qt,{value:s.event??``,onValueChange:e=>{c(t=>({...t,event:e})),d(`event`)},children:[(0,Q.jsx)(Wt,{"aria-describedby":u.event?n:void 0,"aria-invalid":!!u.event||void 0,"aria-label":`Event`,"data-testid":`event-select`,children:(0,Q.jsx)(Kt,{placeholder:`Select an event`})}),(0,Q.jsx)(Ut,{children:to.map(e=>(0,Q.jsxs)(Gt,{children:[(0,Q.jsx)(Vt,{children:e.label}),e.options.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))]},e.label))})]}),u.event&&(0,Q.jsx)(G,{id:n,children:u.event})]}),(0,Q.jsxs)(J,{"data-invalid":!!u.target_url||void 0,children:[(0,Q.jsx)(K,{htmlFor:`webhook-target-url`,children:`Target URL`}),(0,Q.jsx)(X,{"aria-invalid":!!u.target_url||void 0,id:`webhook-target-url`,maxLength:2e3,placeholder:`https://example.com`,type:`url`,value:s.target_url??``,onChange:e=>c(t=>({...t,target_url:e.target.value})),onKeyDown:()=>d(`target_url`)}),u.target_url&&(0,Q.jsx)(G,{children:u.target_url})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`webhook-secret`,children:`Secret`}),(0,Q.jsx)(X,{id:`webhook-secret`,maxLength:191,placeholder:`https://example.com`,value:s.secret||``,onChange:e=>c(t=>({...t,secret:e.target.value}))})]})]})})})}),so=({integration:e})=>{let{mutateAsync:t}=ao(),n=h(),r=e=>{H.show(We,{title:`Are you sure?`,prompt:`Deleting this webhook may prevent the integration from functioning.`,okVariant:`destructive`,okLabel:`Delete Webhook`,onOk:async r=>{try{await t(e),r?.remove(),b.info(`Webhook deleted`)}catch(e){n(e)}}})};return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(yn,{children:[(0,Q.jsx)(vn,{children:(0,Q.jsxs)(hn,{children:[(0,Q.jsxs)(mn,{children:[F(e.webhooks?.length||0),` `,e.webhooks?.length===1?`webhook`:`webhooks`]}),(0,Q.jsx)(mn,{children:`Last triggered`}),(0,Q.jsx)(mn,{children:(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,Q.jsx)(gn,{children:e.webhooks?.map(t=>(0,Q.jsxs)(hn,{className:`cursor-pointer`,onClick:()=>{H.show(oo,{webhook:t,integrationId:e.id})},children:[(0,Q.jsxs)(_n,{className:`w-3/4 py-3 pr-6`,children:[(0,Q.jsx)(`div`,{className:`font-semibold`,children:t.name}),(0,Q.jsxs)(`div`,{className:`mt-1 grid grid-cols-[max-content_1fr] gap-1 text-sm leading-snug`,children:[(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Event:`}),(0,Q.jsx)(`span`,{children:no(t.event)}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`URL:`}),(0,Q.jsx)(`span`,{className:`line-clamp-3 break-all`,title:t.target_url,children:t.target_url})]})]}),(0,Q.jsx)(_n,{className:`w-1/4 py-3 pr-6 text-sm`,children:t.last_triggered_at&&new Date(t.last_triggered_at).toLocaleString(`default`,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,Q.jsx)(_n,{className:`w-0 text-right`,children:(0,Q.jsx)(cr,{className:`text-destructive hover:text-destructive`,size:`sm`,type:`button`,variant:`ghost`,onClick:e=>{e.stopPropagation(),r(t.id)},children:`Delete`})})]},t.id))})]}),(0,Q.jsx)(`div`,{className:`mt-5`,children:(0,Q.jsxs)(cr,{className:`h-auto p-0 text-green hover:text-green`,size:`sm`,type:`button`,variant:`link`,onClick:()=>{H.show(oo,{integrationId:e.id})},children:[(0,Q.jsx)(gi,{}),`Add webhook`]})})]})},co=({integration:e})=>{let t=Oe(),{updateRoute:n}=V(),{mutateAsync:r}=Xe(),{mutateAsync:i}=qe(),{mutateAsync:a}=re(),o=h(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:f,clearError:p,okProps:m}=T({initialState:e,savingDelay:500,savedDelay:500,onSave:async()=>{await r(s)},onSavedStateReset:()=>{n(`integrations`)},onSaveError:o,onValidate:()=>{let e={};return s.name||(e.name=`Enter integration title`),e}}),g=e.api_keys?.find(e=>e.type===`admin`),_=e.api_keys?.find(e=>e.type===`content`),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{e.type!==`custom`&&(t.remove(),n(`integrations`))},[e.type,t,n]);let S=(t,n)=>{n(!1);let r=t.type===`content`?`Content`:`Admin`;H.show(We,{title:`Regenerate ${r} API Key`,prompt:`You can regenerate ${r} API Key any time, but any scripts or applications using it will need to be updated.`,okLabel:`Regenerate ${r} API Key`,onOk:async r=>{try{await i({integrationId:e.id,apiKeyId:t.id}),n(!0),r?.remove()}catch(e){o(e)}}})};return(0,Q.jsxs)(Ie,{afterClose:()=>{n(`integrations`)},buttonsDisabled:m.disabled,cancelLabel:`Close`,dirty:u===`unsaved`,okLabel:m.label||`Save`,okVariant:m.variant,size:`md`,testId:`custom-integration-modal`,title:s.name||`Custom integration`,stickyFooter:!0,onOk:async()=>{await l({fakeWhenUnchanged:!0})},children:[(0,Q.jsxs)(`div`,{className:`mt-7 flex w-full flex-col gap-7 md:flex-row`,children:[(0,Q.jsx)(`div`,{className:`shrink-0`,children:(0,Q.jsx)(he,{className:`size-25`,children:s.icon_image?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(le,{id:`custom-integration-icon`,src:s.icon_image}),(0,Q.jsx)(be,{children:(0,Q.jsx)(_e,{"aria-label":`Remove icon`,onClick:()=>c(e=>({...e,icon_image:null})),children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{className:`text-center`,inputId:`custom-integration-icon`,onDropAccepted:async([e])=>{try{let t=Te(await a({file:e}));c(e=>({...e,icon_image:t}))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),o(t)}},children:`Upload icon`})})}),(0,Q.jsx)(`div`,{className:`flex min-w-0 grow flex-col`,children:(0,Q.jsxs)(tn,{className:`mb-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!f.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`integration-title`,children:`Title`}),(0,Q.jsx)(X,{"aria-invalid":!!f.name||void 0,id:`integration-title`,maxLength:191,value:s.name,onChange:e=>c(t=>({...t,name:e.target.value})),onKeyDown:()=>p(`name`)}),f.name&&(0,Q.jsx)(G,{children:f.name})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`integration-description`,children:`Description`}),(0,Q.jsx)(X,{id:`integration-description`,maxLength:2e3,value:s.description||``,onChange:e=>c(t=>({...t,description:e.target.value}))})]}),(0,Q.jsx)(Qe,{keys:[{id:`content-api-key`,label:`Content API key`,text:_?.secret,hint:b?(0,Q.jsx)(`div`,{className:`text-green`,children:`Content API Key was successfully regenerated`}):void 0,onRegenerate:()=>_&&S(_,x)},{id:`admin-api-key`,label:`Admin API key`,text:g?.secret,hint:v?(0,Q.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>g&&S(g,y)},{id:`api-url`,label:`API URL`,text:window.location.origin+d().subdir}]})]})})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(so,{integration:e})})]})},lo=H.create(({params:e})=>{let{data:{integrations:t}={}}=nt(),n=t?.find(({id:t})=>t===e?.id);return n?(0,Q.jsx)(co,{integration:n}):null});function uo(e){return typeof e==`object`&&!!e}function fo(e){return[...e.errors||[],...e.warnings||[]]}function po(e=[]){let t=[],n=[],r=[];return e.forEach(e=>{uo(e.details)?fo(e.details).forEach(e=>{e.fatal?t.push(e):n.push(e)}):r.push(e.details)}),{blockingProblems:t,secondaryProblems:n,stringErrors:r}}function mo(e){return[...e.errors||[],...e.warnings||[]]}function ho(e){return e.level===`warning`?`Warning`:e.level===`recommendation`?`Recommendation`:`Error`}function go(e){return e.level===`warning`?`warning`:e.level===`recommendation`?`secondary`:`destructive`}function _o(e){return`${e} non-blocking ${e===1?`issue`:`issues`}`}function vo({problem:e}){return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.details},className:`text-sm text-muted-foreground`}),e.failures?.length>0&&(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h6`,{className:`mb-1 text-xs font-semibold text-muted-foreground uppercase`,children:`Affected files`}),(0,Q.jsx)(`ul`,{className:`space-y-1 text-sm text-muted-foreground`,children:e.failures.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-xs text-foreground`,children:e.ref}),e.message?(0,Q.jsxs)(`span`,{children:[`: `,e.message]}):null]},`${e.ref}-${e.message||``}`))})]})]})}function yo({problem:e,prominent:t=!1}){let[n,r]=(0,Z.useState)(t),i=ho(e);return(0,Q.jsxs)(`div`,{className:`rounded-lg border ${t?`border-destructive/30 bg-background`:`border-border bg-background`} p-4`,children:[(0,Q.jsxs)(`button`,{className:`flex w-full items-start justify-between gap-3 text-left`,type:`button`,onClick:()=>r(!n),children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,Q.jsx)($n,{variant:go(e),children:i}),e.code&&(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.code})]}),(0,Q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.rule},className:`text-sm font-medium text-foreground`})]}),(0,Q.jsx)(Fn,{className:`mt-1 size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Q.jsx)(`div`,{className:`mt-4 border-t border-border pt-4`,children:(0,Q.jsx)(vo,{problem:e})})]})}function bo({defaultOpen:e,problems:t}){let[n,r]=(0,Z.useState)(e),i=t.length;(0,Z.useEffect)(()=>{r(e)},[e]);let a=(0,Z.useMemo)(()=>[...t].sort((e,t)=>{let n={Error:0,Warning:1,Recommendation:2};return n[ho(e)]-n[ho(t)]}),[t]);return i?(0,Q.jsxs)(`div`,{className:`mt-6 border-t border-border pt-5`,children:[(0,Q.jsxs)(`button`,{className:`flex w-full items-center justify-between gap-3 rounded-lg border border-border bg-background p-4 text-left transition-colors hover:bg-muted/40`,type:`button`,onClick:()=>r(!n),children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`text-sm font-semibold text-foreground`,children:[`Review `,_o(i)]}),(0,Q.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:n?`Hide details`:`Show details`})]}),(0,Q.jsx)(Fn,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Q.jsx)(`div`,{className:`mt-4 space-y-3`,children:a.map(e=>(0,Q.jsx)(yo,{problem:e},e.code))})]}):null}function xo({message:e}){return(0,Q.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(Xn,{className:`mt-0.5 size-4 shrink-0`}),(0,Q.jsx)(`p`,{children:e})]})})}function So({children:e,title:t,variant:n}){let r=n===`success`?er:Xn;return(0,Q.jsx)(ci,{role:n===`destructive`?`alert`:`status`,size:`lg`,variant:n===`success`?`success`:`destructive`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`div`,{className:`mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full ${n===`success`?`bg-state-success/10`:`bg-destructive/10`}`,children:(0,Q.jsx)(r,{className:`size-5 ${n===`success`?`text-state-success`:`text-destructive`}`})}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`text-xl font-semibold tracking-tight ${n===`success`?`text-state-success`:`text-destructive`}`,children:t}),(0,Q.jsx)(`div`,{className:`mt-1 text-sm text-foreground`,children:e})]})]})})}var Co=H.create(({title:e,prompt:t,fatalErrors:n,validationDetailsDefaultOpen:r,onRetry:i})=>{let{data:a}=ar(),o=r??a?.config?.environment===`development`,{blockingProblems:s,secondaryProblems:c,stringErrors:l}=po(n),u=s.length+l.length;return(0,Q.jsx)(Ve,{cancelLabel:`Close`,okLabel:`Retry`,okVariant:`default`,prompt:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsx)(`div`,{className:`text-sm text-foreground`,children:t??(0,Q.jsxs)(Q.Fragment,{children:[`Ghost found `,u===1?`a blocking validation error`:`${u} blocking validation errors`,` and did not save your theme. Fix `,u===1?`the issue`:`the issues`,` below and try again.`]})}),(s.length>0||l.length>0)&&(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[s.map(e=>(0,Q.jsx)(yo,{problem:e,prominent:!0},e.code)),l.map(e=>(0,Q.jsx)(xo,{message:e},e))]}),(0,Q.jsx)(bo,{defaultOpen:o,problems:c})]})}),stickyFooter:!0,title:e,onOk:i})}),wo=()=>{let e=Gr();return{supportsCustomFonts:!(e.data?.themes[0])?.warnings?.some(e=>e.code===`GS051-CUSTOM-FONTS`),refreshActiveThemeData:(0,Z.useCallback)(()=>{e.refetch()},[e])}},To=Z.forwardRef(function({className:e,...t},n){return(0,Q.jsx)(Tt,{ref:n,as:`h1`,className:P(`mb-8 text-4xl`,e),"data-modal-page":`title`,leading:`supertight`,weight:`bold`,...t})});To.displayName=`ModalPage.Title`;var $=Z.forwardRef(function({className:e,...t},n){return(0,Q.jsx)(R,{ref:n,className:P(`w-full p-[8vmin] pt-5`,e),"data-modal-page":`root`,...t})});$.displayName=`ModalPage`;var Eo=Object.assign($,{Title:To});function Do(e){let t=e.package?.name||e.name;return Tr(e)?t+=` (default)`:pr(e)?t+=` (legacy)`:e.package?.name!==e.name&&(t=(0,Q.jsxs)(`span`,{className:`md:text-base`,children:[t,` `,(0,Q.jsxs)(`span`,{className:`text-grey-600`,children:[`(`,e.name,`)`]})]})),tr(e)&&(t=(0,Q.jsxs)(`span`,{className:`font-bold md:text-base`,children:[t,` — `,(0,Q.jsx)(`span`,{className:`text-green`,children:` Active`})]})),t}function Oo(e){return e.package?.version||`1.0`}var ko=({theme:e})=>{let{mutateAsync:t}=Ln(),{mutateAsync:n}=ai(),{refreshActiveThemeData:r}=wo(),i=h(),{route:a,updateRoute:o}=V(),{checkThemeLimitError:s}=gt(),c=async()=>{try{await t(e.name),r(),b.success(`Theme activated`,{description:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme`]})})}catch(e){let t=null;e instanceof u&&e.response?.status===422&&e.data?.errors?t=e.data.errors:i(e);let n=(0,Q.jsx)(Q.Fragment,{children:`This theme couldn't be activated because Ghost found a blocking validation error. Fix the issue below and try again.`});t&&H.show(Co,{title:`Theme not activated`,prompt:n,fatalErrors:t,onRetry:async e=>{e?.remove(),c()}})}},l=async()=>{let{apiRoot:t}=d();v(`${t}/themes/${e.name}/download`)},f=async()=>{H.show(We,{title:`Are you sure you want to delete this?`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`You are about to delete `,(0,Q.jsxs)(`strong`,{children:[`"`,e.name,`".`]}),` This is permanent! We warned you, k? Maybe download`,` `,(0,Q.jsx)(`span`,{className:`cursor-pointer text-green-500`,onClick:()=>{l()},children:`your theme before continuing`})]}),okLabel:`Delete`,okRunningLabel:`Deleting`,okVariant:`destructive`,onOk:async t=>{try{await n(e.name),t?.remove()}catch(e){i(e)}}})},p=async()=>{let t=await s(`.`);if(t){H.show(ke,{prompt:t,onOk:()=>o({route:`/pro`,isExternal:!0})});return}o(`theme/edit/${encodeURIComponent(e.name)}?from=${encodeURIComponent(a??``)}`)},m=[];return tr(e)||m.push((0,Q.jsx)(cr,{className:`ml-2`,size:`sm`,type:`button`,variant:`ghost`,onClick:c,children:`Activate`},`activate`)),(0,Q.jsxs)(`div`,{className:`-mr-3 flex items-center gap-4`,children:[m,(0,Q.jsxs)(Yn,{children:[(0,Q.jsx)(fi,{asChild:!0,children:(0,Q.jsx)(cr,{"aria-label":`Menu`,size:`icon`,type:`button`,variant:`ghost`,children:(0,Q.jsx)(lr,{})})}),(0,Q.jsxs)(ui,{align:`end`,className:`z-[9999]`,children:[(0,Q.jsx)(Dr,{onSelect:p,children:`Edit code`}),(0,Q.jsx)(Dr,{onSelect:l,children:`Download`}),jr(e)&&(0,Q.jsx)(Dr,{onSelect:f,children:`Delete`})]})]})]})},Ao=({themes:e})=>(e.sort((e,t)=>e.active&&!t.active?-1:!e.active&&t.active?1:e.package?.name&&t.package?.name?e.package.name.localeCompare(t.package.name):e.name.localeCompare(t.name)),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`h1`,{className:`mb-5 text-2xl font-bold`,children:`Installed themes`}),(0,Q.jsx)(U,{className:`border-t border-border`,children:e.map(e=>{let t=Do(e),n=Oo(e);return(0,Q.jsxs)(pt,{"data-testid":`theme-list-item`,children:[(0,Q.jsxs)(Ue,{className:`py-3 pr-6`,id:`theme-${e.name}`,children:[(0,Q.jsx)(`div`,{children:t}),n&&(0,Q.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:n})]}),(0,Q.jsx)(Be,{children:(0,Q.jsx)(ko,{theme:e})})]},e.name)})})]})),jo=({themes:e})=>(0,Q.jsx)(Eo,{children:(0,Q.jsx)(Ao,{themes:e})}),Mo=``+new URL(`footer-marketplace-bg-cXGt4GLt.png`,import.meta.url).href,No=3e3,Po=e=>e.variants&&e.variants.length>0,Fo=e=>{let t=[{category:e.category,previewUrl:e.previewUrl,image:e.image}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},Io=({onSelectTheme:e})=>{let t=z(),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(0),o=e=>{r(e),a(e!==null&&Po(e)&&Fo(e).length>1?1:0)};return(0,Z.useEffect)(()=>{if(n===null)return;let e=setInterval(()=>{a((i+1)%(Fo(n).length||0))},No);return()=>clearInterval(e)},[n,i]),(0,Q.jsxs)(Eo,{children:[(0,Q.jsx)(Eo.Title,{children:`Themes`}),(0,Q.jsx)(`div`,{className:`mt-[6vmin] grid grid-cols-1 gap-[6vmin] sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4`,children:t.map(t=>{let r=Po(t),a=Fo(t),s=n===t;return(0,Q.jsxs)(`button`,{className:`flex cursor-pointer flex-col gap-3 text-left`,type:`button`,onClick:()=>{e?.(t)},children:[(0,Q.jsx)(`div`,{className:`relative w-full bg-grey-100 shadow-md transition-all duration-500 hover:scale-[1.05]`,onMouseEnter:()=>o(t),onMouseLeave:()=>o(null),children:r?(0,Q.jsx)(Q.Fragment,{children:a.map((e,n)=>(0,Q.jsx)(`img`,{alt:`${t.name} Theme - ${e.category}`,className:L(`size-full object-contain opacity-0 transition-opacity duration-500`,{"opacity-100":n===i&&s||!s&&n===0,relative:n===i,absolute:n!==i,"left-0":n!==i,"top-0":n!==i}),src:e.image},`theme-variant-${e.category.toLowerCase()}`))}):(0,Q.jsx)(`img`,{alt:`${t.name} Theme`,className:`size-full object-contain`,src:t.image})}),(0,Q.jsxs)(`div`,{className:`relative mt-3`,children:[(0,Q.jsx)(Tt,{as:`h4`,className:`md:text-xl`,leading:`heading`,size:`lg`,weight:`bold`,children:t.name}),r?a.map((e,t)=>(0,Q.jsx)(`span`,{className:L(`absolute left-0 translate-y-px text-grey-700 opacity-0`,{"opacity-100":t===i&&s||!s&&t===0}),children:e.category},e.category)):(0,Q.jsx)(`span`,{className:`text-grey-700`,children:t.category})]})]},t.name)})}),(0,Q.jsxs)(`div`,{className:`mx-[-8vmin] mt-[8vmin] mb-[-8vmin] bg-black px-[8vmin] py-16 text-center text-lg text-white`,style:{background:`#15171a url(${Mo}) 100% 100% / 35vw no-repeat`},children:[`Find and buy third-party, premium themes from independent developers in the `,(0,Q.jsx)(`a`,{className:`inline-block font-semibold text-lime`,href:`https://ghost.org/themes/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Marketplace →`})]})]})},Lo=H.create(({title:e,installedTheme:t,validationDetailsDefaultOpen:n,onActivate:r})=>{let{mutateAsync:i}=Ln(),{refreshActiveThemeData:a}=wo(),o=h(),{data:s}=ar(),{data:c}=Br(),l=n??s?.config?.environment===`development`,u=mo(t),d=c?.site?wi(c.site):void 0,f=`Activate theme`;t.active&&(f=`OK`);let p=t.active?(0,Q.jsx)(`span`,{className:`text-green`,children:`It's live!`}):e,m=t.active?(0,Q.jsxs)(Q.Fragment,{children:[`Your theme `,(0,Q.jsx)(`strong`,{children:t.name}),` was saved successfully and is now visible to your readers.`,d?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(`a`,{className:`font-semibold text-black hover:underline dark:text-white`,href:d,rel:`noreferrer`,target:`_blank`,children:`Take a look →`})]}):null]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:t.name}),` has been uploaded. Activate it to make it live.`]});return(0,Q.jsx)(Ve,{cancelLabel:`Close`,okLabel:f,okRunningLabel:`Activating...`,okVariant:`default`,prompt:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[t.active?(0,Q.jsx)(`div`,{className:`space-y-2 text-sm text-foreground`,children:(0,Q.jsx)(`p`,{children:m})}):(0,Q.jsx)(So,{title:`Uploaded successfully`,variant:`success`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:(0,Q.jsx)(`p`,{children:m})})}),(0,Q.jsx)(bo,{defaultOpen:l,problems:u})]})}),stickyFooter:!0,title:p,onOk:async e=>{if(!t.active)try{let e=(await i(t.name)).themes[0];a(),b.success(`Theme activated`,{description:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme.`]})})}catch(e){o(e)}r?.(),e?.remove()}})}),Ro=({current:e,label:t,onBack:n,className:r})=>(0,Q.jsxs)(Ct,{className:r,gap:`sm`,children:[(0,Q.jsx)(cr,{"aria-label":`Back`,size:`icon`,type:`button`,variant:`ghost`,onClick:n,children:(0,Q.jsx)(Un,{})}),(0,Q.jsx)($t,{className:`max-md:hidden`,children:(0,Q.jsxs)(Yt,{className:`whitespace-nowrap`,children:[(0,Q.jsx)(Xt,{children:(0,Q.jsx)(Qt,{asChild:!0,children:(0,Q.jsx)(`button`,{className:`cursor-pointer rounded-sm focus-visible:ring-1 focus-visible:ring-focus-ring focus-visible:outline-hidden`,type:`button`,onClick:n,children:t})})}),(0,Q.jsx)(Zt,{}),(0,Q.jsx)(Xt,{children:(0,Q.jsx)(Jt,{children:e})})]})})]}),zo=e=>e.variants&&e.variants.length>0,Bo=e=>{let t=[{image:e.image,category:e.category,previewUrl:e.previewUrl}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},Vo=e=>e.category.toLowerCase(),Ho=({selectedTheme:e,isInstalling:t,installedTheme:n,onBack:r,onInstall:i})=>{let[a,o]=(0,Z.useState)(`desktop`),[s,c]=(0,Z.useState)(void 0);if(!e)return null;let l=e.previewUrl,u=Bo(e).map(e=>({label:e.category,value:Vo(e)}));zo(e)&&(s===void 0&&c(u[0].value),l=Bo(e).find(e=>Vo(e)===s)?.previewUrl||l);let d=`Install ${e.name}`;t?d=`Installing...`:Or(e)&&!n?.active?d=`Activate ${e.name}`:n&&(d=`Update ${e.name}`);let f=()=>{i?.()},p=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Ro,{current:e.name,label:`Change theme`,onBack:r}),zo(e)?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`hidden md:!visible md:!block`,children:`–`}),(0,Q.jsxs)(J,{className:`w-auto`,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Theme variant`}),(0,Q.jsxs)(qt,{value:s,onValueChange:c,children:[(0,Q.jsx)(Wt,{"aria-label":`Theme variant`,className:`w-auto border-0 bg-transparent shadow-none`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{className:`min-w-max`,children:u.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]})]}):null]}),m=(0,Q.jsxs)(`div`,{className:`flex justify-end gap-8`,children:[(0,Q.jsxs)(Ct,{gap:`sm`,children:[(0,Q.jsx)(cr,{"aria-label":`Desktop preview`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>o(`desktop`),children:(0,Q.jsx)(Hr,{className:a===`desktop`?`text-foreground`:`text-muted-foreground`})}),(0,Q.jsx)(cr,{"aria-label":`Mobile preview`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>o(`mobile`),children:(0,Q.jsx)(ri,{className:a===`mobile`?`text-foreground`:`text-muted-foreground`})})]}),(0,Q.jsx)(cr,{disabled:t,type:`button`,onClick:f,children:t?`Installing...`:d})]});return(0,Q.jsxs)(`div`,{className:`absolute inset-0 z-[100]`,children:[(0,Q.jsxs)(ki,{blurredBackground:!1,className:`z-[100] h-22 min-h-[92px] bg-background p-8`,sticky:!1,children:[(0,Q.jsx)(ki.Left,{className:`flex-auto`,children:p}),(0,Q.jsx)(ki.Actions,{className:`flex-auto justify-end`,children:m})]}),(0,Q.jsx)(`div`,{className:`flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-background`,children:a===`desktop`?(0,Q.jsx)(zi,{device:`desktop`,children:(0,Q.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})}):(0,Q.jsx)(zi,{device:`mobile`,children:(0,Q.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})})})]})},Uo=({onUpload:e})=>{let t=Oe();return(0,Q.jsx)(`div`,{className:`-mb-6`,children:(0,Q.jsx)(Bt,{accept:{"application/zip":[`.zip`]},inputId:`theme-upload`,onDropAccepted:([n])=>{t.remove(),e(n)},children:`Click to select or drag & drop zip file`})})},Wo=({currentTab:e,setCurrentTab:t,themes:n})=>{let r=Oe(),{updateRoute:i}=V(),{mutateAsync:a}=ti(),{checkThemeLimitError:o,isThemeLimited:s}=gt(),c=h(),[l,d]=(0,Z.useState)(),[f,p]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{(async()=>{if(s){let e=await o(`.`);d({enabled:!1,error:e||`Your current plan doesn't support uploading custom themes.`})}else d({enabled:!0})})()},[o,s]);let m=()=>{r.remove(),i(`/`)},g=async e=>{let r=e?.name.replace(/\.zip$/,``),i=n.map(e=>e.name);Or({name:r})?H.show(We,{title:`Upload failed`,cancelLabel:`Cancel`,okLabel:``,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{children:[`The default `,(0,Q.jsx)(`strong`,{children:r}),` theme cannot be overwritten.`]}),(0,Q.jsx)(`p`,{children:`Rename your zip file and try again.`})]}),onOk:async e=>{e?.remove()}}):i.includes(r)?H.show(We,{title:`Overwrite theme`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`The theme `,(0,Q.jsx)(`strong`,{children:r}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,cancelLabel:`Cancel`,okRunningLabel:`Overwriting...`,okVariant:`destructive`,onOk:async a=>{p(!0);let o=i.indexOf(r);n.splice(o,1),await _({file:e,onActivate:m}),p(!1),t(`installed`),a?.remove()}}):(t(`installed`),_({file:e,onActivate:m}))},_=async({file:e,onActivate:t})=>{let n,i=null;try{p(!0),n=await a({file:e}),p(!1)}catch(e){p(!1),e instanceof u&&e.response?.status===422&&e.data?.errors?i=e.data.errors:c(e)}if(i&&!n){let e=(0,Q.jsx)(Q.Fragment,{children:`This theme couldn't be uploaded because Ghost found a blocking validation error. Fix the issue below and upload the theme again.`});H.show(Co,{title:`Theme not uploaded`,prompt:e,fatalErrors:i,onRetry:async()=>{r?.remove(),y()}})}if(!n)return;let o=n.themes[0],s=`Upload successful`,l=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:o.name}),` uploaded`]});o.active||(l=(0,Q.jsxs)(Q.Fragment,{children:[l,` `,`Do you want to activate it now?`]})),(o?.errors?.length||o.warnings?.length)&&(s=`Upload successful`,l=(0,Q.jsxs)(Q.Fragment,{children:[`The theme `,(0,Q.jsxs)(`strong`,{children:[`"`,o.name,`"`]}),` was installed successfully.`]}),o.active||(l=(0,Q.jsxs)(Q.Fragment,{children:[l,`You can activate it when you're ready.`]}))),H.show(Lo,{title:s,prompt:l,installedTheme:o,onActivate:t})},v=(0,Q.jsx)(`div`,{className:`hidden md:!visible md:!block`,children:(0,Q.jsx)(Lt,{value:e,variant:`button-sm`,onValueChange:t,children:(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`official`,children:`Official themes`}),(0,Q.jsx)(Pt,{value:`installed`,children:`Installed`})]})})}),y=()=>{l&&(l.enabled?H.show(We,{title:`Upload theme`,prompt:(0,Q.jsx)(Uo,{onUpload:g}),okLabel:``,formSheet:!1}):H.show(ke,{title:`Upgrade to enable custom themes`,prompt:l.error||(0,Q.jsxs)(Q.Fragment,{children:[`Your current plan only supports official themes. You can install them from the `,(0,Q.jsx)(`a`,{href:`https://ghost.org/marketplace/`,children:`Ghost theme marketplace`}),`.`]}),onOk:()=>i({route:`/pro`,isExternal:!0})}))},b=(0,Q.jsx)(`div`,{className:`flex items-center gap-14`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(cr,{className:`font-semibold`,type:`button`,variant:`ghost`,onClick:()=>{r.remove(),m()},children:`Close`}),(0,Q.jsxs)(cr,{disabled:f,type:`button`,onClick:y,children:[f&&(0,Q.jsx)(Kr,{size:`sm`}),`Upload theme`]})]})});return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(ki,{blurredBackground:!1,className:`sticky -top-px z-50 h-22 min-h-[92px] bg-background p-8`,sticky:!1,children:[(0,Q.jsx)(ki.Left,{className:`flex-auto`,children:v}),(0,Q.jsx)(ki.Actions,{className:`flex-auto justify-end`,children:b})]}),(0,Q.jsx)(`div`,{className:`px-[8vmin] md:hidden`,children:(0,Q.jsx)(Lt,{value:e,variant:`button-sm`,onValueChange:t,children:(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`official`,children:`Official themes`}),(0,Q.jsx)(Pt,{value:`installed`,children:`Installed`})]})})})]})},Go=({currentTab:e,onSelectTheme:t,themes:n})=>{switch(e){case`official`:return(0,Q.jsx)(Io,{onSelectTheme:t});case`installed`:return(0,Q.jsx)(jo,{themes:n})}return null},Ko=({source:e,themeRef:t})=>{let[n,r]=(0,Z.useState)(`official`),[i,a]=(0,Z.useState)(null),[o,s]=(0,Z.useState)(`desktop`),[c,l]=(0,Z.useState)(!1),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),{updateRoute:m}=V(),g=Oe(),{data:{themes:_}={}}=pi(),{mutateAsync:v}=di(),{mutateAsync:y}=Ln(),{checkThemeLimitError:x}=gt(),S=h(),C=e=>{a(e)};if((0,Z.useEffect)(()=>{p(!0)},[]),(0,Z.useEffect)(()=>{(async()=>{if(e&&t&&!u&&f){let e=t.split(`/`)[1];if(await x(e)){g.remove();return}let n=_?.map(e=>e.name)||[],r=n.includes(e.toLowerCase()),i=n.indexOf(e.toLowerCase()),a=_?.[i],o=(0,Q.jsxs)(Q.Fragment,{children:[`By clicking below, `,(0,Q.jsx)(`strong`,{children:e}),` will automatically be activated as the theme for your site.`,r&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`br`,{}),(0,Q.jsx)(`br`,{}),`This will overwrite your existing version of `,(0,Q.jsx)(`strong`,{children:e}),a?.active?` which is your active theme`:``,`. All custom changes will be lost.`]})]});H.show(We,{title:`Install Theme`,prompt:o,okLabel:`Install`,cancelLabel:`Cancel`,okRunningLabel:`Installing...`,okVariant:`default`,onOk:async e=>{let n;d(!0);try{r&&_&&_.splice(i,1),n=await v(t),n?.themes[0]&&(await y(n.themes[0].name),b.success(`Theme activated`,{description:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`capitalize`,children:n.themes[0].name}),` is now your active theme`]})})),e?.remove(),m(``)}catch(e){S(e)}}})}})()},[t,e,v,S,y,m,_,u,x,g,f]),!_)return;let w,T;if(i){w=_.find(e=>e.name.toLowerCase()===i.name.toLowerCase()),T=async()=>{let t=await x(i.name);if(t){H.show(ke,{prompt:t,onOk:()=>m({route:`/pro`,isExternal:!0})});return}return w&&!Or(i)?new Promise(t=>{H.show(We,{title:`Overwrite theme`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`This will overwrite your existing version of `,i.name,w?.active?`, which is your active theme`:``,`. All custom changes will be lost.`]}),okLabel:`Overwrite`,okRunningLabel:`Installing...`,cancelLabel:`Cancel`,okVariant:`destructive`,onOk:async n=>{n?.remove(),await e(),t()}})}):e()};let e=async()=>{let e=`Success`,t=(0,Q.jsx)(Q.Fragment,{});if(Or(i))e=`Activate theme`,t=(0,Q.jsxs)(Q.Fragment,{children:[`By clicking below, `,(0,Q.jsx)(`strong`,{children:i.name}),` will automatically be activated as the theme for your site.`]});else{l(!0);let n;try{n=await v(i.ref)}catch(e){S(e)}finally{l(!1)}if(!n)return;let r=n.themes[0];e=`Success`,t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:r.name}),` has been successfully installed.`]}),r.active||(t=(0,Q.jsxs)(Q.Fragment,{children:[t,` `,`Do you want to activate it now?`]})),(r.errors?.length||r.warnings?.length)&&(e=`Installed successfully`,t=(0,Q.jsxs)(Q.Fragment,{children:[`The theme `,(0,Q.jsxs)(`strong`,{children:[`"`,r.name,`"`]}),` was installed successfully.`]}),r.active||(t=(0,Q.jsxs)(Q.Fragment,{children:[t,`You can activate it when you're ready.`]}))),w=r}H.show(Lo,{title:e,prompt:t,installedTheme:w,onActivate:()=>{g.remove(),m(``)}})}}return(0,Q.jsx)(Ie,{afterClose:()=>{m(``)},animate:!1,cancelLabel:``,footer:!1,padding:!1,size:`full`,testId:`theme-modal`,title:``,scrolling:!0,onCancel:()=>{g.remove(),m(``)},children:(0,Q.jsx)(`div`,{className:`flex h-full justify-between`,children:(0,Q.jsxs)(`div`,{className:`grow`,children:[i&&(0,Q.jsx)(Ho,{installedTheme:w,isInstalling:c,selectedTheme:i,onBack:()=>{a(null)},onClose:()=>{m(``)},onInstall:T}),(0,Q.jsx)(Wo,{currentTab:n,modal:g,previewMode:o,selectedTheme:i,setCurrentTab:r,setPreviewMode:s,setSelectedTheme:a,themes:_}),!i&&(0,Q.jsx)(Go,{currentTab:n,themes:_,onSelectTheme:C})]})})})},qo=t(i(),1),Jo=({children:e,to:t,classNames:n})=>{let r=t||document.body;return r?(0,qo.createPortal)((0,Q.jsx)(`div`,{className:n,onMouseDown:e=>{e.stopPropagation()},children:(0,Q.jsx)(`div`,{children:e})}),r):(0,Q.jsx)(Q.Fragment,{children:e})},Yo=class{columnCount;columns=[];columnHeights;constructor(e=3){this.columnCount=e,this.columns=[[]],this.columnHeights=null}reset(){let e=[],t=[];for(let n=0;n<this.columnCount;n+=1)e[n]=[],t[n]=0;this.columns=e,this.columnHeights=t}addColumns(){for(let e=0;e<this.columnCount;e++)this.columns.push([]),this.columnHeights.push(0)}addPhotoToColumns(e){this.columns||this.reset();let t=Math.min(...this.columnHeights),n=this.columnHeights.indexOf(t);this.columnHeights[n]+=300*e.ratio,this.columns[n].push(e)}getColumns(){return this.columns}changeColumnCount(e){e!==this.columnCount&&(this.columnCount=e,this.reset())}},Xo={heart:e=>(0,Q.jsx)(`svg`,{viewBox:`0 0 32 32`,...e,children:(0,Q.jsx)(`path`,{d:`M17.4 29c-.8.8-2 .8-2.8 0L2.3 16.2C-.8 13.1-.8 8 2.3 4.8c3.1-3.1 8.2-3.1 11.3 0L16 7.6l2.3-2.8c3.1-3.1 8.2-3.1 11.3 0 3.1 3.1 3.1 8.2 0 11.4L17.4 29z`})}),download:e=>(0,Q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,Q.jsx)(`path`,{d:`M20 5.5l-8 8-8-8m-3.5 13h23`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:10,fill:`none`})})},Zo=({icon:e,label:t,...n})=>{let r=null;return e&&(r=Xo[e]),(0,Q.jsxs)(`a`,{className:`text-grey-700 flex h-8 shrink-0 cursor-pointer items-center rounded-md bg-white px-3 py-2 font-sans text-sm font-medium leading-6 opacity-90 transition-all ease-in-out hover:opacity-100`,onClick:e=>e.stopPropagation(),...n,children:[e&&r&&(0,Q.jsx)(r,{className:`size-4 ${e===`heart`?`fill-red`:``} stroke-[3px] ${t&&`mr-1`}`}),t&&(0,Q.jsx)(`span`,{children:t})]})},Qo=({payload:e,srcUrl:t,links:n,likes:r,user:i,alt:a,urls:o,height:s,width:c,zoomed:l,insertImage:u,selectImg:d})=>(0,Q.jsxs)(`div`,{className:`relative mb-6 block ${l?`h-full w-[max-content] cursor-zoom-out`:`w-full cursor-zoom-in`}`,style:{backgroundColor:e.color||`transparent`},"data-kg-unsplash-gallery-item":!0,onClick:t=>{t.stopPropagation(),d(l?null:e)},children:[(0,Q.jsx)(`img`,{alt:a,className:`${l?`h-full w-auto object-contain`:`block h-auto`}`,height:s,loading:`lazy`,src:t,width:c,"data-kg-unsplash-gallery-img":!0}),(0,Q.jsxs)(`div`,{className:`absolute inset-0 flex flex-col justify-between bg-gradient-to-b from-black/5 via-black/5 to-black/30 p-5 opacity-0 transition-all ease-in-out hover:opacity-100`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,Q.jsx)(Zo,{"data-kg-button":`unsplash-like`,href:`${n.html}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit`,icon:`heart`,label:r.toString(),rel:`noopener noreferrer`,target:`_blank`}),(0,Q.jsx)(Zo,{"data-kg-button":`unsplash-download`,href:`${n.download}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit&force=true`,icon:`download`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center`,children:[(0,Q.jsx)(`img`,{alt:`author`,className:`mr-2 size-8 rounded-full`,src:i.profile_image.medium}),(0,Q.jsx)(`div`,{className:`mr-2 truncate font-sans text-sm font-medium text-white`,children:i.name})]}),(0,Q.jsx)(Zo,{label:`Insert image`,"data-kg-unsplash-insert-button":!0,onClick:e=>{e.stopPropagation(),u({src:o.regular.replace(/&w=1080/,`&w=2000`),caption:`<span>Photo by <a href="${i.links.html}">${i.name}</a> / <a href="https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit">Unsplash</a></span>`,height:s,width:c,alt:a,links:n})}})]})]})]}),$o=({payload:e,insertImage:t,selectImg:n,zoomed:r})=>(0,Q.jsx)(`div`,{className:`flex h-full grow basis-0 justify-center`,"data-kg-unsplash-zoomed":!0,onClick:()=>n(null),children:(0,Q.jsx)(Qo,{alt:e.alt_description,height:e.height,insertImage:t,likes:e.likes,links:e.links,payload:e,selectImg:n,srcUrl:e.urls.regular,urls:e.urls,user:e.user,width:e.width,zoomed:r})}),es=()=>(0,Q.jsx)(`div`,{className:`absolute inset-y-0 left-0 flex w-full items-center justify-center overflow-hidden pb-[8vh]`,"data-kg-loader":!0,children:(0,Q.jsx)(`div`,{className:`animate-spin before:bg-grey-800 relative inline-block size-[50px] rounded-full border border-black/10 before:z-10 before:mt-[7px] before:block before:size-[7px] before:rounded-full`})}),ts=e=>(0,Q.jsx)(`div`,{className:`mr-6 flex grow basis-0 flex-col justify-start last-of-type:mr-0`,children:e.children}),ns=e=>e?.columns?e?.columns.map((t,n)=>(0,Q.jsx)(ts,{children:t.map(t=>(0,Q.jsx)(Qo,{alt:t.alt_description,height:t.height,insertImage:e?.insertImage,likes:t.likes,links:t.links,payload:t,selectImg:e?.selectImg,srcUrl:t.urls.regular,urls:t.urls,user:t.user,width:t.width,zoomed:e?.zoomed||null},t.id))},t[0]?.id??`empty-${n}`)):null,rs=e=>(0,Q.jsx)(`div`,{className:`relative h-full overflow-hidden`,"data-kg-unsplash-gallery":!0,children:(0,Q.jsxs)(`div`,{ref:e.galleryRef,className:`flex size-full justify-center overflow-auto px-20 ${e?.zoomed?`pb-10`:``}`,"data-kg-unsplash-gallery-scrollref":!0,children:[e.children,e?.isLoading&&(0,Q.jsx)(es,{})]})}),is=({zoomed:e,error:t,galleryRef:n,isLoading:r,dataset:i,selectImg:a,insertImage:o})=>e?(0,Q.jsx)(rs,{galleryRef:n,zoomed:e,children:(0,Q.jsx)($o,{alt:e.alt_description,height:e.height,insertImage:o,likes:e.likes,links:e.links,payload:e,selectImg:a,srcUrl:e.urls.regular,urls:e.urls,user:e.user,width:e.width,zoomed:e})}):t?(0,Q.jsx)(rs,{galleryRef:n,zoomed:e,children:(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center`,children:[(0,Q.jsx)(`h1`,{className:`mb-4 text-2xl font-bold`,children:`Error`}),(0,Q.jsx)(`p`,{className:`text-lg font-medium`,children:t})]})}):(0,Q.jsx)(rs,{galleryRef:n,isLoading:r,zoomed:e,children:(0,Q.jsx)(ns,{columns:i,insertImage:o,selectImg:a,zoomed:e})}),as=e=>(0,Q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Q.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M.75 23.249l22.5-22.5M23.25 23.249L.75.749`})}),os=e=>(0,Q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Q.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M1.472 13.357a9.063 9.063 0 1 0 16.682-7.09 9.063 9.063 0 1 0-16.682 7.09Zm14.749 2.863 7.029 7.03`})}),ss=e=>(0,Q.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 122.43 122.41`,...e,children:(0,Q.jsx)(`path`,{d:`M83.86 54.15v34.13H38.57V54.15H0v68.26h122.43V54.15H83.86zM38.57 0h45.3v34.13h-45.3z`})}),cs=({closeModal:e,handleSearch:t,children:n})=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`fixed inset-0 z-40 h-[100vh] bg-black opacity-60`}),(0,Q.jsxs)(`div`,{className:`not-kg-prose fixed inset-8 z-50 overflow-hidden rounded bg-white shadow-xl`,"data-kg-modal":`unsplash`,children:[(0,Q.jsx)(`button`,{className:`absolute right-6 top-6 cursor-pointer`,type:`button`,children:(0,Q.jsx)(as,{className:`text-grey-400 size-4 stroke-2`,"data-kg-modal-close-button":!0,onClick:()=>e()})}),(0,Q.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-20 py-10`,children:[(0,Q.jsxs)(`h1`,{className:`flex items-center gap-2 font-sans text-3xl font-bold text-black`,children:[(0,Q.jsx)(ss,{className:`mb-1`}),`Unsplash`]}),(0,Q.jsxs)(`div`,{className:`relative w-full max-w-sm`,children:[(0,Q.jsx)(os,{className:`text-grey-700 absolute left-4 top-1/2 size-4 -translate-y-2`}),(0,Q.jsx)(`input`,{className:`border-grey-300 focus:border-grey-400 h-10 w-full rounded-full border border-solid pl-10 pr-8 font-sans text-md font-normal text-black focus-visible:outline-none`,placeholder:`Search free high-resolution photos`,autoFocus:!0,"data-kg-unsplash-search":!0,onChange:t})]})]}),n]})]})]}),ls=JSON.parse(`[{"id":"TA5hw14Coh4","slug":"a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4","alternative_slugs":{"en":"a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4"},"created_at":"2024-02-07T22:39:36Z","updated_at":"2024-03-07T23:46:14Z","promoted_at":null,"width":8640,"height":5760,"color":"#8c5940","blur_hash":"LKD]brE2IUr?Lgwci_NaDjR*ofoe","description":"NEOM will be home to one of the world’s largest nature reserves: a 25,000 sq km stretch of wilderness, encompassing two deserts divided by a mountain range. | NEOM, Saudi Arabia","alt_description":"a person standing on a sand dune in the desert","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1707345512638-997d31a10eaa?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707345512638-997d31a10eaa"},"links":{"self":"https://api.unsplash.com/photos/a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4","html":"https://unsplash.com/photos/a-person-standing-on-a-sand-dune-in-the-desert-TA5hw14Coh4","download":"https://unsplash.com/photos/TA5hw14Coh4/download?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/TA5hw14Coh4/download?ixid=M3wxMTc3M3wxfDF8YWxsfDF8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":226,"liked_by_user":false,"current_user_collections":[],"sponsorship":{"impression_urls":[],"tagline":"Made to Change","tagline_url":"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral","sponsor":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},"topic_submissions":{},"user":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},{"id":"UArA9A02Kvk","slug":"a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk","alternative_slugs":{"en":"a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk"},"created_at":"2024-03-05T15:48:31Z","updated_at":"2024-03-11T06:59:25Z","promoted_at":"2024-03-11T06:59:25Z","width":2160,"height":2700,"color":"#262626","blur_hash":"L78;S$~p00oLD%D%IVay9F9ZIUay","description":null,"alt_description":"a black and white photo of a man with his head in his hands","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709653688483-fc2b356c1f36?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709653688483-fc2b356c1f36"},"links":{"self":"https://api.unsplash.com/photos/a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk","html":"https://unsplash.com/photos/a-black-and-white-photo-of-a-man-with-his-head-in-his-hands-UArA9A02Kvk","download":"https://unsplash.com/photos/UArA9A02Kvk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/UArA9A02Kvk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDJ8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":20,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"gwWL9kMcm2g","updated_at":"2024-03-11T10:14:07Z","username":"nickandreka","name":"Nick Andréka","first_name":"Nick","last_name":"Andréka","twitter_username":null,"portfolio_url":null,"bio":null,"location":null,"links":{"self":"https://api.unsplash.com/users/nickandreka","html":"https://unsplash.com/@nickandreka","photos":"https://api.unsplash.com/users/nickandreka/photos","likes":"https://api.unsplash.com/users/nickandreka/likes","portfolio":"https://api.unsplash.com/users/nickandreka/portfolio","following":"https://api.unsplash.com/users/nickandreka/following","followers":"https://api.unsplash.com/users/nickandreka/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1698854198608-989031a5ccdeimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"andreka.art","total_collections":0,"total_likes":8,"total_photos":35,"total_promoted_photos":19,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"andreka.art","portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"QX_7m4Lh2qg","slug":"a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg","alternative_slugs":{"en":"a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg"},"created_at":"2024-03-10T16:46:33Z","updated_at":"2024-03-11T06:59:11Z","promoted_at":"2024-03-11T06:59:11Z","width":4000,"height":5751,"color":"#f3f3f3","blur_hash":"LAQJiu~X-;9G-:?cIURj~qD%00xt","description":null,"alt_description":"a black and white photo of a lighthouse","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710088912041-34d1767d376a?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710088912041-34d1767d376a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710088912041-34d1767d376a"},"links":{"self":"https://api.unsplash.com/photos/a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg","html":"https://unsplash.com/photos/a-black-and-white-photo-of-a-lighthouse-QX_7m4Lh2qg","download":"https://unsplash.com/photos/QX_7m4Lh2qg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/QX_7m4Lh2qg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDN8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":21,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"ue6QWAAHoIQ","updated_at":"2024-03-11T08:53:54Z","username":"huzhewseh","name":"Volodymyr M","first_name":"Volodymyr","last_name":"M","twitter_username":"huzhewseh","portfolio_url":null,"bio":null,"location":null,"links":{"self":"https://api.unsplash.com/users/huzhewseh","html":"https://unsplash.com/@huzhewseh","photos":"https://api.unsplash.com/users/huzhewseh/photos","likes":"https://api.unsplash.com/users/huzhewseh/likes","portfolio":"https://api.unsplash.com/users/huzhewseh/portfolio","following":"https://api.unsplash.com/users/huzhewseh/following","followers":"https://api.unsplash.com/users/huzhewseh/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1663221970918-58b1620c49c9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"huzhewseh","total_collections":0,"total_likes":0,"total_photos":18,"total_promoted_photos":3,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"huzhewseh","portfolio_url":null,"twitter_username":"huzhewseh","paypal_email":null}}},{"id":"fMNP7XVcct0","slug":"a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0","alternative_slugs":{"en":"a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0"},"created_at":"2024-03-09T08:40:07Z","updated_at":"2024-03-11T06:58:58Z","promoted_at":"2024-03-11T06:58:58Z","width":3264,"height":4928,"color":"#262626","blur_hash":"L35hY|xu00D%-;xuIUD%00j[?bWB","description":null,"alt_description":"a woman standing in a dark room with her eyes closed","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709973540503-77d699279634?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709973540503-77d699279634?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709973540503-77d699279634"},"links":{"self":"https://api.unsplash.com/photos/a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0","html":"https://unsplash.com/photos/a-woman-standing-in-a-dark-room-with-her-eyes-closed-fMNP7XVcct0","download":"https://unsplash.com/photos/fMNP7XVcct0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/fMNP7XVcct0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDR8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":7,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"lSlibqdw_c8","updated_at":"2024-03-11T08:54:13Z","username":"vitaliyshev89","name":"Vitaliy Shevchenko","first_name":"Vitaliy","last_name":"Shevchenko","twitter_username":null,"portfolio_url":null,"bio":null,"location":"Kharkiv, Ukraine","links":{"self":"https://api.unsplash.com/users/vitaliyshev89","html":"https://unsplash.com/@vitaliyshev89","photos":"https://api.unsplash.com/users/vitaliyshev89/photos","likes":"https://api.unsplash.com/users/vitaliyshev89/likes","portfolio":"https://api.unsplash.com/users/vitaliyshev89/portfolio","following":"https://api.unsplash.com/users/vitaliyshev89/following","followers":"https://api.unsplash.com/users/vitaliyshev89/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1652271342920-31eebbc2c3d0image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":null,"total_collections":0,"total_likes":1,"total_photos":205,"total_promoted_photos":29,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":null,"portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"b4kKyX0BQvc","slug":"a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc","alternative_slugs":{"en":"a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc"},"created_at":"2024-03-08T21:58:28Z","updated_at":"2024-03-11T06:57:35Z","promoted_at":"2024-03-11T06:57:27Z","width":6000,"height":4000,"color":"#0c2626","blur_hash":"LSDJS6kD9Zxu~qkDM|xaS%j]xaV@","description":"Stunning metro train station \\"Elbbrücken\\" in Hamburg, Germany during sunset","alt_description":"a train station with a train on the tracks","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709934645859-f1ed8d3a4954?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709934645859-f1ed8d3a4954"},"links":{"self":"https://api.unsplash.com/photos/a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc","html":"https://unsplash.com/photos/a-train-station-with-a-train-on-the-tracks-b4kKyX0BQvc","download":"https://unsplash.com/photos/b4kKyX0BQvc/download?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/b4kKyX0BQvc/download?ixid=M3wxMTc3M3wwfDF8YWxsfDV8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":8,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"street-photography":{"status":"approved","approved_on":"2024-03-11T06:57:35Z"}},"user":{"id":"TffftDPlBPk","updated_at":"2024-03-11T06:59:04Z","username":"christianlue","name":"Christian Lue","first_name":"Christian","last_name":"Lue","twitter_username":"chrrischii","portfolio_url":null,"bio":null,"location":"Frankfurt / Berlin","links":{"self":"https://api.unsplash.com/users/christianlue","html":"https://unsplash.com/@christianlue","photos":"https://api.unsplash.com/users/christianlue/photos","likes":"https://api.unsplash.com/users/christianlue/likes","portfolio":"https://api.unsplash.com/users/christianlue/portfolio","following":"https://api.unsplash.com/users/christianlue/following","followers":"https://api.unsplash.com/users/christianlue/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1581889127238-ea4aa40e8cb4image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":null,"total_collections":7,"total_likes":15,"total_photos":571,"total_promoted_photos":103,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":null,"portfolio_url":null,"twitter_username":"chrrischii","paypal_email":null}}},{"id":"9633dHhioC8","slug":"a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8","alternative_slugs":{"en":"a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8"},"created_at":"2023-04-28T15:30:26Z","updated_at":"2024-03-10T10:46:58Z","promoted_at":"2023-05-13T12:02:35Z","width":8316,"height":5544,"color":"#734026","blur_hash":"LVHdd89G57-o.9IBsSR-~pD*M{xt","description":"Amongst expansive red sands and spectacular sandstone rock formations, Hisma Desert – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.","alt_description":"a person walking through a canyon in the desert","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1682695795255-b236b1f1267d?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682695795255-b236b1f1267d"},"links":{"self":"https://api.unsplash.com/photos/a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8","html":"https://unsplash.com/photos/a-person-walking-through-a-canyon-in-the-desert-9633dHhioC8","download":"https://unsplash.com/photos/9633dHhioC8/download?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/9633dHhioC8/download?ixid=M3wxMTc3M3wxfDF8YWxsfDZ8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":631,"liked_by_user":false,"current_user_collections":[],"sponsorship":{"impression_urls":["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515595&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515798&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],"tagline":"Made to Change","tagline_url":"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral","sponsor":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},"topic_submissions":{},"user":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},{"id":"4PmYYBFhwFM","slug":"a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM","alternative_slugs":{"en":"a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM"},"created_at":"2024-03-09T18:40:37Z","updated_at":"2024-03-11T06:57:23Z","promoted_at":"2024-03-11T06:57:23Z","width":5248,"height":7872,"color":"#a6a6a6","blur_hash":"LHDA40%MbGxu%L?bt7of_N%gIBRj","description":null,"alt_description":"a close up of a car door with the word budder on it","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710009439657-c0dfdc051a28?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710009439657-c0dfdc051a28"},"links":{"self":"https://api.unsplash.com/photos/a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM","html":"https://unsplash.com/photos/a-close-up-of-a-car-door-with-the-word-budder-on-it-4PmYYBFhwFM","download":"https://unsplash.com/photos/4PmYYBFhwFM/download?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/4PmYYBFhwFM/download?ixid=M3wxMTc3M3wwfDF8YWxsfDd8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":5,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"Xz7_QPPM2So","updated_at":"2024-03-11T08:27:09Z","username":"tiago_f_ferreira","name":"Tiago Ferreira","first_name":"Tiago","last_name":"Ferreira","twitter_username":null,"portfolio_url":"https://tiagoferreira765.wixsite.com/photographyandmusic","bio":"Photography - a hobby, a passion.\\r\\nPlanet earth 🌎, a creative space to enjoy.","location":"Lisboa, Portugal","links":{"self":"https://api.unsplash.com/users/tiago_f_ferreira","html":"https://unsplash.com/@tiago_f_ferreira","photos":"https://api.unsplash.com/users/tiago_f_ferreira/photos","likes":"https://api.unsplash.com/users/tiago_f_ferreira/likes","portfolio":"https://api.unsplash.com/users/tiago_f_ferreira/portfolio","following":"https://api.unsplash.com/users/tiago_f_ferreira/following","followers":"https://api.unsplash.com/users/tiago_f_ferreira/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1595844391672-cdf854039843image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"tiago_f_ferreira","total_collections":1,"total_likes":144,"total_photos":205,"total_promoted_photos":8,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"tiago_f_ferreira","portfolio_url":"https://tiagoferreira765.wixsite.com/photographyandmusic","twitter_username":null,"paypal_email":null}}},{"id":"BUhVFtY-890","slug":"a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890","alternative_slugs":{"en":"a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890"},"created_at":"2024-03-09T10:03:28Z","updated_at":"2024-03-11T06:57:20Z","promoted_at":"2024-03-11T06:57:20Z","width":3511,"height":2231,"color":"#262626","blur_hash":"L24epEWB0eMx$*t8OEV@RPj]baay","description":null,"alt_description":"a close up of a bird with a red head","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709978601970-036e92662b46?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709978601970-036e92662b46?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709978601970-036e92662b46"},"links":{"self":"https://api.unsplash.com/photos/a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890","html":"https://unsplash.com/photos/a-close-up-of-a-bird-with-a-red-head-BUhVFtY-890","download":"https://unsplash.com/photos/BUhVFtY-890/download?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/BUhVFtY-890/download?ixid=M3wxMTc3M3wwfDF8YWxsfDh8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":8,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"textures-patterns":{"status":"rejected"},"spring":{"status":"rejected"},"earth-hour":{"status":"approved","approved_on":"2024-03-10T12:31:10Z"},"health":{"status":"unevaluated"},"animals":{"status":"unevaluated"},"film":{"status":"unevaluated"},"travel":{"status":"unevaluated"},"nature":{"status":"unevaluated"},"wallpapers":{"status":"unevaluated"}},"user":{"id":"3SCC0WcF-wA","updated_at":"2024-03-11T09:44:02Z","username":"refargotohp","name":"refargotohp","first_name":"refargotohp","last_name":null,"twitter_username":null,"portfolio_url":null,"bio":"Hello 👋🏼 My name is Pavel, and I am a photographer. I enjoy the photo in any of its manifestations. Sequential shooting, street, studio, portraiture - it's all me. Waiting for you on my social networks - @refargotohp","location":null,"links":{"self":"https://api.unsplash.com/users/refargotohp","html":"https://unsplash.com/@refargotohp","photos":"https://api.unsplash.com/users/refargotohp/photos","likes":"https://api.unsplash.com/users/refargotohp/likes","portfolio":"https://api.unsplash.com/users/refargotohp/portfolio","following":"https://api.unsplash.com/users/refargotohp/following","followers":"https://api.unsplash.com/users/refargotohp/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1653036388874-dab6bdb375bcimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"refargotohp","total_collections":1,"total_likes":86,"total_photos":132,"total_promoted_photos":61,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"refargotohp","portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"99clkpyauJI","slug":"there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI","alternative_slugs":{"en":"there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI"},"created_at":"2024-03-10T00:15:28Z","updated_at":"2024-03-11T06:56:32Z","promoted_at":"2024-03-11T06:56:32Z","width":4299,"height":3448,"color":"#f3f3f3","blur_hash":"LjJuGn?bM{xu~qoKRPM{9FM{t6M_","description":null,"alt_description":"there are bottles of beer on a shelf in front of a window","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710029721414-9e2125e155c3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710029721414-9e2125e155c3"},"links":{"self":"https://api.unsplash.com/photos/there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI","html":"https://unsplash.com/photos/there-are-bottles-of-beer-on-a-shelf-in-front-of-a-window-99clkpyauJI","download":"https://unsplash.com/photos/99clkpyauJI/download?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA","download_location":"https://api.unsplash.com/photos/99clkpyauJI/download?ixid=M3wxMTc3M3wwfDF8YWxsfDl8fHx8fHwyfHwxNzEwMTUzMjA1fA"},"likes":2,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"film":{"status":"approved","approved_on":"2024-03-10T16:39:06Z"}},"user":{"id":"TPCcwPbQzmY","updated_at":"2024-03-11T06:59:01Z","username":"suzm4film","name":"szm 4","first_name":"szm","last_name":"4","twitter_username":null,"portfolio_url":null,"bio":null,"location":"Japan","links":{"self":"https://api.unsplash.com/users/suzm4film","html":"https://unsplash.com/@suzm4film","photos":"https://api.unsplash.com/users/suzm4film/photos","likes":"https://api.unsplash.com/users/suzm4film/likes","portfolio":"https://api.unsplash.com/users/suzm4film/portfolio","following":"https://api.unsplash.com/users/suzm4film/following","followers":"https://api.unsplash.com/users/suzm4film/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1632890829763-5c518f873dee?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":null,"total_collections":0,"total_likes":0,"total_photos":189,"total_promoted_photos":19,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":null,"portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"Lbt-cZyOUM4","slug":"an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4","alternative_slugs":{"en":"an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4"},"created_at":"2024-03-09T16:58:57Z","updated_at":"2024-03-11T06:57:06Z","promoted_at":"2024-03-11T06:55:38Z","width":5783,"height":3848,"color":"#0c2626","blur_hash":"LkG[.y01Ri-:?bM{RjofM{xuRkWB","description":null,"alt_description":"an old fashioned typewriter sitting on a table in front of a window","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710003364549-de37d4ed3413?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710003364549-de37d4ed3413"},"links":{"self":"https://api.unsplash.com/photos/an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4","html":"https://unsplash.com/photos/an-old-fashioned-typewriter-sitting-on-a-table-in-front-of-a-window-Lbt-cZyOUM4","download":"https://unsplash.com/photos/Lbt-cZyOUM4/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/Lbt-cZyOUM4/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":3,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"8D4VFtkiIuw","updated_at":"2024-03-11T07:28:57Z","username":"tama66","name":"Peter Herrmann","first_name":"Peter","last_name":"Herrmann","twitter_username":null,"portfolio_url":null,"bio":"Everything... but not boring! Instagram@Tiefstapler66","location":"Leverkusen/Germany","links":{"self":"https://api.unsplash.com/users/tama66","html":"https://unsplash.com/@tama66","photos":"https://api.unsplash.com/users/tama66/photos","likes":"https://api.unsplash.com/users/tama66/likes","portfolio":"https://api.unsplash.com/users/tama66/portfolio","following":"https://api.unsplash.com/users/tama66/following","followers":"https://api.unsplash.com/users/tama66/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1611475141936-383e23c6cc6dimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"tiefstapler66","total_collections":1,"total_likes":149,"total_photos":363,"total_promoted_photos":152,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"tiefstapler66","portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"D1jr0Mevs-c","slug":"an-aerial-view-of-a-body-of-water-D1jr0Mevs-c","alternative_slugs":{"en":"an-aerial-view-of-a-body-of-water-D1jr0Mevs-c"},"created_at":"2024-02-07T22:34:15Z","updated_at":"2024-03-10T10:54:36Z","promoted_at":null,"width":5280,"height":2970,"color":"#0c2626","blur_hash":"LH9[JL0i+HM{^}Ezw#R.b@n$nhbb","description":"The Islands of NEOM are home to kaleidoscopic-coloured coral reefs and an abundance of diverse marine life | Islands of NEOM – NEOM, Saudi Arabia","alt_description":"an aerial view of a body of water","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1707343843982-f8275f3994c5?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707343843982-f8275f3994c5"},"links":{"self":"https://api.unsplash.com/photos/an-aerial-view-of-a-body-of-water-D1jr0Mevs-c","html":"https://unsplash.com/photos/an-aerial-view-of-a-body-of-water-D1jr0Mevs-c","download":"https://unsplash.com/photos/D1jr0Mevs-c/download?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/D1jr0Mevs-c/download?ixid=M3wxMTc3M3wxfDF8YWxsfDExfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":308,"liked_by_user":false,"current_user_collections":[],"sponsorship":{"impression_urls":[],"tagline":"Made to Change","tagline_url":"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral","sponsor":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},"topic_submissions":{},"user":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},{"id":"0RBEUjWQBBA","slug":"a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA","alternative_slugs":{"en":"a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA"},"created_at":"2024-03-10T10:15:48Z","updated_at":"2024-03-11T06:55:22Z","promoted_at":"2024-03-11T06:55:22Z","width":4672,"height":7008,"color":"#262626","blur_hash":"LOG8o{t7WBWB~DofR*j@D%NGR%WB","description":null,"alt_description":"a woman standing under a cherry blossom tree","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710065574765-a685385c6d9a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710065574765-a685385c6d9a"},"links":{"self":"https://api.unsplash.com/photos/a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA","html":"https://unsplash.com/photos/a-woman-standing-under-a-cherry-blossom-tree-0RBEUjWQBBA","download":"https://unsplash.com/photos/0RBEUjWQBBA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/0RBEUjWQBBA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEyfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":11,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"ePlndXHeIiM","updated_at":"2024-03-11T09:04:03Z","username":"lwdzl","name":"Jack Dong","first_name":"Jack","last_name":"Dong","twitter_username":null,"portfolio_url":"https://www.xiaohongshu.com/user/profile/5f11b998000000000101d8d2?xhsshare=CopyLink&appuid=5f11b998000000000101d8d2&apptime=1696562673","bio":null,"location":null,"links":{"self":"https://api.unsplash.com/users/lwdzl","html":"https://unsplash.com/@lwdzl","photos":"https://api.unsplash.com/users/lwdzl/photos","likes":"https://api.unsplash.com/users/lwdzl/likes","portfolio":"https://api.unsplash.com/users/lwdzl/portfolio","following":"https://api.unsplash.com/users/lwdzl/following","followers":"https://api.unsplash.com/users/lwdzl/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1696563144074-80a8da44bcd4?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":null,"total_collections":0,"total_likes":101,"total_photos":640,"total_promoted_photos":112,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":null,"portfolio_url":"https://www.xiaohongshu.com/user/profile/5f11b998000000000101d8d2?xhsshare=CopyLink&appuid=5f11b998000000000101d8d2&apptime=1696562673","twitter_username":null,"paypal_email":null}}},{"id":"2IGDvJa2Bd0","slug":"a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0","alternative_slugs":{"en":"a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0"},"created_at":"2024-02-21T14:32:53Z","updated_at":"2024-03-11T06:54:06Z","promoted_at":"2024-03-11T06:54:06Z","width":4672,"height":5840,"color":"#f3f3f3","blur_hash":"L#Gv00ofD%ay~qoeM_ay%NafWVj[","description":null,"alt_description":"a path in the middle of a foggy forest","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1708525736169-534ee3e24e99?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708525736169-534ee3e24e99"},"links":{"self":"https://api.unsplash.com/photos/a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0","html":"https://unsplash.com/photos/a-path-in-the-middle-of-a-foggy-forest-2IGDvJa2Bd0","download":"https://unsplash.com/photos/2IGDvJa2Bd0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/2IGDvJa2Bd0/download?ixid=M3wxMTc3M3wwfDF8YWxsfDEzfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":11,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"zL5HAN1fnJw","updated_at":"2024-03-11T06:58:57Z","username":"viklukphotography","name":"Viktor Mischke","first_name":"Viktor","last_name":"Mischke","twitter_username":null,"portfolio_url":"https://www.istockphoto.com/de/portfolio/snoviktor","bio":null,"location":"Schloss Holte-Stukenbrock","links":{"self":"https://api.unsplash.com/users/viklukphotography","html":"https://unsplash.com/@viklukphotography","photos":"https://api.unsplash.com/users/viklukphotography/photos","likes":"https://api.unsplash.com/users/viklukphotography/likes","portfolio":"https://api.unsplash.com/users/viklukphotography/portfolio","following":"https://api.unsplash.com/users/viklukphotography/following","followers":"https://api.unsplash.com/users/viklukphotography/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1646051425690-ed09fae6858fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"viktormischke","total_collections":0,"total_likes":141,"total_photos":38,"total_promoted_photos":8,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"viktormischke","portfolio_url":"https://www.istockphoto.com/de/portfolio/snoviktor","twitter_username":null,"paypal_email":null}}},{"id":"PZfeP0uwBpQ","slug":"a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ","alternative_slugs":{"en":"a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ"},"created_at":"2024-02-24T10:57:49Z","updated_at":"2024-03-11T06:53:56Z","promoted_at":"2024-03-11T06:53:56Z","width":2720,"height":4080,"color":"#404026","blur_hash":"LIB:Tx%K56NGORbYxas:0KRj-poe","description":"A woman wearing a traditional coolie hat kneels in a field of green vegetables, carefully harvesting the crops.","alt_description":"a person with a hat on their head in a field","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1708771641703-0df3d179cec3?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708771641703-0df3d179cec3"},"links":{"self":"https://api.unsplash.com/photos/a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ","html":"https://unsplash.com/photos/a-person-with-a-hat-on-their-head-in-a-field-PZfeP0uwBpQ","download":"https://unsplash.com/photos/PZfeP0uwBpQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/PZfeP0uwBpQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE0fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":2,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"people":{"status":"rejected"},"experimental":{"status":"rejected"}},"user":{"id":"mWjiXj5vQuQ","updated_at":"2024-03-11T06:58:57Z","username":"chanwei_snap","name":"Chanwei","first_name":"Chanwei","last_name":null,"twitter_username":null,"portfolio_url":null,"bio":"👋 Just a snap-happy amateur sharing my photos with you!\\r\\n📍Instagram: @chanwei.snap\\r\\n","location":"Taipei, Taiwan","links":{"self":"https://api.unsplash.com/users/chanwei_snap","html":"https://unsplash.com/@chanwei_snap","photos":"https://api.unsplash.com/users/chanwei_snap/photos","likes":"https://api.unsplash.com/users/chanwei_snap/likes","portfolio":"https://api.unsplash.com/users/chanwei_snap/portfolio","following":"https://api.unsplash.com/users/chanwei_snap/following","followers":"https://api.unsplash.com/users/chanwei_snap/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1705518610211-a929b876f4d5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"chanwei.snap","total_collections":15,"total_likes":63,"total_photos":150,"total_promoted_photos":2,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"chanwei.snap","portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"1JwHaWeSK9s","slug":"a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s","alternative_slugs":{"en":"a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s"},"created_at":"2024-03-10T11:33:51Z","updated_at":"2024-03-11T06:57:09Z","promoted_at":"2024-03-11T06:53:39Z","width":3586,"height":3917,"color":"#f3f3d9","blur_hash":"LIQ0T^j=_4%M%MxbM{M{_4jZITbH","description":"Title: Christmas eve Artist: Callowhill, James Publisher: L. Prang & Co. Name on Item: JC Date: [ca. 1861–1897] https://www.digitalcommonwealth.org/search/commonwealth:7w62f880r","alt_description":"a picture of some white flowers on a white background","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710069455079-2059d3cefe91?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710069455079-2059d3cefe91"},"links":{"self":"https://api.unsplash.com/photos/a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s","html":"https://unsplash.com/photos/a-picture-of-some-white-flowers-on-a-white-background-1JwHaWeSK9s","download":"https://unsplash.com/photos/1JwHaWeSK9s/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/1JwHaWeSK9s/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE1fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":7,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"piFVWeoWxU8","updated_at":"2024-03-11T07:28:12Z","username":"bostonpubliclibrary","name":"Boston Public Library","first_name":"Boston","last_name":"Public Library","twitter_username":null,"portfolio_url":"https://www.bpl.org/","bio":"Considered a pioneer of public library service in the United States, the Boston Public Library is among the three largest collections in the country and is committed to be ‘Free for All’.","location":"Boston, USA","links":{"self":"https://api.unsplash.com/users/bostonpubliclibrary","html":"https://unsplash.com/@bostonpubliclibrary","photos":"https://api.unsplash.com/users/bostonpubliclibrary/photos","likes":"https://api.unsplash.com/users/bostonpubliclibrary/likes","portfolio":"https://api.unsplash.com/users/bostonpubliclibrary/portfolio","following":"https://api.unsplash.com/users/bostonpubliclibrary/following","followers":"https://api.unsplash.com/users/bostonpubliclibrary/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1579171056760-0293bb679901image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":null,"total_collections":6,"total_likes":0,"total_photos":510,"total_promoted_photos":62,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":null,"portfolio_url":"https://www.bpl.org/","twitter_username":null,"paypal_email":null}}},{"id":"efzvMAIpfWY","slug":"a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY","alternative_slugs":{"en":"a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY"},"created_at":"2023-04-28T12:46:16Z","updated_at":"2024-03-11T09:48:19Z","promoted_at":null,"width":9504,"height":6336,"color":"#c07359","blur_hash":"LELo7xNHxa~Bz:s9S4nO~VbwoLS~","description":"Amongst expansive red sands and spectacular sandstone rock formations, Hisma Desert – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.","alt_description":"a couple of people that are standing in the dirt","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1682685797742-42c9987a2c34?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682685797742-42c9987a2c34"},"links":{"self":"https://api.unsplash.com/photos/a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY","html":"https://unsplash.com/photos/a-couple-of-people-that-are-standing-in-the-dirt-efzvMAIpfWY","download":"https://unsplash.com/photos/efzvMAIpfWY/download?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/efzvMAIpfWY/download?ixid=M3wxMTc3M3wxfDF8YWxsfDE2fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":211,"liked_by_user":false,"current_user_collections":[],"sponsorship":{"impression_urls":["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515544&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515747&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],"tagline":"Made to Change","tagline_url":"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral","sponsor":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},"topic_submissions":{},"user":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},{"id":"j39-6Uto9QQ","slug":"a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ","alternative_slugs":{"en":"a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ"},"created_at":"2024-03-09T22:12:40Z","updated_at":"2024-03-11T07:57:13Z","promoted_at":"2024-03-11T06:51:56Z","width":3759,"height":5639,"color":"#26260c","blur_hash":"L79tDG?H4;IURu%MM{RP~oohIoIo","description":null,"alt_description":"a forest filled with lots of tall trees","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710020339360-ce951881b835?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710020339360-ce951881b835?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710020339360-ce951881b835"},"links":{"self":"https://api.unsplash.com/photos/a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ","html":"https://unsplash.com/photos/a-forest-filled-with-lots-of-tall-trees-j39-6Uto9QQ","download":"https://unsplash.com/photos/j39-6Uto9QQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/j39-6Uto9QQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE3fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":1,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"MarIhx6ztc0","updated_at":"2024-03-11T06:51:56Z","username":"brice_cooper18","name":"Brice Cooper","first_name":"Brice","last_name":"Cooper","twitter_username":null,"portfolio_url":null,"bio":"Always down for an adventure, capturing those adventures one photo at a time. Never stop exploring!","location":"Florida","links":{"self":"https://api.unsplash.com/users/brice_cooper18","html":"https://unsplash.com/@brice_cooper18","photos":"https://api.unsplash.com/users/brice_cooper18/photos","likes":"https://api.unsplash.com/users/brice_cooper18/likes","portfolio":"https://api.unsplash.com/users/brice_cooper18/portfolio","following":"https://api.unsplash.com/users/brice_cooper18/following","followers":"https://api.unsplash.com/users/brice_cooper18/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1673045276376-91bb892b6e94image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"brice_cooper18","total_collections":14,"total_likes":0,"total_photos":1467,"total_promoted_photos":51,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"brice_cooper18","portfolio_url":null,"twitter_username":null,"paypal_email":null}}},{"id":"oTE1p2Awp3I","slug":"a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I","alternative_slugs":{"en":"a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I"},"created_at":"2024-02-27T22:15:01Z","updated_at":"2024-03-11T06:51:52Z","promoted_at":"2024-03-11T06:51:52Z","width":4000,"height":5333,"color":"#c0c0c0","blur_hash":"LLE:C[u5IooJ_N%gE1ax~ps8Vsoe","description":null,"alt_description":"a couple of people standing on top of a cliff next to the ocean","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709071784840-cf3ecc434749?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709071784840-cf3ecc434749"},"links":{"self":"https://api.unsplash.com/photos/a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I","html":"https://unsplash.com/photos/a-couple-of-people-standing-on-top-of-a-cliff-next-to-the-ocean-oTE1p2Awp3I","download":"https://unsplash.com/photos/oTE1p2Awp3I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/oTE1p2Awp3I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE4fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":8,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"khtnjqjzcq0","updated_at":"2024-03-11T06:51:53Z","username":"mitchorr","name":"Mitchell Orr","first_name":"Mitchell","last_name":"Orr","twitter_username":null,"portfolio_url":"https://mitchorr.darkroom.tech/","bio":"If you feel you would like to support my work, any donations no matter how small, would be extremely helpful. \\r\\nThanks for looking!","location":"Wirral","links":{"self":"https://api.unsplash.com/users/mitchorr","html":"https://unsplash.com/@mitchorr","photos":"https://api.unsplash.com/users/mitchorr/photos","likes":"https://api.unsplash.com/users/mitchorr/likes","portfolio":"https://api.unsplash.com/users/mitchorr/portfolio","following":"https://api.unsplash.com/users/mitchorr/following","followers":"https://api.unsplash.com/users/mitchorr/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1687891061126-8858e815018fimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"mitchorr1","total_collections":0,"total_likes":41,"total_photos":358,"total_promoted_photos":118,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"mitchorr1","portfolio_url":"https://mitchorr.darkroom.tech/","twitter_username":null,"paypal_email":null}}},{"id":"ihmo0uRQ3jA","slug":"a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA","alternative_slugs":{"en":"a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA"},"created_at":"2024-02-24T20:00:04Z","updated_at":"2024-03-11T06:51:48Z","promoted_at":"2024-03-11T06:51:48Z","width":4000,"height":6000,"color":"#260c0c","blur_hash":"L78;b;?I4Xx?tcIUD+xt03oy-.M|","description":null,"alt_description":"a bed sitting in a bedroom next to a window","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1708804309492-5ef3f3458c33?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1708804309492-5ef3f3458c33"},"links":{"self":"https://api.unsplash.com/photos/a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA","html":"https://unsplash.com/photos/a-bed-sitting-in-a-bedroom-next-to-a-window-ihmo0uRQ3jA","download":"https://unsplash.com/photos/ihmo0uRQ3jA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/ihmo0uRQ3jA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDE5fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":20,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"Og5qBrDjufI","updated_at":"2024-03-11T06:51:49Z","username":"mariailves","name":"Maria Ilves","first_name":"Maria","last_name":"Ilves","twitter_username":null,"portfolio_url":"http://www.mariailves.com","bio":null,"location":"Ambleside","links":{"self":"https://api.unsplash.com/users/mariailves","html":"https://unsplash.com/@mariailves","photos":"https://api.unsplash.com/users/mariailves/photos","likes":"https://api.unsplash.com/users/mariailves/likes","portfolio":"https://api.unsplash.com/users/mariailves/portfolio","following":"https://api.unsplash.com/users/mariailves/following","followers":"https://api.unsplash.com/users/mariailves/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1708802611867-ab4ff1564c8cimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"mariailves_","total_collections":0,"total_likes":0,"total_photos":38,"total_promoted_photos":4,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"mariailves_","portfolio_url":"http://www.mariailves.com","twitter_username":null,"paypal_email":null}}},{"id":"UvQtTVdFi9I","slug":"UvQtTVdFi9I","alternative_slugs":{"en":"UvQtTVdFi9I"},"created_at":"2016-08-12T16:12:25Z","updated_at":"2024-03-11T06:50:27Z","promoted_at":"2024-03-11T06:50:27Z","width":3648,"height":5472,"color":"#8ca673","blur_hash":"LGG9g4IAVax[.Zxus=kB9HtQ%LRj","description":null,"alt_description":null,"breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1471018289981-5d9f06e2bf45?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1471018289981-5d9f06e2bf45"},"links":{"self":"https://api.unsplash.com/photos/UvQtTVdFi9I","html":"https://unsplash.com/photos/UvQtTVdFi9I","download":"https://unsplash.com/photos/UvQtTVdFi9I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/UvQtTVdFi9I/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":60,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"dhG1THiRwtA","updated_at":"2024-03-11T06:50:28Z","username":"clarissemeyer","name":"Clarisse Meyer","first_name":"Clarisse","last_name":"Meyer","twitter_username":"claireymeyer","portfolio_url":"https://www.clarisserae.com","bio":"Photo | Video | Design - Southern California & Beyond\\r\\nInstagram: @clarisse.rae","location":"Orange County, CA","links":{"self":"https://api.unsplash.com/users/clarissemeyer","html":"https://unsplash.com/@clarissemeyer","photos":"https://api.unsplash.com/users/clarissemeyer/photos","likes":"https://api.unsplash.com/users/clarissemeyer/likes","portfolio":"https://api.unsplash.com/users/clarissemeyer/portfolio","following":"https://api.unsplash.com/users/clarissemeyer/following","followers":"https://api.unsplash.com/users/clarissemeyer/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1470948329031-558b487bdf37?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"clarisse.rae","total_collections":2,"total_likes":139,"total_photos":99,"total_promoted_photos":58,"accepted_tos":false,"for_hire":false,"social":{"instagram_username":"clarisse.rae","portfolio_url":"https://www.clarisserae.com","twitter_username":"claireymeyer","paypal_email":null}}},{"id":"iswshBYbTBk","slug":"a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk","alternative_slugs":{"en":"a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk"},"created_at":"2024-02-27T19:26:10Z","updated_at":"2024-03-11T06:48:50Z","promoted_at":"2024-03-11T06:48:50Z","width":3940,"height":2634,"color":"#73a673","blur_hash":"LEDn~t%{y:WXDPVtH[jt8{o|VGk9","description":null,"alt_description":"a woman riding an escalator down an escalator","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709061965707-9a89ffb23103?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709061965707-9a89ffb23103"},"links":{"self":"https://api.unsplash.com/photos/a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk","html":"https://unsplash.com/photos/a-woman-riding-an-escalator-down-an-escalator-iswshBYbTBk","download":"https://unsplash.com/photos/iswshBYbTBk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/iswshBYbTBk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIyfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":4,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"people":{"status":"rejected"}},"user":{"id":"d-2o2yQwtxY","updated_at":"2024-03-11T06:48:59Z","username":"vitalymazur","name":"Vitalii Mazur","first_name":"Vitalii","last_name":"Mazur","twitter_username":"@madebyvitalii","portfolio_url":"https://www.behance.net/vitaliimazur","bio":"Life through photography 🌿 \\r\\nFeel free to support me via PayPal (vitaly.mazur@icloud.com) if you like to use my shots. Also I'm available for a photoshoot in Toronto 📸🇨🇦","location":"Toronto, Canada","links":{"self":"https://api.unsplash.com/users/vitalymazur","html":"https://unsplash.com/@vitalymazur","photos":"https://api.unsplash.com/users/vitalymazur/photos","likes":"https://api.unsplash.com/users/vitalymazur/likes","portfolio":"https://api.unsplash.com/users/vitalymazur/portfolio","following":"https://api.unsplash.com/users/vitalymazur/following","followers":"https://api.unsplash.com/users/vitalymazur/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1708119387274-fad12c7d293b?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"vitalymazur ","total_collections":14,"total_likes":773,"total_photos":263,"total_promoted_photos":15,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"vitalymazur ","portfolio_url":"https://www.behance.net/vitaliimazur","twitter_username":"@madebyvitalii","paypal_email":null}}},{"id":"uSNuKKh7wpA","slug":"a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA","alternative_slugs":{"en":"a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA"},"created_at":"2024-03-01T10:58:28Z","updated_at":"2024-03-11T06:48:07Z","promoted_at":"2024-03-11T06:48:07Z","width":9600,"height":5400,"color":"#d9d9d9","blur_hash":"LJLq]_WI_3%eo$xa?cRi~qobITM|","description":"Made in blender 4.0","alt_description":"a picture of a green object with a white background","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709290649154-54c725bd4484?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709290649154-54c725bd4484?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709290649154-54c725bd4484"},"links":{"self":"https://api.unsplash.com/photos/a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA","html":"https://unsplash.com/photos/a-picture-of-a-green-object-with-a-white-background-uSNuKKh7wpA","download":"https://unsplash.com/photos/uSNuKKh7wpA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/uSNuKKh7wpA/download?ixid=M3wxMTc3M3wwfDF8YWxsfDIzfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":42,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"3d-renders":{"status":"approved","approved_on":"2024-03-06T08:20:20Z"},"experimental":{"status":"approved","approved_on":"2024-03-06T07:38:30Z"}},"user":{"id":"5TCQxdaW0wE","updated_at":"2024-03-11T10:04:04Z","username":"theshubhamdhage","name":"Shubham Dhage","first_name":"Shubham","last_name":"Dhage","twitter_username":"theshubhamdhage","portfolio_url":"https://theshubhamdhage.com/","bio":"Creating things is my passion.","location":"Pune, India","links":{"self":"https://api.unsplash.com/users/theshubhamdhage","html":"https://unsplash.com/@theshubhamdhage","photos":"https://api.unsplash.com/users/theshubhamdhage/photos","likes":"https://api.unsplash.com/users/theshubhamdhage/likes","portfolio":"https://api.unsplash.com/users/theshubhamdhage/portfolio","following":"https://api.unsplash.com/users/theshubhamdhage/following","followers":"https://api.unsplash.com/users/theshubhamdhage/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1702918491890-622aa47079a5image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"theshubhamdhage","total_collections":2,"total_likes":296,"total_photos":734,"total_promoted_photos":147,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"theshubhamdhage","portfolio_url":"https://theshubhamdhage.com/","twitter_username":"theshubhamdhage","paypal_email":null}}},{"id":"7lN8MJPnlXs","slug":"a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs","alternative_slugs":{"en":"a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs"},"created_at":"2024-03-06T19:31:23Z","updated_at":"2024-03-11T06:47:23Z","promoted_at":"2024-03-11T06:47:23Z","width":6720,"height":4480,"color":"#26260c","blur_hash":"L05OKD},~lR7TJRj%d^$_0E49Is:","description":null,"alt_description":"a close up of a pine tree with lots of needles","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709753422610-39ed7ddf9e08?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709753422610-39ed7ddf9e08"},"links":{"self":"https://api.unsplash.com/photos/a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs","html":"https://unsplash.com/photos/a-close-up-of-a-pine-tree-with-lots-of-needles-7lN8MJPnlXs","download":"https://unsplash.com/photos/7lN8MJPnlXs/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/7lN8MJPnlXs/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI0fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":5,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"textures-patterns":{"status":"approved","approved_on":"2024-03-11T06:47:18Z"}},"user":{"id":"gMFqynHNocY","updated_at":"2024-03-11T06:48:57Z","username":"blakecheekk","name":"Blake Cheek","first_name":"Blake","last_name":"Cheek","twitter_username":"blakecheekk","portfolio_url":"http://blakecheek.com","bio":"Photographer and Videographer. Lover of coffee and Jesus. ","location":"Atlanta, Ga","links":{"self":"https://api.unsplash.com/users/blakecheekk","html":"https://unsplash.com/@blakecheekk","photos":"https://api.unsplash.com/users/blakecheekk/photos","likes":"https://api.unsplash.com/users/blakecheekk/likes","portfolio":"https://api.unsplash.com/users/blakecheekk/portfolio","following":"https://api.unsplash.com/users/blakecheekk/following","followers":"https://api.unsplash.com/users/blakecheekk/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1709746841716-156061dd4fe9image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"blakecheekk","total_collections":4,"total_likes":0,"total_photos":423,"total_promoted_photos":165,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"blakecheekk","portfolio_url":"http://blakecheek.com","twitter_username":"blakecheekk","paypal_email":null}}},{"id":"Fw8vp9G6FtE","slug":"the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE","alternative_slugs":{"en":"the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE"},"created_at":"2024-03-10T00:43:31Z","updated_at":"2024-03-11T06:46:50Z","promoted_at":"2024-03-11T06:46:50Z","width":6240,"height":4160,"color":"#262626","blur_hash":"LIINNov{ae}=56I]eToaEmWC^iI;","description":null,"alt_description":"the contents of a backpack laid out on a table","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710031407576-135a680d6e10?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710031407576-135a680d6e10?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710031407576-135a680d6e10"},"links":{"self":"https://api.unsplash.com/photos/the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE","html":"https://unsplash.com/photos/the-contents-of-a-backpack-laid-out-on-a-table-Fw8vp9G6FtE","download":"https://unsplash.com/photos/Fw8vp9G6FtE/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/Fw8vp9G6FtE/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI1fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":4,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"UmKpkFAcSDE","updated_at":"2024-03-11T06:46:50Z","username":"taylorheeryphoto","name":"Taylor Heery","first_name":"Taylor","last_name":"Heery","twitter_username":"tahegri","portfolio_url":"http://www.taylorheery.com","bio":"VENMO: @taylorheeryphoto\\r\\nFujifilm fanatic.","location":"Hendersonville, NC","links":{"self":"https://api.unsplash.com/users/taylorheeryphoto","html":"https://unsplash.com/@taylorheeryphoto","photos":"https://api.unsplash.com/users/taylorheeryphoto/photos","likes":"https://api.unsplash.com/users/taylorheeryphoto/likes","portfolio":"https://api.unsplash.com/users/taylorheeryphoto/portfolio","following":"https://api.unsplash.com/users/taylorheeryphoto/following","followers":"https://api.unsplash.com/users/taylorheeryphoto/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1710031596049-549d947d2a3a?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"taylorheeryphoto","total_collections":0,"total_likes":107,"total_photos":520,"total_promoted_photos":209,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"taylorheeryphoto","portfolio_url":"http://www.taylorheery.com","twitter_username":"tahegri","paypal_email":null}}},{"id":"e75CfMG0Sgo","slug":"a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo","alternative_slugs":{"en":"a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo"},"created_at":"2023-04-28T12:46:16Z","updated_at":"2024-03-10T11:50:20Z","promoted_at":null,"width":5429,"height":3619,"color":"#a6c0d9","blur_hash":"LnHLYm%0IAi_?wn$ngj[OtRjs:f6","description":"Nature Reserve – NEOM, Saudi Arabia | The NEOM Nature Reserve region is being designed to deliver protection and restoration of biodiversity across 95% of NEOM.","alt_description":"a person with a backpack looking at mountains","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1682685796002-e05458d61f07?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1682685796002-e05458d61f07?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1682685796002-e05458d61f07"},"links":{"self":"https://api.unsplash.com/photos/a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo","html":"https://unsplash.com/photos/a-person-with-a-backpack-looking-at-mountains-e75CfMG0Sgo","download":"https://unsplash.com/photos/e75CfMG0Sgo/download?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/e75CfMG0Sgo/download?ixid=M3wxMTc3M3wxfDF8YWxsfDI2fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":174,"liked_by_user":false,"current_user_collections":[],"sponsorship":{"impression_urls":["https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515577&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif","https://secure.insightexpressai.com/adServer/adServerESI.aspx?script=false&bannerID=11515780&rnd=[timestamp]&redir=https://secure.insightexpressai.com/adserver/1pixel.gif"],"tagline":"Made to Change","tagline_url":"https://www.neom.com/en-us?utm_source=unsplash&utm_medium=referral","sponsor":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},"topic_submissions":{},"user":{"id":"mYizSrdJkkU","updated_at":"2024-03-11T08:54:08Z","username":"neom","name":"NEOM","first_name":"NEOM","last_name":null,"twitter_username":"neom","portfolio_url":"http://www.neom.com","bio":"Located in the northwest of Saudi Arabia, NEOM’s diverse climate offers both sun-soaked beaches and snow-capped mountains. NEOM’s unique location will provide residents with enhanced livability while protecting 95% of the natural landscape.","location":"NEOM, Saudi Arabia","links":{"self":"https://api.unsplash.com/users/neom","html":"https://unsplash.com/@neom","photos":"https://api.unsplash.com/users/neom/photos","likes":"https://api.unsplash.com/users/neom/likes","portfolio":"https://api.unsplash.com/users/neom/portfolio","following":"https://api.unsplash.com/users/neom/following","followers":"https://api.unsplash.com/users/neom/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1679489218992-ebe823c797dfimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"discoverneom","total_collections":7,"total_likes":1,"total_photos":222,"total_promoted_photos":72,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"discoverneom","portfolio_url":"http://www.neom.com","twitter_username":"neom","paypal_email":null}}},{"id":"jSjHcyHFOdQ","slug":"a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ","alternative_slugs":{"en":"a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ"},"created_at":"2024-02-08T15:36:25Z","updated_at":"2024-03-11T06:46:46Z","promoted_at":"2024-03-11T06:46:46Z","width":8400,"height":5600,"color":"#0c260c","blur_hash":"L44CLsVuD7pF.Po2R7R*-.oyX5My","description":null,"alt_description":"a picture of a green plant in a dark room","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1707406543260-ed14bbd0d086?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1707406543260-ed14bbd0d086"},"links":{"self":"https://api.unsplash.com/photos/a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ","html":"https://unsplash.com/photos/a-picture-of-a-green-plant-in-a-dark-room-jSjHcyHFOdQ","download":"https://unsplash.com/photos/jSjHcyHFOdQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/jSjHcyHFOdQ/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI3fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":14,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"ogQykx6hk_c","updated_at":"2024-03-11T06:46:46Z","username":"pawel_czerwinski","name":"Pawel Czerwinski","first_name":"Pawel","last_name":"Czerwinski","twitter_username":"pm_cze","portfolio_url":"http://paypal.me/pmcze","bio":"Questions about how you can use the photos? help.unsplash.com/en/collections/1463188-unsplash-license 👍","location":"Poland","links":{"self":"https://api.unsplash.com/users/pawel_czerwinski","html":"https://unsplash.com/@pawel_czerwinski","photos":"https://api.unsplash.com/users/pawel_czerwinski/photos","likes":"https://api.unsplash.com/users/pawel_czerwinski/likes","portfolio":"https://api.unsplash.com/users/pawel_czerwinski/portfolio","following":"https://api.unsplash.com/users/pawel_czerwinski/following","followers":"https://api.unsplash.com/users/pawel_czerwinski/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1592328433409-d9ce8a5333eaimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"pmcze","total_collections":7,"total_likes":39154,"total_photos":2137,"total_promoted_photos":1760,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"pmcze","portfolio_url":"http://paypal.me/pmcze","twitter_username":"pm_cze","paypal_email":null}}},{"id":"OfGHUYX0CCg","slug":"a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg","alternative_slugs":{"en":"a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg"},"created_at":"2024-03-06T14:06:51Z","updated_at":"2024-03-11T08:56:52Z","promoted_at":"2024-03-11T06:45:54Z","width":8192,"height":5460,"color":"#260c0c","blur_hash":"LUF{kg=cj@fQ}XxFS3azxFfjS2WW","description":null,"alt_description":"a body of water that has some waves on it","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709733167477-25398ca709c0?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709733167477-25398ca709c0?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709733167477-25398ca709c0"},"links":{"self":"https://api.unsplash.com/photos/a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg","html":"https://unsplash.com/photos/a-body-of-water-that-has-some-waves-on-it-OfGHUYX0CCg","download":"https://unsplash.com/photos/OfGHUYX0CCg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/OfGHUYX0CCg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI4fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":16,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{"earth-hour":{"status":"approved","approved_on":"2024-03-07T09:43:45Z"}},"user":{"id":"uFFemR6e1vs","updated_at":"2024-03-11T06:48:56Z","username":"marcospradobr","name":"Marcos Paulo Prado","first_name":"Marcos Paulo","last_name":"Prado","twitter_username":null,"portfolio_url":"https://www.instagram.com/eusoumarcosprado","bio":"People and commercial photographer based in Rio de Janeiro, Brasil","location":"Rio de Janeiro, Brazil","links":{"self":"https://api.unsplash.com/users/marcospradobr","html":"https://unsplash.com/@marcospradobr","photos":"https://api.unsplash.com/users/marcospradobr/photos","likes":"https://api.unsplash.com/users/marcospradobr/likes","portfolio":"https://api.unsplash.com/users/marcospradobr/portfolio","following":"https://api.unsplash.com/users/marcospradobr/following","followers":"https://api.unsplash.com/users/marcospradobr/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1572910425876-25d44d080554image?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"eusoumarcosprado","total_collections":0,"total_likes":306,"total_photos":413,"total_promoted_photos":139,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"eusoumarcosprado","portfolio_url":"https://www.instagram.com/eusoumarcosprado","twitter_username":null,"paypal_email":null}}},{"id":"VKQpbzeWbrk","slug":"a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk","alternative_slugs":{"en":"a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk"},"created_at":"2024-03-09T21:24:04Z","updated_at":"2024-03-11T06:45:51Z","promoted_at":"2024-03-11T06:45:51Z","width":2592,"height":3872,"color":"#8c2626","blur_hash":"LFI2{Exr0gE}Dlo|=_W-5RE3O=xH","description":null,"alt_description":"a bouquet of orange and white tulips on a red door","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1710018337941-58197591d55a?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1710018337941-58197591d55a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1710018337941-58197591d55a"},"links":{"self":"https://api.unsplash.com/photos/a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk","html":"https://unsplash.com/photos/a-bouquet-of-orange-and-white-tulips-on-a-red-door-VKQpbzeWbrk","download":"https://unsplash.com/photos/VKQpbzeWbrk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/VKQpbzeWbrk/download?ixid=M3wxMTc3M3wwfDF8YWxsfDI5fHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":3,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"H8-Yyg-eX4A","updated_at":"2024-03-11T06:48:56Z","username":"jaelphotos","name":"Jael Coon","first_name":"Jael","last_name":"Coon","twitter_username":null,"portfolio_url":"https://linktr.ee/jaelcoon","bio":"Coffee drinker, photographer, artist and chef/baker","location":"USA","links":{"self":"https://api.unsplash.com/users/jaelphotos","html":"https://unsplash.com/@jaelphotos","photos":"https://api.unsplash.com/users/jaelphotos/photos","likes":"https://api.unsplash.com/users/jaelphotos/likes","portfolio":"https://api.unsplash.com/users/jaelphotos/portfolio","following":"https://api.unsplash.com/users/jaelphotos/following","followers":"https://api.unsplash.com/users/jaelphotos/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1693432710439-47b22b3f6a9eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"jaelcoon","total_collections":51,"total_likes":0,"total_photos":230,"total_promoted_photos":3,"accepted_tos":true,"for_hire":false,"social":{"instagram_username":"jaelcoon","portfolio_url":"https://linktr.ee/jaelcoon","twitter_username":null,"paypal_email":null}}},{"id":"W6AqsLH6HOg","slug":"a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg","alternative_slugs":{"en":"a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg"},"created_at":"2024-03-06T06:59:15Z","updated_at":"2024-03-11T06:45:45Z","promoted_at":"2024-03-11T06:45:45Z","width":6000,"height":4000,"color":"#595959","blur_hash":"LYE_]gO?}qOsW--Ux]$%RPoeX9oz","description":null,"alt_description":"a license plate on the back of a car","breadcrumbs":[],"urls":{"raw":"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3","full":"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=srgb&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=85","regular":"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=1080","small":"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=400","thumb":"https://images.unsplash.com/photo-1709708210553-490ba885fcf6?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw&ixlib=rb-4.0.3&q=80&w=200","small_s3":"https://s3.us-west-2.amazonaws.com/images.unsplash.com/small/photo-1709708210553-490ba885fcf6"},"links":{"self":"https://api.unsplash.com/photos/a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg","html":"https://unsplash.com/photos/a-license-plate-on-the-back-of-a-car-W6AqsLH6HOg","download":"https://unsplash.com/photos/W6AqsLH6HOg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw","download_location":"https://api.unsplash.com/photos/W6AqsLH6HOg/download?ixid=M3wxMTc3M3wwfDF8YWxsfDMwfHx8fHx8Mnx8MTcxMDE1MzIwNXw"},"likes":3,"liked_by_user":false,"current_user_collections":[],"sponsorship":null,"topic_submissions":{},"user":{"id":"VNV70zPYNto","updated_at":"2024-03-11T06:48:56Z","username":"venajeborec","name":"Václav Pechar","first_name":"Václav","last_name":"Pechar","twitter_username":null,"portfolio_url":null,"bio":"Photographer from South Bohemia ✌🏻\\r\\nBe free to contact me to book a shoot 🙏🏻","location":"Czech Republic - Písek","links":{"self":"https://api.unsplash.com/users/venajeborec","html":"https://unsplash.com/@venajeborec","photos":"https://api.unsplash.com/users/venajeborec/photos","likes":"https://api.unsplash.com/users/venajeborec/likes","portfolio":"https://api.unsplash.com/users/venajeborec/portfolio","following":"https://api.unsplash.com/users/venajeborec/following","followers":"https://api.unsplash.com/users/venajeborec/followers"},"profile_image":{"small":"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=32&h=32","medium":"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=64&h=64","large":"https://images.unsplash.com/profile-1687031143105-2420498da92eimage?ixlib=rb-4.0.3&crop=faces&fit=crop&w=128&h=128"},"instagram_username":"amazingvena","total_collections":0,"total_likes":7,"total_photos":324,"total_promoted_photos":30,"accepted_tos":true,"for_hire":true,"social":{"instagram_username":"amazingvena","portfolio_url":null,"twitter_username":null,"paypal_email":null}}}]`),us=class{photos=ls;PAGINATION={};REQUEST_IS_RUNNING=!1;SEARCH_IS_RUNNING=!1;LAST_REQUEST_URL=``;ERROR=null;IS_LOADING=!1;currentPage=1;async fetchPhotos(){this.IS_LOADING=!0;let e=(this.currentPage-1)*30,t=this.currentPage*30;return this.currentPage+=1,this.IS_LOADING=!1,this.photos.slice(e,t)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;let e=await this.fetchPhotos();return e.length>0?e:null}async searchPhotos(e){this.SEARCH_IS_RUNNING=!0;let t=this.photos.filter(t=>t.description&&t.description.toLowerCase().includes(e.toLowerCase())||t.alt_description&&t.alt_description.toLowerCase().includes(e.toLowerCase()));return this.SEARCH_IS_RUNNING=!1,t}searchIsRunning(){return this.SEARCH_IS_RUNNING}triggerDownload(e){}},ds=class{_provider;constructor(e){this._provider=e}async fetchPhotos(){return await this._provider.fetchPhotos()}async searchPhotos(e){return await this._provider.searchPhotos(e)}async triggerDownload(e){this._provider.triggerDownload(e)}async fetchNextPage(){return await this._provider.fetchNextPage()||null}searchIsRunning(){return this._provider.searchIsRunning()}},fs=class{API_URL=`https://api.unsplash.com`;HEADERS;ERROR=null;PAGINATION={};REQUEST_IS_RUNNING=!1;SEARCH_IS_RUNNING=!1;LAST_REQUEST_URL=``;IS_LOADING=!1;constructor(e){this.HEADERS=e}async makeRequest(e){if(this.REQUEST_IS_RUNNING)return null;this.LAST_REQUEST_URL=e;let t={method:`GET`,headers:this.HEADERS};try{this.REQUEST_IS_RUNNING=!0,this.IS_LOADING=!0;let n=await fetch(e,t),r=await this.checkStatus(n);this.extractPagination(r);let i=await r.json();return`results`in i?i.results:i}catch(e){return this.ERROR=e,null}finally{this.REQUEST_IS_RUNNING=!1,this.IS_LOADING=!1}}extractPagination(e){let t=RegExp(`<(.*)>; rel="(.*)"`),n=[],r={};for(let t of e.headers.entries())t[0]===`link`&&n.push(t[1]);return n&&n.toString().split(`,`).forEach(e=>{if(e){let n=t.exec(e);n&&(r[n[2]]=n[1])}}),this.PAGINATION=r,e}async fetchPhotos(){let e=`${this.API_URL}/photos?per_page=30`;return await this.makeRequest(e)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;if(this.PAGINATION.next){let e=`${this.PAGINATION.next}`,t=await this.makeRequest(e);if(t)return t}return null}async searchPhotos(e){let t=`${this.API_URL}/search/photos?query=${e}&per_page=30`;return await this.makeRequest(t)||[]}async triggerDownload(e){e.links.download_location&&await this.makeRequest(e.links.download_location)}async checkStatus(e){if(e.status>=200&&e.status<300)return e;let t=``,n,r=e.headers.get(`content-type`);if(r===`application/json`)n=e.json().then(e=>e.errors[0]);else if(r===`text/xml`)n=e.text();else throw Error(`Unsupported content type`);return n.then(n=>{throw e.status===403&&e.headers.get(`x-ratelimit-remaining`)===`0`&&(t=`Unsplash API rate limit reached, please try again later.`),t=t||n||`Error ${e.status}: Uh-oh! Trouble reaching the Unsplash API`,this.ERROR=t,Error(t)})}searchIsRunning(){return this.SEARCH_IS_RUNNING}},ps=class{photoUseCases;masonryService;photos=[];constructor(e,t){this.photoUseCases=e,this.masonryService=t}async loadNew(){let e=await this.photoUseCases.fetchPhotos();this.photos=e,await this.layoutPhotos()}async layoutPhotos(){this.masonryService.reset(),this.photos&&this.photos.forEach(e=>{e.ratio=e.height/e.width,this.masonryService.addPhotoToColumns(e)})}getColumns(){return this.masonryService.getColumns()}async updateSearch(e){let t=await this.photoUseCases.searchPhotos(e);this.photos=t,this.layoutPhotos()}async loadNextPage(){let e=await this.photoUseCases.fetchNextPage()||[];this.photos=[...this.photos,...e],this.layoutPhotos()}clearPhotos(){this.photos=[]}triggerDownload(e){this.photoUseCases.triggerDownload(e)}searchIsRunning(){return this.photoUseCases.searchIsRunning()}},ms=({onClose:e,onImageInsert:t,unsplashProviderConfig:n})=>{let r=(0,Z.useMemo)(()=>n?new fs(n):new us,[n]),i=(0,Z.useMemo)(()=>new ds(r),[r]),a=(0,Z.useMemo)(()=>new Yo(3),[]),o=(0,Z.useMemo)(()=>new ps(i,a),[i,a]),s=(0,Z.useRef)(null),[c,l]=(0,Z.useState)(0),[u,d]=(0,Z.useState)(0),[f,p]=(0,Z.useState)(o.searchIsRunning()||!0),m=(0,Z.useRef)(!1),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(null),[y,b]=(0,Z.useState)([]);Z.useEffect(()=>{s.current&&_===null&&u!==0&&(s.current.scrollTop=u,d(0))},[_,c,u]),Z.useEffect(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e]),Z.useEffect(()=>{let e=s.current;if(!_)return e&&e.addEventListener(`scroll`,()=>{l(e.scrollTop)}),()=>{e&&e.removeEventListener(`scroll`,()=>{l(e.scrollTop)})}},[s,_]);let x=Z.useCallback(async()=>{if(m.current===!1||h.length===0){b([]),o.clearPhotos(),await o.loadNew();let e=o.getColumns();b(e||[]),s.current&&s.current.scrollTop!==0&&(s.current.scrollTop=0),p(!1)}},[o,h]),S=async e=>{let t=e.target.value;t.length>2&&(v(null),g(t)),t.length===0&&(g(``),m.current=!1,await x())},C=Z.useCallback(async()=>{if(h){p(!0),b([]),o.clearPhotos(),await o.updateSearch(h);let e=o.getColumns();e&&b(e),s.current&&s.current.scrollTop!==0&&(s.current.scrollTop=0),p(!1)}},[h,o]);Z.useEffect(()=>{let e=setTimeout(async()=>{h.length>2?await C():await x()},300);return()=>{m.current=!0,clearTimeout(e)}},[h,C,x]);let w=Z.useCallback(async()=>{p(!0),await o.loadNextPage();let e=o.getColumns();b(e||[]),p(!1)},[o]);Z.useEffect(()=>{let e=s.current;if(e){let t=async()=>{_===null&&e.scrollTop+e.clientHeight>=e.scrollHeight-1e3&&await w()};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t)}}},[s,w,_]);let T=e=>{e&&(v(e),d(c)),e===null&&(v(null),s.current&&(s.current.scrollTop=u))};async function E(e){e.src&&(o.triggerDownload(e),t(e))}return(0,Q.jsx)(cs,{closeModal:e,handleSearch:S,children:(0,Q.jsx)(is,{dataset:y,error:null,galleryRef:s,insertImage:E,isLoading:f,selectImg:T,zoomed:_})})},hs=({unsplashProviderConfig:e,onClose:t,onImageInsert:n})=>(0,Q.jsx)(Jo,{classNames:`admin-x-settings`,children:(0,Q.jsx)(ms,{unsplashProviderConfig:e,onClose:t,onImageInsert:n})}),gs={heading:[{name:`Cardo`,creator:`David Perry`},{name:`Chakra Petch`,creator:`Cadson Demak`},{name:`Fira Mono`,creator:`Carrois Apostrophe`},{name:`Fira Sans`,creator:`Carrois Apostrophe`},{name:`IBM Plex Serif`,creator:`Mike Abbink`},{name:`Inter`,creator:`Rasmus Andersson`},{name:`JetBrains Mono`,creator:`JetBrains`},{name:`Libre Baskerville`,creator:`Impallari Type`},{name:`Lora`,creator:`Cyreal`},{name:`Manrope`,creator:`Mikhail Sharanda`},{name:`Merriweather`,creator:`Sorkin Type`},{name:`Noto Sans`,creator:`Google`},{name:`Noto Serif`,creator:`Google`},{name:`Nunito`,creator:`Vernon Adams`},{name:`Old Standard TT`,creator:`Alexey Kryukov`},{name:`Poppins`,creator:`Indian Type Foundry`},{name:`Roboto`,creator:`Christian Robertson`},{name:`Rufina`,creator:`Martin Sommaruga`},{name:`Space Grotesk`,creator:`Florian Karsten`},{name:`Space Mono`,creator:`Colophon Foundry`},{name:`Tenor Sans`,creator:`Denis Masharov`}],body:[{name:`Fira Mono`,creator:`Carrois Apostrophe`},{name:`Fira Sans`,creator:`Carrois Apostrophe`},{name:`IBM Plex Serif`,creator:`Mike Abbink`},{name:`Inter`,creator:`Rasmus Andersson`},{name:`JetBrains Mono`,creator:`JetBrains`},{name:`Lora`,creator:`Cyreal`},{name:`Manrope`,creator:`Mikhail Sharanda`},{name:`Merriweather`,creator:`Sorkin Type`},{name:`Noto Sans`,creator:`Google`},{name:`Noto Serif`,creator:`Google`},{name:`Nunito`,creator:`Vernon Adams`},{name:`Poppins`,creator:`Indian Type Foundry`},{name:`Roboto`,creator:`Christian Robertson`},{name:`Space Mono`,creator:`Colophon Foundry`}]},_s=`Theme default`,vs=({option:e,selected:t})=>(0,Q.jsxs)(`span`,{className:`flex w-full gap-4 ${e.className??``}`,"data-testid":t?`select-current-option`:`select-option`,"data-value":e.value,children:[(0,Q.jsx)(`span`,{className:`flex size-12 shrink-0 items-center justify-center rounded-md bg-surface-elevated text-2xl font-bold`,children:`Aa`}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsx)(`span`,{className:`text-md`,children:e.label}),(0,Q.jsx)(`span`,{className:`truncate font-sans text-sm font-normal text-muted-foreground`,children:e.hint})]})]}),ys=e=>e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),bs=({values:e,updateSetting:t})=>{let{mutateAsync:n}=re(),{settings:r}=xt(),[i]=Hn(r,[`unsplash`]),[a,o]=(0,Z.useState)(!1),{unsplashConfig:c}=s(),l=h(),u=Ce(),{data:d}=pi(),f=d?.themes.find(e=>e.active),p=f?`${ys(f.name)} (v${f.package?.version||`1.0`})`:`Loading...`,[m,g]=(0,Z.useState)(gs.heading.find(t=>t.name===e.headingFont)||{name:_s,creator:p}),[_,v]=(0,Z.useState)(gs.heading.find(t=>t.name===e.bodyFont)||{name:_s,creator:p}),y=(e,t=!0)=>{let n=``;return e===`Cardo`?n=L(`font-cardo`,t&&`font-bold`):e===`Manrope`?n=L(`font-manrope`,t&&`font-bold`):e===`Merriweather`?n=L(`font-merriweather`,t&&`font-bold`):e===`Nunito`?n=L(`font-nunito`,t&&`font-semibold`):e===`Old Standard TT`?n=L(`font-old-standard-tt`,t&&`font-bold`):e===`Prata`?n=L(`font-prata`,t&&`font-normal`):e===`Roboto`?n=L(`font-roboto`,t&&`font-bold`):e===`Rufina`?n=L(`font-rufina`,t&&`font-bold`):e===`Tenor Sans`?n=L(`font-tenor-sans`,t&&`font-normal`):e===`Chakra Petch`?n=L(`font-chakra-petch`,t&&`font-normal`):e===`Fira Mono`?n=L(`font-fira-mono`,t&&`font-bold`):e===`Fira Sans`?n=L(`font-fira-sans`,t&&`font-bold`):e===`IBM Plex Serif`?n=L(`font-ibm-plex-serif`,t&&`font-bold`):e===`Inter`?n=L(`font-inter`,t&&`font-bold`):e===`JetBrains Mono`?n=L(`font-jetbrains-mono`,t&&`font-bold`):e===`Lora`?n=L(`font-lora`,t&&`font-bold`):e===`Noto Sans`?n=L(`font-noto-sans`,t&&`font-bold`):e===`Noto Serif`?n=L(`font-noto-serif`,t&&`font-bold`):e===`Poppins`?n=L(`font-poppins`,t&&`font-bold`):e===`Space Grotesk`?n=L(`font-space-grotesk`,t&&`font-bold`):e===`Space Mono`&&(n=L(`font-space-mono`,t&&`font-bold`)),n},b=gs.heading.map(e=>{let t=y(e.name,!0);return{label:e.name,value:e.name,hint:e.creator,className:t}});b.unshift({label:_s,value:_s,hint:p,className:`font-sans font-normal`});let x=gs.body.map(e=>{let t=y(e.name,!1);return{label:e.name,value:e.name,hint:e.creator,className:t}});x.unshift({label:_s,value:_s,hint:p,className:`font-sans font-normal`});let S=(e,t)=>e===_s?``:y(e,t),C=b.find(e=>e.value===m.name)||b[0],w=x.find(e=>e.value===_.name)||x[0];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(tn,{className:`mt-6 mb-12 gap-6`,children:[(0,Q.jsx)(B,{debounceMs:200,direction:`rtl`,testId:`accent-color-picker`,title:(0,Q.jsx)(`div`,{children:`Accent color`}),value:e.accentColor,onChange:e=>t(`accent_color`,e)}),(0,Q.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:`Publication icon`}),(0,Q.jsxs)(q,{className:`mr-5 max-w-[160px]`,children:[`A square, social icon, at least `,F(60),`×`,F(60),`px`]})]}),(0,Q.jsx)(`div`,{className:`flex gap-3`,children:(0,Q.jsx)(he,{className:e.icon?`size-16.5`:`h-9 w-40`,children:e.icon?(0,Q.jsxs)(me,{background:`checkerboard`,children:[(0,Q.jsx)(le,{id:`logo`,src:e.icon}),(0,Q.jsx)(be,{className:`top-1 right-1`,children:(0,Q.jsx)(_e,{"aria-label":`Remove publication icon`,"data-testid":`image-delete-button`,onClick:()=>t(`icon`,null),children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{inputId:`logo`,onDropAccepted:async([e])=>{try{t(`icon`,Te(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload icon`})})})]}),(0,Q.jsxs)(`div`,{className:`flex items-start justify-between ${e.icon&&`mt-2`}`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:`Publication logo`}),(0,Q.jsx)(q,{className:`mr-5 max-w-[160px]`,children:`Appears usually in the main header of your theme`})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(he,{className:`h-15 w-40`,children:e.logo?(0,Q.jsxs)(me,{background:`checkerboard`,children:[(0,Q.jsx)(le,{className:`object-contain`,id:`site-logo`,src:e.logo}),(0,Q.jsx)(be,{className:`top-1 right-1`,children:(0,Q.jsx)(_e,{"aria-label":`Remove publication logo`,"data-testid":`image-delete-button`,onClick:()=>t(`logo`,null),children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{inputId:`site-logo`,onDropAccepted:async([e])=>{try{t(`logo`,Te(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload logo`})})})]}),(0,Q.jsxs)(`div`,{className:`mt-2 flex items-start justify-between`,"data-testid":`publication-cover`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:`Publication cover`}),(0,Q.jsx)(q,{className:`mr-5 max-w-[160px]`,children:`Usually as a large banner image on your index pages`})]}),(0,Q.jsx)(he,{className:`h-23.75 w-40`,children:e.coverImage?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(le,{id:`cover`,src:e.coverImage}),(0,Q.jsxs)(be,{className:`top-1 right-1`,children:[u.isEnabled&&(0,Q.jsx)(_e,{"aria-label":`Edit publication cover`,onClick:()=>u.openEditor({image:e.coverImage||``,handleSave:async e=>{try{t(`cover_image`,Te(await n({file:e})))}catch(e){l(e)}}}),children:(0,Q.jsx)(ni,{})}),(0,Q.jsx)(_e,{"aria-label":`Remove publication cover`,"data-testid":`image-delete-button`,onClick:()=>t(`cover_image`,null),children:(0,Q.jsx)(nr,{})})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(ae,{inputId:`cover`,onDropAccepted:async([e])=>{try{t(`cover_image`,Te(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload cover`}),i&&(0,Q.jsx)(be,{className:`top-1 right-1 opacity-100`,children:(0,Q.jsx)(_e,{"aria-label":`Select publication cover from Unsplash`,"data-testid":`toggle-unsplash-button`,onClick:()=>o(!0),children:(0,Q.jsx)(ii,{})})})]})}),a&&c&&i&&(0,Q.jsx)(hs,{unsplashProviderConfig:c,onClose:()=>{o(!1)},onImageInsert:e=>{e.src&&t(`cover_image`,e.src),o(!1)}})]})]}),(0,Q.jsxs)(rn,{className:`-mt-4 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Typography`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-6`,children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Heading font`}),(0,Q.jsxs)(qt,{value:C.value,onValueChange:e=>{e===_s?(g({name:_s,creator:p}),t(`heading_font`,``)):(g({name:e,creator:gs.heading.find(t=>t.name===e)?.creator||``}),t(`heading_font`,e))},children:[(0,Q.jsx)(Wt,{"aria-label":`Heading font`,className:`h-16 pl-2 ${S(C.label,!0)}`,"data-testid":`heading-font-select`,children:(0,Q.jsx)(Kt,{children:(0,Q.jsx)(vs,{option:C,selected:!0})})}),(0,Q.jsx)(Ut,{children:b.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsx)(vs,{option:e})},e.value))})]})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Body font`}),(0,Q.jsxs)(qt,{value:w.value,onValueChange:e=>{e===_s?(v({name:_s,creator:p}),t(`body_font`,``)):(v({name:e,creator:gs.body.find(t=>t.name===e)?.creator||``}),t(`body_font`,e))},children:[(0,Q.jsx)(Wt,{"aria-label":`Body font`,className:`h-16 pl-2 ${S(w.label,!1)}`,"data-testid":`body-font-select`,children:(0,Q.jsx)(Kt,{children:(0,Q.jsx)(vs,{option:w,selected:!0})})}),(0,Q.jsx)(Ut,{className:`max-h-52`,children:x.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsx)(vs,{option:e})},e.value))})]})]})]})]})]})},xs=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self,n.mingo=r())})(e,(function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function i(e,t){return a(e)||o(e,t)||s(e,t)||l()}function a(e){if(Array.isArray(e))return e}function o(e,t){if(!(typeof Symbol>`u`||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function s(e,t){if(e){if(typeof e==`string`)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`)return Array.from(n);if(n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}}function c(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=`null`,d=`undefined`,f=`boolean`,p=`number`,m=`string`,h=`date`,g=`regexp`,_=`array`,v=`object`,y=`function`,b=[u,d,f,p,m,h,g],x=`expression`,S=`group`,C=`pipeline`,w=`projection`,T=`query`,E=function(){};Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(this==null)throw TypeError(`"this" is null or not defined`);var n=Object(this),r=n.length>>>0;if(r===0)return!1;var i=t|0,a=Math.max(i>=0?i:r-Math.abs(i),0);function o(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)}for(;a<r;){if(o(n[a],e))return!0;a++}return!1}});var D=Array.prototype.push;function O(e,t){e||le(t)}function k(e){switch(M(e)){case _:return e.map(k);case v:return fe(e,k);default:return e}}function A(e){switch(M(e)){case _:return Ee([],e);case v:return Object.assign({},e);default:return e}}function j(e){return e===null?`Null`:e===void 0?`Undefined`:e.constructor.name}function M(e){return j(e).toLowerCase()}function ee(e){return M(e)===f}function N(e){return M(e)===m}function P(e){return M(e)===p}var F=Array.isArray||function(e){return!!e&&e.constructor===Array};function I(e){return!!e&&e.constructor===Object}function L(e){return e===Object(e)}function R(e){return M(e)===h}function z(e){return M(e)===g}function te(e){return M(e)===y}function B(e){return e==null}function ne(e){return e===null}function re(e){return e===void 0}function ie(e,t){return e.includes(t)}function ae(e,t){return!ie(e,t)}function oe(e){return!!e}function se(e){return B(e)||F(e)&&e.length===0||I(e)&&ue(e).length===0||!e}function V(e){return F(e)?e:[e]}function ce(e,t){return e.hasOwnProperty(t)}function le(e){throw Error(e)}var ue=Object.keys;function de(e,t,n){if(t=t.bind(n),F(e))for(var r=0,i=e.length;r<i&&t(e[r],r,e)!==!1;r++);else for(var a in e)if(e.hasOwnProperty(a)&&t(e[a],a,e)===!1)break}function fe(e,t,n){t=t.bind(n);for(var r={},i=ue(e),a=0;a<i.length;a++){var o=i[a];r[o]=t(e[o],o)}return r}function pe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(e===E)return t;if(t===E)return e;var r=[e,t];if(!(r.every(I)||r.every(F)))throw Error(`mismatched types. must both be array or object`);if(n.flatten=n.flatten||!1,F(e))if(n.flatten){for(var i=0,a=0;i<e.length&&a<t.length;)e[i]=pe(e[i++],t[a++],n);for(;a<t.length;)e.push(t[a++])}else D.apply(e,t);else Object.keys(t).forEach(function(r){e.hasOwnProperty(r)?e[r]=pe(e[r],t[r],n):e[r]=t[r]});return e}function me(e,t,n){return F(e)?e.reduce(t,n):(de(e,function(r,i){return n=t(n,r,i,e)}),n)}function he(e,t){var n=t.map(Se);return e.filter(function(e){return ie(n,Se(e))})}function ge(e,t){return Ee(Ee([],e),t.filter(ae.bind(null,e)))}function _e(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,n=[];function r(e,t){for(var i=0,a=e.length;i<a;i++)F(e[i])&&(t>0||t<0)?r(e[i],Math.max(-1,t-1)):n.push(e[i])}return r(e,t),n}function ve(e,t){if(t<1)return e;for(;t--&&F(e)&&e.length===1;)e=e[0];return e}function ye(e,t){for(var n=[e],r=[t];n.length>0;)if(e=n.pop(),t=r.pop(),e!==t){var i=M(e);if(i!==M(t)||i===y)return!1;switch(i){case _:if(e.length!==t.length)return!1;Ee(n,e),Ee(r,t);break;case v:var a=ue(e),o=ue(t);if(a.length!==o.length)return!1;a.sort(),o.sort();for(var s=0,c=a.length;s<c;s++){var l=a[s];if(l!==o[s])return!1;n.push(e[l]),r.push(t[l])}break;default:if(xe(e)!==xe(t))return!1}}return n.length===0}function be(e){var t={},n=[];return de(e,function(e){var r=Se(e);ce(t,r)||(n.push(e),t[r]=0)}),n}function xe(e){var t=M(e);switch(t){case f:case p:case g:return e.toString();case m:return JSON.stringify(e);case h:return e.toISOString();case u:case d:return t;case _:return`[`+e.map(xe)+`]`;default:var n=t===v?``:`${j(e)}`,r=ue(e);return r.sort(),`${n}{`+r.map(function(t){return`${xe(t)}:${xe(e[t])}`})+`}`}}function Se(e){if(B(e))return null;for(var t=0,n=xe(e),r=n.length;r;)t=(t<<5)-t^n.charCodeAt(--r);return t>>>0}function Ce(e,t){return e<t?-1:+(e>t)}function we(e,t,n){var r=[],i=[],a={};if(n||=Ce,se(e))return e;for(var o=0;o<e.length;o++){var s=e[o],c=t(s,o);B(c)?i.push(s):(a[c]?a[c].push(s):a[c]=[s],r.push(c))}r.sort(n);for(var l=0;l<r.length;l++)Ee(i,a[r[l]]);return i}function Te(e,t){var n={keys:[],groups:[]},r={};return de(e,function(e){var i=t(e),a=Se(i),o=-1;r[a]===void 0&&(o=n.keys.length,r[a]=o,n.keys.push(i),n.groups.push([])),o=r[a],n.groups[o].push(e)}),n}function Ee(e,t){return D.apply(e,t),e}function H(e,t){for(var n=0,r=e.length-1;n<=r;){var i=Math.round(n+(r-n)/2);if(t<e[i])r=i-1;else if(t>e[i])n=i+1;else return i}return n}function De(e){var t=this;return function(n){return function(){var r=[...arguments],i=Se(r);return ce(n,i)||(n[i]=e.apply(t,r)),n[i]}}({})}function Oe(e,t){return L(e)?e[t]:void 0}function ke(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=0;n.meta=n.meta||!1;function i(e,t){for(var n=e,a=0;a<t.length;a++){var o=t[a];if(o.match(/^\d+$/)===null&&F(n)){if(a===0&&r>0)break;r+=1,t=t.slice(a),n=me(n,function(e,n){var r=i(n,t);return r!==void 0&&e.push(r),e},[]);break}else n=Oe(n,o);if(n===void 0)break}return n}return e=ie(b,M(e))?e:i(e,t.split(`.`)),n.meta?{result:e,depth:r}:e}function Ae(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n.preserveMissingValues=n.preserveMissingValues||!1;var r=t.split(`.`),i=r[0],a=r.length===1||r.slice(1).join(`.`),o=i.match(/^\d+$/)!==null,s=r.length>1,c,l;try{F(e)?o?(c=Oe(e,Number(i)),s&&(c=Ae(c,a,n)),c=[c]):(c=[],de(e,function(e){l=Ae(e,t,n),n.preserveMissingValues?(l===void 0&&(l=E),c.push(l)):l!==void 0&&c.push(l)})):(l=Oe(e,i),s&&(l=Ae(l,a,n)),O(l!==void 0),c={},c[i]=l)}catch{c=void 0}return c}function je(e){if(F(e))for(var t=e.length-1;t>=0;t--)e[t]===E?e.splice(t,1):je(e[t]);else if(I(e))for(var n in e)e.hasOwnProperty(n)&&je(e[n]);return e}function Me(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=t.split(`.`),a=i[0],o=i.length===1||i.slice(1).join(`.`);i.length===1?n(e,a):(r===!0&&B(e[a])&&(e[a]={}),Me(e[a],o,n,r))}function Ne(e,t,n){Me(e,t,function(e,t){e[t]=n},!0)}function Pe(e,t){Me(e,t,function(e,t){F(e)&&/^\d+$/.test(t)?e.splice(parseInt(t),1):I(e)&&delete e[t]})}function Fe(e){return!!e&&e[0]===`$`}function Ie(e){if(ie(b,M(e)))return z(e)?{$regex:e}:{$eq:e};if(L(e)){var t=ue(e);if(!t.some(Fe))return{$eq:e};if(ie(t,`$regex`)){var n=e.$regex,r=e.$options||``,i=``;N(n)&&(i+=n.ignoreCase||r.indexOf(`i`)>=0?`i`:``,i+=n.multiline||r.indexOf(`m`)>=0?`m`:``,i+=n.global||r.indexOf(`g`)>=0?`g`:``,n=new RegExp(n,i)),e.$regex=n,delete e.$options}}return e}function Le(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return B(n)?t<0?(t=Math.max(0,e.length+t),n=e.length-t+1):(n=t,t=0):(t<0&&(t=Math.max(0,e.length+t)),O(n>0,`Invalid argument value for $slice operator. Limit must be a positive number`),n+=t),e.slice(t,n)}function Re(e,t){var n=me(e,function(e,t){return e+t},0),r=e.length||1,i=t&&1||0,a=n/r;return Math.sqrt(me(e,function(e,t){return e+(t-a)**2},0)/(r-i))}function ze(){return{assert:O,clone:A,cloneDeep:k,each:de,err:le,hashCode:Se,getType:j,has:ce,includes:ie.bind(null),isArray:F,isBoolean:ee,isDate:R,isEmpty:se,isEqual:ye,isFunction:te,isNil:B,isNull:ne,isNumber:P,isObject:I,isRegExp:z,isString:N,isUndefined:re,keys:ue,reduce:me,resolve:ke,resolveObj:Ae}}var Be=function(){return Object.assign({computeValue:U,ops:Je},ze())},Ve={key:`_id`};function He(e){Object.assign(Ve,e||{})}var Ue={$$ROOT:function(e,t,n){return n.root},$$CURRENT:function(e,t,n){return e},$$REMOVE:function(e,t,n){}},We={$$KEEP:function(e){return e},$$PRUNE:function(){},$$DESCEND:function(e,t,n){if(!ce(t,`$cond`))return e;var r;return de(e,function(i,a){L(i)&&(F(i)?(r=[],de(i,function(e){I(e)&&(e=Xe(e,t,n)),B(e)||r.push(e)})):r=Xe(i,t,n),B(r)?delete e[a]:e[a]=r)}),e}},Ge=ue(Ue),Ke=ue(We);function qe(){return Ve.key}function Je(){return me(Array.prototype.slice.call(arguments),function(e,t){return Ee(e,ue(di[t]))},[])}function Ye(e,t,n){if(ce(di[S],t))return di[S][t](e,n);if(I(n)){var r={};return de(n,function(t,i){if(r[i]=Ye(e,i,n[i]),ce(di[S],i))return r=r[i],O(ue(n).length===1,`Invalid $group expression '`+JSON.stringify(n)+`'`),!1}),r}}function U(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(r.root=r.root||e,ce(di[x],n))return di[x][n](e,t,r);if(ce(di[S],n))return e=U(e,t,null,r),O(F(e),n+` expression must resolve to an array`),di[S][n](e,null,r);if(N(t)&&t.length>0&&t[0]===`$`){if(ie(Ge,t))return Ue[t](e,null,r);if(ie(Ke,t))return t;var i=Ge.filter(function(e){return t.indexOf(e+`.`)===0});return i.length===1&&(i=i[0],i===`$$ROOT`&&(e=r.root),t=t.substr(i.length)),ke(e,t.slice(1))}switch(M(t)){case _:return t.map(function(t){return U(e,t)});case v:var a={};return de(t,function(n,i){if(a[i]=U(e,n,i,r),[x,S].some(function(e){return ce(di[e],i)}))return O(ue(t).length===1,`Invalid aggregation expression '`+JSON.stringify(t)+`'`),a=a[i],!1}),a;default:return t}}function Xe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n.root=n.root||e;var r=U(e,t,null,n);return ie(Ke,r)?We[r](e,t,n):r}function Ze(e,t){var n=U(e,t);return n==null?null:Math.abs(n)}function Qe(e,t){var n=U(e,t),r=!1,i=me(n,function(e,t){return R(t)&&(O(!r,`'$add' can only have one date value`),r=!0,t=t.getTime()),e+=t,e},0);return r?new Date(i):i}function $e(e,t){var n=U(e,t);return B(n)?null:(O(P(n)||isNaN(n),`$ceil expression must resolve to a number.`),Math.ceil(n))}function et(e,t){var n=U(e,t);return n[0]/n[1]}function tt(e,t){var n=U(e,t);return B(n)?null:(O(P(n)||isNaN(n),`$exp expression must resolve to a number.`),Math.exp(n))}function nt(e,t){var n=U(e,t);return B(n)?null:(O(P(n)||isNaN(n),`$floor expression must resolve to a number.`),Math.floor(n))}function rt(e,t){var n=U(e,t);return B(n)?null:(O(P(n)||isNaN(n),`$ln expression must resolve to a number.`),Math.log(n))}function it(e,t){var n=U(e,t),r=`$log expression must resolve to array(2) of numbers`;return O(F(n)&&n.length===2,r),n.some(B)?null:(O(n.some(isNaN)||n.every(P),r),Math.log10(n[0])/Math.log10(n[1]))}function at(e,t){var n=U(e,t);return B(n)?null:(O(P(n)||isNaN(n),`$log10 expression must resolve to a number.`),Math.log10(n))}function ot(e,t){var n=U(e,t);return n[0]%n[1]}function st(e,t){return me(U(e,t),function(e,t){return e*t},1)}function ct(e,t){var n=U(e,t);return O(F(n)&&n.length===2&&n.every(P),`$pow expression must resolve to array(2) of numbers`),O(!(n[0]===0&&n[1]<0),`$pow cannot raise 0 to a negative exponent`),n[0]**+n[1]}function lt(e,t){var n=U(e,t),r=n[0],i=n[1];return B(r)||isNaN(r)||Math.abs(r)===1/0?r:(O(P(r),`$round expression must resolve to a number.`),pt(r,i,!0))}function ut(e,t){var n=U(e,t);return B(n)?null:(O(P(n)&&n>0||isNaN(n),`$sqrt expression must resolve to non-negative number.`),Math.sqrt(n))}function dt(e,t){var n=U(e,t);return n[0]-n[1]}function ft(e,t){var n=U(e,t),r=n[0],i=n[1];return B(r)||isNaN(r)||Math.abs(r)===1/0?r:(O(P(r),`$trunc expression must resolve to a number.`),O(B(i)||P(i)&&i>-20&&i<100,`$trunc expression has invalid place`),pt(r,i,!1))}function pt(e,t,n){t||=0;var r=Math.abs(e)===e?1:-1;e=Math.abs(e);var i=Math.trunc(e),a=e-i;if(t===0){var o=Math.trunc(10*a);n&&(i&1)==1&&o>=5&&i++}else if(t>0){var s=10**t,c=Math.trunc(a*s),l=Math.trunc(a*s*10)%10;n&&l>5&&(c+=1),i+=c/s}else if(t<0){var u=10**(-1*t),d=i%u;if(i=Math.max(0,i-d),n&&r===-1){for(;d>10;)d-=d%10;i>0&&d>=5&&(i+=u)}}return i*r}function mt(e,t){var n=U(e,t);O(F(n)&&n.length===2,`$arrayElemAt expression must resolve to array(2)`),O(F(n[0]),`First operand to $arrayElemAt must resolve to an array`),O(P(n[1]),`Second operand to $arrayElemAt must resolve to an integer`);var r=n[1];if(n=n[0],r<0&&Math.abs(r)<=n.length)return n[r+n.length];if(r>=0&&r<n.length)return n[r]}function ht(e,t){var n=U(e,t);return O(F(n),`$arrayToObject expression must resolve to an array`),me(n,function(e,t){return F(t)&&t.length==2?e[t[0]]=t[1]:(O(I(t)&&ce(t,`k`)&&ce(t,`v`),`$arrayToObject expression is invalid.`),e[t.k]=t.v),e},{})}function gt(e,t){var n=U(e,t,null);return O(F(n),`$concatArrays must resolve to an array`),n.some(B)?null:n.reduce(function(e,t){return Ee(e,t)},[])}function _t(e,t){var n=U(e,t.input),r=t.as,i=t.cond;return O(F(n),`$filter 'input' expression must resolve to an array`),n.filter(function(e){var t={};return t[`$`+r]=e,U(t,i)===!0})}function vt(e,t){var n=U(e,t[0]),r=U(e,t[1]);return O(F(r),`$in second argument must be an array`),r.some(ye.bind(null,n))}function yt(e,t){var n=U(e,t);if(B(n))return null;var r=n[0],i=n[1];if(B(r))return null;O(F(r),`$indexOfArray expression must resolve to an array.`);var a=n[2]||0,o=n[3];return B(o)&&(o=r.length),a>o?-1:(O(a>=0&&o>=0,`$indexOfArray expression is invalid`),(a>0||o<r.length)&&(r=r.slice(a,o)),r.findIndex(ye.bind(null,i))+a)}function bt(e,t){return F(U(e,t[0]))}function xt(e,t){var n=U(e,t.input);O(F(n),`$map 'input' expression must resolve to an array`);var r=t.as,i=t.in,a=`$`+r;return n.map(function(t){return e[a]=t,U(e,i)})}function St(e,t){var n=U(e,t);O(I(n),`$objectToArray expression must resolve to an object`);var r=[];return de(n,function(e,t){return r.push({k:t,v:e})}),r}function Ct(e,t){for(var n=U(e,t),r=n[0],i=n[1],a=n[2]||1,o=[];r<i&&a>0||r>i&&a<0;)o.push(r),r+=a;return o}function wt(e,t){var n=U(e,t.input),r=U(e,t.initialValue),i=t.in;return B(n)?null:(O(F(n),`$reduce 'input' expression must resolve to an array`),me(n,function(e,t){return U({$value:e,$this:t},i)},r))}function Tt(e,t){var n=U(e,t);if(B(n))return null;O(F(n),`$reverseArray expression must resolve to an array`);var r=[];return Ee(r,n),r.reverse(),r}function Et(e,t){var n=U(e,t);return F(n)?n.length:void 0}function Dt(e,t){var n=U(e,t);return Le(n[0],n[1],n[2])}function Ot(e,t){var n=U(e,t.inputs),r=t.useLongestLength||!1;O(F(n),`'inputs' expression must resolve to an array`),O(ee(r),`'useLongestLength' must be a boolean`),F(t.defaults)&&O(oe(r),`'useLongestLength' must be set to true to use 'defaults'`);for(var i=0,a=0,o=n.length;a<o;a++){var s=n[a];if(B(s))return null;O(F(s),`'inputs' expression values must resolve to an array or null`),i=r?Math.max(i,s.length):Math.min(i||s.length,s.length)}for(var c=[],l=t.defaults||[],u=function(e){var t=n.map(function(t,n){return B(t[e])?l[n]||null:t[e]});c.push(t)},d=0;d<i;d++)u(d);return c}function kt(e,t){var n=U(e,t);return F(n)?me(n,function(e,t){return Object.assign(e,t)},{}):{}}function At(e,t){var n=U(e,t);return oe(n)&&n.every(oe)}function jt(e,t){var n=U(e,t);return oe(n)&&n.some(oe)}function Mt(e,t){return!U(e,t[0])}function Nt(e){return e instanceof Ht?e:new Ht(e)}Nt.isIterator=Pt;function Pt(t){return!!t&&e(t)===`object`&&Ft(t.next)}function Ft(e){return!!e&&typeof e==`function`}function It(e,t){var n=e.slice(t+1);e.splice(t),Array.prototype.push.apply(e,n)}var Lt=Error(),W=1,Rt=2,zt=3,Bt=4;function Vt(e,t,n){var r=!1,i=-1,a=0;return function(o){o=o===n;try{outer:for(;!r;){var s=e();i++;for(var c=-1,l=t.length,u=!1;++c<l;){var d=t[c],f=d.func;switch(d.type){case W:s=f(s,i);break;case Rt:if(!f(s,i))continue outer;break;case zt:--d.func,d.func||(u=!0);break;case Bt:--d.func,d.func||It(t,c);continue outer;default:break outer}}if(r=u,o)n[a++]=s;else return{value:s,done:!1}}}catch(e){if(e!==Lt)throw e}return r=!0,{done:!0}}}var Ht=function(){function e(n){if(t(this,e),this.__iteratees=[],this.__first=!1,this.__done=!1,this.__buf=[],Ft(n)&&(n={next:n}),Pt(n)){var r=n;n=function(){var e=r.next();if(e.done)throw Lt;return e.value}}else if(Array.isArray(n)){var i=n,a=i.length,o=0;n=function(){if(o<a)return i[o++];throw Lt}}else if(!Ft(n))throw Error(`Source is not iterable. Must be Array, Function or Object{next:Function}`);this.next=Vt(n,this.__iteratees,this.__buf)}return r(e,[{key:`_validate`,value:function(){if(this.__first)throw Error("Cannot add iteratee/transform after `first()`")}},{key:`_push`,value:function(e){return this._validate(),this.__iteratees.push(e),this}},{key:`map`,value:function(e){return this._push({type:W,func:e})}},{key:`filter`,value:function(e){return this._push({type:Rt,func:e})}},{key:`take`,value:function(e){return e>0?this._push({type:zt,func:e}):this}},{key:`drop`,value:function(e){return e>0?this._push({type:Bt,func:e}):this}},{key:`transform`,value:function(e){this._validate();var t=this,n;return Nt(function(){return n||=Nt(e(t.value())),n.next()})}},{key:`first`,value:function(){return this.take(1),this.__first=!0,this}},{key:`value`,value:function(){return this.__done||=this.next(this.__buf).done,this.__first?this.__buf[0]:this.__buf}},{key:`each`,value:function(e){for(;;){var t=this.next();if(t.done)break;if(e(t.value)===!1)return!1}return!0}},{key:`reduce`,value:function(e,t){var n=this.next(),r=0;for(t===void 0&&!n.done&&(t=n.value,n=this.next(),r++);!n.done;)t=e(t,n.value,r++),n=this.next();return t}},{key:`size`,value:function(){return this.reduce(function(e,t){return++e},0)}}]),e}();typeof Symbol==`function`&&(Ht.prototype[Symbol.iterator]=function(){return this});var Ut=function(){function e(n,r){t(this,e),this.__operators=n,this.__options=r}return r(e,[{key:`stream`,value:function(e,t){var n=this;e=Nt(e);var r=di[C];return se(this.__operators)||de(this.__operators,function(i){var a=ue(i);O(a.length===1&&ie(Je(C),a[0]),`invalid aggregation operator ${a}`),a=a[0],e=t&&t instanceof Kt?r[a].call(t,e,i[a],n.__options):r[a](e,i[a],n.__options)}),e}},{key:`run`,value:function(e,t){return this.stream(e,t).value()}}]),e}();function Wt(e,t,n){return O(F(t),`Aggregation pipeline must be an array`),new Ut(t,n).run(e)}var Gt=function(){function e(n,r,i){t(this,e),this.__filterFn=r.test.bind(r),this.__query=r,this.__source=n,this.__projection=i||r.__projection,this.__operators=[],this.__result=null,this.__stack=[],this.__options={}}return r(e,[{key:`_fetch`,value:function(){return this.__result?this.__result:(I(this.__projection)&&this.__operators.push({$project:this.__projection}),this.__result=Nt(this.__source).filter(this.__filterFn),this.__operators.length>0&&(this.__result=new Ut(this.__operators,this.__options).stream(this.__result,this.__query)),this.__result)}},{key:`all`,value:function(){return this._fetch().value()}},{key:`count`,value:function(){return this.all().length}},{key:`skip`,value:function(e){return this.__operators.push({$skip:e}),this}},{key:`limit`,value:function(e){return this.__operators.push({$limit:e}),this}},{key:`sort`,value:function(e){return this.__operators.push({$sort:e}),this}},{key:`collation`,value:function(e){return this.__options.collation=e,this}},{key:`next`,value:function(){if(this.__stack){if(this.__stack.length>0)return this.__stack.pop();var e=this._fetch().next();if(!e.done)return e.value;this.__stack=null}}},{key:`hasNext`,value:function(){if(!this.__stack)return!1;if(this.__stack.length>0)return!0;var e=this._fetch().next();return e.done?this.__stack=null:this.__stack.push(e.value),!!this.__stack}},{key:`map`,value:function(e){return this._fetch().map(e).value()}},{key:`forEach`,value:function(e){this._fetch().each(e)}}]),e}();typeof Symbol==`function`&&(Gt.prototype[Symbol.iterator]=function(){return this._fetch()});var Kt=function(){function e(n,r){t(this,e),this.__criteria=n,this.__projection=r||{},this.__compiled=[],this._compile()}return r(e,[{key:`_compile`,value:function(){var e=this;O(I(this.__criteria),`query criteria must be an object`);var t;de(this.__criteria,function(n,r){r===`$where`?t={field:r,expr:n}:r===`$expr`||ie([`$and`,`$or`,`$nor`],r)?e._processOperator(r,r,n):(O(!Fe(r),`unknown top level operator: ${r}`),n=Ie(n),de(n,function(t,n){e._processOperator(r,n,t)})),I(t)&&e._processOperator(t.field,t.field,t.expr)})}},{key:`_processOperator`,value:function(e,t,n){O(ce(di[T],t),`invalid query operator ${t} detected`),this.__compiled.push(di[T][t](e,n))}},{key:`test`,value:function(e){for(var t=0,n=this.__compiled.length;t<n;t++)if(!this.__compiled[t](e))return!1;return!0}},{key:`find`,value:function(e,t){return new Gt(e,this,t)}},{key:`remove`,value:function(e){var t=this;return me(e,function(e,n){return t.test(n)||e.push(n),e},[])}}]),e}();function qt(e,t,n){return new Kt(t).find(e,n)}function Jt(e,t){return new Kt(t).remove(e)}function Yt(e,t){if(ye(e,t)||B(e)&&B(t))return!0;if(F(e)){var n=ye.bind(null,t);return e.some(n)||_e(e,1).some(n)}return!1}function Xt(e,t){return!Yt(e,t)}function Zt(e,t){return B(e)?t.some(ne):he(V(e),t).length>0}function Qt(e,t){return!Zt(e,t)}function $t(e,t){return sn(e,t,function(e,t){return e<t})}function en(e,t){return sn(e,t,function(e,t){return e<=t})}function tn(e,t){return sn(e,t,function(e,t){return e>t})}function nn(e,t){return sn(e,t,function(e,t){return e>=t})}function G(e,t){return V(e).some(function(e){return P(e)&&F(t)&&t.length===2&&e%t[0]===t[1]})}function rn(e,t){e=V(e);var n=function(e){return N(e)&&!!e.match(t)};return e.some(n)||_e(e,1).some(n)}function an(e,t){return(t===!1||t===0)&&e===void 0||(t===!0||t===1)&&e!==void 0}function K(e,t){var n=!1;if(F(e)&&F(t))for(var r=0,i=t.length;r<i;r++)if(I(t[r])&&ie(ue(t[r]),`$elemMatch`))n||=on(e,t[r].$elemMatch);else return he(t,e).length===i;return n}function q(e,t){return F(e)&&P(t)&&e.length===t}function on(e,t){if(F(e)&&!se(e)){var n=function(e){return e},r=t;ue(t).every(Fe)&&(r={temp:t},n=function(e){return{temp:e}});for(var i=new Kt(r),a=0,o=e.length;a<o;a++)if(i.test(n(e[a])))return!0}return!1}function J(e,t){switch(t){case 1:case`double`:return P(e)&&(e+``).indexOf(`.`)!==-1;case 2:case m:return N(e);case 3:case v:return I(e);case 4:case _:return F(e);case 6:case d:return B(e);case 8:case`bool`:return ee(e);case 9:case h:return R(e);case 10:case u:return ne(e);case 11:case`regex`:return z(e);case 16:case`int`:return P(e)&&e<=2147483647&&(e+``).indexOf(`.`)===-1;case 18:case`long`:return P(e)&&e>2147483647&&e<=0x8000000000000000&&(e+``).indexOf(`.`)===-1;case 19:case`decimal`:return P(e);default:return!1}}function sn(e,t,n){return V(e).some(function(e){return j(e)===j(t)&&n(e,t)})}function cn(e){return function(t,n){var r=U(t,n);return e(r[0],r[1])}}var ln=cn(Yt),un=cn(Xt),dn=cn(tn),fn=cn($t),pn=cn(nn),mn=cn(en),hn=cn(Qt);function gn(e,t){var n=U(e,t);return n[0]>n[1]?1:n[0]<n[1]?-1:0}function _n(e,t){var n,r,i,a=`$cond: invalid arguments`;return F(t)?(O(t.length===3,a),n=t[0],r=t[1],i=t[2]):(O(I(t),a),n=t.if,r=t.then,i=t.else),U(e,n)?U(e,r):U(e,i)}function vn(e,t){var n=`Invalid arguments for $switch operator`;O(t.branches,n);var r=t.branches.find(function(t){return O(t.case&&t.then,n),U(e,t.case)});return r?U(e,r.then):(O(t.default,n),U(e,t.default))}function yn(e,t){O(F(t)&&t.length===2,`$ifNull expression must resolve to array(2)`);var n=U(e,t);return B(n[0])?n[1]:n[0]}function bn(e,t){var n=U(e,t),r=n-new Date(n.getFullYear(),0,0);return Math.round(r/(1e3*60*60*24))}function xn(e,t){return U(e,t).getDate()}function Sn(e,t){return U(e,t).getDay()+1}function Cn(e,t){return U(e,t).getFullYear()}function wn(e,t){return U(e,t).getMonth()+1}function Tn(e,t){var n=U(e,t);n=new Date(+n),n.setHours(0,0,0),n.setDate(n.getDate()+4-(n.getDay()||7));var r=new Date(n.getFullYear(),0,1);return Math.floor(((n-r)/864e5+1)/7)}function En(e,t){return U(e,t).getUTCHours()}function Dn(e,t){return U(e,t).getMinutes()}function On(e,t){return U(e,t).getSeconds()}function kn(e,t){return U(e,t).getMilliseconds()}var An={"%Y":[Cn,4],"%m":[wn,2],"%d":[xn,2],"%H":[En,2],"%M":[Dn,2],"%S":[On,2],"%L":[kn,3],"%j":[bn,3],"%w":[Sn,1],"%U":[Tn,2],"%%":`%`};function jn(e,t){for(var n=t.format,r=U(e,t.date),i=n.match(/(%%|%Y|%m|%d|%H|%M|%S|%L|%j|%w|%U)/g),a=0,o=i.length;a<o;a++){var s=An[i[a]],c=s;if(F(s)){var l=s[0],u=s[1];c=Mn(l(e,r),u)}n=n.replace(i[a],c)}return n}function Mn(e,t){return Array(Math.max(t-String(e).length+1,0)).join(`0`)+e}function Nn(e,t){return t}function Pn(e,t){var n=U(e,t),r=be(n[0]),i=be(n[1]);return r.length===i.length&&r.length===he(r,i).length}function Fn(e,t){var n=U(e,t);return he(n[0],n[1])}function In(e,t){var n=U(e,t);return n[0].filter(ae.bind(null,n[1]))}function Ln(e,t){var n=U(e,t);return ge(n[0],n[1])}function Rn(e,t){var n=U(e,t);return he(n[0],n[1]).length===n[0].length}function zn(e,t){return U(e,t)[0].some(oe)}function Bn(e,t){return U(e,t)[0].every(oe)}function Vn(e,t){var n=U(e,t);return[null,void 0].some(ie.bind(null,n))?null:n.join(``)}function Hn(e,t){var n=U(e,t),r=`$indexOfBytes expression resolves to invalid an argument`;if(B(n[0]))return null;O(N(n[0])&&N(n[1]),r);var i=n[0],a=n[1],o=n[2],s=n[3],c=B(o)||P(o)&&o>=0&&Math.round(o)===o;if(c&&=B(s)||P(s)&&s>=0&&Math.round(s)===s,O(c,r),o||=0,s||=i.length,o>s)return-1;var l=i.substring(o,s).indexOf(a);return l>-1?l+o:l}function Un(e,t){var n=U(e,t);return B(n[0])?null:(O(n.every(N),`$split expression must result to array(2) of strings`),n[0].split(n[1]))}function Wn(e,t){return~-encodeURI(U(e,t)).split(/%..|./).length}function Gn(e,t){return U(e,t).length}function Kn(e,t){var n=U(e,t),r=n[0],i=n[1];return ye(r,i)||n.every(B)?0:(O(n.every(N),`$strcasecmp must resolve to array(2) of strings`),r=r.toUpperCase(),i=i.toUpperCase(),r>i&&1||r<i&&-1||0)}function qn(e,t){var n=U(e,t),r=n[0],i=n[1],a=n[2];O(N(r)&&P(i)&&i>=0&&P(a)&&a>=0,`$substrBytes: invalid arguments`);for(var o=er(r),s=[],c=0,l=0;l<o.length;l++)s.push(c),c+=o[l].length;var u=s.indexOf(i),d=s.indexOf(i+a);return O(u>-1&&d>-1,`$substrBytes: invalid range, start or end index is a UTF-8 continuation byte.`),r.substring(u,d)}function Jn(e,t){var n=U(e,t),r=n[0],i=n[1],a=n[2];return N(r)?i<0?``:a<0?r.substr(i):r.substr(i,a):``}function Yn(e,t){return Jn(e,t)}function Xn(e,t){var n=U(e,t);return se(n)?``:n.toLowerCase()}function Zn(e,t){var n=U(e,t);return se(n)?``:n.toUpperCase()}var Qn=[192,224,240];function $n(e){if(e<128)return[e];for(var t=e<2048&&1||e<65536&&2||3,n=Qn[t-1],r=[(e>>6*t)+n];t>0;)r.push(128|e>>6*--t&63);return r}function er(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push($n(e.codePointAt(n)));return t}function tr(e,t){var n=t.vars,r=t.in;return de(ue(n),function(t){var r=U(e,n[t]),i=`$`+t;e[i]=r}),U(e,r)}var nr=Object.freeze({__proto__:null,$abs:Ze,$add:Qe,$ceil:$e,$divide:et,$exp:tt,$floor:nt,$ln:rt,$log:it,$log10:at,$mod:ot,$multiply:st,$pow:ct,$round:lt,$sqrt:ut,$subtract:dt,$trunc:ft,$arrayElemAt:mt,$arrayToObject:ht,$concatArrays:gt,$filter:_t,$in:vt,$indexOfArray:yt,$isArray:bt,$map:xt,$objectToArray:St,$range:Ct,$reduce:wt,$reverseArray:Tt,$size:Et,$slice:Dt,$zip:Ot,$mergeObjects:kt,$and:At,$or:jt,$not:Mt,$eq:ln,$ne:un,$gt:dn,$lt:fn,$gte:pn,$lte:mn,$nin:hn,$cmp:gn,$cond:_n,$switch:vn,$ifNull:yn,$dayOfYear:bn,$dayOfMonth:xn,$dayOfWeek:Sn,$year:Cn,$month:wn,$week:Tn,$hour:En,$minute:Dn,$second:On,$millisecond:kn,$dateToString:jn,$literal:Nn,$setEquals:Pn,$setIntersection:Fn,$setDifference:In,$setUnion:Ln,$setIsSubset:Rn,$anyElementTrue:zn,$allElementsTrue:Bn,$concat:Vn,$indexOfBytes:Hn,$split:Un,$strLenBytes:Wn,$strLenCP:Gn,$strcasecmp:Kn,$substrBytes:qn,$substr:Jn,$substrCP:Yn,$toLower:Xn,$toUpper:Zn,$let:tr});function rr(e,t){return B(t)?e:e.map(function(e){return U(e,t)})}function ir(e,t){return be(rr(e,t))}function ar(e,t){var n=rr(e,t).filter(P);return me(n,function(e,t){return e+t},0)/(n.length||1)}function or(e,t){return e.length>0?U(e[0],t):void 0}function sr(e,t){return e.length>0?U(e[e.length-1],t):void 0}function cr(e,t){return me(rr(e,t),function(e,t){return B(e)||t>e?t:e},void 0)}function Y(e,t){return me(e,function(e,n){return Object.assign(e,U(n,t))},{})}function lr(e,t){return me(rr(e,t),function(e,t){return B(e)||t<e?t:e},void 0)}function ur(e,t){return Re(rr(e,t).filter(P),!1)}function dr(e,t){return Re(rr(e,t).filter(P),!0)}function fr(e,t){return F(e)?P(t)?e.length*t:me(rr(e,t).filter(P),function(e,t){return e+t},0):0}var pr=Object.freeze({__proto__:null,$addToSet:ir,$avg:ar,$first:or,$last:sr,$max:cr,$mergeObjects:Y,$min:lr,$push:rr,$stdDevPop:ur,$stdDevSamp:dr,$sum:fr});function mr(e,t,n){var r=ue(t);return r.length===0?e:e.map(function(e){var n=k(e);return de(r,function(r){Ne(n,r,U(e,t[r]))}),n})}var hr=mr;function gr(e,t,n){var r=t.boundaries,i=t.default,a=r[0],o=r[r.length-1],s=t.output||{count:{$sum:1}};O(r.length>2,`$bucket 'boundaries' expression must have at least 3 elements`);for(var c=j(a),l=0,u=r.length-1;l<u;l++)O(c===j(r[l+1]),`$bucket 'boundaries' must all be of the same type`),O(r[l]<r[l+1],`$bucket 'boundaries' must be sorted in ascending order`);!B(i)&&j(t.default)===j(a)&&O(a>t.default||o<t.default,`$bucket 'default' expression must be out of boundaries range`);var d={};de(r,function(e){return d[e]=[]}),B(i)||(d[i]=[]);var f=!1;return Nt(function(){return f||=(e.each(function(e){var n=U(e,t.groupBy);if(B(n)||n<a||n>=o)O(!B(i),`$bucket require a default for out of range values`),d[i].push(e);else{O(n>=a&&n<o,`$bucket 'groupBy' expression must resolve to a value in range of boundaries`);var s=H(r,n);d[r[Math.max(0,s-1)]].push(e)}}),r.pop(),B(i)||r.push(i),Nt(r).map(function(e){var t=Ye(d[e],null,s);return Object.assign(t,{_id:e})})),f.next()})}function _r(e,t,n){var r=t.output||{count:{$sum:1}},i=t.groupBy,a=t.buckets;return O(a>0,`The $bucketAuto 'buckets' field must be greater than 0, but found: `+a),e.transform(function(e){for(var t=Math.max(1,Math.round(e.length/a)),n=De(U),o={},s=[],c=we(e,function(e){var t=n(e,i);return B(t)?s.push(e):(o[t]||(o[t]=[]),o[t].push(e)),t}),l=qe(),u=[],d=0,f=0,p=c.length;f<a&&d<p;f++){for(var m={},h=[],g=0;g<t&&d<p;g++){var _=n(c[d],i);if(B(_)&&(_=null),Ee(h,B(_)?s:o[_]),d+=B(_)?s.length:o[_].length,ce(m,`min`)||(m.min=_),u.length>0){var v=u[u.length-1];v[l].max=m.min}}f==a-1&&Ee(h,c.slice(d)),u.push(Object.assign(Ye(h,null,r),{_id:m}))}return u.length>0&&(u[u.length-1][l].max=n(c[c.length-1],i)),u})}function vr(e,t,n){return O(N(t)&&t.trim()!==``&&t.indexOf(`.`)===-1&&t.trim()[0]!==`$`,`Invalid expression value for $count`),Nt(function(){var n={};return n[t]=e.size(),{value:n,done:!1}}).first()}function yr(e,t,n){return e.transform(function(e){return[fe(t,function(t){return Wt(e,t)})]})}function br(e,t,n){var r=qe(),i=t[r];return e.transform(function(e){var n=Te(e,function(e){return U(e,i,i)});t=A(t),delete t[r];var a=-1,o=n.keys.length;return function(){if(++a===o)return{done:!0};var e=n.keys[a],i={};return e!==void 0&&(i[r]=e),de(t,function(e,t){i[t]=Ye(n.groups[a],t,e)}),{value:i,done:!1}}})}function xr(e,t,n){return e.take(t)}function Sr(e,t,n){var r=t.from,i=t.localField,a=t.foreignField,o=t.as;O(F(r)&&N(a)&&N(i)&&N(o),`$lookup: invalid argument`);var s={};return de(r,function(e){var t=Se(ke(e,a));s[t]=s[t]||[],s[t].push(e)}),e.map(function(e){var t=Se(ke(e,i)),n=A(e);return n[o]=s[t]||[],n})}function Cr(e,t,n){var r=new Kt(t);return e.filter(function(e){return r.test(e)})}function wr(e,t,n){return O(F(t),`$out expression must be an array`),e.map(function(e){return t.push(e),e})}function Tr(e,t,n){if(se(t))return e;var r=ue(t),i=!1,a=qe();if(Dr(t),ie(r,a)){var o=t[a];(o===0||o===!1)&&(r=r.filter(ae.bind(null,[a])),O(ae(r,a),`Must not contain collections id key`),i=se(r))}else r.push(a);return e.map(function(e){return Er(e,t,r,i)})}function Er(e,t,n,r){var i=qe(),a={},o=!1,s=!1,c=[];return r&&c.push(i),n.forEach(function(n){var r,l=t[n];if(n!==i&&ie([0,!1],l)&&(s=!0),n===i&&se(l))r=e[n];else if(N(l))r=U(e,l,n);else if(!ie([1,!0],l))if(F(l))r=l.map(function(t){var n=U(e,t);return B(n)?null:n});else if(I(l)){var u=ue(l),d=u.length>1?!1:u[0];if(ie(Je(w),d)){var f=di[w];d===`$slice`?V(l[d]).every(P)?(r=f[d](e,l[d],n),o=!0):r=U(e,l,n):r=f[d](e,l[d],n)}else if(ce(e,n)){Dr(l);var p=e[n];r=F(p)?p.map(function(e){return Er(e,l,u,!1)}):Er(p,l,u,!1)}else r=U(e,l,n)}else{c.push(n);return}var m=Ae(e,n,{preserveMissingValues:!0});m!==void 0&&pe(a,m,{flatten:!0}),ae([0,1,!1,!0],l)&&(r===void 0?Pe(a,n):Ne(a,n,r))}),je(a),(o||s||r)&&(a=Object.assign({},e,a),c.length>0&&(a=k(a),de(c,function(e){return Pe(a,e)}))),a}function Dr(e){var t=qe(),n=[!1,!1];de(e,function(e,r){r!==t&&(e===0||e===!1?n[0]=!0:(e===1||e===!0)&&(n[1]=!0),O(!(n[0]&&n[1]),`Projection cannot have a mix of inclusion and exclusion.`))})}function Or(e,t,n){return e.map(function(e){return Xe(k(e),t)})}function kr(e,t,n){return e.map(function(e){return e=U(e,t.newRoot),O(I(e),`$replaceRoot expression must return an object`),e})}function Ar(e,t,n){var r=t.size;return O(P(r),`$sample size must be a positive integer`),e.transform(function(e){var t=e.length,n=-1;return function(){return++n===r?{done:!0}:{value:e[Math.floor(Math.random()*t)],done:!1}}})}function jr(e,t,n){return e.drop(t)}function Mr(e,t,n){if(se(t)||!I(t))return e;n||={};var r=Ce,i=n.collation;return I(i)&&N(i.locale)&&(r=Pr(i)),e.transform(function(e){return de(ue(t).reverse(),function(n){var i=Te(e,function(e){return ke(e,n)}),a={},o=we(i.keys,function(e,t){return a[e]=t,e},r);t[n]===-1&&o.reverse(),e=[],de(o,function(t){return Ee(e,i.groups[a[t]])})}),e})}var Nr={1:`base`,2:`accent`,3:`variant`};function Pr(e){var t={sensitivity:Nr[e.strength||3],caseFirst:e.caseFirst===`off`?`false`:e.caseFirst||`false`,numeric:e.numericOrdering||!1,ignorePunctuation:e.alternate===`shifted`};(e.caseLevel||!1)===!0&&(t.sensitivity===`base`&&(t.sensitivity=`case`),t.sensitivity===`accent`&&(t.sensitivity=`variant`));var n=new Intl.Collator(e.locale,t);return function(e,t){if(!N(e)||!N(t))return Ce(e,t);var r=n.compare(e,t);return r<0?-1:+(r>0)}}function Fr(e,t,n){var r={count:{$sum:1}};return r[qe()]=t,Mr(br(e,r),{count:-1},n)}function Ir(t,n,r){N(n)&&(n={path:n});var i=n.path.substr(1),a=n.includeArrayIndex||!1,o=n.preserveNullAndEmptyArrays||!1,s=function(e,t){return a!==!1&&(e[a]=t),e},c;return Nt(function(){for(var n=function(){if(Nt.isIterator(c)){var e=c.next();if(!e.done)return{v:e}}var n=t.next();if(n.done)return{v:n};if(n=n.value,c=ke(n,i),F(c))if(c.length===0&&o===!0){c=null;var r=k(n);return Pe(r,i),{v:{value:s(r,null),done:!1}}}else c=Nt(c).map(function(e,t){var r=k(n);return Ne(r,i,e),s(r,t)});else if(!se(c)||o===!0)return{v:{value:s(k(n),null),done:!1}}};;){var r=n();if(e(r)===`object`)return r.v}})}var Lr=Object.freeze({__proto__:null,$addFields:mr,$set:hr,$bucket:gr,$bucketAuto:_r,$count:vr,$facet:yr,$group:br,$limit:xr,$lookup:Sr,$match:Cr,$out:wr,$project:Tr,$redact:Or,$replaceRoot:kr,$sample:Ar,$skip:jr,$sort:Mr,$sortByCount:Fr,$unwind:Ir});function Rr(e,t,n){le(`$ not implemented`)}function zr(e,t,n){var r=ke(e,n),i=new Kt(t);O(F(r),`$elemMatch: invalid argument`);for(var a=0;a<r.length;a++)if(i.test(r[a]))return[r[a]]}function Br(e,t,n){var r=ke(e,n);return F(r)?F(t)?Le(r,t[0],t[1]):(O(P(t),`$slice: invalid arguments for projection`),Le(r,t)):r}var Vr=Object.freeze({__proto__:null,$:Rr,$elemMatch:zr,$slice:Br});function Hr(e){return function(t,n){return function(r){var i=ke(r,t,{meta:!0});return i=ve(i.result,i.depth),e(i,n)}}}var Ur=Hr(K),Wr=Hr(on),Gr=Hr(Yt),Kr=Hr(an),qr=Hr(tn),Jr=Hr(nn),Yr=Hr(Zt),Xr=Hr($t),Zr=Hr(en),Qr=Hr(G),$r=Hr(Xt),ei=Hr(Qt),ti=Hr(rn),ni=Hr(q),ri=Hr(J);function ii(e,t){O(F(t),`Invalid expression: $and expects value to be an Array`);var n=[];return de(t,function(e){return n.push(new Kt(e))}),function(e){for(var t=0;t<n.length;t++)if(!n[t].test(e))return!1;return!0}}function ai(e,t){O(F(t),`Invalid expression. $or expects value to be an Array`);var n=[];return de(t,function(e){return n.push(new Kt(e))}),function(e){for(var t=0;t<n.length;t++)if(n[t].test(e))return!0;return!1}}function oi(e,t){O(F(t),`Invalid expression. $nor expects value to be an Array`);var n=ai(`$or`,t);return function(e){return!n(e)}}function si(e,t){var n={};n[e]=Ie(t);var r=new Kt(n);return function(e){return!r.test(e)}}function ci(e,t){return te(t)||(t=Function(`return `+t+`;`)),function(e){return t.call(e)===!0}}function li(e,t){return function(e){return U(e,t)}}var ui=Object.freeze({__proto__:null,$all:Ur,$elemMatch:Wr,$eq:Gr,$exists:Kr,$gt:qr,$gte:Jr,$in:Yr,$lt:Xr,$lte:Zr,$mod:Qr,$ne:$r,$nin:ei,$regex:ti,$size:ni,$type:ri,$and:ii,$or:ai,$nor:oi,$not:si,$where:ci,$expr:li}),di={};di[x]={},di[S]={},di[C]={},di[w]={},di[T]={};var X=[[x,nr],[S,pr],[C,Lr],[w,Vr],[T,ui]];function fi(){de(X,function(e){var t=i(e,2),n=t[0],r=t[1];Object.assign(di[n],r)})}function pi(e,t){var n=t(Be());O(ce(di,e),`Invalid operator class ${e}`);var r=di[e];de(n,function(t,n){O(/^\$[a-zA-Z0-9_]*$/.test(n),`Invalid operator name ${n}`),O(!ce(r,n),`${n} already exists for '${e}' operators`)});var i={};switch(e){case T:de(n,function(e,t){e=e.bind(n),i[t]=function(n,r){return function(i){var a=ke(i,n),o=e(n,a,r);return O(ee(o),`${t} must return a boolean`),o}}});break;case w:de(n,function(e,t){e=e.bind(n),i[t]=function(t,n,r){var i=ke(t,r);return e(r,i,n)}});break;default:de(n,function(e,t){i[t]=function(){var t=[...arguments];return e.apply(n,t)}})}Object.assign(di[e],i)}return fi(),{_internal:Be,Aggregator:Ut,CollectionMixin:{query:function(e,t){return new Kt(e).find(this.toJSON(),t)},aggregate:function(e){return new Ut(e).run(this.toJSON())}},Cursor:Gt,Lazy:Nt,OP_EXPRESSION:x,OP_GROUP:S,OP_PIPELINE:C,OP_PROJECTION:w,OP_QUERY:T,Query:Kt,VERSION:`2.5.3`,addOperators:pi,aggregate:Wt,find:qt,remove:Jt,setup:He}}))})),Ss=n(((e,t)=>{(function(){var n,r=`Expected a function`,i=`__lodash_hash_undefined__`,a=`__lodash_placeholder__`,o=1,s=2,c=8,l=16,u=32,d=64,f=128,p=256,m=512,h=1/0,g=9007199254740991,_=NaN,v=4294967295,y=v-1,b=v>>>1,x=[[`ary`,f],[`bind`,o],[`bindKey`,s],[`curry`,c],[`curryRight`,l],[`flip`,m],[`partial`,u],[`partialRight`,d],[`rearg`,p]],S=`[object Arguments]`,C=`[object Array]`,w=`[object AsyncFunction]`,T=`[object Boolean]`,E=`[object Date]`,D=`[object DOMException]`,O=`[object Error]`,k=`[object Function]`,A=`[object GeneratorFunction]`,j=`[object Map]`,M=`[object Number]`,ee=`[object Null]`,N=`[object Object]`,P=`[object Promise]`,F=`[object Proxy]`,I=`[object RegExp]`,L=`[object Set]`,R=`[object String]`,z=`[object Symbol]`,te=`[object Undefined]`,B=`[object WeakMap]`,ne=`[object WeakSet]`,re=`[object ArrayBuffer]`,ie=`[object DataView]`,ae=`[object Float32Array]`,oe=`[object Float64Array]`,se=`[object Int8Array]`,V=`[object Int16Array]`,ce=`[object Int32Array]`,le=`[object Uint8Array]`,ue=`[object Uint8ClampedArray]`,de=`[object Uint16Array]`,fe=`[object Uint32Array]`,pe=/\b__p \+= '';/g,me=/\b(__p \+=) '' \+/g,he=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ge=/&(?:amp|lt|gt|quot|#39);/g,_e=/[&<>"']/g,ve=RegExp(ge.source),ye=RegExp(_e.source),be=/<%-([\s\S]+?)%>/g,xe=/<%([\s\S]+?)%>/g,Se=/<%=([\s\S]+?)%>/g,Ce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,we=/^\w*$/,Te=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ee=/[\\^$.*+?()[\]{}|]/g,H=RegExp(Ee.source),De=/^\s+/,Oe=/\s/,ke=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ae=/\{\n\/\* \[wrapped with (.+)\] \*/,je=/,? & /,Me=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ne=/[()=,{}\[\]\/\s]/,Pe=/\\(\\)?/g,Fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ie=/\w*$/,Le=/^[-+]0x[0-9a-f]+$/i,Re=/^0b[01]+$/i,ze=/^\[object .+?Constructor\]$/,Be=/^0o[0-7]+$/i,Ve=/^(?:0|[1-9]\d*)$/,He=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ue=/($^)/,We=/['\n\r\u2028\u2029\\]/g,Ge=`\\ud800-\\udfff`,Ke=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,qe=`\\u2700-\\u27bf`,Je=`a-z\\xdf-\\xf6\\xf8-\\xff`,Ye=`\\xac\\xb1\\xd7\\xf7`,U=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,Xe=`\\u2000-\\u206f`,Ze=` \\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`,Qe=`A-Z\\xc0-\\xd6\\xd8-\\xde`,$e=`\\ufe0e\\ufe0f`,et=Ye+U+Xe+Ze,tt=`['’]`,nt=`[`+Ge+`]`,rt=`[`+et+`]`,it=`[`+Ke+`]`,at=`\\d+`,ot=`[`+qe+`]`,st=`[`+Je+`]`,ct=`[^`+Ge+et+at+qe+Je+Qe+`]`,lt=`\\ud83c[\\udffb-\\udfff]`,ut=`(?:`+it+`|`+lt+`)`,dt=`[^`+Ge+`]`,ft=`(?:\\ud83c[\\udde6-\\uddff]){2}`,pt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,mt=`[`+Qe+`]`,ht=`\\u200d`,gt=`(?:`+st+`|`+ct+`)`,_t=`(?:`+mt+`|`+ct+`)`,vt=`(?:`+tt+`(?:d|ll|m|re|s|t|ve))?`,yt=`(?:`+tt+`(?:D|LL|M|RE|S|T|VE))?`,bt=ut+`?`,xt=`[`+$e+`]?`,St=`(?:`+ht+`(?:`+[dt,ft,pt].join(`|`)+`)`+xt+bt+`)*`,Ct=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,wt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,Tt=xt+bt+St,Et=`(?:`+[ot,ft,pt].join(`|`)+`)`+Tt,Dt=`(?:`+[dt+it+`?`,it,ft,pt,nt].join(`|`)+`)`,Ot=RegExp(tt,`g`),kt=RegExp(it,`g`),At=RegExp(lt+`(?=`+lt+`)|`+Dt+Tt,`g`),jt=RegExp([mt+`?`+st+`+`+vt+`(?=`+[rt,mt,`$`].join(`|`)+`)`,_t+`+`+yt+`(?=`+[rt,mt+gt,`$`].join(`|`)+`)`,mt+`?`+gt+`+`+vt,mt+`+`+yt,wt,Ct,at,Et].join(`|`),`g`),Mt=RegExp(`[`+ht+Ge+Ke+$e+`]`),Nt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pt=`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`.split(`.`),Ft=-1,It={};It[ae]=It[oe]=It[se]=It[V]=It[ce]=It[le]=It[ue]=It[de]=It[fe]=!0,It[S]=It[C]=It[re]=It[T]=It[ie]=It[E]=It[O]=It[k]=It[j]=It[M]=It[N]=It[I]=It[L]=It[R]=It[B]=!1;var Lt={};Lt[S]=Lt[C]=Lt[re]=Lt[ie]=Lt[T]=Lt[E]=Lt[ae]=Lt[oe]=Lt[se]=Lt[V]=Lt[ce]=Lt[j]=Lt[M]=Lt[N]=Lt[I]=Lt[L]=Lt[R]=Lt[z]=Lt[le]=Lt[ue]=Lt[de]=Lt[fe]=!0,Lt[O]=Lt[k]=Lt[B]=!1;var W={À:`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`},Rt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},zt={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},Bt={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},Vt=parseFloat,Ht=parseInt,Ut=typeof global==`object`&&global&&global.Object===Object&&global,Wt=typeof self==`object`&&self&&self.Object===Object&&self,Gt=Ut||Wt||Function(`return this`)(),Kt=typeof e==`object`&&e&&!e.nodeType&&e,qt=Kt&&typeof t==`object`&&t&&!t.nodeType&&t,Jt=qt&&qt.exports===Kt,Yt=Jt&&Ut.process,Xt=function(){try{return qt&&qt.require&&qt.require(`util`).types||Yt&&Yt.binding&&Yt.binding(`util`)}catch{}}(),Zt=Xt&&Xt.isArrayBuffer,Qt=Xt&&Xt.isDate,$t=Xt&&Xt.isMap,en=Xt&&Xt.isRegExp,tn=Xt&&Xt.isSet,nn=Xt&&Xt.isTypedArray;function G(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function rn(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function an(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function K(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function q(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function on(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function J(e,t){return!!(e!=null&&e.length)&&vn(e,t,0)>-1}function sn(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function cn(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function ln(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function un(e,t,n,r){var i=-1,a=e==null?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n}function dn(e,t,n,r){var i=e==null?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function fn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var pn=Sn(`length`);function mn(e){return e.split(``)}function hn(e){return e.match(Me)||[]}function gn(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function _n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function vn(e,t,n){return t===t?Jn(e,t,n):_n(e,bn,n)}function yn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function bn(e){return e!==e}function xn(e,t){var n=e==null?0:e.length;return n?En(e,t)/n:_}function Sn(e){return function(t){return t==null?n:t[e]}}function Cn(e){return function(t){return e==null?n:e[t]}}function wn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function Tn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function En(e,t){for(var r,i=-1,a=e.length;++i<a;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function Dn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function On(e,t){return cn(t,function(t){return[t,e[t]]})}function kn(e){return e&&e.slice(0,Qn(e)+1).replace(De,``)}function An(e){return function(t){return e(t)}}function jn(e,t){return cn(t,function(t){return e[t]})}function Mn(e,t){return e.has(t)}function Nn(e,t){for(var n=-1,r=e.length;++n<r&&vn(t,e[n],0)>-1;);return n}function Pn(e,t){for(var n=e.length;n--&&vn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var In=Cn(W),Ln=Cn(Rt);function Rn(e){return`\\`+Bt[e]}function zn(e,t){return e==null?n:e[t]}function Bn(e){return Mt.test(e)}function Vn(e){return Nt.test(e)}function Hn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Un(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Wn(e,t){return function(n){return e(t(n))}}function Gn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===a)&&(e[n]=a,o[i++]=n)}return o}function Kn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function qn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Jn(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Yn(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Xn(e){return Bn(e)?er(e):pn(e)}function Zn(e){return Bn(e)?tr(e):mn(e)}function Qn(e){for(var t=e.length;t--&&Oe.test(e.charAt(t)););return t}var $n=Cn(zt);function er(e){for(var t=At.lastIndex=0;At.test(e);)++t;return t}function tr(e){return e.match(At)||[]}function nr(e){return e.match(jt)||[]}var rr=(function e(t){t=t==null?Gt:rr.defaults(Gt.Object(),t,rr.pick(Gt,Pt));var Oe=t.Array,Me=t.Date,Ge=t.Error,Ke=t.Function,qe=t.Math,Je=t.Object,Ye=t.RegExp,U=t.String,Xe=t.TypeError,Ze=Oe.prototype,Qe=Ke.prototype,$e=Je.prototype,et=t[`__core-js_shared__`],tt=Qe.toString,nt=$e.hasOwnProperty,rt=0,it=function(){var e=/[^.]+$/.exec(et&&et.keys&&et.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),at=$e.toString,ot=tt.call(Je),st=Gt._,ct=Ye(`^`+tt.call(nt).replace(Ee,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),lt=Jt?t.Buffer:n,ut=t.Symbol,dt=t.Uint8Array,ft=lt?lt.allocUnsafe:n,pt=Wn(Je.getPrototypeOf,Je),mt=Je.create,ht=$e.propertyIsEnumerable,gt=Ze.splice,_t=ut?ut.isConcatSpreadable:n,vt=ut?ut.iterator:n,yt=ut?ut.toStringTag:n,bt=function(){try{var e=Oo(Je,`defineProperty`);return e({},``,{}),e}catch{}}(),xt=t.clearTimeout!==Gt.clearTimeout&&t.clearTimeout,St=Me&&Me.now!==Gt.Date.now&&Me.now,Ct=t.setTimeout!==Gt.setTimeout&&t.setTimeout,wt=qe.ceil,Tt=qe.floor,Et=Je.getOwnPropertySymbols,Dt=lt?lt.isBuffer:n,At=t.isFinite,jt=Ze.join,Mt=Wn(Je.keys,Je),Nt=qe.max,W=qe.min,Rt=Me.now,zt=t.parseInt,Bt=qe.random,Ut=Ze.reverse,Wt=Oo(t,`DataView`),Kt=Oo(t,`Map`),qt=Oo(t,`Promise`),Yt=Oo(t,`Set`),Xt=Oo(t,`WeakMap`),pn=Oo(Je,`create`),mn=Xt&&new Xt,Cn={},Jn=ps(Wt),er=ps(Kt),tr=ps(qt),ir=ps(Yt),ar=ps(Xt),or=ut?ut.prototype:n,sr=or?or.valueOf:n,cr=or?or.toString:n;function Y(e){if(ou(e)&&!Ul(e)&&!(e instanceof fr)){if(e instanceof dr)return e;if(nt.call(e,`__wrapped__`))return hs(e)}return new dr(e)}var lr=function(){function e(){}return function(t){if(!au(t))return{};if(mt)return mt(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function ur(){}function dr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}Y.templateSettings={escape:be,evaluate:xe,interpolate:Se,variable:``,imports:{_:Y}},Y.prototype=ur.prototype,Y.prototype.constructor=Y,dr.prototype=lr(ur.prototype),dr.prototype.constructor=dr;function fr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function pr(){var e=new fr(this.__wrapped__);return e.__actions__=za(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=za(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=za(this.__views__),e}function mr(){if(this.__filtered__){var e=new fr(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function hr(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ul(e),r=t<0,i=n?e.length:0,a=No(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=r?s:o-1,u=this.__iteratees__,d=u.length,f=0,p=W(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return ba(e,this.__actions__);var m=[];outer:for(;c--&&f<p;){l+=t;for(var h=-1,g=e[l];++h<d;){var _=u[h],v=_.iteratee,y=_.type,b=v(g);if(y==2)g=b;else if(!b){if(y==1)continue outer;break outer}}m[f++]=g}return m}fr.prototype=lr(ur.prototype),fr.prototype.constructor=fr;function gr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _r(){this.__data__=pn?pn(null):{},this.size=0}function vr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function yr(e){var t=this.__data__;if(pn){var r=t[e];return r===i?n:r}return nt.call(t,e)?t[e]:n}function br(e){var t=this.__data__;return pn?t[e]!==n:nt.call(t,e)}function xr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=pn&&t===n?i:t,this}gr.prototype.clear=_r,gr.prototype.delete=vr,gr.prototype.get=yr,gr.prototype.has=br,gr.prototype.set=xr;function Sr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Cr(){this.__data__=[],this.size=0}function wr(e){var t=this.__data__,n=Yr(t,e);return n<0?!1:(n==t.length-1?t.pop():gt.call(t,n,1),--this.size,!0)}function Tr(e){var t=this.__data__,r=Yr(t,e);return r<0?n:t[r][1]}function Er(e){return Yr(this.__data__,e)>-1}function Dr(e,t){var n=this.__data__,r=Yr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}Sr.prototype.clear=Cr,Sr.prototype.delete=wr,Sr.prototype.get=Tr,Sr.prototype.has=Er,Sr.prototype.set=Dr;function Or(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function kr(){this.size=0,this.__data__={hash:new gr,map:new(Kt||Sr),string:new gr}}function Ar(e){var t=Eo(this,e).delete(e);return this.size-=+!!t,t}function jr(e){return Eo(this,e).get(e)}function Mr(e){return Eo(this,e).has(e)}function Nr(e,t){var n=Eo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}Or.prototype.clear=kr,Or.prototype.delete=Ar,Or.prototype.get=jr,Or.prototype.has=Mr,Or.prototype.set=Nr;function Pr(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Or;++t<n;)this.add(e[t])}function Fr(e){return this.__data__.set(e,i),this}function Ir(e){return this.__data__.has(e)}Pr.prototype.add=Pr.prototype.push=Fr,Pr.prototype.has=Ir;function Lr(e){var t=this.__data__=new Sr(e);this.size=t.size}function Rr(){this.__data__=new Sr,this.size=0}function zr(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Br(e){return this.__data__.get(e)}function Vr(e){return this.__data__.has(e)}function Hr(e,t){var n=this.__data__;if(n instanceof Sr){var r=n.__data__;if(!Kt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Or(r)}return n.set(e,t),this.size=n.size,this}Lr.prototype.clear=Rr,Lr.prototype.delete=zr,Lr.prototype.get=Br,Lr.prototype.has=Vr,Lr.prototype.set=Hr;function Ur(e,t){var n=Ul(e),r=!n&&Hl(e),i=!n&&!r&&Jl(e),a=!n&&!r&&!i&&xu(e),o=n||r||i||a,s=o?Dn(e.length,U):[],c=s.length;for(var l in e)(t||nt.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Vo(l,c)))&&s.push(l);return s}function Wr(e){var t=e.length;return t?e[$i(0,t-1)]:n}function Gr(e,t){return us(za(e),ti(t,0,e.length))}function Kr(e){return us(za(e))}function qr(e,t,r){(r!==n&&!zl(e[t],r)||r===n&&!(t in e))&&$r(e,t,r)}function Jr(e,t,r){var i=e[t];(!(nt.call(e,t)&&zl(i,r))||r===n&&!(t in e))&&$r(e,t,r)}function Yr(e,t){for(var n=e.length;n--;)if(zl(e[n][0],t))return n;return-1}function Xr(e,t,n,r){return si(e,function(e,i,a){t(r,e,n(e),a)}),r}function Zr(e,t){return e&&Ba(t,rd(t),e)}function Qr(e,t){return e&&Ba(t,id(t),e)}function $r(e,t,n){t==`__proto__`&&bt?bt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ei(e,t){for(var r=-1,i=t.length,a=Oe(i),o=e==null;++r<i;)a[r]=o?n:Zu(e,t[r]);return a}function ti(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function ni(e,t,r,i,a,o){var s,c=t&1,l=t&2,u=t&4;if(r&&(s=a?r(e,i,a,o):r(e)),s!==n)return s;if(!au(e))return e;var d=Ul(e);if(d){if(s=Io(e),!c)return za(e,s)}else{var f=Mo(e),p=f==k||f==A;if(Jl(e))return ka(e,c);if(f==N||f==S||p&&!a){if(s=l||p?{}:Lo(e),!c)return l?Ha(e,Qr(s,e)):Va(e,Zr(s,e))}else{if(!Lt[f])return a?e:{};s=Ro(e,f,c)}}o||=new Lr;var m=o.get(e);if(m)return m;o.set(e,s),vu(e)?e.forEach(function(n){s.add(ni(n,t,r,n,e,o))}):su(e)&&e.forEach(function(n,i){s.set(i,ni(n,t,r,i,e,o))});var h=d?n:(u?l?So:xo:l?id:rd)(e);return an(h||e,function(n,i){h&&(i=n,n=e[i]),Jr(s,i,ni(n,t,r,i,e,o))}),s}function ri(e){var t=rd(e);return function(n){return ii(n,e,t)}}function ii(e,t,r){var i=r.length;if(e==null)return!i;for(e=Je(e);i--;){var a=r[i],o=t[a],s=e[a];if(s===n&&!(a in e)||!o(s))return!1}return!0}function ai(e,t,i){if(typeof e!=`function`)throw new Xe(r);return os(function(){e.apply(n,i)},t)}function oi(e,t,n,r){var i=-1,a=J,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=cn(t,An(n))),r?(a=sn,o=!1):t.length>=200&&(a=Mn,o=!1,t=new Pr(t));outer:for(;++i<s;){var u=e[i],d=n==null?u:n(u);if(u=r||u!==0?u:0,o&&d===d){for(var f=l;f--;)if(t[f]===d)continue outer;c.push(u)}else a(t,d,r)||c.push(u)}return c}var si=Ga(hi),ci=Ga(gi,!0);function li(e,t){var n=!0;return si(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function ui(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===n?s===s&&!bu(s):r(s,c)))var c=s,l=o}return l}function di(e,t,r,i){var a=e.length;for(r=ku(r),r<0&&(r=-r>a?0:a+r),i=i===n||i>a?a:ku(i),i<0&&(i+=a),i=r>i?0:Au(i);r<i;)e[r++]=t;return e}function X(e,t){var n=[];return si(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function fi(e,t,n,r,i){var a=-1,o=e.length;for(n||=Bo,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?fi(s,t-1,n,r,i):ln(i,s):r||(i[i.length]=s)}return i}var pi=Ka(),mi=Ka(!0);function hi(e,t){return e&&pi(e,t,rd)}function gi(e,t){return e&&mi(e,t,rd)}function _i(e,t){return on(t,function(t){return nu(e[t])})}function vi(e,t){t=Ta(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[fs(t[r++])];return r&&r==i?e:n}function yi(e,t,n){var r=t(e);return Ul(e)?r:ln(r,n(e))}function bi(e){return e==null?e===n?te:ee:yt&&yt in Je(e)?ko(e):es(e)}function xi(e,t){return e>t}function Si(e,t){return e!=null&&nt.call(e,t)}function Ci(e,t){return e!=null&&t in Je(e)}function wi(e,t,n){return e>=W(t,n)&&e<Nt(t,n)}function Ti(e,t,r){for(var i=r?sn:J,a=e[0].length,o=e.length,s=o,c=Oe(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=cn(d,An(t))),l=W(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new Pr(s&&d):n}d=e[0];var f=-1,p=c[0];outer:for(;++f<a&&u.length<l;){var m=d[f],h=t?t(m):m;if(m=r||m!==0?m:0,!(p?Mn(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?Mn(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function Ei(e,t,n,r){return hi(e,function(e,i,a){t(r,n(e),i,a)}),r}function Di(e,t,r){t=Ta(t,e),e=ns(e,t);var i=e==null?e:e[fs(Bs(t))];return i==null?n:G(i,e,r)}function Oi(e){return ou(e)&&bi(e)==S}function ki(e){return ou(e)&&bi(e)==re}function Ai(e){return ou(e)&&bi(e)==E}function ji(e,t,n,r,i){return e===t?!0:e==null||t==null||!ou(e)&&!ou(t)?e!==e&&t!==t:Mi(e,t,n,r,ji,i)}function Mi(e,t,n,r,i,a){var o=Ul(e),s=Ul(t),c=o?C:Mo(e),l=s?C:Mo(t);c=c==S?N:c,l=l==S?N:l;var u=c==N,d=l==N,f=c==l;if(f&&Jl(e)){if(!Jl(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Lr,o||xu(e)?_o(e,t,n,r,i,a):vo(e,t,c,n,r,i,a);if(!(n&1)){var p=u&&nt.call(e,`__wrapped__`),m=d&&nt.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Lr,i(h,g,n,r,a)}}return f?(a||=new Lr,yo(e,t,n,r,i,a)):!1}function Ni(e){return ou(e)&&Mo(e)==j}function Pi(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=Je(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=r[a];var l=c[0],u=e[l],d=c[1];if(s&&c[2]){if(u===n&&!(l in e))return!1}else{var f=new Lr;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?ji(d,u,3,i,f):p))return!1}}return!0}function Fi(e){return!au(e)||Ko(e)?!1:(nu(e)?ct:ze).test(ps(e))}function Ii(e){return ou(e)&&bi(e)==I}function Z(e){return ou(e)&&Mo(e)==L}function Q(e){return ou(e)&&iu(e.length)&&!!It[bi(e)]}function Li(e){return typeof e==`function`?e:e==null?ff:typeof e==`object`?Ul(e)?Ui(e[0],e[1]):Hi(e):Tf(e)}function Ri(e){if(!Jo(e))return Mt(e);var t=[];for(var n in Je(e))nt.call(e,n)&&n!=`constructor`&&t.push(n);return t}function zi(e){if(!au(e))return $o(e);var t=Jo(e),n=[];for(var r in e)r==`constructor`&&(t||!nt.call(e,r))||n.push(r);return n}function Bi(e,t){return e<t}function Vi(e,t){var n=-1,r=Gl(e)?Oe(e.length):[];return si(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Hi(e){var t=Do(e);return t.length==1&&t[0][2]?Xo(t[0][0],t[0][1]):function(n){return n===e||Pi(n,e,t)}}function Ui(e,t){return Uo(e)&&Yo(t)?Xo(fs(e),t):function(r){var i=Zu(r,e);return i===n&&i===t?$u(r,e):ji(t,i,3)}}function Wi(e,t,r,i,a){e!==t&&pi(t,function(o,s){if(a||=new Lr,au(o))Gi(e,t,s,r,Wi,i,a);else{var c=i?i(is(e,s),o,s+``,e,t,a):n;c===n&&(c=o),qr(e,s,c)}},id)}function Gi(e,t,r,i,a,o,s){var c=is(e,r),l=is(t,r),u=s.get(l);if(u){qr(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=Ul(l),m=!p&&Jl(l),h=!p&&!m&&xu(l);d=l,p||m||h?Ul(c)?d=c:Kl(c)?d=za(c):m?(f=!1,d=ka(l,!0)):h?(f=!1,d=Pa(l,!0)):d=[]:hu(l)||Hl(l)?(d=c,Hl(c)?d=Mu(c):(!au(c)||nu(c))&&(d=Lo(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),qr(e,r,d)}function Ki(e,t){var r=e.length;if(r)return t+=t<0?r:0,Vo(t,r)?e[t]:n}function qi(e,t,n){t=t.length?cn(t,function(e){return Ul(e)?function(t){return vi(t,e.length===1?e[0]:e)}:e}):[ff];var r=-1;return t=cn(t,An($())),Tn(Vi(e,function(e,n,i){return{criteria:cn(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return Ia(e,t,n)})}function Ji(e,t){return Yi(e,t,function(t,n){return $u(e,n)})}function Yi(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=vi(e,o);n(s,o)&&aa(a,Ta(o,e),s)}return a}function Xi(e){return function(t){return vi(t,e)}}function Zi(e,t,n,r){var i=r?yn:vn,a=-1,o=t.length,s=e;for(e===t&&(t=za(t)),n&&(s=cn(e,An(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&>.call(s,c,1),gt.call(e,c,1);return e}function Qi(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==a){var a=i;Vo(i)?gt.call(e,i,1):_a(e,i)}}return e}function $i(e,t){return e+Tt(Bt()*(t-e+1))}function ea(e,t,n,r){for(var i=-1,a=Nt(wt((t-e)/(n||1)),0),o=Oe(a);a--;)o[r?a:++i]=e,e+=n;return o}function ta(e,t){var n=``;if(!e||t<1||t>g)return n;do t%2&&(n+=e),t=Tt(t/2),t&&(e+=e);while(t);return n}function na(e,t){return ss(ts(e,t,ff),e+``)}function ra(e){return Wr(Sd(e))}function ia(e,t){var n=Sd(e);return us(n,ti(t,0,n.length))}function aa(e,t,r,i){if(!au(e))return e;t=Ta(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=fs(t[a]),u=r;if(l===`__proto__`||l===`constructor`||l===`prototype`)return e;if(a!=s){var d=c[l];u=i?i(d,l,c):n,u===n&&(u=au(d)?d:Vo(t[a+1])?[]:{})}Jr(c,l,u),c=c[l]}return e}var oa=mn?function(e,t){return mn.set(e,t),e}:ff,sa=bt?function(e,t){return bt(e,`toString`,{configurable:!0,enumerable:!1,value:cf(t),writable:!0})}:ff;function ca(e){return us(Sd(e))}function la(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Oe(i);++r<i;)a[r]=e[r+t];return a}function ua(e,t){var n;return si(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function da(e,t,n){var r=0,i=e==null?r:e.length;if(typeof t==`number`&&t===t&&i<=b){for(;r<i;){var a=r+i>>>1,o=e[a];o!==null&&!bu(o)&&(n?o<=t:o<t)?r=a+1:i=a}return i}return fa(e,t,ff,n)}function fa(e,t,r,i){var a=0,o=e==null?0:e.length;if(o===0)return 0;t=r(t);for(var s=t!==t,c=t===null,l=bu(t),u=t===n;a<o;){var d=Tt((a+o)/2),f=r(e[d]),p=f!==n,m=f===null,h=f===f,g=bu(f);if(s)var _=i||h;else _=u?h&&(i||p):c?h&&p&&(i||!m):l?h&&p&&!m&&(i||!g):m||g?!1:i?f<=t:f<t;_?a=d+1:o=d}return W(o,y)}function pa(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var o=e[n],s=t?t(o):o;if(!n||!zl(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function ma(e){return typeof e==`number`?e:bu(e)?_:+e}function ha(e){if(typeof e==`string`)return e;if(Ul(e))return cn(e,ha)+``;if(bu(e))return cr?cr.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function ga(e,t,n){var r=-1,i=J,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=sn;else if(a>=200){var l=t?null:uo(e);if(l)return Kn(l);o=!1,i=Mn,c=new Pr}else c=t?[]:s;outer:for(;++r<a;){var u=e[r],d=t?t(u):u;if(u=n||u!==0?u:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue outer;t&&c.push(d),s.push(u)}else i(c,d,n)||(c!==s&&c.push(d),s.push(u))}return s}function _a(e,t){t=Ta(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=fs(t[n]);if(i===`__proto__`&&!nt.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=ns(e,t);return a==null||delete a[fs(Bs(t))]}function va(e,t,n,r){return aa(e,t,n(vi(e,t)),r)}function ya(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?la(e,r?0:a,r?a+1:i):la(e,r?a+1:0,r?i:a)}function ba(e,t){var n=e;return n instanceof fr&&(n=n.value()),un(t,function(e,t){return t.func.apply(t.thisArg,ln([e],t.args))},n)}function xa(e,t,n){var r=e.length;if(r<2)return r?ga(e[0]):[];for(var i=-1,a=Oe(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=oi(a[i]||o,e[s],t,n));return ga(fi(a,1),t,n)}function Sa(e,t,r){for(var i=-1,a=e.length,o=t.length,s={};++i<a;){var c=i<o?t[i]:n;r(s,e[i],c)}return s}function Ca(e){return Kl(e)?e:[]}function wa(e){return typeof e==`function`?e:ff}function Ta(e,t){return Ul(e)?e:Uo(e,t)?[e]:ds(Pu(e))}var Ea=na;function Da(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:la(e,t,r)}var Oa=xt||function(e){return Gt.clearTimeout(e)};function ka(e,t){if(t)return e.slice();var n=e.length,r=ft?ft(n):new e.constructor(n);return e.copy(r),r}function Aa(e){var t=new e.constructor(e.byteLength);return new dt(t).set(new dt(e)),t}function ja(e,t){var n=t?Aa(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Ma(e){var t=new e.constructor(e.source,Ie.exec(e));return t.lastIndex=e.lastIndex,t}function Na(e){return sr?Je(sr.call(e)):{}}function Pa(e,t){var n=t?Aa(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Fa(e,t){if(e!==t){var r=e!==n,i=e===null,a=e===e,o=bu(e),s=t!==n,c=t===null,l=t===t,u=bu(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function Ia(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Fa(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function La(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=Nt(a-o,0),u=Oe(c+l),d=!r;++s<c;)u[s]=t[s];for(;++i<o;)(d||i<a)&&(u[n[i]]=e[i]);for(;l--;)u[s++]=e[i++];return u}function Ra(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=Nt(a-s,0),d=Oe(u+l),f=!r;++i<u;)d[i]=e[i];for(var p=i;++c<l;)d[p+c]=t[c];for(;++o<s;)(f||i<a)&&(d[p+n[o]]=e[i++]);return d}function za(e,t){var n=-1,r=e.length;for(t||=Oe(r);++n<r;)t[n]=e[n];return t}function Ba(e,t,r,i){var a=!r;r||={};for(var o=-1,s=t.length;++o<s;){var c=t[o],l=i?i(r[c],e[c],c,r,e):n;l===n&&(l=e[c]),a?$r(r,c,l):Jr(r,c,l)}return r}function Va(e,t){return Ba(e,Ao(e),t)}function Ha(e,t){return Ba(e,jo(e),t)}function Ua(e,t){return function(n,r){var i=Ul(n)?rn:Xr,a=t?t():{};return i(n,e,$(r,2),a)}}function Wa(e){return na(function(t,r){var i=-1,a=r.length,o=a>1?r[a-1]:n,s=a>2?r[2]:n;for(o=e.length>3&&typeof o==`function`?(a--,o):n,s&&Ho(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=Je(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function Ga(e,t){return function(n,r){if(n==null)return n;if(!Gl(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Je(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function Ka(e){return function(t,n,r){for(var i=-1,a=Je(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}function qa(e,t,n){var r=t&o,i=Xa(e);function a(){return(this&&this!==Gt&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Ja(e){return function(t){t=Pu(t);var r=Bn(t)?Zn(t):n,i=r?r[0]:t.charAt(0),a=r?Da(r,1).join(``):t.slice(1);return i[e]()+a}}function Ya(e){return function(t){return un(nf(kd(t).replace(Ot,``)),e,``)}}function Xa(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 n=lr(e.prototype),r=e.apply(n,t);return au(r)?r:n}}function Za(e,t,r){var i=Xa(e);function a(){for(var o=arguments.length,s=Oe(o),c=o,l=To(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:Gn(s,l);return o-=u.length,o<r?co(e,t,eo,a.placeholder,n,s,u,n,n,r-o):G(this&&this!==Gt&&this instanceof a?i:e,this,s)}return a}function Qa(e){return function(t,r,i){var a=Je(t);if(!Gl(t)){var o=$(r,3);t=rd(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,i);return s>-1?a[o?t[s]:s]:n}}function $a(e){return bo(function(t){var i=t.length,a=i,o=dr.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!=`function`)throw new Xe(r);if(o&&!l&&wo(s)==`wrapper`)var l=new dr([],!0)}for(a=l?a:i;++a<i;){s=t[a];var d=wo(s),m=d==`wrapper`?Co(s):n;l=m&&Go(m[0])&&m[1]==(f|c|u|p)&&!m[4].length&&m[9]==1?l[wo(m[0])].apply(l,m[3]):s.length==1&&Go(s)?l[d]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&e.length==1&&Ul(n))return l.plant(n).value();for(var r=0,a=i?t[r].apply(this,e):n;++r<i;)a=t[r].call(this,a);return a}})}function eo(e,t,r,i,a,u,d,p,h,g){var _=t&f,v=t&o,y=t&s,b=t&(c|l),x=t&m,S=y?n:Xa(e);function C(){for(var n=arguments.length,o=Oe(n),s=n;s--;)o[s]=arguments[s];if(b)var c=To(C),l=Fn(o,c);if(i&&(o=La(o,i,a,b)),u&&(o=Ra(o,u,d,b)),n-=l,b&&n<g){var f=Gn(o,c);return co(e,t,eo,C.placeholder,r,o,f,p,h,g-n)}var m=v?r:this,w=y?m[e]:e;return n=o.length,p?o=rs(o,p):x&&n>1&&o.reverse(),_&&h<n&&(o.length=h),this&&this!==Gt&&this instanceof C&&(w=S||Xa(w)),w.apply(m,o)}return C}function to(e,t){return function(n,r){return Ei(n,e,t(r),{})}}function no(e,t){return function(r,i){var a;if(r===n&&i===n)return t;if(r!==n&&(a=r),i!==n){if(a===n)return i;typeof r==`string`||typeof i==`string`?(r=ha(r),i=ha(i)):(r=ma(r),i=ma(i)),a=e(r,i)}return a}}function ro(e){return bo(function(t){return t=cn(t,An($())),na(function(n){var r=this;return e(t,function(e){return G(e,r,n)})})})}function io(e,t){t=t===n?` `:ha(t);var r=t.length;if(r<2)return r?ta(t,e):t;var i=ta(t,wt(e/Xn(t)));return Bn(t)?Da(Zn(i),0,e).join(``):i.slice(0,e)}function ao(e,t,n,r){var i=t&o,a=Xa(e);function s(){for(var t=-1,o=arguments.length,c=-1,l=r.length,u=Oe(l+o),d=this&&this!==Gt&&this instanceof s?a:e;++c<l;)u[c]=r[c];for(;o--;)u[c++]=arguments[++t];return G(d,i?n:this,u)}return s}function oo(e){return function(t,r,i){return i&&typeof i!=`number`&&Ho(t,r,i)&&(r=i=n),t=Ou(t),r===n?(r=t,t=0):r=Ou(r),i=i===n?t<r?1:-1:Ou(i),ea(t,r,i,e)}}function so(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=ju(t),n=ju(n)),e(t,n)}}function co(e,t,r,i,a,l,f,p,m,h){var g=t&c,_=g?f:n,v=g?n:f,y=g?l:n,b=g?n:l;t|=g?u:d,t&=~(g?d:u),t&4||(t&=~(o|s));var x=[e,t,a,y,_,b,v,p,m,h],S=r.apply(n,x);return Go(e)&&as(S,x),S.placeholder=i,cs(S,e,t)}function lo(e){var t=qe[e];return function(e,n){if(e=ju(e),n=n==null?0:W(ku(n),292),n&&At(e)){var r=(Pu(e)+`e`).split(`e`);return r=(Pu(t(r[0]+`e`+(+r[1]+n)))+`e`).split(`e`),+(r[0]+`e`+(+r[1]-n))}return t(e)}}var uo=Yt&&1/Kn(new Yt([,-0]))[1]==h?function(e){return new Yt(e)}:bf;function fo(e){return function(t){var n=Mo(t);return n==j?Un(t):n==L?qn(t):On(t,e(t))}}function po(e,t,i,a,f,p,m,h){var g=t&s;if(!g&&typeof e!=`function`)throw new Xe(r);var _=a?a.length:0;if(_||(t&=~(u|d),a=f=n),m=m===n?m:Nt(ku(m),0),h=h===n?h:ku(h),_-=f?f.length:0,t&d){var v=a,y=f;a=f=n}var b=g?n:Co(e),x=[e,t,i,a,f,v,y,p,m,h];if(b&&Qo(x,b),e=x[0],t=x[1],i=x[2],a=x[3],f=x[4],h=x[9]=x[9]===n?g?0:e.length:Nt(x[9]-_,0),!h&&t&(c|l)&&(t&=~(c|l)),!t||t==o)var S=qa(e,t,i);else S=t==c||t==l?Za(e,t,h):(t==u||t==(o|u))&&!f.length?ao(e,t,i,a):eo.apply(n,x);return cs((b?oa:as)(S,x),e,t)}function mo(e,t,r,i){return e===n||zl(e,$e[r])&&!nt.call(i,r)?t:e}function ho(e,t,r,i,a,o){return au(e)&&au(t)&&(o.set(t,e),Wi(e,t,n,ho,o),o.delete(t)),e}function go(e){return hu(e)?n:e}function _o(e,t,r,i,a,o){var s=r&1,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var f=-1,p=!0,m=r&2?new Pr:n;for(o.set(e,t),o.set(t,e);++f<c;){var h=e[f],g=t[f];if(i)var _=s?i(g,h,f,t,e,o):i(h,g,f,e,t,o);if(_!==n){if(_)continue;p=!1;break}if(m){if(!fn(t,function(e,t){if(!Mn(m,t)&&(h===e||a(h,e,r,i,o)))return m.push(t)})){p=!1;break}}else if(!(h===g||a(h,g,r,i,o))){p=!1;break}}return o.delete(e),o.delete(t),p}function vo(e,t,n,r,i,a,o){switch(n){case ie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case re:return!(e.byteLength!=t.byteLength||!a(new dt(e),new dt(t)));case T:case E:case M:return zl(+e,+t);case O:return e.name==t.name&&e.message==t.message;case I:case R:return e==t+``;case j:var s=Un;case L:var c=r&1;if(s||=Kn,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=_o(s(e),s(t),r,i,a,o);return o.delete(e),u;case z:if(sr)return sr.call(e)==sr.call(t)}return!1}function yo(e,t,r,i,a,o){var s=r&1,c=xo(e),l=c.length;if(l!=xo(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:nt.call(t,d)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var h=s;++u<l;){d=c[u];var g=e[d],_=t[d];if(i)var v=s?i(_,g,d,t,e,o):i(g,_,d,e,t,o);if(!(v===n?g===_||a(g,_,r,i,o):v)){m=!1;break}h||=d==`constructor`}if(m&&!h){var y=e.constructor,b=t.constructor;y!=b&&`constructor`in e&&`constructor`in t&&!(typeof y==`function`&&y instanceof y&&typeof b==`function`&&b instanceof b)&&(m=!1)}return o.delete(e),o.delete(t),m}function bo(e){return ss(ts(e,n,ks),e+``)}function xo(e){return yi(e,rd,Ao)}function So(e){return yi(e,id,jo)}var Co=mn?function(e){return mn.get(e)}:bf;function wo(e){for(var t=e.name+``,n=Cn[t],r=nt.call(Cn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function To(e){return(nt.call(Y,`placeholder`)?Y:e).placeholder}function $(){var e=Y.iteratee||pf;return e=e===pf?Li:e,arguments.length?e(arguments[0],arguments[1]):e}function Eo(e,t){var n=e.__data__;return Wo(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Do(e){for(var t=rd(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Yo(i)]}return t}function Oo(e,t){var r=zn(e,t);return Fi(r)?r:n}function ko(e){var t=nt.call(e,yt),r=e[yt];try{e[yt]=n;var i=!0}catch{}var a=at.call(e);return i&&(t?e[yt]=r:delete e[yt]),a}var Ao=Et?function(e){return e==null?[]:(e=Je(e),on(Et(e),function(t){return ht.call(e,t)}))}:kf,jo=Et?function(e){for(var t=[];e;)ln(t,Ao(e)),e=pt(e);return t}:kf,Mo=bi;(Wt&&Mo(new Wt(new ArrayBuffer(1)))!=ie||Kt&&Mo(new Kt)!=j||qt&&Mo(qt.resolve())!=P||Yt&&Mo(new Yt)!=L||Xt&&Mo(new Xt)!=B)&&(Mo=function(e){var t=bi(e),r=t==N?e.constructor:n,i=r?ps(r):``;if(i)switch(i){case Jn:return ie;case er:return j;case tr:return P;case ir:return L;case ar:return B}return t});function No(e,t,n){for(var r=-1,i=n.length;++r<i;){var a=n[r],o=a.size;switch(a.type){case`drop`:e+=o;break;case`dropRight`:t-=o;break;case`take`:t=W(t,e+o);break;case`takeRight`:e=Nt(e,t-o);break}}return{start:e,end:t}}function Po(e){var t=e.match(Ae);return t?t[1].split(je):[]}function Fo(e,t,n){t=Ta(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=fs(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&iu(i)&&Vo(o,i)&&(Ul(e)||Hl(e)))}function Io(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&nt.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Lo(e){return typeof e.constructor==`function`&&!Jo(e)?lr(pt(e)):{}}function Ro(e,t,n){var r=e.constructor;switch(t){case re:return Aa(e);case T:case E:return new r(+e);case ie:return ja(e,n);case ae:case oe:case se:case V:case ce:case le:case ue:case de:case fe:return Pa(e,n);case j:return new r;case M:case R:return new r(e);case I:return Ma(e);case L:return new r;case z:return Na(e)}}function zo(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(ke,`{
|
|
4
|
+
/* [wrapped with `+t+`] */
|
|
5
|
+
`)}function Bo(e){return Ul(e)||Hl(e)||!!(_t&&e&&e[_t])}function Vo(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&Ve.test(e))&&e>-1&&e%1==0&&e<t}function Ho(e,t,n){if(!au(n))return!1;var r=typeof t;return(r==`number`?Gl(n)&&Vo(t,n.length):r==`string`&&t in n)?zl(n[t],e):!1}function Uo(e,t){if(Ul(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||bu(e)?!0:we.test(e)||!Ce.test(e)||t!=null&&e in Je(t)}function Wo(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Go(e){var t=wo(e),n=Y[t];if(typeof n!=`function`||!(t in fr.prototype))return!1;if(e===n)return!0;var r=Co(n);return!!r&&e===r[0]}function Ko(e){return!!it&&it in e}var qo=et?nu:Af;function Jo(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||$e)}function Yo(e){return e===e&&!au(e)}function Xo(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in Je(r))}}function Zo(e){var t=xl(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function Qo(e,t){var n=e[1],r=t[1],i=n|r,l=i<(o|s|f),u=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&t[7].length<=t[8]&&n==c;if(!(l||u))return e;r&o&&(e[2]=t[2],i|=n&o?0:4);var d=t[3];if(d){var m=e[3];e[3]=m?La(m,d,t[4]):d,e[4]=m?Gn(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?Ra(m,d,t[6]):d,e[6]=m?Gn(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:W(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function $o(e){var t=[];if(e!=null)for(var n in Je(e))t.push(n);return t}function es(e){return at.call(e)}function ts(e,t,r){return t=Nt(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Nt(n.length-t,0),o=Oe(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Oe(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),G(e,this,s)}}function ns(e,t){return t.length<2?e:vi(e,la(t,0,-1))}function rs(e,t){for(var r=e.length,i=W(t.length,r),a=za(e);i--;){var o=t[i];e[i]=Vo(o,r)?a[o]:n}return e}function is(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var as=ls(oa),os=Ct||function(e,t){return Gt.setTimeout(e,t)},ss=ls(sa);function cs(e,t,n){var r=t+``;return ss(e,zo(r,ms(Po(r),n)))}function ls(e){var t=0,r=0;return function(){var i=Rt(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function us(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=$i(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var ds=Zo(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Te,function(e,n,r,i){t.push(r?i.replace(Pe,`$1`):n||e)}),t});function fs(e){if(typeof e==`string`||bu(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function ps(e){if(e!=null){try{return tt.call(e)}catch{}try{return e+``}catch{}}return``}function ms(e,t){return an(x,function(n){var r=`_.`+n[0];t&n[1]&&!J(e,r)&&e.push(r)}),e.sort()}function hs(e){if(e instanceof fr)return e.clone();var t=new dr(e.__wrapped__,e.__chain__);return t.__actions__=za(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function gs(e,t,r){t=(r?Ho(e,t,r):t===n)?1:Nt(ku(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=Oe(wt(i/t));a<i;)s[o++]=la(e,a,a+=t);return s}function _s(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function vs(){var e=arguments.length;if(!e)return[];for(var t=Oe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return ln(Ul(n)?za(n):[n],fi(t,1))}var ys=na(function(e,t){return Kl(e)?oi(e,fi(t,1,Kl,!0)):[]}),bs=na(function(e,t){var r=Bs(t);return Kl(r)&&(r=n),Kl(e)?oi(e,fi(t,1,Kl,!0),$(r,2)):[]}),xs=na(function(e,t){var r=Bs(t);return Kl(r)&&(r=n),Kl(e)?oi(e,fi(t,1,Kl,!0),n,r):[]});function Ss(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),la(e,t<0?0:t,i)):[]}function Cs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),t=i-t,la(e,0,t<0?0:t)):[]}function ws(e,t){return e&&e.length?ya(e,$(t,3),!0,!0):[]}function Ts(e,t){return e&&e.length?ya(e,$(t,3),!0):[]}function Es(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&Ho(e,t,n)&&(n=0,r=i),di(e,t,n,r)):[]}function Ds(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ku(n);return i<0&&(i=Nt(r+i,0)),_n(e,$(t,3),i)}function Os(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=ku(r),a=r<0?Nt(i+a,0):W(a,i-1)),_n(e,$(t,3),a,!0)}function ks(e){return e!=null&&e.length?fi(e,1):[]}function As(e){return e!=null&&e.length?fi(e,h):[]}function js(e,t){return e!=null&&e.length?(t=t===n?1:ku(t),fi(e,t)):[]}function Ms(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];$r(r,i[0],i[1])}return r}function Ns(e){return e&&e.length?e[0]:n}function Ps(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:ku(n);return i<0&&(i=Nt(r+i,0)),vn(e,t,i)}function Fs(e){return e!=null&&e.length?la(e,0,-1):[]}var Is=na(function(e){var t=cn(e,Ca);return t.length&&t[0]===e[0]?Ti(t):[]}),Ls=na(function(e){var t=Bs(e),r=cn(e,Ca);return t===Bs(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Ti(r,$(t,2)):[]}),Rs=na(function(e){var t=Bs(e),r=cn(e,Ca);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?Ti(r,n,t):[]});function zs(e,t){return e==null?``:jt.call(e,t)}function Bs(e){var t=e==null?0:e.length;return t?e[t-1]:n}function Vs(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i;return r!==n&&(a=ku(r),a=a<0?Nt(i+a,0):W(a,i-1)),t===t?Yn(e,t,a):_n(e,bn,a,!0)}function Hs(e,t){return e&&e.length?Ki(e,ku(t)):n}var Us=na(Ws);function Ws(e,t){return e&&e.length&&t&&t.length?Zi(e,t):e}function Gs(e,t,n){return e&&e.length&&t&&t.length?Zi(e,t,$(n,2)):e}function Ks(e,t,r){return e&&e.length&&t&&t.length?Zi(e,t,n,r):e}var qs=bo(function(e,t){var n=e==null?0:e.length,r=ei(e,t);return Qi(e,cn(t,function(e){return Vo(e,n)?+e:e}).sort(Fa)),r});function Js(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=$(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return Qi(e,i),n}function Ys(e){return e==null?e:Ut.call(e)}function Xs(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&Ho(e,t,r)?(t=0,r=i):(t=t==null?0:ku(t),r=r===n?i:ku(r)),la(e,t,r)):[]}function Zs(e,t){return da(e,t)}function Qs(e,t,n){return fa(e,t,$(n,2))}function $s(e,t){var n=e==null?0:e.length;if(n){var r=da(e,t);if(r<n&&zl(e[r],t))return r}return-1}function ec(e,t){return da(e,t,!0)}function tc(e,t,n){return fa(e,t,$(n,2),!0)}function nc(e,t){if(e!=null&&e.length){var n=da(e,t,!0)-1;if(zl(e[n],t))return n}return-1}function rc(e){return e&&e.length?pa(e):[]}function ic(e,t){return e&&e.length?pa(e,$(t,2)):[]}function ac(e){var t=e==null?0:e.length;return t?la(e,1,t):[]}function oc(e,t,r){return e&&e.length?(t=r||t===n?1:ku(t),la(e,0,t<0?0:t)):[]}function sc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),t=i-t,la(e,t<0?0:t,i)):[]}function cc(e,t){return e&&e.length?ya(e,$(t,3),!1,!0):[]}function lc(e,t){return e&&e.length?ya(e,$(t,3)):[]}var uc=na(function(e){return ga(fi(e,1,Kl,!0))}),dc=na(function(e){var t=Bs(e);return Kl(t)&&(t=n),ga(fi(e,1,Kl,!0),$(t,2))}),fc=na(function(e){var t=Bs(e);return t=typeof t==`function`?t:n,ga(fi(e,1,Kl,!0),n,t)});function pc(e){return e&&e.length?ga(e):[]}function mc(e,t){return e&&e.length?ga(e,$(t,2)):[]}function hc(e,t){return t=typeof t==`function`?t:n,e&&e.length?ga(e,n,t):[]}function gc(e){if(!(e&&e.length))return[];var t=0;return e=on(e,function(e){if(Kl(e))return t=Nt(e.length,t),!0}),Dn(t,function(t){return cn(e,Sn(t))})}function _c(e,t){if(!(e&&e.length))return[];var r=gc(e);return t==null?r:cn(r,function(e){return G(t,n,e)})}var vc=na(function(e,t){return Kl(e)?oi(e,t):[]}),yc=na(function(e){return xa(on(e,Kl))}),bc=na(function(e){var t=Bs(e);return Kl(t)&&(t=n),xa(on(e,Kl),$(t,2))}),xc=na(function(e){var t=Bs(e);return t=typeof t==`function`?t:n,xa(on(e,Kl),n,t)}),Sc=na(gc);function Cc(e,t){return Sa(e||[],t||[],Jr)}function wc(e,t){return Sa(e||[],t||[],aa)}var Tc=na(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,_c(e,r)});function Ec(e){var t=Y(e);return t.__chain__=!0,t}function Dc(e,t){return t(e),e}function Oc(e,t){return t(e)}var kc=bo(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return ei(t,e)};return t>1||this.__actions__.length||!(i instanceof fr)||!Vo(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:Oc,args:[a],thisArg:n}),new dr(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function Ac(){return Ec(this)}function jc(){return new dr(this.value(),this.__chain__)}function Mc(){this.__values__===n&&(this.__values__=Du(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}}function Nc(){return this}function Pc(e){for(var t,r=this;r instanceof ur;){var i=hs(r);i.__index__=0,i.__values__=n,t?a.__wrapped__=i:t=i;var a=i;r=r.__wrapped__}return a.__wrapped__=e,t}function Fc(){var e=this.__wrapped__;if(e instanceof fr){var t=e;return this.__actions__.length&&(t=new fr(this)),t=t.reverse(),t.__actions__.push({func:Oc,args:[Ys],thisArg:n}),new dr(t,this.__chain__)}return this.thru(Ys)}function Ic(){return ba(this.__wrapped__,this.__actions__)}var Lc=Ua(function(e,t,n){nt.call(e,n)?++e[n]:$r(e,n,1)});function Rc(e,t,r){var i=Ul(e)?q:li;return r&&Ho(e,t,r)&&(t=n),i(e,$(t,3))}function zc(e,t){return(Ul(e)?on:X)(e,$(t,3))}var Bc=Qa(Ds),Vc=Qa(Os);function Hc(e,t){return fi(Zc(e,t),1)}function Uc(e,t){return fi(Zc(e,t),h)}function Wc(e,t,r){return r=r===n?1:ku(r),fi(Zc(e,t),r)}function Gc(e,t){return(Ul(e)?an:si)(e,$(t,3))}function Kc(e,t){return(Ul(e)?K:ci)(e,$(t,3))}var qc=Ua(function(e,t,n){nt.call(e,n)?e[n].push(t):$r(e,n,[t])});function Jc(e,t,n,r){e=Gl(e)?e:Sd(e),n=n&&!r?ku(n):0;var i=e.length;return n<0&&(n=Nt(i+n,0)),yu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&vn(e,t,n)>-1}var Yc=na(function(e,t,n){var r=-1,i=typeof t==`function`,a=Gl(e)?Oe(e.length):[];return si(e,function(e){a[++r]=i?G(t,e,n):Di(e,t,n)}),a}),Xc=Ua(function(e,t,n){$r(e,n,t)});function Zc(e,t){return(Ul(e)?cn:Vi)(e,$(t,3))}function Qc(e,t,r,i){return e==null?[]:(Ul(t)||(t=t==null?[]:[t]),r=i?n:r,Ul(r)||(r=r==null?[]:[r]),qi(e,t,r))}var $c=Ua(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function el(e,t,n){var r=Ul(e)?un:wn,i=arguments.length<3;return r(e,$(t,4),n,i,si)}function tl(e,t,n){var r=Ul(e)?dn:wn,i=arguments.length<3;return r(e,$(t,4),n,i,ci)}function nl(e,t){return(Ul(e)?on:X)(e,Sl($(t,3)))}function rl(e){return(Ul(e)?Wr:ra)(e)}function il(e,t,r){return t=(r?Ho(e,t,r):t===n)?1:ku(t),(Ul(e)?Gr:ia)(e,t)}function al(e){return(Ul(e)?Kr:ca)(e)}function ol(e){if(e==null)return 0;if(Gl(e))return yu(e)?Xn(e):e.length;var t=Mo(e);return t==j||t==L?e.size:Ri(e).length}function sl(e,t,r){var i=Ul(e)?fn:ua;return r&&Ho(e,t,r)&&(t=n),i(e,$(t,3))}var cl=na(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ho(e,t[0],t[1])?t=[]:n>2&&Ho(t[0],t[1],t[2])&&(t=[t[0]]),qi(e,fi(t,1),[])}),ll=St||function(){return Gt.Date.now()};function ul(e,t){if(typeof t!=`function`)throw new Xe(r);return e=ku(e),function(){if(--e<1)return t.apply(this,arguments)}}function dl(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,po(e,f,n,n,n,n,t)}function fl(e,t){var i;if(typeof t!=`function`)throw new Xe(r);return e=ku(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var pl=na(function(e,t,n){var r=o;if(n.length){var i=Gn(n,To(pl));r|=u}return po(e,r,t,n,i)}),ml=na(function(e,t,n){var r=o|s;if(n.length){var i=Gn(n,To(ml));r|=u}return po(t,r,e,n,i)});function hl(e,t,r){t=r?n:t;var i=po(e,c,n,n,n,n,n,t);return i.placeholder=hl.placeholder,i}function gl(e,t,r){t=r?n:t;var i=po(e,l,n,n,n,n,n,t);return i.placeholder=gl.placeholder,i}function _l(e,t,i){var a,o,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new Xe(r);t=ju(t)||0,au(i)&&(f=!!i.leading,p=`maxWait`in i,s=p?Nt(ju(i.maxWait)||0,t):s,m=`trailing`in i?!!i.trailing:m);function h(t){var r=a,i=o;return a=o=n,d=t,c=e.apply(i,r),c}function g(e){return d=e,l=os(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?W(i,s-r):i}function v(e){var r=e-u,i=e-d;return u===n||r>=t||r<0||p&&i>=s}function y(){var e=ll();if(v(e))return b(e);l=os(y,_(e))}function b(e){return l=n,m&&a?h(e):(a=o=n,c)}function x(){l!==n&&Oa(l),d=0,a=u=o=l=n}function S(){return l===n?c:b(ll())}function C(){var e=ll(),r=v(e);if(a=arguments,o=this,u=e,r){if(l===n)return g(u);if(p)return Oa(l),l=os(y,t),h(u)}return l===n&&(l=os(y,t)),c}return C.cancel=x,C.flush=S,C}var vl=na(function(e,t){return ai(e,1,t)}),yl=na(function(e,t,n){return ai(e,ju(t)||0,n)});function bl(e){return po(e,m)}function xl(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new Xe(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(xl.Cache||Or),n}xl.Cache=Or;function Sl(e){if(typeof e!=`function`)throw new Xe(r);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 Cl(e){return fl(2,e)}var wl=Ea(function(e,t){t=t.length==1&&Ul(t[0])?cn(t[0],An($())):cn(fi(t,1),An($()));var n=t.length;return na(function(r){for(var i=-1,a=W(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return G(e,this,r)})}),Tl=na(function(e,t){return po(e,u,n,t,Gn(t,To(Tl)))}),El=na(function(e,t){return po(e,d,n,t,Gn(t,To(El)))}),Dl=bo(function(e,t){return po(e,p,n,n,n,t)});function Ol(e,t){if(typeof e!=`function`)throw new Xe(r);return t=t===n?t:ku(t),na(e,t)}function kl(e,t){if(typeof e!=`function`)throw new Xe(r);return t=t==null?0:Nt(ku(t),0),na(function(n){var r=n[t],i=Da(n,0,t);return r&&ln(i,r),G(e,this,i)})}function Al(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw new Xe(r);return au(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),_l(e,t,{leading:i,maxWait:t,trailing:a})}function jl(e){return dl(e,1)}function Ml(e,t){return Tl(wa(t),e)}function Nl(){if(!arguments.length)return[];var e=arguments[0];return Ul(e)?e:[e]}function Pl(e){return ni(e,4)}function Fl(e,t){return t=typeof t==`function`?t:n,ni(e,4,t)}function Il(e){return ni(e,5)}function Ll(e,t){return t=typeof t==`function`?t:n,ni(e,5,t)}function Rl(e,t){return t==null||ii(e,t,rd(t))}function zl(e,t){return e===t||e!==e&&t!==t}var Bl=so(xi),Vl=so(function(e,t){return e>=t}),Hl=Oi(function(){return arguments}())?Oi:function(e){return ou(e)&&nt.call(e,`callee`)&&!ht.call(e,`callee`)},Ul=Oe.isArray,Wl=Zt?An(Zt):ki;function Gl(e){return e!=null&&iu(e.length)&&!nu(e)}function Kl(e){return ou(e)&&Gl(e)}function ql(e){return e===!0||e===!1||ou(e)&&bi(e)==T}var Jl=Dt||Af,Yl=Qt?An(Qt):Ai;function Xl(e){return ou(e)&&e.nodeType===1&&!hu(e)}function Zl(e){if(e==null)return!0;if(Gl(e)&&(Ul(e)||typeof e==`string`||typeof e.splice==`function`||Jl(e)||xu(e)||Hl(e)))return!e.length;var t=Mo(e);if(t==j||t==L)return!e.size;if(Jo(e))return!Ri(e).length;for(var n in e)if(nt.call(e,n))return!1;return!0}function Ql(e,t){return ji(e,t)}function $l(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?ji(e,t,n,r):!!i}function eu(e){if(!ou(e))return!1;var t=bi(e);return t==O||t==D||typeof e.message==`string`&&typeof e.name==`string`&&!hu(e)}function tu(e){return typeof e==`number`&&At(e)}function nu(e){if(!au(e))return!1;var t=bi(e);return t==k||t==A||t==w||t==F}function ru(e){return typeof e==`number`&&e==ku(e)}function iu(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=g}function au(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function ou(e){return typeof e==`object`&&!!e}var su=$t?An($t):Ni;function cu(e,t){return e===t||Pi(e,t,Do(t))}function lu(e,t,r){return r=typeof r==`function`?r:n,Pi(e,t,Do(t),r)}function uu(e){return mu(e)&&e!=+e}function du(e){if(qo(e))throw new Ge(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Fi(e)}function fu(e){return e===null}function pu(e){return e==null}function mu(e){return typeof e==`number`||ou(e)&&bi(e)==M}function hu(e){if(!ou(e)||bi(e)!=N)return!1;var t=pt(e);if(t===null)return!0;var n=nt.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&tt.call(n)==ot}var gu=en?An(en):Ii;function _u(e){return ru(e)&&e>=-9007199254740991&&e<=g}var vu=tn?An(tn):Z;function yu(e){return typeof e==`string`||!Ul(e)&&ou(e)&&bi(e)==R}function bu(e){return typeof e==`symbol`||ou(e)&&bi(e)==z}var xu=nn?An(nn):Q;function Su(e){return e===n}function Cu(e){return ou(e)&&Mo(e)==B}function wu(e){return ou(e)&&bi(e)==ne}var Tu=so(Bi),Eu=so(function(e,t){return e<=t});function Du(e){if(!e)return[];if(Gl(e))return yu(e)?Zn(e):za(e);if(vt&&e[vt])return Hn(e[vt]());var t=Mo(e);return(t==j?Un:t==L?Kn:Sd)(e)}function Ou(e){return e?(e=ju(e),e===h||e===-1/0?(e<0?-1:1)*17976931348623157e292:e===e?e:0):e===0?e:0}function ku(e){var t=Ou(e),n=t%1;return t===t?n?t-n:t:0}function Au(e){return e?ti(ku(e),0,v):0}function ju(e){if(typeof e==`number`)return e;if(bu(e))return _;if(au(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=au(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=kn(e);var n=Re.test(e);return n||Be.test(e)?Ht(e.slice(2),n?2:8):Le.test(e)?_:+e}function Mu(e){return Ba(e,id(e))}function Nu(e){return e?ti(ku(e),-9007199254740991,g):e===0?e:0}function Pu(e){return e==null?``:ha(e)}var Fu=Wa(function(e,t){if(Jo(t)||Gl(t)){Ba(t,rd(t),e);return}for(var n in t)nt.call(t,n)&&Jr(e,n,t[n])}),Iu=Wa(function(e,t){Ba(t,id(t),e)}),Lu=Wa(function(e,t,n,r){Ba(t,id(t),e,r)}),Ru=Wa(function(e,t,n,r){Ba(t,rd(t),e,r)}),zu=bo(ei);function Bu(e,t){var n=lr(e);return t==null?n:Zr(n,t)}var Vu=na(function(e,t){e=Je(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&Ho(t[0],t[1],a)&&(i=1);++r<i;)for(var o=t[r],s=id(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===n||zl(d,$e[u])&&!nt.call(e,u))&&(e[u]=o[u])}return e}),Hu=na(function(e){return e.push(n,ho),G(cd,n,e)});function Uu(e,t){return gn(e,$(t,3),hi)}function Wu(e,t){return gn(e,$(t,3),gi)}function Gu(e,t){return e==null?e:pi(e,$(t,3),id)}function Ku(e,t){return e==null?e:mi(e,$(t,3),id)}function qu(e,t){return e&&hi(e,$(t,3))}function Ju(e,t){return e&&gi(e,$(t,3))}function Yu(e){return e==null?[]:_i(e,rd(e))}function Xu(e){return e==null?[]:_i(e,id(e))}function Zu(e,t,r){var i=e==null?n:vi(e,t);return i===n?r:i}function Qu(e,t){return e!=null&&Fo(e,t,Si)}function $u(e,t){return e!=null&&Fo(e,t,Ci)}var ed=to(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=at.call(t)),e[t]=n},cf(ff)),td=to(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=at.call(t)),nt.call(e,t)?e[t].push(n):e[t]=[n]},$),nd=na(Di);function rd(e){return Gl(e)?Ur(e):Ri(e)}function id(e){return Gl(e)?Ur(e,!0):zi(e)}function ad(e,t){var n={};return t=$(t,3),hi(e,function(e,r,i){$r(n,t(e,r,i),e)}),n}function od(e,t){var n={};return t=$(t,3),hi(e,function(e,r,i){$r(n,r,t(e,r,i))}),n}var sd=Wa(function(e,t,n){Wi(e,t,n)}),cd=Wa(function(e,t,n,r){Wi(e,t,n,r)}),ld=bo(function(e,t){var n={};if(e==null)return n;var r=!1;t=cn(t,function(t){return t=Ta(t,e),r||=t.length>1,t}),Ba(e,So(e),n),r&&(n=ni(n,7,go));for(var i=t.length;i--;)_a(n,t[i]);return n});function ud(e,t){return fd(e,Sl($(t)))}var dd=bo(function(e,t){return e==null?{}:Ji(e,t)});function fd(e,t){if(e==null)return{};var n=cn(So(e),function(e){return[e]});return t=$(t),Yi(e,n,function(e,n){return t(e,n[0])})}function pd(e,t,r){t=Ta(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[fs(t[i])];o===n&&(i=a,o=r),e=nu(o)?o.call(e):o}return e}function md(e,t,n){return e==null?e:aa(e,t,n)}function hd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:aa(e,t,r,i)}var gd=fo(rd),_d=fo(id);function vd(e,t,n){var r=Ul(e),i=r||Jl(e)||xu(e);if(t=$(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:au(e)&&nu(a)?lr(pt(e)):{}}return(i?an:hi)(e,function(e,r,i){return t(n,e,r,i)}),n}function yd(e,t){return e==null?!0:_a(e,t)}function bd(e,t,n){return e==null?e:va(e,t,wa(n))}function xd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:va(e,t,wa(r),i)}function Sd(e){return e==null?[]:jn(e,rd(e))}function Cd(e){return e==null?[]:jn(e,id(e))}function wd(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=ju(r),r=r===r?r:0),t!==n&&(t=ju(t),t=t===t?t:0),ti(ju(e),t,r)}function Td(e,t,r){return t=Ou(t),r===n?(r=t,t=0):r=Ou(r),e=ju(e),wi(e,t,r)}function Ed(e,t,r){if(r&&typeof r!=`boolean`&&Ho(e,t,r)&&(t=r=n),r===n&&(typeof t==`boolean`?(r=t,t=n):typeof e==`boolean`&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=Ou(e),t===n?(t=e,e=0):t=Ou(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var a=Bt();return W(e+a*(t-e+Vt(`1e-`+((a+``).length-1))),t)}return $i(e,t)}var Dd=Ya(function(e,t,n){return t=t.toLowerCase(),e+(n?Od(t):t)});function Od(e){return tf(Pu(e).toLowerCase())}function kd(e){return e=Pu(e),e&&e.replace(He,In).replace(kt,``)}function Ad(e,t,r){e=Pu(e),t=ha(t);var i=e.length;r=r===n?i:ti(ku(r),0,i);var a=r;return r-=t.length,r>=0&&e.slice(r,a)==t}function jd(e){return e=Pu(e),e&&ye.test(e)?e.replace(_e,Ln):e}function Md(e){return e=Pu(e),e&&H.test(e)?e.replace(Ee,`\\$&`):e}var Nd=Ya(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Pd=Ya(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),Fd=Ja(`toLowerCase`);function Id(e,t,n){e=Pu(e),t=ku(t);var r=t?Xn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return io(Tt(i),n)+e+io(wt(i),n)}function Ld(e,t,n){e=Pu(e),t=ku(t);var r=t?Xn(e):0;return t&&r<t?e+io(t-r,n):e}function Rd(e,t,n){e=Pu(e),t=ku(t);var r=t?Xn(e):0;return t&&r<t?io(t-r,n)+e:e}function zd(e,t,n){return n||t==null?t=0:t&&=+t,zt(Pu(e).replace(De,``),t||0)}function Bd(e,t,r){return t=(r?Ho(e,t,r):t===n)?1:ku(t),ta(Pu(e),t)}function Vd(){var e=arguments,t=Pu(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var Hd=Ya(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function Ud(e,t,r){return r&&typeof r!=`number`&&Ho(e,t,r)&&(t=r=n),r=r===n?v:r>>>0,r?(e=Pu(e),e&&(typeof t==`string`||t!=null&&!gu(t))&&(t=ha(t),!t&&Bn(e))?Da(Zn(e),0,r):e.split(t,r)):[]}var Wd=Ya(function(e,t,n){return e+(n?` `:``)+tf(t)});function Gd(e,t,n){return e=Pu(e),n=n==null?0:ti(ku(n),0,e.length),t=ha(t),e.slice(n,n+t.length)==t}function Kd(e,t,r){var i=Y.templateSettings;r&&Ho(e,t,r)&&(t=n),e=Pu(e),t=Ru({},t,i,mo);var a=Ru({},t.imports,i.imports,mo),o=rd(a),s=jn(a,o);an(o,function(e){if(Ne.test(e))throw new Ge("Invalid `imports` option passed into `_.template`")});var c,l,u=0,d=t.interpolate||Ue,f=`__p += '`,p=Ye((t.escape||Ue).source+`|`+d.source+`|`+(d===Se?Fe:Ue).source+`|`+(t.evaluate||Ue).source+`|$`,`g`),m=`//# sourceURL=`+(nt.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++Ft+`]`)+`
|
|
6
|
+
`;e.replace(p,function(t,n,r,i,a,o){return r||=i,f+=e.slice(u,o).replace(We,Rn),n&&(c=!0,f+=`' +
|
|
7
|
+
__e(`+n+`) +
|
|
8
|
+
'`),a&&(l=!0,f+=`';
|
|
9
|
+
`+a+`;
|
|
10
|
+
__p += '`),r&&(f+=`' +
|
|
11
|
+
((__t = (`+r+`)) == null ? '' : __t) +
|
|
12
|
+
'`),u=o+t.length,t}),f+=`';
|
|
13
|
+
`;var h=nt.call(t,`variable`)&&t.variable;if(!h)f=`with (obj) {
|
|
14
|
+
`+f+`
|
|
15
|
+
}
|
|
16
|
+
`;else if(Ne.test(h))throw new Ge("Invalid `variable` option passed into `_.template`");f=(l?f.replace(pe,``):f).replace(me,`$1`).replace(he,`$1;`),f=`function(`+(h||`obj`)+`) {
|
|
17
|
+
`+(h?``:`obj || (obj = {});
|
|
18
|
+
`)+`var __t, __p = ''`+(c?`, __e = _.escape`:``)+(l?`, __j = Array.prototype.join;
|
|
19
|
+
function print() { __p += __j.call(arguments, '') }
|
|
20
|
+
`:`;
|
|
21
|
+
`)+f+`return __p
|
|
22
|
+
}`;var g=rf(function(){return Ke(o,m+`return `+f).apply(n,s)});if(g.source=f,eu(g))throw g;return g}function qd(e){return Pu(e).toLowerCase()}function Jd(e){return Pu(e).toUpperCase()}function Yd(e,t,r){if(e=Pu(e),e&&(r||t===n))return kn(e);if(!e||!(t=ha(t)))return e;var i=Zn(e),a=Zn(t);return Da(i,Nn(i,a),Pn(i,a)+1).join(``)}function Xd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.slice(0,Qn(e)+1);if(!e||!(t=ha(t)))return e;var i=Zn(e);return Da(i,0,Pn(i,Zn(t))+1).join(``)}function Zd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.replace(De,``);if(!e||!(t=ha(t)))return e;var i=Zn(e);return Da(i,Nn(i,Zn(t))).join(``)}function Qd(e,t){var r=30,i=`...`;if(au(t)){var a=`separator`in t?t.separator:a;r=`length`in t?ku(t.length):r,i=`omission`in t?ha(t.omission):i}e=Pu(e);var o=e.length;if(Bn(e)){var s=Zn(e);o=s.length}if(r>=o)return e;var c=r-Xn(i);if(c<1)return i;var l=s?Da(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),gu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=Ye(a.source,Pu(Ie.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(ha(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function $d(e){return e=Pu(e),e&&ve.test(e)?e.replace(ge,$n):e}var ef=Ya(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),tf=Ja(`toUpperCase`);function nf(e,t,r){return e=Pu(e),t=r?n:t,t===n?Vn(e)?nr(e):hn(e):e.match(t)||[]}var rf=na(function(e,t){try{return G(e,n,t)}catch(e){return eu(e)?e:new Ge(e)}}),af=bo(function(e,t){return an(t,function(t){t=fs(t),$r(e,t,pl(e[t],e))}),e});function of(e){var t=e==null?0:e.length,n=$();return e=t?cn(e,function(e){if(typeof e[1]!=`function`)throw new Xe(r);return[n(e[0]),e[1]]}):[],na(function(n){for(var r=-1;++r<t;){var i=e[r];if(G(i[0],this,n))return G(i[1],this,n)}})}function sf(e){return ri(ni(e,1))}function cf(e){return function(){return e}}function lf(e,t){return e==null||e!==e?t:e}var uf=$a(),df=$a(!0);function ff(e){return e}function pf(e){return Li(typeof e==`function`?e:ni(e,1))}function mf(e){return Hi(ni(e,1))}function hf(e,t){return Ui(e,ni(t,1))}var gf=na(function(e,t){return function(n){return Di(n,e,t)}}),_f=na(function(e,t){return function(n){return Di(e,n,t)}});function vf(e,t,n){var r=rd(t),i=_i(t,r);n==null&&!(au(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=_i(t,rd(t)));var a=!(au(n)&&`chain`in n)||!!n.chain,o=nu(e);return an(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=za(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ln([this.value()],arguments))})}),e}function yf(){return Gt._===this&&(Gt._=st),this}function bf(){}function xf(e){return e=ku(e),na(function(t){return Ki(t,e)})}var Sf=ro(cn),Cf=ro(q),wf=ro(fn);function Tf(e){return Uo(e)?Sn(fs(e)):Xi(e)}function Ef(e){return function(t){return e==null?n:vi(e,t)}}var Df=oo(),Of=oo(!0);function kf(){return[]}function Af(){return!1}function jf(){return{}}function Mf(){return``}function Nf(){return!0}function Pf(e,t){if(e=ku(e),e<1||e>g)return[];var n=v,r=W(e,v);t=$(t),e-=v;for(var i=Dn(r,t);++n<e;)t(n);return i}function Ff(e){return Ul(e)?cn(e,fs):bu(e)?[e]:za(ds(Pu(e)))}function If(e){var t=++rt;return Pu(e)+t}var Lf=no(function(e,t){return e+t},0),Rf=lo(`ceil`),zf=no(function(e,t){return e/t},1),Bf=lo(`floor`);function Vf(e){return e&&e.length?ui(e,ff,xi):n}function Hf(e,t){return e&&e.length?ui(e,$(t,2),xi):n}function Uf(e){return xn(e,ff)}function Wf(e,t){return xn(e,$(t,2))}function Gf(e){return e&&e.length?ui(e,ff,Bi):n}function Kf(e,t){return e&&e.length?ui(e,$(t,2),Bi):n}var qf=no(function(e,t){return e*t},1),Jf=lo(`round`),Yf=no(function(e,t){return e-t},0);function Xf(e){return e&&e.length?En(e,ff):0}function Zf(e,t){return e&&e.length?En(e,$(t,2)):0}return Y.after=ul,Y.ary=dl,Y.assign=Fu,Y.assignIn=Iu,Y.assignInWith=Lu,Y.assignWith=Ru,Y.at=zu,Y.before=fl,Y.bind=pl,Y.bindAll=af,Y.bindKey=ml,Y.castArray=Nl,Y.chain=Ec,Y.chunk=gs,Y.compact=_s,Y.concat=vs,Y.cond=of,Y.conforms=sf,Y.constant=cf,Y.countBy=Lc,Y.create=Bu,Y.curry=hl,Y.curryRight=gl,Y.debounce=_l,Y.defaults=Vu,Y.defaultsDeep=Hu,Y.defer=vl,Y.delay=yl,Y.difference=ys,Y.differenceBy=bs,Y.differenceWith=xs,Y.drop=Ss,Y.dropRight=Cs,Y.dropRightWhile=ws,Y.dropWhile=Ts,Y.fill=Es,Y.filter=zc,Y.flatMap=Hc,Y.flatMapDeep=Uc,Y.flatMapDepth=Wc,Y.flatten=ks,Y.flattenDeep=As,Y.flattenDepth=js,Y.flip=bl,Y.flow=uf,Y.flowRight=df,Y.fromPairs=Ms,Y.functions=Yu,Y.functionsIn=Xu,Y.groupBy=qc,Y.initial=Fs,Y.intersection=Is,Y.intersectionBy=Ls,Y.intersectionWith=Rs,Y.invert=ed,Y.invertBy=td,Y.invokeMap=Yc,Y.iteratee=pf,Y.keyBy=Xc,Y.keys=rd,Y.keysIn=id,Y.map=Zc,Y.mapKeys=ad,Y.mapValues=od,Y.matches=mf,Y.matchesProperty=hf,Y.memoize=xl,Y.merge=sd,Y.mergeWith=cd,Y.method=gf,Y.methodOf=_f,Y.mixin=vf,Y.negate=Sl,Y.nthArg=xf,Y.omit=ld,Y.omitBy=ud,Y.once=Cl,Y.orderBy=Qc,Y.over=Sf,Y.overArgs=wl,Y.overEvery=Cf,Y.overSome=wf,Y.partial=Tl,Y.partialRight=El,Y.partition=$c,Y.pick=dd,Y.pickBy=fd,Y.property=Tf,Y.propertyOf=Ef,Y.pull=Us,Y.pullAll=Ws,Y.pullAllBy=Gs,Y.pullAllWith=Ks,Y.pullAt=qs,Y.range=Df,Y.rangeRight=Of,Y.rearg=Dl,Y.reject=nl,Y.remove=Js,Y.rest=Ol,Y.reverse=Ys,Y.sampleSize=il,Y.set=md,Y.setWith=hd,Y.shuffle=al,Y.slice=Xs,Y.sortBy=cl,Y.sortedUniq=rc,Y.sortedUniqBy=ic,Y.split=Ud,Y.spread=kl,Y.tail=ac,Y.take=oc,Y.takeRight=sc,Y.takeRightWhile=cc,Y.takeWhile=lc,Y.tap=Dc,Y.throttle=Al,Y.thru=Oc,Y.toArray=Du,Y.toPairs=gd,Y.toPairsIn=_d,Y.toPath=Ff,Y.toPlainObject=Mu,Y.transform=vd,Y.unary=jl,Y.union=uc,Y.unionBy=dc,Y.unionWith=fc,Y.uniq=pc,Y.uniqBy=mc,Y.uniqWith=hc,Y.unset=yd,Y.unzip=gc,Y.unzipWith=_c,Y.update=bd,Y.updateWith=xd,Y.values=Sd,Y.valuesIn=Cd,Y.without=vc,Y.words=nf,Y.wrap=Ml,Y.xor=yc,Y.xorBy=bc,Y.xorWith=xc,Y.zip=Sc,Y.zipObject=Cc,Y.zipObjectDeep=wc,Y.zipWith=Tc,Y.entries=gd,Y.entriesIn=_d,Y.extend=Iu,Y.extendWith=Lu,vf(Y,Y),Y.add=Lf,Y.attempt=rf,Y.camelCase=Dd,Y.capitalize=Od,Y.ceil=Rf,Y.clamp=wd,Y.clone=Pl,Y.cloneDeep=Il,Y.cloneDeepWith=Ll,Y.cloneWith=Fl,Y.conformsTo=Rl,Y.deburr=kd,Y.defaultTo=lf,Y.divide=zf,Y.endsWith=Ad,Y.eq=zl,Y.escape=jd,Y.escapeRegExp=Md,Y.every=Rc,Y.find=Bc,Y.findIndex=Ds,Y.findKey=Uu,Y.findLast=Vc,Y.findLastIndex=Os,Y.findLastKey=Wu,Y.floor=Bf,Y.forEach=Gc,Y.forEachRight=Kc,Y.forIn=Gu,Y.forInRight=Ku,Y.forOwn=qu,Y.forOwnRight=Ju,Y.get=Zu,Y.gt=Bl,Y.gte=Vl,Y.has=Qu,Y.hasIn=$u,Y.head=Ns,Y.identity=ff,Y.includes=Jc,Y.indexOf=Ps,Y.inRange=Td,Y.invoke=nd,Y.isArguments=Hl,Y.isArray=Ul,Y.isArrayBuffer=Wl,Y.isArrayLike=Gl,Y.isArrayLikeObject=Kl,Y.isBoolean=ql,Y.isBuffer=Jl,Y.isDate=Yl,Y.isElement=Xl,Y.isEmpty=Zl,Y.isEqual=Ql,Y.isEqualWith=$l,Y.isError=eu,Y.isFinite=tu,Y.isFunction=nu,Y.isInteger=ru,Y.isLength=iu,Y.isMap=su,Y.isMatch=cu,Y.isMatchWith=lu,Y.isNaN=uu,Y.isNative=du,Y.isNil=pu,Y.isNull=fu,Y.isNumber=mu,Y.isObject=au,Y.isObjectLike=ou,Y.isPlainObject=hu,Y.isRegExp=gu,Y.isSafeInteger=_u,Y.isSet=vu,Y.isString=yu,Y.isSymbol=bu,Y.isTypedArray=xu,Y.isUndefined=Su,Y.isWeakMap=Cu,Y.isWeakSet=wu,Y.join=zs,Y.kebabCase=Nd,Y.last=Bs,Y.lastIndexOf=Vs,Y.lowerCase=Pd,Y.lowerFirst=Fd,Y.lt=Tu,Y.lte=Eu,Y.max=Vf,Y.maxBy=Hf,Y.mean=Uf,Y.meanBy=Wf,Y.min=Gf,Y.minBy=Kf,Y.stubArray=kf,Y.stubFalse=Af,Y.stubObject=jf,Y.stubString=Mf,Y.stubTrue=Nf,Y.multiply=qf,Y.nth=Hs,Y.noConflict=yf,Y.noop=bf,Y.now=ll,Y.pad=Id,Y.padEnd=Ld,Y.padStart=Rd,Y.parseInt=zd,Y.random=Ed,Y.reduce=el,Y.reduceRight=tl,Y.repeat=Bd,Y.replace=Vd,Y.result=pd,Y.round=Jf,Y.runInContext=e,Y.sample=rl,Y.size=ol,Y.snakeCase=Hd,Y.some=sl,Y.sortedIndex=Zs,Y.sortedIndexBy=Qs,Y.sortedIndexOf=$s,Y.sortedLastIndex=ec,Y.sortedLastIndexBy=tc,Y.sortedLastIndexOf=nc,Y.startCase=Wd,Y.startsWith=Gd,Y.subtract=Yf,Y.sum=Xf,Y.sumBy=Zf,Y.template=Kd,Y.times=Pf,Y.toFinite=Ou,Y.toInteger=ku,Y.toLength=Au,Y.toLower=qd,Y.toNumber=ju,Y.toSafeInteger=Nu,Y.toString=Pu,Y.toUpper=Jd,Y.trim=Yd,Y.trimEnd=Xd,Y.trimStart=Zd,Y.truncate=Qd,Y.unescape=$d,Y.uniqueId=If,Y.upperCase=ef,Y.upperFirst=tf,Y.each=Gc,Y.eachRight=Kc,Y.first=Ns,vf(Y,function(){var e={};return hi(Y,function(t,n){nt.call(Y.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),Y.VERSION=`4.18.1`,an([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){Y[e].placeholder=Y}),an([`drop`,`take`],function(e,t){fr.prototype[e]=function(r){r=r===n?1:Nt(ku(r),0);var i=this.__filtered__&&!t?new fr(this):this.clone();return i.__filtered__?i.__takeCount__=W(r,i.__takeCount__):i.__views__.push({size:W(r,v),type:e+(i.__dir__<0?`Right`:``)}),i},fr.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),an([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;fr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:$(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),an([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);fr.prototype[e]=function(){return this[n](1).value()[0]}}),an([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);fr.prototype[e]=function(){return this.__filtered__?new fr(this):this[n](1)}}),fr.prototype.compact=function(){return this.filter(ff)},fr.prototype.find=function(e){return this.filter(e).head()},fr.prototype.findLast=function(e){return this.reverse().find(e)},fr.prototype.invokeMap=na(function(e,t){return typeof e==`function`?new fr(this):this.map(function(n){return Di(n,e,t)})}),fr.prototype.reject=function(e){return this.filter(Sl($(e)))},fr.prototype.slice=function(e,t){e=ku(e);var r=this;return r.__filtered__&&(e>0||t<0)?new fr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(t=ku(t),r=t<0?r.dropRight(-t):r.take(t-e)),r)},fr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},fr.prototype.toArray=function(){return this.take(v)},hi(fr.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=Y[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(Y.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof fr,l=s[0],u=c||Ul(t),d=function(e){var t=a.apply(Y,ln([e],s));return i&&f?t[0]:t};u&&r&&typeof l==`function`&&l.length!=1&&(c=u=!1);var f=this.__chain__,p=!!this.__actions__.length,m=o&&!f,h=c&&!p;if(!o&&u){t=h?t:new fr(this);var g=e.apply(t,s);return g.__actions__.push({func:Oc,args:[d],thisArg:n}),new dr(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),an([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=Ze[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);Y.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ul(i)?i:[],e)}return this[n](function(n){return t.apply(Ul(n)?n:[],e)})}}),hi(fr.prototype,function(e,t){var n=Y[t];if(n){var r=n.name+``;nt.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:t,func:n})}}),Cn[eo(n,s).name]=[{name:`wrapper`,func:n}],fr.prototype.clone=pr,fr.prototype.reverse=mr,fr.prototype.value=hr,Y.prototype.at=kc,Y.prototype.chain=Ac,Y.prototype.commit=jc,Y.prototype.next=Mc,Y.prototype.plant=Pc,Y.prototype.reverse=Fc,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=Ic,Y.prototype.first=Y.prototype.head,vt&&(Y.prototype[vt]=Nc),Y})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(Gt._=rr,define(function(){return rr})):qt?((qt.exports=rr)._=rr,Kt._=rr):Gt._=rr}).call(e)})),Cs=n(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),ws=n(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=Cs(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),Ts=n(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=!1),t}function o(){try{return localStorage}catch{}}t.exports=ws()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),Es=n(((e,t)=>{var n=Ss(),r=Ts()(`mongo-knex:converter`),i=Ts()(`mongo-knex:converter-extended`),a=[`$and`,`$or`],o={$eq:`=`,$ne:`!=`,$gt:`>`,$gte:`>=`,$lt:`<`,$lte:`<=`,$in:`in`,$nin:`not in`,$regex:`like`,$not:`not like`},s={$eq:`$ne`,$ne:`$eq`,$gt:`$lte`,$gte:`$lt`,$lt:`$gte`,$lte:`$gt`,$in:`$nin`,$nin:`$in`},c={count:`count(??)`,countDistinct:`count(distinct ??)`,sum:`sum(??)`},l=`*`,u=e=>e.charAt(0)===`$`,d=e=>u(e)&&n.includes(a,e),f=e=>u(e)&&n.includes(n.keys(o),e),p=e=>u(e)&&n.includes([`$ne`,`$nin`],e),m=e=>u(e)&&n.includes([`$gt`,`$gte`,`$lt`,`$lte`],e),h=e=>n.includes([o.$in,o.$nin],e),g=e=>!!s[e],_=e=>n.isNumber(e)&&Number.isFinite(e)||n.isString(e)&&e.trim()!==``&&Number.isFinite(Number(e)),v=(e,t)=>(e===`$in`||e===`$nin`)&&n.isArray(t)?n.every(t,_):_(t),y=e=>Error(`Aggregate relation "${e}" only supports ${Object.keys(s).join(`, `)} comparisons with numeric values`),b=e=>Error(`Aggregate relation "${e}" is queried by name only, without a column (e.g. "${e}:0")`),x=(e,t)=>{switch(e){case`$eq`:return Number(t)===0;case`$ne`:return Number(t)!==0;case`$gt`:return Number(t)<0;case`$gte`:return Number(t)<=0;case`$lt`:return Number(t)>0;case`$lte`:return Number(t)>=0;case`$in`:return n.castArray(t).some(e=>Number(e)===0);case`$nin`:return!n.castArray(t).some(e=>Number(e)===0);default:return!1}},S=e=>JSON.stringify(e,function(e,t){return t instanceof RegExp?t.toString():t}),C=({source:e,ignoreCase:t})=>(e=e.replace(/\\([.*+?^${}()|[\]\\/])/g,`$1`),t&&(e=e.toLowerCase()),e=e.replace(new RegExp(n.escapeRegExp(l),`g`),`**`),e=e.replace(/%/g,`*%`),e=e.replace(/_/g,`*_`),e=e.startsWith(`^`)?e.substring(1)+`%`:e.endsWith(`$`)?`%`+e.substring(0,e.length-1):`%`+e+`%`,{source:e,ignoreCase:t}),w=class{constructor(e={},t={}){this.tableName=e.tableName,this.cte=t.cte,this.config={},Object.assign(this.config,{relations:{}},t)}processWhereType(e,t,n){return n===null?(e===`$or`?`orWhere`:`where`)+(t===`$ne`?`NotNull`:`Null`):e===`$or`?`orWhere`:`andWhere`}processStatement(e,t,i){let[a,o]=e.split(`.`);if(o){r(a,o);let s=a,c=this.config.relations[s];if(c&&c.type===`aggregate`)throw b(s);return c?{table:a,column:o,operator:t,value:i,config:c,isRelation:!0}:(c=n.find(this.config.relations,e=>e.joinTable===s),c?{joinTable:c.joinTable,table:c.tableName,column:o,operator:t,value:i,config:c,isRelation:!0}:{column:e,operator:t,value:i,isRelation:!1})}let s=this.config.relations[e];return s&&s.type===`aggregate`?{table:e,column:null,operator:t,value:i,config:s,isRelation:!0}:{column:this.cte&&this.cte===!0?`${e}`:`${this.tableName}.${e}`,operator:t,value:i,isRelation:!1}}groupRelationStatements(e,t){let r={},i=t===`$and`?e.filter(e=>!e.joinTable):e;if(n.each(i,(e,t)=>{let i=e.config&&e.config.type===`aggregate`,a=!i&&p(e.operator);!a&&!i&&r[e.table]&&(a=n.some(r[e.table].innerWhereStatements,t=>!(t.column!==e.column||m(t.operator)&&m(e.operator))));let o=e.table;if(a&&(o=`${e.table}_${t})}`,r[o]))throw Error(`Key collision detected`);r[o]||(r[o]={},r[o].innerWhereStatements=[]),r[o].innerWhereStatements.push(e)}),t===`$and`){let t=e.filter(e=>e.joinTable);n.each(Object.keys(r),e=>{r[e].joinFilterStatements=t})}return r}buildRelationQuery(e,t,a){r(`(buildRelationQuery)`),i.enabled&&i(`(buildRelationQuery) ${S(t)}`);let s=this.groupRelationStatements(t,a);i.enabled&&i(`(buildRelationQuery) grouped: ${S(s)}`),n.each(Object.keys(s),t=>{r(`(buildRelationQuery) build relation for ${t}`);let c=s[t].innerWhereStatements,l=c[0];if(l.config.type===`manyToMany`)if(n.every(c.map(e=>e.operator),f)){let a=n.every(c.map(e=>e.operator),e=>p(e)),u=a?o.$nin:o.$in;e[[`whereNull`,`whereNotNull`].includes(l.whereType)?`andWhere`:[`orWhereNull`,`orWhereNotNull`].includes(l.whereType)?`orWhere`:l.whereType](`${this.tableName}.id`,u,function(){let e=s[t].joinFilterStatements,u=l.config.tableName,d=`${l.config.tableName}.${l.config.joinToForeign||`id`}`;l.config.tableNameAs&&(u=`${l.config.tableName} as ${l.config.tableNameAs}`,d=`${l.config.tableNameAs}.${l.config.joinToForeign||`id`}`);let f=l.config.joinType||`innerJoin`,m=this.select(`${l.config.joinTable}.${l.config.joinFrom}`).from(`${l.config.joinTable}`)[f](u,function(){this.on(d,`=`,`${l.config.joinTable}.${l.config.joinTo}`),n.each(e,e=>{this.andOn(`${e.joinTable}.${e.column}`,o[e.operator],e.value)})});return i.enabled&&r(`(buildRelationQuery) innerQB sql-pre: ${m.toSQL().sql}`),n.each(c,(e,t)=>{r(`(buildRelationQuery) build relation where statements for ${t}`);let i=`${e.joinTable||e.table}.${e.column}`,s;s=a?o.$in:p(e.operator)?o.$nin:o[e.operator];let c=e.value;h(s)&&(c=n.isArray(e.value)?e.value:[e.value]),m[e.whereType](i,s,c)}),i.enabled&&r(`(buildRelationQuery) innerQB sql-post: ${m.toSQL().sql}`),m})}else r(`one of ${t} group statements contains unknown operator`);else if(l.config.type===`oneToOne`)if(n.every(c.map(e=>e.operator),f)){let a=n.every(c.map(e=>e.operator),e=>p(e)),u=a?o.$nin:o.$in,d=this.tableName;e[l.whereType===`orWhere`?`orWhere`:`where`](`${this.tableName}.id`,u,function(){let e=s[t].joinFilterStatements,u=l.config.tableName,f=`${l.config.tableName}.${l.config.joinFrom}`;l.config.tableNameAs&&(u=`${l.config.tableName} as ${l.config.tableNameAs}`,f=`${l.config.tableNameAs}.${l.config.joinFrom}`);let m=this.select(`${d}.id`).from(`${d}`).leftJoin(u,function(){this.on(f,`=`,`${d}.id`),n.each(e,e=>{this.andOn(`${e.joinTable}.${e.column}`,o[e.operator],e.value)})});return n.each(c,(e,t)=>{r(`(buildRelationQuery) build relation where statements for ${t}`);let i=`${e.table}.${e.column}`,s;a?(s=o.$in,e.value===null&&(e.whereType=e.whereType===`whereNotNull`?`whereNull`:`whereNotNull`)):s=p(e.operator)?o.$nin:o[e.operator];let c=e.value;h(s)&&(c=n.isArray(e.value)?e.value:[e.value]),m[e.whereType](i,s,c)}),i.enabled&&r(`(buildRelationQuery) innerQB sql-pre: ${m.toSQL().sql}`),m})}else r(`one of ${t} group statements contains unknown operator`);else l.config.type===`aggregate`&&this.buildAggregateRelationQuery(e,c,l,a,s[t].joinFilterStatements)})}buildAggregateRelationQuery(e,t,a,l,u){let d=a.config;if(!d.aggregate||!d.aggregate.fn||!d.aggregate.column)throw Error(`Aggregate relations require an aggregate config with fn and column`);let f=c[d.aggregate.fn];if(!f)throw Error(`Unknown aggregate function: ${d.aggregate.fn}`);let p=l===`$or`?n.some(t,e=>x(e.operator,e.value)):n.every(t,e=>x(e.operator,e.value)),m=p?o.$nin:o.$in,g=a.whereType===`orWhere`?`orWhere`:`where`,_=d.tableNameAs||d.tableName,v=d.tableNameAs?`${d.tableName} as ${d.tableNameAs}`:d.tableName,y=[_,...n.map(d.joins,e=>e.tableNameAs||e.tableName)],b=n.filter(u,e=>y.includes(e.joinTable));e[g](`${this.tableName}.id`,m,function(){let e=this.select(`${_}.${d.joinFrom}`).from(v);p&&e.whereNotNull(`${_}.${d.joinFrom}`);let a=_;return n.each(d.joins,t=>{let n=t.tableNameAs||t.tableName,r=t.tableNameAs?`${t.tableName} as ${t.tableNameAs}`:t.tableName;e.innerJoin(r,`${n}.${t.from}`,`${a}.${t.to}`),a=n}),n.each(d.wheres,(t,n)=>{e.where(n,t)}),n.each(b,t=>{e.where(`${t.joinTable}.${t.column}`,o[t.operator],t.value)}),e.groupBy(`${_}.${d.joinFrom}`),n.each(t,(t,i)=>{r(`(buildAggregateRelationQuery) build aggregate having statement for ${i}`);let a=p?s[t.operator]:t.operator,c=i!==0&&l===`$or`!==p?`orHavingRaw`:`havingRaw`;if(h(o[a])){let r=n.castArray(t.value).map(Number);if(r.length===0){e[c](`1 = 0`);return}let i=r.map(()=>`?`).join(`, `);e[c](`${f} ${o[a]} (${i})`,[d.aggregate.column,...r])}else e[c](`${f} ${o[a]} ?`,[d.aggregate.column,Number(t.value)])}),i.enabled&&r(`(buildAggregateRelationQuery) innerQB sql: ${e.toSQL().sql}`),e})}buildComparison(e,t,n,i,a,s){let c=o[i]||`=`,u=this.processStatement(n,i,a),d=this.processWhereType(t,i,a);if(r(`(buildComparison) mode: ${t}, op: ${i}, isRelation: ${u.isRelation}, group: ${s}`),u.isRelation){if(u.whereType=d,!s){this.buildRelationQuery(e,[u],t);return}Object.prototype.hasOwnProperty.call(e,`relations`)||(e.relations=[]),e.relations.push(u);return}let f=u.column;if(i=u.operator,a=u.value,i===`$regex`||i===`$not`){let{source:t,ignoreCase:o}=C(a);if(a=t,o){d+=`Raw`,r(`(buildComparison) whereType: ${d}, statement: ${n}, op: ${i}, comp: ${c}, value: ${a} (REGEX/i)`),e[d](`lower(??) ${c} ? ESCAPE ?`,[f,a,l]);return}d+=`Raw`,r(`(buildComparison) whereType: ${d}, statement: ${n}, op: ${i}, comp: ${c}, value: ${a} (REGEX)`),e[d](`?? ${c} ? ESCAPE ?`,[f,a,l]);return}r(`(buildComparison) whereType: ${d}, statement: ${n}, op: ${i}, comp: ${c}, value: ${a}`),e[d](f,c,a)}buildWhereClause(e,t,a,o,s){if(r(`(buildWhereClause) mode: ${t}, statement: ${a}`),i.enabled&&i(`(buildWhereClause) ${S(o)}`),!n.isObject(o))return this.buildComparison(e,t,a,`$eq`,o,s);n.forIn(o,(n,i)=>{f(i)?this.buildComparison(e,t,a,i,n,s):r(`unknown operator`)})}buildWhereGroup(e,t,a,o){let s=this.processWhereType(t);r(`(buildWhereGroup) mode: ${a}, whereType: ${s}`),i.enabled&&i(`(buildWhereGroup) ${S(o)}`),e[s](e=>{n.isArray(o)?o.forEach(t=>this.buildQuery(e,a,t,!0)):n.isObject(o)&&this.buildQuery(e,a,o,!0),Object.prototype.hasOwnProperty.call(e,`relations`)&&(this.buildRelationQuery(e,e.relations,a),delete e.relations)})}buildQuery(e,t,a,o){r(`(buildQuery) mode: ${t}`),i.enabled&&i(`(buildQuery) ${S(a)}`),n.forIn(a,(n,i)=>{r(`(buildQuery) key: ${i}`),d(i)?this.buildWhereGroup(e,t,i,n):this.buildWhereClause(e,t,i,n,o)})}validateAggregateStatements(e){n.isPlainObject(e)&&n.forIn(e,(e,t)=>{if(d(t)){n.castArray(e).forEach(e=>this.validateAggregateStatements(e));return}if(u(t))return;let[r,i]=t.split(`.`),a=this.config.relations[r];if(!a||a.type!==`aggregate`)return;if(i)throw b(r);let o=n.isPlainObject(e)?e:{$eq:e};n.forIn(o,(e,t)=>{if(!g(t)||!v(t,e))throw y(r)})})}processJSON(e,t){r(`(processJSON)`),i.enabled&&i(`(processJSON) ${S(t)}`),this.validateAggregateStatements(t),this.buildQuery(e,`$and`,t)}};t.exports=function(e,t,n){return new w({tableName:e._single.table},n).processJSON(e,t),e}})),Ds=n(((e,t)=>{t.exports=Es()})),Os=n(((e,t)=>{var n=Ss(),r=[`$and`,`$or`],i=(e,t)=>Array.isArray(e)?e.map(e=>i(e,t)).filter(e=>!n.isEmpty(e)):n.reduce(e,(e,a,o)=>{let s;if(r.includes(o)){let e=i(a,t);s=n.isEmpty(e)?null:{[o]:e}}else s=o===`yg`?{[o]:i(a,t)}:t(a,o);return n.assign({},e,s)},{}),a=(e,t)=>n.isEmpty(e)?t:n.isEmpty(t)?e:{$and:[e,t]},o=(e,t)=>n.some(e,(e,r,i)=>r===`$and`?o(i.$and,t):r===`$or`?o(i.$or,t):r!==t&&n.isObject(e)?o(e,t):r===t),s=(e,t)=>e&&i(e,function(e,n){if(!t(n))return{[n]:e}}),c=(...e)=>{let t={};return e.filter(e=>!!e).forEach(e=>{e&&Object.keys(e).length>0&&(e=s(e,e=>o(t,e)),e&&(t=Object.keys(t).length>0?a(t,e):e))}),t},l=(e,t)=>{let r=(e,t)=>t.$and?{$and:[e,...t.$and]}:{$and:[e,t]};return i(e,function(e,i){let a=n.find(t,{key:i});if(!a)return{[i]:e};let o={[a.replacement]:e};return a.expansion?r(o,a.expansion):o})};function u(e,t){let n=t.find(({from:t})=>t===e);return n?n.to:e}function d(e,t){return Array.isArray(e)?e.map(t):t(e)}function f(e){return function(t){return i(t,function(t,r){return r===e.key.from?typeof t==`object`?{[e.key.to]:n.reduce(t,(t,n,r)=>Object.assign(t,{[r]:d(n,t=>u(t,e.values))}),{})}:{[e.key.to]:u(t,e.values)}:{[r]:t}})}}var p=(e,t)=>i(e,function(e,n){return Object.keys(t).includes(n)?t[n]??{}:{[n]:e}});function m(...e){return function(t){for(let n of e)t=n(t);return t}}function h(e){if(!e)return[];let t=[];if(e.$and)for(let n of e.$and)for(let e of h(n))t.includes(e)||t.push(e);else if(e.$or)for(let n of e.$or)for(let e of h(n))t.includes(e)||t.push(e);else e.yg?t.push(...h(e.yg)):t.push(...Object.keys(e));return t}function g(e,t){let n,r;if(typeof e!=`object`)return[n,r];if(e.$and){for(let i of e.$and){let e=h(i),a=!1;for(let n of e)if(t.includes(n))a=!0;else if(a)throw Error(`This filter is not supported because you cannot combine ${t.join(`, `)} filters with other filters except at the root level in an AND.`);a?n?n.$and.push(i):n={$and:[i]}:r?r.$and.push(i):r={$and:[i]}}n&&n.$and.length===1&&(n=n.$and[0]),r&&r.$and.length===1&&(r=r.$and[0])}else if(e.$or){let i=!1;for(let n of e.$or){let e=h(n);for(let n of e)if(t.includes(n)){i=!0;continue}else if(i)throw Error(`This filter is not supported because you cannot combine ${t.join(`, `)} filters with other filters in an OR.`)}i?n=e:r=e}else if(e.yg)return this.splitFilter(e.yg,t);else{let i=Object.keys(e);for(let a of i)t.includes(a)?n?n[a]=e[a]:n={[a]:e[a]}:r?r[a]=e[a]:r={[a]:e[a]}}return[n,r]}function _(e){let t=[];for(let n of Object.keys(e))e[n]&&t.push({key:{from:n,to:e[n]},values:[]});return t.map(e=>f(e))}t.exports={mapKeyValues:f,combineFilters:a,findStatement:o,rejectStatements:s,mergeFilters:c,expandFilters:l,mapQuery:i,replaceFilters:p,chainTransformers:m,getUsedKeys:h,splitFilter:g,mapKeys:_}})),ks=n(((e,t)=>{t.exports=Os()})),As=n(((e,t)=>{var n=ks(),r=Ni(),i=Ss(),a=e=>!e||Object.keys(e).length===0?e:e.map(e=>{let t=Object.assign({},e);return t.expansion&&=r.parse(e.expansion),t}),o=(e,t)=>{let r=a(t);return n.expandFilters(e,r)},s=e=>{if(!e.$and||!n.findStatement(e,`$ne`))return e;let t=e.$and,r=t.filter(e=>n.findStatement(e,`$ne`)),a=i.groupBy(r,e=>Object.keys(e)[0]);Object.keys(a).filter(e=>a[e].length>1).forEach(n=>{let r=a[n].map(e=>e[n].$ne).filter(e=>e!==void 0);r.length!==0&&(e[n]={$nin:r},a[n].forEach(e=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)}))}),t.length===0&&delete e.$and;for(let t in e)t===`$and`&&(e[t]=e[t].map(s));return e},c=e=>e.charAt(0)===`$`,l=e=>{if(i.isArray(e))return e.map(l);if(!i.isPlainObject(e))return e;let t=Object.keys(e);if(t.length===1){let n=t[0],r=e[n];if(!c(n)&&i.isPlainObject(r)&&Object.keys(r).length===1&&i.isArray(r.$all))return{$and:r.$all.map(e=>({[n]:e}))}}return i.mapValues(e,l)};t.exports={mergeFilters:n.mergeFilters,parseExpansions:a,expandFilters:o,combineNeFilters:s,expandAllFilters:l}})),js=n(((e,t)=>{var n=xs(),r=Ni(),i=Ds(),a=As();t.exports=(e,t={})=>{let o={};return o.lex=()=>r.lex(e),o.parse=function(){!this.filter&&e&&(this.filter=r.parse(e),t.transformer&&(this.filter=t.transformer(this.filter)));let n,i;t.overrides&&(n=r.parse(t.overrides)),t.defaults&&(i=r.parse(t.defaults));let o=a.mergeFilters(n,this.filter,i);return o=a.combineNeFilters(o),o=a.expandAllFilters(o),t.expansions&&(o=a.expandFilters(o,t.expansions)),o},o.queryJSON=function(e){return this.query=this.query||new n.Query(o.parse()),this.query.test(e)},o.querySQL=e=>i(e,o.parse(),t),o.toString=()=>e,o.toJSON=o.parse,o},t.exports.utils={mapQuery:ks().mapQuery,mapKeyValues:ks().mapKeyValues}})),Ms=t(n(((e,t)=>{t.exports=js()}))(),1);function Ns(e,t){return e.visibility?(0,Ms.default)(e.visibility).queryJSON(t):!0}function Ps({description:e,accentColor:t,icon:n,logo:r,coverImage:i,themeSettings:a,bodyFont:o,headingFont:s}){if(!a)return;let c=a.reduce((e,{key:t,value:n})=>({...e,[t]:n}),{}),l=new URLSearchParams;l.append(`c`,t),l.append(`d`,e),l.append(`icon`,n),l.append(`logo`,r),l.append(`cover`,i),l.append(`bf`,o),l.append(`hf`,s);let u={};return a.forEach(e=>{u[e.key]=Ns(e,c)?e.value:null}),l.append(`custom`,JSON.stringify(u)),l.toString()}var Fs=({settings:e,url:t})=>{let n=Ps({...e});return(0,Q.jsx)(Ha,{addDelay:!1,className:`absolute -top-px -left-px size-[calc(110%_+_3px)] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[calc(130%_+_3px)] max-[1600px]:scale-[.76923]`,generateContent:(0,Z.useCallback)(e=>{if(!t||!n)return;let r=new URL(t);r.searchParams.set(`admin_toolbar`,`0`),fetch(r.toString(),{method:`POST`,headers:{"Content-Type":`text/html;charset=utf-8`,"x-ghost-preview":n,Accept:`text/html`},mode:`cors`,credentials:`include`}).then(e=>e.text()).then(t=>{let n=`html { pointer-events: none; }`,r=new DOMParser().parseFromString(t,`text/html`),i=r.querySelector(`style`),a=i?.innerHTML;a?i.innerHTML=`${a}\n\n${n}`:r.head.innerHTML+=`<style>${n}</style>`;let o=(r.doctype?new XMLSerializer().serializeToString(r.doctype):``)+r.documentElement.outerHTML;e.contentDocument?.open(),e.contentDocument?.write(o),e.contentDocument?.close()})},[n,t]),height:`100%`,parentClassName:`relative h-full w-full overflow-hidden`,testId:`theme-preview`,width:`100%`})},Is=({setting:e,setSetting:t})=>{let[n,r]=(0,Z.useState)({});(0,Z.useEffect)(()=>{let t=e.value===null?``:String(e.value);r(n=>({...n,[e.key]:t}))},[e]);let i=e=>{n[e]!==void 0&&t(n[e])},a=(e,t)=>{r(n=>({...n,[e]:t}))},{mutateAsync:o}=re(),s=h(),c=async e=>{try{t(Te(await o({file:e})))}catch(e){s(e)}};switch(e.type){case`text`:return(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`theme-setting-${e.key}`,children:_i(e.key)}),(0,Q.jsx)(X,{className:`h-[var(--control-height)] border-transparent bg-muted`,id:`theme-setting-${e.key}`,value:n[e.key]||``,onBlur:()=>i(e.key),onChange:t=>a(e.key,t.target.value)}),e.description&&(0,Q.jsx)(q,{children:e.description})]});case`boolean`:return(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`theme-setting-${e.key}`,children:_i(e.key)}),e.description&&(0,Q.jsx)(q,{children:e.description})]}),(0,Q.jsx)(W,{checked:!!e.value,id:`theme-setting-${e.key}`,onCheckedChange:t})]});case`select`:return(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:_i(e.key)}),(0,Q.jsxs)(qt,{value:e.value,onValueChange:t,children:[(0,Q.jsx)(Wt,{"aria-label":_i(e.key),"data-testid":`setting-select-${e.key}`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:e.options.map(e=>(0,Q.jsx)(Ht,{value:e,children:e},e))})]}),e.description&&(0,Q.jsx)(q,{children:e.description})]});case`color`:return(0,Q.jsx)(B,{debounceMs:200,direction:`rtl`,hint:e.description,title:_i(e.key),value:e.value||``,onChange:e=>t(e)});case`image`:return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(K,{children:_i(e.key)}),(0,Q.jsx)(he,{className:e.value?`h-25`:`h-8`,children:e.value?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(le,{id:`custom-${e.key}`,src:e.value}),(0,Q.jsx)(be,{children:(0,Q.jsx)(_e,{"aria-label":`Remove image`,onClick:()=>t(null),children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{inputId:`custom-${e.key}`,onDropAccepted:e=>c(e[0]),children:`Upload image`})}),e.description&&(0,Q.jsx)(q,{children:e.description})]})}},Ls={source:[`title_font`,`body_font`],casper:[`title_font`,`body_font`],alto:[`title_font`,`body_font`],bulletin:[`title_font`,`body_font`],dawn:[`title_font`,`body_font`],digest:[`title_font`,`body_font`],dope:[`title_font`,`body_font`],ease:[`title_font`,`body_font`],edge:[`title_font`,`body_font`],edition:[`title_font`,`body_font`],episode:[`typography`],headline:[`title_font`,`body_font`],journal:[`title_font`,`body_font`],london:[`title_font`,`body_font`],ruby:[`title_font`,`body_font`],solo:[`typography`],taste:[`style`],wave:[`title_font`,`body_font`]},Rs=({sections:e,updateSetting:t})=>{let{data:n}=pi(),r=n?.themes.find(e=>e.active),i=r?.package.name?.toLowerCase()||``,a=r?.package.author?.name||``,{supportsCustomFonts:o}=wo();return(0,Q.jsx)(Q.Fragment,{children:e.map(e=>{let n=e.settings.filter(t=>Ns(t,e.settings.reduce((e,{key:t,value:n})=>({...e,[t]:n}),{}))),r;return(0,Q.jsxs)(rn,{className:`gap-0 first-of-type:mt-6`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:e.title}),(0,Q.jsx)(tn,{className:`mb-12 gap-4`,children:n.map(e=>{let n=``;e.type===`boolean`&&r!==`boolean`&&r!==void 0&&(n=`mt-3`),(e.type===`text`||e.type===`select`)&&(r===`text`||r===`select`)&&(n=`mt-2`);let s=Ls[i];return s&&s.includes(e.key)&&a===`Ghost Foundation`&&o&&(n+=` hidden`),r=e.type,(0,Q.jsx)(`div`,{className:n,children:(0,Q.jsx)(Is,{setSetting:n=>t({...e,value:n}),setting:e},e.key)},e.key)})})]},e.id)})})},zs=({globalSettings:e,themeSettingSections:t,updateGlobalSetting:n,updateThemeSetting:r,onTabChange:i})=>{let[a,o]=(0,Z.useState)(`global`);return(0,Q.jsx)(`div`,{className:`flex h-full flex-col justify-between`,children:(0,Q.jsx)(`div`,{className:`grow p-7 pt-0`,"data-testid":`design-setting-tabs`,children:t.length>0?(0,Q.jsxs)(Lt,{value:a,variant:`underline`,onValueChange:e=>{o(e),i(e)},children:[(0,Q.jsxs)(It,{className:`sticky top-0 z-50 bg-surface-elevated-2`,children:[(0,Q.jsx)(Pt,{value:`global`,children:`Brand`}),(0,Q.jsx)(Pt,{value:`theme-settings`,children:`Theme`})]}),(0,Q.jsx)(Ft,{value:`global`,children:(0,Q.jsx)(bs,{updateSetting:n,values:e})}),(0,Q.jsx)(Ft,{value:`theme-settings`,children:(0,Q.jsx)(Rs,{sections:t,updateSetting:r})})]}):(0,Q.jsx)(bs,{updateSetting:n,values:e})})})},Bs=()=>{let{settings:e,siteData:t}=xt(),{mutateAsync:n}=Y(),{data:{posts:[r]}={posts:[]}}=M({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),{data:i}=Lr(),{mutateAsync:a}=oi(),o=h(),[s,c]=(0,Z.useState)(`homepage`),[l,u]=(0,Z.useState)(`desktop`),{updateRoute:d}=V(),f=vt().getParam(`ref`),{formState:p,saveState:m,handleSave:g,updateForm:_,setFormState:v,okProps:y}=T({initialState:{settings:e,themeSettings:i?i.custom_theme_settings:void 0},savingDelay:500,onSave:async()=>{if(p.themeSettings?.some(e=>e.dirty)){let e=await a(p.themeSettings);v(t=>({...t,themeSettings:e.custom_theme_settings}))}if(p.settings.some(e=>e.dirty)){let{settings:e}=await n(p.settings.filter(e=>e.dirty));v(t=>({...t,settings:e}))}},onSaveError:o});(0,Z.useEffect)(()=>{i&&v(e=>({...e,themeSettings:i.custom_theme_settings}))},[v,i]);let b=(e,t)=>{_(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},x=e=>{_(t=>({...t,themeSettings:t.themeSettings?.map(t=>t.key===e.key?{...e,dirty:!0}:t)}))},[S,C,w,E,D,O,k]=Hn(p.settings,[`description`,`accent_color`,`icon`,`logo`,`cover_image`,`heading_font`,`body_font`]),A=(p.themeSettings||[]).reduce((e,t)=>{let n=t.group===`homepage`||t.group===`post`?t.group:`site-wide`;return{...e,[n]:(e[n]||[]).concat(t)}},{}),j=Object.entries(A).map(([e,t])=>({id:e,settings:t||[],title:e===`site-wide`?`Site wide`:e===`homepage`?`Homepage`:`Post`})),ee=e=>{r&&c(e)},N=e=>{c(e===`post`&&r?`post`:`homepage`)},P=wi(t);switch(s){case`homepage`:P=wi(t);break;case`post`:P=r.url;break}let F=(0,Q.jsx)(Fs,{settings:{description:S,accentColor:C,icon:w,logo:E,coverImage:D,themeSettings:p.themeSettings,headingFont:O,bodyFont:k},url:P}),I=l===`desktop`?(0,Q.jsx)(zi,{"data-testid":`preview-desktop`,device:`desktop`,children:F}):(0,Q.jsx)(zi,{"data-testid":`preview-mobile`,device:`mobile`,children:F}),L=r?(0,Q.jsx)(Lt,{value:s,variant:`button-sm`,onValueChange:ee,children:(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`homepage`,children:`Homepage`}),(0,Q.jsx)(Pt,{value:`post`,children:`Post`})]})}):void 0,R=(0,Q.jsxs)(xn,{type:`single`,value:l,onValueChange:e=>{(e===`desktop`||e===`mobile`)&&u(e)},children:[(0,Q.jsx)(bn,{"aria-label":`Desktop`,value:`desktop`,children:(0,Q.jsx)(Hr,{})}),(0,Q.jsx)(bn,{"aria-label":`Mobile`,value:`mobile`,children:(0,Q.jsx)(ri,{})})]}),z=(0,Q.jsx)(zs,{globalSettings:{description:S,accentColor:C,icon:w,logo:E,coverImage:D,headingFont:O,bodyFont:k},handleSave:g,themeSettingSections:j,updateGlobalSetting:b,updateThemeSetting:x,onTabChange:N});return(0,Q.jsx)(Za,{afterClose:()=>{d(f===`setup`?{isExternal:!0,route:`analytics`}:`design`)},buttonsDisabled:y.disabled,cancelLabel:`Close`,deviceSelector:R,dirty:m===`unsaved`,okLabel:y.label||`Save`,okVariant:y.variant,preview:I,previewToolbarTabs:L,sidebar:z,sidebarPadding:!1,siteLink:wi(t),size:`full`,testId:`design-modal`,title:`Design`,onOk:async()=>{await g({fakeWhenUnchanged:!0})}})},Vs=H.create(({title:e,prompt:t,cancelLabel:n=`Cancel`,okLabel:r=`OK`,okVariant:i=`default`})=>{let a=Oe(),o=e=>{a.resolve(e),a.remove()};return(0,Q.jsx)(Ie,{backDropClick:!1,cancelLabel:n,okLabel:r,okVariant:i,testId:`theme-editor-confirm-modal`,title:e,width:540,onCancel:()=>o(!1),onOk:()=>o(!0),children:(0,Q.jsx)(`div`,{className:`py-4`,children:t})})}),Hs=H.create(({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a=`Cancel`,okLabel:o=`Continue`})=>{let s=Oe(),[c,l]=(0,Z.useState)(r),u=e=>{s.resolve(e),s.remove()};return(0,Q.jsx)(Ie,{backDropClick:!1,cancelLabel:a,okDisabled:!c.trim(),okLabel:o,testId:`theme-editor-input-modal`,title:e,width:540,onCancel:()=>u(null),onOk:()=>u(c),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[t,(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`theme-editor-input`,children:n}),(0,Q.jsx)(X,{className:`h-[var(--control-height)] border-transparent bg-muted`,id:`theme-editor-input`,placeholder:i,value:c,autoFocus:!0,onChange:e=>l(e.target.value)})]})]})})}),Us=`inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-[13px] font-medium transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#4a9eff] disabled:cursor-not-allowed disabled:opacity-50`,Ws=`${Us} border-[#2f333b] bg-transparent text-[#e6e7ea] hover:bg-[#1f2228]`,Gs=`${Us} border-transparent bg-green text-black hover:bg-green-400`,Ks=({currentThemeName:e,changes:t,isSaving:n,onClose:r,onSave:i})=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[#23262c] bg-[#1a1d21] px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-[14px] font-semibold text-[#f4f5f7]`,children:`Edit theme`}),(0,Q.jsx)(`span`,{className:`truncate text-[12px] text-[#8a8f98]`,children:e})]}),t.length>0&&(0,Q.jsxs)(`span`,{className:`rounded-full border border-transparent bg-[#3b2a16] px-2.5 py-1 text-[11px] leading-none text-[#f5a623]`,children:[F(t.length),` `,t.length===1?`file modified`:`files modified`]}),(0,Q.jsx)(`div`,{className:`grow`}),(0,Q.jsxs)(`button`,{className:Ws,type:`button`,onClick:r,children:[(0,Q.jsx)(Gn,{size:14}),`Close`]}),(0,Q.jsxs)(`button`,{className:Gs,disabled:n,type:`button`,onClick:i,children:[(0,Q.jsx)(Zr,{size:14}),n?`Saving…`:`Save`]})]}),qs=e=>{let t={type:`dir`,name:``,path:``,children:new Map};for(let n of Object.keys(e).sort()){let r=n.split(`/`),i=t;for(let t=0;t<r.length;t+=1){let a=r[t];if(t===r.length-1){i.children.set(a,{type:`file`,name:a,path:n,editable:e[n].editable});continue}let o=`${r.slice(0,t+1).join(`/`)}/`,s=i.children.get(a);if(s?.type===`dir`){i=s;continue}let c={type:`dir`,name:a,path:o,children:new Map};i.children.set(a,c),i=c}}return t},Js=e=>e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`dir`?-1:1),Ys=`inline-flex h-5 w-5 items-center justify-center rounded-sm text-[#c8ccd3] transition-opacity hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#4a9eff] disabled:cursor-not-allowed disabled:opacity-30`,Xs=({currentFiles:e,selectedNode:t,setSelectedNode:n,expandedDirectories:r,setExpandedDirectories:i,changesMap:a,isLoading:o,onCreateFile:s,onRenameSelected:c,onDeleteSelected:l,onOpenFile:u})=>{let d=(e,o=0)=>{if(e.type===`file`){let n=t?.type===`file`&&t.path===e.path,r=a.get(e.path);return(0,Q.jsxs)(`button`,{className:`flex min-h-6 w-full items-center gap-1.5 rounded px-2 py-1 text-left text-[13px] leading-5 ${n?`bg-[#243043] text-white`:`text-[#c8ccd3] hover:bg-[#1f2228]`} ${e.editable?``:`opacity-70`}`,style:{paddingLeft:`${o*14+8}px`},type:`button`,onClick:()=>u(e.path),children:[(0,Q.jsx)(`span`,{className:`w-3 shrink-0`}),(0,Q.jsx)(zn,{size:14}),(0,Q.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.name}),r&&(0,Q.jsx)(`span`,{className:`mr-1 size-1.5 shrink-0 rounded-full ${r===`deleted`?`bg-[#ff6b6b]`:r===`added`?`bg-[#14b886]`:`bg-[#f5a623]`}`})]},e.path)}let s=r.has(e.path),c=t?.type===`dir`&&t.path===e.path,l=Js(Array.from(e.children?.values()||[]));return(0,Q.jsxs)(`div`,{children:[e.path&&(0,Q.jsxs)(`button`,{className:`flex min-h-6 w-full items-center gap-1.5 rounded px-2 py-1 text-left text-[13px] leading-5 ${c?`bg-[#202630] text-white`:`text-[#c8ccd3] hover:bg-[#1f2228]`}`,style:{paddingLeft:`${o*14+8}px`},type:`button`,onClick:()=>{n({type:`dir`,path:e.path}),i(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n})},children:[s?(0,Q.jsx)(Fn,{className:`shrink-0 text-[#6a6f78]`,size:12}):(0,Q.jsx)(kr,{className:`shrink-0 text-[#6a6f78]`,size:12}),s?(0,Q.jsx)(vr,{className:`shrink-0 text-[#8a8f98]`,size:14}):(0,Q.jsx)(vi,{className:`shrink-0 text-[#8a8f98]`,size:14}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.name})]}),(e.path===``||s)&&(0,Q.jsx)(`div`,{children:l.map(t=>d(t,e.path?o+1:o))})]},e.path||`root`)};return(0,Q.jsxs)(`aside`,{className:`flex w-[280px] shrink-0 flex-col border-r border-[#23262c] bg-[#16181c]`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-[#23262c] px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`text-[12px] font-medium text-[#c8ccd3]`,children:[Object.keys(e).length,` files`]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`button`,{"aria-label":`New file`,className:Ys,type:`button`,onClick:s,children:(0,Q.jsx)(gi,{size:13})}),(0,Q.jsx)(`button`,{"aria-label":`Rename selected item`,className:Ys,disabled:!t,type:`button`,onClick:c,children:(0,Q.jsx)(ni,{size:13})}),(0,Q.jsx)(`button`,{"aria-label":`Delete selected item`,className:Ys,disabled:!t,type:`button`,onClick:l,children:(0,Q.jsx)(nr,{size:13})})]})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:o?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center text-[13px] text-[#8a8f98]`,children:[(0,Q.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-[#2f333b] border-t-[#14b886]`}),(0,Q.jsx)(`span`,{children:`Loading theme files…`})]}):Object.keys(e).length===0?(0,Q.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#8a8f98]`,children:`This theme archive does not contain any files.`}):d(qs(e))})]})},Zs=t(n(((t,n)=>{(function(e){typeof t==`object`&&n!==void 0?n.exports=e():typeof define==`function`&&define.amd?define([],e):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=e()})(function(){return function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a}({1:[function(e,t,n){var r=e(`./utils`),i=e(`./support`),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;n.encode=function(e){for(var t,n,i,o,s,c,l,u=[],d=0,f=e.length,p=f,m=r.getTypeOf(e)!==`string`;d<e.length;)p=f-d,i=m?(t=e[d++],n=d<f?e[d++]:0,d<f?e[d++]:0):(t=e.charCodeAt(d++),n=d<f?e.charCodeAt(d++):0,d<f?e.charCodeAt(d++):0),o=t>>2,s=(3&t)<<4|n>>4,c=1<p?(15&n)<<2|i>>6:64,l=2<p?63&i:64,u.push(a.charAt(o)+a.charAt(s)+a.charAt(c)+a.charAt(l));return u.join(``)},n.decode=function(e){var t,n,r,o,s,c,l=0,u=0,d=`data:`;if(e.substr(0,d.length)===d)throw Error(`Invalid base64 input, it looks like a data url.`);var f,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,``)).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&p--,e.charAt(e.length-2)===a.charAt(64)&&p--,p%1!=0)throw Error(`Invalid base64 input, bad content length.`);for(f=i.uint8array?new Uint8Array(0|p):Array(0|p);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(o=a.indexOf(e.charAt(l++)))>>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=`
|
|
23
|
+
\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,o){var s=a.transformTo(`string`,o(i));return l.CENTRAL_DIRECTORY_END+`\0\0\0\0`+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(`error`,function(e){t.error(e)}),this},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch{}return!0},u.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e(`../compressions`),i=e(`./ZipFileWorker`);n.generateWorker=function(e,t,n){var a=new i(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,n){o++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw Error(n+` is not a valid compression method !`);return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,l=n.date;n._compressWorker(i,s).withStreamInfo(`file`,{name:e,dir:c,date:l,comment:n.comment||``,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(a)}),a.entriesCount=o}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw Error(`The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.`);this.files=Object.create(null),this.comment=null,this.root=``,this.clone=function(){var e=new r;for(var t in this)typeof this[t]!=`function`&&(e[t]=this[t]);return e}}(r.prototype=e(`./object`)).loadAsync=e(`./load`),r.support=e(`./support`),r.defaults=e(`./defaults`),r.version=`3.10.1`,r.loadAsync=function(e,t){return new r().loadAsync(e,t)},r.external=e(`./external`),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e(`./utils`),i=e(`./external`),a=e(`./utf8`),o=e(`./zipEntries`),s=e(`./stream/Crc32Probe`),c=e(`./nodejsUtils`);function l(e){return new i.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on(`error`,function(e){n(e)}).on(`end`,function(){r.streamInfo.crc32===e.decompressed.crc32?t():n(Error(`Corrupted zip : CRC32 mismatch`))}).resume()})}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(Error(`JSZip can't accept a stream when loading a zip file.`)):r.prepareContent(`the loaded zip file`,e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new o(t);return n.load(e),n}).then(function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var a=0;a<r.length;a++)n.push(l(r[a]));return i.Promise.all(n)}).then(function(e){for(var i=e.shift(),a=i.files,o=0;o<a.length;o++){var s=a[o],c=s.fileNameStr,l=r.resolve(s.fileNameStr);n.file(l,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(l).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e(`../utils`),i=e(`../stream/GenericWorker`);function a(e,t){i.call(this,`Nodejs stream input adapter for `+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(a,i),a.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on(`data`,function(e){t.push({data:e,meta:{percent:0}})}).on(`error`,function(e){t.isPaused?this.generatedError=e:t.error(e)}).on(`end`,function(){t.isPaused?t._upstreamEnded=!0:t.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e(`readable-stream`).Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on(`data`,function(e,t){i.push(e)||i._helper.pause(),n&&n(t)}).on(`error`,function(e){i.emit(`error`,e)}).on(`end`,function(){i.push(null)})}e(`../utils`).inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:typeof Buffer<`u`,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e==`number`)throw Error(`The "data" argument must not be a number`);return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on==`function`&&typeof e.pause==`function`&&typeof e.resume==`function`}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=a.getTypeOf(t),s=a.extend(n||{},c);s.date=s.date||new Date,s.compression!==null&&(s.compression=s.compression.toUpperCase()),typeof s.unixPermissions==`string`&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=h(e)),s.createFolders&&(r=m(e))&&g.call(this,r,!0);var d=i===`string`&&!1===s.binary&&!1===s.base64;n&&n.binary!==void 0||(s.binary=!d),(t instanceof l&&t.uncompressedSize===0||s.dir||!t||t.length===0)&&(s.base64=!1,s.binary=!0,t=``,s.compression=`STORE`,i=`string`);var _=null;_=t instanceof l||t instanceof o?t:f.isNode&&f.isStream(t)?new p(e,t):a.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,_,s);this.files[e]=v}var i=e(`./utf8`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=e(`./stream/StreamHelper`),c=e(`./defaults`),l=e(`./compressedObject`),u=e(`./zipObject`),d=e(`./generate`),f=e(`./nodejsUtils`),p=e(`./nodejs/NodejsStreamInputAdapter`),m=function(e){e.slice(-1)===`/`&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf(`/`);return 0<t?e.substring(0,t):``},h=function(e){return e.slice(-1)!==`/`&&(e+=`/`),e},g=function(e,t){return t=t===void 0?c.createFolders:t,e=h(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return Object.prototype.toString.call(e)===`[object RegExp]`}t.exports={load:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(arguments.length!==1)return e=this.root+e,r.call(this,e,t,n),this;if(_(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var a=this.files[this.root+e];return a&&!a.dir?a:null},folder:function(e){if(!e)return this;if(_(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||=(e.slice(-1)!==`/`&&(e+=`/`),this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},generateInternalStream:function(e){var t,n={};try{if((n=a.extend(e||{},{streamFiles:!1,compression:`STORE`,compressionOptions:null,type:``,platform:`DOS`,comment:null,mimeType:`application/zip`,encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),n.type===`binarystring`&&(n.type=`string`),!n.type)throw Error(`No output type specified.`);a.checkSupport(n.type),n.platform!==`darwin`&&n.platform!==`freebsd`&&n.platform!==`linux`&&n.platform!==`sunos`||(n.platform=`UNIX`),n.platform===`win32`&&(n.platform=`DOS`);var r=n.comment||this.comment||``;t=d.generateWorker(this,n,r)}catch(e){(t=new o(`error`)).error(e)}return new s(t,n.type||`string`,n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e||={}).type||(e.type=`nodebuffer`),this.generateInternalStream(e).toNodejsStream(t)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e(`stream`)},{stream:void 0}],17:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&i===a[3]},i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e(`../utils`);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error(`End of data reached (data length = `+this.length+`, asked index = `+e+`). Corrupted zip ?`)},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.end()}),e.on(`error`,function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e=`Worker `+this.name;return this.previous?this.previous+` -> `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case`string`:return t.join(``);case`array`:return Array.prototype.concat.apply([],t);case`uint8array`:for(i=new Uint8Array(a),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case`nodebuffer`:return Buffer.concat(t);default:throw Error(`concat : unsupported type '`+e+`'`)}}(s,a),l))}catch(e){i(e)}a=[]}).resume()})}function d(e,t,n){var o=t;switch(t){case`blob`:case`arraybuffer`:o=`uint8array`;break;case`base64`:o=`string`}try{this._internalType=o,this._outputType=t,this._mimeType=n,r.checkSupport(o),this._worker=e.pipe(new i(o)),e.lock()}catch(e){this._worker=new a(`error`),this._worker.error(e)}}d.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var n=this;return e===`data`?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){r.delay(t,arguments,n)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport(`nodestream`),this._outputType!==`nodebuffer`)throw Error(this._outputType+` is not supported by this method`);return new l(this,{objectMode:this._outputType!==`nodebuffer`},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,n.nodebuffer=typeof Buffer<`u`,n.uint8array=typeof Uint8Array<`u`,typeof ArrayBuffer>`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):Array(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t<o;)if((i=e[t++])<128)c[n++]=i;else if(4<(a=s[i]))c[n++]=65533,t+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&t<o;)i=i<<6|63&e[t++],a--;1<a?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e(`setimmediate`),n.newBlob=function(e,t){n.checkSupport(`blob`);try{return new Blob([e],{type:t})}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch{throw Error(`Bug : can't construct the Blob.`)}}};var l={stringifyByChunk:function(e,t,n){var r=[],i=0,a=e.length;if(a<=n)return String.fromCharCode.apply(null,e);for(;i<a;)t===`array`||t===`nodebuffer`?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,a)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,a)))),i+=n;return r.join(``)},stringifyByChar:function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function u(e){var t=65536,r=n.getTypeOf(e),i=!0;if(r===`uint8array`?i=l.applyCanBeUsed.uint8array:r===`nodebuffer`&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=u;var f={};f.string={string:s,array:function(e){return c(e,Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},f.array={string:u,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},f.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return a.newBufferFrom(e)}},f.nodebuffer={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){return t||=``,e?(n.checkSupport(e),f[n.getTypeOf(t)][e](t)):t},n.resolve=function(e){for(var t=e.split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];i===`.`||i===``&&r!==0&&r!==t.length-1||(i===`..`?n.pop():n.push(i))}return n.join(`/`)},n.getTypeOf=function(e){return typeof e==`string`?`string`:Object.prototype.toString.call(e)===`[object Array]`?`array`:r.nodebuffer&&a.isBuffer(e)?`nodebuffer`:r.uint8array&&e instanceof Uint8Array?`uint8array`:r.arraybuffer&&e instanceof ArrayBuffer?`arraybuffer`:void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw Error(e+` is not supported by this platform`)},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r=``;for(n=0;n<(e||``).length;n++)r+=`\\x`+((t=e.charCodeAt(n))<16?`0`:``)+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&n[t]===void 0&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,a,s,l){return o.Promise.resolve(t).then(function(e){return r.blob&&(e instanceof Blob||[`[object File]`,`[object Blob]`].indexOf(Object.prototype.toString.call(e))!==-1)&&typeof FileReader<`u`?new o.Promise(function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)}):e}).then(function(t){var u=n.getTypeOf(t);return u?(u===`arraybuffer`?t=n.transformTo(`uint8array`,t):u===`string`&&(l?t=i.decode(t):a&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):Array(e.length))}(t))),t):o.Promise.reject(Error(`Can't read the data of '`+e+`'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./signature`),o=e(`./zipEntry`),s=e(`./support`);function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error(`Corrupted zip or bug: unexpected signature (`+i.pretty(t)+`, expected `+i.pretty(e)+`)`)}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?`uint8array`:`array`,n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw Error(`Multi-volumes zip are not supported`)},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw Error(`Corrupted zip or bug: expected `+this.centralDirRecords+` records in central dir, got `+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?Error(`Corrupted zip: can't find end of central directory`):Error(`Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html`);this.reader.setIndex(e);var t=e;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error(`Corrupted zip: can't find the ZIP64 end of central directory locator`);if(this.reader.setIndex(e),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error(`Corrupted zip: can't find the ZIP64 end of central directory`);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw Error(`Corrupted zip: missing `+Math.abs(r)+` bytes.`)},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./compressedObject`),o=e(`./crc32`),s=e(`./utf8`),c=e(`./compressions`),l=e(`./support`);function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw Error(`Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)`);if((t=function(e){for(var t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod))===null)throw Error(`Corrupted zip : compression `+i.pretty(this.compressionMethod)+` unknown (inner file : `+i.transformTo(`string`,this.fileName)+`)`);this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error(`Encrypted zip are not supported`);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=l.uint8array?`uint8array`:`array`;if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(r!==null)this.fileCommentStr=r;else{var a=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileName)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileComment)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e(`./stream/StreamHelper`),a=e(`./stream/DataWorker`),o=e(`./utf8`),s=e(`./compressedObject`),c=e(`./stream/GenericWorker`);r.prototype={internalStream:function(e){var t=null,n=`string`;try{if(!e)throw Error(`No output type specified.`);var r=(n=e.toLowerCase())===`string`||n===`text`;n!==`binarystring`&&n!==`text`||(n=`string`),t=this._decompressWorker();var a=!this._dataBinary;a&&!r&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&r&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new c(`error`)).error(e)}return new i(t,n,``)},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||`nodebuffer`).toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new a(this._data)}};for(var l=[`asText`,`asBinary`,`asNodeBuffer`,`asUint8Array`,`asArrayBuffer`],u=function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},d=0;d<l.length;d++)r.prototype[l[d]]=u;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(u),s=e.document.createTextNode(``);o.observe(s,{characterData:!0}),n=function(){s.data=a=++a%2}}else if(e.setImmediate||e.MessageChannel===void 0)n=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;r=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}t.exports=function(e){l.push(e)!==1||r||n()}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],37:[function(e,t,n){var r=e(`immediate`);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=m(function(){t(i,r)});o.status===`error`&&r(o.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}(t.exports=l).prototype.finally=function(e){if(typeof e!=`function`)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||typeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n},u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return a.reject(t,e)},l.all=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(function(e){o[i]=e,++s!==n||r||(r=!0,a.resolve(l,o))},function(e){r||(r=!0,a.reject(l,e))})}},l.race=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c=e[o],t.resolve(c).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))});var c;return s}},{immediate:36}],38:[function(e,t,n){var r={};(0,e(`./lib/utils/common`).assign)(r,e(`./lib/deflate`),e(`./lib/inflate`),e(`./lib/zlib/constants`)),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e(`./zlib/deflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/messages`),s=e(`./zlib/zstream`),c=Object.prototype.toString,l=0,u=-1,d=0,f=8;function p(e){if(!(this instanceof p))return new p(e);this.options=i.assign({level:u,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:``},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var m;if(m=typeof t.dictionary==`string`?a.string2buf(t.dictionary):c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,m))!==l)throw Error(o[n]);this._dict_set=!0}}function m(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}p.prototype.push=function(e,t){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,typeof e==`string`?s.input=a.string2buf(e):c.call(e)===`[object ArrayBuffer]`?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(s.avail_out===0&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),(n=r.deflate(s,o))!==1&&n!==l)return this.onEnd(n),!(this.ended=!0);s.avail_out!==0&&(s.avail_in!==0||o!==4&&o!==2)||(this.options.to===`string`?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||s.avail_out===0)&&n!==1);return o===4?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):o!==2||(this.onEnd(l),!(s.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=m,n.deflateRaw=function(e,t){return(t||={}).raw=!0,m(e,t)},n.gzip=function(e,t){return(t||={}).gzip=!0,m(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e(`./zlib/inflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/constants`),s=e(`./zlib/messages`),c=e(`./zlib/zstream`),l=e(`./zlib/gzheader`),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:``},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw Error(s[n]);this.header=new l,r.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}d.prototype.push=function(e,t){var n,s,c,l,d,f,p=this.strm,m=this.options.chunkSize,h=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,typeof e==`string`?p.input=a.binstring2buf(e):u.call(e)===`[object ArrayBuffer]`?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new i.Buf8(m),p.next_out=0,p.avail_out=m),(n=r.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&h&&(f=typeof h==`string`?a.string2buf(h):u.call(h)===`[object ArrayBuffer]`?new Uint8Array(h):h,n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(p.avail_out!==0&&n!==o.Z_STREAM_END&&(p.avail_in!==0||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||(this.options.to===`string`?(c=a.utf8border(p.output,p.next_out),l=p.next_out-c,d=a.buf2string(p.output,c),p.next_out=l,p.avail_out=m-l,l&&i.arraySet(p.output,p.output,c,l,0),this.onData(d)):this.onData(i.shrinkBuf(p.output,p.next_out)))),p.avail_in===0&&p.avail_out===0&&(g=!0)}while((0<p.avail_in||p.avail_out===0)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(e,t){return(t||={}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e(`./common`),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n=``,o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,l=Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)l[r++]=i;else if(4<(a=o[i]))l[r++]=65533,n+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&n<s;)i=i<<6|63&e[n++],a--;1<a?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+t[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function ee(e){return(e<<1)-(4<e?9:0)}function N(e){for(var t=e.length;0<=--t;)e[t]=0}function P(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function F(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,P(e.strm)}function I(e,t){e.pending_buf[e.pending++]=t}function L(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function R(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<f);if(r=w-(f-a),a=f-w,o<r){if(e.match_start=t,s<=(o=r))break;p=l[a+o-1],m=l[a+o]}}while((t=d[t&u])>c&&--i!=0);return o<=e.lookahead?o:e.lookahead}function z(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f<p&&(p=f),n=p===0?0:(l.avail_in-=p,i.arraySet(u,l.input,l.next_in,p,d),l.state.wrap===1?l.adler=o(l.adler,u,p,d):l.state.wrap===2&&(l.adler=s(l.adler,u,p,d)),l.next_in+=p,l.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+C-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<C)););}while(e.lookahead<T&&e.strm.avail_in!==0)}function te(e,t){for(var n,r;;){if(e.lookahead<T){if(z(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-T&&(e.match_length=R(e,n)),e.match_length>=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}function B(e,t){for(var n,r,i;;){if(e.lookahead<T){if(z(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=C-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-T&&(e.match_length=R(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===C&&4096<e.strstart-e.match_start)&&(e.match_length=C-1)),e.prev_length>=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=C-1,e.strstart++,r&&(F(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&F(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=a._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}function ne(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function re(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),N(this.dyn_ltree),N(this.dyn_dtree),N(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(S+1),this.heap=new i.Buf16(2*v+1),N(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),N(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ie(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:D,e.adler=t.wrap===2?0:1,t.last_flush=l,a._tr_init(t),d):M(e,f)}function ae(e){var t=ie(e);return t===d&&function(e){e.window_size=2*e.w_size,N(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=C-1,e.match_available=0,e.ins_h=0}(e.state),t}function oe(e,t,n,r,a,o){if(!e)return f;var s=1;if(t===p&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||_<a||n!==g||r<8||15<r||t<0||9<t||o<0||m<o)return M(e,f);r===8&&(r=9);var c=new re;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+C-1)/C),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=n,ae(e)}r=[new ne(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(z(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,F(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),O)}),new ne(4,4,8,4,te),new ne(4,5,16,8,te),new ne(4,6,32,32,te),new ne(4,4,16,16,B),new ne(8,16,32,32,B),new ne(8,16,128,128,B),new ne(8,32,128,256,B),new ne(32,128,258,1024,B),new ne(32,258,258,4096,B)],n.deflateInit=function(e,t){return oe(e,t,g,15,8,0)},n.deflateInit2=oe,n.deflateReset=ae,n.deflateResetKeep=ie,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5<t||t<0)return e?M(e,f):f;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===666&&t!==u)return M(e,e.avail_out===0?-5:f);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(i.wrap===2)e.adler=0,I(i,31),I(i,139),I(i,8),i.gzhead?(I(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),I(i,255&i.gzhead.time),I(i,i.gzhead.time>>8&255),I(i,i.gzhead.time>>16&255),I(i,i.gzhead.time>>24&255),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(I(i,255&i.gzhead.extra.length),I(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(I(i,0),I(i,0),I(i,0),I(i,0),I(i,0),I(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),I(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,L(i,p),i.strstart!==0&&(L(i,e.adler>>>16),L(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending!==i.pending_buf_size));)I(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,I(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),P(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,I(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&P(e),i.pending+2<=i.pending_buf_size&&(I(i,255&e.adler),I(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(P(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&ee(t)<=ee(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(z(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(z(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+w;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=w-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(F(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(F(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(F(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(N(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),P(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(I(i,255&e.adler),I(i,e.adler>>8&255),I(i,e.adler>>16&255),I(i,e.adler>>24&255),I(i,255&e.total_in),I(i,e.total_in>>8&255),I(i,e.total_in>>16&255),I(i,e.total_in>>24&255)):(L(i,e.adler>>>16),L(i,65535&e.adler)),P(e),0<i.wrap&&(i.wrap=-i.wrap),i.pending===0?1:d):d},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&t!==69&&t!==73&&t!==91&&t!==103&&t!==D&&t!==666?M(e,f):(e.state=null,t===D?M(e,-3):d):f},n.deflateSetDictionary=function(e,t){var n,r,a,s,c,l,u,p,m=t.length;if(!e||!e.state||(s=(n=e.state).wrap)===2||s===1&&n.status!==E||n.lookahead)return f;for(s===1&&(e.adler=o(e.adler,t,m,0)),n.wrap=0,m>=n.w_size&&(s===0&&(N(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,z(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+C-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=C-1,z(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=C-1,n.match_available=0,e.next_in=l,e.input=u,e.avail_in=c,n.wrap=s,d},n.deflateInfo=`pako deflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];t:for(;;){if(p>>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){n.mode=12;break e}e.msg=`invalid literal/length code`,n.mode=30;break e}x=65535&y,(b&=15)&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];r:for(;;){if(p>>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg=`invalid distance code`,n.mode=30;break e}if(S=65535&y,m<(b&=15)&&(p+=T[r++]<<m,(m+=8)<b&&(p+=T[r++]<<m,m+=8)),c<(S+=p&(1<<b)-1)){e.msg=`invalid distance too far back`,n.mode=30;break e}if(p>>>=b,m-=b,(b=a-o)<S){if(u<(b=S-b)&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break e}if(w=f,(C=0)===d){if(C+=l-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,(b-=d)<x){for(x-=b;E[a++]=f[C++],--b;);if(C=0,d<x){for(x-=b=d;E[a++]=f[C++],--b;);C=a-S,w=E}}}else if(C+=d-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}for(;2<x;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],1<x&&(E[a++]=w[C++]))}else{for(C=a-S;E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],2<(x-=3););x&&(E[a++]=E[C++],1<x&&(E[a++]=E[C++]))}break}}break}}while(r<i&&a<s);r-=x=m>>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=m}},{}],49:[function(e,t,n){var r=e(`../utils/common`),i=e(`./adler32`),a=e(`./crc32`),o=e(`./inffast`),s=e(`./inftrees`),c=1,l=2,u=0,d=-2,f=1,p=852,m=592;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?d:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):d}function b(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=y(e,t))!==u&&(e.state=null),n):d}var x,S,C=!0;function w(e){if(C){var t;for(x=new r.Buf32(512),S=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(c,e.lens,0,288,x,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(l,e.lens,0,32,S,0,e.work,{bits:5}),C=!1}e.lencode=x,e.lenbits=9,e.distcode=S,e.distbits=5}function T(e,t,n,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=_,n.inflateInit=function(e){return b(e,15)},n.inflateInit2=b,n.inflate=function(e,t){var n,p,m,g,_,v,y,b,x,S,C,E,D,O,k,A,j,M,ee,N,P,F,I,L,R=0,z=new r.Buf8(4),te=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return d;(n=e.state).mode===12&&(n.mode=13),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,S=v,C=y,F=u;e:for(;;)switch(n.mode){case f:if(n.wrap===0){n.mode=13;break}for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(2&n.wrap&&b===35615){z[n.check=0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,P=8+(15&(b>>>=4)),n.wbits===0)n.wbits=P;else if(P>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<P,e.adler=n.check=1,n.mode=512&b?10:12,x=b=0;break;case 2:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.flags=b,(255&n.flags)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(57344&n.flags){e.msg=`unknown header flags set`,n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.time=b),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,z[2]=b>>>16&255,z[3]=b>>>24&255,n.check=a(n.check,z,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(z[0]=255&b,z[1]=b>>>8&255,n.check=a(n.check,z,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(P=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,P)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;P=p[g+E++],n.head&&P&&n.length<65536&&(n.head.name+=String.fromCharCode(P)),P&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,P)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(v===0)break e;for(E=0;P=p[g+E++],n.head&&P&&n.length<65536&&(n.head.comment+=String.fromCharCode(P)),P&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,P)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(65535&n.check)){e.msg=`header crc mismatch`,n.mode=30;break}x=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}e.adler=n.check=h(b),x=b=0,n.mode=11;case 11:if(n.havedict===0)return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,2;e.adler=n.check=1,n.mode=12;case 12:if(t===5||t===6)break e;case 13:if(n.last){b>>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}switch(n.last=1&b,--x,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if((65535&b)!=(b>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v<E&&(E=v),y<E&&(E=y),E===0)break e;r.arraySet(m,p,g,E,_),v-=E,g+=E,y-=E,_+=E,n.length-=E;break}n.mode=12;break;case 17:for(;x<14;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.nlen=257+(31&b),b>>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286<n.nlen||30<n.ndist){e.msg=`too many length or distance symbols`,n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.lens[te[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[te[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},F=s(0,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=(R=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(j<16)b>>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(L=k+2;x<L;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b>>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}P=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(L=k+3;x<L;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,P=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(L=k+7;x<L;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,P=0,E=11+(127&(b>>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=P}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,I={bits:n.lenbits},F=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,F){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},F=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,F){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(R=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,ee=A,N=j;A=(R=n.lencode[N+((b&(1<<M+ee)-1)>>M)])>>>16&255,j=65535&R,!(M+(k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(L=n.extra;x<L;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(R=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&R,!((k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,ee=A,N=j;A=(R=n.distcode[N+((b&(1<<M+ee)-1)>>M)])>>>16&255,j=65535&R,!(M+(k=R>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(L=n.extra;x<L;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(y<E&&(E=y),y-=E,n.length-=E;m[_++]=O[D++],--E;);n.length===0&&(n.mode=21);break;case 26:if(y===0)break e;m[_++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(v===0)break e;v--,b|=p[g++]<<x,x+=8}if(C-=y,e.total_out+=C,n.total+=C,C&&(e.adler=n.check=n.flags?a(n.check,m,C,_-C):i(n.check,m,C,_-C)),C=y,(n.flags?b:h(b))!==n.check){e.msg=`incorrect data check`,n.mode=30;break}x=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(4294967295&n.total)){e.msg=`incorrect length check`,n.mode=30;break}x=b=0}n.mode=29;case 29:F=1;break e;case 30:F=-3;break e;case 31:return-4;case 32:default:return d}return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,(n.wsize||C!==e.avail_out&&n.mode<30&&(n.mode<27||t!==4))&&T(e,e.output,e.next_out,C-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,C-=e.avail_out,e.total_in+=S,e.total_out+=C,n.total+=C,n.wrap&&C&&(e.adler=n.check=n.flags?a(n.check,m,C,e.next_out-C):i(n.check,m,C,e.next_out-C)),e.data_type=n.bits+(n.last?64:0)+(n.mode===12?128:0)+(n.mode===20||n.mode===15?256:0),(S==0&&C===0||t===4)&&F===u&&(F=-5),F)},n.inflateEnd=function(e){if(!e||!e.state)return d;var t=e.state;return t.window&&=null,e.state=null,u},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,u):d},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?(n=e.state).wrap!==0&&n.mode!==11?d:n.mode===11&&i(1,t,r,0)!==n.check?-3:T(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,u):d},n.inflateInfo=`pako inflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e(`../utils/common`),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,c,l,u,d,f){var p,m,h,g,_,v,y,b,x,S=f.bits,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,ee=null,N=0,P=new r.Buf16(16),F=new r.Buf16(16),I=null,L=0;for(C=0;C<=15;C++)P[C]=0;for(w=0;w<c;w++)P[t[n+w]]++;for(D=S,E=15;1<=E&&P[E]===0;E--);if(E<D&&(D=E),E===0)return l[u++]=20971520,l[u++]=20971520,f.bits=1,0;for(T=1;T<E&&P[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=P[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(F[1]=0,C=1;C<15;C++)F[C+1]=F[C]+P[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[F[t[n+w]]++]=w);if(v=e===0?(ee=I=d,19):e===1?(ee=i,N-=257,I=a,L-=257,256):(ee=o,I=s,-1),C=T,_=u,k=w=M=0,h=-1,g=(j=1<<(O=D))-1,e===1&&852<j||e===2&&592<j)return 1;for(;;){for(y=C-k,x=d[w]<v?(b=0,d[w]):d[w]>v?(b=I[L+d[w]],ee[N+d[w]]):(b=96,0),p=1<<C-k,T=m=1<<O;l[_+(M>>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<<C-1;M&p;)p>>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--P[C]==0){if(C===E)break;C=t[n+d[w]]}if(D<C&&(M&g)!==h){for(k===0&&(k=D),_+=T,A=1<<(O=C-k);O+k<E&&!((A-=P[O+k])<=0);)O++,A<<=1;if(j+=1<<O,e===1&&852<j||e===2&&592<j)return 1;l[h=M&g]=D<<24|O<<16|_-u|0}}return M!==0&&(l[_+M]=C-k<<24|4194304),f.bits=D,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}},{}],52:[function(e,t,n){var r=e(`../utils/common`),i=0,a=1;function o(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,c=29,l=256,u=l+1+c,d=30,f=19,p=2*u+1,m=15,h=16,g=7,_=256,v=16,y=17,b=18,x=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],S=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=Array(2*(u+2));o(T);var E=Array(2*d);o(E);var D=Array(512);o(D);var O=Array(256);o(O);var k=Array(c);o(k);var A,j,M,ee=Array(d);function N(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function P(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function F(e){return e<256?D[e]:D[256+(e>>>7)]}function I(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function L(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,I(e,e.bi_buf),e.bi_buf=t>>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function R(e,t,n){L(e,n[2*t],n[2*t+1])}function z(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function te(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=z(a[s]++,s))}}function B(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<d;t++)e.dyn_dtree[2*t]=0;for(t=0;t<f;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function ne(e){8<e.bi_valid?I(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function re(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ie(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&re(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!re(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ae(e,t,n){var r,i,a,o,s=0;if(e.last_lit!==0)for(;r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,r===0?R(e,i,t):(R(e,(a=O[i])+l+1,t),(o=x[a])!==0&&L(e,i-=k[a],o),R(e,a=F(--r),n),(o=S[a])!==0&&L(e,r-=ee[a],o)),s<e.last_lit;);R(e,_,t)}function oe(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<c;n++)a[2*n]===0?a[2*n+1]=0:(e.heap[++e.heap_len]=l=n,e.depth[n]=0);for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)ie(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ie(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ie(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(a=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(a=g,_++),c[2*r+1]=a,l<r||(e.bl_count[a]++,o=0,h<=r&&(o=f[r-h]),s=c[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(u[2*r+1]+o)));if(_!==0){do{for(a=g-1;e.bl_count[a]===0;)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(a=g;a!==0;a--)for(r=e.bl_count[a];r!==0;)l<(i=e.heap[--n])||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),r--)}}(e,t),te(a,l,e.bl_count)}function se(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<c&&i===o||(s<l?e.bl_tree[2*i]+=s:i===0?s<=10?e.bl_tree[2*y]++:e.bl_tree[2*b]++:(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*v]++),a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4))}function V(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<c&&i===o)){if(s<l)for(;R(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(R(e,y,e.bl_tree),L(e,s-3,3)):(R(e,b,e.bl_tree),L(e,s-11,7)):(i!==a&&(R(e,i,e.bl_tree),s--),R(e,v,e.bl_tree),L(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(ee);var ce=!1;function le(e,t,n,i){L(e,(s<<1)+ +!!i,3),function(e,t,n,i){ne(e),i&&(I(e,n),I(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){ce||=(function(){var e,t,n,r,i,a=Array(m+1);for(r=n=0;r<c-1;r++)for(k[r]=n,e=0;e<1<<x[r];e++)O[n++]=r;for(O[n-1]=r,r=i=0;r<16;r++)for(ee[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(ee[r]=i<<7,e=0;e<1<<S[r]-7;e++)D[256+i++]=r;for(t=0;t<=m;t++)a[t]=0;for(e=0;e<=143;)T[2*e+1]=8,e++,a[8]++;for(;e<=255;)T[2*e+1]=9,e++,a[9]++;for(;e<=279;)T[2*e+1]=7,e++,a[7]++;for(;e<=287;)T[2*e+1]=8,e++,a[8]++;for(te(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=z(e,5);A=new N(T,x,l+1,u,m),j=new N(E,S,0,d,m),M=new N([],C,0,f,g)}(),!0),e.l_desc=new P(e.dyn_ltree,A),e.d_desc=new P(e.dyn_dtree,j),e.bl_desc=new P(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,B(e)},n._tr_stored_block=le,n._tr_flush_block=function(e,t,n,r){var o,s,c=0;0<e.level?(e.strm.data_type===2&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t<l;t++)if(e.dyn_ltree[2*t]!==0)return a;return i}(e)),oe(e,e.l_desc),oe(e,e.d_desc),c=function(e){var t;for(se(e,e.dyn_ltree,e.l_desc.max_code),se(e,e.dyn_dtree,e.d_desc.max_code),oe(e,e.bl_desc),t=f-1;3<=t&&e.bl_tree[2*w[t]+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?le(e,t,n,r):e.strategy===4||s===o?(L(e,2+ +!!r,3),ae(e,T,E)):(L(e,4+ +!!r,3),function(e,t,n,r){var i;for(L(e,t-257,5),L(e,n-1,5),L(e,r-4,4),i=0;i<r;i++)L(e,e.bl_tree[2*w[i]+1],3);V(e,e.dyn_ltree,t-1),V(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),ae(e,e.dyn_ltree,e.dyn_dtree)),B(e),r&&ne(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*F(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){L(e,2,3),R(e,_,T),function(e){e.bi_valid===16?(I(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];return s[o]={callback:e,args:t},n(o),o++},u.clearImmediate=d}function d(e){delete s[e]}function f(e){if(c)setTimeout(f,0,e);else{var n=s[e];if(n){c=!0;try{(function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}})(n)}finally{d(e),c=!1}}}}function p(t){t.source===e&&typeof t.data==`string`&&t.data.indexOf(a)===0&&f(+t.data.slice(a.length))}})(typeof self>`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1),Qs=e=>{if(!e.startsWith(`theme/edit/`))return{themeName:null,isInvalid:!1};let t=e.slice(11).split(`?`)[0];if(!t||t.includes(`/`))return{themeName:null,isInvalid:!0};try{let e=decodeURIComponent(t);return!e||e.includes(`/`)?{themeName:null,isInvalid:!0}:{themeName:e,isInvalid:!1}}catch{return{themeName:null,isInvalid:!0}}},$s={maxFiles:1e3,maxExtractedBytes:32*1024*1024},ec=class extends Error{reason;constructor(e,t){super(t),this.name=`ThemeArchiveExtractionError`,this.reason=e}},tc=new Set([`css`,`cjs`,`hbs`,`handlebars`,`htm`,`html`,`js`,`json`,`less`,`md`,`markdown`,`mjs`,`sass`,`scss`,`svg`,`txt`,`xml`,`yaml`,`yml`]),nc=new Set([`.editorconfig`,`.eslintignore`,`.eslintrc`,`.gitattributes`,`.gitignore`,`.npmignore`,`.prettierignore`,`.prettierrc`,`CODEOWNERS`,`LICENSE`,`LICENCE`,`NOTICE`,`Procfile`]),rc=e=>{if(tc.has(ic(e)))return!0;let t=e.split(`/`).at(-1)||e;return nc.has(t)},ic=e=>{let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()},ac=e=>{let t=e.trim().replace(/^\/+/,``).replace(/\/+/g,`/`);if(!t)return null;let n=t.split(`/`).filter(Boolean);return n.length===0||n.some(e=>e===`.`||e===`..`)?null:n.join(`/`)},oc=e=>[`casper`,`source`].includes(e.toLowerCase()),sc=e=>{if(e.length===0)return``;let t=e[0].indexOf(`/`);if(t<=0)return``;let n=e[0].slice(0,t+1);return e.every(e=>e.startsWith(n))?n:``},cc=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t,date:new Date(t.date),binary:t.binary?new Uint8Array(t.binary):null}])),lc=`Failed to open the theme archive. Download the theme again and retry.`,uc=e=>{let t=e/(1024*1024);return Number.isInteger(t)?`${t} MB`:`${t.toFixed(1)} MB`},dc=e=>{let t=[];return e.forEach((e,n)=>{n.dir||t.push([e,n])}),t},fc=e=>{if(e.length>$s.maxFiles)throw new ec(`too_many_files`,`This theme archive contains too many files for the browser editor (${e.length}/${$s.maxFiles}).`)},pc=async e=>{try{return await Zs.default.loadAsync(e)}catch{throw new ec(`invalid_archive`,lc)}},mc=async e=>{try{return await e.async(`uint8array`)}catch{throw new ec(`invalid_archive`,lc)}},hc=async e=>{try{return await e.async(`string`)}catch{throw new ec(`invalid_archive`,lc)}},gc=e=>{let t=ac(e);if(!t||t!==e)throw new ec(`invalid_archive`,lc);return t},_c=(e,t)=>{let n=e+t;if(n>$s.maxExtractedBytes)throw new ec(`too_large`,`This theme archive is too large to open in the browser editor. Extracted files must stay under ${uc($s.maxExtractedBytes)}.`);return n},vc=async e=>{let t=dc(await pc(e));fc(t);let n=sc(t.map(([e])=>e)),r={},i=new TextEncoder,a=0;for(let[e,o]of t){let t=n?e.slice(n.length):e;if(!t)continue;let s=gc(t);if(rc(s))try{let e=await hc(o);a=_c(a,i.encode(e).byteLength),r[s]={path:s,editable:!0,content:e,binary:null,date:o.date||new Date,unixPermissions:typeof o.unixPermissions==`number`?o.unixPermissions:null,dosPermissions:typeof o.dosPermissions==`number`?o.dosPermissions:null};continue}catch{}let c=await mc(o);a=_c(a,c.byteLength),r[s]={path:s,editable:!1,content:null,binary:c,date:o.date||new Date,unixPermissions:typeof o.unixPermissions==`number`?o.unixPermissions:null,dosPermissions:typeof o.dosPermissions==`number`?o.dosPermissions:null}}return{files:r,rootPrefix:n}},yc=async({files:e,rootPrefix:t})=>{let n=new Zs.default;for(let[r,i]of Object.entries(e)){let e=`${t}${r}`,a={date:i.date,createFolders:!0,unixPermissions:i.unixPermissions??void 0,dosPermissions:i.dosPermissions??void 0};i.editable?n.file(e,i.content??``,a):n.file(e,i.binary,{...a,binary:!0})}return n.generateAsync({type:`blob`,mimeType:`application/zip`,compression:`DEFLATE`,compressionOptions:{level:6}})},bc=({baseFiles:e,currentFiles:t})=>{let n=new Set([...Object.keys(e),...Object.keys(t)]),r=[];for(let i of Array.from(n).sort()){let n=e[i],a=t[i];if(!n&&a){r.push({path:i,editable:a.editable,status:`added`});continue}if(n&&!a){r.push({path:i,editable:n.editable,status:`deleted`});continue}!n||!a||n.editable&&a.editable&&n.content!==a.content&&r.push({path:i,editable:!0,status:`modified`})}return r},xc=({files:e,oldPrefix:t,newPrefix:n})=>{let r={};for(let[i,a]of Object.entries(e)){if(!i.startsWith(t)){r[i]=a;continue}let e=`${n}${i.slice(t.length)}`;r[e]={...a,path:e}}return r},Sc=e=>{switch(ic(e)){case`css`:case`scss`:case`sass`:case`less`:return ee(()=>import(`./dist-Q1p9iXwH.js`).then(e=>e.r).then(e=>e.css()),__vite__mapDeps([0,1,2,3]),import.meta.url);case`js`:case`cjs`:case`mjs`:return ee(()=>import(`./dist-DG78yroX.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([4,1,2,5,3]),import.meta.url);case`json`:return ee(()=>import(`./dist-DCk0UkGx.js`).then(e=>e.json()),__vite__mapDeps([6,2,3]),import.meta.url);case`md`:case`markdown`:return ee(()=>import(`./dist-DyViJwIy.js`).then(e=>e.markdown()),__vite__mapDeps([7,2,5,8,3,0,1,4]),import.meta.url);case`yaml`:case`yml`:return ee(()=>import(`./dist-t6AXpf_4.js`).then(e=>e.yaml()),__vite__mapDeps([9,2,3]),import.meta.url);case`hbs`:case`handlebars`:case`html`:case`htm`:case`svg`:case`xml`:return ee(()=>import(`./dist-pHiOxyxa.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url);default:return ee(()=>import(`./dist-pHiOxyxa.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url)}},Cc=e=>{let t=ic(e);if(!t)return`text`;switch(t){case`hbs`:return`handlebars`;case`htm`:return`html`;case`yml`:return`yaml`;default:return t}},wc=e=>{if(e[`package.json`]?.editable)return{type:`file`,path:`package.json`};let t=Object.keys(e).sort().find(t=>e[t].editable);if(t)return{type:`file`,path:t};let n=Object.keys(e).sort()[0];return n?{type:`file`,path:n}:null},Tc=e=>{let t=e.split(`/`),n=[``];for(let e=0;e<t.length-1;e+=1)n.push(`${t.slice(0,e+1).join(`/`)}/`);return n},Ec=[`theme`,`design`],Dc=e=>Ec.some(t=>e===t||e.startsWith(`${t}/`)),Oc=()=>{let e=window.location.hash.substring(1),t=`${window.location.protocol}//${window.location.hostname}`,n;try{n=new URL(e||`/`,t)}catch{return null}let r=n.searchParams.get(`from`);return r===null?null:r===``||Dc(r)?r:null},kc=(e,t)=>{let n=`theme/edit/${encodeURIComponent(e)}`;return t===null?n:`${n}?from=${encodeURIComponent(t)}`},Ac=(e,t)=>!e.editable&&rc(t),jc=/^[a-z0-9][\w-]{0,63}$/,Mc={COMPRESSED_TOO_LARGE:`Theme too large to upload`,ENTRY_TOO_LARGE:`File too large`,TOTAL_TOO_LARGE:`Theme contents too large`},Nc=e=>{if(!e||e<=0)return`the allowed size`;let t=e/(1024*1024);return t>=1?`${t.toFixed(1)} MB`:`${Math.round(e/1024)} KB`},Pc=e=>{let{entryName:t,limitBytes:n}=e.errorDetails??{},r=Nc(n);switch(e.code){case`COMPRESSED_TOO_LARGE`:return`The theme archive is too large to upload (max ${r}).`;case`ENTRY_TOO_LARGE`:return t?`The file "${t}" is too large (max ${r} per file).`:`One of the files is too large (max ${r} per file).`;case`TOTAL_TOO_LARGE`:return`The theme contents exceed the maximum allowed size of ${r}.`;default:return e.message||`Theme upload failed.`}},Fc=e=>`inline-flex h-5 w-5 items-center justify-center rounded-sm text-[#c8ccd3] transition-opacity hover:opacity-100 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#4a9eff] ${e?`opacity-100`:`opacity-60`}`,Ic=`flex h-full items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]`,Lc=Oi.theme({"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`#355070`},".cm-content ::selection":{color:`#ffffff`}},{dark:!0}),Rc=({themeName:e})=>{let t=Oe(),{updateRoute:n}=V(),r=c(),i=h(),{data:a}=pi(),[o,s]=(0,Z.useState)(e),[l,u]=(0,Z.useState)({}),[f,p]=(0,Z.useState)({}),[m,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(null),[y,x]=(0,Z.useState)(new Set([``])),[S,C]=(0,Z.useState)(!0),[w,T]=(0,Z.useState)(!1),[E,D]=(0,Z.useState)(null),[O,k]=(0,Z.useState)(!1),[A,j]=(0,Z.useState)([]);(0,Z.useEffect)(()=>{let t=!0,n=()=>{s(e),u({}),p({}),g(``),v(null),x(new Set([``]))};return(async()=>{C(!0),D(null),n();try{let{apiRoot:n}=d(),r=await fetch(`${n}/themes/${encodeURIComponent(e)}/download/`,{credentials:`include`,headers:{Accept:`application/zip, application/octet-stream, */*`}});if(!r.ok)throw Error(`Failed to load theme "${e}" (${r.status})`);let i=await vc(await r.arrayBuffer()),a=cc(i.files),o=wc(a);if(!t)return;s(e),u(cc(i.files)),p(a),g(i.rootPrefix),v(o),x(new Set(o?.type===`file`?Tc(o.path):[``]))}catch(e){if(!t)return;D(e instanceof Error?e.message:`Failed to load theme`)}finally{t&&C(!1)}})(),()=>{t=!1}},[e]),(0,Z.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[]);let M=(0,Z.useMemo)(()=>bc({baseFiles:l,currentFiles:f}),[l,f]),ee=(0,Z.useMemo)(()=>new Map(M.map(e=>[e.path,e.status])),[M]),N=_?.type===`file`?f[_.path]:null;(0,Z.useEffect)(()=>{let e=!0;return N?.editable?(Sc(N.path).then(t=>{e&&j([Mt({top:!0}),jt,t,...O?[Oi.lineWrapping]:[],Lc])}).catch(()=>{e&&j([Mt({top:!0}),jt,...O?[Oi.lineWrapping]:[],Lc])}),()=>{e=!1}):(j([]),()=>{e=!1})},[O,N]);let P=async({title:e,prompt:t,cancelLabel:n,okLabel:r,okVariant:i})=>!!await H.show(Vs,{title:e,prompt:t,cancelLabel:n,okLabel:r,okVariant:i}),F=async({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o})=>await H.show(Hs,{title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o}),I=async()=>{M.length>0&&!await P({title:`Discard changes?`,prompt:`You have unsaved theme changes. Close the editor and discard them?`,okLabel:`Discard changes`,okVariant:`destructive`})||(t.remove(),n(Oc()??`design/change-theme`))},L=(0,Z.useRef)(()=>{});(0,Z.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`){e.preventDefault(),L.current();return}e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[]);let R=e=>{x(t=>{let n=new Set(t);for(let t of Tc(e))n.add(t);return n})},z=(e,t)=>{if(p(e),t){v(t),t.type===`file`&&R(t.path);return}_?.type===`file`&&e[_.path]||v(wc(e))},te=async()=>{let e=await F({title:`Create file`,fieldTitle:`File path`,initialValue:`partials/new-file.hbs`,okLabel:`Create file`,prompt:`Add a new editable file to this theme.`}),t=e?ac(e):null;if(!t)return;if(!rc(t)){b.error(`Only text files can be created here`,{description:`Use a text-based theme file extension such as .hbs, .css, .js, or .json.`});return}if(f[t]){b.error(`File already exists`);return}let n={...f,[t]:{path:t,editable:!0,content:``,binary:null,date:new Date,unixPermissions:null,dosPermissions:null}};z(n,{type:`file`,path:t})},B=async()=>{if(!_)return;let e=_.type===`dir`?_.path.replace(/\/$/,``):_.path,t=_.type===`dir`?`Rename folder to`:`Rename file to`,n=await F({title:_.type===`dir`?`Rename folder`:`Rename file`,fieldTitle:`Path`,initialValue:e,okLabel:`Rename`,prompt:t}),r=n?ac(n):null;if(!r||r===e)return;if(_.type===`file`){let e=f[_.path];if(!rc(r)&&e.editable){b.error(`Text files must keep a text file extension`);return}if(Ac(e,r)){b.error(`Binary files cannot be renamed to a text file`,{description:`Rename this file with a non-text extension to keep its contents intact.`});return}if(f[r]){b.error(`A file with that name already exists`);return}let t={...f},n=t[_.path];delete t[_.path],t[r]={...n,path:r,editable:rc(r)},z(t,{type:`file`,path:r});return}let i=`${r}/`;if(i.startsWith(_.path)){b.error(`A folder cannot be renamed inside itself`);return}if(Object.keys(f).find(e=>e.startsWith(i))){b.error(`A folder with that path already exists`);return}let a=xc({files:f,oldPrefix:_.path,newPrefix:i});z(a,{type:`dir`,path:i}),x(e=>{let t=new Set;for(let n of e){if(!n.startsWith(_.path)){t.add(n);continue}t.add(`${i}${n.slice(_.path.length)}`)}return t})},ne=async()=>{if(!_)return;if(_.type===`file`){if(!await P({title:`Delete file`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`Delete `,(0,Q.jsx)(`strong`,{children:_.path}),` from this theme?`]}),okLabel:`Delete`,okVariant:`destructive`}))return;let e={...f};delete e[_.path],z(e);return}let e=Object.keys(f).filter(e=>e.startsWith(_.path));if(!e.length||!await P({title:`Delete folder`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`Delete `,e.length,` file`,e.length===1?``:`s`,` from `,(0,Q.jsx)(`strong`,{children:_.path}),`?`]}),okLabel:`Delete`,okVariant:`destructive`}))return;let t={...f};for(let n of e)delete t[n];z(t)},re=e=>{let t=l[e],n=f[e],r={...f};!t&&n?delete r[e]:t&&(r[e]={...t,binary:t.binary?new Uint8Array(t.binary):null}),z(r)},ie=async()=>{let e=(await F({title:`Save as new theme`,fieldTitle:`Theme name`,initialValue:`${o}-edited`,okLabel:`Continue`,prompt:`Default themes cannot be overwritten. Save your edits as a new theme instead.`}))?.trim().toLowerCase();return e?jc.test(e)?oc(e)?(b.error(`Built-in themes cannot be overwritten`),null):e:(b.error(`Invalid theme name`,{description:`Use 1-64 characters, starting with a letter or number. Allowed: letters, numbers, dashes, and underscores.`}),null):null},ae=async()=>{if(w)return;if(M.length===0){b.info(`No changes to save`);return}let e=o,t=oc(e)?await ie():e;if(!t)return;let c=t!==e,l=a?.themes.some(e=>e.name===t)||!1,p=c?`Save your edits as "${t}"?`:`Upload ${M.length} changed file${M.length===1?``:`s`} and replace "${e}"?`;if(await P({title:c?`Save theme as new copy`:`Update theme`,prompt:p,okLabel:c?`Save theme`:`Replace theme`})&&!(c&&l&&!await P({title:`Overwrite theme`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:t}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,okVariant:`destructive`}))){T(!0);try{let e=await yc({files:f,rootPrefix:m}),i=new FormData;i.append(`file`,e,`${t}.zip`);let a=await fetch(`${d().apiRoot}/themes/upload/`,{method:`POST`,credentials:`include`,headers:{Accept:`application/json`},body:i}),o=await a.json().catch(()=>null);if(!a.ok){if(a.status===422&&o?.errors){H.show(Co,{title:`Theme not saved`,fatalErrors:o.errors});return}let e=o?.errors?.[0];if(e?.code&&Mc[e.code]){b.error(Mc[e.code],{description:Pc(e)});return}throw Error(e?.message||`Theme upload failed.`)}let l=o.themes[0],p=Oc();u(cc(f)),c&&(s(t),g(m?`${t}/`:``),n(kc(t,p))),await r.invalidateQueries({queryKey:[`ThemesResponseType`]}),c||l.errors?.length||l.warnings?.length?H.show(Lo,{title:c?`Theme saved`:`Theme updated`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:l.name}),` saved successfully.`]}),installedTheme:l}):b.success(`Theme saved`,{description:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`capitalize`,children:l.name}),` has been updated.`]})})}catch(e){i(e)}finally{T(!1)}}};(0,Z.useEffect)(()=>{L.current=ae});let oe=e=>{v({type:`file`,path:e}),R(e)},se=N?ee.get(N.path):null;return(0,Q.jsx)(`div`,{"aria-label":`Edit theme ${e}`,"aria-modal":`true`,className:`dark fixed inset-0 z-[140] bg-[rgba(10,11,13,0.72)] text-[#e6e7ea] backdrop-blur-[4px]`,"data-testid":`theme-code-editor-modal`,role:`dialog`,onClick:e=>{e.target===e.currentTarget&&I()},children:(0,Q.jsxs)(`div`,{className:`relative flex size-full flex-col overflow-hidden bg-[#15171a]`,children:[(0,Q.jsx)(Ks,{changes:M,currentThemeName:o,isSaving:w,onClose:I,onSave:()=>void ae()}),E&&(0,Q.jsx)(`div`,{className:`border-b border-[#512828] bg-[#3a1d1d] px-4 py-2 text-[12px] text-[#ffbdbd]`,children:E}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Q.jsx)(Xs,{changesMap:ee,currentFiles:f,expandedDirectories:y,isLoading:S,selectedNode:_,setExpandedDirectories:x,setSelectedNode:v,onCreateFile:te,onDeleteSelected:ne,onOpenFile:oe,onRenameSelected:B}),(0,Q.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-[#16181c]`,children:[(0,Q.jsx)(`div`,{className:`flex items-center gap-2 border-b border-[#23262c] bg-[#17191d] px-4 py-2 text-[12px] text-[#8a8f98]`,children:N?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-[#e6e7ea]`,children:N.path}),(0,Q.jsx)(`span`,{className:`rounded bg-[#2a2d33] px-2 py-0.5 text-[10px] tracking-[0.04em] text-[#c8ccd3] uppercase`,children:Cc(N.path)}),se&&(0,Q.jsxs)(`button`,{className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] tracking-[0.04em] uppercase ${se===`deleted`?`bg-[#4a2222] text-[#ffbdbd]`:se===`added`?`bg-[#17342a] text-[#a5e8c8]`:`bg-[#3b2a16] text-[#f5a623]`}`,type:`button`,onClick:()=>re(N.path),children:[(0,Q.jsx)(Ei,{size:11}),`Revert`]}),(0,Q.jsx)(`div`,{className:`grow`}),N.editable&&(0,Q.jsx)(`button`,{"aria-label":O?`Disable text wrap`:`Enable text wrap`,"aria-pressed":O,className:Fc(O),title:O?`Disable text wrap`:`Enable text wrap`,type:`button`,onClick:()=>k(e=>!e),children:(0,Q.jsx)(Sr,{className:`shrink-0`,size:14,strokeWidth:2})})]}):(0,Q.jsx)(`span`,{children:`No file selected`})}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[!_&&!S&&(0,Q.jsx)(`div`,{className:Ic,children:`Select a file from the tree to start editing.`}),_?.type===`dir`&&(0,Q.jsx)(`div`,{className:Ic,children:`Folder selected. Choose a file to edit, or rename or delete the folder from the file pane.`}),N&&!N.editable&&(0,Q.jsx)(`div`,{className:Ic,children:`This file cannot be edited in the browser.`}),N?.editable&&(0,Q.jsx)(Nt,{basicSetup:{highlightActiveLine:!1,highlightActiveLineGutter:!1},className:`h-full [&_.cm-button]:h-8 [&_.cm-button]:rounded-md [&_.cm-button]:border [&_.cm-button]:border-[#2f333b] [&_.cm-button]:bg-[#1f2228] [&_.cm-button]:bg-none [&_.cm-button]:px-3 [&_.cm-button]:text-[13px] [&_.cm-button]:text-[#c8ccd3] [&_.cm-button:hover]:bg-[#2a2d33] [&_.cm-content]:min-h-full [&_.cm-content]:py-3 [&_.cm-content_*::selection]:bg-[#355070] [&_.cm-cursor]:border-l-[#e6e7ea] [&_.cm-editor]:h-full [&_.cm-editor]:rounded-none [&_.cm-editor]:border-0 [&_.cm-editor]:bg-[#16181c] [&_.cm-gutters]:border-r-[#23262c] [&_.cm-gutters]:bg-[#17191d] [&_.cm-line::selection]:bg-[#355070] [&_.cm-panel]:bg-[#17191d] [&_.cm-panel]:shadow-none [&_.cm-panel.cm-search]:gap-2 [&_.cm-panel.cm-search]:px-3 [&_.cm-panel.cm-search]:py-2 [&_.cm-panel.cm-search]:text-[13px] [&_.cm-panels]:border-b [&_.cm-panels]:border-[#23262c] [&_.cm-panels]:bg-[#17191d] [&_.cm-panels]:text-[#c8ccd3] [&_.cm-scroller]:min-h-full [&_.cm-scroller]:overflow-auto [&_.cm-scroller]:bg-[#16181c] [&_.cm-search]:flex [&_.cm-search]:flex-wrap [&_.cm-search]:items-center [&_.cm-search]:gap-2 [&_.cm-search_label]:inline-flex [&_.cm-search_label]:items-center [&_.cm-search_label]:gap-1.5 [&_.cm-search_label]:text-[#a5abb4] [&_.cm-search_label_input]:size-4 [&_.cm-search_label_input]:accent-[#14b886] [&_.cm-searchMatch]:bg-[#243043] [&_.cm-searchMatch-selected]:bg-[#3b2a16] [&_.cm-searchMatch-selected]:outline-none [&_.cm-selectionBackground]:!bg-[#355070] [&_.cm-selectionLayer_.cm-selectionBackground]:!bg-[#355070] [&_.cm-textfield]:h-8 [&_.cm-textfield]:min-w-[220px] [&_.cm-textfield]:rounded-md [&_.cm-textfield]:border [&_.cm-textfield]:border-[#2f333b] [&_.cm-textfield]:bg-[#16181c] [&_.cm-textfield]:px-2.5 [&_.cm-textfield]:text-[#e6e7ea] [&_.cm-textfield]:outline-none [&_.cm-textfield]:placeholder:text-[#6a6f78]`,extensions:A,height:`full`,theme:jt,value:N.content||``,autoFocus:!0,onChange:e=>{p(t=>({...t,[N.path]:{...t[N.path],content:e}}))}},`${N.path}:${A.length}`)]})]})]})]})})},zc=H.create(({pathName:e})=>{let t=Oe(),{route:n,updateRoute:r}=V(),i=n||e,[a,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(!1),{checkThemeLimitError:h,isThemeLimitCheckReady:g,noThemeChangesAllowed:_,isThemeLimited:v}=gt(),[y,b]=(0,Z.useState)(null),[x,S]=(0,Z.useState)(!1),{themeName:C,isInvalid:w}=Qs(i),T=i===`design/edit`||i===`design/change-theme`||i===`theme/install`||i.startsWith(`theme/edit/`),E=(0,Z.useCallback)(e=>{H.show(ke,{prompt:e,onOk:()=>r({route:`/pro`,isExternal:!0})})},[r]);if((0,Z.useEffect)(()=>{i===`design/change-theme`&&g?(async()=>{if(!_){c(!1),o(null);return}c(!0);let e=await h();o(e),c(!1),e&&(E(e),t.remove())})():(o(null),c(!1))},[h,i,g,t,_,E]),(0,Z.useEffect)(()=>{i!==`theme/install`&&(S(!1),b(null),u(!1))},[i]),(0,Z.useEffect)(()=>{w&&(t.remove(),r(`theme`))},[w,t,r]),(0,Z.useEffect)(()=>{T||t.remove()},[T,t]),(0,Z.useEffect)(()=>{let e=!1;return(async()=>{if(!C){f(null),m(!1);return}if(!g){m(!0);return}if(!v){f(null),m(!1);return}m(!0);let n=await h(`.`);e||(f(n),m(!1),n&&(E(n),t.remove(),r(`theme`)))})(),()=>{e=!0}},[h,C,g,v,t,E,r]),(0,Z.useEffect)(()=>{let e=()=>{let e=window.location.href.split(`#`)[1]?.split(`?`)[1];return e?new URLSearchParams(e).get(`ref`):null},n=e=>{b(!1),_?(E(e),window.history.replaceState({},``,window.location.pathname+window.location.hash.split(`?`)[0]),t.remove(),r(`theme`)):(E(e),t.remove(),r(`theme`))};(async()=>{if(i!==`theme/install`){u(!1);return}if(S(!0),!g){u(!0);return}if(!v){b(!0),u(!1);return}u(!0);let t=e();if(!t){b(!1),u(!1);return}let r=t.split(`/`)[1]?.toLowerCase(),a=await h(r);if(i!==`theme/install`){u(!1);return}if(a){b(!1),u(!1),n(a);return}b(!0),u(!1)})()},[h,i,g,_,v,t,E,r]),i===`design/edit`)return(0,Q.jsx)(Bs,{});if(i===`design/change-theme`)return s||a?null:(0,Q.jsx)(Ko,{});if(i===`theme/install`){if(!x||!g||l||y===null||!y)return null;let e=window.location.href.split(`#`)[1]?.split(`?`)[1],t=null,n=null;if(e){let r=new URLSearchParams(e);t=r.get(`ref`),n=r.get(`source`)}return(0,Q.jsx)(Ko,{source:n,themeRef:t})}else if(i.startsWith(`theme/edit/`))return w||!C||p||d?null:(0,Q.jsx)(Rc,{themeName:C});else return null}),Bc=({backgroundColor:e,html:t,style:n})=>{let r=(0,Z.useRef)(e),i=(0,Z.useRef)(t),a=!!t;return r.current=e,i.current=t,(0,Q.jsx)(Ha,{className:`absolute size-full overflow-hidden transition-opacity duration-500`,generateContent:(0,Z.useCallback)(e=>{let t=e.contentDocument||e.contentWindow?.document;if(!t)return;e.dataset.previewLayout=n;let a=`
|
|
24
|
+
<html>
|
|
25
|
+
<head>
|
|
26
|
+
<style>body, html {height: 100%; padding: 0; margin: 0; overflow: hidden; background: ${r.current}; transition: background-color 200ms ease;}</style>
|
|
27
|
+
<style>${n}</style>
|
|
28
|
+
</head>
|
|
29
|
+
<body>${i.current}</body>
|
|
30
|
+
</html>
|
|
31
|
+
`;t.open(),t.write(a),t.close()},[a,n]),height:`100%`,parentClassName:`relative h-full min-h-[400px] w-full`,updateContent:(0,Z.useCallback)(r=>{if(r.dataset.previewLayout!==n)return;let i=r.contentDocument||r.contentWindow?.document;if(!i)return;[i.documentElement,i.body].forEach(t=>{t.style.backgroundColor=e,t.style.transition=`background-color 200ms ease`});let a=new DOMParser().parseFromString(t,`text/html`).querySelector(`script`),o=i.querySelector(`script`);if(!a||!o)return;let s=new Map(Array.from(a.attributes).filter(e=>e.name.startsWith(`data-`)).map(e=>[e.name,e.value]));Array.from(o.attributes).filter(e=>e.name.startsWith(`data-`)&&!s.has(e.name)).forEach(e=>o.removeAttribute(e.name)),s.forEach((e,t)=>{o.getAttribute(t)!==e&&o.setAttribute(t,e)})},[e,t,n]),width:`100%`})},Vc=({selectedLayout:e,accentColor:t,handleColorToggle:n,selectedColor:r,selectedLabels:i,handleLabelClick:a,embedScript:o,handleLayoutSelect:s,handleCopyClick:c,isCopied:l,handleClose:u})=>{let{loadData:d}=E({path:`/labels/`,filterKey:`name`,responseKey:`labels`}),[f,p]=(0,Z.useState)(i||[]),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(!1),v=(0,Z.useRef)(0),y=(0,Z.useRef)(null),b=(0,Z.useRef)(d),x=(0,Z.useRef)(i);b.current=d,x.current=i;let S=(0,Z.useCallback)(async(e,t)=>{let n=x.current||[];try{let r=(await b.current(e)).map(e=>({label:e.name,value:e.name}));t===v.current&&p([...n,...r.filter(e=>!n.some(t=>t.value===e.value))])}catch{t===v.current&&p(n)}finally{t===v.current&&_(!1)}},[]),C=(0,Z.useCallback)((e,t=!1)=>{v.current+=1;let n=v.current;_(!0),y.current&&clearTimeout(y.current),t?y.current=setTimeout(()=>void S(e,n),500):S(e,n)},[S]);return(0,Z.useEffect)(()=>{p(e=>[...i||[],...e.filter(e=>!i?.some(t=>t.value===e.value))])},[i]),(0,Z.useEffect)(()=>()=>{v.current+=1,y.current&&clearTimeout(y.current)},[]),(0,Q.jsxs)(`div`,{className:`flex h-[calc(100vh-16vmin)] max-h-[645px] flex-col justify-between overflow-y-scroll border-grey-200 p-6 pb-0 max-lg:border-t lg:border-l dark:border-grey-900`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Tt,{as:`h4`,className:`mb-8 md:text-xl`,leading:`heading`,size:`lg`,weight:`bold`,children:`Embed signup form`}),(0,Q.jsxs)(tn,{className:`mb-10 gap-6`,children:[(0,Q.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,Q.jsx)(`div`,{children:`Layout`}),(0,Q.jsxs)(xn,{type:`single`,value:e,onValueChange:e=>e&&s(e),children:[(0,Q.jsx)(bn,{value:`all-in-one`,children:`Branded`}),(0,Q.jsx)(bn,{value:`minimal`,children:`Minimal`})]})]}),e===`all-in-one`&&(0,Q.jsx)(B,{debounceMs:200,direction:`rtl`,eyedropper:!0,swatches:[{hex:`#08090c`,title:`Dark`,value:`#08090c`},{hex:`#ffffff`,title:`Light`,value:`#ffffff`},{hex:t||`#d74780`,title:`Accent`,value:t||`#d74780`}],title:`Background color`,value:r,onChange:e=>{e&&n(e)}}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Labels at signup`}),(0,Q.jsxs)(Ne,{open:m,onOpenChange:e=>{h(e),e&&C(``)},children:[(0,Q.jsx)(lt,{"aria-label":`Labels at signup`,children:(0,Q.jsx)(Re,{placeholder:!i?.length,children:i?.length?i.map(e=>e.label).join(`, `):`Pick one or more labels (optional)`})}),(0,Q.jsx)(tt,{children:(0,Q.jsx)(pn,{footer:({searchInput:e,clearSearch:t})=>{let n=e.trim();return g||!n||f.some(e=>e.label.toLowerCase()===n.toLowerCase())?null:(0,Q.jsx)(`div`,{className:`border-t p-1`,children:(0,Q.jsxs)(`button`,{className:`flex h-8 w-full items-center justify-start gap-2 rounded-xs px-2 text-sm hover:bg-interactive-hover`,type:`button`,onClick:()=>{let e={label:n,value:n};p(t=>[...t,e]),a([...(i||[]).map(e=>e.value),n]),t()},children:[(0,Q.jsx)(gi,{className:`size-4`}),`Create “`,n,`”`]})})},isLoading:g,options:f,values:(i||[]).map(e=>e.value),onChange:a,onSearchChange:e=>C(e,!0)})})]}),(0,Q.jsx)(q,{children:`Will be applied to all members signing up via this form`})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`embed-signup-code`,children:`Embed code`}),(0,Q.jsx)(sn,{className:`resize-none border-transparent bg-muted font-mono`,id:`embed-signup-code`,value:`${o}`,readOnly:!0}),(0,Q.jsx)(q,{children:`Paste this code onto any website where you'd like your signup to appear.`})]})]})]}),(0,Q.jsx)(rt,{height:74,children:(0,Q.jsxs)(`div`,{className:`flex w-full justify-end gap-3`,children:[(0,Q.jsx)(cr,{className:`font-semibold lg:hidden`,type:`button`,variant:`ghost`,onClick:u,children:`Close`}),(0,Q.jsx)(cr,{type:`button`,onClick:c,children:l?`Copied!`:`Copy code`})]})})]})};function Hc(e){return e?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):``}var Uc=({preview:e,config:t,settings:n,labels:r,backgroundColor:i,layout:a})=>{let o=t.blogUrl,s=t.signupForm.url.replace(`{version}`,t.signupForm.version),c={site:o,locale:n.locale,"button-color":n.accentColor,"button-text-color":bt(n.accentColor).hex()};for(let[e,t]of r.entries())c[`label-${e+1}`]=t.name;let l=`min-height: 58px;max-width: 440px;margin: 0 auto;width: 100%`;a===`all-in-one`&&(n.icon&&n.icon!==``&&(c.icon=n.icon.replace(/\/content\/images\/(?:size\/[^/]+\/)*/,`/content/images/size/w192h192/`)),c.title=n.title,c.description=n.description,c[`background-color`]=i,c[`text-color`]=bt(i).hex(),l=`height: 40vmin;min-height: 360px`),e&&(l=a===`minimal`?`min-height: 58px; max-width: 440px;width: 100%;position: absolute; left: 50%; top:50%; transform: translate(-50%, -50%);`:`height: 100vh`);let u=``,d=[`background-color`,`text-color`,`button-color`,`button-text-color`,`title`,`description`,`icon`,`site`,`locale`],f=Object.keys(c).sort((e,t)=>d.indexOf(e)-d.indexOf(t));for(let e of f){let t=c[e];u+=` data-${e}="${Hc(t)}"`}let p=`<div style="${Hc(l)}"><script src="${encodeURI(s)}"${u} async><\/script></div>`;return e&&a===`minimal`?`<div style="position: absolute; z-index: -1; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);background-size: 16px 16px;background-position: 0 0, 8px 8px;;"></div>${p}`:p},Wc=H.create(()=>{let e=Oe(),[t,n]=(0,Z.useState)(`#08090c`),[r,i]=(0,Z.useState)([]),[a,o]=(0,Z.useState)(`all-in-one`),[s,c]=(0,Z.useState)(``),[l,u]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),{updateRoute:p}=V(),{config:m}=xt(),{localSettings:h,siteData:g}=ve(),[_,v,y,b,x]=Hn(h,[`accent_color`,`title`,`description`,`locale`,`icon`]),[S,C]=(0,Z.useState)({active:!1});return(0,Z.useEffect)(()=>{if(!g)return;let e={config:{blogUrl:g.url,signupForm:{url:m?.signupForm?.url,version:m?.signupForm?.version}},settings:{accentColor:_||`#d74780`,title:v||``,locale:b||`en`,icon:x||``,description:y||``},labels:r.map(({label:e})=>({name:e})),backgroundColor:t||`#08090c`,layout:a},n=Uc({preview:!0,...e});c(n);let i=Uc({preview:!1,...e});u(i)},[g,_,r,m,v,t,a,b,x,y]),(0,Q.jsx)(Ie,{afterClose:()=>{p(`embed-signup-form`)},cancelLabel:``,footer:!1,height:645,padding:!1,testId:`embed-signup-form`,title:``,topRightContent:`close`,width:1120,children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[5.2fr_2.8fr]`,children:[(0,Q.jsx)(Bc,{backgroundColor:t,html:s,style:a}),(0,Q.jsx)(Vc,{accentColor:_,customColor:S,embedScript:l,handleClose:()=>{e.remove(),p(`embed-signup-form`)},handleColorToggle:e=>{n(e)},handleCopyClick:async()=>{try{await navigator.clipboard.writeText(l),f(!0),setTimeout(()=>f(!1),2e3)}catch(e){console.error(`Failed to copy text: `,e)}},handleLabelClick:e=>{if(e.length){let t=e.map(e=>({label:e,value:e}));i(t)}else i([])},handleLayoutSelect:o,isCopied:d,selectedColor:t,selectedLabels:r,selectedLayout:a,setCustomColor:C})]})})}),Gc=H.create(()=>{let{updateRoute:e}=V(),{settings:t}=xt(),{mutateAsync:n}=Y(),r=h(),[i,a]=(0,Z.useState)(``),[o]=Hn(t,[`firstpromoter`]),[s]=Hn(t,[`firstpromoter_id`]),[c,l]=(0,Z.useState)(`Save`),[u,d]=(0,Z.useState)(!!o);(0,Z.useEffect)(()=>{d(o||!1),a(s||null)},[o,s]);let f=async()=>{let e=[{key:`firstpromoter`,value:u},{key:`firstpromoter_id`,value:i}];try{l(`Saving...`),await Promise.all([n(e),new Promise(e=>{setTimeout(e,1e3)})]),l(`Saved`)}catch(e){r(e)}finally{setTimeout(()=>l(`Save`),1e3)}};return(0,Q.jsxs)(Ie,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:u!==o||i!==s,okLabel:c,okVariant:`default`,testId:`firstpromoter-modal`,title:``,onOk:async()=>{try{await f()}catch(e){r(e)}},children:[(0,Q.jsx)(mt,{detail:`Launch your own member referral program`,icon:(0,Q.jsx)(it,{className:`-mt-2`,name:`firstpromoter`,size:56}),title:`FirstPromoter`}),(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsxs)(rn,{className:`gap-0`,children:[(0,Q.jsx)(on,{className:`mb-3 text-md! leading-supertight font-bold md:text-lg!`,children:`FirstPromoter configuration`}),(0,Q.jsxs)(tn,{className:`gap-8 rounded-sm border border-border-default p-4 md:p-7 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`firstpromoter-enabled`,children:`Enable FirstPromoter`}),(0,Q.jsxs)(q,{children:[`Enable `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://firstpromoter.com/?fpr=ghost&fp_sid=admin`,rel:`noopener noreferrer`,target:`_blank`,children:`FirstPromoter`}),` for tracking referrals`]})]}),(0,Q.jsx)(W,{checked:u,id:`firstpromoter-enabled`,onCheckedChange:d})]}),u&&(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`firstpromoter-account-id`,children:`FirstPromoter account ID`}),(0,Q.jsx)(X,{id:`firstpromoter-account-id`,placeholder:`XXXXXXXX`,value:i||``,onChange:e=>a(e.target.value)}),(0,Q.jsx)(q,{children:(0,Q.jsxs)(Q.Fragment,{children:[`Affiliate and referral tracking, find your ID `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/help/firstpromoter-id/`,rel:`noopener noreferrer`,target:`_blank`,children:`here`})]})})]})]})]})})]})}),Kc=({offset:e,onTrigger:t})=>{let n=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0].intersectionRatio<=0||t()});return n.current&&e.observe(n.current),()=>e.disconnect()},[t]),(0,Q.jsx)(`div`,{ref:n,className:`absolute w-full`,style:{bottom:e}})},qc=`ActionsResponseType`,Jc=(e,t)=>{let n=e=>e.event===`edited`&&typeof e.context?.action_name==`string`?e.context.action_name:``;return e.resource_id===t.resource_id&&e.resource_type===t.resource_type&&e.event===t.event&&n(e)===n(t)},Yc=_({dataType:qc,path:`/actions/`,returnData:e=>{let{pages:t}=e,n=t.flatMap(e=>e.actions.map(({context:e,...t})=>({...t,context:JSON.parse(e)})));n=n.reverse();let r=1;n.forEach((e,t)=>{let i=n[t+1];i&&Jc(e,i)?(e.skip=!0,r+=1):r>1&&(e.count=r,r=1)});let i=t[t.length-1].meta;return{actions:n.reverse(),meta:i,isEnd:i?i.pagination.pages===i.pagination.page:!0}}}),Xc=e=>{let t=e.resource_type;if(e.event!==`deleted`)switch(e.resource_type){case`page`:case`post`:return!e.resource||!e.resource.id?void 0:(t===`post`&&e.context?.type&&(t=e.context?.type),{isExternal:!0,route:`editor/${t}/${e.resource.id}`,models:[t,e.resource.id]});case`integration`:return!e.resource||!e.resource.id?void 0:{route:`integrations/${e.resource.id}`};case`offer`:return!e.resource||!e.resource.id?void 0:{isExternal:!0,route:`offers/${e.resource.id}`,models:[e.resource.id]};case`tag`:return!e.resource||!e.resource.slug?void 0:{isExternal:!0,route:`tag`,models:[e.resource.slug]};case`product`:return{route:`tiers`};case`user`:return!e.resource||!e.resource.slug?void 0:{route:`staff/${e.resource.slug}`}}},Zc=e=>{let t=e.resource_type;t===`api_key`?t=`API key`:t===`setting`?t=`settings`:t===`product`?t=`tier`:t===`gift_link`?t=`gift link`:t===`security_action`?t=`security action`:t===`member_custom_field`&&(t=`custom field`),t===`post`&&e.context?.type&&(t=e.context?.type);let n=e.event;return e.event===`edited`&&e.context?.action_name&&(n=e.context?.action_name),n===`reset_authentication`?n=`reset authentication`:n===`custom_fields_edited`&&(n=`custom fields edited`),e.context?.count&&e.context?.count>1?`${e.context?.count} ${t}s ${n}`:`${t.slice(0,1).toUpperCase()}${t.slice(1)} ${n}`},Qc=e=>{if(e.resource_type===`setting`&&e.context?.group&&e.context?.key)return{group:e.context?.group,key:e.context?.key}},$c=e=>typeof e.context?.count==`number`&&e.context?.count>1,el=({action:e})=>{let t=or;switch(e.event){case`added`:t=gi;break;case`deleted`:t=nr;break}return(0,Q.jsx)(t,{className:`size-3`})},tl=({action:e})=>(0,Q.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Q.jsx)(Cr,{className:`size-10`,name:e.actor?.name||e.actor?.slug,src:e.actor?.image}),(0,Q.jsx)(`div`,{className:`absolute -right-1 -bottom-1 z-30 flex items-center justify-center rounded-full border border-border-default bg-background p-1 shadow-sm`,children:(0,Q.jsx)(el,{action:e})})]}),nl=({label:e,item:t,excludedItems:n,toggleItem:r})=>{let i=(0,Z.useId)();return(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:i,children:e}),(0,Q.jsx)(W,{checked:!n.includes(t),id:i,onCheckedChange:e=>r(t,e)})]})},rl=({userId:e,excludedEvents:t,excludedResources:n,toggleEventType:r,toggleResourceType:i})=>{let{updateRoute:a}=V(),o=E({path:`/users/`,filterKey:`name`,responseKey:`users`}),[s,c]=(0,Z.useState)([]),[l,u]=(0,Z.useState)(),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(0),g=(0,Z.useRef)(null),_=(0,Z.useRef)(o);_.current=o;let v=(0,Z.useCallback)(async(e,t)=>{try{let n=await _.current.loadData(e);t===h.current&&c(n.map(e=>({label:e.name,value:e.id})))}catch{t===h.current&&c([])}finally{t===h.current&&m(!1)}},[]),y=(0,Z.useCallback)((e,t=!1)=>{h.current+=1;let n=h.current;m(!0),g.current&&clearTimeout(g.current),t?g.current=setTimeout(()=>void v(e,n),500):v(e,n)},[v]);(0,Z.useEffect)(()=>(y(``),()=>{h.current+=1,g.current&&clearTimeout(g.current)}),[y]),(0,Z.useEffect)(()=>{let t=!1;if(!e){u(null);return}return _.current.loadInitialValues([e],`id`).then(([e])=>{if(!t&&e){let t={label:e.name,value:e.id};u(t),c(e=>e.some(e=>e.value===t.value)?e:[t,...e])}}).catch(()=>{t||u(null)}),()=>{t=!0}},[e]);let b=()=>{u(null)};return(0,Q.jsxs)(Ct,{align:`center`,gap:`md`,children:[(0,Q.jsxs)(si,{children:[(0,Q.jsx)(Xr,{asChild:!0,children:(0,Q.jsx)(cr,{type:`button`,variant:`outline`,children:`Filter`})}),(0,Q.jsx)($r,{align:`end`,className:`z-[9999] w-[220px]`,"data-testid":`history-filters`,children:(0,Q.jsxs)(wt,{gap:`2xl`,children:[(0,Q.jsxs)(wt,{gap:`md`,children:[(0,Q.jsx)(nl,{excludedItems:t,item:`added`,label:`Added`,toggleItem:r}),(0,Q.jsx)(nl,{excludedItems:t,item:`edited`,label:`Edited`,toggleItem:r}),(0,Q.jsx)(nl,{excludedItems:t,item:`deleted`,label:`Deleted`,toggleItem:r})]}),(0,Q.jsxs)(wt,{gap:`md`,children:[(0,Q.jsx)(nl,{excludedItems:n,item:`post`,label:`Posts`,toggleItem:i}),(0,Q.jsx)(nl,{excludedItems:n,item:`page`,label:`Pages`,toggleItem:i}),(0,Q.jsx)(nl,{excludedItems:n,item:`tag`,label:`Tags`,toggleItem:i}),(0,Q.jsx)(nl,{excludedItems:n,item:`offer,product`,label:`Tiers & offers`,toggleItem:i}),(0,Q.jsx)(nl,{excludedItems:n,item:`api_key,integration,setting,user,webhook`,label:`Settings & staff`,toggleItem:i})]})]})})]}),(0,Q.jsx)(`div`,{className:`w-[200px]`,children:(0,Q.jsxs)(Ct,{className:`${zt(`within`)} relative h-(--control-height) overflow-hidden`,gap:`none`,children:[(0,Q.jsxs)(si,{open:d,onOpenChange:e=>{f(e),e&&y(``)},children:[(0,Q.jsx)(Xr,{asChild:!0,children:(0,Q.jsxs)(`button`,{"aria-label":`Staff`,className:`flex min-w-0 flex-1 items-center justify-between px-3 text-control`,"data-testid":`history-staff-filter`,role:`combobox`,type:`button`,children:[(0,Q.jsx)(`span`,{className:l?`truncate pr-8`:`truncate pr-8 text-muted-foreground`,children:l?.label??`Search staff`}),(0,Q.jsx)(Fn,{className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Q.jsx)($r,{align:`start`,className:`z-[9999] w-72 p-0`,children:(0,Q.jsx)(pn,{i18n:{searchPlaceholder:`Search staff`},isLoading:p,isMultiSelect:!1,options:l&&!s.some(e=>e.value===l.value)?[l,...s]:s,shouldFilter:!1,values:l?[l.value]:[],autoCloseOnSelect:!0,onChange:e=>{let t=s.find(t=>t.value===e[0]);t&&(u(t),a(`history/view/${t.value}`))},onClose:()=>f(!1),onSearchChange:e=>y(e,!0)})})]}),l&&(0,Q.jsx)(`button`,{"aria-label":`Clear selection`,className:`absolute top-1/2 right-10 z-10 flex size-8 -translate-y-1/2 items-center justify-center text-muted-foreground hover:text-foreground`,type:`button`,onClick:()=>{b(),a(`history/view`)},children:(0,Q.jsx)(Gn,{className:`size-4`})})]})})]})},il=({action:e})=>{let{updateRoute:t}=V(),n=Qc(e);if(e.resource_type===`security_action`&&e.context?.action_name===`reset_authentication`){let t=typeof e.context.api_keys_rotated==`number`?e.context.api_keys_rotated:null,n=typeof e.context.users_locked==`number`?e.context.users_locked:null,r=[t===null?null:`${F(t)} API ${t===1?`key`:`keys`} rotated`,n===null?null:`${F(n)} ${n===1?`user`:`users`} locked`].filter(Boolean);return(0,Q.jsx)(Q.Fragment,{children:r.length?r.join(`, `):`Authentication reset`})}else if(n){let{group:e,key:t}=n;return(0,Q.jsxs)(Q.Fragment,{children:[e.slice(0,1).toUpperCase(),e.slice(1),e!==t&&(0,Q.jsxs)(`span`,{children:[` `,(0,Q.jsxs)(`code`,{className:`mb-1 bg-white text-grey-800 dark:bg-grey-900 dark:text-white`,children:[`(`,t,`)`]})]})]})}else if(e.resource?.title||e.resource?.name||e.context?.primary_name){let n=Xc(e);return n?(0,Q.jsx)(`a`,{className:`cursor-pointer font-bold`,onClick:e=>{e.preventDefault(),t(n)},children:e.resource?.title||e.resource?.name}):(0,Q.jsx)(Q.Fragment,{children:e.resource?.title||e.resource?.name||e.context?.primary_name})}else return(0,Q.jsx)(`span`,{className:`text-grey-500`,children:`(unknown)`})},al=e=>{let t=new Intl.DateTimeFormat(`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).formatToParts(e).reduce((e,{type:t,value:n})=>({...e,[t]:n}),{});return`${t.year}-${t.month}-${t.day} ${t.hour}:${t.minute}:${t.second}`},ol=200,sl=H.create(({params:e})=>{let t=Oe(),{updateRoute:n}=V(),[r,i]=(0,Z.useState)([]),[a,s]=(0,Z.useState)([`label`]),{data:c,fetchNextPage:l,isFetchingNextPage:u}=Yc({searchParams:{include:`actor,resource`,limit:ol.toString(),filter:[r.length&&`event:-[${r.join(`,`)}]`,a.length&&`resource_type:-[${a.join(`,`)}]`,e?.user&&`actor_id:'${e.user}'`].filter(Boolean).join(`+`)},getNextPageParams:(e,t)=>({...t,filter:[t.filter,e.actions.length&&`created_at:<'${al(new Date(e.actions[e.actions.length-1].created_at))}'`].join(`+`)}),placeholderData:o}),d=(0,Z.useCallback)(()=>{c?.isEnd||l()},[c?.isEnd,l]),f=(e,t,n)=>{e(e=>n?e.concat(t):e.filter(e=>e!==t))},p=r.length>0||a.length>0||e?.user;return(0,Q.jsx)(Ie,{afterClose:()=>{n(`history`)},cancelLabel:``,okLabel:`Close`,scrolling:!0,size:`md`,stickyFooter:!0,stickyHeader:!0,testId:`history-modal`,title:`History`,topRightContent:(0,Q.jsx)(rl,{excludedEvents:r,excludedResources:a,toggleEventType:(e,t)=>f(i,e,!t),toggleResourceType:(e,t)=>f(s,e,!t),userId:e?.user}),onOk:()=>{t.remove(),n(`history`)},children:(0,Q.jsx)(`div`,{className:`relative mt-6`,children:(0,Q.jsxs)(U,{children:[c?.actions?c.actions.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Kc,{offset:250,onTrigger:d}),c.actions.map(e=>!e.skip&&(0,Q.jsx)(pt,{children:(0,Q.jsxs)(Ue,{className:`flex items-center gap-3 py-3`,children:[(0,Q.jsx)(tl,{action:e}),(0,Q.jsxs)(`div`,{className:`min-w-0 grow`,children:[(0,Q.jsxs)(`div`,{children:[Zc(e),$c(e)?``:`: `,!$c(e)&&(0,Q.jsx)(il,{action:e}),e.count?(0,Q.jsxs)(Q.Fragment,{children:[` `,F(e.count),` times`]}):null,(0,Q.jsxs)(`span`,{children:[` — by `,e.actor?.name||e.actor?.slug]})]}),(0,Q.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:[new Date(e.created_at).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`}),new Date(e.created_at).toLocaleTimeString(`default`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})].join(` | `)})]})]})},e.id)),u&&(0,Q.jsx)(`div`,{className:`flex items-center justify-center p-5`,children:(0,Q.jsx)(Kr,{size:`md`})})]}):(0,Q.jsxs)(hr,{children:[(0,Q.jsx)(Di,{children:(0,Q.jsx)(Yr,{})}),p?`No entries match your current filters.`:`No history entries found.`]}):c===void 0?(0,Q.jsx)(`div`,{className:`flex items-center justify-center px-5 pt-12 pb-10`,children:(0,Q.jsx)(`div`,{className:`flex h-64 items-center justify-center`,children:(0,Q.jsx)(Kr,{size:`lg`})})}):(0,Q.jsx)(hr,{children:`No entries found.`}),c?.isEnd&&c.actions.length>0&&(0,Q.jsx)(`div`,{className:`border-t border-border pt-2 text-sm text-muted-foreground`,children:`End of history log`})]})})})}),cl=`USER_ALREADY_REGISTERED`,ll=`A user with that email address already exists.`,ul=H.create(()=>{let e=H.useModal(),t=de(),n=de({searchParams:{limit:`100`,permissions:`assign`}}),r=De(),{updateRoute:i}=V(),{config:a}=xt(),o=a.labs.superEditors,s=(0,Z.useRef)(null),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,m]=(0,Z.useState)(`contributor`),[g,_]=(0,Z.useState)({}),{data:{users:v}={}}=Tn(),{data:{invites:x}={}}=ue(),{mutateAsync:S}=at(),C=h();if((0,Z.useEffect)(()=>{s.current&&s.current.focus()},[]),(0,Z.useEffect)(()=>{u===`saved`&&setTimeout(()=>{d(``)},2e3)},[u]),(0,Z.useEffect)(()=>{f!==`contributor`&&r?.isLimited(`staff`)?r.errorIfWouldGoOverLimit(`staff`).then(()=>{_(e=>({...e,role:void 0}))}).catch(e=>{if(e instanceof Ee){_(t=>({...t,role:e.message}));return}else throw e}):_(e=>({...e,role:void 0}))},[r,f]),!t.data?.roles||!n.data?.roles)return null;let w=t.data.roles,T=n.data.roles,E=`Send invitation`;u===`saving`?E=`Sending...`:u===`saved`?E=`Invite sent!`:u===`error`&&(E=`Retry`);let D=async()=>{if(u!==`saving`){if(!eo.default.isEmail(c)){_({email:`Please enter a valid email address.`});return}if(v?.some(({email:e})=>e===c)){_({email:ll});return}if(x?.some(({email:e})=>e===c)){_({email:`A user with that email address was already invited.`});return}if(!g.role){d(`saving`);try{await S({email:c,roleId:w.find(({name:e})=>e.toLowerCase()===f.toLowerCase()).id}),d(`saved`),b.success(`Invitation sent`,{description:`${c}`}),e.remove(),i(`staff?tab=invited`)}catch(e){if((e instanceof y?e.data?.errors[0]:void 0)?.code===cl){d(``),_({email:ll});return}d(`error`);let t=(0,Q.jsxs)(`span`,{children:[`If the problem persists, `,(0,Q.jsxs)(`a`,{href:`https://ghost.org/contact`,children:[(0,Q.jsx)(`u`,{children:`contact support`}),`.`]}),`.`]});e instanceof p&&e.data?.errors?.[0]?.type===`EmailError`&&(t=(0,Q.jsx)(`span`,{children:`Check your Mailgun configuration.`})),b.error(`Failed to send invitation`,{description:t}),C(e,{withToast:!1});return}}}},O=[{hint:`Can create and edit their own posts, but cannot publish. An Editor needs to approve and publish for them.`,label:`Contributor`,value:`contributor`},{hint:`A trusted user who can create, edit and publish their own posts, but can’t modify others.`,label:`Author`,value:`author`},{hint:`Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site.`,label:`Editor`,value:`editor`},{hint:`Trusted staff user who should be able to manage all content and users, as well as site settings and options.`,label:`Administrator`,value:`administrator`}];o&&(O[2]={hint:`Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site. Can manage members and moderate comments.`,label:`Editor (beta mode)`,value:`super editor`});let k=O.filter(e=>T.some(t=>t.name===e.label||t.name===`Super Editor`&&e.label===`Editor (beta mode)`));return g.email&&(E=`Retry`),(0,Q.jsx)(Ie,{afterClose:()=>{i(`staff`)},cancelLabel:``,okLabel:E,okVariant:u===`error`||g.email?`destructive`:`default`,testId:`invite-user-modal`,title:`Invite a new staff user`,width:540,onOk:D,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6 py-4 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsx)(`p`,{children:`Send an invitation for a new person to create a staff account on your site, and select a role that matches what you’d like them to be able to do.`}),(0,Q.jsxs)(J,{"data-invalid":!!g.email||void 0,children:[(0,Q.jsx)(K,{htmlFor:`invite-email`,children:`Email address`}),(0,Q.jsx)(X,{ref:s,"aria-invalid":!!g.email||void 0,id:`invite-email`,placeholder:`jamie@example.com`,value:c,onChange:e=>l(e.target.value),onKeyDown:()=>_(e=>({...e,email:void 0}))}),g.email&&(0,Q.jsx)(G,{children:g.email})]}),(0,Q.jsxs)(rn,{children:[(0,Q.jsx)(on,{id:`invite-role-legend`,variant:`label`,children:`Role`}),(0,Q.jsx)(ba,{"aria-describedby":g.role?`invite-role-error`:void 0,"aria-invalid":!!g.role||void 0,"aria-labelledby":`invite-role-legend`,name:`role`,value:f,onValueChange:e=>m(e),children:k.map(e=>{let t=`invite-role-${e.value.replace(/\s+/g,`-`)}`;return(0,Q.jsxs)(J,{className:`has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-0`,orientation:`horizontal`,children:[(0,Q.jsx)(Sa,{id:t,value:e.value}),(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:t,children:e.label}),(0,Q.jsx)(q,{children:e.hint})]})]},e.value)})}),(0,Q.jsx)(G,{id:`invite-role-error`,children:g.role}),(0,Q.jsx)(nn,{})]})]})})}),dl=e=>!!(e.label&&!e.label.match(/^\s*$/)||e.url!==`/`),fl=({items:e,setItems:t})=>{let n=je({items:(0,Z.useMemo)(()=>e.map(e=>({...e,errors:{}})),[e]),setItems:(0,Z.useCallback)(e=>{t(e.map(({url:e,label:t})=>({url:e,label:t})))},[t]),blank:{url:`/`,label:``,errors:{}},canAddNewItem:dl}),r=new RegExp(/^(\/|#|[a-zA-Z0-9-]+:)/),i=e=>{let t={};return(!e.label||e.label.match(/^\s*$/))&&(t.label=`You must specify a label`),(!e.url||e.url.match(/\s/)||!eo.default.isURL(e.url,{require_protocol:!0})&&!e.url.match(r))&&(t.url=`You must specify a valid URL or relative path`),t},a=(e,t)=>{let r=n.items.find(t=>t.id===e);n.updateItem(e,{...r.item,...t})},o=()=>{let e=i(n.newItem);Object.values(e).some(e=>e)?n.setNewItem({...n.newItem,errors:e}):n.addItem()},s=e=>{n.removeItem(e)},c=(e,t)=>{n.moveItem(e,t)},l=(e,t)=>{if(e===`new`)n.setNewItem({...n.newItem,errors:{...n.newItem.errors,[t]:void 0}});else{let r=n.items.find(t=>t.id===e).item;n.updateItem(e,{...r,errors:{...r.errors,[t]:void 0}})}};return{items:n.items.map(({item:e,id:t})=>({...e,id:t})),updateItem:a,addItem:o,removeItem:s,moveItem:c,newItem:{...n.newItem,id:`new`},setNewItem:e=>n.setNewItem({...n.newItem,...e}),clearError:l,validate:()=>{let e=!0;if(n.items.forEach(({item:t,id:r})=>{let a=i(t);Object.values(a).some(e=>e)&&(e=!1,n.updateItem(r,{...t,errors:a}))}),dl(n.newItem)){let t=i(n.newItem);Object.values(t).some(e=>e)&&(e=!1,n.setNewItem({...n.newItem,errors:t}))}return e}}},pl=({baseUrl:e,item:t,updateItem:n,addItem:r,clearError:i,labelPlaceholder:a,unstyled:o,textFieldClasses:s,action:c,className:l,...u})=>{let d=ht({baseUrl:e,nullable:!0,value:t.url,onChange:e=>n?.({url:e||``})});return(0,Q.jsxs)(`div`,{className:L(`flex w-full items-start gap-3`,l),"data-testid":`navigation-item-editor`,...u,children:[(0,Q.jsx)(`div`,{className:`flex flex-1 pt-1`,children:(0,Q.jsxs)(J,{className:`grow`,"data-invalid":!!t.errors.label||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,htmlFor:`navigation-label-${t.id}`,children:`Label`}),(0,Q.jsx)(X,{"aria-invalid":!!t.errors.label||void 0,className:L(!o&&`h-[var(--control-height)] rounded-lg border-transparent bg-muted py-2 focus-visible:border-green focus-visible:bg-surface-elevated focus-visible:ring-green/25`,o&&`border-0 bg-transparent shadow-none focus-visible:ring-0`,s),id:`navigation-label-${t.id}`,placeholder:a,value:t.label,onChange:e=>n?.({label:e.target.value}),onKeyDown:e=>{n?.({label:e.target.value}),e.key===`Enter`&&(e.preventDefault(),r?.()),t.errors.label&&i?.(`label`)}}),t.errors.label&&(0,Q.jsx)(G,{children:t.errors.label})]})}),(0,Q.jsxs)(J,{className:`flex-1 pt-1`,"data-invalid":!!t.errors.url||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,htmlFor:`navigation-url-${t.id}`,children:`URL`}),(0,Q.jsx)(X,{"aria-invalid":!!t.errors.url||void 0,className:L(`h-[var(--control-height)] rounded-lg border-transparent bg-muted py-2 focus-visible:border-green focus-visible:bg-surface-elevated focus-visible:ring-green/25`,s),id:`navigation-url-${t.id}`,value:d.displayValue,onBlur:d.commitValue,onChange:e=>d.setDisplayValue(e.target.value),onFocus:d.handleFocus,onKeyDown:t=>{d.handleKeyDown(t);let r=ge(t.target.value,e,!0);n?.({url:r.save||``})},onKeyUp:a=>{if(a.key===`Enter`){a.preventDefault();let t=ge(a.target.value,e,!0);n?.({url:t.save||``}),r?.()}t.errors.url&&i?.(`url`)}}),t.errors.url&&(0,Q.jsx)(G,{children:t.errors.url})]}),c&&(0,Q.jsx)(Ct,{align:`center`,className:`h-[calc(var(--control-height)+0.25rem)] shrink-0 translate-y-px pt-1`,children:c})]})},ml=({baseUrl:e,navigation:t})=>(0,Q.jsxs)(`div`,{className:`w-full pt-2`,children:[(0,Q.jsx)(Ae,{dragHandleClass:`translate-y-0.5`,getDragHandleLabel:e=>`Reorder ${e.label||`navigation item`}`,items:t.items,itemSeparator:!1,renderItem:n=>(0,Q.jsx)(pl,{action:(0,Q.jsx)(cr,{"aria-label":`Delete navigation item`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>t.removeItem(n.id),children:(0,Q.jsx)(nr,{})}),baseUrl:e,clearError:e=>t.clearError(n.id,e),item:n,updateItem:e=>t.updateItem(n.id,e)}),onMove:t.moveItem}),(0,Q.jsxs)(Ct,{align:`start`,gap:`md`,children:[(0,Q.jsx)(Ct,{align:`center`,className:`h-[calc(var(--control-height)+0.5rem)] shrink-0 translate-y-0.5 pt-2`,children:(0,Q.jsx)(gi,{className:`size-4 text-muted-foreground`})}),(0,Q.jsx)(pl,{action:(0,Q.jsx)(cr,{"aria-label":`Add navigation item`,"data-testid":`add-button`,size:`icon`,type:`button`,variant:`ghost`,onClick:t.addItem,children:(0,Q.jsx)(gi,{})}),addItem:t.addItem,baseUrl:e,className:`mt-1`,clearError:e=>t.clearError(t.newItem.id,e),"data-testid":`new-navigation-item`,item:t.newItem,labelPlaceholder:`New item label`,updateItem:t.setNewItem})]})]}),hl=H.create(()=>{let e=Oe(),{updateRoute:t}=V(),{localSettings:n,updateSetting:r,saveState:i,handleSave:a,siteData:o}=ve(),[s,c]=Hn(n,[`navigation`,`secondary_navigation`]),l=(0,Z.useMemo)(()=>JSON.parse(s||`[]`),[s]),u=(0,Z.useMemo)(()=>JSON.parse(c||`[]`),[c]),d=(0,Z.useCallback)(e=>{r(`navigation`,JSON.stringify(e))},[r]),f=(0,Z.useCallback)(e=>{r(`secondary_navigation`,JSON.stringify(e))},[r]),p=fl({items:l,setItems:d}),m=fl({items:u,setItems:f}),[h,g]=(0,Z.useState)(`primary-nav`);return(0,Q.jsx)(Ie,{afterClose:()=>{t(`navigation`)},buttonsDisabled:i===`saving`,cancelLabel:`Close`,dirty:n.some(e=>e.dirty),okLabel:i===`saving`?`Saving...`:`Save`,scrolling:!0,size:`lg`,stickyFooter:!0,testId:`navigation-modal`,title:`Navigation`,onOk:async()=>{p.validate()&&m.validate()&&(await a(),e.remove(),t(`navigation`))},children:(0,Q.jsx)(`div`,{className:`mt-6 mb-1`,children:(0,Q.jsxs)(Lt,{value:h,variant:`underline`,onValueChange:g,children:[(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`primary-nav`,children:`Primary`}),(0,Q.jsx)(Pt,{value:`secondary-nav`,children:`Secondary`})]}),(0,Q.jsx)(Ft,{value:`primary-nav`,children:(0,Q.jsx)(ml,{baseUrl:o.url,navigation:p})}),(0,Q.jsx)(Ft,{value:`secondary-nav`,children:(0,Q.jsx)(ml,{baseUrl:o.url,navigation:m})})]})})})});``+new URL(`user-cover-yM4cP_Mo.jpg`,import.meta.url).href,``+new URL(`latest-posts-1-D7-ilqhR.jpg`,import.meta.url).href,``+new URL(`latest-posts-2-BPfbGB8B.jpg`,import.meta.url).href,``+new URL(`latest-posts-3-D72O3dn8.jpg`,import.meta.url).href;var gl=({senderName:e,senderEmail:t,senderReplyTo:n,headerImage:r,headerIcon:i,headerTitle:a,headerSubtitle:o,showPostTitleSection:s,showExcerpt:c,titleAlignment:l,titleFontCategory:u,titleFontWeight:d,bodyFontCategory:f,authorPlaceholder:p,showCommentCta:m,showFeatureImage:h,showFeedback:g,showShareButton:_,showLatestPosts:v,showSubscriptionDetails:y,siteTitle:b,footerContent:x,showBadge:S,backgroundColor:C,headerBackgroundColor:w,accentColor:T,textColor:E,secondaryTextColor:D,headerTextColor:O,secondaryHeaderTextColor:k,postTitleColor:A,sectionTitleColor:j,dividerColor:M,buttonColor:ee,buttonTextColor:N,linkColor:P,buttonCorners:F,buttonStyle:I,imageCorners:R,linkStyle:z,dividerStyle:te})=>{let B=i||a,{config:ne}=xt(),re=new Date().toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`numeric`}),ie=new Date().getFullYear(),ae=x?x.replace(/<a/g,`<a target="_blank" rel="noopener noreferrer"`):``,oe;oe=qn(ne)?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`leading-normal`,children:[(0,Q.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`From: `}),(0,Q.jsxs)(`span`,{children:[e,` (`,t,`)`]})]}),(0,Q.jsxs)(`p`,{className:`leading-normal`,children:[(0,Q.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`Reply-to: `}),n||t]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`leading-normal`,children:[(0,Q.jsx)(`span`,{className:`font-semibold text-grey-900`,children:e}),(0,Q.jsxs)(`span`,{children:[` `,t]})]}),(0,Q.jsxs)(`p`,{className:`leading-normal`,children:[(0,Q.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`To:`}),` Jamie Larson jamie@example.com`]})]});let se=`mb-5 text-pretty leading-[1.7] text-black`;return se=u===`serif`&&f===`serif`?L(se,`mb-8 font-serif text-[2.0rem] leading-tight`):u!==`serif`&&f===`serif`?L(se,`mb-8 text-[1.7rem] leading-tight tracking-tight`):u===`serif`&&f!==`serif`?L(se,`mb-8 font-serif text-[2.0rem] leading-tight`):L(se,`mb-8 text-[1.9rem] leading-tight tracking-tight`),l===`center`&&(se=L(se,`text-center`)),(0,Q.jsx)(`div`,{className:`relative flex grow flex-col`,children:(0,Q.jsx)(`div`,{className:`absolute inset-0 m-5 flex items-center justify-center`,children:(0,Q.jsxs)(`div`,{className:`mx-auto my-0 flex max-h-full w-full max-w-[700px] flex-col overflow-hidden rounded-[4px] text-black shadow-sm`,children:[(0,Q.jsx)(`div`,{className:`flex-column flex min-h-[77px] justify-center gap-1 rounded-t-sm border-b border-grey-200 bg-white px-6 text-grey-700`,children:oe}),(0,Q.jsxs)(`div`,{className:`overflow-y-auto`,style:{backgroundColor:C},children:[(0,Q.jsxs)(`div`,{className:`px-[7rem]`,style:{backgroundColor:w},children:[r&&(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`img`,{alt:``,className:`mb-4 block pt-6`,src:r})}),B&&(0,Q.jsxs)(`div`,{className:`py-3`,children:[i&&(0,Q.jsx)(`img`,{alt:``,className:`mx-auto mb-2 size-10`,role:`presentation`,src:i}),a&&(0,Q.jsx)(`h4`,{className:`mb-1 text-center text-[1.6rem] leading-tight font-bold tracking-tight text-grey-900 uppercase`,style:{color:O},children:a}),o&&(0,Q.jsx)(`h5`,{className:`mb-1 text-center text-[1.3rem] font-normal text-grey-700`,style:{color:k},children:o})]}),s&&(0,Q.jsxs)(`div`,{className:L(`flex flex-col py-8`,l===`center`?`items-center`:`items-start`),children:[(0,Q.jsx)(`h2`,{className:L(`text-4xl leading-supertight font-bold text-black`,u===`serif`&&`font-serif`,d===`normal`&&`font-normal`,d===`medium`&&`font-medium`,d===`semibold`&&`font-semibold`,d===`bold`&&`font-bold`,l===`center`?`text-center`:`text-left`,c?`mb-2`:`mb-8`),style:{color:A},children:`Your email newsletter`}),c&&(0,Q.jsx)(`p`,{className:se,style:{color:O},children:`A subtitle to highlight key points and engage your readers.`}),(0,Q.jsxs)(`div`,{className:L(`flex w-full justify-between text-center text-md leading-none text-grey-700`,l===`center`?`flex-col gap-1`:`flex-row`),children:[(0,Q.jsxs)(`p`,{className:`pb-1 text-[1.3rem]`,style:{color:k},children:[`By `,p,(0,Q.jsx)(`span`,{className:`before:pr-1 before:pl-0.5 before:content-['•']`,children:re})]}),(0,Q.jsx)(`p`,{className:`pb-1 text-[1.3rem] underline`,style:{color:k},children:(0,Q.jsx)(`span`,{children:`View in browser`})})]})]}),h&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:L(`h-[unset] w-full max-w-[600px] bg-cover bg-no-repeat`,s?``:`pt-6`),children:(0,Q.jsx)(`img`,{alt:`Feature`,className:L(`min-h-full min-w-full shrink-0`,R===`square`&&`rounded-none`,R===`rounded`&&`rounded-md`),src:``+new URL(`user-cover-yM4cP_Mo.jpg`,import.meta.url).href})}),(0,Q.jsx)(`div`,{className:`mt-1 w-full max-w-[600px] pb-8 text-center text-[1.3rem] text-grey-700`,style:{color:k},children:`Feature image caption`})]})]}),(0,Q.jsxs)(`div`,{className:L(`px-[7rem]`,w!==`transparent`&&`pt-10`),children:[(0,Q.jsxs)(`div`,{className:L(`max-w-[600px] border-b border-grey-200 pb-[52px] leading-[27.2px] text-black`,te===`dashed`&&`border-dashed`,te===`dotted`&&`border-b-2 border-dotted`,f===`serif`?`font-serif text-[1.8rem]`:`text-[1.7rem] tracking-tight`,h||s?``:`pt-8`),style:{borderColor:M},children:[(0,Q.jsx)(`p`,{className:`mb-6`,style:{color:E},children:`This is what your content will look like when you send one of your posts as an email newsletter to your subscribers.`}),(0,Q.jsx)(`p`,{className:`mb-6`,style:{color:E},children:`Over there on the right you'll see some settings that allow you to customize the look and feel of this template – from colors and typography to layout and buttons – to make it perfectly suited to your brand.`}),(0,Q.jsx)(`p`,{className:`mb-[52px]`,style:{color:E},children:`Email templates are exceptionally finnicky to make, but we've spent a long time optimising this one to make it work beautifully across devices, email clients and content types. So, you can trust that every email you send with Ghost will look great and work well. Just like the rest of your site.`}),(0,Q.jsx)(`hr`,{className:L(`my-[52px] border-[#e0e7eb]`,te===`dashed`&&`border-dashed`,te===`dotted`&&`border-t-0 border-b-2 border-dotted`),style:{borderColor:M}}),(0,Q.jsx)(`h3`,{className:L(`mb-[13px] text-[2.6rem] leading-supertight`,u===`serif`&&`font-serif`,u===`sans_serif`&&`font-sans`,d===`normal`&&`font-normal`,d===`medium`&&`font-medium`,d===`semibold`&&`font-semibold`,d===`bold`&&`font-bold`),style:{color:j},children:`Need inspiration?`}),(0,Q.jsxs)(`p`,{className:`mb-[27px]`,style:{color:E},children:[`We've put together a `,(0,Q.jsx)(`a`,{className:L(z===`underline`&&`underline`,z===`bold`&&`font-bold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:{color:P||T},target:`_blank`,children:`quick guide`}),` that walks through all of the available settings, along with a few examples of what's possible.`]}),(0,Q.jsx)(`a`,{className:L(`inline-block border px-[18px] py-2 font-sans text-[15px]`,F===`rounded`&&`rounded-[6px]`,F===`pill`&&`rounded-full`,F===`square`&&`rounded-none`,I===`outline`?`bg-transparent`:`border-transparent text-white`,z===`bold`?`font-bold`:`font-semibold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:I===`outline`?{borderColor:ee||T,color:ee||T}:{backgroundColor:ee||T,color:N},target:`_blank`,children:`Learn more`})]}),(g||m||_)&&(0,Q.jsx)(`div`,{className:L(`grid gap-5 border-b border-grey-200 px-6 py-5`,te===`dashed`&&`border-dashed`,te===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:M},children:(0,Q.jsxs)(`div`,{className:`grid auto-cols-fr grid-flow-col gap-4`,children:[g&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Q.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:M,color:E},children:(0,Q.jsx)(Qn,{className:`size-5`})}),(0,Q.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:E},children:`More like this`})]}),(0,Q.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Q.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:M,color:E},children:(0,Q.jsx)(Er,{className:`size-5`})}),(0,Q.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:E},children:`Less like this`})]})]}),m&&(0,Q.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Q.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:M,color:E},children:(0,Q.jsx)(br,{className:`size-5`})}),(0,Q.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:E},children:`Comment`})]}),_&&(0,Q.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Q.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:M,color:E},children:(0,Q.jsx)(Ur,{className:`size-5`})}),(0,Q.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:E},children:`Share`})]})]})}),v&&(0,Q.jsxs)(`div`,{className:L(`border-b border-grey-200 py-6`,te===`dashed`&&`border-dashed`,te===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:M},children:[(0,Q.jsx)(`h3`,{className:`mt-2 mb-4 pb-1 text-[1.2rem] font-semibold tracking-wide text-black uppercase`,style:{color:E},children:`Keep reading`}),(0,Q.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:L(`mt-0.5 text-[1.9rem] text-black`,u===`serif`&&`font-serif`,d===`normal`&&`font-normal`,d===`medium`&&`font-medium`,d===`semibold`&&`font-semibold`,d===`bold`&&`font-bold`),style:{color:j},children:`The three latest posts published on your site`}),(0,Q.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:D},children:`Posts sent as an email only will never be shown here.`})]}),(0,Q.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Q.jsx)(`img`,{alt:`Latest post`,className:L(R===`square`&&`rounded-none`,R===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-1-D7-ilqhR.jpg`,import.meta.url).href})})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:L(`mt-0.5 text-[1.9rem] text-black`,u===`serif`&&`font-serif`,d===`normal`&&`font-normal`,d===`medium`&&`font-medium`,d===`semibold`&&`font-semibold`,d===`bold`&&`font-bold`),style:{color:j},children:`Displayed at the bottom of each newsletter`}),(0,Q.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:D},children:`Giving your readers one more place to discover your stories.`})]}),(0,Q.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Q.jsx)(`img`,{alt:`Latest post`,className:L(R===`square`&&`rounded-none`,R===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-2-BPfbGB8B.jpg`,import.meta.url).href})})]}),(0,Q.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:L(`mt-0.5 text-[1.9rem] text-black`,u===`serif`&&`font-serif`,d===`normal`&&`font-normal`,d===`medium`&&`font-medium`,d===`semibold`&&`font-semibold`,d===`bold`&&`font-bold`),style:{color:j},children:`To keep your work front and center`}),(0,Q.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:D},children:`Making sure that your audience stays engaged.`})]}),(0,Q.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Q.jsx)(`img`,{alt:`Latest post`,className:L(R===`square`&&`rounded-none`,R===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-3-D72O3dn8.jpg`,import.meta.url).href})})]})]}),y&&(0,Q.jsxs)(`div`,{className:L(`border-b border-grey-200 py-8`,te===`dashed`&&`border-dashed`,te===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:M},children:[(0,Q.jsx)(`h4`,{className:`mb-3 text-[1.2rem] tracking-wide text-black uppercase`,style:{color:E},children:`Subscription details`}),(0,Q.jsxs)(`p`,{className:`m-0 mb-4 text-base`,style:{color:E},children:[`You are receiving this because you are a paid subscriber to `,b,`. Your subscription will renew on 17 Jul 2024.`]}),(0,Q.jsxs)(`div`,{className:`flex`,children:[(0,Q.jsxs)(`div`,{className:`shrink-0 text-base`,children:[(0,Q.jsx)(`p`,{style:{color:E},children:`Name: Jamie Larson`}),(0,Q.jsx)(`p`,{style:{color:E},children:`Email: jamie@example.com`}),(0,Q.jsx)(`p`,{style:{color:E},children:`Member since: 17 July 2023`})]}),(0,Q.jsx)(`span`,{className:L(`w-full self-end text-right text-base whitespace-nowrap`,z===`underline`&&`underline`,z===`bold`&&`font-bold`),style:{color:P||T},children:`Manage subscription`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-center pt-10`,children:[(0,Q.jsx)(`div`,{dangerouslySetInnerHTML:{__html:ae||``},className:`text px-8 py-3 text-center text-[1.3rem] leading-base break-words text-grey-700 [&_a]:underline`,style:{color:D}}),(0,Q.jsxs)(`div`,{className:`px-8 pt-3 pb-14 text-center text-[1.3rem] text-grey-700`,children:[(0,Q.jsxs)(`span`,{style:{color:D},children:[b,` © `,ie,` — `]}),(0,Q.jsx)(`span`,{className:`pointer-events-none cursor-auto underline`,style:{color:D},children:`Unsubscribe`})]}),S&&(0,Q.jsx)(`div`,{className:`flex flex-col items-center pt-[10px] pb-[40px]`,children:(0,Q.jsxs)(`a`,{className:`pointer-events-none inline-flex cursor-auto items-center px-2 py-1 text-[1.25rem] font-semibold tracking-tight text-grey-900`,href:`https://ghost.org`,style:{color:E},children:[(0,Q.jsx)(ot,{className:`mr-[6px] size-4`}),(0,Q.jsx)(`span`,{children:`Powered by Ghost`})]})})]})]})]})]})})})},_l=({newsletter:e})=>{let{currentUser:t,settings:n,siteData:r,config:i}=xt(),[a,o,s,c,l]=Hn(n,[`title`,`icon`,`comments_enabled`,`support_email_address`,`default_email_address`]),u=null;e.show_header_title?u=a||null:e.show_header_name&&(u=e.name);let d=e.show_header_title&&e.show_header_name?e.name:void 0,f=e.show_comment_cta&&s!==`off`,p=e.feedback_enabled,m=e.show_share_button,h=()=>{let t=e.background_color;return/#([0-9a-f]{3}){1,2}$/i.test(t)?t:`#ffffff`},g=()=>{let t=e.header_background_color;return!t||t===`transparent`?`transparent`:/#([0-9a-f]{3}){1,2}$/i.test(t)?t:`transparent`},_=()=>{let t=e.button_color;return/#([0-9a-f]{3}){1,2}$/i.test(t||``)?t:t===null?bt(h()).hex():r.accent_color},v=()=>{let t=e.button_style,n=_();if(n&&t===`fill`)return bt(n).hex()},y=()=>{let t=e.link_color===void 0?`accent`:e.link_color;return t===`accent`?r.accent_color:/#([0-9a-f]{3}){1,2}$/i.test(t||``)?t:bt(h()).hex()},b=()=>{let t=e.post_title_color;if(/#([0-9a-f]{3}){1,2}$/i.test(t||``))return t;if(t===`accent`)return r.accent_color;let n=g();return bt(n===`transparent`?h():n).hex()},x=()=>{let t=e.section_title_color;return/#([0-9a-f]{3}){1,2}$/i.test(t||``)?t:t===`accent`?r.accent_color:bt(h()).hex()},S=()=>{let t=e.divider_color;return/#([0-9a-f]{3}){1,2}$/i.test(t||``)?t:t===`accent`?r.accent_color:`#e0e7eb`},C=bt(h()).hex(),w=bt(h()).alpha(.5).toString(),T=g()===`transparent`?C:bt(g()).hex(),E=g()===`transparent`?w:bt(g()).alpha(.5).toString(),D={backgroundColor:h(),headerBackgroundColor:g(),postTitleColor:b()||void 0,sectionTitleColor:x()||void 0,buttonColor:_()||void 0,buttonTextColor:v()||void 0,linkColor:y()||void 0,dividerColor:S()||void 0,textColor:C,secondaryTextColor:w,headerTextColor:T,secondaryHeaderTextColor:E};return(0,Q.jsx)(gl,{accentColor:r.accent_color,authorPlaceholder:t.name||t.email,backgroundColor:D.backgroundColor||`#ffffff`,bodyFontCategory:e.body_font_category,buttonCorners:e.button_corners||`rounded`,buttonStyle:e.button_style||`fill`,dividerStyle:e.divider_style||`solid`,footerContent:e.footer_content,headerBackgroundColor:D.headerBackgroundColor||`transparent`,headerIcon:e.show_header_icon?o:void 0,headerImage:e.header_image,headerSubtitle:d,headerTitle:u,imageCorners:e.image_corners||`square`,linkStyle:e.link_style||`underline`,senderEmail:Ge(e,i,l),senderName:e.sender_name||a,senderReplyTo:Ze(e,i,c,l),showBadge:e.show_badge,showCommentCta:f,showExcerpt:e.show_excerpt,showFeatureImage:e.show_feature_image,showFeedback:p,showLatestPosts:e.show_latest_posts,showPostTitleSection:e.show_post_title_section,showShareButton:m,showSubscriptionDetails:e.show_subscription_details,siteTitle:a,titleAlignment:e.title_alignment,titleFontCategory:e.title_font_category,titleFontWeight:e.title_font_weight||`bold`,...D})},vl=({label:e,value:t,options:n,onValueChange:r})=>(0,Q.jsx)(xn,{"aria-label":e,type:`single`,value:t,onValueChange:e=>e&&r(e),children:n.map(e=>(0,Q.jsxs)(Pr,{children:[(0,Q.jsx)(Vr,{asChild:!0,children:(0,Q.jsx)(bn,{"aria-label":e.label,disabled:e.disabled,value:e.value,children:e.icon})}),(0,Q.jsx)(hi,{children:e.label})]},e.value))}),yl=({newsletter:e,updateNewsletter:t,errors:n,clearError:r})=>{let{settings:i,config:a}=xt(),[o,s]=Hn(i,[`default_email_address`,`support_email_address`]),[c,l]=(0,Z.useState)(Ze(e,a,s,o)||``),u=Ge(e,a,o),d=(0,Z.useCallback)(e=>{l(e.target.value),t({sender_reply_to:e.target.value||`newsletter`})},[t,l]);return(0,Q.jsxs)(J,{"data-invalid":!!n.sender_reply_to||void 0,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-reply-to`,children:`Reply-to email`}),(0,Q.jsx)(X,{"aria-invalid":!!n.sender_reply_to||void 0,id:`newsletter-reply-to`,maxLength:191,placeholder:u||``,value:c,onBlur:()=>{let t=Ze(e,a,s,o)||``;l(t)},onChange:d,onKeyDown:()=>r(`sender_reply_to`)}),n.sender_reply_to&&(0,Q.jsx)(G,{children:n.sender_reply_to})]})},bl=({newsletter:e,onlyOne:t,updateNewsletter:n,validate:r,errors:i,clearError:a})=>{let{updateRoute:o}=V(),{mutateAsync:s}=Ai(),c=De(),{settings:l,config:u,siteData:d}=xt(),[f,p]=Hn(l,[`icon`,`default_email_address`]),{mutateAsync:m}=re(),[g,_]=(0,Z.useState)(`generalSettings`),{localSettings:v}=ve(),[y]=Hn(v,[`title`]),x=h(),{data:{newsletters:S}={}}=Mi(),C=[`all`,`paid`].includes(_r(l,`comments_enabled`)||``),w=Ge(e,u,p),[T,E]=(0,Z.useState)(S||[]),D=T.filter(e=>e.status===`active`);(0,Z.useEffect)(()=>{E(S||[])},[S]);let O=[{value:`serif`,label:`Elegant serif`,className:`font-serif`},{value:`sans_serif`,label:`Clean sans-serif`}],k={sans_serif:{options:[{value:`normal`,label:`Regular`,className:`font-normal`},{value:`medium`,label:`Medium`,className:`font-medium`},{value:`semibold`,label:`Semi-bold`,className:`font-semibold`},{value:`bold`,label:`Bold`,className:`font-bold`}]},serif:{options:[{value:`normal`,label:`Regular`,className:`font-normal`},{value:`bold`,label:`Bold`,className:`font-bold`}],map:{medium:`normal`,semibold:`bold`}}},A=()=>e.background_color===`light`?!1:bt(e.background_color).hex().toLowerCase()===`#ffffff`,j=async()=>{if(e.status===`active`)H.show(We,{title:`Archive newsletter`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`mb-6`,children:[`Your newsletter `,(0,Q.jsx)(`strong`,{children:e.name}),` will no longer be visible to members or available as an option when publishing new posts.`]}),(0,Q.jsx)(`div`,{children:`Existing posts previously sent as this newsletter will remain unchanged.`})]}),okLabel:`Archive`,okVariant:`destructive`,onOk:async t=>{try{await s({...e,status:`archived`}),t?.remove(),b.success(`Newsletter archived`)}catch(e){x(e)}}});else{try{await c?.errorIfWouldGoOverLimit(`newsletters`)}catch(e){if(e instanceof Ee){H.show(ke,{prompt:e.message||`Your current plan doesn't support more newsletters.`,onOk:()=>o({route:`/pro`,isExternal:!0})});return}else throw e}H.show(We,{title:`Reactivate newsletter`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`Reactivating `,(0,Q.jsx)(`strong`,{children:e.name}),` will immediately make it visible to members and re-enable it as an option when publishing new posts.`]}),okLabel:`Reactivate`,onOk:async t=>{await s({...e,status:`active`}),t?.remove(),b.success(`Newsletter reactivated`)}})}},M=()=>{if(!qn(u))return(0,Q.jsxs)(J,{"data-invalid":!!i.sender_email||void 0,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-sender-email`,children:`Sender email address`}),(0,Q.jsx)(X,{"aria-invalid":!!i.sender_email||void 0,id:`newsletter-sender-email`,placeholder:w||``,value:e.sender_email||``,onChange:e=>n({sender_email:e.target.value}),onKeyDown:()=>a(`sender_email`)}),i.sender_email&&(0,Q.jsx)(G,{children:i.sender_email})]});if(ur(u))return(0,Q.jsxs)(J,{"data-invalid":!!i.sender_email||void 0,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-sender-email`,children:`Sender email address`}),(0,Q.jsx)(X,{"aria-invalid":!!i.sender_email||void 0,id:`newsletter-sender-email`,maxLength:191,placeholder:p,value:e.sender_email||``,onChange:e=>{n({sender_email:e.target.value})},onKeyDown:()=>a(`sender_email`)}),i.sender_email&&(0,Q.jsx)(G,{children:i.sender_email})]})},ee=k[e.title_font_category||`sans_serif`].options,N=[{id:`generalSettings`,title:`General`,contents:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Name and description`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-6 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!i.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-detail-name`,children:`Name`}),(0,Q.jsx)(X,{"aria-invalid":!!i.name||void 0,id:`newsletter-detail-name`,maxLength:191,placeholder:`Weekly Roundup`,value:e.name||``,onChange:e=>n({name:e.target.value}),onKeyDown:()=>a(`name`)}),i.name&&(0,Q.jsx)(G,{children:i.name})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`newsletter-description`,children:`Description`}),(0,Q.jsx)(sn,{className:`border-transparent bg-muted`,id:`newsletter-description`,maxLength:2e3,rows:2,value:e.description||``,onChange:e=>n({description:e.target.value})})]})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Email info`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-6 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`newsletter-sender-name`,children:`Sender name`}),(0,Q.jsx)(X,{id:`newsletter-sender-name`,maxLength:191,placeholder:y,value:e.sender_name||``,onChange:e=>n({sender_name:e.target.value})})]}),M(),(0,Q.jsx)(yl,{clearError:a,errors:i,newsletter:e,updateNewsletter:n,validate:r})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Member settings`}),(0,Q.jsx)(tn,{className:`mb-12 gap-6`,children:(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-subscribe-on-signup`,children:`Subscribe new members on signup`}),(0,Q.jsx)(W,{checked:!!e.subscribe_on_signup,id:`newsletter-subscribe-on-signup`,onCheckedChange:e=>n({subscribe_on_signup:e})})]})})]}),(0,Q.jsx)(`div`,{className:`mt-10 mb-5`,children:e.status===`active`?!t&&(0,Q.jsx)(cr,{className:`text-destructive hover:text-destructive`,disabled:D.length===1,type:`button`,variant:`ghost`,onClick:j,children:`Archive newsletter`}):(0,Q.jsx)(cr,{className:`text-green hover:text-green`,type:`button`,variant:`ghost`,onClick:j,children:`Reactivate newsletter`})})]})},{id:`content`,title:`Content`,contents:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Header`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(Tt,{as:`h6`,className:`mb-2 text-base`,weight:`semibold`,children:`Header image`})}),(0,Q.jsxs)(`div`,{className:`flex-column flex gap-1`,children:[(0,Q.jsx)(he,{className:`h-16.5`,children:e.header_image?(0,Q.jsxs)(me,{children:[(0,Q.jsx)(le,{id:`logo`,src:e.header_image}),(0,Q.jsx)(be,{children:(0,Q.jsx)(_e,{"aria-label":`Remove header image`,onClick:()=>n({header_image:null}),children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{inputId:`logo`,onDropAccepted:async([e])=>{try{n({header_image:Te(await m({file:e}))})}catch(e){x(e)}},children:(0,Q.jsx)(Qr,{className:`size-5 text-grey-700 dark:text-grey-300`})})}),(0,Q.jsxs)(q,{children:[F(1200),`×`,F(600),` recommended. Use a transparent PNG for best results on any background.`]})]})]}),(0,Q.jsxs)(wt,{gap:`md`,children:[f&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-header-icon`,children:`Publication icon`}),(0,Q.jsx)(W,{checked:!!e.show_header_icon,id:`newsletter-show-header-icon`,onCheckedChange:e=>n({show_header_icon:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-header-title`,children:`Publication title`}),(0,Q.jsx)(W,{checked:!!e.show_header_title,id:`newsletter-show-header-title`,onCheckedChange:e=>n({show_header_title:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-header-name`,children:`Newsletter name`}),(0,Q.jsx)(W,{checked:!!e.show_header_name,id:`newsletter-show-header-name`,onCheckedChange:e=>n({show_header_name:e})})]})]})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Title section`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-4`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-post-title`,children:`Post title`}),(0,Q.jsx)(W,{checked:!!e.show_post_title_section,id:`newsletter-show-post-title`,onCheckedChange:e=>n({show_post_title_section:e})})]}),e.show_post_title_section&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-excerpt`,children:`Post excerpt`}),(0,Q.jsx)(W,{checked:!!e.show_excerpt,id:`newsletter-show-excerpt`,onCheckedChange:e=>n({show_excerpt:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-feature-image`,children:`Feature image`}),(0,Q.jsx)(W,{checked:!!e.show_feature_image,id:`newsletter-show-feature-image`,onCheckedChange:e=>n({show_feature_image:e})})]})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Footer`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-6`,children:[(0,Q.jsxs)(wt,{gap:`lg`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-feedback-enabled`,children:`Ask your readers for feedback`}),(0,Q.jsx)(W,{checked:!!e.feedback_enabled,id:`newsletter-feedback-enabled`,onCheckedChange:e=>n({feedback_enabled:e})})]}),C&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-comment-cta`,children:`Add a link to your comments`}),(0,Q.jsx)(W,{checked:!!e.show_comment_cta,id:`newsletter-show-comment-cta`,onCheckedChange:e=>n({show_comment_cta:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-share-button`,children:`Show share button`}),(0,Q.jsx)(W,{checked:!!e.show_share_button,id:`newsletter-show-share-button`,onCheckedChange:e=>n({show_share_button:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-latest-posts`,children:`Share your latest posts`}),(0,Q.jsx)(W,{checked:!!e.show_latest_posts,id:`newsletter-show-latest-posts`,onCheckedChange:e=>n({show_latest_posts:e})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-subscription-details`,children:`Show subscription details`}),(0,Q.jsx)(W,{checked:!!e.show_subscription_details,id:`newsletter-show-subscription-details`,onCheckedChange:e=>n({show_subscription_details:e})})]})]}),(0,Q.jsx)(qa,{hint:`Any extra information or legal text`,nodes:`MINIMAL_NODES`,placeholder:` `,title:`Email footer`,value:e.footer_content||``,onChange:e=>n({footer_content:e})})]})]}),(0,Q.jsx)(Jn,{}),(0,Q.jsxs)(`div`,{className:`my-5 flex w-full items-start`,children:[(0,Q.jsx)(`span`,{children:(0,Q.jsx)(Nr,{className:`mt-[-1px] mr-2 size-5 text-red`})}),(0,Q.jsx)(tn,{className:`gap-8`,children:(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`newsletter-show-badge`,children:`Promote independent publishing`}),(0,Q.jsx)(q,{children:`Show you're a part of the indie publishing movement with a small badge in the footer`})]}),(0,Q.jsx)(W,{checked:!!e.show_badge,id:`newsletter-show-badge`,onCheckedChange:e=>n({show_badge:e})})]})})]})]})},{id:`design`,title:`Design`,contents:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Global`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-4`,children:[(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{hex:`#ffffff`,value:`light`,title:`White`}],title:`Background color`,value:e.background_color||`light`,onChange:e=>n({background_color:e})})}),(0,Q.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`shrink-0`,children:`Heading font`}),(0,Q.jsxs)(J,{className:`max-w-[200px]`,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Heading font`}),(0,Q.jsxs)(qt,{value:e.title_font_category,onValueChange:t=>{let r=e.title_font_weight,i=r;return k[t].options.find(e=>e.value===r)||(i=k[t].map?.[r]||`bold`),n({title_font_category:t,title_font_weight:i})},children:[(0,Q.jsx)(Wt,{"aria-label":`Heading font`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:O.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsx)(`span`,{className:e.className,children:e.label})},e.value))})]})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`shrink-0`,children:`Heading weight`}),(0,Q.jsxs)(J,{className:`max-w-[200px]`,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Heading weight`}),(0,Q.jsxs)(qt,{value:(()=>{let t=e.title_font_category||`sans_serif`,n=e.title_font_weight,r=k[t].map,i=r&&r[n]||n;return ee.find(e=>e.value===i)||ee[0]})().value,onValueChange:e=>n({title_font_weight:e}),children:[(0,Q.jsx)(Wt,{"aria-label":`Heading weight`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:ee.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsx)(`span`,{className:e.className,children:e.label})},e.value))})]})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Q.jsx)(`div`,{className:`shrink-0`,children:`Body font`}),(0,Q.jsxs)(J,{className:`max-w-[200px]`,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Body font`}),(0,Q.jsxs)(qt,{value:e.body_font_category,onValueChange:e=>n({body_font_category:e}),children:[(0,Q.jsx)(Wt,{"aria-label":`Body font`,"data-testid":`body-font-select`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:O.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsx)(`span`,{className:e.className,children:e.label})},e.value))})]})]})]})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Header`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-4`,children:[(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:`transparent`,title:`Transparent`,hex:`#00000000`}],title:`Header background color`,value:e.header_background_color||`transparent`,onChange:e=>n({header_background_color:e})})}),(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:A()?`#ffffff`:`#000000`},{value:`accent`,title:`Accent`,hex:d.accent_color}],title:`Post title color`,value:e.post_title_color,onChange:e=>n({post_title_color:e})})}),(0,Q.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Q.jsx)(`div`,{children:`Title alignment`}),(0,Q.jsx)(vl,{label:`Title alignment`,options:[{value:`left`,label:`Left`,icon:(0,Q.jsx)(dr,{className:`size-3.5!`}),disabled:!e.show_post_title_section},{value:`center`,label:`Center`,icon:(0,Q.jsx)(Pn,{className:`size-3.5!`}),disabled:!e.show_post_title_section}],value:e.title_alignment,onValueChange:e=>n({title_alignment:e})})]})]})]}),(0,Q.jsxs)(rn,{className:`mt-6 gap-0`,children:[(0,Q.jsx)(on,{className:`mb-4 text-md! leading-supertight font-bold md:text-lg!`,children:`Body`}),(0,Q.jsxs)(tn,{className:`mb-12 gap-4`,children:[(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:A()?`#ffffff`:`#000000`},{value:`accent`,title:`Accent`,hex:d.accent_color}],title:`Section title color`,value:e.section_title_color,onChange:e=>n({section_title_color:e})})}),(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:A()?`#ffffff`:`#000000`}],title:`Button color`,value:e.button_color,onChange:e=>n({button_color:e})})}),(0,Q.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Q.jsx)(`div`,{children:`Button style`}),(0,Q.jsx)(vl,{label:`Button style`,options:[{value:`fill`,label:`Fill`,icon:(0,Q.jsx)(ei,{className:`size-3.5!`,fill:`currentColor`})},{value:`outline`,label:`Outline`,icon:(0,Q.jsx)(ei,{className:`size-3.5!`})}],value:e.button_style||`fill`,onValueChange:e=>n({button_style:e})})]}),(0,Q.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Q.jsx)(`div`,{children:`Button corners`}),(0,Q.jsx)(vl,{label:`Button corners`,options:[{value:`square`,label:`Squared`,icon:(0,Q.jsx)(Ir,{className:`size-3.5!`})},{value:`rounded`,label:`Rounded`,icon:(0,Q.jsx)(ei,{className:`size-3.5!`})},{value:`pill`,label:`Pill`,icon:(0,Q.jsx)(xr,{className:`size-3.5!`})}],value:e.button_corners||`rounded`,onValueChange:e=>n({button_corners:e})})]}),(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:A()?`#ffffff`:`#000000`}],title:`Link color`,value:e.link_color,onChange:e=>n({link_color:e})})}),(0,Q.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Q.jsx)(`div`,{children:`Link style`}),(0,Q.jsx)(vl,{label:`Link style`,options:[{value:`underline`,label:`Underline`,icon:(0,Q.jsx)(Bn,{className:`size-3.5!`})},{value:`regular`,label:`Regular`,icon:(0,Q.jsx)(yr,{className:`size-3.5!`})},{value:`bold`,label:`Bold`,icon:(0,Q.jsx)(Jr,{className:`size-3.5!`})}],value:e.link_style||`underline`,onValueChange:e=>n({link_style:e})})]}),(0,Q.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Q.jsx)(`div`,{children:`Image corners`}),(0,Q.jsx)(vl,{label:`Image corners`,options:[{value:`square`,label:`Squared`,icon:(0,Q.jsx)(Ir,{className:`size-3.5!`})},{value:`rounded`,label:`Rounded`,icon:(0,Q.jsx)(ei,{className:`size-3.5!`})}],value:e.image_corners||`square`,onValueChange:e=>n({image_corners:e})})]}),(0,Q.jsx)(`div`,{className:`mb-1`,children:(0,Q.jsx)(B,{direction:`rtl`,eyedropper:!0,swatches:[{value:`light`,title:`Light`,hex:`#e0e7eb`},{value:`accent`,title:`Accent`,hex:d.accent_color}],title:`Divider color`,value:e.divider_color||`light`,onChange:e=>n({divider_color:e})})})]})]})]})}];return(0,Q.jsx)(`div`,{className:`flex flex-col`,children:(0,Q.jsx)(`div`,{className:`px-7 pt-0 pb-7`,children:(0,Q.jsxs)(Lt,{value:g,variant:`underline`,onValueChange:e=>{_(e)},children:[(0,Q.jsx)(It,{className:`sticky top-0 z-50 bg-surface-elevated-2`,children:N.map(e=>(0,Q.jsx)(Pt,{value:e.id,children:e.title},e.id))}),N.map(e=>(0,Q.jsx)(Ft,{value:e.id,children:e.contents},e.id))]})})})},xl=({newsletter:e,onlyOne:t})=>{let{config:n}=xt(),{mutateAsync:r}=Ai(),{updateRoute:i}=V(),a=se(`automations`)?`emails`:`newsletters`,{formState:o,saveState:s,updateForm:c,setFormState:l,handleSave:u,validate:d,errors:f,clearError:p,okProps:m}=T({initialState:e,savingDelay:500,onSave:async()=>{let{meta:{sent_email_verification:[e]=[]}={}}=await r(o),t;(e&&e===`sender_email`||e&&e===`sender_reply_to`)&&(t=(0,Q.jsx)(`div`,{children:`We‘ve sent a confirmation email to the new address.`})),t&&b.info(t)},onSaveError:h(),onValidate:()=>{let e={};return o.name||(e.name=`A name is required for your newsletter`),o.sender_email&&!eo.default.isEmail(o.sender_email)?e.sender_email=`Enter a valid email address`:o.sender_email&&ur(n)&&o.sender_email.split(`@`)[1]!==Zn(n)&&(e.sender_email=`Email address must end with @${Zn(n)}`),o.sender_reply_to&&!eo.default.isEmail(o.sender_reply_to)&&![`newsletter`,`support`].includes(o.sender_reply_to)&&(e.sender_reply_to=`Enter a valid email address`),e}}),g=e=>{c(t=>({...t,...e}))};(0,Z.useEffect)(()=>{l(()=>e)},[l,e]);let _=(0,Q.jsx)(_l,{newsletter:o}),v=(0,Q.jsx)(bl,{clearError:p,errors:f,newsletter:o,onlyOne:t,updateNewsletter:g,validate:d});return(0,Q.jsx)(Za,{afterClose:()=>i(a),buttonsDisabled:m.disabled,cancelLabel:`Close`,dirty:s===`unsaved`,okLabel:m.label||`Save`,okVariant:m.variant,preview:_,previewBgColor:`grey`,previewToolbar:!1,sidebar:v,sidebarPadding:!1,testId:`newsletter-modal`,title:`Newsletter`,onOk:async()=>{await u({fakeWhenUnchanged:!0})}})},Sl=H.create(({params:e})=>{let{data:{newsletters:t,isEnd:n}={},fetchNextPage:r}=Mi(),i=t?.find(({id:t})=>t===e?.id);return(0,Z.useEffect)(()=>{!i&&!n&&r()},[r,n,i]),i?(0,Q.jsx)(xl,{newsletter:i,onlyOne:t.length===1}):null}),Cl=({id:e})=>{let{updateRoute:t}=V(),{data:{offers:n=[]}={}}=A(e||``),[r,i]=(0,Z.useState)(),[a,o]=(0,Z.useState)(``),{siteData:s}=xt();(0,Z.useEffect)(()=>{if(n.length>0){let e=n[0],t=`${wi(s)}${e?.code}`;o(t),i(e)}},[n,s]);let[c,l]=(0,Z.useState)(!1),u=()=>{let e=``;switch(r?.type){case`percent`:e=r?.amount+`% discount`;break;case`fixed`:e=F(ze(r?.amount),{maximumFractionDigits:2})+` `+r?.currency+` discount`;break;case`trial`:e=r?.amount+` days free trial`;break;default:break}return`${encodeURIComponent(r?.name||``)} — Check out ${encodeURIComponent(e)} on:`};return(0,Q.jsx)(Ie,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,footer:!1,height:`full`,size:`lg`,testId:`offer-success-modal`,topRightContent:`close`,width:1140,children:(0,Q.jsxs)(`div`,{className:`-mt-6 flex h-full flex-col items-center justify-center text-center`,children:[(0,Q.jsx)(Ro,{className:`absolute top-5 left-6`,current:r?.name||``,label:`Offers`,onBack:()=>t(`offers/edit`)}),(0,Q.jsx)(Fr,{className:`-mt-4 size-10 text-grey-700`}),(0,Q.jsx)(`h1`,{className:`mt-6 text-4xl`,children:`Your new offer is live!`}),(0,Q.jsx)(`p`,{className:`mt-3 max-w-[510px] text-[1.6rem]`,children:`You can share the link anywhere. In your newsletter, social media, a podcast, or in-person. It all just works.`}),(0,Q.jsxs)(`div`,{className:`mt-8 flex w-full max-w-md flex-col gap-8`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col-reverse gap-2`,children:[(0,Q.jsx)(X,{className:`h-[var(--control-height)] border-transparent bg-muted`,name:`offer-url`,type:`url`,value:a,disabled:!0}),(0,Q.jsx)(cr,{className:`w-full`,type:`button`,onClick:async()=>{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)},children:c?`Copied!`:`Copy link`})]}),(0,Q.jsx)(`div`,{className:`flex items-center gap-4 text-sm font-medium before:h-px before:grow before:bg-grey-300 before:content-[""] after:h-px after:grow after:bg-grey-300 after:content-[""] dark:before:bg-grey-800 dark:after:bg-grey-800`,children:`OR`}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(cr,{"aria-label":`Share on X`,className:`h-8 flex-1`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>{window.open(`https://twitter.com/intent/tweet?url=${encodeURI(a)}&text=${u()}`,`_blank`)},children:(0,Q.jsx)(it,{className:`size-3.5!`,name:`twitter-x`})}),(0,Q.jsx)(cr,{"aria-label":`Share on Facebook`,className:`h-8 flex-1`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(a)}`,`_blank`)},children:(0,Q.jsx)(it,{className:`size-3.5!`,name:`facebook`})}),(0,Q.jsx)(cr,{"aria-label":`Share on LinkedIn`,className:`h-8 flex-1`,size:`sm`,type:`button`,variant:`outline`,onClick:()=>{window.open(`http://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(a)}&title=${u()}`,`_blank`)},children:(0,Q.jsx)(it,{className:`size-3.5!`,name:`linkedin`})})]})]})]})})},wl=({href:e,onDestroyed:t,selectedTab:n,portalParent:r})=>{n||=`signup`;let i=(0,Z.useRef)(null),[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(!0),l=(0,Z.useCallback)(()=>{setTimeout(()=>{i.current&&c(!1)},300)},[i]);if((0,Z.useEffect)(()=>{let n=t=>{e&&new URL(t.origin).origin===new URL(e).origin&&t?.data?.type===`portal-preview-ready`&&l()};return window.addEventListener(`message`,n,!0),()=>{window.removeEventListener(`message`,n,!0),t?.()}},[e,t,l,a]),!e)return null;let u=`mt-[-7%] flex h-screen items-center justify-center`,d=`hidden`;return r===`preview`?(u=`absolute z-50 mt-[-7%] flex h-screen items-center justify-center`,d=`invisible`):r===`offers`&&(u=`absolute z-50 flex w-full h-full items-center justify-center`,d=`invisible`),(0,Q.jsxs)(Q.Fragment,{children:[s&&(0,Q.jsx)(`div`,{className:u,children:(0,Q.jsx)(`span`,{children:(0,Q.jsx)(Kr,{size:`lg`})})}),(0,Q.jsx)(`iframe`,{ref:i,className:!s&&a?``:d,"data-testid":`portal-preview`,height:`100%`,src:e,title:`Portal Preview`,width:`100%`,onLoad:()=>{o(!0)}})]})},Tl=(e,t)=>{let{disableBackground:n=!1,name:r,code:i,displayTitle:a=``,displayDescription:o=``,type:s,cadence:c,amount:l=0,duration:u,durationInMonths:d,currency:f=`usd`,status:p,tierId:m,redemptionType:h=`signup`}=e;t=t.replace(/\/$/,``);let g=new URLSearchParams;return g.append(`disableBackground`,`false`),g.append(`name`,encodeURIComponent(r)),g.append(`code`,encodeURIComponent(i)),g.append(`display_title`,encodeURIComponent(a)),g.append(`display_description`,encodeURIComponent(o)),g.append(`type`,encodeURIComponent(s)),g.append(`cadence`,encodeURIComponent(c)),g.append(`amount`,encodeURIComponent(l)),g.append(`duration`,encodeURIComponent(u)),g.append(`duration_in_months`,encodeURIComponent(d)),g.append(`currency`,encodeURIComponent(f)),g.append(`status`,encodeURIComponent(p)),g.append(`tier_id`,encodeURIComponent(m)),g.append(`redemption_type`,encodeURIComponent(h)),n&&g.append(`disableBackground`,`true`),g.append(`admin_toolbar`,`0`),`${t}/?v=modal-portal-offer#/portal/preview/offer?${g.toString()}`},El=e=>{let t=[];return e.forEach(e=>{t.push({label:`${e.name} - Monthly`,value:`${e.id}-month-${e.currency}`}),t.push({label:`${e.name} - Yearly`,value:`${e.id}-year-${e.currency}`})}),t};function Dl(e){return e.toString().toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\w-]+/g,``).replace(/--+/g,`-`)}var Ol=191,kl=e=>{let{fixedAmount:t=0,percentAmount:n=0,trialAmount:r=0,amount:i=0}=e;switch(e.type){case`fixed`:return t*100;case`percent`:return n;case`trial`:return r;default:return i}},Al=({tierOptions:e,handleTierChange:t,selectedTier:n,typeOptions:r,durationOptions:i,handleTypeChange:a,handleDurationChange:o,overrides:s,handleAmountTypeChange:c,handleNameInput:l,handleTextAreaInput:u,handleDisplayTitleInput:d,handleDurationInMonthsInput:f,handleAmountInput:p,handleCodeInput:m,clearError:h,errors:g,testId:_,handleTrialAmountInput:v,amountOptions:y})=>{let b=s.cadence===`year`,x=b?i.filter(e=>e.value!==`repeating`):i,[S,C]=(0,Z.useState)(0),w=S>40?`text-red`:`text-green`,{siteData:T}=xt(),[E,D]=(0,Z.useState)(!1),O=wi(T),k=`${O}${s.code.value}`;return(0,Q.jsx)(`div`,{className:`pt-7`,"data-testid":_,children:(0,Q.jsxs)(tn,{className:`mb-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsxs)(J,{"data-invalid":!!g.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-name`,children:`Offer name`}),(0,Q.jsx)(X,{"aria-invalid":!!g.name||void 0,id:`offer-name`,maxLength:40,placeholder:`Black Friday`,onChange:e=>{l(e),C(e.target.value.length)},onKeyDown:()=>h(`name`)}),g.name?(0,Q.jsx)(G,{children:g.name}):(0,Q.jsx)(q,{children:(0,Q.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Q.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Q.jsxs)(`strong`,{children:[(0,Q.jsx)(`span`,{className:w,children:F(S)}),` / `,F(40)]})]})})]}),(0,Q.jsxs)(J,{"data-invalid":!!g.displayTitle||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-display-title`,children:`Display title`}),(0,Q.jsx)(X,{"aria-invalid":!!g.displayTitle||void 0,id:`offer-display-title`,maxLength:Ol,placeholder:`Black Friday Special`,value:s.displayTitle.value,onChange:e=>{d(e)},onKeyDown:()=>h(`displayTitle`)}),g.displayTitle&&(0,Q.jsx)(G,{children:g.displayTitle})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`offer-display-description`,children:`Display description`}),(0,Q.jsx)(sn,{className:`border-transparent bg-muted`,id:`offer-display-description`,maxLength:Ol,placeholder:`Take advantage of this limited-time offer.`,value:s.displayDescription,onChange:e=>{u(e)}})]})]})]}),(0,Q.jsxs)(`section`,{className:`mt-4`,children:[(0,Q.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsx)(ba,{"aria-label":`Offer type`,className:`rounded-md border border-border-default p-4`,value:s.type===`trial`?`trial`:`percent`,onValueChange:a,children:r.map(e=>{let t=`offer-type-${e.value}`;return(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(Sa,{id:t,indicator:`check`,value:e.value}),(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{className:`cursor-pointer`,htmlFor:t,children:e.title}),(0,Q.jsx)(q,{children:e.description})]})]},e.value)})}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Tier — Cadence`}),(0,Q.jsxs)(qt,{value:n.value,onValueChange:n=>{let r=e.find(e=>e.value===n);r&&t(r)},children:[(0,Q.jsx)(Wt,{"aria-label":`Tier — Cadence`,"data-testid":`tier-cadence-select-offers`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:e.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]}),s.type!==`trial`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(J,{"data-invalid":!!g.amount||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-amount`,children:`Amount off`}),(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!g.amount||void 0,children:[(0,Q.jsx)(ln,{id:`offer-amount`,type:`number`,value:s.type===`fixed`?s.fixedAmount===0?``:s.fixedAmount?.toString():s.percentAmount===0?``:s.percentAmount?.toString(),onChange:e=>{p(e)},onKeyDown:()=>h(`amount`)}),(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsxs)(qt,{value:s.type===`percent`?y[0].value:y[1].value,onValueChange:c,children:[(0,Q.jsx)(Wt,{"aria-label":`Amount type`,className:`h-7 w-20 border-0 bg-transparent px-2 shadow-none focus-visible:ring-0`,"data-testid":`amount-type-select-offers`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{align:`end`,children:y.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})})]}),g.amount&&(0,Q.jsx)(G,{children:g.amount})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Duration`}),(0,Q.jsxs)(qt,{value:s.duration,onValueChange:e=>{h(`durationInMonths`),o(e)},children:[(0,Q.jsx)(Wt,{"aria-label":`Duration`,"data-testid":`duration-select-offers`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:x.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]}),s.duration===`repeating`&&!b&&(0,Q.jsx)(`div`,{className:`-mt-4`,children:(0,Q.jsxs)(J,{"data-invalid":!!g.durationInMonths||void 0,children:[(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!g.durationInMonths||void 0,children:[(0,Q.jsx)(ln,{"aria-invalid":!!g.durationInMonths||void 0,"data-testid":`duration-months-input`,type:`number`,value:s.durationInMonths===0?``:String(s.durationInMonths),onChange:e=>{f(e)},onKeyDown:()=>h(`durationInMonths`)}),(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsx)(cn,{children:s.durationInMonths===1?`month`:`months`})})]}),g.durationInMonths&&(0,Q.jsx)(G,{children:g.durationInMonths})]})})]}),s.type===`trial`&&(0,Q.jsxs)(J,{"data-invalid":!!g.amount||void 0,children:[(0,Q.jsx)(K,{htmlFor:`trial-duration`,children:`Trial duration`}),(0,Q.jsx)(X,{"aria-invalid":!!g.amount||void 0,id:`trial-duration`,type:`number`,value:s.trialAmount?.toString(),onChange:e=>{v(e)},onKeyDown:()=>h(`amount`)}),g.amount&&(0,Q.jsx)(G,{children:g.amount})]}),(0,Q.jsxs)(J,{"data-invalid":!!g.code||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-code`,children:`Offer code`}),(0,Q.jsx)(X,{"aria-invalid":!!g.code||void 0,id:`offer-code`,placeholder:`black-friday`,value:s.code.value,onChange:e=>{m(e)},onKeyDown:()=>h(`code`)}),g.code?(0,Q.jsx)(G,{children:g.code}):s.code.value!==``&&(0,Q.jsx)(q,{children:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{children:[O,(0,Q.jsx)(`span`,{className:`font-bold`,children:s.code.value})]}),(0,Q.jsx)(cr,{className:`h-auto p-0 text-sm text-green hover:text-green`,size:`sm`,type:`button`,variant:`link`,onClick:async()=>{await navigator.clipboard.writeText(k),D(!0),setTimeout(()=>D(!1),2e3)},children:E?`Copied`:`Copy`})]})})]})]})]})]})})},jl=e=>{let[t,n,r]=e.split(`-`);if(!t||!n||!r)throw Error(`Invalid input format. Expected format is: id-period-currency`);return{id:t,period:n,currency:r}},Ml=()=>{let{siteData:e}=xt(),t=[{title:`Discount`,description:`Offer a special reduced price`,value:`percent`},{title:`Free trial`,description:`Give free access for a limited time`,value:`trial`}],n=[{value:`once`,label:`First-payment`},{value:`repeating`,label:`Multiple-months`},{value:`forever`,label:`Forever`}],[r,i]=(0,Z.useState)(``),{updateRoute:a}=V(),{data:{tiers:o}={}}=Pi(),s=Ii(o||[]),c=El(s),{mutateAsync:l}=j(),[d,f]=(0,Z.useState)({tier:c[0]||{},dataset:{id:c[0]?.value?jl(c[0]?.value).id:``,period:c[0]?.value?jl(c[0]?.value).period:``,currency:c[0]?.value?jl(c[0]?.value).currency:``}}),{data:{offers:p=[]}={}}=k(),{formState:m,updateForm:h,handleSave:g,saveState:_,okProps:v,validate:y,errors:x,clearError:S}=T({initialState:{disableBackground:!1,name:``,code:{isDirty:!1,value:``},displayTitle:{isDirty:!1,value:``},displayDescription:``,type:`percent`,cadence:d?.dataset?.period||``,amount:0,duration:`once`,durationInMonths:1,currency:d?.dataset?.currency||`USD`,status:`active`,tierId:d?.dataset?.id||``,trialAmount:7,fixedAmount:0,percentAmount:0},onSave:async()=>{let e=m.type===`trial`?`trial`:m.duration,t={name:m.name,code:m.code.value,display_title:m.displayTitle.value,display_description:m.displayDescription,cadence:m.cadence,amount:kl(m)||0,duration:e,...e===`repeating`?{duration_in_months:m.durationInMonths}:{},currency:m.currency,status:m.status,redemption_type:`signup`,tier:{id:m.tierId},type:m.type,currency_restriction:!1},n=await l(t);n&&n.offers&&n.offers.length>0&&a(`offers/success/${n.offers[0].id}`)},onSaveError:()=>{},onValidate:()=>{let e={};return!m.name&&m.name.length===0&&(e.name=`Name is required`),!m.code.value&&m.code.value.length===0&&(e.code=`Code is required`),!m.displayTitle.value&&m.displayTitle.value.length===0&&(e.displayTitle=`Display title is required`),m.type===`percent`&&m.percentAmount===0&&(e.amount=`Enter an amount greater than 0.`),m.type===`percent`&&(m.percentAmount<1||m.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),(m.type===`fixed`&&m.fixedAmount===0||m.type===`fixed`&&m.fixedAmount<1)&&(e.amount=`Enter an amount greater than 0.`),m.type===`trial`&&m.trialAmount===0&&(e.amount=`Enter an amount greater than 0.`),m.type===`trial`&&m.trialAmount<1&&(e.amount=`Free trial must be at least 1 day.`),m.type!==`trial`&&m.duration===`repeating`&&(!Number.isInteger(m.durationInMonths)||m.durationInMonths<1)&&(e.durationInMonths=`Enter a whole number of months (1 or more).`),e},savingDelay:500}),C=[{value:`percent`,label:`%`},{value:`fixed`,label:m.currency}],w=e=>{let t=jl(e.value),n=t.period===`year`;f({tier:e,dataset:t}),h(e=>({...e,cadence:t.period,currency:t.currency,tierId:t.id,duration:n&&e.duration===`repeating`?`once`:e.duration})),n&&S(`durationInMonths`)},E=e=>{e===`trial`&&(S(`amount`),S(`durationInMonths`)),h(t=>({...t,type:e}))},D=e=>{h(t=>({...t,type:e===`percent`?`percent`:`fixed`}))},O=e=>{let t=e.target;m.type===`fixed`?h(e=>({...e,fixedAmount:Number(t.value)})):m.type===`percent`?h(e=>({...e,percentAmount:Number(t.value)})):h(e=>({...e,amount:Number(t.value)}))},A=e=>{let t=e.target,n=Number(t.value);h(e=>({...e,durationInMonths:Number.isNaN(n)?0:n}))},M=e=>{let t=e.target.value;h(e=>{let n={...e};return n.name=t,e.code.isDirty||(S(`code`),n.code={...e.code,value:Dl(t)}),e.displayTitle.isDirty||(S(`displayTitle`),n.displayTitle={...e.displayTitle,value:t}),n})},ee=e=>{let t=e.target;h(e=>({...e,displayTitle:{...e.displayTitle,isDirty:!0,value:t.value}}))},N=e=>{let t=e.target;h(e=>({...e,displayDescription:t.value}))},P=e=>{let t=e.target;h(e=>({...e,trialAmount:Number(t.value)}))},F=e=>{h(t=>({...t,duration:e}))},I=e=>{let t=e.target;h(e=>({...e,code:{...e.code,isDirty:!0,value:t.value}}))},L=()=>{p.length>0?a(`offers/edit`):a(`offers`)},R=(0,Z.useMemo)(()=>({name:m.name||``,code:m.code.value||``,displayTitle:m.displayTitle.value||``,displayDescription:m.displayDescription||``,type:m.type||`percent`,cadence:m.cadence||`month`,amount:kl(m)||0,duration:m.type===`trial`?`trial`:m.duration||`once`,durationInMonths:m.durationInMonths||0,currency:m.currency||`USD`,status:m.status||`active`,tierId:m.tierId||s[0]?.id,redemptionType:`signup`}),[m,s]);(0,Z.useEffect)(()=>{let t=Tl(R,e.url);i(t)},[m,e.url,m.type,R]);let z=(0,Q.jsx)(Al,{amountOptions:C,clearError:S,durationOptions:n,errors:x,handleAmountInput:O,handleAmountTypeChange:D,handleCodeInput:I,handleDisplayTitleInput:ee,handleDurationChange:F,handleDurationInMonthsInput:A,handleNameInput:M,handleTextAreaInput:N,handleTierChange:w,handleTrialAmountInput:P,handleTypeChange:E,overrides:m,selectedTier:d.tier,testId:`add-offer-sidebar`,tierOptions:c,typeOptions:t,validate:y}),te=(0,Q.jsx)(wl,{href:r||``,portalParent:`offers`});return(0,Q.jsx)(Za,{afterClose:()=>{a(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,dirty:_===`unsaved`,height:`full`,okLabel:`Publish`,okVariant:v.variant,preview:te,previewToolbar:!1,sidebar:z,size:`lg`,testId:`add-offer-modal`,title:`Offer`,width:1140,onCancel:L,onOk:async()=>{if(y(),!Object.values(x).every(e=>!e)){b.dismiss(),b.info(`Can't save offer`,{description:`Make sure you filled all required fields`});return}try{if(await g({force:!0}))return}catch(e){let t;e instanceof u&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),b.dismiss(),t&&b.error(`Can't save offer`,{description:t||`Please try again later`})}}})},Nl=e=>new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`}),Pl=e=>{let t=`offer_redemptions:[${e.join(`,`)}]`;return`/ghost/#/members?filter=${encodeURIComponent(t)}`},Fl=e=>Pl([e]),Il=({amount:e,duration:t})=>e===100&&t===`repeating`,Ll=(e,t)=>`Retention ${e} (${t})`,Rl=({amount:e,duration:t,durationInMonths:n})=>Il({amount:e,duration:t})?`${n} ${n===1?`month`:`months`} free`:t===`once`?`${e}% off once`:t===`repeating`?`${e}% off for ${n} mo`:`${e}% off forever`,zl=(e,t)=>{let n=t.trim(),r=Rl(e),i=Ll(r,n);if(i.length<=40)return i;let a=i.length-40,o=Math.max(3,n.length-a);return Ll(r,n.slice(0,o))};function Bl(e){return new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})}var Vl=({clearError:e,errors:t,offer:n,updateOffer:r})=>{let{siteData:i}=xt(),[a,o]=(0,Z.useState)(!1),s=h(),{mutateAsync:c}=O(),[l,u]=(0,Z.useState)(n?.name.length||0),d=l>40?`text-red`:`text-green`,{updateRoute:f}=V();(0,Z.useEffect)(()=>{n?.name&&u(n?.name.length)},[n?.name]);let p=wi(i),m=`${p}${n?.code}`,g=async()=>{await navigator.clipboard.writeText(m),o(!0),setTimeout(()=>o(!1),2e3)},_=async()=>{n?.status===`active`?H.show(We,{title:`Archive offer`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{children:`New members will no longer be able to subscribe using this offer.`}),(0,Q.jsxs)(`p`,{children:[`All members that previously redeemed `,(0,Q.jsx)(`strong`,{children:n?.name}),` will remain unchanged.`]})]}),okLabel:`Archive`,okVariant:`destructive`,onOk:async e=>{try{await c({...n,status:`archived`}),e?.remove(),b.success(`Offer archived`),f(`offers/edit`)}catch(e){s(e)}}}):H.show(We,{title:`Reactivate offer`,prompt:(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`p`,{children:[`Reactivating `,(0,Q.jsx)(`strong`,{children:n?.name}),` will allow new members to subscribe using this offer. Existing members will remain unchanged.`]})}),okLabel:`Reactivate`,onOk:async e=>{try{await c({...n,status:`active`}),e?.remove(),b.success(`Offer reactivated`),f(`offers/edit`)}catch(e){s(e)}}})};return(0,Q.jsxs)(`div`,{className:`flex grow flex-col pt-2`,children:[(0,Q.jsxs)(tn,{className:`mb-10 grow gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsx)(`section`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5 rounded-md border border-grey-300 p-4 pb-3.5 dark:border-grey-800`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Created on`}),(0,Q.jsx)(`span`,{children:Bl(n?.created_at?n.created_at:``)})]}),(0,Q.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Q.jsxs)(`span`,{children:[F(n?.redemption_count||0),` `,n?.redemption_count===1?`redemption`:`redemptions`]})]}),n?.redemption_count>0&&n?.last_redeemed?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Q.jsx)(`span`,{children:Bl(n?.last_redeemed)})]}):null]}),n?.redemption_count>0?(0,Q.jsx)(`a`,{className:`font-semibold text-green`,href:Fl(n?.id),children:`See members →`}):null]})]})}),(0,Q.jsxs)(`section`,{className:`mt-2`,children:[(0,Q.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsxs)(J,{"data-invalid":!!t.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-name`,children:`Offer name`}),(0,Q.jsx)(X,{"aria-invalid":!!t.name||void 0,id:`offer-name`,maxLength:40,placeholder:`Black Friday`,value:n?.name??``,onChange:e=>{u(e.target.value.length),r({name:e.target.value})},onKeyDown:()=>e(`name`)}),t.name?(0,Q.jsx)(G,{children:t.name}):(0,Q.jsx)(q,{children:(0,Q.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Q.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Q.jsxs)(`strong`,{children:[(0,Q.jsx)(`span`,{className:d,children:F(l)}),` / `,F(40)]})]})})]}),(0,Q.jsxs)(J,{className:`group`,"data-invalid":!!t.code||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-code`,children:`Offer code`}),(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!t.code||void 0,children:[(0,Q.jsx)(ln,{"aria-invalid":!!t.code||void 0,id:`offer-code`,placeholder:`black-friday`,value:n?.code??``,onChange:e=>r({code:e.target.value}),onKeyDown:()=>e(`code`)}),n?.code!==``&&(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsx)(dn,{onClick:g,children:a?`Copied!`:`Copy link`})})]}),t.code?(0,Q.jsx)(G,{children:t.code}):n?.code!==``&&(0,Q.jsxs)(q,{className:`truncate`,children:[p,(0,Q.jsx)(`span`,{className:`font-bold text-foreground`,children:n?.code})]})]}),(0,Q.jsxs)(J,{"data-invalid":!!t.displayTitle||void 0,children:[(0,Q.jsx)(K,{htmlFor:`offer-display-title`,children:`Display title`}),(0,Q.jsx)(X,{"aria-invalid":!!t.displayTitle||void 0,id:`offer-display-title`,placeholder:`Black Friday Special`,value:n?.display_title??``,onChange:e=>r({display_title:e.target.value}),onKeyDown:()=>e(`displayTitle`)}),t.displayTitle&&(0,Q.jsx)(G,{children:t.displayTitle})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`offer-display-description`,children:`Display description`}),(0,Q.jsx)(sn,{className:`border-transparent bg-muted`,id:`offer-display-description`,placeholder:`Take advantage of this limited-time offer.`,value:n?.display_description??``,onChange:e=>r({display_description:e.target.value})})]})]})]})]}),(0,Q.jsx)(`div`,{className:`mb-2`,children:n?.status===`active`?(0,Q.jsx)(cr,{className:`h-auto p-0 text-destructive hover:text-destructive`,type:`button`,variant:`link`,onClick:_,children:`Archive offer`}):(0,Q.jsx)(cr,{className:`h-auto p-0 text-green hover:text-green`,type:`button`,variant:`link`,onClick:_,children:`Reactivate offer`})})]})},Hl=({id:e})=>{let{siteData:t}=xt(),{updateRoute:n}=V(),r=h(),{mutateAsync:i}=O(),[a,o]=(0,Z.useState)(``),{data:{offers:s=[]}={}}=A(e||``),{formState:c,saveState:l,updateForm:d,setFormState:f,handleSave:p,validate:m,errors:g,clearError:_,okProps:v}=T({initialState:s[0],savingDelay:500,onSave:async()=>{await i(c)},onSaveError:r,onValidate:()=>{let e={};return c?.name||(e.name=`Name is required`),c?.display_title||(e.displayTitle=`Display title is required`),c?.code||(e.code=`Please enter a code`),e}});(0,Z.useEffect)(()=>{f(()=>s[0])},[f,s]);let y=(0,Q.jsx)(Vl,{clearError:_,errors:g,offer:c,updateOffer:e=>{d(t=>({...t,...e}))},validate:m});(0,Z.useEffect)(()=>{let e=Tl({name:c?.name||``,code:c?.code||``,displayTitle:c?.display_title||``,displayDescription:c?.display_description||``,type:c?.type||``,cadence:c?.cadence||``,amount:c?.amount,duration:c?.duration||``,durationInMonths:c?.duration_in_months||0,currency:c?.currency||``,status:c?.status||``,tierId:c?.tier?.id||``,redemptionType:`signup`},t.url);o(e)},[c,t]);let x=(0,Q.jsx)(wl,{href:a||``,portalParent:`offers`}),S=()=>{n(`offers/edit`)};return s?(0,Q.jsx)(Za,{afterClose:()=>{n(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,dirty:l===`unsaved`,height:`full`,okLabel:v.label||`Save`,okVariant:v.variant,preview:x,previewToolbarBreadcrumbs:(0,Q.jsx)(Ro,{current:c?.name||`Offer`,label:`Offers`,onBack:S}),sidebar:y,size:`lg`,testId:`offer-update-modal`,title:`Offer`,width:1140,onCancel:S,onOk:async()=>{try{if(await p({force:!0}))return}catch(e){let t;e instanceof u&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),b.dismiss(),t&&b.error(`Can't save offer`,{description:`Please try again later`})}}}):null},Ul=[{title:`Percentage discount`,description:`Offer a special reduced price`,value:`percent`},{title:`Free month(s)`,description:`Give free access for a limited time`,value:`free_months`}],Wl=[{value:`once`,label:`First-payment`},{value:`repeating`,label:`Multiple-months`},{value:`forever`,label:`Forever`}],Gl=191,Kl=99,ql=`Enter a whole number of months between 1 and ${Kl}.`,Jl=e=>Math.max(1,Number.isFinite(e)?Math.trunc(e):0),Yl=({type:e,percentAmount:t,freeMonths:n,lastPercentAmount:r,lastFreeMonths:i})=>e===`free_months`?n>0?n:i:t>0?t:r,Xl=(e=`monthly`)=>({enabled:!1,displayTitle:``,displayDescription:``,type:e===`yearly`?`percent`:`free_months`,percentAmount:20,duration:`once`,durationInMonths:1,freeMonths:1}),Zl=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,Ql=(e,t=`monthly`)=>{let n=Xl(t);if(!e)return n;let r=Zl(e),i=e.type===`percent`&&!r,a=e.duration===`repeating`&&e.duration_in_months?e.duration_in_months:n.durationInMonths;return{enabled:e.status===`active`,displayTitle:e.display_title||``,displayDescription:e.display_description||``,type:r?`free_months`:`percent`,percentAmount:i?e.amount:n.percentAmount,duration:i?e.duration:n.duration,durationInMonths:a,freeMonths:r&&e.duration_in_months||n.freeMonths}},$l=({formState:e,lastPercentAmount:t,lastFreeMonths:n})=>{let r=Yl({type:e.type,percentAmount:e.percentAmount,freeMonths:e.freeMonths,lastPercentAmount:t,lastFreeMonths:n});if(e.type===`free_months`)return{type:`percent`,amount:100,duration:`repeating`,durationInMonths:Jl(r)};let i=e.duration;return{type:`percent`,amount:r,duration:i,durationInMonths:i===`repeating`?Jl(e.durationInMonths):0}},eu=e=>{if(!e)return null;let t=e.duration_in_months??0;return{type:`percent`,amount:e.amount,duration:e.duration,durationInMonths:t}},tu=e=>e?`${e.type}:${e.amount}:${e.duration}:${e.durationInMonths}`:``,nu=e=>Number.isInteger(e)&&e>0&&e<=Kl,ru=(e,t)=>e.displayTitle!==t.displayTitle||e.displayDescription!==t.displayDescription||e.type!==t.type||e.percentAmount!==t.percentAmount||e.duration!==t.duration||e.durationInMonths!==t.durationInMonths||e.freeMonths!==t.freeMonths,iu=({formState:e,updateForm:t,clearError:n,errors:r,cadence:i,lastRedeemed:a,membersFilterUrl:o,redemptions:s})=>{let c=i===`yearly`?Wl.filter(e=>e.value!==`repeating`):Wl;return(0,Q.jsx)(`div`,{className:`flex grow flex-col pt-2`,children:(0,Q.jsxs)(tn,{className:`mb-10 grow gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsx)(`section`,{children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-5 rounded-md border border-grey-300 p-4 pb-3.5 dark:border-grey-800`,children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:(0,Q.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Q.jsxs)(`span`,{children:[F(s),` `,s===1?`redemption`:`redemptions`]})]}),s>0&&a?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Q.jsx)(`span`,{children:Nl(a)})]}):null]}),s>0&&o?(0,Q.jsx)(`a`,{className:`font-semibold text-green`,href:o,children:`See members →`}):null]})})})}),(0,Q.jsx)(`section`,{className:`mt-2`,children:(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsxs)(K,{htmlFor:`${i}-retention-enabled`,children:[`Enable `,i,` retention`]}),(0,Q.jsx)(q,{children:i===`monthly`?`Applied to monthly plans`:`Applied to annual plans`})]}),(0,Q.jsx)(W,{checked:e.enabled,id:`${i}-retention-enabled`,onCheckedChange:e=>t(t=>({...t,enabled:e}))})]})}),e.enabled&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`mt-2`,children:[(0,Q.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`retention-display-title`,children:`Display title`}),(0,Q.jsx)(X,{id:`retention-display-title`,maxLength:Gl,placeholder:`Before you go`,value:e.displayTitle,onChange:e=>{t(t=>({...t,displayTitle:e.target.value}))}})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`retention-display-description`,children:`Display description`}),(0,Q.jsx)(sn,{className:`border-transparent bg-muted`,id:`retention-display-description`,maxLength:Gl,placeholder:`We'd hate to see you leave. How about a special offer to stay?`,value:e.displayDescription,onChange:e=>{t(t=>({...t,displayDescription:e.target.value}))}})]})]})]}),(0,Q.jsxs)(`section`,{className:`mt-4`,children:[(0,Q.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i===`monthly`&&(0,Q.jsx)(ba,{"aria-label":`${i} retention offer type`,className:`rounded-md border border-border-default p-4`,value:e.type,onValueChange:e=>{n(`amount`),n(`durationInMonths`),t(t=>({...t,type:e}))},children:Ul.map(e=>{let t=`${i}-retention-type-${e.value}`;return(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(Sa,{id:t,indicator:`check`,value:e.value}),(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{className:`cursor-pointer`,htmlFor:t,children:e.title}),(0,Q.jsx)(q,{children:e.description})]})]},e.value)})}),e.type===`percent`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(J,{"data-invalid":!!r.amount||void 0,children:[(0,Q.jsx)(K,{htmlFor:`retention-amount`,children:`Amount off`}),(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!r.amount||void 0,children:[(0,Q.jsx)(ln,{"aria-invalid":!!r.amount||void 0,id:`retention-amount`,type:`number`,value:e.percentAmount===0?``:String(e.percentAmount),onChange:e=>{let n=Number(e.target.value),r=Number.isNaN(n)?0:n;t(e=>({...e,percentAmount:r}))},onKeyDown:()=>n(`amount`)}),(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsx)(cn,{children:`%`})})]}),r.amount&&(0,Q.jsx)(G,{children:r.amount})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Duration`}),(0,Q.jsxs)(qt,{value:e.duration,onValueChange:e=>{n(`durationInMonths`),t(t=>({...t,duration:e}))},children:[(0,Q.jsx)(Wt,{"aria-label":`Duration`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:c.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]}),e.duration===`repeating`&&(0,Q.jsx)(`div`,{className:`-mt-4`,children:(0,Q.jsxs)(J,{"data-invalid":!!r.durationInMonths||void 0,children:[(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!r.durationInMonths||void 0,children:[(0,Q.jsx)(ln,{"aria-invalid":!!r.durationInMonths||void 0,"data-testid":`duration-months-input`,type:`number`,value:e.durationInMonths===0?``:String(e.durationInMonths),onChange:e=>{let n=Number(e.target.value);t(e=>({...e,durationInMonths:Number.isNaN(n)?0:n}))},onKeyDown:()=>n(`durationInMonths`)}),(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsx)(cn,{children:e.durationInMonths===1?`month`:`months`})})]}),r.durationInMonths&&(0,Q.jsx)(G,{children:r.durationInMonths})]})})]}),e.type===`free_months`&&(0,Q.jsxs)(J,{"data-invalid":!!r.amount||void 0,children:[(0,Q.jsx)(K,{htmlFor:`retention-free-months`,children:`Free months`}),(0,Q.jsxs)(fn,{className:`h-[var(--control-height)] border-transparent bg-muted`,"data-invalid":!!r.amount||void 0,children:[(0,Q.jsx)(ln,{"aria-invalid":!!r.amount||void 0,id:`retention-free-months`,type:`number`,value:e.freeMonths===0?``:String(e.freeMonths),onChange:e=>{let n=Number(e.target.value);t(e=>({...e,freeMonths:Number.isNaN(n)?0:n}))},onKeyDown:()=>n(`amount`)}),(0,Q.jsx)(un,{align:`inline-end`,children:(0,Q.jsx)(cn,{children:e.freeMonths===1?`month`:`months`})})]}),r.amount&&(0,Q.jsx)(G,{children:r.amount})]})]})]})]})]})})},au=({id:e})=>{let{updateRoute:t}=V(),{siteData:n}=xt(),{data:{tiers:r=[]}={}}=Pi(),{data:{offers:i=[]}={},isFetched:a,isFetching:o}=k(),{mutateAsync:s}=j(),{mutateAsync:c}=O(),l=D(),[d,f]=(0,Z.useState)(``),p=e===`monthly`?`monthly`:`yearly`,m=p===`monthly`?`Monthly retention`:`Yearly retention`,h=p===`monthly`?`month`:`year`,g=Ii(r||[]),_=(0,Z.useMemo)(()=>i.filter(e=>e.redemption_type===`retention`&&e.cadence===h).sort((e,t)=>{let n=e.created_at?new Date(e.created_at).getTime():0;return(t.created_at?new Date(t.created_at).getTime():0)-n}),[i,h]),v=(0,Z.useMemo)(()=>_.find(e=>e.status===`active`)||null,[_]),y=_[0]||null,x=v||y,S=(0,Z.useMemo)(()=>_.reduce((e,t)=>e+(t.redemption_count||0),0),[_]),C=(0,Z.useMemo)(()=>_.map(e=>e.id),[_]),w=(0,Z.useMemo)(()=>_.map(e=>e.last_redeemed).filter(e=>!!e).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime())[0]||null,[_]),E=(0,Z.useMemo)(()=>S===0||C.length===0?null:Pl(C),[C,S]),[A,M]=(0,Z.useState)(20),[ee,N]=(0,Z.useState)(1),[P,F]=(0,Z.useState)(null),{formState:I,setFormState:L,updateForm:R,handleSave:z,saveState:te,okProps:B,errors:ne,clearError:re}=T({initialState:Xl(p),savingDelay:500,onSave:async()=>{let e=!1,t=$l({formState:I,lastPercentAmount:A,lastFreeMonths:ee}),n=tu(eu(x))!==tu(t),r=I.enabled?`active`:`archived`,i=I.displayTitle||``,a=I.displayDescription||``,o=x?i!==(x.display_title||``)||a!==(x.display_description||``):i!==``||a!==``,u=Xl(p),d=!I.enabled&&!x&&ru(I,u),f=async n=>{let r=crypto.getRandomValues(new Uint32Array(1))[0].toString(16).padStart(8,`0`),o=zl(t,r);await s({name:o,code:r,display_title:i,display_description:a,cadence:h,amount:t.amount,duration:t.duration,duration_in_months:t.duration===`repeating`?t.durationInMonths:null,currency:null,status:n,redemption_type:`retention`,tier:null,type:t.type,currency_restriction:!1}),e=!0},m=async()=>{e&&await l()};if(!(!x&&!I.enabled&&!d)){if(n){!I.enabled&&v&&(await c({...v,status:`archived`}),e=!0),await f(r),await m();return}if(x){let t=x.status!==r;(o||t)&&(await c({...x,display_title:i,display_description:a,status:r}),e=!0),await m();return}(I.enabled||d)&&await f(r),await m()}},onSaveError:e=>{let t=`Please try again later`;e instanceof u&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message||t),b.dismiss(),b.error(`Failed to save offer`,{description:t})},onValidate:()=>{let e={};return I.enabled?(I.type===`percent`&&((I.percentAmount<1||I.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),I.duration===`repeating`&&!nu(I.durationInMonths)&&(e.durationInMonths=ql)),I.type===`free_months`&&(nu(I.freeMonths)||(e.amount=ql)),e):e}}),ie=`${e}:${x?.id||`none`}`;(0,Z.useEffect)(()=>{!a||o||te===`unsaved`||P===ie||(L(()=>Ql(x,p)),F(ie))},[p,ie,x,a,P,o,te,L]),(0,Z.useEffect)(()=>{I.percentAmount>0&&M(I.percentAmount)},[I.percentAmount]),(0,Z.useEffect)(()=>{I.freeMonths>0&&N(I.freeMonths)},[I.freeMonths]);let ae=()=>{t(`offers/edit`)},oe=(0,Q.jsx)(iu,{cadence:p,clearError:re,errors:ne,formState:I,lastRedeemed:w,membersFilterUrl:E,redemptions:S,updateForm:R}),se=async()=>{try{await z({force:!0})&&ae()}catch{}},ce=(0,Z.useMemo)(()=>{let e=$l({formState:I,lastPercentAmount:A,lastFreeMonths:ee}),t=g.find(e=>h===`month`?e.monthly_price:e.yearly_price);return{enabled:I.enabled,name:`${p} retention`,code:`${p}-retention`,displayTitle:I.displayTitle||``,displayDescription:I.displayDescription||``,type:e.type,cadence:h,amount:e.amount,duration:e.duration,durationInMonths:e.durationInMonths,currency:``,status:`active`,tierId:t?.id||``,redemptionType:`retention`}},[g,p,I,ee,A,h]);(0,Z.useEffect)(()=>{if(!n.url){f(``);return}let e=Tl(ce,n.url);f(e)},[ce,n.url]);let le=(0,Q.jsx)(wl,{href:d||``,portalParent:`offers`});return(0,Q.jsx)(Za,{afterClose:()=>t(`offers`),backDropClick:!1,cancelLabel:`Cancel`,dirty:te===`unsaved`,height:`full`,okLabel:B.label||`Save`,okVariant:B.variant,preview:le,previewToolbarBreadcrumbs:(0,Q.jsx)(Ro,{current:m,label:`Offers`,onBack:ae}),sidebar:oe,size:`lg`,testId:`retention-offer-modal`,title:`Offer`,width:1140,onCancel:ae,onOk:se})},ou=(e,t)=>e.find(e=>e.redemption_type===`retention`&&e.cadence===t&&e.status===`active`)||null,su=(e,t)=>e.reduce((e,n)=>n.redemption_type!==`retention`||n.cadence!==t?e:e+(n.redemption_count||0),0),cu=(e,t)=>e.filter(e=>e.redemption_type===`retention`&&e.cadence===t).map(e=>e.id),lu=(e,t)=>{let n=e.filter(e=>e.redemption_type===`retention`&&e.cadence===t&&e.created_at).map(e=>new Date(e.created_at).getTime()).filter(e=>!Number.isNaN(e));return n.length===0?null:new Date(Math.max(...n)).toISOString()},uu=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,du=e=>{if(!e)return null;if(uu(e)){let t=e.duration_in_months||0,n=t===1?`month`:`months`;return`${F(t)} ${n} free`}return e.type===`percent`?`${F(e.amount)}% OFF`:null},fu=e=>{if(!e)return null;if(uu(e))return``;if(e.duration===`once`)return`First payment`;if(e.duration===`repeating`&&e.duration_in_months){let t=e.duration_in_months===1?`month`:`months`;return`For ${F(e.duration_in_months)} ${t}`}return e.duration===`forever`?`Forever`:null},pu=e=>{let t=ou(e,`month`),n=ou(e,`year`),r=cu(e,`month`),i=cu(e,`year`),a=su(e,`month`),o=su(e,`year`);return[{id:`monthly`,name:`Monthly retention`,description:`Applied to monthly plans`,terms:du(t),termsDetail:fu(t),redemptionOfferIds:r,redemptions:a,status:t?`active`:`inactive`,createdAt:lu(e,`month`)},{id:`yearly`,name:`Yearly retention`,description:`Applied to annual plans`,terms:du(n),termsDetail:fu(n),redemptionOfferIds:i,redemptions:o,status:n?`active`:`inactive`,createdAt:lu(e,`year`)}]},mu=e=>e===`month`?`monthly`:`yearly`,hu=e=>e===`once`?`First payment`:e===`repeating`?`Repeating`:`Forever`,gu=(e,t,n,r,i)=>{let a=``,o=n===`month`?i?.monthly_price??0:i?.yearly_price??0,s=o,c=e=>parseFloat(e.toFixed(2)),l=e=>F(c(ze(e)),{maximumFractionDigits:2}),u=He(r)+l(o);switch(e){case`percent`:a=`${F(t)}% off`,s=o-o*t/100;break;case`fixed`:a=`${l(t)} ${r} off`,s=o-t;break;case`trial`:a=`${F(t)} days free`,u=``;break;default:break}s<0&&(s=0);let d=He(r)+l(s);return{discountOffer:a,originalPriceWithCurrency:u,updatedPriceWithCurrency:d}},_u=({showArchived:e,setShowArchived:t,sortOption:n,sortDirection:r,onSortChange:i,onDirectionChange:a})=>(0,Q.jsxs)(Yn,{children:[(0,Q.jsx)(fi,{asChild:!0,children:(0,Q.jsx)(cr,{"aria-label":`Filter options`,className:`text-muted-foreground hover:text-foreground`,size:`icon`,type:`button`,variant:`ghost`,children:(0,Q.jsx)(Rr,{size:16,strokeWidth:1.5})})}),(0,Q.jsxs)(ui,{align:`end`,className:`z-[9999] min-w-[200px] normal-case`,children:[(0,Q.jsx)(wr,{className:`text-xs tracking-wide text-muted-foreground uppercase`,children:`Sort by`}),(0,Q.jsxs)(Ar,{value:n,onValueChange:i,children:[(0,Q.jsx)(fr,{value:`date-added`,children:`Date added`}),(0,Q.jsx)(fr,{value:`name`,children:`Name`}),(0,Q.jsx)(fr,{value:`redemptions`,children:`Redemptions`})]}),(0,Q.jsxs)(Dr,{onSelect:a,children:[r===`asc`?(0,Q.jsx)(Ti,{className:`size-3`}):(0,Q.jsx)(yi,{className:`size-3`}),r===`asc`?`Ascending`:`Descending`]}),(0,Q.jsx)(In,{}),(0,Q.jsx)(rr,{checked:e,onCheckedChange:e=>t(!!e),children:`Show archived`})]})]}),vu=({offer:e,onClick:t})=>{let n=e.redemptions>0&&e.redemptionOfferIds.length>0?Pl(e.redemptionOfferIds):void 0;return(0,Q.jsxs)(hn,{"data-testid":`retention-offer-item`,children:[(0,Q.jsx)(_n,{className:`sticky left-0 z-10 bg-background p-0`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 pl-0 text-left`,type:`button`,onClick:t,children:(0,Q.jsxs)(wt,{gap:`none`,children:[(0,Q.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:e.description})]})})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.terms?(0,Q.jsxs)(wt,{gap:`none`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium uppercase`,children:e.terms}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:e.termsDetail})]}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`–`})})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`–`})})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:n?(0,Q.jsx)(`a`,{className:`block cursor-pointer p-5 hover:underline`,"data-testid":`retention-redemptions-link-${e.id}`,href:n,children:F(e.redemptions)}):(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,"data-testid":`retention-redemptions-link-${e.id}`,type:`button`,onClick:t,children:F(e.redemptions)})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.status===`active`?(0,Q.jsx)($n,{className:`rounded-full uppercase`,variant:`success`,children:`Active`}):(0,Q.jsx)($n,{className:`rounded-full uppercase`,variant:`secondary`,children:`Inactive`})})})]})},yu=({archived:e,offer:t,tier:n,onClick:r})=>{let{discountOffer:i,originalPriceWithCurrency:a,updatedPriceWithCurrency:o}=gu(t.type,t.amount,t.cadence,t.currency||`USD`,n);return(0,Q.jsxs)(hn,{className:e?`opacity-60`:void 0,"data-testid":`offer-item`,children:[(0,Q.jsx)(_n,{className:`sticky left-0 z-10 bg-background p-0`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 pl-0 text-left`,type:`button`,onClick:r,children:(0,Q.jsxs)(wt,{gap:`none`,children:[(0,Q.jsx)(`span`,{className:`font-semibold`,children:t.name}),(0,Q.jsxs)(`span`,{className:`text-muted-foreground`,children:[n.name,` `,mu(t.cadence)]})]})})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:r,children:(0,Q.jsxs)(wt,{gap:`none`,children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium uppercase`,children:i}),(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:t.type===`trial`?`Trial period`:hu(t.duration)})]})})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsxs)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:r,children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:o}),` `,t.type===`trial`?null:(0,Q.jsx)(`span`,{className:`relative text-sm text-muted-foreground before:absolute before:-inset-x-0.5 before:top-1/2 before:rotate-[-20deg] before:border-t before:content-[""]`,children:a})]})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:t.redemption_count>0&&t.id?(0,Q.jsx)(`a`,{className:`block cursor-pointer p-5 hover:underline`,href:Fl(t.id),children:F(t.redemption_count)}):(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:r,children:F(t.redemption_count)})}),(0,Q.jsx)(_n,{className:`p-0 whitespace-nowrap`,children:(0,Q.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:r,children:e?(0,Q.jsx)($n,{className:`rounded-full uppercase`,variant:`secondary`,children:`Archived`}):(0,Q.jsx)($n,{className:`rounded-full uppercase`,variant:`success`,children:`Active`})})})]})},bu=e=>e.offer.name,xu=e=>e.kind===`retention`?e.offer.redemptions:e.offer.redemption_count,Su=e=>e.kind===`retention`?e.offer.createdAt:e.offer.created_at||null,Cu=(e,t,n)=>{let r=n===`desc`?-1:1;return[...e].sort((e,n)=>{let i;switch(t){case`name`:i=bu(e).localeCompare(bu(n));break;case`redemptions`:i=xu(e)-xu(n);break;default:{let t=Su(e),r=Su(n);if(!t&&!r)i=0;else if(!t)return 1;else if(r)i=new Date(t).getTime()-new Date(r).getTime();else return-1;break}}return(i||bu(e).localeCompare(bu(n)))*r})},wu=()=>{let e=Oe(),{updateRoute:t}=V(),{data:{offers:n=[]}={}}=k(),{data:{tiers:r}={}}=Pi(),i=n.filter(e=>e.redemption_type===`signup`),a=pu(n),{sortingState:o,setSortingState:s}=ft(),c=o?.find(e=>e.type===`offers`),{offersShowArchived:l,setOffersShowArchived:u}=xe(),d=c?.option||`date-added`,f=c?.direction||`desc`,p=e=>{e&&t(`offers/edit/${e}`)},m=e=>{t(`offers/edit/retention/${e}`)},h=Ii(r||[]),g=i.filter(e=>{let t=r?.find(t=>t.id===e?.tier?.id),n=e.status===`active`&&t&&t.active===!0,i=e.status===`archived`||t&&t.active===!1;return!!(n||l&&i)}),_=Cu([...a.map(e=>({kind:`retention`,offer:e})),...g.map(e=>({kind:`signup`,offer:e}))],d,f),v=e=>{s?.([{type:`offers`,option:e,direction:f}])},y=()=>{s?.([{type:`offers`,option:d,direction:f===`asc`?`desc`:`asc`}])},x=e=>{let t=r?.find(t=>t.id===e?.tier?.id);return e.status===`archived`||t?.active===!1};return(0,Q.jsx)(Ie,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,cancelLabel:``,footer:!1,height:`full`,size:`lg`,testId:`offers-modal`,title:`Offers`,topRightContent:(0,Q.jsxs)(Ct,{gap:`md`,children:[(0,Q.jsx)(cr,{className:`font-semibold`,type:`button`,variant:`ghost`,onClick:()=>{e.remove(),t(`offers`)},children:`Close`}),(0,Q.jsx)(cr,{type:`button`,onClick:()=>{h.length===0?b.info(`You must have an active tier to create an offer.`):t(`offers/new`)},children:`New offer`})]}),width:1140,children:(0,Q.jsx)(wt,{className:`h-full pt-8`,children:(0,Q.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Q.jsxs)(yn,{className:`m-0 min-w-[900px]`,children:[(0,Q.jsxs)(`colgroup`,{children:[(0,Q.jsx)(`col`,{className:`w-[25%]`}),(0,Q.jsx)(`col`,{className:`w-[200px]`}),(0,Q.jsx)(`col`,{className:`w-[200px]`}),(0,Q.jsx)(`col`,{className:`w-[200px]`}),(0,Q.jsx)(`col`,{className:`w-[220px]`})]}),(0,Q.jsx)(vn,{children:(0,Q.jsxs)(hn,{children:[(0,Q.jsx)(mn,{className:`sticky left-0 z-10 h-auto bg-background p-0 pb-2.5 uppercase`,children:`Name`}),(0,Q.jsx)(mn,{className:`h-auto p-0 pb-2.5 pl-5 uppercase`,children:`Terms`}),(0,Q.jsx)(mn,{className:`h-auto p-0 pb-2.5 pl-5 uppercase`,children:`Price`}),(0,Q.jsx)(mn,{className:`h-auto p-0 pb-2.5 pl-5 uppercase`,children:`Redemptions`}),(0,Q.jsx)(mn,{className:`h-auto p-0 pb-2.5 pl-5 uppercase`,children:(0,Q.jsxs)(Ct,{align:`center`,justify:`between`,children:[`Status`,(0,Q.jsx)(_u,{setShowArchived:u,showArchived:l,sortDirection:f,sortOption:d,onDirectionChange:y,onSortChange:v})]})})]})}),(0,Q.jsx)(gn,{"data-testid":`offers-table-body`,children:_.map(e=>{if(e.kind===`retention`)return(0,Q.jsx)(vu,{offer:e.offer,onClick:()=>m(e.offer.id)},`retention-${e.offer.id}`);let t=e.offer,n=r?.find(e=>e.id===t?.tier?.id);if(!n)return null;let i=x(t);return(0,Q.jsx)(yu,{archived:i,offer:t,tier:n,onClick:()=>p(t.id)},`signup-${t.id}`)})})]})})})})},Tu=({route:e})=>{if(e===`offers/new`)return(0,Q.jsx)(Ml,{});if(e.startsWith(`offers/edit/retention/`)&&e.length>22){let t=e.split(`/`).pop();return(0,Q.jsx)(au,{id:t||``})}else if(e===`offers/edit/retention/`||e===`offers/edit/retention`)return(0,Q.jsx)(wu,{});else if(e.startsWith(`offers/edit/`)&&e.length>12){let t=e.split(`/`).pop();return(0,Q.jsx)(Hl,{id:t||``})}else if(e.startsWith(`offers/success/`)&&e.length>15){let t=e.split(`/`).pop();return(0,Q.jsx)(Cl,{id:t||``})}else if(e===`offers/edit`||e===`offers/edit/`)return(0,Q.jsx)(wu,{})},Eu=H.create(()=>{let{route:e}=V();return(0,Q.jsx)(Tu,{route:e})});``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href;var Du=m({method:`POST`,path:()=>`/files/upload/`,body:({file:e})=>{let t=new FormData;return t.append(`file`,e),t}}),Ou=H.create(()=>{let{updateRoute:e}=V(),[t,n]=(0,Z.useState)({js:!1,css:!1}),{settings:r,config:i}=xt(),[a]=Hn(r,[`pintura`]),{mutateAsync:o}=Y(),{mutateAsync:s}=Du(),c=h();(0,Z.useEffect)(()=>{f(a||!1)},[a]);let[l,u]=(0,Z.useState)(`Save`),[d,f]=(0,Z.useState)(!!a),p=async()=>{let e=[{key:`pintura`,value:d}];try{u(`Saving...`),await Promise.all([o(e),new Promise(e=>{setTimeout(e,1e3)})]),u(`Saved`)}catch(e){c(e)}finally{setTimeout(()=>u(`Save`),1e3)}},m=async(e,t)=>{try{n(e=>({...e,[t]:!0}));let{files:r}=await s({file:e}),i=r[0].url,a=[{key:`pintura_${t}_url`,value:i}];await o(a),b.success(`Pintura ${t} uploaded`)}catch(e){c(e)}finally{n(e=>({...e,[t]:!1}))}};return(0,Q.jsxs)(Ie,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:d!==a,okLabel:l,okVariant:`default`,testId:`pintura-modal`,title:``,onOk:p,children:[(0,Q.jsx)(mt,{detail:`Advanced image editing`,icon:(0,Q.jsx)(it,{name:`pintura`,size:48}),title:`Pintura`}),(0,Q.jsxs)(`div`,{className:`mt-7`,children:[!i.pintura&&(0,Q.jsxs)(`div`,{className:`mb-7 flex flex-col items-stretch justify-between gap-4 rounded-sm bg-grey-50 p-4 md:flex-row md:p-7 dark:bg-grey-950`,children:[(0,Q.jsxs)(`div`,{className:`md:basis-1/2`,children:[(0,Q.jsx)(`p`,{className:`mb-4 text-md font-semibold`,children:`Add advanced image editing to Ghost, with Pintura`}),(0,Q.jsx)(`p`,{className:`mb-4`,children:`Pintura is a powerful JavaScript image editor that allows you to crop, rotate, annotate and modify images directly inside Ghost.`}),(0,Q.jsx)(`p`,{children:`Try a demo, purchase a license, and download the required CSS/JS files from pqina.nl/pintura/ to activate this feature.`})]}),(0,Q.jsxs)(`div`,{className:`flex grow flex-col items-end justify-between gap-2 md:basis-1/2`,children:[(0,Q.jsx)(`img`,{alt:`Pintura screenshot`,src:``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href}),(0,Q.jsx)(`a`,{className:`-mb-1 font-medium text-green`,href:`https://pqina.nl/pintura/ghost/?ref=ghost.org`,rel:`noopener noreferrer`,target:`_blank`,children:`Find out more →`})]})]}),(0,Q.jsxs)(rn,{className:`gap-0`,children:[(0,Q.jsx)(on,{className:`mb-3 text-md! leading-supertight font-bold md:text-lg!`,children:`Pintura configuration`}),(0,Q.jsxs)(tn,{className:`gap-8 rounded-sm border border-border-default p-4 md:p-7`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`pintura-enabled`,children:`Enable Pintura`}),(0,Q.jsxs)(q,{children:[`Enable `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://pqina.nl/pintura/ghost/?ref=ghost.org`,rel:`noopener noreferrer`,target:`_blank`,children:`Pintura`}),` for editing your images in Ghost`]})]}),(0,Q.jsx)(W,{checked:d,id:`pintura-enabled`,onCheckedChange:f})]}),d&&!i.pintura&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:`Upload Pintura script`}),(0,Q.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Q.jsx)(`code`,{children:`pintura-umd.js`}),` file from the Pintura package`]})]}),(0,Q.jsx)(Bt,{accept:{"text/javascript":[`.js`],"application/javascript":[`.js`]},disabled:t.js,variant:`button`,onDropAccepted:e=>m(e[0],`js`),children:t.js?`Uploading...`:`Upload`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{children:`Upload Pintura styles`}),(0,Q.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Q.jsx)(`code`,{children:`pintura.css`}),` file from the Pintura package`]})]}),(0,Q.jsx)(Bt,{accept:{"text/css":[`.css`]},disabled:t.css,variant:`button`,onDropAccepted:e=>m(e[0],`css`),children:t.css?`Uploading...`:`Upload`})]})]})]})]})]})]})}),ku=({localSettings:e,updateSetting:t})=>{let[n,r,i,a,o,s]=Hn(e,[`transistor`,`transistor_portal_enabled`,`transistor_portal_heading`,`transistor_portal_description`,`transistor_portal_button_text`,`transistor_portal_url_template`]);if(n!==!0)return null;let c=r===!0;return(0,Q.jsxs)(R,{className:`[&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsx)(Jn,{}),(0,Q.jsx)(Tt,{as:`h5`,className:`md:text-lg`,leading:`supertight`,weight:`bold`,children:`Transistor`}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-portal-enabled`,children:`Enable Transistor integration`}),(0,Q.jsx)(q,{children:`Show a section on the account page for members to access private podcasts`})]}),(0,Q.jsx)(W,{checked:c,id:`transistor-portal-enabled`,onCheckedChange:e=>t(`transistor_portal_enabled`,e)})]}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-heading`,children:`Heading`}),(0,Q.jsx)(X,{id:`transistor-heading`,placeholder:`Podcasts`,value:i,onChange:e=>t(`transistor_portal_heading`,e.target.value)}),(0,Q.jsx)(q,{children:`The heading displayed above the Transistor section`})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-description`,children:`Description`}),(0,Q.jsx)(X,{id:`transistor-description`,placeholder:`Access your RSS feeds`,value:a,onChange:e=>t(`transistor_portal_description`,e.target.value)}),(0,Q.jsx)(q,{children:`A short description of what members can do`})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-button-text`,children:`Button text`}),(0,Q.jsx)(X,{id:`transistor-button-text`,placeholder:`Manage`,value:o,onChange:e=>t(`transistor_portal_button_text`,e.target.value)}),(0,Q.jsx)(q,{children:`The text displayed on the button`})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-url-template`,children:`URL template`}),(0,Q.jsx)(X,{id:`transistor-url-template`,placeholder:`https://partner.transistor.fm/ghost/{memberUuid}`,value:s,onChange:e=>t(`transistor_portal_url_template`,e.target.value)}),(0,Q.jsxs)(q,{children:[`Use `,`{memberUuid}`,` as a placeholder for the member ID`]})]})]})]})},Au=({localSettings:e,updateSetting:t,errors:n,setError:r})=>{let{siteData:i,settings:a,config:o}=xt(),[s,c]=Hn(a,[`members_support_address`,`support_email_address`]),l=c?.toString()||Mr(s?.toString()||``,i,o),u=mi(i,o),[d,f]=(0,Z.useState)(l);return(0,Z.useEffect)(()=>{f(l)},[l]),(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsxs)(tn,{className:`mb-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!n.members_support_address||void 0,children:[(0,Q.jsx)(K,{htmlFor:`members-support-address`,children:`Support email address`}),(0,Q.jsx)(X,{"aria-invalid":!!n.members_support_address||void 0,id:`members-support-address`,value:d,onBlur:e=>{let n=e.target.value;n?eo.default.isEmail(n)?r(`members_support_address`,``):r(`members_support_address`,`Enter a valid email address`):r(`members_support_address`,`Enter an email address`);let a=u&&n===`noreply@${u}`?`noreply`:n;t(`members_support_address`,a),f(Mr(a,i,o))},onChange:e=>f(e.target.value)}),n.members_support_address&&(0,Q.jsx)(G,{children:n.members_support_address})]}),(0,Q.jsx)(ku,{localSettings:e,updateSetting:t})]})})},ju=[{icon:`portal-icon-1`,label:`Portal icon 1`,value:`icon-1`},{icon:`portal-icon-2`,label:`Portal icon 2`,value:`icon-2`},{icon:`portal-icon-3`,label:`Portal icon 3`,value:`icon-3`},{icon:`portal-icon-4`,label:`Portal icon 4`,value:`icon-4`},{icon:`portal-icon-5`,label:`Portal icon 5`,value:`icon-5`}],Mu=({localSettings:e,updateSetting:t})=>{let{mutateAsync:n}=re(),r=h(),[i,a,o,s]=Hn(e,[`portal_button`,`portal_button_style`,`portal_button_icon`,`portal_button_signup_text`]),c=o||ju[0].value,[l,u]=(0,Z.useState)(ju.map(({value:e})=>e).includes(c)?void 0:c),d=async e=>{try{let r=Te(await n({file:e}));t(`portal_button_icon`,r),u(r)}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),r(t)}};return(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsxs)(tn,{className:`mb-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`show-portal-button`,children:`Show portal button`}),(0,Q.jsx)(W,{checked:!!i,id:`show-portal-button`,onCheckedChange:e=>t(`portal_button`,e)})]}),i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Button style`}),(0,Q.jsxs)(qt,{value:a,onValueChange:e=>t(`portal_button_style`,e),children:[(0,Q.jsx)(Wt,{"aria-label":`Button style`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:[{value:`icon-and-text`,label:`Icon and text`},{value:`icon-only`,label:`Icon only`},{value:`text-only`,label:`Text only`}].map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]}),a?.toString()?.includes(`icon`)&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Tt,{as:`h6`,className:`text-base`,weight:`semibold`,children:`Icon`}),(0,Q.jsxs)(Ct,{className:`w-full`,gap:`none`,justify:`between`,children:[(0,Q.jsx)(xn,{"aria-label":`Portal button icon`,className:`contents border-0! bg-transparent! p-0`,type:`single`,value:c,onValueChange:e=>e&&t(`portal_button_icon`,e),children:ju.map(e=>(0,Q.jsx)(bn,{"aria-label":e.label,className:`group size-[46px] border border-transparent p-3 hover:bg-transparent data-[state=on]:border-primary data-[state=on]:bg-transparent data-[state=on]:text-primary data-[state=on]:shadow-none`,value:e.value,children:(0,Q.jsx)(it,{className:`size-[18px] opacity-70 transition-opacity group-hover:opacity-100 group-data-[state=on]:opacity-100`,name:e.icon})},e.value))}),(0,Q.jsx)(he,{className:`size-[46px] overflow-visible border ${c===l?`border-primary`:`border-transparent`}`,children:l?(0,Q.jsxs)(me,{className:`overflow-visible`,children:[(0,Q.jsx)(le,{className:`rounded-md`,src:l}),(0,Q.jsx)(cr,{"aria-label":`Use uploaded Portal icon`,"aria-pressed":c===l,className:`absolute inset-0 z-10 size-full rounded-md bg-transparent hover:bg-transparent`,size:`icon`,type:`button`,variant:`ghost`,onClick:()=>t(`portal_button_icon`,l)}),(0,Q.jsx)(be,{className:`-top-2 -right-2 z-20 opacity-100`,children:(0,Q.jsx)(_e,{"aria-label":`Delete uploaded Portal icon`,className:`size-6 rounded-full p-0`,onClick:()=>{c===l&&t(`portal_button_icon`,null),u(void 0)},children:(0,Q.jsx)(nr,{})})})]}):(0,Q.jsx)(ae,{accept:{"image/*":[]},"aria-label":`Upload Portal icon`,className:`size-full p-0`,inputAriaLabel:`Upload Portal icon`,onDropAccepted:e=>d(e[0]),children:(0,Q.jsx)(ir,{className:`size-5`})})})]})]}),a?.toString()?.includes(`text`)&&(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`portal-signup-button-text`,children:`Signup button text`}),(0,Q.jsx)(X,{id:`portal-signup-button-text`,value:s,onChange:e=>t(`portal_button_signup_text`,e.target.value)})]})]})]})})},Nu=({name:e,value:t})=>{let n=(0,Z.useId)();return(0,Q.jsxs)(pt,{children:[(0,Q.jsxs)(Ue,{className:`flex w-full grow flex-col py-3 lg:flex-row lg:items-center lg:gap-5`,children:[(0,Q.jsxs)(`label`,{className:`inline-block whitespace-nowrap lg:w-[180px] lg:min-w-[180px]`,htmlFor:n,children:[e,`:`]}),(0,Q.jsx)(X,{className:`grow border-0 border-b border-border bg-transparent py-1 text-muted-foreground shadow-none lg:p-1`,id:n,value:t,disabled:!0})]}),(0,Q.jsx)(Be,{children:(0,Q.jsx)(cr,{size:`sm`,type:`button`,variant:`ghost`,onClick:async e=>{let n=e.currentTarget;try{await navigator.clipboard.writeText(t),n.innerText=`Copied`,setTimeout(()=>{n.innerText=`Copy`},1e3)}catch{}},children:`Copy`})})]})},Pu=()=>{let[e,t]=(0,Z.useState)(!1),[n,r]=(0,Z.useState)(``),{siteData:i,settings:a}=xt(),{data:{tiers:o}={}}=Pi(),s=Ii(o||[]),[c]=Hn(a,[`paid_members_enabled`]),l=()=>{t(!e)};(0,Z.useEffect)(()=>{s?.length&&!n&&r(s[0].id)},[s,n]);let u=s?.map(e=>({label:e.name,value:e.id})),d=wi(i);return(0,Q.jsxs)(Eo,{className:`max-w-[920px] text-base text-foreground`,children:[(0,Q.jsx)(Eo.Title,{children:`Links`}),(0,Q.jsxs)(`p`,{className:`-mt-6 mb-16`,children:[`Use these `,e?`data attributes`:`links`,` in your theme to show pages of Portal.`]}),(0,Q.jsxs)(`section`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border pb-2`,children:[(0,Q.jsx)(`h2`,{className:`text-xl font-semibold`,children:`Generic`}),(0,Q.jsx)(cr,{size:`sm`,type:`button`,variant:`ghost`,onClick:l,children:e?`Links`:`Data attributes`})]}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Nu,{name:`Default`,value:e?`data-portal`:`${d}#/portal`}),(0,Q.jsx)(Nu,{name:`Sign in`,value:e?`data-portal="signin"`:`${d}#/portal/signin`}),(0,Q.jsx)(Nu,{name:`Sign up`,value:e?`data-portal="signup"`:`${d}#/portal/signup`}),c&&(0,Q.jsx)(Nu,{name:`Gift subscriptions`,value:e?`data-portal="gift"`:`${d}#/portal/gift`})]})]}),(0,Q.jsxs)(`section`,{className:`mt-14`,children:[(0,Q.jsx)(`h2`,{className:`border-b border-border pb-2 text-xl font-semibold`,children:`Tiers`}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(pt,{children:(0,Q.jsxs)(Ue,{className:`flex w-full items-center gap-2 py-2`,children:[(0,Q.jsx)(`span`,{className:`inline-block w-[180px] min-w-[180px] shrink-0`,children:`Tier:`}),(0,Q.jsxs)(J,{className:`grow`,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Tier`}),(0,Q.jsxs)(qt,{value:n,onValueChange:r,children:[(0,Q.jsx)(Wt,{"aria-label":`Tier`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:u.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]})]})}),(0,Q.jsx)(Nu,{name:`Signup / Monthly`,value:e?`data-portal="signup/${n}/monthly"`:`${d}#/portal/signup/${n}/monthly`}),(0,Q.jsx)(Nu,{name:`Signup / Yearly`,value:e?`data-portal="signup/${n}/yearly"`:`${d}#/portal/signup/${n}/yearly`}),(0,Q.jsx)(Nu,{name:`Signup / Free`,value:e?`data-portal="signup/free"`:`${d}#/portal/signup/free`})]})]}),(0,Q.jsxs)(`section`,{className:`mt-14`,children:[(0,Q.jsx)(`h2`,{className:`border-b border-border pb-2 text-xl font-semibold`,children:`Account`}),(0,Q.jsxs)(U,{children:[(0,Q.jsx)(Nu,{name:`Account`,value:e?`data-portal="account"`:`${d}#/portal/account`}),(0,Q.jsx)(Nu,{name:`Account / Plans`,value:e?`data-portal="account/plans"`:`${d}#/portal/account/plans`}),(0,Q.jsx)(Nu,{name:`Account / Profile`,value:e?`data-portal="account/profile"`:`${d}#/portal/account/profile`}),(0,Q.jsx)(Nu,{name:`Account / Newsletters`,value:e?`data-portal="account/newsletters"`:`${d}#/portal/account/newsletters`}),(0,Q.jsx)(Nu,{name:`Account / Newsletter help`,value:e?`data-portal="account/newsletters/help"`:`${d}#/portal/account/newsletters/help`})]})]})]})},Fu=({settings:e,config:t,tiers:n,siteData:r,selectedTab:i,previewTheme:a})=>{if(!r?.url)return null;let o=n.filter(e=>e.visibility===`public`&&e.type===`paid`).map(e=>e.id),s=r.url.replace(/\/$/,``),c=JSON.parse(_r(e,`portal_plans`)||``),l=new URLSearchParams;l.append(`button`,_r(e,`portal_button`)?`true`:`false`),l.append(`name`,_r(e,`portal_name`)?`true`:`false`),l.append(`isFree`,c.includes(`free`)?`true`:`false`),l.append(`isMonthly`,Si(e,t)&&c.includes(`monthly`)?`true`:`false`),l.append(`isYearly`,Si(e,t)&&c.includes(`yearly`)?`true`:`false`),l.append(`page`,i===`account`?`accountHome`:`signup`),l.append(`previewTheme`,a),l.append(`buttonIcon`,encodeURIComponent(_r(e,`portal_button_icon`)||`icon-1`)),l.append(`signupButtonText`,encodeURIComponent(_r(e,`portal_button_signup_text`)||``)),l.append(`membersSignupAccess`,_r(e,`members_signup_access`)||`all`),l.append(`allowSelfSignup`,_r(e,`allow_self_signup`)||`false`),l.append(`signupTermsHtml`,_r(e,`portal_signup_terms_html`)||``),l.append(`signupCheckboxRequired`,_r(e,`portal_signup_checkbox_required`)?`true`:`false`),l.append(`portalProducts`,o.join(`,`));let u=_r(e,`portal_default_plan`);u&&l.append(`portalDefaultPlan`,u),c&&c.length&&l.append(`portalPrices`,encodeURIComponent(c.join(`,`)));let d=_r(e,`accent_color`);d!=null&&l.append(`accentColor`,encodeURIComponent(d));let f=_r(e,`portal_button_style`);return f&&l.append(`buttonStyle`,encodeURIComponent(f)),l.append(`disableBackground`,`false`),_r(e,`transistor`)&&l.append(`transistorPortalSettings`,JSON.stringify({enabled:_r(e,`transistor_portal_enabled`),heading:_r(e,`transistor_portal_heading`)||`Podcasts`,description:_r(e,`transistor_portal_description`)||`Access your RSS feeds`,button_text:_r(e,`transistor_portal_button_text`)||`Manage`,url_template:_r(e,`transistor_portal_url_template`)||`https://partner.transistor.fm/ghost/{memberUuid}`})),l.append(`admin_toolbar`,`0`),`${s}/?v=modal-portal-settings#/portal/preview?${l.toString()}`},Iu=({darkMode:e,selectedTab:t=`signup`,localSettings:n,localTiers:r})=>{let{siteData:i,config:a}=xt(),o=Fu({settings:n,tiers:r,selectedTab:t,previewTheme:e?`dark`:`light`,siteData:i,config:a}),s=(0,Q.jsx)(Q.Fragment,{});switch(t){case`account`:s=(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(wl,{href:o||``,portalParent:`preview`,selectedTab:t})});break;case`links`:s=(0,Q.jsx)(Pu,{});break;default:s=(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(wl,{href:o||``,portalParent:`preview`,selectedTab:t})});break}return s},Lu=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a})=>{let{config:o}=xt(),[s,c,l,u,d,f]=Hn(e,[`members_signup_access`,`portal_name`,`portal_signup_terms_html`,`portal_signup_checkbox_required`,`portal_plans`,`portal_default_plan`]),p=JSON.parse(d?.toString()||`[]`),m=(0,Z.useMemo)(()=>{let e=document.createElement(`div`);return e.innerHTML=l?.toString()||``,e.innerText.length},[l]),h=(0,Z.useCallback)((e,t)=>{a(e,t)},[]);(0,Z.useEffect)(()=>{m>115?h(`portal_signup_terms_html`,`Signup notice is too long`):h(`portal_signup_terms_html`,void 0)},[m,h]);let g=e=>{let n=p.indexOf(e);n===-1?p.push(e):p.splice(n,1),t(`portal_plans`,JSON.stringify(p)),f===`yearly`?!p.includes(`yearly`)&&p.includes(`monthly`)&&t(`portal_default_plan`,`monthly`):f===`monthly`&&(p.includes(`monthly`)||t(`portal_default_plan`,`yearly`))},_=s===`all`||s===`paid`,v=s===`all`,y=Si(e,o),b=[];n&&n.forEach(e=>{e.type===`free`&&v&&b.push({checked:p.includes(`free`),disabled:!_,label:e.name,value:`free`,testId:`free-tier-checkbox`,onChange:n=>{p.includes(`free`)&&!n&&p.splice(p.indexOf(`free`),1),!p.includes(`free`)&&n&&p.push(`free`),t(`portal_plans`,JSON.stringify(p)),r({...e,visibility:n?`public`:`none`})}})});let x=Ii(n)||[],S=[{value:`yearly`,label:`Yearly`},{value:`monthly`,label:`Monthly`}];y&&x.length>0&&x.forEach(e=>{b.push({checked:e.visibility===`public`,label:e.name,value:e.id,onChange:(t=>r({...e,visibility:t?`public`:`none`}))})});let C=y&&x.length>0&&x.some(e=>e.visibility===`public`);return(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsxs)(tn,{className:`mb-10 gap-8`,children:[(0,Q.jsxs)(J,{"data-disabled":!_||void 0,orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`portal-display-name`,children:`Display name in signup form`}),(0,Q.jsx)(W,{checked:!!c,disabled:!_,id:`portal-display-name`,onCheckedChange:e=>t(`portal_name`,e)})]}),(0,Q.jsxs)(rn,{children:[(0,Q.jsx)(on,{variant:`label`,children:`Available tiers`}),(0,Q.jsx)(tn,{"data-slot":`checkbox-group`,children:b.map(e=>(0,Q.jsxs)(J,{"data-disabled":e.disabled||void 0,orientation:`horizontal`,children:[(0,Q.jsx)(en,{checked:e.checked,"data-testid":e.testId,disabled:e.disabled,id:`portal-tier-${e.value}`,onCheckedChange:t=>e.onChange(t===!0)}),(0,Q.jsx)(K,{htmlFor:`portal-tier-${e.value}`,children:e.label})]},e.value))})]}),C&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(rn,{children:[(0,Q.jsx)(on,{variant:`label`,children:`Available prices`}),(0,Q.jsx)(tn,{"data-slot":`checkbox-group`,children:[`monthly`,`yearly`].map(e=>(0,Q.jsxs)(J,{"data-disabled":!_||void 0,orientation:`horizontal`,children:[(0,Q.jsx)(en,{checked:p.includes(e),disabled:!_,id:`portal-plan-${e}`,onCheckedChange:()=>g(e)}),(0,Q.jsx)(K,{className:`capitalize`,htmlFor:`portal-plan-${e}`,children:e})]},e))})]}),p.includes(`yearly`)&&p.includes(`monthly`)&&(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Default price at signup`}),(0,Q.jsxs)(qt,{value:typeof f==`string`?f:``,onValueChange:e=>t(`portal_default_plan`,e),children:[(0,Q.jsx)(Wt,{"aria-label":`Default price at signup`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:S.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]})]})]}),(0,Q.jsx)(qa,{error:!!i.portal_signup_terms_html,hint:i.portal_signup_terms_html||(0,Q.jsxs)(Q.Fragment,{children:[`Recommended: `,(0,Q.jsx)(`strong`,{children:`115`}),` characters. You've used `,(0,Q.jsx)(`strong`,{className:`text-green`,children:m})]}),nodes:`MINIMAL_NODES`,placeholder:`By signing up, I agree to receive emails from ...`,title:`Display notice at signup`,value:l?.toString(),onChange:e=>t(`portal_signup_terms_html`,e)}),l?.toString()&&(0,Q.jsxs)(J,{"data-disabled":!_||void 0,orientation:`horizontal`,children:[(0,Q.jsx)(K,{htmlFor:`portal-require-agreement`,children:`Require agreement`}),(0,Q.jsx)(W,{checked:!!u,disabled:!_,id:`portal-require-agreement`,onCheckedChange:e=>t(`portal_signup_checkbox_required`,e)})]})]})})},Ru=m({path:()=>`/settings/verifications`,method:`PUT`,body:({token:e})=>({token:e}),updateQueries:{dataType:`SettingsResponseType`,emberUpdateType:`createOrUpdate`,update:e=>({...e,settings:e.settings})}}),zu={signupOptions:`signup`,lookAndFeel:`signup`,accountPage:`account`},Bu=`border-b-2 border-transparent after:hidden data-[state=active]:border-foreground`,Vu=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a,selectedTab:o,onTabChange:s})=>(0,Q.jsx)(`div`,{className:`pt-4`,children:(0,Q.jsxs)(Lt,{value:o,variant:`underline`,onValueChange:e=>s(e),children:[(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{className:Bu,value:`signupOptions`,children:`Signup options`}),(0,Q.jsx)(Pt,{className:Bu,value:`lookAndFeel`,children:`Look & feel`}),(0,Q.jsx)(Pt,{className:Bu,value:`accountPage`,children:`Account page`})]}),(0,Q.jsx)(Ft,{value:`signupOptions`,children:(0,Q.jsx)(Lu,{errors:i,localSettings:e,localTiers:n,setError:a,updateSetting:t,updateTier:r})}),(0,Q.jsx)(Ft,{value:`lookAndFeel`,children:(0,Q.jsx)(Mu,{localSettings:e,updateSetting:t})}),(0,Q.jsx)(Ft,{value:`accountPage`,children:(0,Q.jsx)(Au,{errors:i,localSettings:e,setError:a,updateSetting:t})})]})}),Hu=H.create(()=>{let{updateRoute:e}=V(),{darkMode:t}=Dt(),[n,r]=(0,Z.useState)(`signup`),[i,a]=(0,Z.useState)(`signupOptions`),o=h(),{settings:s,siteData:c,config:l}=xt(),{mutateAsync:u}=Y(),{data:{tiers:d}={}}=Pi(),{mutateAsync:f}=Fi(),{mutateAsync:p}=Ru(),{getParam:m}=vt(),g=m(`verifyEmail`);(0,Z.useEffect)(()=>{g&&(async({token:e})=>{try{let{settings:t}=await p({token:e}),[n]=Hn(t,[`members_support_address`]);H.show(We,{title:`Support address verified`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`Your support email address has been changed to `,(0,Q.jsx)(`strong`,{children:n}),`.`]}),okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()})}catch(e){let t=`There was an error verifying your email address. Please try again.`;e?.message===`Token expired`&&(t=`Verification link has expired.`),H.show(We,{title:`Error verifying support address`,prompt:t,okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()}),o(e,{withToast:!1})}})({token:g})},[o,g,p]);let{formState:_,setFormState:v,saveState:y,handleSave:b,updateForm:x,okProps:S}=T({initialState:{settings:s,tiers:d||[]},savingDelay:500,onSave:async()=>{await Promise.all(_.tiers.filter(({dirty:e})=>e).map(e=>f(e))),v(e=>({...e,tiers:_.tiers.map(e=>({...e,dirty:!1}))}));let e=_.settings.filter(e=>e.dirty);if(!e.length)return;let{meta:t,settings:n}=await u(e);if(v(e=>({...e,settings:_.settings.map(e=>({...e,dirty:!1}))})),t?.sent_email_verification){let e=_.settings.find(e=>e.key===`members_support_address`)?.value,t=n.find(e=>e.key===`support_email_address`)?.value||Mr(n.find(e=>e.key===`members_support_address`)?.value?.toString()||`noreply`,c,l);H.show(We,{title:`Confirm email address`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[`We've sent a confirmation email to `,(0,Q.jsx)(`strong`,{children:e}),`. Until verified, your support email address will remain `,t,`.`]}),okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()})}},onSaveError:o});(0,Z.useEffect)(()=>{!_.tiers.length&&d?.length&&v(e=>({...e,tiers:d}))},[d,_.tiers,v]);let[C,w]=(0,Z.useState)({}),E=(e,t)=>{x(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},D=(e,t)=>{w(n=>({...n,[e]:t}))},O=e=>{x(t=>({...t,tiers:t.tiers.map(t=>t.id===e.id?{...e,dirty:!0}:t)}))},k=e=>{r(e),e===`account`?a(`accountPage`):e===`signup`&&i===`accountPage`&&a(`signupOptions`)},A=(0,Q.jsx)(Vu,{errors:C,localSettings:_.settings,localTiers:_.tiers,selectedTab:i,setError:D,updateSetting:E,updateTier:O,onTabChange:e=>{a(e),r(zu[e])}}),j=(0,Q.jsx)(Iu,{darkMode:t,localSettings:_.settings,localTiers:_.tiers,selectedTab:n}),M=(0,Q.jsx)(Lt,{value:n,variant:`button-sm`,onValueChange:e=>k(e),children:(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{value:`signup`,children:`Signup`}),(0,Q.jsx)(Pt,{value:`account`,children:`Account page`}),(0,Q.jsx)(Pt,{value:`links`,children:`Links`})]})});return(0,Q.jsx)(Za,{afterClose:()=>{e(`portal`)},buttonsDisabled:S.disabled,cancelLabel:`Close`,dirty:y===`unsaved`,okLabel:S.label||`Save`,okVariant:S.variant,preview:j,previewBgColor:n===`links`?`white`:`greygradient`,previewToolbarTabs:M,sidebar:A,testId:`portal-modal`,title:`Portal`,onOk:async()=>{Object.values(C).filter(Boolean).length||await b({force:!0})}})}),Uu=H.create(()=>{let{updateRoute:e}=V(),{localSettings:t,updateSetting:n,handleSave:r,validate:i,errors:a,clearError:o,okProps:s}=ve({onValidate:()=>{let e={};return c&&!eo.default.isURL(c,{require_protocol:!0})&&(e.slackUrl=`The URL must be in a format like https://hooks.slack.com/services/<your personal key>`),e},savingDelay:500}),[c,l]=Hn(t,[`slack_url`,`slack_username`]),{mutateAsync:u}=Rn();return(0,Q.jsxs)(Ie,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:t.some(e=>e.dirty),okLabel:s.label||`Save`,okVariant:s.variant,testId:`slack-modal`,title:``,onOk:async()=>{b.dismiss(),await r()},children:[(0,Q.jsx)(mt,{detail:`A messaging app for teams`,icon:(0,Q.jsx)(it,{name:`slack`,size:56}),title:`Slack`}),(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsxs)(rn,{className:`gap-0`,children:[(0,Q.jsx)(on,{className:`mb-3 text-md! leading-supertight font-bold md:text-lg!`,children:`Slack configuration`}),(0,Q.jsxs)(tn,{className:`gap-8 rounded-sm border border-border-default p-4 md:p-7 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!a.slackUrl||void 0,children:[(0,Q.jsx)(K,{htmlFor:`slack-webhook-url`,children:`Webhook URL`}),(0,Q.jsx)(X,{"aria-invalid":!!a.slackUrl||void 0,id:`slack-webhook-url`,placeholder:`https://hooks.slack.com/services/...`,value:c,onBlur:i,onChange:e=>n(`slack_url`,e.target.value),onKeyDown:()=>o(`slackUrl`)}),a.slackUrl?(0,Q.jsx)(G,{children:a.slackUrl}):(0,Q.jsx)(q,{children:(0,Q.jsxs)(Q.Fragment,{children:[`Automatically send newly published posts to a channel in Slack or any Slack-compatible service like Discord or Mattermost. Set up a new incoming webhook `,(0,Q.jsx)(`a`,{href:`https://my.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks`,children:`here`}),`, and grab the URL.`]})})]}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2 md:flex-row md:items-center`,children:[(0,Q.jsxs)(J,{className:`grow`,children:[(0,Q.jsx)(K,{htmlFor:`slack-username`,children:`Username`}),(0,Q.jsx)(X,{id:`slack-username`,value:l,onChange:e=>n(`slack_username`,e.target.value)}),(0,Q.jsx)(q,{children:`The username to display messages from`})]}),(0,Q.jsx)(cr,{type:`button`,variant:`outline`,onClick:async()=>{b.dismiss(),await r()&&(await u(null),b.info(`Check your Slack channel for the test message`))},children:`Send test notification`})]})]})]})})]})}),Wu=``+new URL(`stripe-thumb-Cu2h4McY.jpg`,import.meta.url).href,Gu=``+new URL(`orb-squircle-DUFLvKu-.png`,import.meta.url).href,Ku=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20400%20400'%20style='enable-background:new%200%200%20400%20400'%20xml:space='preserve'%3e%3cpath%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23635bff'%20d='M0%200h400v400H0z'/%3e%3cpath%20d='M184.4%20155.5c0-9.4%207.7-13.1%2020.5-13.1%2018.4%200%2041.6%205.6%2060%2015.5v-56.8C244.8%2093.1%20225%2090%20205%2090c-49.1%200-81.7%2025.6-81.7%2068.4%200%2066.7%2091.9%2056.1%2091.9%2084.9%200%2011.1-9.7%2014.7-23.2%2014.7-20.1%200-45.7-8.2-66-19.3v57.5c22.5%209.7%2045.2%2013.8%2066%2013.8%2050.3%200%2084.9-24.9%2084.9-68.2-.4-72-92.5-59.2-92.5-86.3z'%20style='fill-rule:evenodd;clip-rule:evenodd;fill:%23fff'/%3e%3c/svg%3e`,qu=``+new URL(`stripe-verified-DM7Q8nrY.svg`,import.meta.url).href,Ju=1e3,Yu=15*Ju,Xu=({onNext:e})=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsx)(Tt,{as:`h3`,className:`md:text-2xl`,leading:`heading`,size:`xl`,weight:`bold`,children:`Getting paid`}),(0,Q.jsx)(`img`,{alt:`Stripe Verified Partner Badge`,src:qu})]}),(0,Q.jsxs)(`div`,{className:`mt-6 mb-7`,children:[`Stripe is our exclusive direct payments partner. Ghost collects `,(0,Q.jsx)(`strong`,{children:`no fees`}),` on any payments! If you don’t have a Stripe account yet, you can `,(0,Q.jsx)(`a`,{className:`underline`,href:`https://stripe.com`,rel:`noopener noreferrer`,target:`_blank`,children:`sign up here`}),`.`]}),(0,Q.jsx)(Le,{label:(0,Q.jsx)(Q.Fragment,{children:`I have a Stripe account, let's go →`}),onClick:e})]}),Zu=()=>{let[e,t]=(0,Z.useState)(!1),[n,r]=(0,Z.useState)(``),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(``),{refetch:c}=Pi({searchParams:{filter:`type:paid+active:true`},enabled:!1}),{mutateAsync:l}=Fi(),{mutateAsync:f}=Y(),p=h(),m=e=>{r(e.target.value),t(!!e.target.value)},g=async()=>{let{data:e}=await c(),t=e?.pages[0].tiers[0];if(t){t.monthly_price=500,t.yearly_price=5e3,t.currency=`USD`;let e=0;for(;e<Yu;){await new Promise(e=>{setTimeout(e,Ju)});try{await l(t);break}catch(t){if(t instanceof u&&t.data?.errors?.[0].code===`STRIPE_NOT_CONFIGURED`){e+=Ju;continue}else{p(t);return}}}}},_=async()=>{if(s(``),n)try{await f([{key:`stripe_connect_integration_token`,value:n}]),await g(),await f([{key:`portal_plans`,value:JSON.stringify([`free`,`monthly`,`yearly`])}])}catch(e){if(e instanceof u&&e.data?.errors){s(`Invalid secure key`);return}else{p(e);return}}else s(`Please enter a secure key`)},{apiRoot:v}=d(),y=`${v}/members/stripe_connect?mode=${i?`test`:`live`}`;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,Q.jsx)(Tt,{as:`h3`,className:`md:text-2xl`,leading:`heading`,size:`xl`,weight:`bold`,children:`Connect with Stripe`}),(0,Q.jsxs)(J,{className:`w-auto`,orientation:`horizontal`,children:[(0,Q.jsx)(K,{className:i?`text-orange`:`text-muted-foreground`,htmlFor:`stripe-test-mode`,children:`Test mode`}),(0,Q.jsx)(W,{checked:i,className:`data-[state=checked]:bg-orange!`,id:`stripe-test-mode`,onCheckedChange:a})]})]}),(0,Q.jsxs)(Tt,{as:`h6`,className:`text-base`,tone:`secondary`,weight:`semibold`,children:[`Step 1 — `,(0,Q.jsx)(`span`,{className:`text-foreground`,children:`Generate secure key`})]}),(0,Q.jsxs)(`div`,{className:`mt-2 mb-4`,children:[`Click on the `,(0,Q.jsx)(`strong`,{children:`“Connect with Stripe”`}),` button to generate a secure key that connects your Ghost site with Stripe.`]}),(0,Q.jsx)(Le,{href:y,target:`_blank`}),(0,Q.jsxs)(Tt,{as:`h6`,className:`mt-8 mb-2 text-base`,tone:`secondary`,weight:`semibold`,children:[`Step 2 — `,(0,Q.jsx)(`span`,{className:`text-foreground`,children:`Paste secure key`})]}),(0,Q.jsxs)(J,{"data-invalid":!!o||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,htmlFor:`stripe-secure-key`,children:`Secure key`}),(0,Q.jsx)(sn,{"aria-invalid":!!o||void 0,className:`border-transparent bg-muted`,id:`stripe-secure-key`,placeholder:`Paste your secure key here`,onChange:m}),o&&(0,Q.jsx)(G,{children:o})]}),e&&(0,Q.jsx)(cr,{className:`mt-5`,type:`button`,onClick:_,children:`Save Stripe settings`})]})},Qu=({onClose:e})=>{let{settings:t}=xt(),[n,r]=Hn(t,[`stripe_connect_display_name`,`stripe_connect_livemode`]),{refetch:i,isFetching:a}=bi({searchParams:{filter:`status:paid`,limit:`0`},enabled:!1}),{mutateAsync:o}=Wn(),s=h();return(0,Q.jsxs)(`section`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(cr,{className:`text-destructive hover:text-destructive`,disabled:a,type:`button`,variant:`ghost`,onClick:async()=>{let{data:t}=await i(),r=!!t?.meta?.pagination.total;H.show(We,{title:`Disconnect Stripe`,prompt:r?`Cannot disconnect while there are members with active Stripe subscriptions.`:(0,Q.jsxs)(Q.Fragment,{children:[`You‘re about to disconnect your Stripe account `,n,` from this site. This will automatically turn off paid memberships on this site.`]}),okLabel:r?``:`Disconnect`,onOk:async t=>{try{await o(null),t?.remove(),e?.()}catch(e){s(e)}}})},children:[(0,Q.jsx)(mr,{}),`Disconnect`]}),(0,Q.jsx)(cr,{"aria-label":`Close`,size:`icon`,type:`button`,variant:`ghost`,onClick:e,children:(0,Q.jsx)(Gn,{})})]}),(0,Q.jsxs)(`div`,{className:`my-20 flex flex-col items-center`,children:[(0,Q.jsxs)(`div`,{className:`relative h-20 w-[200px]`,children:[(0,Q.jsx)(`img`,{alt:`Ghost Logo`,className:`absolute left-10 size-16`,src:Gu}),(0,Q.jsx)(`img`,{alt:`Stripe Logo`,className:`absolute right-10 size-16 rounded-2xl shadow-[-1.5px_0_0_1.5px_#fff] dark:shadow-[-1.5px_0_0_1.5px_black]`,src:Ku})]}),(0,Q.jsxs)(Tt,{as:`h3`,className:`text-center md:text-2xl`,leading:`heading`,size:`xl`,weight:`bold`,children:[`You are connected with Stripe!`,r?null:` (Test mode)`]}),(0,Q.jsxs)(`div`,{className:`mt-1`,children:[`Connected to `,(0,Q.jsx)(`strong`,{children:n||`Test mode`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,Q.jsx)(Tt,{as:`h6`,className:`text-base`,weight:`semibold`,children:`Read next`}),(0,Q.jsxs)(`a`,{className:`mt-5 flex w-100 flex-col items-stretch justify-between overflow-hidden rounded-md border border-grey-200 transition-all hover:border-grey-400 md:flex-row dark:border-grey-900`,href:`https://ghost.org/resources/managing-your-stripe-account/?ref=admin`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Q.jsxs)(`div`,{className:`order-2 p-4 md:order-1`,children:[(0,Q.jsx)(`div`,{className:`text-md font-semibold`,children:`How to setup and manage your Stripe account`}),(0,Q.jsx)(`div`,{className:`mt-2 text-grey-800 dark:text-grey-500`,children:`Learn how to configure your Stripe account to work with Ghost, from custom branding to payment receipt emails.`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-1 text-grey-800 dark:text-grey-500`,children:[(0,Q.jsx)(`img`,{alt:`Ghost Logo`,className:`size-4`,src:Ye}),(0,Q.jsx)(`span`,{className:`font-semibold`,children:`Ghost Resources`})]})]}),(0,Q.jsx)(`div`,{className:`order-1 hidden w-[200px] shrink-0 items-center justify-center overflow-hidden md:visible! md:order-2 md:flex!`,children:(0,Q.jsx)(`img`,{alt:`Bookmark Thumb`,className:`min-h-full min-w-full shrink-0`,src:Wu})})]})]})]})},$u=({onClose:e})=>{let{localSettings:t,updateSetting:n,handleSave:r,saveState:i}=ve(),[a,o]=Hn(t,[`stripe_publishable_key`,`stripe_secret_key`]);return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Tt,{as:`h3`,className:`md:text-2xl`,leading:`heading`,size:`xl`,weight:`bold`,children:`Connect Stripe`}),(0,Q.jsxs)(tn,{className:`mt-10 gap-8 [&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`stripe-publishable-key`,children:`Publishable key`}),(0,Q.jsx)(X,{id:`stripe-publishable-key`,value:a?.toString()??``,onChange:e=>n(`stripe_publishable_key`,e.target.value)})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`stripe-secure-key`,children:`Secure key`}),(0,Q.jsx)(X,{id:`stripe-secure-key`,value:o?.toString()??``,onChange:e=>n(`stripe_secret_key`,e.target.value)})]}),(0,Q.jsx)(cr,{className:`mt-5`,disabled:i===`saving`,type:`button`,onClick:async()=>{try{b.dismiss(),await r(),e()}catch(e){if(e instanceof u){b.error(`Failed to save settings`,{description:`Check you copied both keys correctly`});return}throw e}},children:`Save Stripe settings`})]})]})},ed=H.create(()=>{let{config:e,settings:t}=xt(),n=_r(t,`stripe_connect_account_id`),{updateRoute:r}=V(),[i,a]=(0,Z.useState)(`start`),o=Oe(),s=De(),c=Si(t,e),l=s?.isDisabled(`limitStripeConnect`);(0,Z.useEffect)(()=>{(async()=>{if(l&&!c)try{await s?.errorIfWouldGoOverLimit(`limitStripeConnect`)}catch(e){e instanceof Ee&&(o.remove(),H.show(ke,{prompt:e.message||`Your current plan doesn't support Stripe Connect.`,onOk:()=>r({route:`/pro`,isExternal:!0})}))}})()},[s,o,r,c,l]);let u=()=>{a(`connect`)},d=()=>{o.remove(),r(`tiers`)},f;return f=e?.stripeDirect||Si(t||[],e||{})&&!n?(0,Q.jsx)($u,{onClose:d}):n?(0,Q.jsx)(Qu,{onClose:d}):i===`start`?(0,Q.jsx)(Xu,{onNext:u}):(0,Q.jsx)(Zu,{}),(0,Q.jsx)(Ie,{afterClose:()=>{r(`tiers`)},cancelLabel:``,footer:(0,Q.jsx)(`div`,{className:`mt-8`}),testId:`stripe-modal`,title:``,width:n?740:520,hideXOnMobile:!0,children:f})}),td=``+new URL(`ali-abdaal-DqO7DmHM.png`,import.meta.url).href,nd=``+new URL(`isaac-saul-WLit1kCf.png`,import.meta.url).href,rd=``+new URL(`joel-warner-DUevCA8i.png`,import.meta.url).href,id=H.create(()=>{let e=Z.useId(),{updateRoute:t}=V(),n=h(),r=Oe(),{settings:i,currentUser:a,siteData:o,config:s}=xt(),c=s.exploreTestimonialsUrl,l=o.site_uuid,[u]=Hn(i,[`title`]),d=a.name,f=a.email,p=a.roles[0].name,m=a.profile_image,{formState:g,updateForm:_,saveState:v,handleSave:y,errors:x,clearError:S}=T({initialState:{content:``,prev_platform:``},onSave:async()=>{let e=[`none`,`other`,``].includes(g.prev_platform)?void 0:g.prev_platform,n={ghost_uuid:l,staff_user_email:f,content:g.content,prev_platform:e};if(!c||!(await fetch(c,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(n)})).ok)throw Error(`Something went wrong, please try again later.`);b.success(`Thank you for your testimonial!`),t(`explore`),r.remove()},onSaveError:n,onValidate:()=>{let e={};return g.content.trim()||(e.content=`This field is required`),e}});return(0,Q.jsx)(Ie,{afterClose:()=>{t(`explore`)},cancelLabel:``,footer:!1,padding:!1,testId:`explore-testimonials-modal`,title:``,topRightContent:`close`,width:920,children:(0,Q.jsx)(tn,{className:`gap-8`,children:(0,Q.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,Q.jsxs)(`div`,{className:`hidden w-full flex-col justify-between bg-gradient-to-tl from-grey-100/50 to-grey-100/80 p-8 dark:from-grey-900/40 dark:to-grey-900/60 [@media(min-width:905px)]:visible! [@media(min-width:905px)]:flex!`,children:[(0,Q.jsxs)(`div`,{className:`pr-6`,children:[(0,Q.jsx)(`div`,{className:`relative rounded-xl bg-white px-3 py-2.5 text-md text-grey-700 italic shadow-lg before:absolute before:-bottom-1.5 before:left-5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 dark:before:bg-black`,children:`Moving to Ghost has proven to be one of the best business decisions we’ve made as an independent media outlet.`}),(0,Q.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${rd})`}}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Joel Warner`}),(0,Q.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Lever News`})]})]})]}),(0,Q.jsxs)(`div`,{className:`mt-8 ml-6`,children:[(0,Q.jsx)(`div`,{className:`relative rounded-xl bg-white px-3 py-2.5 text-md text-grey-700 italic shadow-lg before:absolute before:right-5 before:-bottom-1.5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 dark:before:bg-black`,children:`It has now been one year since I quit my full-time job to go all in on Tangle. Today, we have 50,000+ paying subscribers. That’s roughly $5M in gross yearly revenue ... it’s the best paying job I’ve ever had.`}),(0,Q.jsxs)(`div`,{className:`mt-[14px] mr-2 flex items-center justify-end gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,Q.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Isaac Saul`}),(0,Q.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Tangle`})]}),(0,Q.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${nd})`}})]})]}),(0,Q.jsxs)(`div`,{className:`mt-8 hidden pr-6 [@media(min-width:940px)]:visible! [@media(min-width:940px)]:block!`,children:[(0,Q.jsx)(`div`,{className:`relative rounded-xl bg-white px-3 py-2.5 text-md text-grey-700 italic shadow-lg before:absolute before:-bottom-1.5 before:left-5 before:block before:size-3 before:rotate-45 before:bg-white dark:bg-black dark:text-grey-300 dark:before:bg-black`,children:`You should be using Ghost because it’s absolutely amazing and I love it. It’s what I’ve been using for all my sites since 2016.`}),(0,Q.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Q.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${td})`}}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Ali Abdaal`}),(0,Q.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`YouTuber`})]})]})]})]}),(0,Q.jsxs)(`div`,{className:`flex grow flex-col justify-between gap-6 p-8 [@media(min-width:905px)]:min-w-[520px] [@media(min-width:940px)]:min-w-[460px]`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`flex size-[60px] items-center justify-center rounded-full bg-gradient-to-t from-[#CFB0FF] to-[#B27EFF]`,children:(0,Q.jsx)(`svg`,{fill:`none`,height:`26`,viewBox:`0 0 32 26`,width:`32`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Q.jsx)(`path`,{d:`M19.9967 26L18.1562 21.4542C23.4268 19.1176 25.7693 16.5261 26.2712 11.7255C25.5183 12.3627 24.5562 12.7026 23.3431 12.7026C20.1641 12.7026 17.4869 10.1536 17.4869 6.41503C17.4869 2.80392 20.3732 9.72736e-07 24.2634 6.32644e-07C28.2791 2.81581e-07 31.5 3.10131 31.5 8.96405C31.5 17.5458 27.4425 23.0261 19.9967 26ZM3.0098 26L1.12745 21.4543C6.43987 19.1176 8.78235 16.5261 9.24248 11.7255C8.53137 12.3627 7.56928 12.7026 6.35621 12.7026C3.17712 12.7026 0.499999 10.1536 0.499998 6.41504C0.499998 2.80393 3.38627 2.45778e-06 7.23464 2.12135e-06C11.2503 1.77028e-06 14.5131 3.10131 14.5131 8.96405C14.5131 17.5458 10.4556 23.0261 3.0098 26Z`,fill:`white`})})}),(0,Q.jsxs)(`div`,{className:`mt-6`,children:[(0,Q.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:`A quote about Ghost`}),(0,Q.jsx)(`div`,{className:`mt-2 text-pretty`,children:`We feature quotes from publishers to showcase their work, including a logo and a link! If you'd like to be included, share a quote we can use to highlight you.`})]}),(0,Q.jsx)(`div`,{className:`mt-8`,children:(0,Q.jsxs)(J,{"data-invalid":!!x.content||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,htmlFor:`testimonial-content`,children:`Quote`}),(0,Q.jsx)(sn,{"aria-invalid":!!x.content||void 0,className:`border-transparent bg-muted`,id:`testimonial-content`,placeholder:`What changed for the better since you switched to Ghost?`,rows:7,value:g.content,autoFocus:!0,onChange:e=>_(t=>({...t,content:e.target.value})),onKeyDown:()=>S(`content`)}),x.content&&(0,Q.jsx)(G,{children:x.content})]})}),(0,Q.jsx)(`div`,{className:`mt-4 ml-0.5`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Cr,{className:`size-10`,email:f,name:d,src:m}),(0,Q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Q.jsxs)(`span`,{className:`font-medium`,children:[`By `,d||f]}),(0,Q.jsxs)(`span`,{className:`text-sm text-grey-700`,children:[p,` — `,u]})]})]})})]}),(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`mt-2 flex items-center gap-4`,children:[(0,Q.jsx)(`div`,{className:`grow`,children:(0,Q.jsxs)(J,{"data-invalid":!!x.prev_platform||void 0,children:[(0,Q.jsx)(K,{className:`sr-only`,children:`Previous platform`}),(0,Q.jsxs)(qt,{value:g.prev_platform,onValueChange:e=>{_(t=>({...t,prev_platform:e})),S(`prev_platform`)},children:[(0,Q.jsx)(Wt,{"aria-describedby":x.prev_platform?e:void 0,"aria-invalid":!!x.prev_platform||void 0,"aria-label":`Previous platform`,"data-testid":`migrated-from`,children:(0,Q.jsx)(Kt,{placeholder:`Previous platform`})}),(0,Q.jsx)(Ut,{children:[{value:`none`,label:`None -\xA0This is a new site`},{value:`substack`,label:`Substack`},{value:`beehiiv`,label:`BeeHiiv`},{value:`wordpress`,label:`WordPress`},{value:`newspack`,label:`Newspack`},{value:`medium`,label:`Medium`},{value:`squarespace`,label:`Squarespace`},{value:`wix`,label:`Wix`},{value:`patreon`,label:`Patreon`},{value:`memberful`,label:`Memberful`},{value:`other`,label:`Other`}].map(e=>(0,Q.jsx)(Ht,{value:e.value,children:e.label},e.value))})]}),x.prev_platform&&(0,Q.jsx)(G,{id:e,children:x.prev_platform})]})}),(0,Q.jsxs)(cr,{disabled:v===`saving`,type:`button`,onClick:async()=>{await y()},children:[v===`saving`&&(0,Q.jsx)(Kr,{size:`sm`}),`Send testimonial`]})]})})]})]})})})});``+new URL(`ghost-transistor-sWk3BgP7.png`,import.meta.url).href;var ad=H.create(()=>{let{updateRoute:e}=V(),{config:t,settings:n}=xt(),{mutateAsync:r}=Y(),{data:{integrations:i}={integrations:[]}}=nt(),{mutateAsync:a}=qe(),o=h(),[s,c]=(0,Z.useState)(!1),l=t.hostSettings?.limits?.customIntegrations?.disabled,[u]=Hn(n,[`transistor`]),[f,p]=(0,Z.useState)(!!u),[m,g]=(0,Z.useState)(`Save`);(0,Z.useEffect)(()=>{p(u||!1)},[u]),(0,Z.useEffect)(()=>{l&&e(`integrations`)},[l,e]);let _=i.find(({slug:e})=>e===`transistor`),v=_?.api_keys?.find(e=>e.type===`admin`);return(0,Q.jsxs)(Ie,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:f!==u,okLabel:m,okVariant:`default`,testId:`transistor-modal`,title:``,onOk:async()=>{let e=[{key:`transistor`,value:f}];try{g(`Saving...`),await Promise.all([r(e),new Promise(e=>{setTimeout(e,1e3)})]),g(`Saved`)}catch(e){o(e)}finally{setTimeout(()=>g(`Save`),1e3)}},children:[(0,Q.jsx)(mt,{detail:`Give your members access to private podcasts`,icon:(0,Q.jsx)(it,{name:`transistor`,size:56}),title:`Transistor.fm`}),(0,Q.jsxs)(`div`,{className:`mt-7`,children:[(0,Q.jsxs)(rn,{className:`gap-0`,children:[(0,Q.jsx)(on,{className:`mb-3 text-md! leading-supertight font-bold md:text-lg!`,children:`Transistor configuration`}),(0,Q.jsxs)(tn,{className:`gap-8 rounded-sm border border-border-default p-4 md:p-7`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`transistor-enabled`,children:`Enable Transistor`}),(0,Q.jsxs)(q,{children:[`Connect your Ghost site with `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://transistor.fm`,rel:`noopener noreferrer`,target:`_blank`,children:`Transistor.fm`}),` to offer members private podcasts.`]})]}),(0,Q.jsx)(W,{checked:f,id:`transistor-enabled`,onCheckedChange:p})]}),f&&(0,Q.jsx)(Qe,{keys:[{id:`admin-api-key`,label:`Admin API key`,text:v?.secret,hint:s?(0,Q.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>{if(!_||!v)throw Error(`Transistor integration or Admin API key not found`);c(!1),H.show(We,{title:`Regenerate Admin API Key`,prompt:`You will need to update the API key in your Transistor account settings after regenerating.`,okLabel:`Regenerate Admin API Key`,onOk:async e=>{try{await a({integrationId:_.id,apiKeyId:v.id}),c(!0),e?.remove()}catch(e){o(e)}}})}},{id:`api-url`,label:`API URL`,text:window.location.origin+d().subdir}]})]})]}),f&&(0,Q.jsx)(`div`,{className:`mt-5 flex flex-col items-center`,children:(0,Q.jsxs)(`a`,{className:`flex w-100 flex-col items-stretch justify-between overflow-hidden rounded-md bg-grey-50 transition-all hover:border-grey-400 hover:bg-grey-100 md:flex-row dark:bg-grey-900 dark:hover:bg-grey-950`,href:`https://ghost.org/integrations/transistor/`,rel:`noopener noreferrer`,target:`_blank`,children:[(0,Q.jsxs)(`div`,{className:`order-2 px-7 py-5 md:order-1`,children:[(0,Q.jsx)(`div`,{className:`text-md font-semibold`,children:`How to use Transistor in Ghost`}),(0,Q.jsx)(`div`,{className:`mt-1 text-grey-800 dark:text-grey-500`,children:`Learn more about connecting Transistor with Ghost to offer members access to private podcasts in Portal or as an embed in posts and pages with a custom Transistor card.`})]}),(0,Q.jsx)(`div`,{className:`order-1 hidden w-[200px] shrink-0 items-center justify-center overflow-hidden md:visible! md:order-2 md:flex!`,children:(0,Q.jsx)(`img`,{alt:`Bookmark Thumb`,className:`min-h-full min-w-full shrink-0`,src:``+new URL(`ghost-transistor-sWk3BgP7.png`,import.meta.url).href})})]})})]})]})}),od=H.create(()=>{let{updateRoute:e}=V(),{settings:t}=xt(),[n]=Hn(t,[`unsplash`]),{mutateAsync:r}=Y(),i=h(),[a,o]=(0,Z.useState)(`Save`),[s,c]=(0,Z.useState)(!!n);return(0,Z.useEffect)(()=>{c(n||!1)},[n]),(0,Q.jsxs)(Ie,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:s!==n,okLabel:a,okVariant:`default`,testId:`unsplash-modal`,title:``,onOk:async()=>{let e=[{key:`unsplash`,value:s}];try{o(`Saving...`),await Promise.all([r(e),new Promise(e=>{setTimeout(e,1e3)})]),o(`Saved`)}catch(e){i(e)}finally{setTimeout(()=>o(`Save`),1e3)}},children:[(0,Q.jsx)(mt,{detail:`Beautiful, free photos`,icon:(0,Q.jsx)(it,{name:`unsplash`,size:48}),title:`Unsplash`}),(0,Q.jsx)(`div`,{className:`mt-7`,children:(0,Q.jsx)(tn,{className:`gap-8 rounded-sm border border-border-default p-4 md:p-7`,children:(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`unsplash-enabled`,children:`Enable Unsplash`}),(0,Q.jsxs)(q,{children:[`Enable `,(0,Q.jsx)(`a`,{className:`text-green`,href:`https://unsplash.com`,rel:`noopener noreferrer`,target:`_blank`,children:`Unsplash`}),` image integration for your posts`]})]}),(0,Q.jsx)(W,{checked:s,id:`unsplash-enabled`,onCheckedChange:c})]})})})]})}),sd=({user:e,setUserData:t})=>{let{config:n,settings:r}=xt(),i=Si(r||[],n||{});return(0,Q.jsxs)(_t,{children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Engagement`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`comment-notifications`,children:`Comments`}),(0,Q.jsx)(q,{children:`Every time a member comments on one of your posts`})]}),(0,Q.jsx)(W,{checked:!!e.comment_notifications,id:`comment-notifications`,onCheckedChange:n=>t({...e,comment_notifications:n})})]}),kn(e)&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`recommendation-notifications`,children:`Recommendations`}),(0,Q.jsx)(q,{children:`Every time another publisher recommends you to their audience`})]}),(0,Q.jsx)(W,{checked:!!e.recommendation_notifications,id:`recommendation-notifications`,onCheckedChange:n=>t({...e,recommendation_notifications:n})})]})]})]}),kn(e)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Members`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`free-member-signup-notifications`,children:`New signups`}),(0,Q.jsx)(q,{children:`Every time a new free member signs up`})]}),(0,Q.jsx)(W,{checked:!!e.free_member_signup_notification,id:`free-member-signup-notifications`,onCheckedChange:n=>t({...e,free_member_signup_notification:n})})]}),i&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`paid-subscription-started-notifications`,children:`New paid members`}),(0,Q.jsx)(q,{children:`Every time a member starts a new paid subscription`})]}),(0,Q.jsx)(W,{checked:!!e.paid_subscription_started_notification,id:`paid-subscription-started-notifications`,onCheckedChange:n=>t({...e,paid_subscription_started_notification:n})})]}),(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`paid-subscription-canceled-notifications`,children:`Paid member cancellations`}),(0,Q.jsx)(q,{children:`Every time a member cancels their paid subscription`})]}),(0,Q.jsx)(W,{checked:!!e.paid_subscription_canceled_notification,id:`paid-subscription-canceled-notifications`,onCheckedChange:n=>t({...e,paid_subscription_canceled_notification:n})})]})]})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Revenue`}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`milestone-notifications`,children:`Milestones`}),(0,Q.jsx)(q,{children:i?`Occasional summaries of your audience & revenue growth`:`Occasional summaries of your audience growth`})]}),(0,Q.jsx)(W,{checked:!!e.milestone_notifications,id:`milestone-notifications`,onCheckedChange:n=>t({...e,milestone_notifications:n})})]}),i&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`donation-notifications`,children:`Tips & donations`}),(0,Q.jsx)(q,{children:`Every time you receive a one-time payment`})]}),(0,Q.jsx)(W,{checked:!!e.donation_notifications,id:`donation-notifications`,onCheckedChange:n=>t({...e,donation_notifications:n})})]}),i&&(0,Q.jsxs)(J,{orientation:`horizontal`,children:[(0,Q.jsxs)(an,{children:[(0,Q.jsx)(K,{htmlFor:`gift-subscription-notifications`,children:`Gift subscriptions`}),(0,Q.jsx)(q,{children:`Every time someone purchases or redeems a gift subscription`})]}),(0,Q.jsx)(W,{checked:!!e.gift_subscription_notifications,id:`gift-subscription-notifications`,onCheckedChange:n=>t({...e,gift_subscription_notifications:n})})]})]})]})]})]})},cd=({user:e,setUserData:t})=>(0,Q.jsx)(we,{variant:`plain`,children:(0,Q.jsx)(sd,{setUserData:t,user:e})}),ld=[`1234567890`,`qwertyuiop`,`qwertzuiop`,`asdfghjkl;`,`abcdefghij`,`0987654321`,`1q2w3e4r5t`,`12345asdfg`],ud=[`ghost`,`password`,`passw0rd`],dd=e=>{let t={},n=!0,r=e.length/2;for(let n=0;n<e.length;n+=1)t[e[n]]?t[e[n]]+=1:t[e[n]]=1;for(let e in t)if(t[e]>=r)return n=!1,n;return n},fd=({user:e})=>{let{currentUser:t,config:n,siteData:r}=xt(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[u,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(``),[m,g]=(0,Z.useState)({}),_=(0,Z.useRef)(null),v=(0,Z.useRef)(null),x=(0,Z.useRef)(null),{mutateAsync:S}=Sn(),C=h(),w=e.id===t.id,T=({password:t,confirmPassword:i})=>{if(w&&!o)return{oldPassword:`Your current password is required to set a new one`};if(t!==i)return{newPassword:`Your new passwords do not match`,confirmNewPassword:`Your new passwords do not match`};let a=n.blogUrl||window.location.host,s=r.title;a=a.replace(/^http(s?):\/\//,``);let c=a.match(/\/$/)?a:`${a}/`;if(s&&=s.trim().toLowerCase(),t.length<10)return{newPassword:`Password must be at least 10 characters long.`};t=t.toString();for(let e of ld)if(e===t)return{newPassword:`Sorry, you cannot use an insecure password.`};if(t.toLowerCase()===e.email.toLowerCase())return{newPassword:`Sorry, you cannot use an insecure password.`};for(let e of ud)if(t.toLowerCase().indexOf(e)>=0)return{newPassword:`Sorry, you cannot use an insecure password.`};return t.toLowerCase()===s||t.toLowerCase()===a||t.toLowerCase()===c||!dd(t)?{newPassword:`Sorry, you cannot use an insecure password.`}:{}};(0,Z.useEffect)(()=>{f===`saved`&&setTimeout(()=>{p(``),a(!1)},2500)},[f]),(0,Z.useEffect)(()=>{i&&setTimeout(()=>{w?x.current?.focus():_.current?.focus()},100)},[i,w]);let E=()=>{a(!0)},D=`Save password`;f===`saving`?D=`Saving...`:f===`saved`&&(D=`Saved`);let O=(0,Q.jsxs)(Q.Fragment,{children:[w&&(0,Q.jsxs)(J,{"data-invalid":!!m.oldPassword||void 0,children:[(0,Q.jsx)(K,{htmlFor:`old-password`,children:`Old password`}),(0,Q.jsx)(X,{ref:x,"aria-invalid":!!m.oldPassword||void 0,"data-testid":`old-password`,id:`old-password`,type:`password`,value:o,onChange:e=>s(e.target.value)}),m.oldPassword&&(0,Q.jsx)(G,{children:m.oldPassword})]}),(0,Q.jsxs)(J,{"data-invalid":!!m.newPassword||void 0,children:[(0,Q.jsx)(K,{htmlFor:`new-password`,children:`New password`}),(0,Q.jsx)(X,{ref:_,"aria-invalid":!!m.newPassword||void 0,"data-testid":`new-password`,id:`new-password`,type:`password`,value:c,onChange:e=>l(e.target.value)}),m.newPassword&&(0,Q.jsx)(G,{children:m.newPassword})]}),(0,Q.jsxs)(J,{"data-invalid":!!m.confirmNewPassword||void 0,children:[(0,Q.jsx)(K,{htmlFor:`confirm-password`,children:`Confirm new password`}),(0,Q.jsx)(X,{ref:v,"aria-invalid":!!m.confirmNewPassword||void 0,"data-testid":`confirm-password`,id:`confirm-password`,type:`password`,value:u,onChange:e=>d(e.target.value)}),m.confirmNewPassword&&(0,Q.jsx)(G,{children:m.confirmNewPassword})]}),(0,Q.jsxs)(`div`,{className:`mt-1 flex items-center justify-end gap-3`,children:[(0,Q.jsx)(cr,{type:`button`,variant:`outline`,onClick:()=>{a(!1),s(``),l(``),d(``),g({})},children:`Cancel`}),(0,Q.jsx)(cr,{"data-testid":`save-password-button`,type:`button`,onClick:async()=>{p(`saving`);let t=T({password:c,confirmPassword:u});if(g(t),Object.keys(t).length>0){p(``);return}try{await S({newPassword:c,confirmNewPassword:u,oldPassword:o,userId:e?.id}),p(`saved`)}catch(e){p(``),b.error(e instanceof y?e.message:`Couldn't update password. Please try again.`),C(e,{withToast:!1})}},children:D})]})]});return(0,Q.jsx)(Q.Fragment,{children:i?O:(0,Q.jsxs)(`div`,{className:`relative flex flex-col`,children:[(0,Q.jsxs)(J,{className:`grow`,"data-disabled":!0,children:[(0,Q.jsx)(K,{htmlFor:`current-password`,children:`Password`}),(0,Q.jsx)(X,{id:`current-password`,type:`password`,value:`••••••••••••`,disabled:!0})]}),(0,Q.jsx)(cr,{className:`absolute top-0 right-0 h-auto p-0 hover:bg-transparent`,"data-testid":`change-password-button`,size:`sm`,type:`button`,variant:`ghost`,onClick:E,children:`Change`})]})})},pd=({user:e,setUserData:t})=>{let{data:{roles:n}={}}=de(),{config:r}=xt(),i=r.labs.superEditors,a=[{hint:`Can write and edit their own posts, but cannot publish them.`,label:`Contributor`,value:`contributor`},{hint:`Can create, edit and publish their own posts, but can’t modify others.`,label:`Author`,value:`author`},{hint:`Can edit and publish any posts, and manage Authors and Contributors.`,label:`Editor`,value:`editor`},{hint:`Trusted user who has full access to all content, settings, and user management.`,label:`Administrator`,value:`administrator`}];if(i&&(a=a.map(e=>e.value===`editor`?{...e,label:`Editor (beta mode)`,value:`super editor`,hint:`Can invite and manage other Authors and Contributors, as well as edit and publish any posts on the site. Can manage members and moderate comments.`}:e)),wn(e)){let e={label:`Owner`,value:`owner`};return(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Role`}),(0,Q.jsxs)(qt,{value:e.value,disabled:!0,children:[(0,Q.jsx)(Wt,{"aria-label":`Role`,children:(0,Q.jsx)(Kt,{})}),(0,Q.jsx)(Ut,{children:(0,Q.jsx)(Ht,{value:e.value,children:e.label})})]}),(0,Q.jsxs)(q,{children:[`This user is the owner of the site. `,(0,Q.jsx)(`a`,{href:`https://ghost.org/help/transfer-publication-ownership/`,rel:`noopener noreferrer`,target:`_blank`,children:`Transfer ownership`}),` first to change their role.`]})]})}let o=e.roles[0].name.toLowerCase(),s=a.find(e=>e.value.toLowerCase()===o)?.label;return(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{children:`Role`}),(0,Q.jsxs)(qt,{value:o,onValueChange:r=>{let i=n?.find(e=>e.name.toLowerCase()===r.toLowerCase());i&&t?.({...e,roles:[i]})},children:[(0,Q.jsx)(Wt,{"aria-label":`Role`,"data-testid":`role-select`,children:(0,Q.jsx)(Kt,{children:s})}),(0,Q.jsx)(Ut,{children:a.map(e=>(0,Q.jsx)(Ht,{value:e.value,children:(0,Q.jsxs)(`span`,{className:`flex flex-col`,children:[(0,Q.jsx)(`span`,{children:e.label}),(0,Q.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.hint})]})},e.value))})]})]})},md=g({dataType:`StaffTokenResponseType`,path:`/users/me/token/`}),hd=m({path:()=>`/users/me/token/`,method:`PUT`}),gd=()=>{let{refetch:e}=md({enabled:!1}),t=h(),[n,r]=(0,Z.useState)(``),{mutateAsync:i}=hd();return(0,Z.useEffect)(()=>{(async()=>{let t=await e();t?.data?.apiKey&&r(`${t.data.apiKey.id}:${t.data.apiKey.secret}`)})()},[e]),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Tt,{as:`h6`,className:`mb-2 text-base`,weight:`semibold`,children:`Staff access token`}),(0,Q.jsx)(Qe,{hasLabel:!1,keys:[{id:`staff-access-token`,text:n||``,onRegenerate:()=>{H.show(We,{title:`Regenerate your Staff Access Token`,prompt:`You can regenerate your Staff Access Token any time, but any scripts or applications using it will need to be updated.`,okLabel:`Regenerate your Staff Access Token`,okVariant:`destructive`,onOk:async e=>{try{let t=await i([]);r(`${t.apiKey.id}:${t.apiKey.secret}`),e?.remove()}catch(e){t(e)}}})}}]})]})},_d=({errors:e,clearError:t,user:n,setUserData:r})=>{let{currentUser:i,siteData:a}=xt(),o=wi(a);return(0,Q.jsxs)(_t,{className:`[&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!e?.email||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-email`,children:`Email`}),(0,Q.jsx)(X,{"aria-invalid":!!e?.email||void 0,id:`staff-email`,maxLength:191,value:n.email,onChange:e=>r({...n,email:e.target.value}),onKeyDown:()=>t(`email`)}),e?.email?(0,Q.jsx)(G,{children:e.email}):(0,Q.jsx)(q,{children:`Used for notifications`})]}),(0,Q.jsx)(fd,{user:n}),kn(i)&&(0,Q.jsx)(pd,{setUserData:r,user:n}),(0,Q.jsxs)(J,{"data-invalid":!!e?.name||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-name`,children:`Full name`}),(0,Q.jsx)(X,{"aria-invalid":!!e?.name||void 0,id:`staff-name`,maxLength:191,value:n.name,onChange:e=>r({...n,name:e.target.value}),onKeyDown:()=>t(`name`)}),e?.name?(0,Q.jsx)(G,{children:e.name}):(0,Q.jsx)(q,{children:`Use your real name so people can recognize you`})]}),(0,Q.jsxs)(J,{children:[(0,Q.jsx)(K,{htmlFor:`staff-slug`,children:`Slug`}),(0,Q.jsx)(X,{id:`staff-slug`,maxLength:191,value:n.slug,onChange:e=>r({...n,slug:e.target.value})}),(0,Q.jsxs)(q,{children:[o,`author/`,n.slug]})]}),(0,Q.jsxs)(J,{"data-invalid":!!e?.location||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-location`,children:`Location`}),(0,Q.jsx)(X,{"aria-invalid":!!e?.location||void 0,id:`staff-location`,maxLength:65535,value:n.location||``,onChange:e=>r({...n,location:e.target.value}),onKeyDown:()=>t(`location`)}),e?.location?(0,Q.jsx)(G,{children:e.location}):(0,Q.jsx)(q,{children:`Where in the world do you live?`})]}),(0,Q.jsxs)(J,{"data-invalid":!!e?.bio||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-bio`,children:`Bio`}),(0,Q.jsx)(sn,{"aria-invalid":!!e?.bio||void 0,className:`border-transparent bg-muted`,id:`staff-bio`,maxLength:65535,value:n.bio||``,onChange:e=>{r({...n,bio:e.target.value})},onKeyDown:()=>t(`bio`)}),e?.bio?(0,Q.jsx)(G,{children:e.bio}):(0,Q.jsxs)(q,{children:[`Recommended: `,F(250),` characters. You‘ve used `,(0,Q.jsx)(`span`,{className:`font-bold`,children:F(n.bio?.length||0)})]})]}),n.id===i.id&&(0,Q.jsx)(gd,{})]})},vd=e=>(0,Q.jsx)(we,{variant:`plain`,children:(0,Q.jsx)(_d,{...e})}),yd=({errors:e,clearError:t,validateField:n,user:r,setUserData:i})=>{let[a,o]=(0,Z.useState)(()=>Object.fromEntries(dt.map(e=>{let t=r[e.key];return[e.key,e.toDisplayValue(t)]})));return(0,Q.jsxs)(_t,{className:`[&_:where(input)]:h-[var(--control-height)] [&_:where(input)]:border-transparent [&_:where(input)]:bg-muted`,children:[(0,Q.jsxs)(J,{"data-invalid":!!e?.website||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-website`,children:`Website`}),(0,Q.jsx)(X,{"aria-invalid":!!e?.website||void 0,"data-testid":`website-input`,id:`staff-website`,maxLength:2e3,placeholder:`https://example.com`,value:r.website||``,onChange:e=>{i({...r,website:e.target.value})},onKeyDown:()=>t(`website`)}),e?.website&&(0,Q.jsx)(G,{children:e.website})]}),dt.map(s=>(0,Q.jsxs)(J,{"data-invalid":!!e?.[s.key]||void 0,children:[(0,Q.jsx)(K,{htmlFor:`staff-${s.key}`,children:s.staffTitle}),(0,Q.jsx)(X,{"aria-invalid":!!e?.[s.key]||void 0,"data-testid":s.testId,id:`staff-${s.key}`,maxLength:2e3,placeholder:s.placeholder,value:a[s.key],onBlur:e=>{if(n(s.key,e.target.value)){let{displayValue:t,storedValue:n}=Ke(s.key,e.target.value);o(e=>({...e,[s.key]:t})),i({...r,[s.key]:n})}},onChange:e=>{o(t=>({...t,[s.key]:e.target.value}))},onKeyDown:()=>t(s.key)}),e?.[s.key]&&(0,Q.jsx)(G,{children:e[s.key]})]},s.key))]})},bd=e=>(0,Q.jsx)(we,{variant:`plain`,children:(0,Q.jsx)(yd,{...e})}),xd={name:({name:e})=>{let t=``;return e||(t=`Name is required`),e&&e.length>191&&(t=`Name is too long`),t},email:({email:e})=>eo.default.isEmail(e||``)?``:`Enter a valid email address`,url:({url:e})=>!e||eo.default.isURL(e,{require_tld:!1})?``:`Enter a valid URL`,bio:({bio:e})=>!e||e.length<=250?``:`Bio is too long`,location:({location:e})=>!e||e.length<=150?``:`Location is too long`,website:({website:e})=>!e||eo.default.isURL(e)&&e.length<=2e3?``:`Enter a valid URL`,...Object.fromEntries(dt.map(e=>[e.key,t=>st(e.key,t[e.key])]))},Sd=({user:e,onDeletingUserChange:t})=>{let{updateRoute:n,route:r}=V(),i=e=>{let t=e.split(`/`).pop()||``;return t===`social-links`||t===`email-notifications`?t:`profile`},{ownerUser:a}=oe(),{currentUser:o}=xt(),s=h(),{formState:c,setFormState:l,saveState:u,handleSave:d,updateForm:f,errors:p,setErrors:m,clearError:g,okProps:_}=T({initialState:e,savingDelay:500,savedDelay:500,onValidate:t=>Object.entries(xd).reduce((n,[r,i])=>{if($e.includes(r)&&t[r]===e[r])return n;let a=i(t);return a&&(n[r]=a),n},{}),onSave:async t=>{let a=(await C?.(t))?.users?.[0];if(a&&(l(()=>a),a.slug!==e.slug)){let e=i(r),t=e===`profile`?``:`/${e}`;n({route:`staff/${a.slug}${t}`,replace:!0})}},onSaveError:s}),v=e=>f(()=>e),y=(e,t)=>{let n=xd[e]?.({[e]:t});return n?(m({...p,[e]:n}),!1):(g(e),!0)},x=Oe(),{mutateAsync:S}=re(),{mutateAsync:C}=On(),{mutateAsync:w}=An(),{mutateAsync:E}=En(),D=De(),O=Ce(),k=(0,Z.useCallback)(()=>{Mn(o)?n(`staff`):n({isExternal:!0,route:``})},[o,n]),A=async e=>{if(e.status===`inactive`&&e.roles[0].name!==`Contributor`)try{await D?.errorIfWouldGoOverLimit(`staff`)}catch(e){if(e instanceof Ee){H.show(ke,{formSheet:!0,prompt:e.message||`Your current plan doesn't support more users.`,onOk:()=>n({route:`/pro`,isExternal:!0})});return}else throw e}let t=`This user will no longer be able to log in but their posts will be kept.`;e.status===`inactive`&&(t=`This user will be able to log in again and will have the same permissions they had previously.`),H.show(We,{title:`Are you sure you want to suspend this user?`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`strong`,{children:`WARNING:`}),` `,t]}),okLabel:e.status===`inactive`?`Un-suspend`:`Suspend`,okRunningLabel:e.status===`inactive`?`Un-suspending...`:`Suspending...`,okVariant:`destructive`,onOk:async t=>{let n={...e,status:e.status===`inactive`?`active`:`inactive`};try{await C(n),l(()=>n),t?.remove(),b.success(e.status===`inactive`?`User un-suspended`:`User suspended`)}catch(e){s(e)}}})},j=(n,{owner:r})=>{H.show(We,{title:`Are you sure you want to delete this user?`,prompt:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`mb-3`,children:[(0,Q.jsx)(`span`,{className:`font-bold`,children:n.name||n.email}),` will be permanently deleted and all their posts will be automatically assigned to `,(0,Q.jsx)(`span`,{className:`font-bold`,children:r.name}),`.`]}),(0,Q.jsxs)(`p`,{children:[`To make these easy to find in the future, each post will be given an internal tag of `,(0,Q.jsxs)(`span`,{className:`font-bold`,children:[`#`,e.slug]})]})]}),okLabel:`Delete user`,okVariant:`destructive`,onOk:async e=>{t(!0);try{await w(n?.id),e?.remove(),x?.remove(),k(),setTimeout(()=>b.success(`User deleted`),100)}catch(e){t(!1),s(e)}}})},M=()=>{H.show(We,{title:`Transfer Ownership`,prompt:`Are you sure you want to transfer the ownership of this blog? You will not be able to undo this action.`,okLabel:`Yep — I'm sure`,okVariant:`destructive`,onOk:async t=>{try{await E(e.id),t?.remove(),b.success(`Ownership transferred`)}catch(e){s(e)}}})},ee=async(e,t)=>{try{let n=Te(await S({file:t}));switch(e){case`cover_image`:f(e=>({...e,cover_image:n}));break;case`profile_image`:f(e=>({...e,profile_image:n}));break}}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),s(t)}},N=e=>{switch(e){case`cover_image`:f(e=>({...e,cover_image:``}));break;case`profile_image`:f(e=>({...e,profile_image:``}));break}},P=kn(o)||Nn(o)&&Cn(e),F=wn(o)&&jn(c)&&c.status!==`inactive`,I=c.id!==o.id&&(kn(o)&&!wn(e)||Nn(o)&&Cn(e)),R=c.status===`inactive`?`Un-suspend user`:`Suspend user`,z=`h-8 bg-surface-inverse px-3 text-surface-inverse-foreground opacity-80 hover:bg-surface-inverse/90 hover:text-surface-inverse-foreground hover:opacity-100`,te=c.status===`inactive`?` (Suspended)`:``,[B,ne]=(0,Z.useState)(i(r));return(0,Q.jsx)(Ie,{afterClose:k,animate:Mn(o),backDrop:Mn(o),buttonsDisabled:_.disabled,cancelLabel:`Close`,dirty:u===`unsaved`,hideXOnMobile:!0,okLabel:_.label||`Save`,okVariant:_.variant,size:Mn(o)?`md`:`bleed`,stickyFooter:!0,testId:`user-detail-modal`,width:Mn(o)?600:`full`,onOk:async()=>{await d({fakeWhenUnchanged:!0})},children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`relative ${Mn(o)?`-mx-8 -mt-8 rounded-t`:`-mx-10 -mt-10`}`,children:(0,Q.jsx)(`div`,{className:`flex flex-wrap items-end justify-between gap-8 p-8 ${c.cover_image?`bg-cover bg-center`:``} ${!Mn(o)&&`min-h-[30vmin]`}`,style:{backgroundImage:c.cover_image?`url(${c.cover_image})`:`none`},children:(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-nowrap items-start justify-between gap-3`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(he,{className:`-ml-1 size-20 overflow-visible rounded-full`,children:c.profile_image?(0,Q.jsxs)(me,{className:`rounded-full`,children:[(0,Q.jsx)(le,{"data-testid":`profile-image-preview`,id:`avatar`,src:c.profile_image}),(0,Q.jsxs)(be,{className:`top-1 right-1`,children:[O.isEnabled&&(0,Q.jsx)(_e,{"aria-label":`Edit profile image`,className:`rounded-full`,onClick:()=>O.openEditor({image:c.profile_image||``,handleSave:async e=>ee(`profile_image`,e)}),children:(0,Q.jsx)(ni,{})}),(0,Q.jsx)(_e,{"aria-label":`Remove profile image`,className:`rounded-full`,onClick:()=>N(`profile_image`),children:(0,Q.jsx)(nr,{})})]})]}):(0,Q.jsx)(ae,{className:`rounded-full bg-surface-inverse text-surface-inverse-foreground opacity-80 hover:opacity-100`,inputId:`avatar`,inputTestId:`profile-image-upload`,onDropAccepted:e=>ee(`profile_image`,e[0]),children:(0,Q.jsx)(Kn,{className:`size-8 text-surface-inverse-foreground`})})})}),(0,Q.jsxs)(`div`,{className:`flex flex-nowrap items-start gap-3`,children:[c.cover_image?(0,Q.jsxs)(`div`,{className:`flex flex-nowrap items-end justify-end gap-4`,children:[(0,Q.jsx)(`img`,{alt:``,className:`hidden`,"data-testid":`cover-image-preview`,src:c.cover_image}),O.isEnabled&&(0,Q.jsx)(cr,{className:z,type:`button`,onClick:()=>O.openEditor({image:c.cover_image||``,handleSave:async e=>ee(`cover_image`,e)}),children:`Edit cover image`}),(0,Q.jsx)(cr,{className:z,type:`button`,onClick:()=>N(`cover_image`),children:`Delete cover image`})]}):(0,Q.jsx)(Bt,{className:`h-8`,inputId:`cover-image`,inputTestId:`cover-image-upload`,variant:`button`,onDropAccepted:e=>ee(`cover_image`,e[0]),children:`Upload cover image`}),P&&(0,Q.jsx)(`div`,{className:`z-10`,children:(0,Q.jsxs)(Yn,{children:[(0,Q.jsx)(fi,{asChild:!0,children:(0,Q.jsxs)(`button`,{className:L(`flex h-8 cursor-pointer items-center justify-center rounded px-3`,c.cover_image?`bg-[rgba(0,0,0,0.75)] opacity-80 hover:opacity-100`:`border border-grey-300 bg-transparent text-black dark:border-grey-800 dark:text-white`),type:`button`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:`Actions`}),(0,Q.jsx)(lr,{className:L(`size-5`,c.cover_image&&`text-white`)})]})}),(0,Q.jsxs)(ui,{align:`end`,className:`z-[9999]`,children:[F&&(0,Q.jsx)(Dr,{onSelect:M,children:`Make owner`}),(0,Q.jsx)(Dr,{onSelect:()=>{x.remove(),n(`history/view/${c.id}`)},children:`View user activity`}),I&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Dr,{onSelect:()=>{A(c)},children:R}),(0,Q.jsx)(Dr,{className:`text-destructive focus:text-destructive`,onSelect:()=>{j(e,{owner:a})},children:`Delete user`})]})]})]})})]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(Tt,{as:`h3`,className:L(`break-words md:text-2xl md:break-normal`,c.cover_image?`text-white`:`text-foreground`),leading:`heading`,size:`xl`,weight:`bold`,children:[e.name,te]}),(0,Q.jsx)(`span`,{className:L(`text-md font-medium capitalize`,c.cover_image?`text-white`:`text-black dark:text-white`),children:e.roles[0].name.toLowerCase()})]})]})})}),(0,Q.jsx)(`div`,{className:`${!Mn(o)&&`mx-auto max-w-[536px]`} mt-6 flex flex-col`,children:(0,Q.jsxs)(Lt,{value:B,variant:`underline`,onValueChange:t=>{let r=t===`profile`?``:`/${t}`;n(`staff/${e.slug}${r}`),ne(t)},children:[(0,Q.jsxs)(It,{children:[(0,Q.jsx)(Pt,{title:`Profile`,value:`profile`,children:`Profile`}),(0,Q.jsx)(Pt,{title:`Social Links`,value:`social-links`,children:`Social Links`}),(0,Q.jsx)(Pt,{title:`Email Notifications`,value:`email-notifications`,children:`Email Notifications`})]}),(0,Q.jsx)(Ft,{className:`pt-4`,value:`profile`,children:(0,Q.jsx)(vd,{clearError:g,errors:p,setUserData:v,user:c,validateField:y})}),(0,Q.jsx)(Ft,{className:`pt-4`,value:`social-links`,children:(0,Q.jsx)(bd,{clearError:g,errors:p,setUserData:v,user:c,validateField:y})}),(0,Q.jsx)(Ft,{className:`pt-4`,value:`email-notifications`,children:(0,Q.jsx)(cd,{setUserData:v,user:c})})]})})]})})},Cd={AddIntegrationModal:Pa,AddNewsletterModal:Fa,ContentApiModal:Ia,AddRecommendationModal:Ba,CustomIntegrationModal:lo,DesignAndThemeModal:zc,EditRecommendationModal:Fe,FirstPromoterModal:Gc,HistoryModal:sl,InviteUserModal:ul,NavigationModal:hl,NewsletterDetailModal:Sl,PinturaModal:Ou,PortalModal:Hu,SlackModal:Uu,StripeConnectModal:ed,TestimonialsModal:id,TierDetailModal:Me,TransistorModal:ad,UnsplashModal:od,UserDetailModal:H.create(({params:e})=>{let{currentUser:t}=xt(),{updateRoute:n}=V(),r=h(),[i,a]=(0,Z.useState)(!1),o=t.slug===e?.slug,{data:s,error:c}=Dn(e?.slug||``,{enabled:!o&&!!e?.slug,defaultErrorHandler:!1}),l=o?t:s?.users?.[0],u=c instanceof p&&c.response?.status===404;(0,Z.useEffect)(()=>{c&&!u&&r(c)},[c,u,r]);let d=!o&&!!e?.slug&&!l&&(u||s!==void 0),f=(0,Z.useRef)(void 0);l&&(f.current=l);let m=l||(d?void 0:f.current),g=d?e?.slug??null:null,_=(0,Z.useRef)(null);return(0,Z.useEffect)(()=>{!g||i||_.current===g||(_.current=g,b.error(`User not found`),Mn(t)?n({route:`staff`,replace:!0}):n({isExternal:!0,route:``}))},[g,i,t,n]),m?(0,Q.jsx)(Sd,{user:m,onDeletingUserChange:a}):null}),ZapierModal:ct,AnnouncementBarModal:$a,EmbedSignupFormModal:Wc,OffersContainerModal:Eu,AboutModal:Na,OfferSuccess:Cl};export{Cd as default};
|