ghost 6.52.0 → 6.52.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/tryghost-kg-card-factory-5.2.3.tgz +0 -0
- package/components/tryghost-kg-clean-basic-html-4.3.3.tgz +0 -0
- package/components/tryghost-kg-converters-1.2.3.tgz +0 -0
- package/components/tryghost-kg-default-cards-10.3.3.tgz +0 -0
- package/components/tryghost-kg-default-nodes-2.1.3.tgz +0 -0
- package/components/tryghost-kg-default-transforms-1.3.3.tgz +0 -0
- package/components/tryghost-kg-html-to-lexical-1.3.3.tgz +0 -0
- package/components/tryghost-kg-lexical-html-renderer-1.4.3.tgz +0 -0
- package/components/tryghost-kg-markdown-html-renderer-7.2.3.tgz +0 -0
- package/components/tryghost-kg-utils-1.1.3.tgz +0 -0
- package/core/built/admin/assets/Growth-CczbRexv.js +3 -0
- package/core/built/admin/assets/Newsletters-rFycX4x8.js +1 -0
- package/core/built/admin/assets/Overview-DFubBJaR.js +1 -0
- package/core/built/admin/assets/Web-BDE2lN4_.js +2 -0
- package/core/built/admin/assets/{account-migration-DiS76mRS.js → account-migration-gvH5a8ea.js} +1 -1
- package/core/built/admin/assets/audience-CMWMCxFS.js +1 -0
- package/core/built/admin/assets/{automated-emails-Cel18g7S.js → automated-emails-293Lcj5S.js} +1 -1
- package/core/built/admin/assets/automations-BxnjfCKn.js +1 -0
- package/core/built/admin/assets/automations-kPr44AmD.js +1 -0
- package/core/built/admin/assets/bluesky-sharing-Cww54F3Y.js +1 -0
- package/core/built/admin/assets/{chunk.912.9d6df5a6da679d905bbf.js → chunk.251.dd82df30188bb633b4ae.js} +9 -9
- package/core/built/admin/assets/{chunk.730.2457b7fede040aa52c88.js → chunk.341.20e7d2936dfa5877deea.js} +3 -3
- package/core/built/admin/assets/{chunk.524.d6d399b571454ea0234d.js → chunk.524.697bf0ded48e7c994fc3.js} +5 -5
- package/core/built/admin/assets/{chunk.582.50a9a5cbab6996daf0fe.js → chunk.582.6b742e9ba932688c442c.js} +6 -6
- package/core/built/admin/assets/{code-editor-view-BLGzcLub.js → code-editor-view-DSY5RHLf.js} +1 -1
- package/core/built/admin/assets/comments-BwNUmaNM.js +1 -0
- package/core/built/admin/assets/constants-c-JNF9c2.js +1 -0
- package/core/built/admin/assets/container-CD33Rm0u.js +1 -0
- package/core/built/admin/assets/content-helpers-CNBPrwsi.js +1 -0
- package/core/built/admin/assets/date-range-select-BkkNN98H.js +1 -0
- package/core/built/admin/assets/disabled-sources-indicator-ChHTF69d.js +1 -0
- package/core/built/admin/assets/{domain-2REz20SO.js → domain-CGk9SMa-.js} +1 -1
- package/core/built/admin/assets/dropzone-9zocztX0.js +5 -0
- package/core/built/admin/assets/{edit-profile-7QEh0VtN.js → edit-profile-C0B2Kbsl.js} +1 -1
- package/core/built/admin/assets/editor-Bz2Sm2O8.js +8 -0
- package/core/built/admin/assets/{esm-CEtFqV1y.js → esm-CsHLKmLh.js} +1 -1
- package/core/built/admin/assets/explore-CpRAMnx7.js +1 -0
- package/core/built/admin/assets/feed-BRoOWghO.js +1 -0
- package/core/built/admin/assets/filter-sources-DhxqZID1.js +1 -0
- package/core/built/admin/assets/{filters-DUy8rzI5.js → filters-B8nLLYGO.js} +1 -1
- package/core/built/admin/assets/{gh-chart-DdBGmBS8.js → gh-chart-Cqy9gGq7.js} +1 -1
- package/core/built/admin/assets/{gift-link-modal-CSgyxenA.js → gift-link-modal-v55u0VUL.js} +1 -1
- package/core/built/admin/assets/growth-BIfM3w1p.js +1 -0
- package/core/built/admin/assets/{inbox-CTD-ix6u.js → inbox-CDX57fXK.js} +11 -11
- package/core/built/admin/assets/index-B5yxmQNp.js +69 -0
- package/core/built/admin/assets/inline-DdrWe7D3.js +1 -0
- package/core/built/admin/assets/{input-group-DkR63-nk.js → input-group-DUPGQck1.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-D09TwwLs.js → koenig-lexical-CUVpp-dC.js} +1 -1
- package/core/built/admin/assets/{kpi-card-Fr_HJH78.js → kpi-card-DyDbok3h.js} +1 -1
- package/core/built/admin/assets/kpi-helpers-Bx9IHIMq.js +1 -0
- package/core/built/admin/assets/{kpi-tabs-Dc4Nt4a5.js → kpi-tabs-DmUcThFc.js} +1 -1
- package/core/built/admin/assets/labels-DLL8dl-7.js +1 -0
- package/core/built/admin/assets/layout-B7K3SmL0.js +1 -0
- package/core/built/admin/assets/{links-CfAB2Yeq.js → link-helpers-DHG_8GIT.js} +1 -1
- package/core/built/admin/assets/list-page-COAUFrmV.js +1 -0
- package/core/built/admin/assets/members-BxWs_mjq.js +10 -0
- package/core/built/admin/assets/{modals-Bu-1Uxdc.js → modals-DF2sECo6.js} +4 -4
- package/core/built/admin/assets/moderation-DYKTx5x0.js +1 -0
- package/core/built/admin/assets/newsletter-C-ZD1dI8.js +1 -0
- package/core/built/admin/assets/note-oaRdU_5z.js +1 -0
- package/core/built/admin/assets/notifications-BF4fAiP1.js +1 -0
- package/core/built/admin/assets/{nql-lang-CvCSOQG3.js → nql-lang-BoHzkNg5.js} +1 -1
- package/core/built/admin/assets/{onboarding-route-BDaa9hd3.js → onboarding-route-SS-e9Aeb.js} +1 -1
- package/core/built/admin/assets/overview-Cbn6bIoR.js +1 -0
- package/core/built/admin/assets/post-analytics-Bk9-KEgB.js +1 -0
- package/core/built/admin/assets/post-analytics-context-C8t_048I.js +1 -0
- package/core/built/admin/assets/post-analytics-header-xTjcg4H0.js +1 -0
- package/core/built/admin/assets/post-analytics-provider-CqnWwLMk.js +1 -0
- package/core/built/admin/assets/{post-share-modal-59Ujf4t1.js → post-share-modal-ZUCX7JZo.js} +1 -1
- package/core/built/admin/assets/preferences-BgjgxiBB.js +5 -0
- package/core/built/admin/assets/profile-qIwaxKTm.js +1 -0
- package/core/built/admin/assets/{router-provider-DcttGCQn.js → router-provider-S8Wf6jdu.js} +1 -1
- package/core/built/admin/assets/select-Cp27ScMR.js +1 -0
- package/core/built/admin/assets/{settings-dLraw6et.js → settings-CdDfyF90.js} +1 -1
- package/core/built/admin/assets/{settings-CIslWMfh.js → settings-CynBh-YN.js} +4 -4
- package/core/built/admin/assets/{share-modal-CI3E67kW.js → share-modal-DTIFYNI1.js} +1 -1
- package/core/built/admin/assets/social-urls-DVvRfwEp.js +16 -0
- package/core/built/admin/assets/{sort-button-BYwI0xdN.js → sort-button-BHh5Ba1K.js} +1 -1
- package/core/built/admin/assets/source-icon--egCE7iN.js +1 -0
- package/core/built/admin/assets/stats-DkqCtrPh.js +1 -0
- package/core/built/admin/assets/stats-view-BvWWxegf.js +1 -0
- package/core/built/admin/assets/step-1-DWjw7rIn.js +1 -0
- package/core/built/admin/assets/{step-2-CVOvLQ2n.js → step-2-D1LrETIB.js} +1 -1
- package/core/built/admin/assets/{step-3-BsVXcpWU.js → step-3-BAdJdZw4.js} +2 -2
- package/core/built/admin/assets/{tabs-Bw8aEqsd.js → tabs-DSrHPjWP.js} +1 -1
- package/core/built/admin/assets/tags-BWZqBj19.js +1 -0
- package/core/built/admin/assets/{textarea-CNaqhk5P.js → textarea-CUVQjsrM.js} +1 -1
- package/core/built/admin/assets/{toggle-group-CMp1taHd.js → toggle-group-CrFpl-Xz.js} +1 -1
- package/core/built/admin/assets/{topic-filter-D2_9eEw4.js → topic-filter-jAxwwd9I.js} +1 -1
- package/core/built/admin/assets/types-uYQ1HgqL.js +1 -0
- package/core/built/admin/assets/url-helpers-CCyfRrKj.js +1 -0
- package/core/built/admin/assets/use-analytics-data-DXG7mpgK.js +1 -0
- package/core/built/admin/assets/use-filter-params-EoQBXfP3.js +1 -0
- package/core/built/admin/assets/use-growth-stats-DJoXxVfD.js +1 -0
- package/core/built/admin/assets/use-post-referrers-B-onYbuS.js +1 -0
- package/core/built/admin/assets/use-reply-chain-data-D8IFALoz.js +1 -0
- package/core/built/admin/assets/{use-tinybird-query-CNCaUn39.js → use-tinybird-query-BSL3iVCc.js} +1 -1
- package/core/built/admin/assets/{use-tinybird-token-1T80Odca.js → use-tinybird-token-DHgOnrNu.js} +1 -1
- package/core/built/admin/assets/virtual-list-AQrbRAXP.js +1 -0
- package/core/built/admin/assets/web-zEFi98DS.js +1 -0
- package/core/built/admin/index.html +6 -6
- package/core/server/services/automations/automations-api.js +20 -0
- package/core/server/services/automations/automations-api.ts +31 -0
- package/core/server/services/automations/poll.js +7 -7
- package/core/server/services/automations/poll.ts +12 -9
- package/core/server/services/email-analytics/email-analytics-provider-mailgun.js +2 -2
- package/core/server/services/email-analytics/email-analytics-service-wrapper.js +1 -4
- package/core/server/services/email-analytics/email-analytics-service.js +5 -7
- package/core/server/services/webhooks/serialize.js +6 -5
- package/package.json +1 -1
- package/pnpm-lock.yaml +14 -14
- package/pnpm-workspace.yaml +5 -0
- package/core/built/admin/assets/Growth-Dx0vv-BS.js +0 -3
- package/core/built/admin/assets/Newsletters-v1GnbUjW.js +0 -1
- package/core/built/admin/assets/Overview-BgM7o-Z8.js +0 -1
- package/core/built/admin/assets/Web-DRv-83Ow.js +0 -2
- package/core/built/admin/assets/automations-DFLgH14-.js +0 -1
- package/core/built/admin/assets/automations-Dc4DUKBb.js +0 -1
- package/core/built/admin/assets/bluesky-sharing-Dk1RTUaz.js +0 -1
- package/core/built/admin/assets/comments-DgH1rC7w.js +0 -1
- package/core/built/admin/assets/constants-BlvYJTqz.js +0 -1
- package/core/built/admin/assets/content-helpers-BEgGpvyE.js +0 -1
- package/core/built/admin/assets/editor-u3BPqQed.js +0 -8
- package/core/built/admin/assets/en-DA2zVD_n.js +0 -1
- package/core/built/admin/assets/explore-BgHmdFVz.js +0 -1
- package/core/built/admin/assets/feed-Cs7-F3I5.js +0 -1
- package/core/built/admin/assets/filter-query-core-D6GjHUFB.js +0 -1
- package/core/built/admin/assets/growth-IkQZ1ZV9.js +0 -1
- package/core/built/admin/assets/index-BMhs4O3N.js +0 -69
- package/core/built/admin/assets/inline-C1CpHxuO.js +0 -1
- package/core/built/admin/assets/kpis-BTZ8cyw-.js +0 -1
- package/core/built/admin/assets/labels-sA9m188H.js +0 -5
- package/core/built/admin/assets/layout-szLkuQ88.js +0 -1
- package/core/built/admin/assets/list-page-DWkOdljb.js +0 -1
- package/core/built/admin/assets/main-layout-B-K8KliJ.js +0 -1
- package/core/built/admin/assets/members-PNNhalbu.js +0 -10
- package/core/built/admin/assets/moderation-DqnsNTiw.js +0 -1
- package/core/built/admin/assets/newsletter-BhuQeWFL.js +0 -1
- package/core/built/admin/assets/note-DFy2JTpP.js +0 -1
- package/core/built/admin/assets/notifications-BVu-JOkB.js +0 -1
- package/core/built/admin/assets/overview-Bhg8M7VS.js +0 -1
- package/core/built/admin/assets/pagemenu-C4paivNj.js +0 -1
- package/core/built/admin/assets/post-analytics-BhQUmZyA.js +0 -1
- package/core/built/admin/assets/post-analytics-context-Dy17HR1_.js +0 -1
- package/core/built/admin/assets/post-analytics-header-DAQep1VQ.js +0 -1
- package/core/built/admin/assets/posts/_react-dom-Blmuc0OL.js +0 -21
- package/core/built/admin/assets/posts/alert-dialog-DBJeQQTK.js +0 -154
- package/core/built/admin/assets/posts/app-provider-BJr9fdEC.js +0 -22
- package/core/built/admin/assets/posts/app-utils-9O53Czfw.js +0 -83
- package/core/built/admin/assets/posts/automations-BM0oBTjO.js +0 -275
- package/core/built/admin/assets/posts/automations-Dbp-gdHS.js +0 -223
- package/core/built/admin/assets/posts/avatar-kOk1tTvT.js +0 -144
- package/core/built/admin/assets/posts/badge-DnByIHe9.js +0 -25
- package/core/built/admin/assets/posts/button-Dd8Xreln.js +0 -40844
- package/core/built/admin/assets/posts/chunk-KS7C4IRE-ECXkcZq6.js +0 -7740
- package/core/built/admin/assets/posts/comments-D-7hbbdw.js +0 -8032
- package/core/built/admin/assets/posts/data-list-DdD_glQ-.js +0 -14219
- package/core/built/admin/assets/posts/dialog-DDkTy_np.js +0 -229
- package/core/built/admin/assets/posts/editor-D7-01KV_.js +0 -14633
- package/core/built/admin/assets/posts/empty-indicator-Ze-bwJ27.js +0 -38
- package/core/built/admin/assets/posts/filters-CmKfKtpS.js +0 -5611
- package/core/built/admin/assets/posts/get-site-timezone-DVbWc-NA.js +0 -39
- package/core/built/admin/assets/posts/growth-DlhFUzVg.js +0 -299
- package/core/built/admin/assets/posts/heading-BBl-8tMC.js +0 -92
- package/core/built/admin/assets/posts/hooks-gZAmj4Al.js +0 -5429
- package/core/built/admin/assets/posts/input-DuPLeCGW.js +0 -16
- package/core/built/admin/assets/posts/input-surface-ClwNIxfd.js +0 -17
- package/core/built/admin/assets/posts/jsx-runtime-BfZnKD4L.js +0 -95
- package/core/built/admin/assets/posts/koenig-lexical-DCHiJJou.js +0 -77579
- package/core/built/admin/assets/posts/kpis-Fsx0XmYK.js +0 -2061
- package/core/built/admin/assets/posts/label-D1wSl69p.js +0 -32
- package/core/built/admin/assets/posts/links-DLozzgMh.js +0 -1243
- package/core/built/admin/assets/posts/loading-indicator-BgU2kK3v.js +0 -44
- package/core/built/admin/assets/posts/main-layout-DDlTMrnF.js +0 -15
- package/core/built/admin/assets/posts/newsletter-DAQJ1GLe.js +0 -736
- package/core/built/admin/assets/posts/overview-G3MfRm-S.js +0 -426
- package/core/built/admin/assets/posts/page-header-CanFyB95.js +0 -284
- package/core/built/admin/assets/posts/popover-Cta8ZDHJ.js +0 -221
- package/core/built/admin/assets/posts/post-analytics-cS07-wo_.js +0 -121
- package/core/built/admin/assets/posts/post-analytics-context-D868SMoq.js +0 -150
- package/core/built/admin/assets/posts/post-analytics-header-CZYiuaEL.js +0 -42249
- package/core/built/admin/assets/posts/post-share-modal-BJfswZzf.js +0 -352
- package/core/built/admin/assets/posts/posts-CpusjBC0.js +0 -37
- package/core/built/admin/assets/posts/posts-app-context-CPC7dOlt.js +0 -26
- package/core/built/admin/assets/posts/posts.js +0 -145
- package/core/built/admin/assets/posts/router-provider-DrqpOc8m.js +0 -114
- package/core/built/admin/assets/posts/separator-DAZNzARU.js +0 -37
- package/core/built/admin/assets/posts/settings-CMfUn5Hq.js +0 -66
- package/core/built/admin/assets/posts/shade-app-DLbeExcd-NeEZjE3R.js +0 -4764
- package/core/built/admin/assets/posts/sheet-CEuv-0a5.js +0 -62
- package/core/built/admin/assets/posts/site-WJ6ldary.js +0 -10
- package/core/built/admin/assets/posts/skeleton-CO0qCdQF.js +0 -2426
- package/core/built/admin/assets/posts/source-icon-Bs6o84W3.js +0 -143
- package/core/built/admin/assets/posts/stats-B1Z8H0JT.js +0 -92
- package/core/built/admin/assets/posts/table-CbJ9bOpM.js +0 -77
- package/core/built/admin/assets/posts/tabs-BvzzwQ4P.js +0 -242
- package/core/built/admin/assets/posts/tags-D-4TwsD0.js +0 -462
- package/core/built/admin/assets/posts/tooltip-BI7VtFUY.js +0 -380
- package/core/built/admin/assets/posts/update-queries-DiUznIQ1.js +0 -60
- package/core/built/admin/assets/posts/users-UgRPrTKW.js +0 -83
- package/core/built/admin/assets/posts/value-DF_wOhJe.js +0 -415
- package/core/built/admin/assets/posts/virtual-list-window-DP63Onpm.js +0 -853
- package/core/built/admin/assets/posts/web-axp2l3kK.js +0 -8077
- package/core/built/admin/assets/preferences-ChOzBKcF.js +0 -5
- package/core/built/admin/assets/profile-DlcrYKay.js +0 -1
- package/core/built/admin/assets/select-BbtNHCBq.js +0 -1
- package/core/built/admin/assets/social-urls-DVzIHh2W.js +0 -16
- package/core/built/admin/assets/source-icon-Uuhttjun.js +0 -1
- package/core/built/admin/assets/source-utils-BchD0sF0.js +0 -1
- package/core/built/admin/assets/stats-CrlPzgdd.js +0 -1
- package/core/built/admin/assets/stats-view-UNMhTMCZ.js +0 -1
- package/core/built/admin/assets/step-1-C2HY6pyi.js +0 -1
- package/core/built/admin/assets/tags-DjCsJo0X.js +0 -1
- package/core/built/admin/assets/typeof-Ca-duI-z.js +0 -1
- package/core/built/admin/assets/url-helpers-DxA844rA.js +0 -1
- package/core/built/admin/assets/use-growth-stats-DNIGdI8h.js +0 -1
- package/core/built/admin/assets/use-reply-chain-data-DtEC2Azp.js +0 -1
- package/core/built/admin/assets/virtual-list-window-BTXGwpf5.js +0 -1
- package/core/built/admin/assets/web-Cj8VEw3s.js +0 -1
- /package/core/built/admin/assets/{chunk.912.9d6df5a6da679d905bbf.js.LICENSE.txt → chunk.251.dd82df30188bb633b4ae.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dist-CMhLtvG_.js","./rolldown-runtime-DAXXjFlN.js","./dist-DLRDZ5Qa.js","./dist-DMIqMO5L.js","./dist-C30sqimN.js","./dist-CNbTQjTb.js","./dist-CVmVbSNW.js","./dist-DGtq6W4I.js","./dist-DVfKxKHo.js","./dist-Bw1d5xrJ.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{t as i}from"./react-dom-C6aoWSfl.js";import{i as a,n as o,s}from"./framework-provider-i7X1c1ST.js";import{S as c,_ as l,b as u,f as d,g as f,h as p,m,n as h,p as g,r as _,t as v,u as y,w as b,y as x}from"./hooks-tBACnBdQ.js";import{t as S}from"./jsx-runtime-CtMZ-PAS.js";import{a as C}from"./dist-B7kX8alP.js";import{t as w}from"./dist-B_Ahe-Z8.js";import{d as T,f as E,h as D,l as O,n as k,p as A,r as j,t as M,u as N}from"./esm-CEtFqV1y.js";import{t as P}from"./clsx-CjueKrWZ.js";import{$ as F,$t as I,At as L,B as R,Bt as z,C as B,Ct as ee,Dt as V,E as te,Et as ne,F as H,Ft as re,G as ie,Gt as ae,H as oe,Ht as se,I as ce,J as le,K as ue,L as de,Lt as fe,M as pe,Mt as me,Ot as he,Pt as ge,Q as _e,R as ve,Rt as ye,S as be,T as xe,Tt as Se,Ut as Ce,V as we,Vt as Te,Wt as Ee,X as De,Xt as U,Y as Oe,Z as ke,Zt as Ae,_ as je,a as Me,b as Ne,cn as Pe,dn as Fe,en as Ie,et as Le,f as Re,ft as W,g as ze,gt as Be,h as Ve,ht as He,i as Ue,in as We,it as Ge,j as Ke,jt as qe,k as G,kt as Je,l as Ye,ln as Xe,lt as K,m as Ze,mt as Qe,n as $e,nt as et,pt as tt,r as nt,rn as rt,rt as it,s as at,sn as ot,t as st,u as ct,un as q,v as lt,vt as ut,w as dt,wt as ft,x as pt,xt as mt,y as ht,yt as gt,z as _t,zt as vt}from"./social-urls-DVzIHh2W.js";import{d as yt,p as bt,u as xt}from"./Combination-BPFTKsTn.js";import{r as St}from"./dist-CsekE4FL.js";import{o as Ct}from"./dist-CaHNiF20.js";import{t as wt}from"./dist-JLOy8o0Q.js";import{n as Tt,t as Et}from"./dist-CNlBOype.js";import{t as Dt}from"./preload-helper-DYl5dUZ5.js";import{n as Ot,r as kt}from"./dist-duxRDcQu.js";import{c as At,g as jt,h as Mt}from"./automated-emails-Cel18g7S.js";import{a as Nt,i as Pt,n as Ft,r as It,t as Lt}from"./offers-BYodCS47.js";import{n as Rt}from"./posts-D_gBhqmK.js";import{At as zt,Bn as Bt,C as Vt,D as Ht,H as Ut,Ut as Wt,Wt as Gt,Xn as Kt,Yt as qt,Z as Jt,a as Yt,g as Xt,gn as Zt,mn as Qt,rt as $t,un as en,y as tn}from"./button-DiwO9Rof.js";import{_ as nn,c as rn,d as an,f as on,g as sn,h as cn,m as ln,o as un,p as dn,s as fn,t as pn,u as mn}from"./users-Y8qhvF1q.js";import{Ai as hn,Bt as gn,Gt as _n,Ht as vn,Jt as yn,Kt as bn,Mi as xn,Nn as Sn,Pn as Cn,Rt as wn,Ut as Tn,Vt as En,Wt as Dn,Xt as On,Yt as kn,_n as An,cn as jn,di as Mn,dn as Nn,fi as Pn,fn as Fn,gn as In,ji as Ln,ki as Rn,ln as zn,on as Bn,pi as Vn,pn as Hn,qt as Un,sn as Wn,ui as Gn,un as Kn,y as qn,yn as Jn,zt as Yn}from"./index-BMhs4O3N.js";import{G as Xn}from"./dist-DLRDZ5Qa.js";import{i as Zn,n as Qn,r as $n}from"./newsletters-BEvO0JE3.js";import{t as er}from"./nql-lang-CvCSOQG3.js";import{a as tr,o as nr,r as rr}from"./tiers-74aPYtWv.js";var J=t(r(),1),Y=S(),ir=({children:e,...t})=>(0,Y.jsx)(`div`,{className:`flex size-full flex-col px-8`,...t,children:(0,Y.jsx)(`div`,{className:`size-full overflow-hidden rounded-t-[4px] shadow-sm`,children:e})}),ar=({children:e,...t})=>(0,Y.jsx)(`div`,{className:`flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900`,...t,children:(0,Y.jsx)(`div`,{className:`size-full grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950`,children:e})}),or=({title:e,label:t,value:n,onChange:r,disabled:i,error:a,hint:o,checked:s,separator:c,testId:l})=>{let u=(0,J.useId)();return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 ${c&&`pb-2`}`,children:[e&&(0,Y.jsx)(A,{grey:!0,level:6,children:e}),(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start ${e&&`mt-1 -mb-1`}`,htmlFor:u,children:[(0,Y.jsx)(Et,{className:`mt-0.5 flex size-4 cursor-pointer appearance-none items-center justify-center rounded-[3px] border border-solid border-grey-500 bg-white outline-hidden data-[state=checked]:border-black data-[state=checked]:bg-black data-[state=indeterminate]:border-black data-[state=indeterminate]:bg-black`,"data-testid":l,defaultChecked:s,disabled:i,id:u,value:n,onCheckedChange:e=>{r(e===!0)},children:(0,Y.jsx)(Tt,{children:(0,Y.jsx)(`svg`,{fill:`none`,height:`11`,viewBox:`0 0 10 11`,width:`10`,children:(0,Y.jsx)(`path`,{d:`M1 5.88889L4.6 9L9 1`,stroke:`white`,strokeLinecap:`round`,strokeWidth:`2`})})})}),(0,Y.jsxs)(`div`,{className:`ml-2 flex flex-col ${o&&`mb-2`}`,children:[(0,Y.jsx)(`span`,{className:`inline-block text-[1.425rem] dark:text-white ${o&&`-mb-1`}`,children:t}),o&&(0,Y.jsx)(E,{color:a?`red`:``,children:o})]})]})]}),(c||a)&&(0,Y.jsx)(D,{className:a?`border-red`:``})]})},sr=({title:e,checkboxes:t,hint:n,error:r})=>(0,Y.jsxs)(`div`,{children:[e&&(0,Y.jsx)(A,{grey:!0,level:6,children:e}),(0,Y.jsx)(`div`,{className:`mt-2 flex flex-col gap-1`,children:t?.map(({key:e,...t},n)=>(0,Y.jsx)(or,{...t},e??`checkbox-${n}`))}),(0,Y.jsx)(`div`,{className:`flex flex-col ${n&&`mb-2`}`,children:n&&(0,Y.jsx)(E,{color:r?`red`:``,children:n})})]}),X=({hex:e,value:t,title:n,size:r=`md`,isSelected:i,onSelect:a})=>{let o=(0,J.useRef)(null),s=n=>{n.preventDefault(),a(t===void 0?e:t)},c=e.length===4&&e[3]===`0`||e.length===8&&e.slice(6)===`00`,l=`h-5 w-5`;switch(r){case`lg`:l=`w-6 h-6`;break}return(0,Y.jsx)(`button`,{ref:o,className:P(`relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800`,l,i&&`outline-2 outline-green`),style:{backgroundColor:e},title:n,type:`button`,onClick:s,children:c&&(0,Y.jsx)(`div`,{className:`absolute top-0 left-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})})},cr=({title:e,value:t,swatches:n,swatchSize:r=`md`,onSwatchChange:i,onTogglePicker:a,isExpanded:o,picker:s=!0,containerClassName:c})=>{let l=n.find(e=>e.value===t||e.hex===t);return c=P(`flex flex-col gap-3`),(0,Y.jsxs)(`div`,{className:c,children:[e&&(0,Y.jsx)(A,{useLabelTag:!0,children:e}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(o||!s)&&(0,Y.jsx)(`div`,{className:`flex items-center gap-1`,children:n.map(({customContent:e,...t})=>e?(0,Y.jsx)(J.Fragment,{children:e},t.title):(0,Y.jsx)(X,{isSelected:l?.title===t.title,size:r,onSelect:i,...t},t.title))}),s&&(0,Y.jsxs)(`button`,{"aria-label":`Pick color`,className:`relative size-6 cursor-pointer rounded-full border border-grey-200 dark:border-grey-800`,type:`button`,onClick:a,children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-[conic-gradient(hsl(360,100%,50%),hsl(315,100%,50%),hsl(270,100%,50%),hsl(225,100%,50%),hsl(180,100%,50%),hsl(135,100%,50%),hsl(90,100%,50%),hsl(45,100%,50%),hsl(0,100%,50%))]`}),l&&(0,Y.jsx)(`div`,{className:`absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950`,style:{backgroundColor:l.hex},children:l.hex===`transparent`&&(0,Y.jsx)(`div`,{className:`absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})}),!l&&t&&(0,Y.jsx)(`div`,{className:`absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950`,style:{backgroundColor:t},children:t===`transparent`&&(0,Y.jsx)(`div`,{className:`absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})})]})]})]})};function lr(){return(lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ur(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function Z(e){var t=(0,J.useRef)(e),n=(0,J.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},fr=function(e){return`touches`in e},pr=function(e){return e&&e.ownerDocument.defaultView||self},mr=function(e,t,n){var r=e.getBoundingClientRect(),i=fr(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:dr((i.pageX-(r.left+pr(e).pageXOffset))/r.width),top:dr((i.pageY-(r.top+pr(e).pageYOffset))/r.height)}},hr=function(e){!fr(e)&&e.preventDefault()},gr=J.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=ur(e,[`onMove`,`onKey`,`onEnd`]),a=(0,J.useRef)(null),o=Z(t),s=Z(n),c=Z(r),l=(0,J.useRef)(null),u=(0,J.useRef)(!1),d=(0,J.useMemo)(function(){var e=function(e){hr(e),(fr(e)?e.touches.length>0:e.buttons>0)&&a.current?o(mr(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=pr(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(hr(t),!function(e,t){return t&&!fr(e)}(t,u.current)&&r)){if(fr(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(mr(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,J.useEffect)(function(){return h},[h]),J.createElement(`div`,lr({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),_r=function(e){return e.filter(Boolean).join(` `)},vr=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=_r([`react-colorful__pointer`,e.className]);return J.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},J.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},yr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var br=function(e){return Or(xr(e))},xr=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?yr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?yr(parseInt(e.substring(6,8),16)/255,2):1}},Sr=function(e){return Dr(Tr(e))},Cr=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:yr(e.h),s:yr(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:yr(i/2),a:yr(r,2)}},wr=function(e){var t=Cr(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},Tr=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:yr(255*[r,s,o,o,c,r][l]),g:yr(255*[c,r,r,s,o,o][l]),b:yr(255*[o,o,c,r,r,s][l]),a:yr(i,2)}},Er=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},Dr=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?Er(yr(255*i)):``;return`#`+Er(t)+Er(n)+Er(r)+a},Or=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:yr(60*(s<0?s+6:s)),s:yr(a?o/a*100:0),v:yr(a/255*100),a:i}},kr=J.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=_r([`react-colorful__hue`,e.className]);return J.createElement(`div`,{className:i},J.createElement(gr,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dr(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":yr(t),"aria-valuemax":`360`,"aria-valuemin":`0`},J.createElement(vr,{className:`react-colorful__hue-pointer`,left:t/360,color:wr({h:t,s:100,v:100,a:1})})))}),Ar=J.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:wr({h:t.h,s:100,v:100,a:1})};return J.createElement(`div`,{className:`react-colorful__saturation`,style:i},J.createElement(gr,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dr(t.s+100*e.left,0,100),v:dr(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+yr(t.s)+`%, Brightness `+yr(t.v)+`%`},J.createElement(vr,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:wr(t)})))}),jr=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Mr=function(e,t){return e.toLowerCase()===t.toLowerCase()||jr(xr(e),xr(t))};function Nr(e,t,n,r){var i=Z(n),a=Z(r),o=(0,J.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,J.useRef)({color:t,hsva:s}),u=(0,J.useRef)(!1);return(0,J.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,J.useEffect)(function(){var t;jr(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,J.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,J.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var Pr,Fr=typeof window<`u`?J.useLayoutEffect:J.useEffect,Ir=function(){return Pr||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},Lr=new Map,Rr=function(e){Fr(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Lr.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Lr.set(t,n);var r=Ir();r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},zr=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=ur(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,J.useRef)(null);Rr(c);var l=Nr(n,i,a,o),u=l[0],d=l[1],f=l[2],p=_r([`react-colorful`,t]);return J.createElement(`div`,lr({},s,{ref:c,className:p}),J.createElement(Ar,{hsva:u,onChange:d,onChangeEnd:f}),J.createElement(kr,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},Br={defaultColor:`000`,toHsva:br,fromHsva:function(e){return Sr({h:e.h,s:e.s,v:e.v,a:1})},equal:Mr},Vr=function(e){return J.createElement(zr,lr({},e,{colorModel:Br}))},Hr=/^#?([0-9A-F]{3,8})$/i,Ur=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,s=e.format,c=e.process,l=ur(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),u=(0,J.useState)(function(){return a(n)}),d=u[0],f=u[1],p=Z(r),m=Z(i),h=(0,J.useCallback)(function(e){var t=a(e.target.value);f(t),o(t)&&p(c?c(t):t)},[a,c,o,p]),g=(0,J.useCallback)(function(e){o(e.target.value)||f(a(n)),m(e)},[n,a,o,m]);return(0,J.useEffect)(function(){f(a(n))},[n,a]),J.createElement(`input`,lr({},l,{value:s?s(d):d,spellCheck:`false`,onChange:h,onBlur:g}))},Wr=function(e){return`#`+e},Gr=function(e){var t=e.prefixed,n=e.alpha,r=ur(e,[`prefixed`,`alpha`]),i=(0,J.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,J.useCallback)(function(e){return function(e,t){var n=Hr.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return J.createElement(Ur,lr({},r,{escape:i,format:t?Wr:void 0,process:Wr,validate:a}))},Kr=({hexValue:e,eyedropper:t,clearButtonValue:n,containerClassName:r,onChange:i})=>{let a=(0,J.useRef)(null),o=(0,J.useCallback)(e=>{e.stopPropagation();let t=a.current?.querySelector(`input`);e.target!==t&&(a.current?.querySelector(`input`)?.focus(),e.preventDefault())},[]),s=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{s.current=!1,a.current?.querySelector(`input`)?.focus(),document.removeEventListener(`mouseup`,c),document.removeEventListener(`touchend`,c)},[]),u=(0,J.useCallback)(()=>{s.current=!0,document.addEventListener(`mouseup`,c),document.addEventListener(`touchend`,c)},[c]),d=(0,J.useCallback)(e=>{e.preventDefault(),window.EyeDropper&&(s.current=!0,document.body.style.setProperty(`pointer-events`,`none`),new window.EyeDropper().open().then(e=>i?.(e.sRGBHex)).finally(()=>{s.current=!1,document.body.style.removeProperty(`pointer-events`),a.current?.querySelector(`input`)?.focus()}))},[i]);(0,J.useEffect)(()=>{a.current?.querySelector(`input`)?.focus()},[]);let f=(0,J.useCallback)(()=>{a.current?.querySelector(`input`)?.focus()},[]);return r=P(`mt-2`,r),(0,Y.jsxs)(`div`,{className:r,onMouseDown:o,onTouchStart:o,children:[(0,Y.jsx)(Vr,{className:`w-full`,color:e||`#ffffff`,onChange:i,onMouseDown:u,onTouchStart:u}),(0,Y.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Y.jsxs)(`div`,{ref:a,className:`peer relative order-2 flex h-10 w-full items-center`,onClick:f,children:[(0,Y.jsx)(`span`,{className:`absolute top-[9px] left-2 z-10 mr-2 ml-1 text-grey-700`,children:`#`}),(0,Y.jsx)(Gr,{"aria-label":`Color value`,className:`z-[1] w-full rounded-md border border-transparent bg-grey-100 p-2 pl-6 transition-all hover:bg-grey-100 focus:border-green focus:bg-white focus:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:bg-grey-900 dark:text-white dark:focus:bg-grey-900`,color:e,onChange:i}),t&&!!window.EyeDropper&&(0,Y.jsx)(`button`,{className:`absolute inset-y-0 right-3 z-50 my-auto size-4 p-[1px]`,type:`button`,onClick:d,children:(0,Y.jsx)(l,{className:`size-full`})})]}),n!==void 0&&(0,Y.jsx)(q,{color:`grey`,value:`Clear`,onClick:()=>i?.(n)})]})]})},qr=(0,J.createContext)({colorPickers:[]}),Jr=e=>e.length===4?e.replace(/#(.)(.)(.)/,`#$1$1$2$2$3$3`):e,Yr=({testId:e,title:t,direction:n,value:r,hint:i,error:a,eyedropper:o,clearButtonValue:s,onChange:c,swatches:l=[],alwaysOpen:u=!1,debounceMs:d})=>{let[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(r),g=(0,J.useContext)(qr),_=(0,J.useId)();(0,J.useEffect)(()=>{h(e=>Jr(e||``)===r?e:r)},[r]),(0,J.useEffect)(()=>(g.colorPickers.push({id:_,setExpanded:p}),()=>{g.colorPickers=g.colorPickers.filter(e=>e.id!==_)}),[g,_]),(0,J.useEffect)(()=>{if(f){g.colorPickers.filter(e=>e.id!==_).forEach(e=>e.setExpanded(!1));let e=()=>{p(!1)};return document.addEventListener(`click`,e),()=>{document.removeEventListener(`click`,e)}}},[g,_,f]);let v=(0,J.useMemo)(()=>c&&d?Ie(c,d):c,[d,c]),y=e=>{h(e),v?.(e?Jr(e):null)},b=(0,Y.jsx)(cr,{isExpanded:f,swatches:l,value:m,onSwatchChange:e=>{y(e),p(!1)},onTogglePicker:()=>!u&&p(!f)});t&&(b=(0,Y.jsxs)(`div`,{className:P(`flex w-full cursor-pointer items-start first:mt-0 dark:text-white`,n===`rtl`&&`flex-row-reverse`),children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:b}),(0,Y.jsxs)(`div`,{className:P(`flex-1`,n===`rtl`?`pr-2`:`pl-2`,i?`mt-[-2px]`:`mt-[1px]`),onClick:()=>!u&&p(!f),children:[t,i&&(0,Y.jsx)(`div`,{className:`text-sm ${a?`text-red`:`text-grey-700`}`,children:i})]})]}));let x=l.find(e=>e.value===m);return(0,Y.jsxs)(`div`,{className:`flex-col`,"data-testid":e,onClick:e=>e.stopPropagation(),children:[b,(u||f)&&(0,Y.jsx)(Kr,{clearButtonValue:s,eyedropper:o,hexValue:x?.hex||m||void 0,onChange:y})]})},Xr=({value:e,onChange:t,singleParagraph:n=!0,...r})=>{let i=(0,J.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,Y.jsx)(ae,{...r,singleParagraph:n,children:t=>(0,Y.jsx)(t.HtmlOutputPlugin,{html:e,setHtml:i})})},Zr=({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?``:P(`flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[var(--control-height)]`,a?`bg-transparent`:`bg-grey-100 px-3 dark:bg-grey-900`,n?`border-red`:`transition-all hover:bg-grey-100 has-[:focus]:border-green has-[:focus]:bg-white has-[:focus]:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:selection:bg-[rgba(88,101,116,0.99)] dark:hover:bg-grey-900 dark:has-[:focus]:bg-grey-950`,e&&!t&&!a&&`mt-2`,o);return(0,Y.jsxs)(`div`,{className:`flex flex-col ${s}`,children:[e&&(0,Y.jsx)(A,{className:t?`sr-only`:``,grey:!0,useLabelTag:!0,children:e}),(0,Y.jsx)(`div`,{className:d,children:(0,Y.jsx)(Xr,{...u,value:i})}),r&&(0,Y.jsx)(E,{className:c,color:n?`red`:``,children:r})]})},Qr=`Radio`,[$r,ei]=St(Qr),[ti,ni]=$r(Qr);function ri(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]=J.useState(null),[p,m]=J.useState(null),h={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,hasConsumerStoppedPropagationRef:J.useRef(!1),isFormControl:d?!!a||!!d.closest(`form`):!0,bubbleInput:p,setBubbleInput:m,onCheck:()=>s?.()};return(0,Y.jsx)(ti,{scope:t,...h,children:di(u)?u(h):r})}var ii=`RadioTrigger`,ai=J.forwardRef(({__scopeRadio:e,onClick:t,...n},r)=>{let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,hasConsumerStoppedPropagationRef:l,isFormControl:u,bubbleInput:d}=ni(ii,e),f=C(r,s);return(0,Y.jsx)(w.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":fi(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:bt(t,e=>{i||c(),d&&u&&(l.current=e.isPropagationStopped(),l.current||e.stopPropagation())})})});ai.displayName=ii;var oi=J.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i,required:a,disabled:o,value:s,onCheck:c,form:l,...u}=e;return(0,Y.jsx)(ri,{__scopeRadio:n,checked:i,disabled:o,required:a,onCheck:c,name:r,form:l,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ai,{...u,ref:t,__scopeRadio:n}),e&&(0,Y.jsx)(ui,{__scopeRadio:n})]})})});oi.displayName=Qr;var si=`RadioIndicator`,ci=J.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=ni(si,n);return(0,Y.jsx)(xt,{present:r||a.checked,children:(0,Y.jsx)(w.span,{"data-state":fi(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});ci.displayName=si;var li=`RadioBubbleInput`,ui=J.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}=ni(li,e),p=C(n,d),m=wt(i),h=Ct(r);J.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=J.useRef(i);return(0,Y.jsx)(w.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%)`}})});ui.displayName=li;function di(e){return typeof e==`function`}function fi(e){return e?`checked`:`unchecked`}var pi=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],mi=`RadioGroup`,[hi,gi]=St(mi,[Ln,ei]),_i=Ln(),vi=ei(),[yi,bi]=hi(mi),xi=J.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=_i(n),m=xn(l),[h,g]=yt({prop:a,defaultProp:i??null,onChange:d,caller:mi});return(0,Y.jsx)(yi,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,Y.jsx)(hn,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,Y.jsx)(w.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});xi.displayName=mi;var Si=`RadioGroupItem`,Ci=`RadioGroupItemProvider`,wi=`RadioGroupItemTrigger`,Ti=`RadioGroupItemBubbleInput`;function Ei(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=bi(Ci,t),s=vi(t),c=o.disabled||r;return(0,Y.jsx)(ri,{...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 Di=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e,i=_i(n),a=vi(n),{checked:o,disabled:s}=ni(wi,a.__scopeRadio),c=J.useRef(null),l=C(t,c),u=J.useRef(!1);return J.useEffect(()=>{let e=e=>{pi.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,Y.jsx)(Rn,{asChild:!0,...i,focusable:!s,active:o,children:(0,Y.jsx)(ai,{...a,...r,ref:l,onKeyDown:bt(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:bt(r.onFocus,()=>{u.current&&c.current?.click()})})})});Di.displayName=wi;var Oi=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,Y.jsx)(Ei,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Di,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,Y.jsx)(ki,{__scopeRadioGroup:n})]})})});Oi.displayName=Si;var ki=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Y.jsx)(ui,{...vi(n),...r,ref:t})});ki.displayName=Ti;var Ai=`RadioGroupIndicator`,ji=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Y.jsx)(ci,{...vi(n),...r,ref:t})});ji.displayName=Ai;var Mi=({id:e,title:t,options:n,onSelect:r,error:i,hint:a,selectedOption:o,separator:s})=>(0,Y.jsxs)(xi,{defaultValue:o,name:e,onValueChange:r,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 ${s&&`pb-2`}`,children:[t&&(0,Y.jsx)(A,{level:6,children:t}),n.map(e=>(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start ${t&&`mt-1 -mb-1`}`,htmlFor:e.value,children:[(0,Y.jsx)(Oi,{className:`relative float-left mt-[3px] size-4 min-w-[16px] appearance-none rounded-full border-2 border-solid border-grey-300 hover:cursor-pointer focus:shadow-none focus:ring-0 focus:outline-hidden data-[state=checked]:border-green data-[state=checked]:focus:border-green dark:border-grey-800 dark:text-white dark:data-[state=checked]:border-green dark:data-[state=checked]:focus:border-green`,id:e.value,value:e.value,children:(0,Y.jsx)(ji,{className:`flex size-full items-center justify-center after:block after:size-[6px] after:rounded-full after:border-green after:bg-green after:content-[''] dark:after:border-green dark:after:bg-green`})}),(0,Y.jsxs)(`div`,{className:`ml-2 flex flex-col ${e.hint&&`mb-2`}`,children:[(0,Y.jsx)(`span`,{className:`inline-block text-md dark:text-white ${e.hint&&`-mb-1`}`,children:e.label}),e.hint&&(0,Y.jsx)(E,{children:e.hint})]})]},e.value)),a&&(0,Y.jsx)(E,{color:i?`red`:``,children:a})]}),(s||i)&&(0,Y.jsx)(D,{className:i?`border-red`:``})]}),Ni=({children:e,gap:t=`md`,className:n})=>{let r=`gap-3`;switch(t){case`sm`:r=`gap-2`;break;case`md`:r=`gap-3`;break;case`lg`:r=`gap-4`;break;default:break}return n=P(`flex flex-col`,r,n),(0,Y.jsx)(`div`,{className:n,children:e})},Pi=({heading:e,children:t,className:n})=>(n=P(`w-full p-[8vmin] pt-5`,n),(0,Y.jsxs)(`div`,{className:n,children:[e&&(0,Y.jsx)(A,{className:`mb-8`,children:e}),t]})),Fi=({items:e,backIcon:t=!1,snapBackIcon:n=!0,onBack:r,containerClassName:i,itemClassName:a,activeItemClassName:o,separatorClassName:s})=>{let c=e.length,l=0;return i=P(`flex items-center gap-2`,i),o=P(`font-bold`,o),a=P(a),(0,Y.jsxs)(`div`,{className:i,children:[t&&(0,Y.jsx)(q,{className:n?`mr-1`:`mr-6`,icon:`arrow-left`,iconColorClass:`dark:text-white`,size:`sm`,link:!0,onClick:r}),e.map(e=>{let t=l===c-1?(0,Y.jsx)(`span`,{className:o,children:e.label}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{className:`${a} ${e.onClick&&`-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900`}`,type:`button`,onClick:e.onClick,children:e.label},`bc-${l}`),(0,Y.jsx)(`span`,{className:s,children:`/`})]});return l+=1,t})]})},Ii=({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`,okColor:d=`black`,previewToolbar:p=!0,leftToolbar:m=!0,rightToolbar:h=!0,deviceSelector:g=!0,siteLink:_,previewToolbarURLs:v,previewBgColor:y=`grey`,selectedURL:b,previewToolbarTabs:x,previewToolbarBreadcrumbs:S,buttonsDisabled:C,sidebarButtons:w,sidebarHeader:E,sidebarPadding:D=!0,sidebarContentClasses:O,enableCMDS:k=!0,backDropClick:j,onCancel:M,onOk:F,afterClose:I,onSelectURL:R,onSelectDesktopView:z,onSelectMobileView:B,onBreadcrumbsBack:ee})=>{let V=N(),{setGlobalDirtyState:te}=T();(0,J.useEffect)(()=>{te(c)},[c,te]),(0,J.useEffect)(()=>{if(F){let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),F())};if(k)return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}}});let[ne,H]=(0,J.useState)(`desktop`);if(ne===`mobile`&&g?s=(0,Y.jsx)(ar,{"data-testid":`preview-mobile`,children:s}):ne===`desktop`&&g&&(s=(0,Y.jsx)(ir,{"data-testid":`preview-desktop`,children:s})),p){let e=(0,Y.jsx)(Y.Fragment,{});v?e=(0,Y.jsx)(Te,{options:v,selectedOption:v.find(e=>e.value===b),onSelect:e=>e&&R?.(e.value)}):x?e=(0,Y.jsx)(Xe,{border:!1,selectedTab:b,tabs:x,width:`wide`,onTabChange:R}):S&&(e=(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:!block md:!visible`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:!block md:!visible`,items:S,separatorClassName:`hidden md:!block md:!visible`,backIcon:!0,onBack:ee}));let t=`text-black dark:text-green`,n=`text-grey-500 dark:text-grey-600`,r=g&&(0,Y.jsx)(re,{buttons:[{icon:`laptop`,label:`Desktop`,hideLabel:!0,link:!0,size:`sm`,iconColorClass:ne===`desktop`?t:n,onClick:z||(()=>{H(`desktop`)})},{icon:`mobile`,label:`Mobile`,hideLabel:!0,link:!0,size:`sm`,iconColorClass:ne===`mobile`?t:n,onClick:B||(()=>{H(`mobile`)})}]}),i=``;y===`grey`?i=`bg-grey-50 dark:bg-black`:y===`greygradient`&&(i=`bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black`);let a=P(`absolute inset-y-0 right-[400px] left-0 flex w-full min-w-100 grow flex-col overflow-y-auto`,i),o;_&&(o=(0,Y.jsx)(`div`,{className:`ml-3 border-l border-grey-400 dark:border-grey-800`,children:(0,Y.jsxs)(`a`,{className:`ml-3 flex items-center gap-1`,href:_,rel:`noopener noreferrer`,target:`_blank`,children:[`View site `,(0,Y.jsx)(f,{name:`arrow-top-right`,size:`xs`})]})})),s=(0,Y.jsxs)(`div`,{className:a,children:[p&&(0,Y.jsxs)(`header`,{className:`relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5`,"data-testid":`design-toolbar`,children:[m&&(0,Y.jsx)(`div`,{className:`absolute left-8 flex h-full items-center`,children:e}),h&&(0,Y.jsxs)(`div`,{className:`absolute right-8 flex h-full items-center`,children:[r,o]})]}),(0,Y.jsx)(`div`,{className:`flex grow items-center justify-center text-grey-400`,children:s})]})}let ie=[];return w||(ie.push({key:`cancel-modal`,label:l,onClick:M||(()=>{qe(c,()=>{V.remove(),I?.()})}),disabled:C}),ie.push({key:`ok-modal`,label:u,color:d,onClick:F,disabled:C})),(0,Y.jsx)(L,{afterClose:I,animate:!1,backDropClick:j,dirty:c,footer:!1,height:a,padding:!1,size:r,testId:e,title:``,width:i,hideXOnMobile:!0,children:(0,Y.jsxs)(`div`,{className:`flex h-full grow`,children:[(0,Y.jsx)(`div`,{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${y===`grey`?`bg-grey-50`:`bg-white dark:bg-black`}`,children:s}),o&&(0,Y.jsxs)(`div`,{className:`relative flex size-full flex-col border-l border-grey-100 dark:border-grey-900 [@media(min-width:801px)]:w-auto [@media(min-width:801px)]:basis-[400px]`,children:[E||(0,Y.jsxs)(`div`,{className:`flex max-h-[82px] items-center justify-between gap-3 px-7 py-6`,children:[(0,Y.jsx)(A,{level:n,children:t}),w||(0,Y.jsx)(re,{buttons:ie})]}),(0,Y.jsx)(`div`,{className:`${E?``:`absolute inset-x-0 top-[80px] bottom-0 grow`} ${D&&`p-7 pt-0`} flex flex-col justify-between overflow-y-auto ${O&&O}`,children:o})]})]})})};O.create(Ii);var Li=({offset:e,onTrigger:t})=>{let n=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0].intersectionRatio<=0||t()});return n.current&&e.observe(n.current),()=>e.disconnect()},[t]),(0,Y.jsx)(`div`,{ref:n,className:`absolute w-full`,style:{bottom:e}})},Ri=({className:e,children:t,colSpan:n,sticky:r=!1,...i})=>(0,Y.jsx)(`th`,{className:P(`pr-6! pl-0! text-left align-top`,r&&`sticky top-0 bg-white`,i.onClick&&`hover:cursor-pointer`,e),colSpan:n,...i,children:(0,Y.jsx)(A,{className:`whitespace-nowrap`,level:6,children:t})}),zi=({left:e,center:t,right:n,sticky:r=!0,containerClassName:i,children:a})=>{let o=P(`z-50 h-22 min-h-[92px] p-8`,!a&&`flex items-center justify-between gap-3`,r&&`sticky top-0`,i);return a||(e&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center`,n&&t&&`basis-1/3`,!n&&t&&`basis-1/2`),children:e}),t&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center justify-center`,e&&n&&`basis-1/3`,(e&&!n||!e&&n)&&`basis-1/2`),children:t}),n&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center justify-end`,e&&t&&`basis-1/3`,!e&&t&&`basis-1/2`),children:n})),(0,Y.jsx)(`div`,{className:o,children:a||(0,Y.jsxs)(Y.Fragment,{children:[e,t,n]})})},Bi=n(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Vi=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}})),Hi=n(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Vi(),a=Bi();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*$`)})),Ui=n(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Wi=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)}})),Gi=n(((e,t)=>{var n=Bi(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Vi(),{safeRe:a,t:o}=Hi(),s=Ui(),{compareIdentifiers:c}=Wi(),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}}})),Ki=t(n(((e,t)=>{var n=Gi();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 qi(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,Ki.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 Ji(e,t){let n=!!e.match?.(/production/i);return!!(n&&t!==`mysql8`||!n&&t===`mysql5`)}function Yi({label:e,version:t}){let n=qi(t);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`strong`,{children:[e,`:`]}),` `,n?(0,Y.jsx)(`a`,{className:`text-green`,href:n,rel:`noopener noreferrer`,target:`_blank`,children:t}):t]})}var Xi=O.create(()=>{let{updateRoute:e}=W(),t=K().config,n=Oe();function r(){return new Date().getFullYear()}function i(){return!!t.enableDeveloperExperiments}function a(){return!t.hostSettings?.siteId}return(0,Y.jsx)(L,{afterClose:()=>{e(``)},cancelLabel:``,footer:(0,Y.jsx)(Y.Fragment,{}),topRightContent:`close`,width:540,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 pb-7`,children:[(0,Y.jsx)(rt,{className:`h-auto w-[120px] dark:invert`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[n?.message&&(0,Y.jsxs)(`div`,{className:`gh-prose-links mb-4 rounded-sm border border-green p-5`,children:[(0,Y.jsx)(`strong`,{children:`Update available!`}),(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:n.message}})]}),(0,Y.jsx)(Yi,{label:`Version`,version:t.version}),a()&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Environment:`}),` `,t.environment]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Database:`}),` `,t.database]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Mail:`}),` `,t.mail?t.mail:`Native`]})]}),i()&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Developer experiments:`}),` Enabled`]}),a()&&Ji(t.environment,t.database)&&(0,Y.jsxs)(`div`,{className:`text-red-500 dark:text-red-400`,children:[`You are running an unsupported database in production. Please `,(0,Y.jsx)(`a`,{href:`https://ghost.org/docs/faq/supported-databases/`,rel:`noopener noreferrer`,target:`_blank`,children:`upgrade to MySQL 8`}),`.`]})]}),(0,Y.jsx)(D,{}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.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,Y.jsx)(f,{name:`book-open`,size:`sm`}),` User documentation`]}),(0,Y.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,Y.jsx)(f,{name:`question-circle`,size:`sm`}),` Get help with Ghost`]}),(0,Y.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,Y.jsx)(f,{name:`angle-brackets`,size:`sm`}),` Get involved`]})]}),(0,Y.jsx)(D,{}),(0,Y.jsxs)(`p`,{className:`max-w-[460px] text-sm`,children:[`Copyright © 2013 – `,r(),` Ghost Foundation, released under the `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://github.com/TryGhost/Ghost/blob/main/LICENSE`,rel:`noopener noreferrer`,target:`_blank`,children:`MIT license`}),`. `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost`}),` is a registered trademark of `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/trademark/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Foundation Ltd`}),`.`]})]})})}),Zi=O.create(()=>{let e=N(),{updateRoute:t}=W(),[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)({name:``}),{mutateAsync:o}=Le(),s=ve(),c=g();return(0,J.useEffect)(()=>{s?.isLimited(`customIntegrations`)&&s.errorIfWouldGoOverLimit(`customIntegrations`).catch(n=>{n instanceof de&&(O.show(he,{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,Y.jsx)(L,{afterClose:()=>{t(`integrations`)},okColor:`black`,okLabel:`Add`,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,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsx)(U,{marginBottom:!1,marginTop:!1,children:(0,Y.jsx)(I,{autoFocus:!0,error:!!i.name,hint:i.name,maxLength:191,placeholder:`Custom integration`,title:`Name`,value:n,onChange:e=>r(e.target.value),onInput:()=>{i.name&&a({name:``})}})})})})}),Qi=O.create(()=>{let e=N(),{updateRoute:t}=W(),n=ce(`automations`)?`emails`:`newsletters`,r=g(),[i,a]=(0,J.useState)(!0),[o,s]=(0,J.useState)(null),{data:c}=qn({searchParams:{filter:`newsletters.status:active+email_disabled:0`,limit:`1`,page:`1`,include:`newsletters,labels`}}),{mutateAsync:l}=Qn(),{formState:u,updateForm:d,saveState:f,handleSave:p,errors:m,clearError:h}=jt({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}}),_=ve();(0,J.useEffect)(()=>{if(!_){a(!1);return}_.errorIfWouldGoOverLimit(`newsletters`).catch(e=>{if(e instanceof de)s(e);else throw e}).finally(()=>{a(!1)})},[_]);let v=c?.meta?.pagination.total;return(0,J.useEffect)(()=>{o&&(O.show(he,{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,Y.jsx)(L,{afterClose:()=>{t(n)},backDropClick:!1,okColor:`black`,okDisabled:f===`saving`,okLabel:`Create`,okLoading:f===`saving`,size:`sm`,testId:`add-newsletter-modal`,title:`Create newsletter`,onOk:async()=>{await p()&&e.remove()},children:(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!0,children:[(0,Y.jsx)(I,{autoFocus:!0,error:!!m.name,hint:m.name,maxLength:191,placeholder:`Weekly roundup`,title:`Name`,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),onKeyDown:()=>h(`name`)}),(0,Y.jsx)(z,{maxLength:2e3,title:`Description`,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value}))}),(0,Y.jsx)(vt,{checked:u.optInExistingSubscribers,direction:`rtl`,hint:u.optInExistingSubscribers?`This newsletter will be available to all members. Your ${v===void 0?``:H(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.`,label:`Opt-in existing subscribers`,labelStyle:`heading`,onChange:e=>d(t=>({...t,optInExistingSubscribers:e.target.checked}))})]})})}),$i=O.create(()=>{let e=O.useModal(),{updateRoute:t}=W(),{data:{integrations:n}={integrations:[]}}=F(),r=n.find(({slug:e})=>e===`ghost-core-content`)?.api_keys?.find(e=>e.type===`content`);return(0,Y.jsxs)(L,{afterClose:()=>{t(`integrations`)},cancelLabel:``,footer:(0,Y.jsxs)(`div`,{className:`mx-8 flex w-full items-center justify-between`,children:[(0,Y.jsx)(q,{color:`outline`,href:`https://ghost.org/docs/content-api/`,label:(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Open docs `,(0,Y.jsx)(f,{name:`arrow-top-right`,size:`xs`})]}),rel:`noopener noreferrer`,tag:`a`,target:`_blank`}),(0,Y.jsx)(q,{color:`black`,label:`Close`,onClick:()=>{t(`integrations`),e.remove()}})]}),testId:`content-api-modal`,title:``,stickyFooter:!0,children:[(0,Y.jsx)(it,{detail:`Access your content programmatically`,icon:(0,Y.jsx)(f,{name:`angle-brackets`,size:56}),title:`Content API`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[(0,Y.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,Y.jsx)(Ge,{keys:[{label:`Content API key`,text:r?.secret},{label:`API URL`,text:window.location.origin+d().subdir}]})]})]})}),ea=O.create(({recommendation:e,animate:t})=>{let n=N(),{updateRoute:r,route:i}=W(),{mutateAsync:a}=te(),o=g(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:d,clearError:f,setErrors:h}=jt({initialState:{...e},onSave:async e=>{await a(e),n.remove(),p({title:`Recommendation added`,type:`success`}),B(`Recommendation Added`,{oneClickSubscribe:e.one_click_subscribe}),r(`recommendations`)},onSaveError:o,onValidate:e=>xe(e)}),_=`Add`,v=!1;return u===`saving`?v=!0:u===`saved`&&(_=`Added`),(0,Y.jsx)(L,{afterClose:()=>{r(`recommendations`)},animate:t??!0,backDropClick:!1,cancelLabel:`Cancel`,dirty:!0,leftButtonProps:{label:`Back`,icon:`arrow-left`,iconColorClass:`text-black dark:text-white`,link:!0,size:`sm`,onClick:()=>{u!==`saving`&&(n.remove(),O.show(ra,{pathName:i,animate:!1,recommendation:{...s}}))}},okColor:`black`,okLabel:_,okLoading:v,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,stickyFooter:!0,onCancel:()=>{u!==`saving`&&(n.remove(),r(`recommendations`))},onOk:async()=>{if(u!==`saving`){m();try{await l({force:!0})}catch{p({type:`error`,title:`Something went wrong when adding this recommendation, please try again.`})}}},children:(0,Y.jsx)(dt,{clearError:f,errors:d,formState:s,setErrors:h,showURL:!1,updateForm:c})})}),ta=e=>ye(e).save||``,na=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},ra=O.create(({searchParams:e,recommendation:t,animate:n})=>{let[r,i]=(0,J.useState)(!1),a=N(),{updateRoute:o}=W(),{mutateAsync:s}=G(),c=t?``:e?.get(`url`)??``,{save:l}=c?ye(c):{save:``},d=J.useRef(!1),[f,h]=J.useState(!!l),{formState:g,updateForm:_,handleSave:v,errors:y,saveState:b,clearError:x}=jt({initialState:t??{title:``,url:l||``,description:``,excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let e=new URL(g.url),t=e.hostname.replace(`www.`,``),n={...g,url:e.toString()},{recommendations:r=[]}=await s(e);if(!r||r.length===0)return;let i=r[0];if(i.id)throw new u(`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(),O.show(ea,{animate:!1,recommendation:n})},onValidate:()=>{let e={};return na(e,g.url),f&&h(Object.keys(e).length===0),e}}),S=J.useCallback(async()=>{if(b!==`saving`){m();try{if(await v({force:!0}))return}catch(e){p({type:`error`,title:e instanceof u?e.message:`Something went wrong while checking this URL, please try again.`})}f&&h(!1)}},[v,b,f,h]);return J.useEffect(()=>{f&&!d.current&&(d.current=!0,S())},[f,S]),(0,J.useEffect)(()=>{r&&(S(),i(!1))},[g]),f?(0,Y.jsx)(L,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,footer:!1,header:!1,size:`sm`,children:(0,Y.jsx)(`div`,{className:`flex flex-col items-center justify-center p-8`,children:(0,Y.jsx)(Fe,{})})}):(0,Y.jsxs)(L,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,okColor:`black`,okLabel:`Next`,okLoading:b===`saving`,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,onOk:S,children:[(0,Y.jsxs)(`p`,{className:`mt-4`,children:[`You can recommend `,(0,Y.jsx)(`strong`,{children:`any site`}),` your audience will find valuable, not just those published on Ghost.`]}),(0,Y.jsx)(U,{marginBottom:!1,marginTop:!0,children:(0,Y.jsx)(I,{autoFocus:!0,error:!!y.url,hint:y.url||(0,Y.jsxs)(Y.Fragment,{children:[`Need inspiration? `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://www.ghost.org/explore`,rel:`noopener noreferrer`,target:`_blank`,children:`Explore thousands of sites`}),` to recommend`]}),maxLength:2e3,placeholder:`https://www.example.com`,title:`URL`,value:g.url,onBlur:()=>{let e=ta(g.url);_(t=>({...t,url:e}))},onChange:e=>{x?.(`url`),_(t=>({...t,url:e.target.value}))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_(e=>({...e,url:ta(g.url)})),i(!0))}})})]})});function ia(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),e(...r)},t)}}var aa=({generateContent:e,className:t,height:n,width:r,parentClassName:i,testId:o,addDelay:s=!1})=>{let[c,l]=(0,J.useState)(0),u=[(0,J.useRef)(null),(0,J.useRef)(null)],[d,f]=(0,J.useState)(0);return(0,J.useEffect)(()=>{let t=+(c===0),n=u[t].current;if(n){e(n);let r=()=>{s?setTimeout(()=>{l(t)},500):l(t)};return n.addEventListener(`load`,r),()=>{n.removeEventListener(`load`,r)}}},[e]),(0,J.useEffect)(()=>{let e=u[c].current,t=ia(()=>{f(e?.contentWindow?.scrollY||0)},250);return e?.contentWindow?.addEventListener(`scroll`,t),()=>{e?.contentWindow?.removeEventListener(`scroll`,t)}},[c,u]),(0,J.useEffect)(()=>{let e=u[c].current;if(e)try{e.contentWindow?.scrollTo(0,d)}catch(e){a(e)}},[d,c,u]),(0,Y.jsxs)(`div`,{className:i,"data-testid":o,children:[(0,Y.jsx)(`iframe`,{ref:u[0],className:`${t} ${c===0?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===0,frameBorder:`0`,height:n,title:`Buffered Preview 1`,width:r}),(0,Y.jsx)(`iframe`,{ref:u[1],className:`${t} ${c===1?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===1,frameBorder:`0`,height:n,title:`Buffered Preview 2`,width:r})]})},oa=(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()},sa=({announcementBackgroundColor:e,announcementContent:t,url:n,visibility:r})=>{let i=(0,J.useMemo)(()=>r,[r?.join(`,`)]);return(0,Y.jsx)(aa,{addDelay:!0,className:`absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]`,generateContent:(0,J.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":oa(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`,testId:`announcement-bar-preview-iframe`,width:`100%`})},ca=({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,Y.jsxs)(U,{children:[(0,Y.jsx)(Zr,{nodes:`MINIMAL_NODES`,placeholder:`Highlight breaking news, offers or updates`,title:`Announcement`,value:e,onBlur:c,onChange:t}),(0,Y.jsx)(cr,{isExpanded:!1,picker:!1,swatches:[{hex:`#08090c`,title:`Dark`,value:`dark`},{hex:`#ffffff`,title:`Light`,value:`light`},{hex:n||`#ffdd00`,title:`Accent`,value:`accent`}],swatchSize:`lg`,title:`Background color`,value:r,onSwatchChange:e=>{e!==null&&i(e)},onTogglePicker:()=>{}}),(0,Y.jsx)(sr,{checkboxes:l,title:`Visibility`})]})},la=O.create(()=>{let{siteData:e}=K(),{localSettings:t,updateSetting:n,handleSave:r,okProps:i}=be({savingDelay:500}),[a]=Fn(t,[`announcement_content`]),[o]=Fn(t,[`accent_color`]),[s]=Fn(t,[`announcement_background`]),[c]=Fn(t,[`announcement_visibility`]),[l]=Fn(t,[`paid_members_enabled`]),u=JSON.parse(c?.toString()||`[]`),{updateRoute:d}=W(),[f,m]=(0,J.useState)(`homepage`),h=e=>{n(`announcement_background`,e)},g=(e,t)=>{let r=u.indexOf(e);r===-1&&t?u.push(e):u.splice(r,1),n(`announcement_visibility`,JSON.stringify(u))},_=(0,J.useRef)(Ie(e=>{n(`announcement_content`,e)},500)),v=(0,Y.jsx)(ca,{accentColor:o,announcementBackgroundColor:s,announcementContent:a,announcementTextHandler:e=>{_.current(e)},paidMembersEnabled:l,toggleColorSwatch:h,toggleVisibility:g,visibility:c,onBlur:()=>{}}),{data:{posts:[y]}={posts:[]}}=Rt({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),b=[];y&&(b=[{id:`homepage`,title:`Homepage`},{id:`post`,title:`Post`}]);let x=e=>{b.length&&m(e)},S=jn(e);switch(f){case`homepage`:S=jn(e);break;case`post`:S=y.url;break}let C=(0,Y.jsx)(sa,{announcementBackgroundColor:s,announcementContent:a,url:S,visibility:u});return(0,Y.jsx)(Ii,{afterClose:()=>{d(`announcement-bar`)},buttonsDisabled:i.disabled,cancelLabel:`Close`,deviceSelector:!0,dirty:!1,okColor:i.color,okLabel:i.label||`Save`,preview:C,previewBgColor:`greygradient`,previewToolbarTabs:b,selectedURL:f,sidebar:v,testId:`announcement-bar-modal`,title:`Announcement`,titleHeadingLevel:5,onOk:async()=>{await r({fakeWhenUnchanged:!0})||p({type:`error`,message:`An error occurred while saving your changes. Please try again.`})},onSelectURL:x})}),ua=t(At(),1),da=[{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`}]}],fa=e=>da.flatMap(({options:e})=>e).find(t=>t.value===e)?.label,pa=h({method:`POST`,path:()=>`/webhooks/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:_e,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})}}}),ma=h({method:`PUT`,path:e=>`/webhooks/${e.id}/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:_e,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)}))}}}),ha=h({method:`DELETE`,path:e=>`/webhooks/${e}/`,updateQueries:{dataType:_e,emberUpdateType:`createOrUpdate`,update:(e,t,n)=>({...t,integrations:t.integrations.map(e=>({...e,webhooks:e.webhooks?.filter(e=>e.id!==n)}))})}}),ga=O.create(({webhook:e,integrationId:t})=>{let n=N(),{mutateAsync:r}=pa(),{mutateAsync:i}=ma(),a=g(),{formState:o,updateForm:s,handleSave:c,errors:l,clearError:u}=jt({initialState:e||{},onSave:async()=>{o.id?await i(o):await r({...o,integration_id:t})},onSaveError:a,onValidate:()=>{let e={};return o.name||(e.name=`Enter a name`),o.event||(e.event=`Select an event`),o.target_url||(e.target_url=`Enter a target URL`),o.target_url&&!ua.default.isURL(o.target_url,{require_tld:!1})&&(e.target_url=`Enter a valid URL`),e}});return(0,Y.jsx)(L,{okColor:`black`,okLabel:e?`Update`:`Add`,size:`sm`,testId:`webhook-modal`,title:`Add webhook`,formSheet:!0,onOk:async()=>{await c()&&n.remove()},children:(0,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!1,children:[(0,Y.jsx)(I,{error:!!l.name,hint:l.name,maxLength:191,placeholder:`Custom webhook`,title:`Name`,value:o.name,onChange:e=>s(t=>({...t,name:e.target.value})),onKeyDown:()=>u(`name`)}),(0,Y.jsx)(Te,{error:!!l.event,hint:l.event,options:da,prompt:`Select an event`,selectedOption:da.flatMap(e=>e.options).find(e=>e.value===o.event),testId:`event-select`,title:`Event`,hideTitle:!0,onSelect:e=>{s(t=>({...t,event:e?.value})),u(`event`)}}),(0,Y.jsx)(I,{error:!!l.target_url,hint:l.target_url,maxLength:2e3,placeholder:`https://example.com`,title:`Target URL`,type:`url`,value:o.target_url,onChange:e=>s(t=>({...t,target_url:e.target.value})),onKeyDown:()=>u(`target_url`)}),(0,Y.jsx)(I,{maxLength:191,placeholder:`https://example.com`,title:`Secret`,value:o.secret||void 0,onChange:e=>s(t=>({...t,secret:e.target.value}))})]})})})}),_a=({integration:e})=>{let{mutateAsync:t}=ha(),n=g(),r=e=>{O.show(me,{title:`Are you sure?`,prompt:`Deleting this webhook may prevent the integration from functioning.`,okColor:`red`,okLabel:`Delete Webhook`,onOk:async r=>{try{await t(e),r?.remove(),p({message:`Webhook deleted`,type:`info`})}catch(e){n(e)}}})};return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(gt,{children:[(0,Y.jsxs)(ot,{bgOnHover:!1,children:[(0,Y.jsxs)(Ri,{children:[e.webhooks?.length||0,` `,e.webhooks?.length===1?`webhook`:`webhooks`]}),(0,Y.jsx)(Ri,{children:`Last triggered`})]}),e.webhooks?.map(t=>(0,Y.jsxs)(ot,{action:(0,Y.jsx)(q,{color:`red`,label:`Delete`,link:!0,onClick:e=>{e?.stopPropagation(),r(t.id)}}),bgOnHover:!1,hideActions:!0,onClick:()=>{O.show(ga,{webhook:t,integrationId:e.id})},children:[(0,Y.jsxs)(ut,{className:`w-3/4`,children:[(0,Y.jsx)(`div`,{className:`font-semibold`,children:t.name}),(0,Y.jsxs)(`div`,{className:`mt-1 grid grid-cols-[max-content_1fr] gap-1 text-sm leading-snug`,children:[(0,Y.jsx)(`span`,{className:`text-grey-600`,children:`Event:`}),(0,Y.jsx)(`span`,{children:fa(t.event)}),(0,Y.jsx)(`span`,{className:`text-grey-600`,children:`URL:`}),(0,Y.jsx)(`span`,{className:`line-clamp-3 break-all`,title:t.target_url,children:t.target_url})]})]}),(0,Y.jsx)(ut,{className:`w-1/4 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`})})]},t.id))]}),(0,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsx)(q,{color:`green`,icon:`add`,iconColorClass:`text-green`,label:`Add webhook`,size:`sm`,link:!0,onClick:()=>{O.show(ga,{integrationId:e.id})}})})]})},va=({integration:e})=>{let t=N(),{updateRoute:n}=W(),{mutateAsync:r}=et(),{mutateAsync:i}=ke(),{mutateAsync:a}=pt(),o=g(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:f,clearError:p,okProps:m}=jt({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}}),h=e.api_keys?.find(e=>e.type===`admin`),_=e.api_keys?.find(e=>e.type===`content`),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(!1);(0,J.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`;O.show(me,{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,Y.jsxs)(L,{afterClose:()=>{n(`integrations`)},buttonsDisabled:m.disabled,cancelLabel:`Close`,dirty:u===`unsaved`,okColor:m.color,okLabel:m.label||`Save`,size:`md`,testId:`custom-integration-modal`,title:s.name||`Custom integration`,stickyFooter:!0,onOk:async()=>{await l({fakeWhenUnchanged:!0})},children:[(0,Y.jsxs)(`div`,{className:`mt-7 flex w-full flex-col gap-7 md:flex-row`,children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{height:`100px`,id:`custom-integration-icon`,imageURL:s.icon_image||void 0,width:`100px`,onDelete:()=>c(e=>({...e,icon_image:null})),onUpload:async e=>{try{let t=Ne(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,Y.jsx)(`div`,{className:`flex grow flex-col`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(I,{error:!!f.name,hint:f.name,maxLength:191,title:`Title`,value:s.name,onChange:e=>c(t=>({...t,name:e.target.value})),onKeyDown:()=>p(`name`)}),(0,Y.jsx)(I,{maxLength:2e3,title:`Description`,value:s.description||``,onChange:e=>c(t=>({...t,description:e.target.value}))}),(0,Y.jsx)(Ge,{keys:[{label:`Content API key`,text:_?.secret,hint:b?(0,Y.jsx)(`div`,{className:`text-green`,children:`Content API Key was successfully regenerated`}):void 0,onRegenerate:()=>_&&S(_,x)},{label:`Admin API key`,text:h?.secret,hint:v?(0,Y.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>h&&S(h,y)},{label:`API URL`,text:window.location.origin+d().subdir}]})]})})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(_a,{integration:e})})]})},ya=O.create(({params:e})=>{let{data:{integrations:t}={}}=F(),n=t?.find(({id:t})=>t===e?.id);return n?(0,Y.jsx)(va,{integration:n}):null});function ba(e){return typeof e==`object`&&!!e}function xa(e){return[...e.errors||[],...e.warnings||[]]}function Sa(e=[]){let t=[],n=[],r=[];return e.forEach(e=>{ba(e.details)?xa(e.details).forEach(e=>{e.fatal?t.push(e):n.push(e)}):r.push(e.details)}),{blockingProblems:t,secondaryProblems:n,stringErrors:r}}function Ca(e){return[...e.errors||[],...e.warnings||[]]}function wa(e){return e.level===`warning`?`Warning`:e.level===`recommendation`?`Recommendation`:`Error`}function Ta(e){return e.level===`warning`?`warning`:e.level===`recommendation`?`secondary`:`destructive`}function Ea(e){return`${e} non-blocking ${e===1?`issue`:`issues`}`}function Da({problem:e}){return(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.details},className:`text-sm text-muted-foreground`}),e.failures?.length>0&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h6`,{className:`mb-1 text-xs font-semibold text-muted-foreground uppercase`,children:`Affected files`}),(0,Y.jsx)(`ul`,{className:`space-y-1 text-sm text-muted-foreground`,children:e.failures.map(e=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-xs text-foreground`,children:e.ref}),e.message?(0,Y.jsxs)(`span`,{children:[`: `,e.message]}):null]},`${e.ref}-${e.message||``}`))})]})]})}function Oa({problem:e,prominent:t=!1}){let[n,r]=(0,J.useState)(t),i=wa(e);return(0,Y.jsxs)(`div`,{className:`rounded-lg border ${t?`border-destructive/30 bg-background`:`border-border bg-background`} p-4`,children:[(0,Y.jsxs)(`button`,{className:`flex w-full items-start justify-between gap-3 text-left`,type:`button`,onClick:()=>r(!n),children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,Y.jsx)(Cn,{variant:Ta(e),children:i}),e.code&&(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.code})]}),(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.rule},className:`text-sm font-medium text-foreground`})]}),(0,Y.jsx)(Zt,{className:`mt-1 size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Y.jsx)(`div`,{className:`mt-4 border-t border-border pt-4`,children:(0,Y.jsx)(Da,{problem:e})})]})}function ka({defaultOpen:e,problems:t}){let[n,r]=(0,J.useState)(e),i=t.length;(0,J.useEffect)(()=>{r(e)},[e]);let a=(0,J.useMemo)(()=>[...t].sort((e,t)=>{let n={Error:0,Warning:1,Recommendation:2};return n[wa(e)]-n[wa(t)]}),[t]);return i?(0,Y.jsxs)(`div`,{className:`mt-6 border-t border-border pt-5`,children:[(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`text-sm font-semibold text-foreground`,children:[`Review `,Ea(i)]}),(0,Y.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:n?`Hide details`:`Show details`})]}),(0,Y.jsx)(Zt,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Y.jsx)(`div`,{className:`mt-4 space-y-3`,children:a.map(e=>(0,Y.jsx)(Oa,{problem:e},e.code))})]}):null}function Aa({message:e}){return(0,Y.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(tn,{className:`mt-0.5 size-4 shrink-0`}),(0,Y.jsx)(`p`,{children:e})]})})}function ja({children:e,title:t,variant:n}){let r=n===`success`?en:tn;return(0,Y.jsx)(Sn,{role:n===`destructive`?`alert`:`status`,size:`lg`,variant:n===`success`?`success`:`destructive`,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.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,Y.jsx)(r,{className:`size-5 ${n===`success`?`text-state-success`:`text-destructive`}`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-xl font-semibold tracking-tight ${n===`success`?`text-state-success`:`text-destructive`}`,children:t}),(0,Y.jsx)(`div`,{className:`mt-1 text-sm text-foreground`,children:e})]})]})})}var Ma=O.create(({title:e,prompt:t,fatalErrors:n,validationDetailsDefaultOpen:r,onRetry:i})=>{let{data:a}=Vn(),o=r??a?.config?.environment===`development`,{blockingProblems:s,secondaryProblems:c,stringErrors:l}=Sa(n),u=s.length+l.length;return(0,Y.jsx)(Je,{cancelLabel:`Close`,okColor:`black`,okLabel:`Retry`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`div`,{className:`space-y-5`,children:[(0,Y.jsx)(`div`,{className:`text-sm text-foreground`,children:t??(0,Y.jsxs)(Y.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,Y.jsxs)(`div`,{className:`space-y-3`,children:[s.map(e=>(0,Y.jsx)(Oa,{problem:e,prominent:!0},e.code)),l.map(e=>(0,Y.jsx)(Aa,{message:e},e))]}),(0,Y.jsx)(ka,{defaultOpen:o,problems:c})]})}),stickyFooter:!0,title:e,onOk:i})}),Na=()=>{let e=Dn();return{supportsCustomFonts:!(e.data?.themes[0])?.warnings?.some(e=>e.code===`GS051-CUSTOM-FONTS`),refreshActiveThemeData:(0,J.useCallback)(()=>{e.refetch()},[e])}};function Pa(e){let t=e.package?.name||e.name;return gn(e)?t+=` (default)`:vn(e)?t+=` (legacy)`:e.package?.name!==e.name&&(t=(0,Y.jsxs)(`span`,{className:`md:text-base`,children:[t,` `,(0,Y.jsxs)(`span`,{className:`text-grey-600`,children:[`(`,e.name,`)`]})]})),wn(e)&&(t=(0,Y.jsxs)(`span`,{className:`font-bold md:text-base`,children:[t,` — `,(0,Y.jsx)(`span`,{className:`text-green`,children:` Active`})]})),t}function Fa(e){return e.package?.version||`1.0`}var Ia=({theme:e})=>{let{mutateAsync:t}=Tn(),{mutateAsync:n}=bn(),{refreshActiveThemeData:r}=Na(),i=g(),{route:a,updateRoute:o}=W(),{checkThemeLimitError:s}=ht(),l=async()=>{try{await t(e.name),r(),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme`]})})}catch(e){let t=null;e instanceof c&&e.response?.status===422&&e.data?.errors?t=e.data.errors:i(e);let n=(0,Y.jsx)(Y.Fragment,{children:`This theme couldn't be activated because Ghost found a blocking validation error. Fix the issue below and try again.`});t&&O.show(Ma,{title:`Theme not activated`,prompt:n,fatalErrors:t,onRetry:async e=>{e?.remove(),l()}})}},u=async()=>{let{apiRoot:t}=d();y(`${t}/themes/${e.name}/download`)},f=async()=>{O.show(me,{title:`Are you sure you want to delete this?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`You are about to delete `,(0,Y.jsxs)(`strong`,{children:[`"`,e.name,`".`]}),` This is permanent! We warned you, k? Maybe download`,` `,(0,Y.jsx)(`span`,{className:`cursor-pointer text-green-500`,onClick:()=>{u()},children:`your theme before continuing`})]}),okLabel:`Delete`,okRunningLabel:`Deleting`,okColor:`red`,onOk:async t=>{try{await n(e.name),t?.remove()}catch(e){i(e)}}})},m=async()=>{let t=await s(`.`);if(t){O.show(he,{prompt:t,onOk:()=>o({route:`/pro`,isExternal:!0})});return}o(`theme/edit/${encodeURIComponent(e.name)}?from=${encodeURIComponent(a??``)}`)},h=[];wn(e)||h.push((0,Y.jsx)(q,{className:`ml-2`,color:`green`,label:`Activate`,link:!0,onClick:l},`activate`));let _=[{id:`edit-code`,label:`Edit code`,onClick:m},{id:`download`,label:`Download`,onClick:u}];return En(e)&&_.push({id:`delete`,label:`Delete`,onClick:f}),(0,Y.jsxs)(`div`,{className:`-mr-3 flex items-center gap-4`,children:[h,(0,Y.jsx)(ft,{items:_,position:`end`,triggerButtonProps:{iconColorClass:`text-base`,size:`sm`}})]})},La=({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,Y.jsx)(ne,{pageTitle:`Installed themes`,children:e.map(e=>{let t=Pa(e),n=Fa(e);return(0,Y.jsx)(Se,{action:(0,Y.jsx)(Ia,{theme:e}),detail:n,id:`theme-${e.name}`,separator:!1,testId:`theme-list-item`,title:t},e.name)})})),Ra=({themes:e})=>(0,Y.jsx)(Pi,{children:(0,Y.jsx)(La,{themes:e})}),za=``+new URL(`footer-marketplace-bg-cXGt4GLt.png`,import.meta.url).href,Ba=3e3,Va=e=>e.variants&&e.variants.length>0,Ha=e=>{let t=[{category:e.category,previewUrl:e.previewUrl,image:e.image}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},Ua=({onSelectTheme:e})=>{let t=ue(),[n,r]=(0,J.useState)(null),[i,a]=(0,J.useState)(0),o=e=>{r(e),a(e!==null&&Va(e)&&Ha(e).length>1?1:0)};return(0,J.useEffect)(()=>{if(n===null)return;let e=setInterval(()=>{a((i+1)%(Ha(n).length||0))},Ba);return()=>clearInterval(e)},[n,i]),(0,Y.jsxs)(Pi,{heading:`Themes`,children:[(0,Y.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=Va(t),a=Ha(t),s=n===t;return(0,Y.jsxs)(`button`,{className:`flex cursor-pointer flex-col gap-3 text-left`,type:`button`,onClick:()=>{e?.(t)},children:[(0,Y.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,Y.jsx)(Y.Fragment,{children:a.map((e,n)=>(0,Y.jsx)(`img`,{alt:`${t.name} Theme - ${e.category}`,className:P(`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,Y.jsx)(`img`,{alt:`${t.name} Theme`,className:`size-full object-contain`,src:t.image})}),(0,Y.jsxs)(`div`,{className:`relative mt-3`,children:[(0,Y.jsx)(A,{level:4,children:t.name}),r?a.map((e,t)=>(0,Y.jsx)(`span`,{className:P(`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,Y.jsx)(`span`,{className:`text-grey-700`,children:t.category})]})]},t.name)})}),(0,Y.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(${za}) 100% 100% / 35vw no-repeat`},children:[`Find and buy third-party, premium themes from independent developers in the `,(0,Y.jsx)(`a`,{className:`inline-block font-semibold text-lime`,href:`https://ghost.org/themes/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Marketplace →`})]})]})},Wa=O.create(({title:e,installedTheme:t,validationDetailsDefaultOpen:n,onActivate:r})=>{let{mutateAsync:i}=Tn(),{refreshActiveThemeData:a}=Na(),o=g(),{data:s}=Vn(),{data:c}=zn(),l=n??s?.config?.environment===`development`,u=Ca(t),d=c?.site?jn(c.site):void 0,f=`Activate theme`;t.active&&(f=`OK`);let m=t.active?(0,Y.jsx)(`span`,{className:`text-green`,children:`It's live!`}):e,h=t.active?(0,Y.jsxs)(Y.Fragment,{children:[`Your theme `,(0,Y.jsx)(`strong`,{children:t.name}),` was saved successfully and is now visible to your readers.`,d?(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)(`a`,{className:`font-semibold text-black hover:underline dark:text-white`,href:d,rel:`noreferrer`,target:`_blank`,children:`Take a look →`})]}):null]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:t.name}),` has been uploaded. Activate it to make it live.`]});return(0,Y.jsx)(Je,{cancelLabel:`Close`,okColor:`black`,okLabel:f,okRunningLabel:`Activating...`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`div`,{className:`space-y-5`,children:[t.active?(0,Y.jsx)(`div`,{className:`space-y-2 text-sm text-foreground`,children:(0,Y.jsx)(`p`,{children:h})}):(0,Y.jsx)(ja,{title:`Uploaded successfully`,variant:`success`,children:(0,Y.jsx)(`div`,{className:`space-y-2`,children:(0,Y.jsx)(`p`,{children:h})})}),(0,Y.jsx)(ka,{defaultOpen:l,problems:u})]})}),stickyFooter:!0,title:m,onOk:async e=>{if(!t.active)try{let e=(await i(t.name)).themes[0];a(),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme.`]})})}catch(e){o(e)}r?.(),e?.remove()}})}),Ga=e=>e.variants&&e.variants.length>0,Ka=e=>{let t=[{image:e.image,category:e.category,previewUrl:e.previewUrl}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},qa=e=>e.category.toLowerCase(),Ja=({selectedTheme:e,isInstalling:t,installedTheme:n,onBack:r,onInstall:i})=>{let[a,o]=(0,J.useState)(`desktop`),[s,c]=(0,J.useState)(void 0);if(!e)return null;let l=e.previewUrl,u=Ka(e).map(e=>({label:e.category,value:qa(e)}));Ga(e)&&(s===void 0&&c(u[0]),l=Ka(e).find(e=>qa(e)===s?.value)?.previewUrl||l);let d=`Install ${e.name}`;return t?d=`Installing...`:Yn(e)&&!n?.active?d=`Activate ${e.name}`:n&&(d=`Update ${e.name}`),(0,Y.jsxs)(`div`,{className:`absolute inset-0 z-[100]`,children:[(0,Y.jsx)(zi,{containerClassName:`bg-grey-50 dark:bg-black z-[100]`,left:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:!block md:!visible`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:!block md:!visible`,items:[{label:`Change theme`,onClick:r},{label:e.name}],separatorClassName:`hidden md:!block md:!visible`,backIcon:!0,onBack:r}),Ga(e)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`hidden md:!visible md:!block`,children:`–`}),(0,Y.jsx)(Te,{border:!1,controlClasses:{menu:`min-w-max`},fullWidth:!1,options:u,selectedOption:s,clearBg:!0,onSelect:e=>{c(e||void 0)}})]}):null]}),right:(0,Y.jsxs)(`div`,{className:`flex justify-end gap-8`,children:[(0,Y.jsx)(re,{buttons:[{icon:`laptop`,iconColorClass:a===`desktop`?`text-black dark:text-green`:`text-grey-500 dark:text-grey-600`,link:!0,size:`sm`,onClick:()=>{o(`desktop`)}},{icon:`mobile`,iconColorClass:a===`mobile`?`text-black dark:text-green`:`text-grey-500 dark:text-grey-600`,link:!0,size:`sm`,onClick:()=>{o(`mobile`)}}]}),(0,Y.jsx)(q,{color:`green`,disabled:t,label:t?`Installing...`:d,onClick:()=>{i?.()}})]}),sticky:!1}),(0,Y.jsx)(`div`,{className:`flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-grey-50 dark:bg-black`,children:a===`desktop`?(0,Y.jsx)(ir,{children:(0,Y.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})}):(0,Y.jsx)(ar,{children:(0,Y.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})})})]})},Ya=({onUpload:e})=>{let t=N();return(0,Y.jsx)(`div`,{className:`-mb-6`,children:(0,Y.jsx)(Ae,{id:`theme-upload`,onUpload:n=>{t.remove(),e(n)},children:(0,Y.jsx)(`div`,{className:`cursor-pointer bg-grey-50 p-10 text-center dark:bg-grey-950`,children:`Click to select or drag & drop zip file`})})})},Xa=({currentTab:e,setCurrentTab:t,themes:n})=>{let r=N(),{updateRoute:i}=W(),{mutateAsync:a}=yn(),{checkThemeLimitError:o,isThemeLimited:s}=ht(),l=g(),[u,d]=(0,J.useState)(),[f,p]=(0,J.useState)(!1);(0,J.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(`/`)},h=async e=>{let r=e?.name.replace(/\.zip$/,``),i=n.map(e=>e.name);Yn({name:r})?O.show(me,{title:`Upload failed`,cancelLabel:`Cancel`,okLabel:``,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{children:[`The default `,(0,Y.jsx)(`strong`,{children:r}),` theme cannot be overwritten.`]}),(0,Y.jsx)(`p`,{children:`Rename your zip file and try again.`})]}),onOk:async e=>{e?.remove()}}):i.includes(r)?O.show(me,{title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsx)(`strong`,{children:r}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,cancelLabel:`Cancel`,okRunningLabel:`Overwriting...`,okColor:`red`,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 c&&e.response?.status===422&&e.data?.errors?i=e.data.errors:l(e)}if(i&&!n){let e=(0,Y.jsx)(Y.Fragment,{children:`This theme couldn't be uploaded because Ghost found a blocking validation error. Fix the issue below and upload the theme again.`});O.show(Ma,{title:`Theme not uploaded`,prompt:e,fatalErrors:i,onRetry:async()=>{r?.remove(),y()}})}if(!n)return;let o=n.themes[0],s=`Upload successful`,u=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:o.name}),` uploaded`]});o.active||(u=(0,Y.jsxs)(Y.Fragment,{children:[u,` `,`Do you want to activate it now?`]})),(o?.errors?.length||o.warnings?.length)&&(s=`Upload successful`,u=(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsxs)(`strong`,{children:[`"`,o.name,`"`]}),` was installed successfully.`]}),o.active||(u=(0,Y.jsxs)(Y.Fragment,{children:[u,`You can activate it when you're ready.`]}))),O.show(Wa,{title:s,prompt:u,installedTheme:o,onActivate:t})},v=(0,Y.jsx)(`div`,{className:`hidden md:!visible md:!block`,children:(0,Y.jsx)(Xe,{border:!1,selectedTab:e,tabs:[{id:`official`,title:`Official themes`},{id:`installed`,title:`Installed`}],onTabChange:e=>{t(e)}})}),y=()=>{u&&(u.enabled?O.show(me,{title:`Upload theme`,prompt:(0,Y.jsx)(Ya,{onUpload:h}),okLabel:``,formSheet:!1}):O.show(he,{title:`Upgrade to enable custom themes`,prompt:u.error||(0,Y.jsxs)(Y.Fragment,{children:[`Your current plan only supports official themes. You can install them from the `,(0,Y.jsx)(`a`,{href:`https://ghost.org/marketplace/`,children:`Ghost theme marketplace`}),`.`]}),onOk:()=>i({route:`/pro`,isExternal:!0})}))};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(zi,{containerClassName:`bg-white dark:bg-black`,left:v,right:(0,Y.jsx)(`div`,{className:`flex items-center gap-14`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(q,{label:`Close`,onClick:()=>{r.remove(),m()}}),(0,Y.jsx)(q,{color:`black`,label:`Upload theme`,loading:f,onClick:y})]})})}),(0,Y.jsx)(`div`,{className:`px-[8vmin] md:hidden`,children:(0,Y.jsx)(Xe,{border:!1,selectedTab:e,tabs:[{id:`official`,title:`Official themes`},{id:`installed`,title:`Installed`}],onTabChange:e=>{t(e)}})})]})},Za=({currentTab:e,onSelectTheme:t,themes:n})=>{switch(e){case`official`:return(0,Y.jsx)(Ua,{onSelectTheme:t});case`installed`:return(0,Y.jsx)(Ra,{themes:n})}return null},Qa=({source:e,themeRef:t})=>{let[n,r]=(0,J.useState)(`official`),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(`desktop`),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),[f,m]=(0,J.useState)(!1),{updateRoute:h}=W(),_=N(),{data:{themes:v}={}}=_n(),{mutateAsync:y}=Un(),{mutateAsync:b}=Tn(),{checkThemeLimitError:x}=ht(),S=g(),C=e=>{a(e)};if((0,J.useEffect)(()=>{m(!0)},[]),(0,J.useEffect)(()=>{(async()=>{if(e&&t&&!u&&f){let e=t.split(`/`)[1];if(await x(e)){_.remove();return}let n=v?.map(e=>e.name)||[],r=n.includes(e.toLowerCase()),i=n.indexOf(e.toLowerCase()),a=v?.[i],o=(0,Y.jsxs)(Y.Fragment,{children:[`By clicking below, `,(0,Y.jsx)(`strong`,{children:e}),` will automatically be activated as the theme for your site.`,r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`br`,{}),`This will overwrite your existing version of `,(0,Y.jsx)(`strong`,{children:e}),a?.active?` which is your active theme`:``,`. All custom changes will be lost.`]})]});O.show(me,{title:`Install Theme`,prompt:o,okLabel:`Install`,cancelLabel:`Cancel`,okRunningLabel:`Installing...`,okColor:`black`,onOk:async e=>{let n;d(!0);try{r&&v&&v.splice(i,1),n=await y(t),n?.themes[0]&&(await b(n.themes[0].name),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:n.themes[0].name}),` is now your active theme`]})})),e?.remove(),h(``)}catch(e){S(e)}}})}})()},[t,e,y,S,b,h,v,u,x,_,f]),!v)return;let w,T;if(i){w=v.find(e=>e.name.toLowerCase()===i.name.toLowerCase()),T=async()=>{let t=await x(i.name);if(t){O.show(he,{prompt:t,onOk:()=>h({route:`/pro`,isExternal:!0})});return}return w&&!Yn(i)?new Promise(t=>{O.show(me,{title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.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`,okColor:`red`,onOk:async n=>{n?.remove(),await e(),t()}})}):e()};let e=async()=>{let e=`Success`,t=(0,Y.jsx)(Y.Fragment,{});if(Yn(i))e=`Activate theme`,t=(0,Y.jsxs)(Y.Fragment,{children:[`By clicking below, `,(0,Y.jsx)(`strong`,{children:i.name}),` will automatically be activated as the theme for your site.`]});else{l(!0);let n;try{n=await y(i.ref)}catch(e){S(e)}finally{l(!1)}if(!n)return;let r=n.themes[0];e=`Success`,t=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:r.name}),` has been successfully installed.`]}),r.active||(t=(0,Y.jsxs)(Y.Fragment,{children:[t,` `,`Do you want to activate it now?`]})),(r.errors?.length||r.warnings?.length)&&(e=`Installed successfully`,t=(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsxs)(`strong`,{children:[`"`,r.name,`"`]}),` was installed successfully.`]}),r.active||(t=(0,Y.jsxs)(Y.Fragment,{children:[t,`You can activate it when you're ready.`]}))),w=r}O.show(Wa,{title:e,prompt:t,installedTheme:w,onActivate:()=>{_.remove(),h(``)}})}}return(0,Y.jsx)(L,{afterClose:()=>{h(``)},animate:!1,cancelLabel:``,footer:!1,padding:!1,size:`full`,testId:`theme-modal`,title:``,scrolling:!0,onCancel:()=>{_.remove(),h(``)},children:(0,Y.jsx)(`div`,{className:`flex h-full justify-between`,children:(0,Y.jsxs)(`div`,{className:`grow`,children:[i&&(0,Y.jsx)(Ja,{installedTheme:w,isInstalling:c,selectedTheme:i,onBack:()=>{a(null)},onClose:()=>{h(``)},onInstall:T}),(0,Y.jsx)(Xa,{currentTab:n,modal:_,previewMode:o,selectedTheme:i,setCurrentTab:r,setPreviewMode:s,setSelectedTheme:a,themes:v}),!i&&(0,Y.jsx)(Za,{currentTab:n,themes:v,onSelectTheme:C})]})})})},$a=t(i(),1),eo=({children:e,to:t,classNames:n})=>{let r=t||document.body;return r?(0,$a.createPortal)((0,Y.jsx)(`div`,{className:n,onMouseDown:e=>{e.stopPropagation()},children:(0,Y.jsx)(`div`,{children:e})}),r):(0,Y.jsx)(Y.Fragment,{children:e})},to=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())}},no={heart:e=>(0,Y.jsx)(`svg`,{viewBox:`0 0 32 32`,...e,children:(0,Y.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,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,Y.jsx)(`path`,{d:`M20 5.5l-8 8-8-8m-3.5 13h23`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:10,fill:`none`})})},ro=({icon:e,label:t,...n})=>{let r=null;return e&&(r=no[e]),(0,Y.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,Y.jsx)(r,{className:`size-4 ${e===`heart`?`fill-red`:``} stroke-[3px] ${t&&`mr-1`}`}),t&&(0,Y.jsx)(`span`,{children:t})]})},io=({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,Y.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,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,Y.jsx)(ro,{"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,Y.jsx)(ro,{"data-kg-button":`unsplash-download`,href:`${n.download}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit&force=true`,icon:`download`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center`,children:[(0,Y.jsx)(`img`,{alt:`author`,className:`mr-2 size-8 rounded-full`,src:i.profile_image.medium}),(0,Y.jsx)(`div`,{className:`mr-2 truncate font-sans text-sm font-medium text-white`,children:i.name})]}),(0,Y.jsx)(ro,{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})}})]})]})]}),ao=({payload:e,insertImage:t,selectImg:n,zoomed:r})=>(0,Y.jsx)(`div`,{className:`flex h-full grow basis-0 justify-center`,"data-kg-unsplash-zoomed":!0,onClick:()=>n(null),children:(0,Y.jsx)(io,{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})}),oo=()=>(0,Y.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,Y.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`})}),so=e=>(0,Y.jsx)(`div`,{className:`mr-6 flex grow basis-0 flex-col justify-start last-of-type:mr-0`,children:e.children}),co=e=>e?.columns?e?.columns.map((t,n)=>(0,Y.jsx)(so,{children:t.map(t=>(0,Y.jsx)(io,{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,lo=e=>(0,Y.jsx)(`div`,{className:`relative h-full overflow-hidden`,"data-kg-unsplash-gallery":!0,children:(0,Y.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,Y.jsx)(oo,{})]})}),uo=({zoomed:e,error:t,galleryRef:n,isLoading:r,dataset:i,selectImg:a,insertImage:o})=>e?(0,Y.jsx)(lo,{galleryRef:n,zoomed:e,children:(0,Y.jsx)(ao,{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,Y.jsx)(lo,{galleryRef:n,zoomed:e,children:(0,Y.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center`,children:[(0,Y.jsx)(`h1`,{className:`mb-4 text-2xl font-bold`,children:`Error`}),(0,Y.jsx)(`p`,{className:`text-lg font-medium`,children:t})]})}):(0,Y.jsx)(lo,{galleryRef:n,isLoading:r,zoomed:e,children:(0,Y.jsx)(co,{columns:i,insertImage:o,selectImg:a,zoomed:e})}),fo=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M.75 23.249l22.5-22.5M23.25 23.249L.75.749`})}),po=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Y.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`})}),mo=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 122.43 122.41`,...e,children:(0,Y.jsx)(`path`,{d:`M83.86 54.15v34.13H38.57V54.15H0v68.26h122.43V54.15H83.86zM38.57 0h45.3v34.13h-45.3z`})}),ho=({closeModal:e,handleSearch:t,children:n})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 h-[100vh] bg-black opacity-60`}),(0,Y.jsxs)(`div`,{className:`not-kg-prose fixed inset-8 z-50 overflow-hidden rounded bg-white shadow-xl`,"data-kg-modal":`unsplash`,children:[(0,Y.jsx)(`button`,{className:`absolute right-6 top-6 cursor-pointer`,type:`button`,children:(0,Y.jsx)(fo,{className:`text-grey-400 size-4 stroke-2`,"data-kg-modal-close-button":!0,onClick:()=>e()})}),(0,Y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Y.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-20 py-10`,children:[(0,Y.jsxs)(`h1`,{className:`flex items-center gap-2 font-sans text-3xl font-bold text-black`,children:[(0,Y.jsx)(mo,{className:`mb-1`}),`Unsplash`]}),(0,Y.jsxs)(`div`,{className:`relative w-full max-w-sm`,children:[(0,Y.jsx)(po,{className:`text-grey-700 absolute left-4 top-1/2 size-4 -translate-y-2`}),(0,Y.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]})]})]}),go=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}}}]`),_o=class{photos=go;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){}},vo=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()}},yo=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}},bo=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()}},xo=({onClose:e,onImageInsert:t,unsplashProviderConfig:n})=>{let r=(0,J.useMemo)(()=>n?new yo(n):new _o,[n]),i=(0,J.useMemo)(()=>new vo(r),[r]),a=(0,J.useMemo)(()=>new to(3),[]),o=(0,J.useMemo)(()=>new bo(i,a),[i,a]),s=(0,J.useRef)(null),[c,l]=(0,J.useState)(0),[u,d]=(0,J.useState)(0),[f,p]=(0,J.useState)(o.searchIsRunning()||!0),m=(0,J.useRef)(!1),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(null),[y,b]=(0,J.useState)([]);J.useEffect(()=>{s.current&&_===null&&u!==0&&(s.current.scrollTop=u,d(0))},[_,c,u]),J.useEffect(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e]),J.useEffect(()=>{let e=s.current;if(!_)return e&&e.addEventListener(`scroll`,()=>{l(e.scrollTop)}),()=>{e&&e.removeEventListener(`scroll`,()=>{l(e.scrollTop)})}},[s,_]);let x=J.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=J.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]);J.useEffect(()=>{let e=setTimeout(async()=>{h.length>2?await C():await x()},300);return()=>{m.current=!0,clearTimeout(e)}},[h,C,x]);let w=J.useCallback(async()=>{p(!0),await o.loadNextPage();let e=o.getColumns();b(e||[]),p(!1)},[o]);J.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,Y.jsx)(ho,{closeModal:e,handleSearch:S,children:(0,Y.jsx)(uo,{dataset:y,error:null,galleryRef:s,insertImage:E,isLoading:f,selectImg:T,zoomed:_})})},So=({unsplashProviderConfig:e,onClose:t,onImageInsert:n})=>(0,Y.jsx)(eo,{classNames:`admin-x-settings`,children:(0,Y.jsx)(xo,{unsplashProviderConfig:e,onClose:t,onImageInsert:n})}),Co={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`}]},wo=`Theme default`,To=({children:e,...t})=>(0,Y.jsx)(Ce.SingleValue,{...t,children:(0,Y.jsx)(`div`,{className:`group`,"data-testid":`select-current-option`,"data-value":t.data.value,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-md bg-white text-2xl font-bold dark:bg-black`,children:`Aa`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-md`,children:e}),(0,Y.jsx)(`span`,{className:`font-sans text-sm font-normal text-grey-700 dark:text-grey-600`,children:t.data.creator})]})]})})}),Eo=({children:e,...t})=>(0,Y.jsx)(Ce.Option,{...t,children:(0,Y.jsxs)(`div`,{className:t.isSelected?`relative flex w-full items-center justify-between gap-2`:`group`,"data-testid":`select-option`,"data-value":t.data.value,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-md bg-grey-100 text-2xl font-bold group-hover:bg-grey-200 dark:bg-grey-900 dark:group-hover:bg-grey-800`,children:`Aa`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-md`,children:e}),(0,Y.jsx)(`span`,{className:`font-sans text-sm font-normal text-grey-700 dark:text-grey-600`,children:t.data.creator})]})]}),t.isSelected&&(0,Y.jsx)(`span`,{children:(0,Y.jsx)(f,{name:`check`,size:14})})]})}),Q=e=>e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),Do=({values:e,updateSetting:t})=>{let{mutateAsync:n}=pt(),{settings:r}=K(),[i]=Fn(r,[`unsplash`]),[a,s]=(0,J.useState)(!1),{unsplashConfig:c}=o(),l=g(),u=lt(),{data:d}=_n(),f=d?.themes.find(e=>e.active),p=f?`${Q(f.name)} (v${f.package?.version||`1.0`})`:`Loading...`,[m,h]=(0,J.useState)(Co.heading.find(t=>t.name===e.headingFont)||{name:wo,creator:p}),[_,v]=(0,J.useState)(Co.heading.find(t=>t.name===e.bodyFont)||{name:wo,creator:p}),y=(e,t=!0)=>{let n=``;return e===`Cardo`?n=P(`font-cardo`,t&&`font-bold`):e===`Manrope`?n=P(`font-manrope`,t&&`font-bold`):e===`Merriweather`?n=P(`font-merriweather`,t&&`font-bold`):e===`Nunito`?n=P(`font-nunito`,t&&`font-semibold`):e===`Old Standard TT`?n=P(`font-old-standard-tt`,t&&`font-bold`):e===`Prata`?n=P(`font-prata`,t&&`font-normal`):e===`Roboto`?n=P(`font-roboto`,t&&`font-bold`):e===`Rufina`?n=P(`font-rufina`,t&&`font-bold`):e===`Tenor Sans`?n=P(`font-tenor-sans`,t&&`font-normal`):e===`Chakra Petch`?n=P(`font-chakra-petch`,t&&`font-normal`):e===`Fira Mono`?n=P(`font-fira-mono`,t&&`font-bold`):e===`Fira Sans`?n=P(`font-fira-sans`,t&&`font-bold`):e===`IBM Plex Serif`?n=P(`font-ibm-plex-serif`,t&&`font-bold`):e===`Inter`?n=P(`font-inter`,t&&`font-bold`):e===`JetBrains Mono`?n=P(`font-jetbrains-mono`,t&&`font-bold`):e===`Lora`?n=P(`font-lora`,t&&`font-bold`):e===`Noto Sans`?n=P(`font-noto-sans`,t&&`font-bold`):e===`Noto Serif`?n=P(`font-noto-serif`,t&&`font-bold`):e===`Poppins`?n=P(`font-poppins`,t&&`font-bold`):e===`Space Grotesk`?n=P(`font-space-grotesk`,t&&`font-bold`):e===`Space Mono`&&(n=P(`font-space-mono`,t&&`font-bold`)),n},b=Co.heading.map(e=>{let t=y(e.name,!0);return{label:e.name,value:e.name,creator:e.creator,className:t}});b.unshift({label:wo,value:wo,creator:p,className:`font-sans font-normal`});let x=Co.body.map(e=>{let t=y(e.name,!1);return{label:e.name,value:e.name,creator:e.creator,className:t}});x.unshift({label:wo,value:wo,creator:p,className:`font-sans font-normal`});let S=(e,t)=>e===wo?``:y(e,t),C={label:m.name,value:m.name,creator:m.creator},w={label:_.name,value:_.name,creator:_.creator};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:``,children:[(0,Y.jsx)(Yr,{debounceMs:200,direction:`rtl`,testId:`accent-color-picker`,title:(0,Y.jsx)(`div`,{children:`Accent color`}),value:e.accentColor,onChange:e=>t(`accent_color`,e)}),(0,Y.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication icon`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`A square, social icon, at least 60x60px`})]}),(0,Y.jsx)(`div`,{className:`flex gap-3`,children:(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,editButtonClassName:`top-1! right-1!`,height:e.icon?`66px`:`36px`,id:`logo`,imageBWCheckedBg:!0,imageURL:e.icon||``,width:e.icon?`66px`:`160px`,onDelete:()=>t(`icon`,null),onUpload:async e=>{try{t(`icon`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload icon`})})]}),(0,Y.jsxs)(`div`,{className:`flex items-start justify-between ${e.icon&&`mt-2`}`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication logo`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`Appears usually in the main header of your theme`})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,height:`60px`,id:`site-logo`,imageBWCheckedBg:!0,imageFit:`contain`,imageURL:e.logo||``,width:`160px`,onDelete:()=>t(`logo`,null),onUpload:async e=>{try{t(`logo`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload logo`})})]}),(0,Y.jsxs)(`div`,{className:`mt-2 flex items-start justify-between`,"data-testid":`publication-cover`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication cover`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`Usually as a large banner image on your index pages`})]}),(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,editButtonClassName:`top-1! right-10!`,height:`95px`,id:`cover`,imageURL:e.coverImage||``,openUnsplash:()=>s(!0),pintura:{isEnabled:u.isEnabled,openEditor:async()=>u.openEditor({image:e.coverImage||``,handleSave:async e=>{try{t(`cover_image`,Ne(await n({file:e})))}catch(e){l(e)}}})},unsplashButtonClassName:`bg-transparent! h-6! top-1.5! w-6! right-1.5! z-50`,unsplashEnabled:i,width:`160px`,onDelete:()=>t(`cover_image`,null),onUpload:async e=>{try{t(`cover_image`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload cover`}),a&&c&&i&&(0,Y.jsx)(So,{unsplashProviderConfig:c,onClose:()=>{s(!1)},onImageInsert:e=>{e.src&&t(`cover_image`,e.src),s(!1)}})]})]}),(0,Y.jsxs)(U,{className:`-mt-4`,gap:`sm`,margins:`lg`,title:`Typography`,children:[(0,Y.jsx)(Te,{className:S(C.label,!0),components:{Option:Eo,SingleValue:To},controlClasses:{control:`min-h-16! pl-2!`,option:`pl-2!`},hint:``,menuShouldScrollIntoView:!0,options:b,selectedOption:C,testId:`heading-font-select`,title:`Heading font`,onSelect:e=>{e?.value===wo?(h({name:wo,creator:p}),t(`heading_font`,``)):(h({name:e?.value||``,creator:Co.heading.find(t=>t.name===e?.value)?.creator||``}),t(`heading_font`,e?.value||``))}}),(0,Y.jsx)(Te,{className:S(w.label,!1),components:{Option:Eo,SingleValue:To},controlClasses:{control:`min-h-16! pl-2!`,option:`pl-2!`},hint:``,maxMenuHeight:200,menuPosition:`fixed`,menuShouldScrollIntoView:!0,options:x,selectedOption:w,testId:`body-font-select`,title:`Body font`,onSelect:e=>{e?.value===wo?(v({name:wo,creator:p}),t(`body_font`,``)):(v({name:e?.value||``,creator:Co.body.find(t=>t.name===e?.value)?.creator||``}),t(`body_font`,e?.value||``))}})]})]})},Oo=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.
|
|
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{t as i}from"./react-dom-C6aoWSfl.js";import{i as a,n as o,s}from"./framework-provider-i7X1c1ST.js";import{S as c,_ as l,b as u,f as d,g as f,h as p,m,n as h,p as g,r as _,t as v,u as y,w as b,y as x}from"./hooks-tBACnBdQ.js";import{t as S}from"./jsx-runtime-CtMZ-PAS.js";import{a as C}from"./dist-B7kX8alP.js";import{t as w}from"./dist-B_Ahe-Z8.js";import{d as T,f as E,h as D,l as O,n as k,p as A,r as j,t as M,u as N}from"./esm-CsHLKmLh.js";import{t as P}from"./clsx-CjueKrWZ.js";import{$ as F,$t as I,At as L,B as R,Bt as z,C as B,Ct as ee,Dt as V,E as te,Et as ne,F as H,Ft as re,G as ie,Gt as ae,H as oe,Ht as se,I as ce,J as le,K as ue,L as de,Lt as fe,M as pe,Mt as me,Ot as he,Pt as ge,Q as _e,R as ve,Rt as ye,S as be,T as xe,Tt as Se,Ut as Ce,V as we,Vt as Te,Wt as Ee,X as De,Xt as U,Y as Oe,Z as ke,Zt as Ae,_ as je,a as Me,b as Ne,cn as Pe,dn as Fe,en as Ie,et as Le,f as Re,ft as W,g as ze,gt as Be,h as Ve,ht as He,i as Ue,in as We,it as Ge,j as Ke,jt as qe,k as G,kt as Je,l as Ye,ln as Xe,lt as K,m as Ze,mt as Qe,n as $e,nt as et,pt as tt,r as nt,rn as rt,rt as it,s as at,sn as ot,t as st,u as ct,un as q,v as lt,vt as ut,w as dt,wt as ft,x as pt,xt as mt,y as ht,yt as gt,z as _t,zt as vt}from"./social-urls-DVvRfwEp.js";import{d as yt,p as bt,u as xt}from"./Combination-BPFTKsTn.js";import{r as St}from"./dist-CsekE4FL.js";import{o as Ct}from"./dist-CaHNiF20.js";import{t as wt}from"./dist-JLOy8o0Q.js";import{n as Tt,t as Et}from"./dist-CNlBOype.js";import{t as Dt}from"./preload-helper-DYl5dUZ5.js";import{n as Ot,r as kt}from"./dist-duxRDcQu.js";import{c as At,g as jt,h as Mt}from"./automated-emails-293Lcj5S.js";import{a as Nt,i as Pt,n as Ft,r as It,t as Lt}from"./offers-BYodCS47.js";import{n as Rt}from"./posts-D_gBhqmK.js";import{At as zt,Bn as Bt,C as Vt,D as Ht,H as Ut,Ut as Wt,Wt as Gt,Xn as Kt,Yt as qt,Z as Jt,a as Yt,g as Xt,gn as Zt,mn as Qt,rt as $t,un as en,y as tn}from"./button-DiwO9Rof.js";import{_ as nn,c as rn,d as an,f as on,g as sn,h as cn,m as ln,o as un,p as dn,s as fn,t as pn,u as mn}from"./users-Y8qhvF1q.js";import{Ai as hn,Bt as gn,Gt as _n,Ht as vn,Jt as yn,Kt as bn,Lt as xn,Mn as Sn,Nn as Cn,Oi as wn,Rt as Tn,Ut as En,Vt as Dn,Wt as On,Yt as kn,an as An,cn as jn,di as Mn,dn as Nn,fi as Pn,fn as Fn,gn as In,hn as Ln,ji as Rn,ki as zn,li as Bn,ln as Vn,on as Hn,qt as Un,sn as Wn,ui as Gn,un as Kn,v as qn,vn as Jn,zt as Yn}from"./index-B5yxmQNp.js";import{G as Xn}from"./dist-DLRDZ5Qa.js";import{i as Zn,n as Qn,r as $n}from"./newsletters-BEvO0JE3.js";import{t as er}from"./nql-lang-BoHzkNg5.js";import{a as tr,o as nr,r as rr}from"./tiers-74aPYtWv.js";var J=t(r(),1),Y=S(),ir=({children:e,...t})=>(0,Y.jsx)(`div`,{className:`flex size-full flex-col px-8`,...t,children:(0,Y.jsx)(`div`,{className:`size-full overflow-hidden rounded-t-[4px] shadow-sm`,children:e})}),ar=({children:e,...t})=>(0,Y.jsx)(`div`,{className:`flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900`,...t,children:(0,Y.jsx)(`div`,{className:`size-full grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950`,children:e})}),or=({title:e,label:t,value:n,onChange:r,disabled:i,error:a,hint:o,checked:s,separator:c,testId:l})=>{let u=(0,J.useId)();return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1 ${c&&`pb-2`}`,children:[e&&(0,Y.jsx)(A,{grey:!0,level:6,children:e}),(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start ${e&&`mt-1 -mb-1`}`,htmlFor:u,children:[(0,Y.jsx)(Et,{className:`mt-0.5 flex size-4 cursor-pointer appearance-none items-center justify-center rounded-[3px] border border-solid border-grey-500 bg-white outline-hidden data-[state=checked]:border-black data-[state=checked]:bg-black data-[state=indeterminate]:border-black data-[state=indeterminate]:bg-black`,"data-testid":l,defaultChecked:s,disabled:i,id:u,value:n,onCheckedChange:e=>{r(e===!0)},children:(0,Y.jsx)(Tt,{children:(0,Y.jsx)(`svg`,{fill:`none`,height:`11`,viewBox:`0 0 10 11`,width:`10`,children:(0,Y.jsx)(`path`,{d:`M1 5.88889L4.6 9L9 1`,stroke:`white`,strokeLinecap:`round`,strokeWidth:`2`})})})}),(0,Y.jsxs)(`div`,{className:`ml-2 flex flex-col ${o&&`mb-2`}`,children:[(0,Y.jsx)(`span`,{className:`inline-block text-[1.425rem] dark:text-white ${o&&`-mb-1`}`,children:t}),o&&(0,Y.jsx)(E,{color:a?`red`:``,children:o})]})]})]}),(c||a)&&(0,Y.jsx)(D,{className:a?`border-red`:``})]})},sr=({title:e,checkboxes:t,hint:n,error:r})=>(0,Y.jsxs)(`div`,{children:[e&&(0,Y.jsx)(A,{grey:!0,level:6,children:e}),(0,Y.jsx)(`div`,{className:`mt-2 flex flex-col gap-1`,children:t?.map(({key:e,...t},n)=>(0,Y.jsx)(or,{...t},e??`checkbox-${n}`))}),(0,Y.jsx)(`div`,{className:`flex flex-col ${n&&`mb-2`}`,children:n&&(0,Y.jsx)(E,{color:r?`red`:``,children:n})})]}),X=({hex:e,value:t,title:n,size:r=`md`,isSelected:i,onSelect:a})=>{let o=(0,J.useRef)(null),s=n=>{n.preventDefault(),a(t===void 0?e:t)},c=e.length===4&&e[3]===`0`||e.length===8&&e.slice(6)===`00`,l=`h-5 w-5`;switch(r){case`lg`:l=`w-6 h-6`;break}return(0,Y.jsx)(`button`,{ref:o,className:P(`relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800`,l,i&&`outline-2 outline-green`),style:{backgroundColor:e},title:n,type:`button`,onClick:s,children:c&&(0,Y.jsx)(`div`,{className:`absolute top-0 left-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})})},cr=({title:e,value:t,swatches:n,swatchSize:r=`md`,onSwatchChange:i,onTogglePicker:a,isExpanded:o,picker:s=!0,containerClassName:c})=>{let l=n.find(e=>e.value===t||e.hex===t);return c=P(`flex flex-col gap-3`),(0,Y.jsxs)(`div`,{className:c,children:[e&&(0,Y.jsx)(A,{useLabelTag:!0,children:e}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(o||!s)&&(0,Y.jsx)(`div`,{className:`flex items-center gap-1`,children:n.map(({customContent:e,...t})=>e?(0,Y.jsx)(J.Fragment,{children:e},t.title):(0,Y.jsx)(X,{isSelected:l?.title===t.title,size:r,onSelect:i,...t},t.title))}),s&&(0,Y.jsxs)(`button`,{"aria-label":`Pick color`,className:`relative size-6 cursor-pointer rounded-full border border-grey-200 dark:border-grey-800`,type:`button`,onClick:a,children:[(0,Y.jsx)(`div`,{className:`absolute inset-0 rounded-full bg-[conic-gradient(hsl(360,100%,50%),hsl(315,100%,50%),hsl(270,100%,50%),hsl(225,100%,50%),hsl(180,100%,50%),hsl(135,100%,50%),hsl(90,100%,50%),hsl(45,100%,50%),hsl(0,100%,50%))]`}),l&&(0,Y.jsx)(`div`,{className:`absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950`,style:{backgroundColor:l.hex},children:l.hex===`transparent`&&(0,Y.jsx)(`div`,{className:`absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})}),!l&&t&&(0,Y.jsx)(`div`,{className:`absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950`,style:{backgroundColor:t},children:t===`transparent`&&(0,Y.jsx)(`div`,{className:`absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red`})})]})]})]})};function lr(){return(lr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ur(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function Z(e){var t=(0,J.useRef)(e),n=(0,J.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var dr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},fr=function(e){return`touches`in e},pr=function(e){return e&&e.ownerDocument.defaultView||self},mr=function(e,t,n){var r=e.getBoundingClientRect(),i=fr(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:dr((i.pageX-(r.left+pr(e).pageXOffset))/r.width),top:dr((i.pageY-(r.top+pr(e).pageYOffset))/r.height)}},hr=function(e){!fr(e)&&e.preventDefault()},gr=J.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=ur(e,[`onMove`,`onKey`,`onEnd`]),a=(0,J.useRef)(null),o=Z(t),s=Z(n),c=Z(r),l=(0,J.useRef)(null),u=(0,J.useRef)(!1),d=(0,J.useMemo)(function(){var e=function(e){hr(e),(fr(e)?e.touches.length>0:e.buttons>0)&&a.current?o(mr(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=pr(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(hr(t),!function(e,t){return t&&!fr(e)}(t,u.current)&&r)){if(fr(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(mr(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,J.useEffect)(function(){return h},[h]),J.createElement(`div`,lr({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),_r=function(e){return e.filter(Boolean).join(` `)},vr=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=_r([`react-colorful__pointer`,e.className]);return J.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},J.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},yr=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var br=function(e){return Or(xr(e))},xr=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?yr(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?yr(parseInt(e.substring(6,8),16)/255,2):1}},Sr=function(e){return Dr(Tr(e))},Cr=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:yr(e.h),s:yr(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:yr(i/2),a:yr(r,2)}},wr=function(e){var t=Cr(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},Tr=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:yr(255*[r,s,o,o,c,r][l]),g:yr(255*[c,r,r,s,o,o][l]),b:yr(255*[o,o,c,r,r,s][l]),a:yr(i,2)}},Er=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},Dr=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?Er(yr(255*i)):``;return`#`+Er(t)+Er(n)+Er(r)+a},Or=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:yr(60*(s<0?s+6:s)),s:yr(a?o/a*100:0),v:yr(a/255*100),a:i}},kr=J.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=_r([`react-colorful__hue`,e.className]);return J.createElement(`div`,{className:i},J.createElement(gr,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:dr(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":yr(t),"aria-valuemax":`360`,"aria-valuemin":`0`},J.createElement(vr,{className:`react-colorful__hue-pointer`,left:t/360,color:wr({h:t,s:100,v:100,a:1})})))}),Ar=J.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:wr({h:t.h,s:100,v:100,a:1})};return J.createElement(`div`,{className:`react-colorful__saturation`,style:i},J.createElement(gr,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:dr(t.s+100*e.left,0,100),v:dr(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+yr(t.s)+`%, Brightness `+yr(t.v)+`%`},J.createElement(vr,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:wr(t)})))}),jr=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Mr=function(e,t){return e.toLowerCase()===t.toLowerCase()||jr(xr(e),xr(t))};function Nr(e,t,n,r){var i=Z(n),a=Z(r),o=(0,J.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,J.useRef)({color:t,hsva:s}),u=(0,J.useRef)(!1);return(0,J.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,J.useEffect)(function(){var t;jr(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,J.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,J.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var Pr,Fr=typeof window<`u`?J.useLayoutEffect:J.useEffect,Ir=function(){return Pr||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},Lr=new Map,Rr=function(e){Fr(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!Lr.has(t)){var n=t.createElement(`style`);n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,Lr.set(t,n);var r=Ir();r&&n.setAttribute(`nonce`,r),t.head.appendChild(n)}},[])},zr=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=ur(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,J.useRef)(null);Rr(c);var l=Nr(n,i,a,o),u=l[0],d=l[1],f=l[2],p=_r([`react-colorful`,t]);return J.createElement(`div`,lr({},s,{ref:c,className:p}),J.createElement(Ar,{hsva:u,onChange:d,onChangeEnd:f}),J.createElement(kr,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},Br={defaultColor:`000`,toHsva:br,fromHsva:function(e){return Sr({h:e.h,s:e.s,v:e.v,a:1})},equal:Mr},Vr=function(e){return J.createElement(zr,lr({},e,{colorModel:Br}))},Hr=/^#?([0-9A-F]{3,8})$/i,Ur=function(e){var t=e.color,n=t===void 0?``:t,r=e.onChange,i=e.onBlur,a=e.escape,o=e.validate,s=e.format,c=e.process,l=ur(e,[`color`,`onChange`,`onBlur`,`escape`,`validate`,`format`,`process`]),u=(0,J.useState)(function(){return a(n)}),d=u[0],f=u[1],p=Z(r),m=Z(i),h=(0,J.useCallback)(function(e){var t=a(e.target.value);f(t),o(t)&&p(c?c(t):t)},[a,c,o,p]),g=(0,J.useCallback)(function(e){o(e.target.value)||f(a(n)),m(e)},[n,a,o,m]);return(0,J.useEffect)(function(){f(a(n))},[n,a]),J.createElement(`input`,lr({},l,{value:s?s(d):d,spellCheck:`false`,onChange:h,onBlur:g}))},Wr=function(e){return`#`+e},Gr=function(e){var t=e.prefixed,n=e.alpha,r=ur(e,[`prefixed`,`alpha`]),i=(0,J.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,``).substring(0,n?8:6)},[n]),a=(0,J.useCallback)(function(e){return function(e,t){var n=Hr.exec(e),r=n?n[1].length:0;return r===3||r===6||!!t&&r===4||!!t&&r===8}(e,n)},[n]);return J.createElement(Ur,lr({},r,{escape:i,format:t?Wr:void 0,process:Wr,validate:a}))},Kr=({hexValue:e,eyedropper:t,clearButtonValue:n,containerClassName:r,onChange:i})=>{let a=(0,J.useRef)(null),o=(0,J.useCallback)(e=>{e.stopPropagation();let t=a.current?.querySelector(`input`);e.target!==t&&(a.current?.querySelector(`input`)?.focus(),e.preventDefault())},[]),s=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{s.current=!1,a.current?.querySelector(`input`)?.focus(),document.removeEventListener(`mouseup`,c),document.removeEventListener(`touchend`,c)},[]),u=(0,J.useCallback)(()=>{s.current=!0,document.addEventListener(`mouseup`,c),document.addEventListener(`touchend`,c)},[c]),d=(0,J.useCallback)(e=>{e.preventDefault(),window.EyeDropper&&(s.current=!0,document.body.style.setProperty(`pointer-events`,`none`),new window.EyeDropper().open().then(e=>i?.(e.sRGBHex)).finally(()=>{s.current=!1,document.body.style.removeProperty(`pointer-events`),a.current?.querySelector(`input`)?.focus()}))},[i]);(0,J.useEffect)(()=>{a.current?.querySelector(`input`)?.focus()},[]);let f=(0,J.useCallback)(()=>{a.current?.querySelector(`input`)?.focus()},[]);return r=P(`mt-2`,r),(0,Y.jsxs)(`div`,{className:r,onMouseDown:o,onTouchStart:o,children:[(0,Y.jsx)(Vr,{className:`w-full`,color:e||`#ffffff`,onChange:i,onMouseDown:u,onTouchStart:u}),(0,Y.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,Y.jsxs)(`div`,{ref:a,className:`peer relative order-2 flex h-10 w-full items-center`,onClick:f,children:[(0,Y.jsx)(`span`,{className:`absolute top-[9px] left-2 z-10 mr-2 ml-1 text-grey-700`,children:`#`}),(0,Y.jsx)(Gr,{"aria-label":`Color value`,className:`z-[1] w-full rounded-md border border-transparent bg-grey-100 p-2 pl-6 transition-all hover:bg-grey-100 focus:border-green focus:bg-white focus:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:bg-grey-900 dark:text-white dark:focus:bg-grey-900`,color:e,onChange:i}),t&&!!window.EyeDropper&&(0,Y.jsx)(`button`,{className:`absolute inset-y-0 right-3 z-50 my-auto size-4 p-[1px]`,type:`button`,onClick:d,children:(0,Y.jsx)(l,{className:`size-full`})})]}),n!==void 0&&(0,Y.jsx)(q,{color:`grey`,value:`Clear`,onClick:()=>i?.(n)})]})]})},qr=(0,J.createContext)({colorPickers:[]}),Jr=e=>e.length===4?e.replace(/#(.)(.)(.)/,`#$1$1$2$2$3$3`):e,Yr=({testId:e,title:t,direction:n,value:r,hint:i,error:a,eyedropper:o,clearButtonValue:s,onChange:c,swatches:l=[],alwaysOpen:u=!1,debounceMs:d})=>{let[f,p]=(0,J.useState)(!1),[m,h]=(0,J.useState)(r),g=(0,J.useContext)(qr),_=(0,J.useId)();(0,J.useEffect)(()=>{h(e=>Jr(e||``)===r?e:r)},[r]),(0,J.useEffect)(()=>(g.colorPickers.push({id:_,setExpanded:p}),()=>{g.colorPickers=g.colorPickers.filter(e=>e.id!==_)}),[g,_]),(0,J.useEffect)(()=>{if(f){g.colorPickers.filter(e=>e.id!==_).forEach(e=>e.setExpanded(!1));let e=()=>{p(!1)};return document.addEventListener(`click`,e),()=>{document.removeEventListener(`click`,e)}}},[g,_,f]);let v=(0,J.useMemo)(()=>c&&d?Ie(c,d):c,[d,c]),y=e=>{h(e),v?.(e?Jr(e):null)},b=(0,Y.jsx)(cr,{isExpanded:f,swatches:l,value:m,onSwatchChange:e=>{y(e),p(!1)},onTogglePicker:()=>!u&&p(!f)});t&&(b=(0,Y.jsxs)(`div`,{className:P(`flex w-full cursor-pointer items-start first:mt-0 dark:text-white`,n===`rtl`&&`flex-row-reverse`),children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:b}),(0,Y.jsxs)(`div`,{className:P(`flex-1`,n===`rtl`?`pr-2`:`pl-2`,i?`mt-[-2px]`:`mt-[1px]`),onClick:()=>!u&&p(!f),children:[t,i&&(0,Y.jsx)(`div`,{className:`text-sm ${a?`text-red`:`text-grey-700`}`,children:i})]})]}));let x=l.find(e=>e.value===m);return(0,Y.jsxs)(`div`,{className:`flex-col`,"data-testid":e,onClick:e=>e.stopPropagation(),children:[b,(u||f)&&(0,Y.jsx)(Kr,{clearButtonValue:s,eyedropper:o,hexValue:x?.hex||m||void 0,onChange:y})]})},Xr=({value:e,onChange:t,singleParagraph:n=!0,...r})=>{let i=(0,J.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,Y.jsx)(ae,{...r,singleParagraph:n,children:t=>(0,Y.jsx)(t.HtmlOutputPlugin,{html:e,setHtml:i})})},Zr=({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?``:P(`flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[var(--control-height)]`,a?`bg-transparent`:`bg-grey-100 px-3 dark:bg-grey-900`,n?`border-red`:`transition-all hover:bg-grey-100 has-[:focus]:border-green has-[:focus]:bg-white has-[:focus]:shadow-[0_0_0_1px_rgba(48,207,67,1)] dark:selection:bg-[rgba(88,101,116,0.99)] dark:hover:bg-grey-900 dark:has-[:focus]:bg-grey-950`,e&&!t&&!a&&`mt-2`,o);return(0,Y.jsxs)(`div`,{className:`flex flex-col ${s}`,children:[e&&(0,Y.jsx)(A,{className:t?`sr-only`:``,grey:!0,useLabelTag:!0,children:e}),(0,Y.jsx)(`div`,{className:d,children:(0,Y.jsx)(Xr,{...u,value:i})}),r&&(0,Y.jsx)(E,{className:c,color:n?`red`:``,children:r})]})},Qr=`Radio`,[$r,ei]=St(Qr),[ti,ni]=$r(Qr);function ri(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]=J.useState(null),[p,m]=J.useState(null),h={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,hasConsumerStoppedPropagationRef:J.useRef(!1),isFormControl:d?!!a||!!d.closest(`form`):!0,bubbleInput:p,setBubbleInput:m,onCheck:()=>s?.()};return(0,Y.jsx)(ti,{scope:t,...h,children:di(u)?u(h):r})}var ii=`RadioTrigger`,ai=J.forwardRef(({__scopeRadio:e,onClick:t,...n},r)=>{let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,hasConsumerStoppedPropagationRef:l,isFormControl:u,bubbleInput:d}=ni(ii,e),f=C(r,s);return(0,Y.jsx)(w.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":fi(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:bt(t,e=>{i||c(),d&&u&&(l.current=e.isPropagationStopped(),l.current||e.stopPropagation())})})});ai.displayName=ii;var oi=J.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i,required:a,disabled:o,value:s,onCheck:c,form:l,...u}=e;return(0,Y.jsx)(ri,{__scopeRadio:n,checked:i,disabled:o,required:a,onCheck:c,name:r,form:l,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ai,{...u,ref:t,__scopeRadio:n}),e&&(0,Y.jsx)(ui,{__scopeRadio:n})]})})});oi.displayName=Qr;var si=`RadioIndicator`,ci=J.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=ni(si,n);return(0,Y.jsx)(xt,{present:r||a.checked,children:(0,Y.jsx)(w.span,{"data-state":fi(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});ci.displayName=si;var li=`RadioBubbleInput`,ui=J.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}=ni(li,e),p=C(n,d),m=wt(i),h=Ct(r);J.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=J.useRef(i);return(0,Y.jsx)(w.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%)`}})});ui.displayName=li;function di(e){return typeof e==`function`}function fi(e){return e?`checked`:`unchecked`}var pi=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],mi=`RadioGroup`,[hi,gi]=St(mi,[hn,ei]),_i=hn(),vi=ei(),[yi,bi]=hi(mi),xi=J.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=_i(n),m=Rn(l),[h,g]=yt({prop:a,defaultProp:i??null,onChange:d,caller:mi});return(0,Y.jsx)(yi,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,Y.jsx)(zn,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,Y.jsx)(w.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});xi.displayName=mi;var Si=`RadioGroupItem`,Ci=`RadioGroupItemProvider`,wi=`RadioGroupItemTrigger`,Ti=`RadioGroupItemBubbleInput`;function Ei(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=bi(Ci,t),s=vi(t),c=o.disabled||r;return(0,Y.jsx)(ri,{...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 Di=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e,i=_i(n),a=vi(n),{checked:o,disabled:s}=ni(wi,a.__scopeRadio),c=J.useRef(null),l=C(t,c),u=J.useRef(!1);return J.useEffect(()=>{let e=e=>{pi.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,Y.jsx)(wn,{asChild:!0,...i,focusable:!s,active:o,children:(0,Y.jsx)(ai,{...a,...r,ref:l,onKeyDown:bt(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:bt(r.onFocus,()=>{u.current&&c.current?.click()})})})});Di.displayName=wi;var Oi=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return(0,Y.jsx)(Ei,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Di,{...a,ref:t,__scopeRadioGroup:n}),e&&(0,Y.jsx)(ki,{__scopeRadioGroup:n})]})})});Oi.displayName=Si;var ki=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Y.jsx)(ui,{...vi(n),...r,ref:t})});ki.displayName=Ti;var Ai=`RadioGroupIndicator`,ji=J.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Y.jsx)(ci,{...vi(n),...r,ref:t})});ji.displayName=Ai;var Mi=({id:e,title:t,options:n,onSelect:r,error:i,hint:a,selectedOption:o,separator:s})=>(0,Y.jsxs)(xi,{defaultValue:o,name:e,onValueChange:r,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2 ${s&&`pb-2`}`,children:[t&&(0,Y.jsx)(A,{level:6,children:t}),n.map(e=>(0,Y.jsxs)(`label`,{className:`flex cursor-pointer items-start ${t&&`mt-1 -mb-1`}`,htmlFor:e.value,children:[(0,Y.jsx)(Oi,{className:`relative float-left mt-[3px] size-4 min-w-[16px] appearance-none rounded-full border-2 border-solid border-grey-300 hover:cursor-pointer focus:shadow-none focus:ring-0 focus:outline-hidden data-[state=checked]:border-green data-[state=checked]:focus:border-green dark:border-grey-800 dark:text-white dark:data-[state=checked]:border-green dark:data-[state=checked]:focus:border-green`,id:e.value,value:e.value,children:(0,Y.jsx)(ji,{className:`flex size-full items-center justify-center after:block after:size-[6px] after:rounded-full after:border-green after:bg-green after:content-[''] dark:after:border-green dark:after:bg-green`})}),(0,Y.jsxs)(`div`,{className:`ml-2 flex flex-col ${e.hint&&`mb-2`}`,children:[(0,Y.jsx)(`span`,{className:`inline-block text-md dark:text-white ${e.hint&&`-mb-1`}`,children:e.label}),e.hint&&(0,Y.jsx)(E,{children:e.hint})]})]},e.value)),a&&(0,Y.jsx)(E,{color:i?`red`:``,children:a})]}),(s||i)&&(0,Y.jsx)(D,{className:i?`border-red`:``})]}),Ni=({children:e,gap:t=`md`,className:n})=>{let r=`gap-3`;switch(t){case`sm`:r=`gap-2`;break;case`md`:r=`gap-3`;break;case`lg`:r=`gap-4`;break;default:break}return n=P(`flex flex-col`,r,n),(0,Y.jsx)(`div`,{className:n,children:e})},Pi=({heading:e,children:t,className:n})=>(n=P(`w-full p-[8vmin] pt-5`,n),(0,Y.jsxs)(`div`,{className:n,children:[e&&(0,Y.jsx)(A,{className:`mb-8`,children:e}),t]})),Fi=({items:e,backIcon:t=!1,snapBackIcon:n=!0,onBack:r,containerClassName:i,itemClassName:a,activeItemClassName:o,separatorClassName:s})=>{let c=e.length,l=0;return i=P(`flex items-center gap-2`,i),o=P(`font-bold`,o),a=P(a),(0,Y.jsxs)(`div`,{className:i,children:[t&&(0,Y.jsx)(q,{className:n?`mr-1`:`mr-6`,icon:`arrow-left`,iconColorClass:`dark:text-white`,size:`sm`,link:!0,onClick:r}),e.map(e=>{let t=l===c-1?(0,Y.jsx)(`span`,{className:o,children:e.label}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{className:`${a} ${e.onClick&&`-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900`}`,type:`button`,onClick:e.onClick,children:e.label},`bc-${l}`),(0,Y.jsx)(`span`,{className:s,children:`/`})]});return l+=1,t})]})},Ii=({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`,okColor:d=`black`,previewToolbar:p=!0,leftToolbar:m=!0,rightToolbar:h=!0,deviceSelector:g=!0,siteLink:_,previewToolbarURLs:v,previewBgColor:y=`grey`,selectedURL:b,previewToolbarTabs:x,previewToolbarBreadcrumbs:S,buttonsDisabled:C,sidebarButtons:w,sidebarHeader:E,sidebarPadding:D=!0,sidebarContentClasses:O,enableCMDS:k=!0,backDropClick:j,onCancel:M,onOk:F,afterClose:I,onSelectURL:R,onSelectDesktopView:z,onSelectMobileView:B,onBreadcrumbsBack:ee})=>{let V=N(),{setGlobalDirtyState:te}=T();(0,J.useEffect)(()=>{te(c)},[c,te]),(0,J.useEffect)(()=>{if(F){let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),F())};if(k)return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}}});let[ne,H]=(0,J.useState)(`desktop`);if(ne===`mobile`&&g?s=(0,Y.jsx)(ar,{"data-testid":`preview-mobile`,children:s}):ne===`desktop`&&g&&(s=(0,Y.jsx)(ir,{"data-testid":`preview-desktop`,children:s})),p){let e=(0,Y.jsx)(Y.Fragment,{});v?e=(0,Y.jsx)(Te,{options:v,selectedOption:v.find(e=>e.value===b),onSelect:e=>e&&R?.(e.value)}):x?e=(0,Y.jsx)(Xe,{border:!1,selectedTab:b,tabs:x,width:`wide`,onTabChange:R}):S&&(e=(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:!block md:!visible`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:!block md:!visible`,items:S,separatorClassName:`hidden md:!block md:!visible`,backIcon:!0,onBack:ee}));let t=`text-black dark:text-green`,n=`text-grey-500 dark:text-grey-600`,r=g&&(0,Y.jsx)(re,{buttons:[{icon:`laptop`,label:`Desktop`,hideLabel:!0,link:!0,size:`sm`,iconColorClass:ne===`desktop`?t:n,onClick:z||(()=>{H(`desktop`)})},{icon:`mobile`,label:`Mobile`,hideLabel:!0,link:!0,size:`sm`,iconColorClass:ne===`mobile`?t:n,onClick:B||(()=>{H(`mobile`)})}]}),i=``;y===`grey`?i=`bg-grey-50 dark:bg-black`:y===`greygradient`&&(i=`bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black`);let a=P(`absolute inset-y-0 right-[400px] left-0 flex w-full min-w-100 grow flex-col overflow-y-auto`,i),o;_&&(o=(0,Y.jsx)(`div`,{className:`ml-3 border-l border-grey-400 dark:border-grey-800`,children:(0,Y.jsxs)(`a`,{className:`ml-3 flex items-center gap-1`,href:_,rel:`noopener noreferrer`,target:`_blank`,children:[`View site `,(0,Y.jsx)(f,{name:`arrow-top-right`,size:`xs`})]})})),s=(0,Y.jsxs)(`div`,{className:a,children:[p&&(0,Y.jsxs)(`header`,{className:`relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5`,"data-testid":`design-toolbar`,children:[m&&(0,Y.jsx)(`div`,{className:`absolute left-8 flex h-full items-center`,children:e}),h&&(0,Y.jsxs)(`div`,{className:`absolute right-8 flex h-full items-center`,children:[r,o]})]}),(0,Y.jsx)(`div`,{className:`flex grow items-center justify-center text-grey-400`,children:s})]})}let ie=[];return w||(ie.push({key:`cancel-modal`,label:l,onClick:M||(()=>{qe(c,()=>{V.remove(),I?.()})}),disabled:C}),ie.push({key:`ok-modal`,label:u,color:d,onClick:F,disabled:C})),(0,Y.jsx)(L,{afterClose:I,animate:!1,backDropClick:j,dirty:c,footer:!1,height:a,padding:!1,size:r,testId:e,title:``,width:i,hideXOnMobile:!0,children:(0,Y.jsxs)(`div`,{className:`flex h-full grow`,children:[(0,Y.jsx)(`div`,{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${y===`grey`?`bg-grey-50`:`bg-white dark:bg-black`}`,children:s}),o&&(0,Y.jsxs)(`div`,{className:`relative flex size-full flex-col border-l border-grey-100 dark:border-grey-900 [@media(min-width:801px)]:w-auto [@media(min-width:801px)]:basis-[400px]`,children:[E||(0,Y.jsxs)(`div`,{className:`flex max-h-[82px] items-center justify-between gap-3 px-7 py-6`,children:[(0,Y.jsx)(A,{level:n,children:t}),w||(0,Y.jsx)(re,{buttons:ie})]}),(0,Y.jsx)(`div`,{className:`${E?``:`absolute inset-x-0 top-[80px] bottom-0 grow`} ${D&&`p-7 pt-0`} flex flex-col justify-between overflow-y-auto ${O&&O}`,children:o})]})]})})};O.create(Ii);var Li=({offset:e,onTrigger:t})=>{let n=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let e=new IntersectionObserver(e=>{e[0].intersectionRatio<=0||t()});return n.current&&e.observe(n.current),()=>e.disconnect()},[t]),(0,Y.jsx)(`div`,{ref:n,className:`absolute w-full`,style:{bottom:e}})},Ri=({className:e,children:t,colSpan:n,sticky:r=!1,...i})=>(0,Y.jsx)(`th`,{className:P(`pr-6! pl-0! text-left align-top`,r&&`sticky top-0 bg-white`,i.onClick&&`hover:cursor-pointer`,e),colSpan:n,...i,children:(0,Y.jsx)(A,{className:`whitespace-nowrap`,level:6,children:t})}),zi=({left:e,center:t,right:n,sticky:r=!0,containerClassName:i,children:a})=>{let o=P(`z-50 h-22 min-h-[92px] p-8`,!a&&`flex items-center justify-between gap-3`,r&&`sticky top-0`,i);return a||(e&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center`,n&&t&&`basis-1/3`,!n&&t&&`basis-1/2`),children:e}),t&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center justify-center`,e&&n&&`basis-1/3`,(e&&!n||!e&&n)&&`basis-1/2`),children:t}),n&&=(0,Y.jsx)(`div`,{className:P(`flex flex-auto items-center justify-end`,e&&t&&`basis-1/3`,!e&&t&&`basis-1/2`),children:n})),(0,Y.jsx)(`div`,{className:o,children:a||(0,Y.jsxs)(Y.Fragment,{children:[e,t,n]})})},Bi=n(((e,t)=>{t.exports=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...e)=>console.error(`SEMVER`,...e):()=>{}})),Vi=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}})),Hi=n(((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Vi(),a=Bi();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*$`)})),Ui=n(((e,t)=>{var n=Object.freeze({loose:!0}),r=Object.freeze({});t.exports=e=>e?typeof e==`object`?e:n:r})),Wi=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)}})),Gi=n(((e,t)=>{var n=Bi(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=Vi(),{safeRe:a,t:o}=Hi(),s=Ui(),{compareIdentifiers:c}=Wi(),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}}})),Ki=t(n(((e,t)=>{var n=Gi();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 qi(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,Ki.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 Ji(e,t){let n=!!e.match?.(/production/i);return!!(n&&t!==`mysql8`||!n&&t===`mysql5`)}function Yi({label:e,version:t}){let n=qi(t);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`strong`,{children:[e,`:`]}),` `,n?(0,Y.jsx)(`a`,{className:`text-green`,href:n,rel:`noopener noreferrer`,target:`_blank`,children:t}):t]})}var Xi=O.create(()=>{let{updateRoute:e}=W(),t=K().config,n=Oe();function r(){return new Date().getFullYear()}function i(){return!!t.enableDeveloperExperiments}function a(){return!t.hostSettings?.siteId}return(0,Y.jsx)(L,{afterClose:()=>{e(``)},cancelLabel:``,footer:(0,Y.jsx)(Y.Fragment,{}),topRightContent:`close`,width:540,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 pb-7`,children:[(0,Y.jsx)(rt,{className:`h-auto w-[120px] dark:invert`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-1.5`,children:[n?.message&&(0,Y.jsxs)(`div`,{className:`gh-prose-links mb-4 rounded-sm border border-green p-5`,children:[(0,Y.jsx)(`strong`,{children:`Update available!`}),(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:n.message}})]}),(0,Y.jsx)(Yi,{label:`Version`,version:t.version}),a()&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Environment:`}),` `,t.environment]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Database:`}),` `,t.database]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Mail:`}),` `,t.mail?t.mail:`Native`]})]}),i()&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:`Developer experiments:`}),` Enabled`]}),a()&&Ji(t.environment,t.database)&&(0,Y.jsxs)(`div`,{className:`text-red-500 dark:text-red-400`,children:[`You are running an unsupported database in production. Please `,(0,Y.jsx)(`a`,{href:`https://ghost.org/docs/faq/supported-databases/`,rel:`noopener noreferrer`,target:`_blank`,children:`upgrade to MySQL 8`}),`.`]})]}),(0,Y.jsx)(D,{}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.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,Y.jsx)(f,{name:`book-open`,size:`sm`}),` User documentation`]}),(0,Y.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,Y.jsx)(f,{name:`question-circle`,size:`sm`}),` Get help with Ghost`]}),(0,Y.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,Y.jsx)(f,{name:`angle-brackets`,size:`sm`}),` Get involved`]})]}),(0,Y.jsx)(D,{}),(0,Y.jsxs)(`p`,{className:`max-w-[460px] text-sm`,children:[`Copyright © 2013 – `,r(),` Ghost Foundation, released under the `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://github.com/TryGhost/Ghost/blob/main/LICENSE`,rel:`noopener noreferrer`,target:`_blank`,children:`MIT license`}),`. `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost`}),` is a registered trademark of `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/trademark/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Foundation Ltd`}),`.`]})]})})}),Zi=O.create(()=>{let e=N(),{updateRoute:t}=W(),[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)({name:``}),{mutateAsync:o}=Le(),s=ve(),c=g();return(0,J.useEffect)(()=>{s?.isLimited(`customIntegrations`)&&s.errorIfWouldGoOverLimit(`customIntegrations`).catch(n=>{n instanceof de&&(O.show(he,{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,Y.jsx)(L,{afterClose:()=>{t(`integrations`)},okColor:`black`,okLabel:`Add`,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,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsx)(U,{marginBottom:!1,marginTop:!1,children:(0,Y.jsx)(I,{autoFocus:!0,error:!!i.name,hint:i.name,maxLength:191,placeholder:`Custom integration`,title:`Name`,value:n,onChange:e=>r(e.target.value),onInput:()=>{i.name&&a({name:``})}})})})})}),Qi=O.create(()=>{let e=N(),{updateRoute:t}=W(),n=ce(`automations`)?`emails`:`newsletters`,r=g(),[i,a]=(0,J.useState)(!0),[o,s]=(0,J.useState)(null),{data:c}=qn({searchParams:{filter:`newsletters.status:active+email_disabled:0`,limit:`1`,page:`1`,include:`newsletters,labels`}}),{mutateAsync:l}=Qn(),{formState:u,updateForm:d,saveState:f,handleSave:p,errors:m,clearError:h}=jt({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}}),_=ve();(0,J.useEffect)(()=>{if(!_){a(!1);return}_.errorIfWouldGoOverLimit(`newsletters`).catch(e=>{if(e instanceof de)s(e);else throw e}).finally(()=>{a(!1)})},[_]);let v=c?.meta?.pagination.total;return(0,J.useEffect)(()=>{o&&(O.show(he,{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,Y.jsx)(L,{afterClose:()=>{t(n)},backDropClick:!1,okColor:`black`,okDisabled:f===`saving`,okLabel:`Create`,okLoading:f===`saving`,size:`sm`,testId:`add-newsletter-modal`,title:`Create newsletter`,onOk:async()=>{await p()&&e.remove()},children:(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!0,children:[(0,Y.jsx)(I,{autoFocus:!0,error:!!m.name,hint:m.name,maxLength:191,placeholder:`Weekly roundup`,title:`Name`,value:u.name,onChange:e=>d(t=>({...t,name:e.target.value})),onKeyDown:()=>h(`name`)}),(0,Y.jsx)(z,{maxLength:2e3,title:`Description`,value:u.description,onChange:e=>d(t=>({...t,description:e.target.value}))}),(0,Y.jsx)(vt,{checked:u.optInExistingSubscribers,direction:`rtl`,hint:u.optInExistingSubscribers?`This newsletter will be available to all members. Your ${v===void 0?``:H(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.`,label:`Opt-in existing subscribers`,labelStyle:`heading`,onChange:e=>d(t=>({...t,optInExistingSubscribers:e.target.checked}))})]})})}),$i=O.create(()=>{let e=O.useModal(),{updateRoute:t}=W(),{data:{integrations:n}={integrations:[]}}=F(),r=n.find(({slug:e})=>e===`ghost-core-content`)?.api_keys?.find(e=>e.type===`content`);return(0,Y.jsxs)(L,{afterClose:()=>{t(`integrations`)},cancelLabel:``,footer:(0,Y.jsxs)(`div`,{className:`mx-8 flex w-full items-center justify-between`,children:[(0,Y.jsx)(q,{color:`outline`,href:`https://ghost.org/docs/content-api/`,label:(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[`Open docs `,(0,Y.jsx)(f,{name:`arrow-top-right`,size:`xs`})]}),rel:`noopener noreferrer`,tag:`a`,target:`_blank`}),(0,Y.jsx)(q,{color:`black`,label:`Close`,onClick:()=>{t(`integrations`),e.remove()}})]}),testId:`content-api-modal`,title:``,stickyFooter:!0,children:[(0,Y.jsx)(it,{detail:`Access your content programmatically`,icon:(0,Y.jsx)(f,{name:`angle-brackets`,size:56}),title:`Content API`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[(0,Y.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,Y.jsx)(Ge,{keys:[{label:`Content API key`,text:r?.secret},{label:`API URL`,text:window.location.origin+d().subdir}]})]})]})}),ea=O.create(({recommendation:e,animate:t})=>{let n=N(),{updateRoute:r,route:i}=W(),{mutateAsync:a}=te(),o=g(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:d,clearError:f,setErrors:h}=jt({initialState:{...e},onSave:async e=>{await a(e),n.remove(),p({title:`Recommendation added`,type:`success`}),B(`Recommendation Added`,{oneClickSubscribe:e.one_click_subscribe}),r(`recommendations`)},onSaveError:o,onValidate:e=>xe(e)}),_=`Add`,v=!1;return u===`saving`?v=!0:u===`saved`&&(_=`Added`),(0,Y.jsx)(L,{afterClose:()=>{r(`recommendations`)},animate:t??!0,backDropClick:!1,cancelLabel:`Cancel`,dirty:!0,leftButtonProps:{label:`Back`,icon:`arrow-left`,iconColorClass:`text-black dark:text-white`,link:!0,size:`sm`,onClick:()=>{u!==`saving`&&(n.remove(),O.show(ra,{pathName:i,animate:!1,recommendation:{...s}}))}},okColor:`black`,okLabel:_,okLoading:v,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,stickyFooter:!0,onCancel:()=>{u!==`saving`&&(n.remove(),r(`recommendations`))},onOk:async()=>{if(u!==`saving`){m();try{await l({force:!0})}catch{p({type:`error`,title:`Something went wrong when adding this recommendation, please try again.`})}}},children:(0,Y.jsx)(dt,{clearError:f,errors:d,formState:s,setErrors:h,showURL:!1,updateForm:c})})}),ta=e=>ye(e).save||``,na=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},ra=O.create(({searchParams:e,recommendation:t,animate:n})=>{let[r,i]=(0,J.useState)(!1),a=N(),{updateRoute:o}=W(),{mutateAsync:s}=G(),c=t?``:e?.get(`url`)??``,{save:l}=c?ye(c):{save:``},d=J.useRef(!1),[f,h]=J.useState(!!l),{formState:g,updateForm:_,handleSave:v,errors:y,saveState:b,clearError:x}=jt({initialState:t??{title:``,url:l||``,description:``,excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let e=new URL(g.url),t=e.hostname.replace(`www.`,``),n={...g,url:e.toString()},{recommendations:r=[]}=await s(e);if(!r||r.length===0)return;let i=r[0];if(i.id)throw new u(`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(),O.show(ea,{animate:!1,recommendation:n})},onValidate:()=>{let e={};return na(e,g.url),f&&h(Object.keys(e).length===0),e}}),S=J.useCallback(async()=>{if(b!==`saving`){m();try{if(await v({force:!0}))return}catch(e){p({type:`error`,title:e instanceof u?e.message:`Something went wrong while checking this URL, please try again.`})}f&&h(!1)}},[v,b,f,h]);return J.useEffect(()=>{f&&!d.current&&(d.current=!0,S())},[f,S]),(0,J.useEffect)(()=>{r&&(S(),i(!1))},[g]),f?(0,Y.jsx)(L,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,footer:!1,header:!1,size:`sm`,children:(0,Y.jsx)(`div`,{className:`flex flex-col items-center justify-center p-8`,children:(0,Y.jsx)(Fe,{})})}):(0,Y.jsxs)(L,{afterClose:()=>{o(`recommendations`)},animate:n??!0,backDropClick:!1,okColor:`black`,okLabel:`Next`,okLoading:b===`saving`,size:`sm`,testId:`add-recommendation-modal`,title:`Add recommendation`,onOk:S,children:[(0,Y.jsxs)(`p`,{className:`mt-4`,children:[`You can recommend `,(0,Y.jsx)(`strong`,{children:`any site`}),` your audience will find valuable, not just those published on Ghost.`]}),(0,Y.jsx)(U,{marginBottom:!1,marginTop:!0,children:(0,Y.jsx)(I,{autoFocus:!0,error:!!y.url,hint:y.url||(0,Y.jsxs)(Y.Fragment,{children:[`Need inspiration? `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://www.ghost.org/explore`,rel:`noopener noreferrer`,target:`_blank`,children:`Explore thousands of sites`}),` to recommend`]}),maxLength:2e3,placeholder:`https://www.example.com`,title:`URL`,value:g.url,onBlur:()=>{let e=ta(g.url);_(t=>({...t,url:e}))},onChange:e=>{x?.(`url`),_(t=>({...t,url:e.target.value}))},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),_(e=>({...e,url:ta(g.url)})),i(!0))}})})]})});function ia(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),e(...r)},t)}}var aa=({generateContent:e,className:t,height:n,width:r,parentClassName:i,testId:o,addDelay:s=!1})=>{let[c,l]=(0,J.useState)(0),u=[(0,J.useRef)(null),(0,J.useRef)(null)],[d,f]=(0,J.useState)(0);return(0,J.useEffect)(()=>{let t=+(c===0),n=u[t].current;if(n){e(n);let r=()=>{s?setTimeout(()=>{l(t)},500):l(t)};return n.addEventListener(`load`,r),()=>{n.removeEventListener(`load`,r)}}},[e]),(0,J.useEffect)(()=>{let e=u[c].current,t=ia(()=>{f(e?.contentWindow?.scrollY||0)},250);return e?.contentWindow?.addEventListener(`scroll`,t),()=>{e?.contentWindow?.removeEventListener(`scroll`,t)}},[c,u]),(0,J.useEffect)(()=>{let e=u[c].current;if(e)try{e.contentWindow?.scrollTo(0,d)}catch(e){a(e)}},[d,c,u]),(0,Y.jsxs)(`div`,{className:i,"data-testid":o,children:[(0,Y.jsx)(`iframe`,{ref:u[0],className:`${t} ${c===0?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===0,frameBorder:`0`,height:n,title:`Buffered Preview 1`,width:r}),(0,Y.jsx)(`iframe`,{ref:u[1],className:`${t} ${c===1?`z-20 opacity-100`:`z-10 opacity-0`}`,"data-visible":c===1,frameBorder:`0`,height:n,title:`Buffered Preview 2`,width:r})]})},oa=(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()},sa=({announcementBackgroundColor:e,announcementContent:t,url:n,visibility:r})=>{let i=(0,J.useMemo)(()=>r,[r?.join(`,`)]);return(0,Y.jsx)(aa,{addDelay:!0,className:`absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]`,generateContent:(0,J.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":oa(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`,testId:`announcement-bar-preview-iframe`,width:`100%`})},ca=({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,Y.jsxs)(U,{children:[(0,Y.jsx)(Zr,{nodes:`MINIMAL_NODES`,placeholder:`Highlight breaking news, offers or updates`,title:`Announcement`,value:e,onBlur:c,onChange:t}),(0,Y.jsx)(cr,{isExpanded:!1,picker:!1,swatches:[{hex:`#08090c`,title:`Dark`,value:`dark`},{hex:`#ffffff`,title:`Light`,value:`light`},{hex:n||`#ffdd00`,title:`Accent`,value:`accent`}],swatchSize:`lg`,title:`Background color`,value:r,onSwatchChange:e=>{e!==null&&i(e)},onTogglePicker:()=>{}}),(0,Y.jsx)(sr,{checkboxes:l,title:`Visibility`})]})},la=O.create(()=>{let{siteData:e}=K(),{localSettings:t,updateSetting:n,handleSave:r,okProps:i}=be({savingDelay:500}),[a]=Nn(t,[`announcement_content`]),[o]=Nn(t,[`accent_color`]),[s]=Nn(t,[`announcement_background`]),[c]=Nn(t,[`announcement_visibility`]),[l]=Nn(t,[`paid_members_enabled`]),u=JSON.parse(c?.toString()||`[]`),{updateRoute:d}=W(),[f,m]=(0,J.useState)(`homepage`),h=e=>{n(`announcement_background`,e)},g=(e,t)=>{let r=u.indexOf(e);r===-1&&t?u.push(e):u.splice(r,1),n(`announcement_visibility`,JSON.stringify(u))},_=(0,J.useRef)(Ie(e=>{n(`announcement_content`,e)},500)),v=(0,Y.jsx)(ca,{accentColor:o,announcementBackgroundColor:s,announcementContent:a,announcementTextHandler:e=>{_.current(e)},paidMembersEnabled:l,toggleColorSwatch:h,toggleVisibility:g,visibility:c,onBlur:()=>{}}),{data:{posts:[y]}={posts:[]}}=Rt({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),b=[];y&&(b=[{id:`homepage`,title:`Homepage`},{id:`post`,title:`Post`}]);let x=e=>{b.length&&m(e)},S=Wn(e);switch(f){case`homepage`:S=Wn(e);break;case`post`:S=y.url;break}let C=(0,Y.jsx)(sa,{announcementBackgroundColor:s,announcementContent:a,url:S,visibility:u});return(0,Y.jsx)(Ii,{afterClose:()=>{d(`announcement-bar`)},buttonsDisabled:i.disabled,cancelLabel:`Close`,deviceSelector:!0,dirty:!1,okColor:i.color,okLabel:i.label||`Save`,preview:C,previewBgColor:`greygradient`,previewToolbarTabs:b,selectedURL:f,sidebar:v,testId:`announcement-bar-modal`,title:`Announcement`,titleHeadingLevel:5,onOk:async()=>{await r({fakeWhenUnchanged:!0})||p({type:`error`,message:`An error occurred while saving your changes. Please try again.`})},onSelectURL:x})}),ua=t(At(),1),da=[{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`}]}],fa=e=>da.flatMap(({options:e})=>e).find(t=>t.value===e)?.label,pa=h({method:`POST`,path:()=>`/webhooks/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:_e,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})}}}),ma=h({method:`PUT`,path:e=>`/webhooks/${e.id}/`,body:e=>({webhooks:[e]}),updateQueries:{dataType:_e,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)}))}}}),ha=h({method:`DELETE`,path:e=>`/webhooks/${e}/`,updateQueries:{dataType:_e,emberUpdateType:`createOrUpdate`,update:(e,t,n)=>({...t,integrations:t.integrations.map(e=>({...e,webhooks:e.webhooks?.filter(e=>e.id!==n)}))})}}),ga=O.create(({webhook:e,integrationId:t})=>{let n=N(),{mutateAsync:r}=pa(),{mutateAsync:i}=ma(),a=g(),{formState:o,updateForm:s,handleSave:c,errors:l,clearError:u}=jt({initialState:e||{},onSave:async()=>{o.id?await i(o):await r({...o,integration_id:t})},onSaveError:a,onValidate:()=>{let e={};return o.name||(e.name=`Enter a name`),o.event||(e.event=`Select an event`),o.target_url||(e.target_url=`Enter a target URL`),o.target_url&&!ua.default.isURL(o.target_url,{require_tld:!1})&&(e.target_url=`Enter a valid URL`),e}});return(0,Y.jsx)(L,{okColor:`black`,okLabel:e?`Update`:`Add`,size:`sm`,testId:`webhook-modal`,title:`Add webhook`,formSheet:!0,onOk:async()=>{await c()&&n.remove()},children:(0,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!1,children:[(0,Y.jsx)(I,{error:!!l.name,hint:l.name,maxLength:191,placeholder:`Custom webhook`,title:`Name`,value:o.name,onChange:e=>s(t=>({...t,name:e.target.value})),onKeyDown:()=>u(`name`)}),(0,Y.jsx)(Te,{error:!!l.event,hint:l.event,options:da,prompt:`Select an event`,selectedOption:da.flatMap(e=>e.options).find(e=>e.value===o.event),testId:`event-select`,title:`Event`,hideTitle:!0,onSelect:e=>{s(t=>({...t,event:e?.value})),u(`event`)}}),(0,Y.jsx)(I,{error:!!l.target_url,hint:l.target_url,maxLength:2e3,placeholder:`https://example.com`,title:`Target URL`,type:`url`,value:o.target_url,onChange:e=>s(t=>({...t,target_url:e.target.value})),onKeyDown:()=>u(`target_url`)}),(0,Y.jsx)(I,{maxLength:191,placeholder:`https://example.com`,title:`Secret`,value:o.secret||void 0,onChange:e=>s(t=>({...t,secret:e.target.value}))})]})})})}),_a=({integration:e})=>{let{mutateAsync:t}=ha(),n=g(),r=e=>{O.show(me,{title:`Are you sure?`,prompt:`Deleting this webhook may prevent the integration from functioning.`,okColor:`red`,okLabel:`Delete Webhook`,onOk:async r=>{try{await t(e),r?.remove(),p({message:`Webhook deleted`,type:`info`})}catch(e){n(e)}}})};return(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(gt,{children:[(0,Y.jsxs)(ot,{bgOnHover:!1,children:[(0,Y.jsxs)(Ri,{children:[e.webhooks?.length||0,` `,e.webhooks?.length===1?`webhook`:`webhooks`]}),(0,Y.jsx)(Ri,{children:`Last triggered`})]}),e.webhooks?.map(t=>(0,Y.jsxs)(ot,{action:(0,Y.jsx)(q,{color:`red`,label:`Delete`,link:!0,onClick:e=>{e?.stopPropagation(),r(t.id)}}),bgOnHover:!1,hideActions:!0,onClick:()=>{O.show(ga,{webhook:t,integrationId:e.id})},children:[(0,Y.jsxs)(ut,{className:`w-3/4`,children:[(0,Y.jsx)(`div`,{className:`font-semibold`,children:t.name}),(0,Y.jsxs)(`div`,{className:`mt-1 grid grid-cols-[max-content_1fr] gap-1 text-sm leading-snug`,children:[(0,Y.jsx)(`span`,{className:`text-grey-600`,children:`Event:`}),(0,Y.jsx)(`span`,{children:fa(t.event)}),(0,Y.jsx)(`span`,{className:`text-grey-600`,children:`URL:`}),(0,Y.jsx)(`span`,{className:`line-clamp-3 break-all`,title:t.target_url,children:t.target_url})]})]}),(0,Y.jsx)(ut,{className:`w-1/4 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`})})]},t.id))]}),(0,Y.jsx)(`div`,{className:`mt-5`,children:(0,Y.jsx)(q,{color:`green`,icon:`add`,iconColorClass:`text-green`,label:`Add webhook`,size:`sm`,link:!0,onClick:()=>{O.show(ga,{integrationId:e.id})}})})]})},va=({integration:e})=>{let t=N(),{updateRoute:n}=W(),{mutateAsync:r}=et(),{mutateAsync:i}=ke(),{mutateAsync:a}=pt(),o=g(),{formState:s,updateForm:c,handleSave:l,saveState:u,errors:f,clearError:p,okProps:m}=jt({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}}),h=e.api_keys?.find(e=>e.type===`admin`),_=e.api_keys?.find(e=>e.type===`content`),[v,y]=(0,J.useState)(!1),[b,x]=(0,J.useState)(!1);(0,J.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`;O.show(me,{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,Y.jsxs)(L,{afterClose:()=>{n(`integrations`)},buttonsDisabled:m.disabled,cancelLabel:`Close`,dirty:u===`unsaved`,okColor:m.color,okLabel:m.label||`Save`,size:`md`,testId:`custom-integration-modal`,title:s.name||`Custom integration`,stickyFooter:!0,onOk:async()=>{await l({fakeWhenUnchanged:!0})},children:[(0,Y.jsxs)(`div`,{className:`mt-7 flex w-full flex-col gap-7 md:flex-row`,children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{height:`100px`,id:`custom-integration-icon`,imageURL:s.icon_image||void 0,width:`100px`,onDelete:()=>c(e=>({...e,icon_image:null})),onUpload:async e=>{try{let t=Ne(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,Y.jsx)(`div`,{className:`flex grow flex-col`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(I,{error:!!f.name,hint:f.name,maxLength:191,title:`Title`,value:s.name,onChange:e=>c(t=>({...t,name:e.target.value})),onKeyDown:()=>p(`name`)}),(0,Y.jsx)(I,{maxLength:2e3,title:`Description`,value:s.description||``,onChange:e=>c(t=>({...t,description:e.target.value}))}),(0,Y.jsx)(Ge,{keys:[{label:`Content API key`,text:_?.secret,hint:b?(0,Y.jsx)(`div`,{className:`text-green`,children:`Content API Key was successfully regenerated`}):void 0,onRegenerate:()=>_&&S(_,x)},{label:`Admin API key`,text:h?.secret,hint:v?(0,Y.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>h&&S(h,y)},{label:`API URL`,text:window.location.origin+d().subdir}]})]})})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(_a,{integration:e})})]})},ya=O.create(({params:e})=>{let{data:{integrations:t}={}}=F(),n=t?.find(({id:t})=>t===e?.id);return n?(0,Y.jsx)(va,{integration:n}):null});function ba(e){return typeof e==`object`&&!!e}function xa(e){return[...e.errors||[],...e.warnings||[]]}function Sa(e=[]){let t=[],n=[],r=[];return e.forEach(e=>{ba(e.details)?xa(e.details).forEach(e=>{e.fatal?t.push(e):n.push(e)}):r.push(e.details)}),{blockingProblems:t,secondaryProblems:n,stringErrors:r}}function Ca(e){return[...e.errors||[],...e.warnings||[]]}function wa(e){return e.level===`warning`?`Warning`:e.level===`recommendation`?`Recommendation`:`Error`}function Ta(e){return e.level===`warning`?`warning`:e.level===`recommendation`?`secondary`:`destructive`}function Ea(e){return`${e} non-blocking ${e===1?`issue`:`issues`}`}function Da({problem:e}){return(0,Y.jsxs)(`div`,{className:`space-y-3`,children:[(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.details},className:`text-sm text-muted-foreground`}),e.failures?.length>0&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h6`,{className:`mb-1 text-xs font-semibold text-muted-foreground uppercase`,children:`Affected files`}),(0,Y.jsx)(`ul`,{className:`space-y-1 text-sm text-muted-foreground`,children:e.failures.map(e=>(0,Y.jsxs)(`li`,{children:[(0,Y.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-xs text-foreground`,children:e.ref}),e.message?(0,Y.jsxs)(`span`,{children:[`: `,e.message]}):null]},`${e.ref}-${e.message||``}`))})]})]})}function Oa({problem:e,prominent:t=!1}){let[n,r]=(0,J.useState)(t),i=wa(e);return(0,Y.jsxs)(`div`,{className:`rounded-lg border ${t?`border-destructive/30 bg-background`:`border-border bg-background`} p-4`,children:[(0,Y.jsxs)(`button`,{className:`flex w-full items-start justify-between gap-3 text-left`,type:`button`,onClick:()=>r(!n),children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,Y.jsx)(Cn,{variant:Ta(e),children:i}),e.code&&(0,Y.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.code})]}),(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:e.rule},className:`text-sm font-medium text-foreground`})]}),(0,Y.jsx)(Zt,{className:`mt-1 size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Y.jsx)(`div`,{className:`mt-4 border-t border-border pt-4`,children:(0,Y.jsx)(Da,{problem:e})})]})}function ka({defaultOpen:e,problems:t}){let[n,r]=(0,J.useState)(e),i=t.length;(0,J.useEffect)(()=>{r(e)},[e]);let a=(0,J.useMemo)(()=>[...t].sort((e,t)=>{let n={Error:0,Warning:1,Recommendation:2};return n[wa(e)]-n[wa(t)]}),[t]);return i?(0,Y.jsxs)(`div`,{className:`mt-6 border-t border-border pt-5`,children:[(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`text-sm font-semibold text-foreground`,children:[`Review `,Ea(i)]}),(0,Y.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:n?`Hide details`:`Show details`})]}),(0,Y.jsx)(Zt,{className:`size-4 shrink-0 text-muted-foreground transition-transform ${n?`rotate-180`:``}`})]}),n&&(0,Y.jsx)(`div`,{className:`mt-4 space-y-3`,children:a.map(e=>(0,Y.jsx)(Oa,{problem:e},e.code))})]}):null}function Aa({message:e}){return(0,Y.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Y.jsx)(tn,{className:`mt-0.5 size-4 shrink-0`}),(0,Y.jsx)(`p`,{children:e})]})})}function ja({children:e,title:t,variant:n}){let r=n===`success`?en:tn;return(0,Y.jsx)(Sn,{role:n===`destructive`?`alert`:`status`,size:`lg`,variant:n===`success`?`success`:`destructive`,children:(0,Y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Y.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,Y.jsx)(r,{className:`size-5 ${n===`success`?`text-state-success`:`text-destructive`}`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-xl font-semibold tracking-tight ${n===`success`?`text-state-success`:`text-destructive`}`,children:t}),(0,Y.jsx)(`div`,{className:`mt-1 text-sm text-foreground`,children:e})]})]})})}var Ma=O.create(({title:e,prompt:t,fatalErrors:n,validationDetailsDefaultOpen:r,onRetry:i})=>{let{data:a}=Pn(),o=r??a?.config?.environment===`development`,{blockingProblems:s,secondaryProblems:c,stringErrors:l}=Sa(n),u=s.length+l.length;return(0,Y.jsx)(Je,{cancelLabel:`Close`,okColor:`black`,okLabel:`Retry`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`div`,{className:`space-y-5`,children:[(0,Y.jsx)(`div`,{className:`text-sm text-foreground`,children:t??(0,Y.jsxs)(Y.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,Y.jsxs)(`div`,{className:`space-y-3`,children:[s.map(e=>(0,Y.jsx)(Oa,{problem:e,prominent:!0},e.code)),l.map(e=>(0,Y.jsx)(Aa,{message:e},e))]}),(0,Y.jsx)(ka,{defaultOpen:o,problems:c})]})}),stickyFooter:!0,title:e,onOk:i})}),Na=()=>{let e=En();return{supportsCustomFonts:!(e.data?.themes[0])?.warnings?.some(e=>e.code===`GS051-CUSTOM-FONTS`),refreshActiveThemeData:(0,J.useCallback)(()=>{e.refetch()},[e])}};function Pa(e){let t=e.package?.name||e.name;return Yn(e)?t+=` (default)`:Dn(e)?t+=` (legacy)`:e.package?.name!==e.name&&(t=(0,Y.jsxs)(`span`,{className:`md:text-base`,children:[t,` `,(0,Y.jsxs)(`span`,{className:`text-grey-600`,children:[`(`,e.name,`)`]})]})),xn(e)&&(t=(0,Y.jsxs)(`span`,{className:`font-bold md:text-base`,children:[t,` — `,(0,Y.jsx)(`span`,{className:`text-green`,children:` Active`})]})),t}function Fa(e){return e.package?.version||`1.0`}var Ia=({theme:e})=>{let{mutateAsync:t}=vn(),{mutateAsync:n}=_n(),{refreshActiveThemeData:r}=Na(),i=g(),{route:a,updateRoute:o}=W(),{checkThemeLimitError:s}=ht(),l=async()=>{try{await t(e.name),r(),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme`]})})}catch(e){let t=null;e instanceof c&&e.response?.status===422&&e.data?.errors?t=e.data.errors:i(e);let n=(0,Y.jsx)(Y.Fragment,{children:`This theme couldn't be activated because Ghost found a blocking validation error. Fix the issue below and try again.`});t&&O.show(Ma,{title:`Theme not activated`,prompt:n,fatalErrors:t,onRetry:async e=>{e?.remove(),l()}})}},u=async()=>{let{apiRoot:t}=d();y(`${t}/themes/${e.name}/download`)},f=async()=>{O.show(me,{title:`Are you sure you want to delete this?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`You are about to delete `,(0,Y.jsxs)(`strong`,{children:[`"`,e.name,`".`]}),` This is permanent! We warned you, k? Maybe download`,` `,(0,Y.jsx)(`span`,{className:`cursor-pointer text-green-500`,onClick:()=>{u()},children:`your theme before continuing`})]}),okLabel:`Delete`,okRunningLabel:`Deleting`,okColor:`red`,onOk:async t=>{try{await n(e.name),t?.remove()}catch(e){i(e)}}})},m=async()=>{let t=await s(`.`);if(t){O.show(he,{prompt:t,onOk:()=>o({route:`/pro`,isExternal:!0})});return}o(`theme/edit/${encodeURIComponent(e.name)}?from=${encodeURIComponent(a??``)}`)},h=[];xn(e)||h.push((0,Y.jsx)(q,{className:`ml-2`,color:`green`,label:`Activate`,link:!0,onClick:l},`activate`));let _=[{id:`edit-code`,label:`Edit code`,onClick:m},{id:`download`,label:`Download`,onClick:u}];return gn(e)&&_.push({id:`delete`,label:`Delete`,onClick:f}),(0,Y.jsxs)(`div`,{className:`-mr-3 flex items-center gap-4`,children:[h,(0,Y.jsx)(ft,{items:_,position:`end`,triggerButtonProps:{iconColorClass:`text-base`,size:`sm`}})]})},La=({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,Y.jsx)(ne,{pageTitle:`Installed themes`,children:e.map(e=>{let t=Pa(e),n=Fa(e);return(0,Y.jsx)(Se,{action:(0,Y.jsx)(Ia,{theme:e}),detail:n,id:`theme-${e.name}`,separator:!1,testId:`theme-list-item`,title:t},e.name)})})),Ra=({themes:e})=>(0,Y.jsx)(Pi,{children:(0,Y.jsx)(La,{themes:e})}),za=``+new URL(`footer-marketplace-bg-cXGt4GLt.png`,import.meta.url).href,Ba=3e3,Va=e=>e.variants&&e.variants.length>0,Ha=e=>{let t=[{category:e.category,previewUrl:e.previewUrl,image:e.image}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},Ua=({onSelectTheme:e})=>{let t=ue(),[n,r]=(0,J.useState)(null),[i,a]=(0,J.useState)(0),o=e=>{r(e),a(e!==null&&Va(e)&&Ha(e).length>1?1:0)};return(0,J.useEffect)(()=>{if(n===null)return;let e=setInterval(()=>{a((i+1)%(Ha(n).length||0))},Ba);return()=>clearInterval(e)},[n,i]),(0,Y.jsxs)(Pi,{heading:`Themes`,children:[(0,Y.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=Va(t),a=Ha(t),s=n===t;return(0,Y.jsxs)(`button`,{className:`flex cursor-pointer flex-col gap-3 text-left`,type:`button`,onClick:()=>{e?.(t)},children:[(0,Y.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,Y.jsx)(Y.Fragment,{children:a.map((e,n)=>(0,Y.jsx)(`img`,{alt:`${t.name} Theme - ${e.category}`,className:P(`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,Y.jsx)(`img`,{alt:`${t.name} Theme`,className:`size-full object-contain`,src:t.image})}),(0,Y.jsxs)(`div`,{className:`relative mt-3`,children:[(0,Y.jsx)(A,{level:4,children:t.name}),r?a.map((e,t)=>(0,Y.jsx)(`span`,{className:P(`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,Y.jsx)(`span`,{className:`text-grey-700`,children:t.category})]})]},t.name)})}),(0,Y.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(${za}) 100% 100% / 35vw no-repeat`},children:[`Find and buy third-party, premium themes from independent developers in the `,(0,Y.jsx)(`a`,{className:`inline-block font-semibold text-lime`,href:`https://ghost.org/themes/`,rel:`noopener noreferrer`,target:`_blank`,children:`Ghost Marketplace →`})]})]})},Wa=O.create(({title:e,installedTheme:t,validationDetailsDefaultOpen:n,onActivate:r})=>{let{mutateAsync:i}=vn(),{refreshActiveThemeData:a}=Na(),o=g(),{data:s}=Pn(),{data:c}=jn(),l=n??s?.config?.environment===`development`,u=Ca(t),d=c?.site?Wn(c.site):void 0,f=`Activate theme`;t.active&&(f=`OK`);let m=t.active?(0,Y.jsx)(`span`,{className:`text-green`,children:`It's live!`}):e,h=t.active?(0,Y.jsxs)(Y.Fragment,{children:[`Your theme `,(0,Y.jsx)(`strong`,{children:t.name}),` was saved successfully and is now visible to your readers.`,d?(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsx)(`a`,{className:`font-semibold text-black hover:underline dark:text-white`,href:d,rel:`noreferrer`,target:`_blank`,children:`Take a look →`})]}):null]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:t.name}),` has been uploaded. Activate it to make it live.`]});return(0,Y.jsx)(Je,{cancelLabel:`Close`,okColor:`black`,okLabel:f,okRunningLabel:`Activating...`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`div`,{className:`space-y-5`,children:[t.active?(0,Y.jsx)(`div`,{className:`space-y-2 text-sm text-foreground`,children:(0,Y.jsx)(`p`,{children:h})}):(0,Y.jsx)(ja,{title:`Uploaded successfully`,variant:`success`,children:(0,Y.jsx)(`div`,{className:`space-y-2`,children:(0,Y.jsx)(`p`,{children:h})})}),(0,Y.jsx)(ka,{defaultOpen:l,problems:u})]})}),stickyFooter:!0,title:m,onOk:async e=>{if(!t.active)try{let e=(await i(t.name)).themes[0];a(),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:e.name}),` is now your active theme.`]})})}catch(e){o(e)}r?.(),e?.remove()}})}),Ga=e=>e.variants&&e.variants.length>0,Ka=e=>{let t=[{image:e.image,category:e.category,previewUrl:e.previewUrl}];return e.variants&&e.variants.length>0&&t.push(...e.variants),t},qa=e=>e.category.toLowerCase(),Ja=({selectedTheme:e,isInstalling:t,installedTheme:n,onBack:r,onInstall:i})=>{let[a,o]=(0,J.useState)(`desktop`),[s,c]=(0,J.useState)(void 0);if(!e)return null;let l=e.previewUrl,u=Ka(e).map(e=>({label:e.category,value:qa(e)}));Ga(e)&&(s===void 0&&c(u[0]),l=Ka(e).find(e=>qa(e)===s?.value)?.previewUrl||l);let d=`Install ${e.name}`;return t?d=`Installing...`:Tn(e)&&!n?.active?d=`Activate ${e.name}`:n&&(d=`Update ${e.name}`),(0,Y.jsxs)(`div`,{className:`absolute inset-0 z-[100]`,children:[(0,Y.jsx)(zi,{containerClassName:`bg-grey-50 dark:bg-black z-[100]`,left:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:!block md:!visible`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:!block md:!visible`,items:[{label:`Change theme`,onClick:r},{label:e.name}],separatorClassName:`hidden md:!block md:!visible`,backIcon:!0,onBack:r}),Ga(e)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`hidden md:!visible md:!block`,children:`–`}),(0,Y.jsx)(Te,{border:!1,controlClasses:{menu:`min-w-max`},fullWidth:!1,options:u,selectedOption:s,clearBg:!0,onSelect:e=>{c(e||void 0)}})]}):null]}),right:(0,Y.jsxs)(`div`,{className:`flex justify-end gap-8`,children:[(0,Y.jsx)(re,{buttons:[{icon:`laptop`,iconColorClass:a===`desktop`?`text-black dark:text-green`:`text-grey-500 dark:text-grey-600`,link:!0,size:`sm`,onClick:()=>{o(`desktop`)}},{icon:`mobile`,iconColorClass:a===`mobile`?`text-black dark:text-green`:`text-grey-500 dark:text-grey-600`,link:!0,size:`sm`,onClick:()=>{o(`mobile`)}}]}),(0,Y.jsx)(q,{color:`green`,disabled:t,label:t?`Installing...`:d,onClick:()=>{i?.()}})]}),sticky:!1}),(0,Y.jsx)(`div`,{className:`flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-grey-50 dark:bg-black`,children:a===`desktop`?(0,Y.jsx)(ir,{children:(0,Y.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})}):(0,Y.jsx)(ar,{children:(0,Y.jsx)(`iframe`,{className:`size-full`,src:l,title:`Theme preview`})})})]})},Ya=({onUpload:e})=>{let t=N();return(0,Y.jsx)(`div`,{className:`-mb-6`,children:(0,Y.jsx)(Ae,{id:`theme-upload`,onUpload:n=>{t.remove(),e(n)},children:(0,Y.jsx)(`div`,{className:`cursor-pointer bg-grey-50 p-10 text-center dark:bg-grey-950`,children:`Click to select or drag & drop zip file`})})})},Xa=({currentTab:e,setCurrentTab:t,themes:n})=>{let r=N(),{updateRoute:i}=W(),{mutateAsync:a}=Un(),{checkThemeLimitError:o,isThemeLimited:s}=ht(),l=g(),[u,d]=(0,J.useState)(),[f,p]=(0,J.useState)(!1);(0,J.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(`/`)},h=async e=>{let r=e?.name.replace(/\.zip$/,``),i=n.map(e=>e.name);Tn({name:r})?O.show(me,{title:`Upload failed`,cancelLabel:`Cancel`,okLabel:``,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{children:[`The default `,(0,Y.jsx)(`strong`,{children:r}),` theme cannot be overwritten.`]}),(0,Y.jsx)(`p`,{children:`Rename your zip file and try again.`})]}),onOk:async e=>{e?.remove()}}):i.includes(r)?O.show(me,{title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsx)(`strong`,{children:r}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,cancelLabel:`Cancel`,okRunningLabel:`Overwriting...`,okColor:`red`,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 c&&e.response?.status===422&&e.data?.errors?i=e.data.errors:l(e)}if(i&&!n){let e=(0,Y.jsx)(Y.Fragment,{children:`This theme couldn't be uploaded because Ghost found a blocking validation error. Fix the issue below and upload the theme again.`});O.show(Ma,{title:`Theme not uploaded`,prompt:e,fatalErrors:i,onRetry:async()=>{r?.remove(),y()}})}if(!n)return;let o=n.themes[0],s=`Upload successful`,u=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:o.name}),` uploaded`]});o.active||(u=(0,Y.jsxs)(Y.Fragment,{children:[u,` `,`Do you want to activate it now?`]})),(o?.errors?.length||o.warnings?.length)&&(s=`Upload successful`,u=(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsxs)(`strong`,{children:[`"`,o.name,`"`]}),` was installed successfully.`]}),o.active||(u=(0,Y.jsxs)(Y.Fragment,{children:[u,`You can activate it when you're ready.`]}))),O.show(Wa,{title:s,prompt:u,installedTheme:o,onActivate:t})},v=(0,Y.jsx)(`div`,{className:`hidden md:!visible md:!block`,children:(0,Y.jsx)(Xe,{border:!1,selectedTab:e,tabs:[{id:`official`,title:`Official themes`},{id:`installed`,title:`Installed`}],onTabChange:e=>{t(e)}})}),y=()=>{u&&(u.enabled?O.show(me,{title:`Upload theme`,prompt:(0,Y.jsx)(Ya,{onUpload:h}),okLabel:``,formSheet:!1}):O.show(he,{title:`Upgrade to enable custom themes`,prompt:u.error||(0,Y.jsxs)(Y.Fragment,{children:[`Your current plan only supports official themes. You can install them from the `,(0,Y.jsx)(`a`,{href:`https://ghost.org/marketplace/`,children:`Ghost theme marketplace`}),`.`]}),onOk:()=>i({route:`/pro`,isExternal:!0})}))};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(zi,{containerClassName:`bg-white dark:bg-black`,left:v,right:(0,Y.jsx)(`div`,{className:`flex items-center gap-14`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(q,{label:`Close`,onClick:()=>{r.remove(),m()}}),(0,Y.jsx)(q,{color:`black`,label:`Upload theme`,loading:f,onClick:y})]})})}),(0,Y.jsx)(`div`,{className:`px-[8vmin] md:hidden`,children:(0,Y.jsx)(Xe,{border:!1,selectedTab:e,tabs:[{id:`official`,title:`Official themes`},{id:`installed`,title:`Installed`}],onTabChange:e=>{t(e)}})})]})},Za=({currentTab:e,onSelectTheme:t,themes:n})=>{switch(e){case`official`:return(0,Y.jsx)(Ua,{onSelectTheme:t});case`installed`:return(0,Y.jsx)(Ra,{themes:n})}return null},Qa=({source:e,themeRef:t})=>{let[n,r]=(0,J.useState)(`official`),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(`desktop`),[c,l]=(0,J.useState)(!1),[u,d]=(0,J.useState)(!1),[f,m]=(0,J.useState)(!1),{updateRoute:h}=W(),_=N(),{data:{themes:v}={}}=On(),{mutateAsync:y}=bn(),{mutateAsync:b}=vn(),{checkThemeLimitError:x}=ht(),S=g(),C=e=>{a(e)};if((0,J.useEffect)(()=>{m(!0)},[]),(0,J.useEffect)(()=>{(async()=>{if(e&&t&&!u&&f){let e=t.split(`/`)[1];if(await x(e)){_.remove();return}let n=v?.map(e=>e.name)||[],r=n.includes(e.toLowerCase()),i=n.indexOf(e.toLowerCase()),a=v?.[i],o=(0,Y.jsxs)(Y.Fragment,{children:[`By clicking below, `,(0,Y.jsx)(`strong`,{children:e}),` will automatically be activated as the theme for your site.`,r&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`br`,{}),`This will overwrite your existing version of `,(0,Y.jsx)(`strong`,{children:e}),a?.active?` which is your active theme`:``,`. All custom changes will be lost.`]})]});O.show(me,{title:`Install Theme`,prompt:o,okLabel:`Install`,cancelLabel:`Cancel`,okRunningLabel:`Installing...`,okColor:`black`,onOk:async e=>{let n;d(!0);try{r&&v&&v.splice(i,1),n=await y(t),n?.themes[0]&&(await b(n.themes[0].name),p({title:`Theme activated`,type:`success`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:n.themes[0].name}),` is now your active theme`]})})),e?.remove(),h(``)}catch(e){S(e)}}})}})()},[t,e,y,S,b,h,v,u,x,_,f]),!v)return;let w,T;if(i){w=v.find(e=>e.name.toLowerCase()===i.name.toLowerCase()),T=async()=>{let t=await x(i.name);if(t){O.show(he,{prompt:t,onOk:()=>h({route:`/pro`,isExternal:!0})});return}return w&&!Tn(i)?new Promise(t=>{O.show(me,{title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.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`,okColor:`red`,onOk:async n=>{n?.remove(),await e(),t()}})}):e()};let e=async()=>{let e=`Success`,t=(0,Y.jsx)(Y.Fragment,{});if(Tn(i))e=`Activate theme`,t=(0,Y.jsxs)(Y.Fragment,{children:[`By clicking below, `,(0,Y.jsx)(`strong`,{children:i.name}),` will automatically be activated as the theme for your site.`]});else{l(!0);let n;try{n=await y(i.ref)}catch(e){S(e)}finally{l(!1)}if(!n)return;let r=n.themes[0];e=`Success`,t=(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:r.name}),` has been successfully installed.`]}),r.active||(t=(0,Y.jsxs)(Y.Fragment,{children:[t,` `,`Do you want to activate it now?`]})),(r.errors?.length||r.warnings?.length)&&(e=`Installed successfully`,t=(0,Y.jsxs)(Y.Fragment,{children:[`The theme `,(0,Y.jsxs)(`strong`,{children:[`"`,r.name,`"`]}),` was installed successfully.`]}),r.active||(t=(0,Y.jsxs)(Y.Fragment,{children:[t,`You can activate it when you're ready.`]}))),w=r}O.show(Wa,{title:e,prompt:t,installedTheme:w,onActivate:()=>{_.remove(),h(``)}})}}return(0,Y.jsx)(L,{afterClose:()=>{h(``)},animate:!1,cancelLabel:``,footer:!1,padding:!1,size:`full`,testId:`theme-modal`,title:``,scrolling:!0,onCancel:()=>{_.remove(),h(``)},children:(0,Y.jsx)(`div`,{className:`flex h-full justify-between`,children:(0,Y.jsxs)(`div`,{className:`grow`,children:[i&&(0,Y.jsx)(Ja,{installedTheme:w,isInstalling:c,selectedTheme:i,onBack:()=>{a(null)},onClose:()=>{h(``)},onInstall:T}),(0,Y.jsx)(Xa,{currentTab:n,modal:_,previewMode:o,selectedTheme:i,setCurrentTab:r,setPreviewMode:s,setSelectedTheme:a,themes:v}),!i&&(0,Y.jsx)(Za,{currentTab:n,themes:v,onSelectTheme:C})]})})})},$a=t(i(),1),eo=({children:e,to:t,classNames:n})=>{let r=t||document.body;return r?(0,$a.createPortal)((0,Y.jsx)(`div`,{className:n,onMouseDown:e=>{e.stopPropagation()},children:(0,Y.jsx)(`div`,{children:e})}),r):(0,Y.jsx)(Y.Fragment,{children:e})},to=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())}},no={heart:e=>(0,Y.jsx)(`svg`,{viewBox:`0 0 32 32`,...e,children:(0,Y.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,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,...e,children:(0,Y.jsx)(`path`,{d:`M20 5.5l-8 8-8-8m-3.5 13h23`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeMiterlimit:10,fill:`none`})})},ro=({icon:e,label:t,...n})=>{let r=null;return e&&(r=no[e]),(0,Y.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,Y.jsx)(r,{className:`size-4 ${e===`heart`?`fill-red`:``} stroke-[3px] ${t&&`mr-1`}`}),t&&(0,Y.jsx)(`span`,{children:t})]})},io=({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,Y.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,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-end gap-3`,children:[(0,Y.jsx)(ro,{"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,Y.jsx)(ro,{"data-kg-button":`unsplash-download`,href:`${n.download}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit&force=true`,icon:`download`})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center`,children:[(0,Y.jsx)(`img`,{alt:`author`,className:`mr-2 size-8 rounded-full`,src:i.profile_image.medium}),(0,Y.jsx)(`div`,{className:`mr-2 truncate font-sans text-sm font-medium text-white`,children:i.name})]}),(0,Y.jsx)(ro,{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})}})]})]})]}),ao=({payload:e,insertImage:t,selectImg:n,zoomed:r})=>(0,Y.jsx)(`div`,{className:`flex h-full grow basis-0 justify-center`,"data-kg-unsplash-zoomed":!0,onClick:()=>n(null),children:(0,Y.jsx)(io,{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})}),oo=()=>(0,Y.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,Y.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`})}),so=e=>(0,Y.jsx)(`div`,{className:`mr-6 flex grow basis-0 flex-col justify-start last-of-type:mr-0`,children:e.children}),co=e=>e?.columns?e?.columns.map((t,n)=>(0,Y.jsx)(so,{children:t.map(t=>(0,Y.jsx)(io,{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,lo=e=>(0,Y.jsx)(`div`,{className:`relative h-full overflow-hidden`,"data-kg-unsplash-gallery":!0,children:(0,Y.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,Y.jsx)(oo,{})]})}),uo=({zoomed:e,error:t,galleryRef:n,isLoading:r,dataset:i,selectImg:a,insertImage:o})=>e?(0,Y.jsx)(lo,{galleryRef:n,zoomed:e,children:(0,Y.jsx)(ao,{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,Y.jsx)(lo,{galleryRef:n,zoomed:e,children:(0,Y.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center`,children:[(0,Y.jsx)(`h1`,{className:`mb-4 text-2xl font-bold`,children:`Error`}),(0,Y.jsx)(`p`,{className:`text-lg font-medium`,children:t})]})}):(0,Y.jsx)(lo,{galleryRef:n,isLoading:r,zoomed:e,children:(0,Y.jsx)(co,{columns:i,insertImage:o,selectImg:a,zoomed:e})}),fo=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Y.jsx)(`path`,{fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,d:`M.75 23.249l22.5-22.5M23.25 23.249L.75.749`})}),po=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,strokeWidth:1.5,viewBox:`0 0 24 24`,...e,children:(0,Y.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`})}),mo=e=>(0,Y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 122.43 122.41`,...e,children:(0,Y.jsx)(`path`,{d:`M83.86 54.15v34.13H38.57V54.15H0v68.26h122.43V54.15H83.86zM38.57 0h45.3v34.13h-45.3z`})}),ho=({closeModal:e,handleSearch:t,children:n})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 h-[100vh] bg-black opacity-60`}),(0,Y.jsxs)(`div`,{className:`not-kg-prose fixed inset-8 z-50 overflow-hidden rounded bg-white shadow-xl`,"data-kg-modal":`unsplash`,children:[(0,Y.jsx)(`button`,{className:`absolute right-6 top-6 cursor-pointer`,type:`button`,children:(0,Y.jsx)(fo,{className:`text-grey-400 size-4 stroke-2`,"data-kg-modal-close-button":!0,onClick:()=>e()})}),(0,Y.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,Y.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between px-20 py-10`,children:[(0,Y.jsxs)(`h1`,{className:`flex items-center gap-2 font-sans text-3xl font-bold text-black`,children:[(0,Y.jsx)(mo,{className:`mb-1`}),`Unsplash`]}),(0,Y.jsxs)(`div`,{className:`relative w-full max-w-sm`,children:[(0,Y.jsx)(po,{className:`text-grey-700 absolute left-4 top-1/2 size-4 -translate-y-2`}),(0,Y.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]})]})]}),go=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}}}]`),_o=class{photos=go;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){}},vo=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()}},yo=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}},bo=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()}},xo=({onClose:e,onImageInsert:t,unsplashProviderConfig:n})=>{let r=(0,J.useMemo)(()=>n?new yo(n):new _o,[n]),i=(0,J.useMemo)(()=>new vo(r),[r]),a=(0,J.useMemo)(()=>new to(3),[]),o=(0,J.useMemo)(()=>new bo(i,a),[i,a]),s=(0,J.useRef)(null),[c,l]=(0,J.useState)(0),[u,d]=(0,J.useState)(0),[f,p]=(0,J.useState)(o.searchIsRunning()||!0),m=(0,J.useRef)(!1),[h,g]=(0,J.useState)(``),[_,v]=(0,J.useState)(null),[y,b]=(0,J.useState)([]);J.useEffect(()=>{s.current&&_===null&&u!==0&&(s.current.scrollTop=u,d(0))},[_,c,u]),J.useEffect(()=>{let t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`keydown`,t)}},[e]),J.useEffect(()=>{let e=s.current;if(!_)return e&&e.addEventListener(`scroll`,()=>{l(e.scrollTop)}),()=>{e&&e.removeEventListener(`scroll`,()=>{l(e.scrollTop)})}},[s,_]);let x=J.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=J.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]);J.useEffect(()=>{let e=setTimeout(async()=>{h.length>2?await C():await x()},300);return()=>{m.current=!0,clearTimeout(e)}},[h,C,x]);let w=J.useCallback(async()=>{p(!0),await o.loadNextPage();let e=o.getColumns();b(e||[]),p(!1)},[o]);J.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,Y.jsx)(ho,{closeModal:e,handleSearch:S,children:(0,Y.jsx)(uo,{dataset:y,error:null,galleryRef:s,insertImage:E,isLoading:f,selectImg:T,zoomed:_})})},So=({unsplashProviderConfig:e,onClose:t,onImageInsert:n})=>(0,Y.jsx)(eo,{classNames:`admin-x-settings`,children:(0,Y.jsx)(xo,{unsplashProviderConfig:e,onClose:t,onImageInsert:n})}),Co={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`}]},wo=`Theme default`,To=({children:e,...t})=>(0,Y.jsx)(Ce.SingleValue,{...t,children:(0,Y.jsx)(`div`,{className:`group`,"data-testid":`select-current-option`,"data-value":t.data.value,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-md bg-white text-2xl font-bold dark:bg-black`,children:`Aa`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-md`,children:e}),(0,Y.jsx)(`span`,{className:`font-sans text-sm font-normal text-grey-700 dark:text-grey-600`,children:t.data.creator})]})]})})}),Eo=({children:e,...t})=>(0,Y.jsx)(Ce.Option,{...t,children:(0,Y.jsxs)(`div`,{className:t.isSelected?`relative flex w-full items-center justify-between gap-2`:`group`,"data-testid":`select-option`,"data-value":t.data.value,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-md bg-grey-100 text-2xl font-bold group-hover:bg-grey-200 dark:bg-grey-900 dark:group-hover:bg-grey-800`,children:`Aa`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`text-md`,children:e}),(0,Y.jsx)(`span`,{className:`font-sans text-sm font-normal text-grey-700 dark:text-grey-600`,children:t.data.creator})]})]}),t.isSelected&&(0,Y.jsx)(`span`,{children:(0,Y.jsx)(f,{name:`check`,size:14})})]})}),Q=e=>e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `),Do=({values:e,updateSetting:t})=>{let{mutateAsync:n}=pt(),{settings:r}=K(),[i]=Nn(r,[`unsplash`]),[a,s]=(0,J.useState)(!1),{unsplashConfig:c}=o(),l=g(),u=lt(),{data:d}=On(),f=d?.themes.find(e=>e.active),p=f?`${Q(f.name)} (v${f.package?.version||`1.0`})`:`Loading...`,[m,h]=(0,J.useState)(Co.heading.find(t=>t.name===e.headingFont)||{name:wo,creator:p}),[_,v]=(0,J.useState)(Co.heading.find(t=>t.name===e.bodyFont)||{name:wo,creator:p}),y=(e,t=!0)=>{let n=``;return e===`Cardo`?n=P(`font-cardo`,t&&`font-bold`):e===`Manrope`?n=P(`font-manrope`,t&&`font-bold`):e===`Merriweather`?n=P(`font-merriweather`,t&&`font-bold`):e===`Nunito`?n=P(`font-nunito`,t&&`font-semibold`):e===`Old Standard TT`?n=P(`font-old-standard-tt`,t&&`font-bold`):e===`Prata`?n=P(`font-prata`,t&&`font-normal`):e===`Roboto`?n=P(`font-roboto`,t&&`font-bold`):e===`Rufina`?n=P(`font-rufina`,t&&`font-bold`):e===`Tenor Sans`?n=P(`font-tenor-sans`,t&&`font-normal`):e===`Chakra Petch`?n=P(`font-chakra-petch`,t&&`font-normal`):e===`Fira Mono`?n=P(`font-fira-mono`,t&&`font-bold`):e===`Fira Sans`?n=P(`font-fira-sans`,t&&`font-bold`):e===`IBM Plex Serif`?n=P(`font-ibm-plex-serif`,t&&`font-bold`):e===`Inter`?n=P(`font-inter`,t&&`font-bold`):e===`JetBrains Mono`?n=P(`font-jetbrains-mono`,t&&`font-bold`):e===`Lora`?n=P(`font-lora`,t&&`font-bold`):e===`Noto Sans`?n=P(`font-noto-sans`,t&&`font-bold`):e===`Noto Serif`?n=P(`font-noto-serif`,t&&`font-bold`):e===`Poppins`?n=P(`font-poppins`,t&&`font-bold`):e===`Space Grotesk`?n=P(`font-space-grotesk`,t&&`font-bold`):e===`Space Mono`&&(n=P(`font-space-mono`,t&&`font-bold`)),n},b=Co.heading.map(e=>{let t=y(e.name,!0);return{label:e.name,value:e.name,creator:e.creator,className:t}});b.unshift({label:wo,value:wo,creator:p,className:`font-sans font-normal`});let x=Co.body.map(e=>{let t=y(e.name,!1);return{label:e.name,value:e.name,creator:e.creator,className:t}});x.unshift({label:wo,value:wo,creator:p,className:`font-sans font-normal`});let S=(e,t)=>e===wo?``:y(e,t),C={label:m.name,value:m.name,creator:m.creator},w={label:_.name,value:_.name,creator:_.creator};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:``,children:[(0,Y.jsx)(Yr,{debounceMs:200,direction:`rtl`,testId:`accent-color-picker`,title:(0,Y.jsx)(`div`,{children:`Accent color`}),value:e.accentColor,onChange:e=>t(`accent_color`,e)}),(0,Y.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication icon`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`A square, social icon, at least 60x60px`})]}),(0,Y.jsx)(`div`,{className:`flex gap-3`,children:(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,editButtonClassName:`top-1! right-1!`,height:e.icon?`66px`:`36px`,id:`logo`,imageBWCheckedBg:!0,imageURL:e.icon||``,width:e.icon?`66px`:`160px`,onDelete:()=>t(`icon`,null),onUpload:async e=>{try{t(`icon`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload icon`})})]}),(0,Y.jsxs)(`div`,{className:`flex items-start justify-between ${e.icon&&`mt-2`}`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication logo`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`Appears usually in the main header of your theme`})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,height:`60px`,id:`site-logo`,imageBWCheckedBg:!0,imageFit:`contain`,imageURL:e.logo||``,width:`160px`,onDelete:()=>t(`logo`,null),onUpload:async e=>{try{t(`logo`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload logo`})})]}),(0,Y.jsxs)(`div`,{className:`mt-2 flex items-start justify-between`,"data-testid":`publication-cover`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Publication cover`}),(0,Y.jsx)(E,{className:`mt-0! mr-5 max-w-[160px]`,children:`Usually as a large banner image on your index pages`})]}),(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,editButtonClassName:`top-1! right-10!`,height:`95px`,id:`cover`,imageURL:e.coverImage||``,openUnsplash:()=>s(!0),pintura:{isEnabled:u.isEnabled,openEditor:async()=>u.openEditor({image:e.coverImage||``,handleSave:async e=>{try{t(`cover_image`,Ne(await n({file:e})))}catch(e){l(e)}}})},unsplashButtonClassName:`bg-transparent! h-6! top-1.5! w-6! right-1.5! z-50`,unsplashEnabled:i,width:`160px`,onDelete:()=>t(`cover_image`,null),onUpload:async e=>{try{t(`cover_image`,Ne(await n({file:e})))}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),l(t)}},children:`Upload cover`}),a&&c&&i&&(0,Y.jsx)(So,{unsplashProviderConfig:c,onClose:()=>{s(!1)},onImageInsert:e=>{e.src&&t(`cover_image`,e.src),s(!1)}})]})]}),(0,Y.jsxs)(U,{className:`-mt-4`,gap:`sm`,margins:`lg`,title:`Typography`,children:[(0,Y.jsx)(Te,{className:S(C.label,!0),components:{Option:Eo,SingleValue:To},controlClasses:{control:`min-h-16! pl-2!`,option:`pl-2!`},hint:``,menuShouldScrollIntoView:!0,options:b,selectedOption:C,testId:`heading-font-select`,title:`Heading font`,onSelect:e=>{e?.value===wo?(h({name:wo,creator:p}),t(`heading_font`,``)):(h({name:e?.value||``,creator:Co.heading.find(t=>t.name===e?.value)?.creator||``}),t(`heading_font`,e?.value||``))}}),(0,Y.jsx)(Te,{className:S(w.label,!1),components:{Option:Eo,SingleValue:To},controlClasses:{control:`min-h-16! pl-2!`,option:`pl-2!`},hint:``,maxMenuHeight:200,menuPosition:`fixed`,menuShouldScrollIntoView:!0,options:x,selectedOption:w,testId:`body-font-select`,title:`Body font`,onSelect:e=>{e?.value===wo?(v({name:wo,creator:p}),t(`body_font`,``)):(v({name:e?.value||``,creator:Co.body.find(t=>t.name===e?.value)?.creator||``}),t(`body_font`,e?.value||``))}})]})]})},Oo=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
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||ce(t)}function k(e){switch(M(e)){case _:return e.map(k);case v:return de(e,k);default:return e}}function A(e){switch(M(e)){case _:return Te([],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 N(e){return M(e)===f}function P(e){return M(e)===m}function F(e){return M(e)===p}var I=Array.isArray||function(e){return!!e&&e.constructor===Array};function L(e){return!!e&&e.constructor===Object}function R(e){return e===Object(e)}function z(e){return M(e)===h}function B(e){return M(e)===g}function ee(e){return M(e)===y}function V(e){return e==null}function te(e){return e===null}function ne(e){return e===void 0}function H(e,t){return e.includes(t)}function re(e,t){return!H(e,t)}function ie(e){return!!e}function ae(e){return V(e)||I(e)&&e.length===0||L(e)&&le(e).length===0||!e}function oe(e){return I(e)?e:[e]}function se(e,t){return e.hasOwnProperty(t)}function ce(e){throw Error(e)}var le=Object.keys;function ue(e,t,n){if(t=t.bind(n),I(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 de(e,t,n){t=t.bind(n);for(var r={},i=le(e),a=0;a<i.length;a++){var o=i[a];r[o]=t(e[o],o)}return r}function fe(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(L)||r.every(I)))throw Error(`mismatched types. must both be array or object`);if(n.flatten=n.flatten||!1,I(e))if(n.flatten){for(var i=0,a=0;i<e.length&&a<t.length;)e[i]=fe(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]=fe(e[r],t[r],n):e[r]=t[r]});return e}function pe(e,t,n){return I(e)?e.reduce(t,n):(ue(e,function(r,i){return n=t(n,r,i,e)}),n)}function me(e,t){var n=t.map(xe);return e.filter(function(e){return H(n,xe(e))})}function he(e,t){return Te(Te([],e),t.filter(re.bind(null,e)))}function ge(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++)I(e[i])&&(t>0||t<0)?r(e[i],Math.max(-1,t-1)):n.push(e[i])}return r(e,t),n}function _e(e,t){if(t<1)return e;for(;t--&&I(e)&&e.length===1;)e=e[0];return e}function ve(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;Te(n,e),Te(r,t);break;case v:var a=le(e),o=le(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(be(e)!==be(t))return!1}}return n.length===0}function ye(e){var t={},n=[];return ue(e,function(e){var r=xe(e);se(t,r)||(n.push(e),t[r]=0)}),n}function be(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(be)+`]`;default:var n=t===v?``:`${j(e)}`,r=le(e);return r.sort(),`${n}{`+r.map(function(t){return`${be(t)}:${be(e[t])}`})+`}`}}function xe(e){if(V(e))return null;for(var t=0,n=be(e),r=n.length;r;)t=(t<<5)-t^n.charCodeAt(--r);return t>>>0}function Se(e,t){return e<t?-1:+(e>t)}function Ce(e,t,n){var r=[],i=[],a={};if(n||=Se,ae(e))return e;for(var o=0;o<e.length;o++){var s=e[o],c=t(s,o);V(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++)Te(i,a[r[l]]);return i}function we(e,t){var n={keys:[],groups:[]},r={};return ue(e,function(e){var i=t(e),a=xe(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 Te(e,t){return D.apply(e,t),e}function Ee(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=xe(r);return se(n,i)||(n[i]=e.apply(t,r)),n[i]}}({})}function U(e,t){return R(e)?e[t]:void 0}function Oe(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&&I(n)){if(a===0&&r>0)break;r+=1,t=t.slice(a),n=pe(n,function(e,n){var r=i(n,t);return r!==void 0&&e.push(r),e},[]);break}else n=U(n,o);if(n===void 0)break}return n}return e=H(b,M(e))?e:i(e,t.split(`.`)),n.meta?{result:e,depth:r}:e}function ke(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{I(e)?o?(c=U(e,Number(i)),s&&(c=ke(c,a,n)),c=[c]):(c=[],ue(e,function(e){l=ke(e,t,n),n.preserveMissingValues?(l===void 0&&(l=E),c.push(l)):l!==void 0&&c.push(l)})):(l=U(e,i),s&&(l=ke(l,a,n)),O(l!==void 0),c={},c[i]=l)}catch{c=void 0}return c}function Ae(e){if(I(e))for(var t=e.length-1;t>=0;t--)e[t]===E?e.splice(t,1):Ae(e[t]);else if(L(e))for(var n in e)e.hasOwnProperty(n)&&Ae(e[n]);return e}function je(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&&V(e[a])&&(e[a]={}),je(e[a],o,n,r))}function Me(e,t,n){je(e,t,function(e,t){e[t]=n},!0)}function Ne(e,t){je(e,t,function(e,t){I(e)&&/^\d+$/.test(t)?e.splice(parseInt(t),1):L(e)&&delete e[t]})}function Pe(e){return!!e&&e[0]===`$`}function Fe(e){if(H(b,M(e)))return B(e)?{$regex:e}:{$eq:e};if(R(e)){var t=le(e);if(!t.some(Pe))return{$eq:e};if(H(t,`$regex`)){var n=e.$regex,r=e.$options||``,i=``;P(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 Ie(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return V(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 Le(e,t){var n=pe(e,function(e,t){return e+t},0),r=e.length||1,i=t&&1||0,a=n/r;return Math.sqrt(pe(e,function(e,t){return e+(t-a)**2},0)/(r-i))}function Re(){return{assert:O,clone:A,cloneDeep:k,each:ue,err:ce,hashCode:xe,getType:j,has:se,includes:H.bind(null),isArray:I,isBoolean:N,isDate:z,isEmpty:ae,isEqual:ve,isFunction:ee,isNil:V,isNull:te,isNumber:F,isObject:L,isRegExp:B,isString:P,isUndefined:ne,keys:le,reduce:pe,resolve:Oe,resolveObj:ke}}var W=function(){return Object.assign({computeValue:G,ops:Ke},Re())},ze={key:`_id`};function Be(e){Object.assign(ze,e||{})}var Ve={$$ROOT:function(e,t,n){return n.root},$$CURRENT:function(e,t,n){return e},$$REMOVE:function(e,t,n){}},He={$$KEEP:function(e){return e},$$PRUNE:function(){},$$DESCEND:function(e,t,n){if(!se(t,`$cond`))return e;var r;return ue(e,function(i,a){R(i)&&(I(i)?(r=[],ue(i,function(e){L(e)&&(e=Je(e,t,n)),V(e)||r.push(e)})):r=Je(i,t,n),V(r)?delete e[a]:e[a]=r)}),e}},Ue=le(Ve),We=le(He);function Ge(){return ze.key}function Ke(){return pe(Array.prototype.slice.call(arguments),function(e,t){return Te(e,le(li[t]))},[])}function qe(e,t,n){if(se(li[S],t))return li[S][t](e,n);if(L(n)){var r={};return ue(n,function(t,i){if(r[i]=qe(e,i,n[i]),se(li[S],i))return r=r[i],O(le(n).length===1,`Invalid $group expression '`+JSON.stringify(n)+`'`),!1}),r}}function G(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,se(li[x],n))return li[x][n](e,t,r);if(se(li[S],n))return e=G(e,t,null,r),O(I(e),n+` expression must resolve to an array`),li[S][n](e,null,r);if(P(t)&&t.length>0&&t[0]===`$`){if(H(Ue,t))return Ve[t](e,null,r);if(H(We,t))return t;var i=Ue.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)),Oe(e,t.slice(1))}switch(M(t)){case _:return t.map(function(t){return G(e,t)});case v:var a={};return ue(t,function(n,i){if(a[i]=G(e,n,i,r),[x,S].some(function(e){return se(li[e],i)}))return O(le(t).length===1,`Invalid aggregation expression '`+JSON.stringify(t)+`'`),a=a[i],!1}),a;default:return t}}function Je(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};n.root=n.root||e;var r=G(e,t,null,n);return H(We,r)?He[r](e,t,n):r}function Ye(e,t){var n=G(e,t);return n==null?null:Math.abs(n)}function Xe(e,t){var n=G(e,t),r=!1,i=pe(n,function(e,t){return z(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 K(e,t){var n=G(e,t);return V(n)?null:(O(F(n)||isNaN(n),`$ceil expression must resolve to a number.`),Math.ceil(n))}function Ze(e,t){var n=G(e,t);return n[0]/n[1]}function Qe(e,t){var n=G(e,t);return V(n)?null:(O(F(n)||isNaN(n),`$exp expression must resolve to a number.`),Math.exp(n))}function $e(e,t){var n=G(e,t);return V(n)?null:(O(F(n)||isNaN(n),`$floor expression must resolve to a number.`),Math.floor(n))}function et(e,t){var n=G(e,t);return V(n)?null:(O(F(n)||isNaN(n),`$ln expression must resolve to a number.`),Math.log(n))}function tt(e,t){var n=G(e,t),r=`$log expression must resolve to array(2) of numbers`;return O(I(n)&&n.length===2,r),n.some(V)?null:(O(n.some(isNaN)||n.every(F),r),Math.log10(n[0])/Math.log10(n[1]))}function nt(e,t){var n=G(e,t);return V(n)?null:(O(F(n)||isNaN(n),`$log10 expression must resolve to a number.`),Math.log10(n))}function rt(e,t){var n=G(e,t);return n[0]%n[1]}function it(e,t){return pe(G(e,t),function(e,t){return e*t},1)}function at(e,t){var n=G(e,t);return O(I(n)&&n.length===2&&n.every(F),`$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 ot(e,t){var n=G(e,t),r=n[0],i=n[1];return V(r)||isNaN(r)||Math.abs(r)===1/0?r:(O(F(r),`$round expression must resolve to a number.`),lt(r,i,!0))}function st(e,t){var n=G(e,t);return V(n)?null:(O(F(n)&&n>0||isNaN(n),`$sqrt expression must resolve to non-negative number.`),Math.sqrt(n))}function ct(e,t){var n=G(e,t);return n[0]-n[1]}function q(e,t){var n=G(e,t),r=n[0],i=n[1];return V(r)||isNaN(r)||Math.abs(r)===1/0?r:(O(F(r),`$trunc expression must resolve to a number.`),O(V(i)||F(i)&&i>-20&&i<100,`$trunc expression has invalid place`),lt(r,i,!1))}function lt(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 ut(e,t){var n=G(e,t);O(I(n)&&n.length===2,`$arrayElemAt expression must resolve to array(2)`),O(I(n[0]),`First operand to $arrayElemAt must resolve to an array`),O(F(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 dt(e,t){var n=G(e,t);return O(I(n),`$arrayToObject expression must resolve to an array`),pe(n,function(e,t){return I(t)&&t.length==2?e[t[0]]=t[1]:(O(L(t)&&se(t,`k`)&&se(t,`v`),`$arrayToObject expression is invalid.`),e[t.k]=t.v),e},{})}function ft(e,t){var n=G(e,t,null);return O(I(n),`$concatArrays must resolve to an array`),n.some(V)?null:n.reduce(function(e,t){return Te(e,t)},[])}function pt(e,t){var n=G(e,t.input),r=t.as,i=t.cond;return O(I(n),`$filter 'input' expression must resolve to an array`),n.filter(function(e){var t={};return t[`$`+r]=e,G(t,i)===!0})}function mt(e,t){var n=G(e,t[0]),r=G(e,t[1]);return O(I(r),`$in second argument must be an array`),r.some(ve.bind(null,n))}function ht(e,t){var n=G(e,t);if(V(n))return null;var r=n[0],i=n[1];if(V(r))return null;O(I(r),`$indexOfArray expression must resolve to an array.`);var a=n[2]||0,o=n[3];return V(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(ve.bind(null,i))+a)}function gt(e,t){return I(G(e,t[0]))}function _t(e,t){var n=G(e,t.input);O(I(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,G(e,i)})}function vt(e,t){var n=G(e,t);O(L(n),`$objectToArray expression must resolve to an object`);var r=[];return ue(n,function(e,t){return r.push({k:t,v:e})}),r}function yt(e,t){for(var n=G(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 bt(e,t){var n=G(e,t.input),r=G(e,t.initialValue),i=t.in;return V(n)?null:(O(I(n),`$reduce 'input' expression must resolve to an array`),pe(n,function(e,t){return G({$value:e,$this:t},i)},r))}function xt(e,t){var n=G(e,t);if(V(n))return null;O(I(n),`$reverseArray expression must resolve to an array`);var r=[];return Te(r,n),r.reverse(),r}function St(e,t){var n=G(e,t);return I(n)?n.length:void 0}function Ct(e,t){var n=G(e,t);return Ie(n[0],n[1],n[2])}function wt(e,t){var n=G(e,t.inputs),r=t.useLongestLength||!1;O(I(n),`'inputs' expression must resolve to an array`),O(N(r),`'useLongestLength' must be a boolean`),I(t.defaults)&&O(ie(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(V(s))return null;O(I(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 V(t[e])?l[n]||null:t[e]});c.push(t)},d=0;d<i;d++)u(d);return c}function Tt(e,t){var n=G(e,t);return I(n)?pe(n,function(e,t){return Object.assign(e,t)},{}):{}}function Et(e,t){var n=G(e,t);return ie(n)&&n.every(ie)}function Dt(e,t){var n=G(e,t);return ie(n)&&n.some(ie)}function Ot(e,t){return!G(e,t[0])}function kt(e){return e instanceof zt?e:new zt(e)}kt.isIterator=At;function At(t){return!!t&&e(t)===`object`&&jt(t.next)}function jt(e){return!!e&&typeof e==`function`}function Mt(e,t){var n=e.slice(t+1);e.splice(t),Array.prototype.push.apply(e,n)}var Nt=Error(),Pt=1,Ft=2,It=3,Lt=4;function Rt(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 Pt:s=f(s,i);break;case Ft:if(!f(s,i))continue outer;break;case It:--d.func,d.func||(u=!0);break;case Lt:--d.func,d.func||Mt(t,c);continue outer;default:break outer}}if(r=u,o)n[a++]=s;else return{value:s,done:!1}}}catch(e){if(e!==Nt)throw e}return r=!0,{done:!0}}}var zt=function(){function e(n){if(t(this,e),this.__iteratees=[],this.__first=!1,this.__done=!1,this.__buf=[],jt(n)&&(n={next:n}),At(n)){var r=n;n=function(){var e=r.next();if(e.done)throw Nt;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 Nt}}else if(!jt(n))throw Error(`Source is not iterable. Must be Array, Function or Object{next:Function}`);this.next=Rt(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:Pt,func:e})}},{key:`filter`,value:function(e){return this._push({type:Ft,func:e})}},{key:`take`,value:function(e){return e>0?this._push({type:It,func:e}):this}},{key:`drop`,value:function(e){return e>0?this._push({type:Lt,func:e}):this}},{key:`transform`,value:function(e){this._validate();var t=this,n;return kt(function(){return n||=kt(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`&&(zt.prototype[Symbol.iterator]=function(){return this});var Bt=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=kt(e);var r=li[C];return ae(this.__operators)||ue(this.__operators,function(i){var a=le(i);O(a.length===1&&H(Ke(C),a[0]),`invalid aggregation operator ${a}`),a=a[0],e=t&&t instanceof Ut?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 Vt(e,t,n){return O(I(t),`Aggregation pipeline must be an array`),new Bt(t,n).run(e)}var Ht=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:(L(this.__projection)&&this.__operators.push({$project:this.__projection}),this.__result=kt(this.__source).filter(this.__filterFn),this.__operators.length>0&&(this.__result=new Bt(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`&&(Ht.prototype[Symbol.iterator]=function(){return this._fetch()});var Ut=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(L(this.__criteria),`query criteria must be an object`);var t;ue(this.__criteria,function(n,r){r===`$where`?t={field:r,expr:n}:r===`$expr`||H([`$and`,`$or`,`$nor`],r)?e._processOperator(r,r,n):(O(!Pe(r),`unknown top level operator: ${r}`),n=Fe(n),ue(n,function(t,n){e._processOperator(r,n,t)})),L(t)&&e._processOperator(t.field,t.field,t.expr)})}},{key:`_processOperator`,value:function(e,t,n){O(se(li[T],t),`invalid query operator ${t} detected`),this.__compiled.push(li[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 Ht(e,this,t)}},{key:`remove`,value:function(e){var t=this;return pe(e,function(e,n){return t.test(n)||e.push(n),e},[])}}]),e}();function Wt(e,t,n){return new Ut(t).find(e,n)}function Gt(e,t){return new Ut(t).remove(e)}function Kt(e,t){if(ve(e,t)||V(e)&&V(t))return!0;if(I(e)){var n=ve.bind(null,t);return e.some(n)||ge(e,1).some(n)}return!1}function qt(e,t){return!Kt(e,t)}function Jt(e,t){return V(e)?t.some(te):me(oe(e),t).length>0}function Yt(e,t){return!Jt(e,t)}function Xt(e,t){return cn(e,t,function(e,t){return e<t})}function Zt(e,t){return cn(e,t,function(e,t){return e<=t})}function Qt(e,t){return cn(e,t,function(e,t){return e>t})}function $t(e,t){return cn(e,t,function(e,t){return e>=t})}function en(e,t){return oe(e).some(function(e){return F(e)&&I(t)&&t.length===2&&e%t[0]===t[1]})}function tn(e,t){e=oe(e);var n=function(e){return P(e)&&!!e.match(t)};return e.some(n)||ge(e,1).some(n)}function nn(e,t){return(t===!1||t===0)&&e===void 0||(t===!0||t===1)&&e!==void 0}function rn(e,t){var n=!1;if(I(e)&&I(t))for(var r=0,i=t.length;r<i;r++)if(L(t[r])&&H(le(t[r]),`$elemMatch`))n||=on(e,t[r].$elemMatch);else return me(t,e).length===i;return n}function an(e,t){return I(e)&&F(t)&&e.length===t}function on(e,t){if(I(e)&&!ae(e)){var n=function(e){return e},r=t;le(t).every(Pe)&&(r={temp:t},n=function(e){return{temp:e}});for(var i=new Ut(r),a=0,o=e.length;a<o;a++)if(i.test(n(e[a])))return!0}return!1}function sn(e,t){switch(t){case 1:case`double`:return F(e)&&(e+``).indexOf(`.`)!==-1;case 2:case m:return P(e);case 3:case v:return L(e);case 4:case _:return I(e);case 6:case d:return V(e);case 8:case`bool`:return N(e);case 9:case h:return z(e);case 10:case u:return te(e);case 11:case`regex`:return B(e);case 16:case`int`:return F(e)&&e<=2147483647&&(e+``).indexOf(`.`)===-1;case 18:case`long`:return F(e)&&e>2147483647&&e<=0x8000000000000000&&(e+``).indexOf(`.`)===-1;case 19:case`decimal`:return F(e);default:return!1}}function cn(e,t,n){return oe(e).some(function(e){return j(e)===j(t)&&n(e,t)})}function ln(e){return function(t,n){var r=G(t,n);return e(r[0],r[1])}}var un=ln(Kt),dn=ln(qt),fn=ln(Qt),pn=ln(Xt),mn=ln($t),hn=ln(Zt),gn=ln(Yt);function _n(e,t){var n=G(e,t);return n[0]>n[1]?1:n[0]<n[1]?-1:0}function vn(e,t){var n,r,i,a=`$cond: invalid arguments`;return I(t)?(O(t.length===3,a),n=t[0],r=t[1],i=t[2]):(O(L(t),a),n=t.if,r=t.then,i=t.else),G(e,n)?G(e,r):G(e,i)}function yn(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),G(e,t.case)});return r?G(e,r.then):(O(t.default,n),G(e,t.default))}function bn(e,t){O(I(t)&&t.length===2,`$ifNull expression must resolve to array(2)`);var n=G(e,t);return V(n[0])?n[1]:n[0]}function xn(e,t){var n=G(e,t),r=n-new Date(n.getFullYear(),0,0);return Math.round(r/(1e3*60*60*24))}function Sn(e,t){return G(e,t).getDate()}function Cn(e,t){return G(e,t).getDay()+1}function wn(e,t){return G(e,t).getFullYear()}function Tn(e,t){return G(e,t).getMonth()+1}function En(e,t){var n=G(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 Dn(e,t){return G(e,t).getUTCHours()}function On(e,t){return G(e,t).getMinutes()}function kn(e,t){return G(e,t).getSeconds()}function An(e,t){return G(e,t).getMilliseconds()}var jn={"%Y":[wn,4],"%m":[Tn,2],"%d":[Sn,2],"%H":[Dn,2],"%M":[On,2],"%S":[kn,2],"%L":[An,3],"%j":[xn,3],"%w":[Cn,1],"%U":[En,2],"%%":`%`};function Mn(e,t){for(var n=t.format,r=G(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=jn[i[a]],c=s;if(I(s)){var l=s[0],u=s[1];c=Nn(l(e,r),u)}n=n.replace(i[a],c)}return n}function Nn(e,t){return Array(Math.max(t-String(e).length+1,0)).join(`0`)+e}function Pn(e,t){return t}function Fn(e,t){var n=G(e,t),r=ye(n[0]),i=ye(n[1]);return r.length===i.length&&r.length===me(r,i).length}function In(e,t){var n=G(e,t);return me(n[0],n[1])}function Ln(e,t){var n=G(e,t);return n[0].filter(re.bind(null,n[1]))}function Rn(e,t){var n=G(e,t);return he(n[0],n[1])}function zn(e,t){var n=G(e,t);return me(n[0],n[1]).length===n[0].length}function Bn(e,t){return G(e,t)[0].some(ie)}function Vn(e,t){return G(e,t)[0].every(ie)}function Hn(e,t){var n=G(e,t);return[null,void 0].some(H.bind(null,n))?null:n.join(``)}function Un(e,t){var n=G(e,t),r=`$indexOfBytes expression resolves to invalid an argument`;if(V(n[0]))return null;O(P(n[0])&&P(n[1]),r);var i=n[0],a=n[1],o=n[2],s=n[3],c=V(o)||F(o)&&o>=0&&Math.round(o)===o;if(c&&=V(s)||F(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 Wn(e,t){var n=G(e,t);return V(n[0])?null:(O(n.every(P),`$split expression must result to array(2) of strings`),n[0].split(n[1]))}function Gn(e,t){return~-encodeURI(G(e,t)).split(/%..|./).length}function Kn(e,t){return G(e,t).length}function qn(e,t){var n=G(e,t),r=n[0],i=n[1];return ve(r,i)||n.every(V)?0:(O(n.every(P),`$strcasecmp must resolve to array(2) of strings`),r=r.toUpperCase(),i=i.toUpperCase(),r>i&&1||r<i&&-1||0)}function Jn(e,t){var n=G(e,t),r=n[0],i=n[1],a=n[2];O(P(r)&&F(i)&&i>=0&&F(a)&&a>=0,`$substrBytes: invalid arguments`);for(var o=tr(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 Yn(e,t){var n=G(e,t),r=n[0],i=n[1],a=n[2];return P(r)?i<0?``:a<0?r.substr(i):r.substr(i,a):``}function Xn(e,t){return Yn(e,t)}function Zn(e,t){var n=G(e,t);return ae(n)?``:n.toLowerCase()}function Qn(e,t){var n=G(e,t);return ae(n)?``:n.toUpperCase()}var $n=[192,224,240];function er(e){if(e<128)return[e];for(var t=e<2048&&1||e<65536&&2||3,n=$n[t-1],r=[(e>>6*t)+n];t>0;)r.push(128|e>>6*--t&63);return r}function tr(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(er(e.codePointAt(n)));return t}function nr(e,t){var n=t.vars,r=t.in;return ue(le(n),function(t){var r=G(e,n[t]),i=`$`+t;e[i]=r}),G(e,r)}var rr=Object.freeze({__proto__:null,$abs:Ye,$add:Xe,$ceil:K,$divide:Ze,$exp:Qe,$floor:$e,$ln:et,$log:tt,$log10:nt,$mod:rt,$multiply:it,$pow:at,$round:ot,$sqrt:st,$subtract:ct,$trunc:q,$arrayElemAt:ut,$arrayToObject:dt,$concatArrays:ft,$filter:pt,$in:mt,$indexOfArray:ht,$isArray:gt,$map:_t,$objectToArray:vt,$range:yt,$reduce:bt,$reverseArray:xt,$size:St,$slice:Ct,$zip:wt,$mergeObjects:Tt,$and:Et,$or:Dt,$not:Ot,$eq:un,$ne:dn,$gt:fn,$lt:pn,$gte:mn,$lte:hn,$nin:gn,$cmp:_n,$cond:vn,$switch:yn,$ifNull:bn,$dayOfYear:xn,$dayOfMonth:Sn,$dayOfWeek:Cn,$year:wn,$month:Tn,$week:En,$hour:Dn,$minute:On,$second:kn,$millisecond:An,$dateToString:Mn,$literal:Pn,$setEquals:Fn,$setIntersection:In,$setDifference:Ln,$setUnion:Rn,$setIsSubset:zn,$anyElementTrue:Bn,$allElementsTrue:Vn,$concat:Hn,$indexOfBytes:Un,$split:Wn,$strLenBytes:Gn,$strLenCP:Kn,$strcasecmp:qn,$substrBytes:Jn,$substr:Yn,$substrCP:Xn,$toLower:Zn,$toUpper:Qn,$let:nr});function J(e,t){return V(t)?e:e.map(function(e){return G(e,t)})}function Y(e,t){return ye(J(e,t))}function ir(e,t){var n=J(e,t).filter(F);return pe(n,function(e,t){return e+t},0)/(n.length||1)}function ar(e,t){return e.length>0?G(e[0],t):void 0}function or(e,t){return e.length>0?G(e[e.length-1],t):void 0}function sr(e,t){return pe(J(e,t),function(e,t){return V(e)||t>e?t:e},void 0)}function X(e,t){return pe(e,function(e,n){return Object.assign(e,G(n,t))},{})}function cr(e,t){return pe(J(e,t),function(e,t){return V(e)||t<e?t:e},void 0)}function lr(e,t){return Le(J(e,t).filter(F),!1)}function ur(e,t){return Le(J(e,t).filter(F),!0)}function Z(e,t){return I(e)?F(t)?e.length*t:pe(J(e,t).filter(F),function(e,t){return e+t},0):0}var dr=Object.freeze({__proto__:null,$addToSet:Y,$avg:ir,$first:ar,$last:or,$max:sr,$mergeObjects:X,$min:cr,$push:J,$stdDevPop:lr,$stdDevSamp:ur,$sum:Z});function fr(e,t,n){var r=le(t);return r.length===0?e:e.map(function(e){var n=k(e);return ue(r,function(r){Me(n,r,G(e,t[r]))}),n})}var pr=fr;function mr(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`);!V(i)&&j(t.default)===j(a)&&O(a>t.default||o<t.default,`$bucket 'default' expression must be out of boundaries range`);var d={};ue(r,function(e){return d[e]=[]}),V(i)||(d[i]=[]);var f=!1;return kt(function(){return f||=(e.each(function(e){var n=G(e,t.groupBy);if(V(n)||n<a||n>=o)O(!V(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=Ee(r,n);d[r[Math.max(0,s-1)]].push(e)}}),r.pop(),V(i)||r.push(i),kt(r).map(function(e){var t=qe(d[e],null,s);return Object.assign(t,{_id:e})})),f.next()})}function hr(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(G),o={},s=[],c=Ce(e,function(e){var t=n(e,i);return V(t)?s.push(e):(o[t]||(o[t]=[]),o[t].push(e)),t}),l=Ge(),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(V(_)&&(_=null),Te(h,V(_)?s:o[_]),d+=V(_)?s.length:o[_].length,se(m,`min`)||(m.min=_),u.length>0){var v=u[u.length-1];v[l].max=m.min}}f==a-1&&Te(h,c.slice(d)),u.push(Object.assign(qe(h,null,r),{_id:m}))}return u.length>0&&(u[u.length-1][l].max=n(c[c.length-1],i)),u})}function gr(e,t,n){return O(P(t)&&t.trim()!==``&&t.indexOf(`.`)===-1&&t.trim()[0]!==`$`,`Invalid expression value for $count`),kt(function(){var n={};return n[t]=e.size(),{value:n,done:!1}}).first()}function _r(e,t,n){return e.transform(function(e){return[de(t,function(t){return Vt(e,t)})]})}function vr(e,t,n){var r=Ge(),i=t[r];return e.transform(function(e){var n=we(e,function(e){return G(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),ue(t,function(e,t){i[t]=qe(n.groups[a],t,e)}),{value:i,done:!1}}})}function yr(e,t,n){return e.take(t)}function br(e,t,n){var r=t.from,i=t.localField,a=t.foreignField,o=t.as;O(I(r)&&P(a)&&P(i)&&P(o),`$lookup: invalid argument`);var s={};return ue(r,function(e){var t=xe(Oe(e,a));s[t]=s[t]||[],s[t].push(e)}),e.map(function(e){var t=xe(Oe(e,i)),n=A(e);return n[o]=s[t]||[],n})}function xr(e,t,n){var r=new Ut(t);return e.filter(function(e){return r.test(e)})}function Sr(e,t,n){return O(I(t),`$out expression must be an array`),e.map(function(e){return t.push(e),e})}function Cr(e,t,n){if(ae(t))return e;var r=le(t),i=!1,a=Ge();if(Tr(t),H(r,a)){var o=t[a];(o===0||o===!1)&&(r=r.filter(re.bind(null,[a])),O(re(r,a),`Must not contain collections id key`),i=ae(r))}else r.push(a);return e.map(function(e){return wr(e,t,r,i)})}function wr(e,t,n,r){var i=Ge(),a={},o=!1,s=!1,c=[];return r&&c.push(i),n.forEach(function(n){var r,l=t[n];if(n!==i&&H([0,!1],l)&&(s=!0),n===i&&ae(l))r=e[n];else if(P(l))r=G(e,l,n);else if(!H([1,!0],l))if(I(l))r=l.map(function(t){var n=G(e,t);return V(n)?null:n});else if(L(l)){var u=le(l),d=u.length>1?!1:u[0];if(H(Ke(w),d)){var f=li[w];d===`$slice`?oe(l[d]).every(F)?(r=f[d](e,l[d],n),o=!0):r=G(e,l,n):r=f[d](e,l[d],n)}else if(se(e,n)){Tr(l);var p=e[n];r=I(p)?p.map(function(e){return wr(e,l,u,!1)}):wr(p,l,u,!1)}else r=G(e,l,n)}else{c.push(n);return}var m=ke(e,n,{preserveMissingValues:!0});m!==void 0&&fe(a,m,{flatten:!0}),re([0,1,!1,!0],l)&&(r===void 0?Ne(a,n):Me(a,n,r))}),Ae(a),(o||s||r)&&(a=Object.assign({},e,a),c.length>0&&(a=k(a),ue(c,function(e){return Ne(a,e)}))),a}function Tr(e){var t=Ge(),n=[!1,!1];ue(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 Er(e,t,n){return e.map(function(e){return Je(k(e),t)})}function Dr(e,t,n){return e.map(function(e){return e=G(e,t.newRoot),O(L(e),`$replaceRoot expression must return an object`),e})}function Or(e,t,n){var r=t.size;return O(F(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 kr(e,t,n){return e.drop(t)}function Ar(e,t,n){if(ae(t)||!L(t))return e;n||={};var r=Se,i=n.collation;return L(i)&&P(i.locale)&&(r=Mr(i)),e.transform(function(e){return ue(le(t).reverse(),function(n){var i=we(e,function(e){return Oe(e,n)}),a={},o=Ce(i.keys,function(e,t){return a[e]=t,e},r);t[n]===-1&&o.reverse(),e=[],ue(o,function(t){return Te(e,i.groups[a[t]])})}),e})}var jr={1:`base`,2:`accent`,3:`variant`};function Mr(e){var t={sensitivity:jr[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(!P(e)||!P(t))return Se(e,t);var r=n.compare(e,t);return r<0?-1:+(r>0)}}function Nr(e,t,n){var r={count:{$sum:1}};return r[Ge()]=t,Ar(vr(e,r),{count:-1},n)}function Pr(t,n,r){P(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 kt(function(){for(var n=function(){if(kt.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=Oe(n,i),I(c))if(c.length===0&&o===!0){c=null;var r=k(n);return Ne(r,i),{v:{value:s(r,null),done:!1}}}else c=kt(c).map(function(e,t){var r=k(n);return Me(r,i,e),s(r,t)});else if(!ae(c)||o===!0)return{v:{value:s(k(n),null),done:!1}}};;){var r=n();if(e(r)===`object`)return r.v}})}var Fr=Object.freeze({__proto__:null,$addFields:fr,$set:pr,$bucket:mr,$bucketAuto:hr,$count:gr,$facet:_r,$group:vr,$limit:yr,$lookup:br,$match:xr,$out:Sr,$project:Cr,$redact:Er,$replaceRoot:Dr,$sample:Or,$skip:kr,$sort:Ar,$sortByCount:Nr,$unwind:Pr});function Ir(e,t,n){ce(`$ not implemented`)}function Lr(e,t,n){var r=Oe(e,n),i=new Ut(t);O(I(r),`$elemMatch: invalid argument`);for(var a=0;a<r.length;a++)if(i.test(r[a]))return[r[a]]}function Rr(e,t,n){var r=Oe(e,n);return I(r)?I(t)?Ie(r,t[0],t[1]):(O(F(t),`$slice: invalid arguments for projection`),Ie(r,t)):r}var zr=Object.freeze({__proto__:null,$:Ir,$elemMatch:Lr,$slice:Rr});function Br(e){return function(t,n){return function(r){var i=Oe(r,t,{meta:!0});return i=_e(i.result,i.depth),e(i,n)}}}var Vr=Br(rn),Hr=Br(on),Ur=Br(Kt),Wr=Br(nn),Gr=Br(Qt),Kr=Br($t),qr=Br(Jt),Jr=Br(Xt),Yr=Br(Zt),Xr=Br(en),Zr=Br(qt),Qr=Br(Yt),$r=Br(tn),ei=Br(an),ti=Br(sn);function ni(e,t){O(I(t),`Invalid expression: $and expects value to be an Array`);var n=[];return ue(t,function(e){return n.push(new Ut(e))}),function(e){for(var t=0;t<n.length;t++)if(!n[t].test(e))return!1;return!0}}function ri(e,t){O(I(t),`Invalid expression. $or expects value to be an Array`);var n=[];return ue(t,function(e){return n.push(new Ut(e))}),function(e){for(var t=0;t<n.length;t++)if(n[t].test(e))return!0;return!1}}function ii(e,t){O(I(t),`Invalid expression. $nor expects value to be an Array`);var n=ri(`$or`,t);return function(e){return!n(e)}}function ai(e,t){var n={};n[e]=Fe(t);var r=new Ut(n);return function(e){return!r.test(e)}}function oi(e,t){return ee(t)||(t=Function(`return `+t+`;`)),function(e){return t.call(e)===!0}}function si(e,t){return function(e){return G(e,t)}}var ci=Object.freeze({__proto__:null,$all:Vr,$elemMatch:Hr,$eq:Ur,$exists:Wr,$gt:Gr,$gte:Kr,$in:qr,$lt:Jr,$lte:Yr,$mod:Xr,$ne:Zr,$nin:Qr,$regex:$r,$size:ei,$type:ti,$and:ni,$or:ri,$nor:ii,$not:ai,$where:oi,$expr:si}),li={};li[x]={},li[S]={},li[C]={},li[w]={},li[T]={};var ui=[[x,rr],[S,dr],[C,Fr],[w,zr],[T,ci]];function di(){ue(ui,function(e){var t=i(e,2),n=t[0],r=t[1];Object.assign(li[n],r)})}function fi(e,t){var n=t(W());O(se(li,e),`Invalid operator class ${e}`);var r=li[e];ue(n,function(t,n){O(/^\$[a-zA-Z0-9_]*$/.test(n),`Invalid operator name ${n}`),O(!se(r,n),`${n} already exists for '${e}' operators`)});var i={};switch(e){case T:ue(n,function(e,t){e=e.bind(n),i[t]=function(n,r){return function(i){var a=Oe(i,n),o=e(n,a,r);return O(N(o),`${t} must return a boolean`),o}}});break;case w:ue(n,function(e,t){e=e.bind(n),i[t]=function(t,n,r){var i=Oe(t,r);return e(r,i,n)}});break;default:ue(n,function(e,t){i[t]=function(){var t=[...arguments];return e.apply(n,t)}})}Object.assign(li[e],i)}return di(),{_internal:W,Aggregator:Bt,CollectionMixin:{query:function(e,t){return new Ut(e).find(this.toJSON(),t)},aggregate:function(e){return new Bt(e).run(this.toJSON())}},Cursor:Ht,Lazy:kt,OP_EXPRESSION:x,OP_GROUP:S,OP_PIPELINE:C,OP_PROJECTION:w,OP_QUERY:T,Query:Ut,VERSION:`2.5.3`,addOperators:fi,aggregate:Vt,find:Wt,remove:Gt,setup:Be}}))})),ko=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]`,N=`[object Null]`,P=`[object Object]`,F=`[object Promise]`,I=`[object Proxy]`,L=`[object RegExp]`,R=`[object Set]`,z=`[object String]`,B=`[object Symbol]`,ee=`[object Undefined]`,V=`[object WeakMap]`,te=`[object WeakSet]`,ne=`[object ArrayBuffer]`,H=`[object DataView]`,re=`[object Float32Array]`,ie=`[object Float64Array]`,ae=`[object Int8Array]`,oe=`[object Int16Array]`,se=`[object Int32Array]`,ce=`[object Uint8Array]`,le=`[object Uint8ClampedArray]`,ue=`[object Uint16Array]`,de=`[object Uint32Array]`,fe=/\b__p \+= '';/g,pe=/\b(__p \+=) '' \+/g,me=/(__e\(.*?\)|\b__t\)) \+\n'';/g,he=/&(?:amp|lt|gt|quot|#39);/g,ge=/[&<>"']/g,_e=RegExp(he.source),ve=RegExp(ge.source),ye=/<%-([\s\S]+?)%>/g,be=/<%([\s\S]+?)%>/g,xe=/<%=([\s\S]+?)%>/g,Se=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ce=/^\w*$/,we=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Te=/[\\^$.*+?()[\]{}|]/g,Ee=RegExp(Te.source),De=/^\s+/,U=/\s/,Oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ke=/\{\n\/\* \[wrapped with (.+)\] \*/,Ae=/,? & /,je=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Me=/[()=,{}\[\]\/\s]/,Ne=/\\(\\)?/g,Pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fe=/\w*$/,Ie=/^[-+]0x[0-9a-f]+$/i,Le=/^0b[01]+$/i,Re=/^\[object .+?Constructor\]$/,W=/^0o[0-7]+$/i,ze=/^(?:0|[1-9]\d*)$/,Be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ve=/($^)/,He=/['\n\r\u2028\u2029\\]/g,Ue=`\\ud800-\\udfff`,We=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,Ge=`\\u2700-\\u27bf`,Ke=`a-z\\xdf-\\xf6\\xf8-\\xff`,qe=`\\xac\\xb1\\xd7\\xf7`,G=`\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf`,Je=`\\u2000-\\u206f`,Ye=` \\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`,Xe=`A-Z\\xc0-\\xd6\\xd8-\\xde`,K=`\\ufe0e\\ufe0f`,Ze=qe+G+Je+Ye,Qe=`['’]`,$e=`[`+Ue+`]`,et=`[`+Ze+`]`,tt=`[`+We+`]`,nt=`\\d+`,rt=`[`+Ge+`]`,it=`[`+Ke+`]`,at=`[^`+Ue+Ze+nt+Ge+Ke+Xe+`]`,ot=`\\ud83c[\\udffb-\\udfff]`,st=`(?:`+tt+`|`+ot+`)`,ct=`[^`+Ue+`]`,q=`(?:\\ud83c[\\udde6-\\uddff]){2}`,lt=`[\\ud800-\\udbff][\\udc00-\\udfff]`,ut=`[`+Xe+`]`,dt=`\\u200d`,ft=`(?:`+it+`|`+at+`)`,pt=`(?:`+ut+`|`+at+`)`,mt=`(?:`+Qe+`(?:d|ll|m|re|s|t|ve))?`,ht=`(?:`+Qe+`(?:D|LL|M|RE|S|T|VE))?`,gt=st+`?`,_t=`[`+K+`]?`,vt=`(?:`+dt+`(?:`+[ct,q,lt].join(`|`)+`)`+_t+gt+`)*`,yt=`\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])`,bt=`\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])`,xt=_t+gt+vt,St=`(?:`+[rt,q,lt].join(`|`)+`)`+xt,Ct=`(?:`+[ct+tt+`?`,tt,q,lt,$e].join(`|`)+`)`,wt=RegExp(Qe,`g`),Tt=RegExp(tt,`g`),Et=RegExp(ot+`(?=`+ot+`)|`+Ct+xt,`g`),Dt=RegExp([ut+`?`+it+`+`+mt+`(?=`+[et,ut,`$`].join(`|`)+`)`,pt+`+`+ht+`(?=`+[et,ut+ft,`$`].join(`|`)+`)`,ut+`?`+ft+`+`+mt,ut+`+`+ht,bt,yt,nt,St].join(`|`),`g`),Ot=RegExp(`[`+dt+Ue+We+K+`]`),kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,At=`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(`.`),jt=-1,Mt={};Mt[re]=Mt[ie]=Mt[ae]=Mt[oe]=Mt[se]=Mt[ce]=Mt[le]=Mt[ue]=Mt[de]=!0,Mt[S]=Mt[C]=Mt[ne]=Mt[T]=Mt[H]=Mt[E]=Mt[O]=Mt[k]=Mt[j]=Mt[M]=Mt[P]=Mt[L]=Mt[R]=Mt[z]=Mt[V]=!1;var Nt={};Nt[S]=Nt[C]=Nt[ne]=Nt[H]=Nt[T]=Nt[E]=Nt[re]=Nt[ie]=Nt[ae]=Nt[oe]=Nt[se]=Nt[j]=Nt[M]=Nt[P]=Nt[L]=Nt[R]=Nt[z]=Nt[B]=Nt[ce]=Nt[le]=Nt[ue]=Nt[de]=!0,Nt[O]=Nt[k]=Nt[V]=!1;var Pt={À:`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`},Ft={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},It={"&":`&`,"<":`<`,">":`>`,""":`"`,"'":`'`},Lt={"\\":`\\`,"'":`'`,"\n":`n`,"\r":`r`,"\u2028":`u2028`,"\u2029":`u2029`},Rt=parseFloat,zt=parseInt,Bt=typeof global==`object`&&global&&global.Object===Object&&global,Vt=typeof self==`object`&&self&&self.Object===Object&&self,Ht=Bt||Vt||Function(`return this`)(),Ut=typeof e==`object`&&e&&!e.nodeType&&e,Wt=Ut&&typeof t==`object`&&t&&!t.nodeType&&t,Gt=Wt&&Wt.exports===Ut,Kt=Gt&&Bt.process,qt=function(){try{return Wt&&Wt.require&&Wt.require(`util`).types||Kt&&Kt.binding&&Kt.binding(`util`)}catch{}}(),Jt=qt&&qt.isArrayBuffer,Yt=qt&&qt.isDate,Xt=qt&&qt.isMap,Zt=qt&&qt.isRegExp,Qt=qt&&qt.isSet,$t=qt&&qt.isTypedArray;function en(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 tn(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 nn(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function rn(e,t){for(var n=e==null?0:e.length;n--&&t(e[n],n,e)!==!1;);return e}function an(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 sn(e,t){return!!(e!=null&&e.length)&&yn(e,t,0)>-1}function cn(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 ln(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 un(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function dn(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 fn(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 pn(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 mn=Cn(`length`);function hn(e){return e.split(``)}function gn(e){return e.match(je)||[]}function _n(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function vn(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 yn(e,t,n){return t===t?Yn(e,t,n):vn(e,xn,n)}function bn(e,t,n,r){for(var i=n-1,a=e.length;++i<a;)if(r(e[i],t))return i;return-1}function xn(e){return e!==e}function Sn(e,t){var n=e==null?0:e.length;return n?Dn(e,t)/n:_}function Cn(e){return function(t){return t==null?n:t[e]}}function wn(e){return function(t){return e==null?n:e[t]}}function Tn(e,t,n,r,i){return i(e,function(e,i,a){n=r?(r=!1,e):t(n,e,i,a)}),n}function En(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Dn(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 On(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function kn(e,t){return ln(t,function(t){return[t,e[t]]})}function An(e){return e&&e.slice(0,$n(e)+1).replace(De,``)}function jn(e){return function(t){return e(t)}}function Mn(e,t){return ln(t,function(t){return e[t]})}function Nn(e,t){return e.has(t)}function Pn(e,t){for(var n=-1,r=e.length;++n<r&&yn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length;n--&&yn(t,e[n],0)>-1;);return n}function In(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Ln=wn(Pt),Rn=wn(Ft);function zn(e){return`\\`+Lt[e]}function Bn(e,t){return e==null?n:e[t]}function Vn(e){return Ot.test(e)}function Hn(e){return kt.test(e)}function Un(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Wn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Gn(e,t){return function(n){return e(t(n))}}function Kn(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 qn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Jn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function Yn(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function Xn(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function Zn(e){return Vn(e)?tr(e):mn(e)}function Qn(e){return Vn(e)?nr(e):hn(e)}function $n(e){for(var t=e.length;t--&&U.test(e.charAt(t)););return t}var er=wn(It);function tr(e){for(var t=Et.lastIndex=0;Et.test(e);)++t;return t}function nr(e){return e.match(Et)||[]}function rr(e){return e.match(Dt)||[]}var J=(function e(t){t=t==null?Ht:J.defaults(Ht.Object(),t,J.pick(Ht,At));var U=t.Array,je=t.Date,Ue=t.Error,We=t.Function,Ge=t.Math,Ke=t.Object,qe=t.RegExp,G=t.String,Je=t.TypeError,Ye=U.prototype,Xe=We.prototype,K=Ke.prototype,Ze=t[`__core-js_shared__`],Qe=Xe.toString,$e=K.hasOwnProperty,et=0,tt=function(){var e=/[^.]+$/.exec(Ze&&Ze.keys&&Ze.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),nt=K.toString,rt=Qe.call(Ke),it=Ht._,at=qe(`^`+Qe.call($e).replace(Te,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),ot=Gt?t.Buffer:n,st=t.Symbol,ct=t.Uint8Array,q=ot?ot.allocUnsafe:n,lt=Gn(Ke.getPrototypeOf,Ke),ut=Ke.create,dt=K.propertyIsEnumerable,ft=Ye.splice,pt=st?st.isConcatSpreadable:n,mt=st?st.iterator:n,ht=st?st.toStringTag:n,gt=function(){try{var e=ko(Ke,`defineProperty`);return e({},``,{}),e}catch{}}(),_t=t.clearTimeout!==Ht.clearTimeout&&t.clearTimeout,vt=je&&je.now!==Ht.Date.now&&je.now,yt=t.setTimeout!==Ht.setTimeout&&t.setTimeout,bt=Ge.ceil,xt=Ge.floor,St=Ke.getOwnPropertySymbols,Ct=ot?ot.isBuffer:n,Et=t.isFinite,Dt=Ye.join,Ot=Gn(Ke.keys,Ke),kt=Ge.max,Pt=Ge.min,Ft=je.now,It=t.parseInt,Lt=Ge.random,Bt=Ye.reverse,Vt=ko(t,`DataView`),Ut=ko(t,`Map`),Wt=ko(t,`Promise`),Kt=ko(t,`Set`),qt=ko(t,`WeakMap`),mn=ko(Ke,`create`),hn=qt&&new qt,wn={},Yn=ms(Vt),tr=ms(Ut),nr=ms(Wt),Y=ms(Kt),ir=ms(qt),ar=st?st.prototype:n,or=ar?ar.valueOf:n,sr=ar?ar.toString:n;function X(e){if(ou(e)&&!$(e)&&!(e instanceof Z)){if(e instanceof ur)return e;if($e.call(e,`__wrapped__`))return gs(e)}return new ur(e)}var cr=function(){function e(){}return function(t){if(!au(t))return{};if(ut)return ut(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function lr(){}function ur(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}X.templateSettings={escape:ye,evaluate:be,interpolate:xe,variable:``,imports:{_:X}},X.prototype=lr.prototype,X.prototype.constructor=X,ur.prototype=cr(lr.prototype),ur.prototype.constructor=ur;function Z(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=v,this.__views__=[]}function dr(){var e=new Z(this.__wrapped__);return e.__actions__=Ba(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ba(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ba(this.__views__),e}function fr(){if(this.__filtered__){var e=new Z(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function pr(){var e=this.__wrapped__.value(),t=this.__dir__,n=$(e),r=t<0,i=n?e.length:0,a=Po(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=Pt(c,this.__takeCount__);if(!n||!r&&i==c&&p==c)return xa(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}Z.prototype=cr(lr.prototype),Z.prototype.constructor=Z;function mr(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 hr(){this.__data__=mn?mn(null):{},this.size=0}function gr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}function _r(e){var t=this.__data__;if(mn){var r=t[e];return r===i?n:r}return $e.call(t,e)?t[e]:n}function vr(e){var t=this.__data__;return mn?t[e]!==n:$e.call(t,e)}function yr(e,t){var r=this.__data__;return this.size+=+!this.has(e),r[e]=mn&&t===n?i:t,this}mr.prototype.clear=hr,mr.prototype.delete=gr,mr.prototype.get=_r,mr.prototype.has=vr,mr.prototype.set=yr;function br(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 xr(){this.__data__=[],this.size=0}function Sr(e){var t=this.__data__,n=qr(t,e);return n<0?!1:(n==t.length-1?t.pop():ft.call(t,n,1),--this.size,!0)}function Cr(e){var t=this.__data__,r=qr(t,e);return r<0?n:t[r][1]}function wr(e){return qr(this.__data__,e)>-1}function Tr(e,t){var n=this.__data__,r=qr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}br.prototype.clear=xr,br.prototype.delete=Sr,br.prototype.get=Cr,br.prototype.has=wr,br.prototype.set=Tr;function Er(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 Dr(){this.size=0,this.__data__={hash:new mr,map:new(Ut||br),string:new mr}}function Or(e){var t=Do(this,e).delete(e);return this.size-=+!!t,t}function kr(e){return Do(this,e).get(e)}function Ar(e){return Do(this,e).has(e)}function jr(e,t){var n=Do(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}Er.prototype.clear=Dr,Er.prototype.delete=Or,Er.prototype.get=kr,Er.prototype.has=Ar,Er.prototype.set=jr;function Mr(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Er;++t<n;)this.add(e[t])}function Nr(e){return this.__data__.set(e,i),this}function Pr(e){return this.__data__.has(e)}Mr.prototype.add=Mr.prototype.push=Nr,Mr.prototype.has=Pr;function Fr(e){var t=this.__data__=new br(e);this.size=t.size}function Ir(){this.__data__=new br,this.size=0}function Lr(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Rr(e){return this.__data__.get(e)}function zr(e){return this.__data__.has(e)}function Br(e,t){var n=this.__data__;if(n instanceof br){var r=n.__data__;if(!Ut||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Er(r)}return n.set(e,t),this.size=n.size,this}Fr.prototype.clear=Ir,Fr.prototype.delete=Lr,Fr.prototype.get=Rr,Fr.prototype.has=zr,Fr.prototype.set=Br;function Vr(e,t){var n=$(e),r=!n&&Ul(e),i=!n&&!r&&Jl(e),a=!n&&!r&&!i&&xu(e),o=n||r||i||a,s=o?On(e.length,G):[],c=s.length;for(var l in e)(t||$e.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Ho(l,c)))&&s.push(l);return s}function Hr(e){var t=e.length;return t?e[ea(0,t-1)]:n}function Ur(e,t){return ds(Ba(e),$r(t,0,e.length))}function Wr(e){return ds(Ba(e))}function Gr(e,t,r){(r!==n&&!Bl(e[t],r)||r===n&&!(t in e))&&Zr(e,t,r)}function Kr(e,t,r){var i=e[t];(!($e.call(e,t)&&Bl(i,r))||r===n&&!(t in e))&&Zr(e,t,r)}function qr(e,t){for(var n=e.length;n--;)if(Bl(e[n][0],t))return n;return-1}function Jr(e,t,n,r){return ai(e,function(e,i,a){t(r,e,n(e),a)}),r}function Yr(e,t){return e&&Va(t,rd(t),e)}function Xr(e,t){return e&&Va(t,id(t),e)}function Zr(e,t,n){t==`__proto__`&>?gt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Qr(e,t){for(var r=-1,i=t.length,a=U(i),o=e==null;++r<i;)a[r]=o?n:Zu(e,t[r]);return a}function $r(e,t,r){return e===e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function ei(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=$(e);if(d){if(s=Lo(e),!c)return Ba(e,s)}else{var f=No(e),p=f==k||f==A;if(Jl(e))return Aa(e,c);if(f==P||f==S||p&&!a){if(s=l||p?{}:Ro(e),!c)return l?Ua(e,Xr(s,e)):Ha(e,Yr(s,e))}else{if(!Nt[f])return a?e:{};s=zo(e,f,c)}}o||=new Fr;var m=o.get(e);if(m)return m;o.set(e,s),vu(e)?e.forEach(function(n){s.add(ei(n,t,r,n,e,o))}):su(e)&&e.forEach(function(n,i){s.set(i,ei(n,t,r,i,e,o))});var h=d?n:(u?l?Co:So:l?id:rd)(e);return nn(h||e,function(n,i){h&&(i=n,n=e[i]),Kr(s,i,ei(n,t,r,i,e,o))}),s}function ti(e){var t=rd(e);return function(n){return ni(n,e,t)}}function ni(e,t,r){var i=r.length;if(e==null)return!i;for(e=Ke(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 ri(e,t,i){if(typeof e!=`function`)throw new Je(r);return ss(function(){e.apply(n,i)},t)}function ii(e,t,n,r){var i=-1,a=sn,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=ln(t,jn(n))),r?(a=cn,o=!1):t.length>=200&&(a=Nn,o=!1,t=new Mr(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 ai=Ka(mi),oi=Ka(hi,!0);function si(e,t){var n=!0;return ai(e,function(e,r,i){return n=!!t(e,r,i),n}),n}function ci(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 li(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 ui(e,t){var n=[];return ai(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function di(e,t,n,r,i){var a=-1,o=e.length;for(n||=Vo,i||=[];++a<o;){var s=e[a];t>0&&n(s)?t>1?di(s,t-1,n,r,i):un(i,s):r||(i[i.length]=s)}return i}var fi=qa(),pi=qa(!0);function mi(e,t){return e&&fi(e,t,rd)}function hi(e,t){return e&&pi(e,t,rd)}function gi(e,t){return on(t,function(t){return nu(e[t])})}function _i(e,t){t=Ea(t,e);for(var r=0,i=t.length;e!=null&&r<i;)e=e[ps(t[r++])];return r&&r==i?e:n}function vi(e,t,n){var r=t(e);return $(e)?r:un(r,n(e))}function yi(e){return e==null?e===n?ee:N:ht&&ht in Ke(e)?Ao(e):ts(e)}function bi(e,t){return e>t}function xi(e,t){return e!=null&&$e.call(e,t)}function Si(e,t){return e!=null&&t in Ke(e)}function Ci(e,t,n){return e>=Pt(t,n)&&e<kt(t,n)}function wi(e,t,r){for(var i=r?cn:sn,a=e[0].length,o=e.length,s=o,c=U(o),l=1/0,u=[];s--;){var d=e[s];s&&t&&(d=ln(d,jn(t))),l=Pt(d.length,l),c[s]=!r&&(t||a>=120&&d.length>=120)?new Mr(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?Nn(p,h):i(u,h,r))){for(s=o;--s;){var g=c[s];if(!(g?Nn(g,h):i(e[s],h,r)))continue outer}p&&p.push(h),u.push(m)}}return u}function Ti(e,t,n,r){return mi(e,function(e,i,a){t(r,n(e),i,a)}),r}function Ei(e,t,r){t=Ea(t,e),e=rs(e,t);var i=e==null?e:e[ps(Vs(t))];return i==null?n:en(i,e,r)}function Di(e){return ou(e)&&yi(e)==S}function Oi(e){return ou(e)&&yi(e)==ne}function ki(e){return ou(e)&&yi(e)==E}function Ai(e,t,n,r,i){return e===t?!0:e==null||t==null||!ou(e)&&!ou(t)?e!==e&&t!==t:ji(e,t,n,r,Ai,i)}function ji(e,t,n,r,i,a){var o=$(e),s=$(t),c=o?C:No(e),l=s?C:No(t);c=c==S?P:c,l=l==S?P:l;var u=c==P,d=l==P,f=c==l;if(f&&Jl(e)){if(!Jl(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Fr,o||xu(e)?vo(e,t,n,r,i,a):yo(e,t,c,n,r,i,a);if(!(n&1)){var p=u&&$e.call(e,`__wrapped__`),m=d&&$e.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Fr,i(h,g,n,r,a)}}return f?(a||=new Fr,bo(e,t,n,r,i,a)):!1}function Mi(e){return ou(e)&&No(e)==j}function Ni(e,t,r,i){var a=r.length,o=a,s=!i;if(e==null)return!o;for(e=Ke(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 Fr;if(i)var p=i(u,d,l,e,t,f);if(!(p===n?Ai(d,u,3,i,f):p))return!1}}return!0}function Pi(e){return!au(e)||qo(e)?!1:(nu(e)?at:Re).test(ms(e))}function Fi(e){return ou(e)&&yi(e)==L}function Ii(e){return ou(e)&&No(e)==R}function Li(e){return ou(e)&&iu(e.length)&&!!Mt[yi(e)]}function Ri(e){return typeof e==`function`?e:e==null?ff:typeof e==`object`?$(e)?Wi(e[0],e[1]):Ui(e):Tf(e)}function zi(e){if(!Yo(e))return Ot(e);var t=[];for(var n in Ke(e))$e.call(e,n)&&n!=`constructor`&&t.push(n);return t}function Bi(e){if(!au(e))return es(e);var t=Yo(e),n=[];for(var r in e)r==`constructor`&&(t||!$e.call(e,r))||n.push(r);return n}function Vi(e,t){return e<t}function Hi(e,t){var n=-1,r=Gl(e)?U(e.length):[];return ai(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Ui(e){var t=Oo(e);return t.length==1&&t[0][2]?Zo(t[0][0],t[0][1]):function(n){return n===e||Ni(n,e,t)}}function Wi(e,t){return Wo(e)&&Xo(t)?Zo(ps(e),t):function(r){var i=Zu(r,e);return i===n&&i===t?$u(r,e):Ai(t,i,3)}}function Gi(e,t,r,i,a){e!==t&&fi(t,function(o,s){if(a||=new Fr,au(o))Ki(e,t,s,r,Gi,i,a);else{var c=i?i(as(e,s),o,s+``,e,t,a):n;c===n&&(c=o),Gr(e,s,c)}},id)}function Ki(e,t,r,i,a,o,s){var c=as(e,r),l=as(t,r),u=s.get(l);if(u){Gr(e,r,u);return}var d=o?o(c,l,r+``,e,t,s):n,f=d===n;if(f){var p=$(l),m=!p&&Jl(l),h=!p&&!m&&xu(l);d=l,p||m||h?$(c)?d=c:Kl(c)?d=Ba(c):m?(f=!1,d=Aa(l,!0)):h?(f=!1,d=Fa(l,!0)):d=[]:hu(l)||Ul(l)?(d=c,Ul(c)?d=Mu(c):(!au(c)||nu(c))&&(d=Ro(l))):f=!1}f&&(s.set(l,d),a(d,l,i,o,s),s.delete(l)),Gr(e,r,d)}function qi(e,t){var r=e.length;if(r)return t+=t<0?r:0,Ho(t,r)?e[t]:n}function Ji(e,t,n){t=t.length?ln(t,function(e){return $(e)?function(t){return _i(t,e.length===1?e[0]:e)}:e}):[ff];var r=-1;return t=ln(t,jn(Q())),En(Hi(e,function(e,n,i){return{criteria:ln(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return La(e,t,n)})}function Yi(e,t){return Xi(e,t,function(t,n){return $u(e,n)})}function Xi(e,t,n){for(var r=-1,i=t.length,a={};++r<i;){var o=t[r],s=_i(e,o);n(s,o)&&oa(a,Ea(o,e),s)}return a}function Zi(e){return function(t){return _i(t,e)}}function Qi(e,t,n,r){var i=r?bn:yn,a=-1,o=t.length,s=e;for(e===t&&(t=Ba(t)),n&&(s=ln(e,jn(n)));++a<o;)for(var c=0,l=t[a],u=n?n(l):l;(c=i(s,u,c,r))>-1;)s!==e&&ft.call(s,c,1),ft.call(e,c,1);return e}function $i(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;Ho(i)?ft.call(e,i,1):va(e,i)}}return e}function ea(e,t){return e+xt(Lt()*(t-e+1))}function ta(e,t,n,r){for(var i=-1,a=kt(bt((t-e)/(n||1)),0),o=U(a);a--;)o[r?a:++i]=e,e+=n;return o}function na(e,t){var n=``;if(!e||t<1||t>g)return n;do t%2&&(n+=e),t=xt(t/2),t&&(e+=e);while(t);return n}function ra(e,t){return cs(ns(e,t,ff),e+``)}function ia(e){return Hr(Sd(e))}function aa(e,t){var n=Sd(e);return ds(n,$r(t,0,n.length))}function oa(e,t,r,i){if(!au(e))return e;t=Ea(t,e);for(var a=-1,o=t.length,s=o-1,c=e;c!=null&&++a<o;){var l=ps(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:Ho(t[a+1])?[]:{})}Kr(c,l,u),c=c[l]}return e}var sa=hn?function(e,t){return hn.set(e,t),e}:ff,ca=gt?function(e,t){return gt(e,`toString`,{configurable:!0,enumerable:!1,value:cf(t),writable:!0})}:ff;function la(e){return ds(Sd(e))}function ua(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=U(i);++r<i;)a[r]=e[r+t];return a}function da(e,t){var n;return ai(e,function(e,r,i){return n=t(e,r,i),!n}),!!n}function fa(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 pa(e,t,ff,n)}function pa(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=xt((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 Pt(o,y)}function ma(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||!Bl(s,c)){var c=s;a[i++]=o===0?0:o}}return a}function ha(e){return typeof e==`number`?e:bu(e)?_:+e}function ga(e){if(typeof e==`string`)return e;if($(e))return ln(e,ga)+``;if(bu(e))return sr?sr.call(e):``;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function _a(e,t,n){var r=-1,i=sn,a=e.length,o=!0,s=[],c=s;if(n)o=!1,i=cn;else if(a>=200){var l=t?null:fo(e);if(l)return qn(l);o=!1,i=Nn,c=new Mr}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 va(e,t){t=Ea(t,e);var n=-1,r=t.length;if(!r)return!0;for(;++n<r;){var i=ps(t[n]);if(i===`__proto__`&&!$e.call(e,`__proto__`)||(i===`constructor`||i===`prototype`)&&n<r-1)return!1}var a=rs(e,t);return a==null||delete a[ps(Vs(t))]}function ya(e,t,n,r){return oa(e,t,n(_i(e,t)),r)}function ba(e,t,n,r){for(var i=e.length,a=r?i:-1;(r?a--:++a<i)&&t(e[a],a,e););return n?ua(e,r?0:a,r?a+1:i):ua(e,r?a+1:0,r?i:a)}function xa(e,t){var n=e;return n instanceof Z&&(n=n.value()),dn(t,function(e,t){return t.func.apply(t.thisArg,un([e],t.args))},n)}function Sa(e,t,n){var r=e.length;if(r<2)return r?_a(e[0]):[];for(var i=-1,a=U(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=ii(a[i]||o,e[s],t,n));return _a(di(a,1),t,n)}function Ca(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 wa(e){return Kl(e)?e:[]}function Ta(e){return typeof e==`function`?e:ff}function Ea(e,t){return $(e)?e:Wo(e,t)?[e]:fs(Pu(e))}var Da=ra;function Oa(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:ua(e,t,r)}var ka=_t||function(e){return Ht.clearTimeout(e)};function Aa(e,t){if(t)return e.slice();var n=e.length,r=q?q(n):new e.constructor(n);return e.copy(r),r}function ja(e){var t=new e.constructor(e.byteLength);return new ct(t).set(new ct(e)),t}function Ma(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Na(e){var t=new e.constructor(e.source,Fe.exec(e));return t.lastIndex=e.lastIndex,t}function Pa(e){return or?Ke(or.call(e)):{}}function Fa(e,t){var n=t?ja(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ia(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 La(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Ia(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Ra(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=kt(a-o,0),u=U(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 za(e,t,n,r){for(var i=-1,a=e.length,o=-1,s=n.length,c=-1,l=t.length,u=kt(a-s,0),d=U(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 Ba(e,t){var n=-1,r=e.length;for(t||=U(r);++n<r;)t[n]=e[n];return t}function Va(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?Zr(r,c,l):Kr(r,c,l)}return r}function Ha(e,t){return Va(e,jo(e),t)}function Ua(e,t){return Va(e,Mo(e),t)}function Wa(e,t){return function(n,r){var i=$(n)?tn:Jr,a=t?t():{};return i(n,e,Q(r,2),a)}}function Ga(e){return ra(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&&Uo(r[0],r[1],s)&&(o=a<3?n:o,a=1),t=Ke(t);++i<a;){var c=r[i];c&&e(t,c,i,o)}return t})}function Ka(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=Ke(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}function qa(e){return function(t,n,r){for(var i=-1,a=Ke(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 Ja(e,t,n){var r=t&o,i=Za(e);function a(){return(this&&this!==Ht&&this instanceof a?i:e).apply(r?n:this,arguments)}return a}function Ya(e){return function(t){t=Pu(t);var r=Vn(t)?Qn(t):n,i=r?r[0]:t.charAt(0),a=r?Oa(r,1).join(``):t.slice(1);return i[e]()+a}}function Xa(e){return function(t){return dn(nf(kd(t).replace(wt,``)),e,``)}}function Za(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=cr(e.prototype),r=e.apply(n,t);return au(r)?r:n}}function Qa(e,t,r){var i=Za(e);function a(){for(var o=arguments.length,s=U(o),c=o,l=Eo(a);c--;)s[c]=arguments[c];var u=o<3&&s[0]!==l&&s[o-1]!==l?[]:Kn(s,l);return o-=u.length,o<r?lo(e,t,to,a.placeholder,n,s,u,n,n,r-o):en(this&&this!==Ht&&this instanceof a?i:e,this,s)}return a}function $a(e){return function(t,r,i){var a=Ke(t);if(!Gl(t)){var o=Q(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 eo(e){return xo(function(t){var i=t.length,a=i,o=ur.prototype.thru;for(e&&t.reverse();a--;){var s=t[a];if(typeof s!=`function`)throw new Je(r);if(o&&!l&&To(s)==`wrapper`)var l=new ur([],!0)}for(a=l?a:i;++a<i;){s=t[a];var d=To(s),m=d==`wrapper`?wo(s):n;l=m&&Ko(m[0])&&m[1]==(f|c|u|p)&&!m[4].length&&m[9]==1?l[To(m[0])].apply(l,m[3]):s.length==1&&Ko(s)?l[d]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&e.length==1&&$(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 to(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:Za(e);function C(){for(var n=arguments.length,o=U(n),s=n;s--;)o[s]=arguments[s];if(b)var c=Eo(C),l=In(o,c);if(i&&(o=Ra(o,i,a,b)),u&&(o=za(o,u,d,b)),n-=l,b&&n<g){var f=Kn(o,c);return lo(e,t,to,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=is(o,p):x&&n>1&&o.reverse(),_&&h<n&&(o.length=h),this&&this!==Ht&&this instanceof C&&(w=S||Za(w)),w.apply(m,o)}return C}function no(e,t){return function(n,r){return Ti(n,e,t(r),{})}}function ro(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=ga(r),i=ga(i)):(r=ha(r),i=ha(i)),a=e(r,i)}return a}}function io(e){return xo(function(t){return t=ln(t,jn(Q())),ra(function(n){var r=this;return e(t,function(e){return en(e,r,n)})})})}function ao(e,t){t=t===n?` `:ga(t);var r=t.length;if(r<2)return r?na(t,e):t;var i=na(t,bt(e/Zn(t)));return Vn(t)?Oa(Qn(i),0,e).join(``):i.slice(0,e)}function oo(e,t,n,r){var i=t&o,a=Za(e);function s(){for(var t=-1,o=arguments.length,c=-1,l=r.length,u=U(l+o),d=this&&this!==Ht&&this instanceof s?a:e;++c<l;)u[c]=r[c];for(;o--;)u[c++]=arguments[++t];return en(d,i?n:this,u)}return s}function so(e){return function(t,r,i){return i&&typeof i!=`number`&&Uo(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),ta(t,r,i,e)}}function co(e){return function(t,n){return typeof t==`string`&&typeof n==`string`||(t=ju(t),n=ju(n)),e(t,n)}}function lo(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 Ko(e)&&os(S,x),S.placeholder=i,ls(S,e,t)}function uo(e){var t=Ge[e];return function(e,n){if(e=ju(e),n=n==null?0:Pt(ku(n),292),n&&Et(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 fo=Kt&&1/qn(new Kt([,-0]))[1]==h?function(e){return new Kt(e)}:bf;function po(e){return function(t){var n=No(t);return n==j?Wn(t):n==R?Jn(t):kn(t,e(t))}}function mo(e,t,i,a,f,p,m,h){var g=t&s;if(!g&&typeof e!=`function`)throw new Je(r);var _=a?a.length:0;if(_||(t&=~(u|d),a=f=n),m=m===n?m:kt(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:wo(e),x=[e,t,i,a,f,v,y,p,m,h];if(b&&$o(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:kt(x[9]-_,0),!h&&t&(c|l)&&(t&=~(c|l)),!t||t==o)var S=Ja(e,t,i);else S=t==c||t==l?Qa(e,t,h):(t==u||t==(o|u))&&!f.length?oo(e,t,i,a):to.apply(n,x);return ls((b?sa:os)(S,x),e,t)}function ho(e,t,r,i){return e===n||Bl(e,K[r])&&!$e.call(i,r)?t:e}function go(e,t,r,i,a,o){return au(e)&&au(t)&&(o.set(t,e),Gi(e,t,n,go,o),o.delete(t)),e}function _o(e){return hu(e)?n:e}function vo(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 Mr: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(!pn(t,function(e,t){if(!Nn(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 yo(e,t,n,r,i,a,o){switch(n){case H:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ne:return!(e.byteLength!=t.byteLength||!a(new ct(e),new ct(t)));case T:case E:case M:return Bl(+e,+t);case O:return e.name==t.name&&e.message==t.message;case L:case z:return e==t+``;case j:var s=Wn;case R:var c=r&1;if(s||=qn,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=vo(s(e),s(t),r,i,a,o);return o.delete(e),u;case B:if(or)return or.call(e)==or.call(t)}return!1}function bo(e,t,r,i,a,o){var s=r&1,c=So(e),l=c.length;if(l!=So(t).length&&!s)return!1;for(var u=l;u--;){var d=c[u];if(!(s?d in t:$e.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 xo(e){return cs(ns(e,n,As),e+``)}function So(e){return vi(e,rd,jo)}function Co(e){return vi(e,id,Mo)}var wo=hn?function(e){return hn.get(e)}:bf;function To(e){for(var t=e.name+``,n=wn[t],r=$e.call(wn,t)?n.length:0;r--;){var i=n[r],a=i.func;if(a==null||a==e)return i.name}return t}function Eo(e){return($e.call(X,`placeholder`)?X:e).placeholder}function Q(){var e=X.iteratee||pf;return e=e===pf?Ri:e,arguments.length?e(arguments[0],arguments[1]):e}function Do(e,t){var n=e.__data__;return Go(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Oo(e){for(var t=rd(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Xo(i)]}return t}function ko(e,t){var r=Bn(e,t);return Pi(r)?r:n}function Ao(e){var t=$e.call(e,ht),r=e[ht];try{e[ht]=n;var i=!0}catch{}var a=nt.call(e);return i&&(t?e[ht]=r:delete e[ht]),a}var jo=St?function(e){return e==null?[]:(e=Ke(e),on(St(e),function(t){return dt.call(e,t)}))}:kf,Mo=St?function(e){for(var t=[];e;)un(t,jo(e)),e=lt(e);return t}:kf,No=yi;(Vt&&No(new Vt(new ArrayBuffer(1)))!=H||Ut&&No(new Ut)!=j||Wt&&No(Wt.resolve())!=F||Kt&&No(new Kt)!=R||qt&&No(new qt)!=V)&&(No=function(e){var t=yi(e),r=t==P?e.constructor:n,i=r?ms(r):``;if(i)switch(i){case Yn:return H;case tr:return j;case nr:return F;case Y:return R;case ir:return V}return t});function Po(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=Pt(t,e+o);break;case`takeRight`:e=kt(e,t-o);break}}return{start:e,end:t}}function Fo(e){var t=e.match(ke);return t?t[1].split(Ae):[]}function Io(e,t,n){t=Ea(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=ps(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)&&Ho(o,i)&&($(e)||Ul(e)))}function Lo(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&$e.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Ro(e){return typeof e.constructor==`function`&&!Yo(e)?cr(lt(e)):{}}function zo(e,t,n){var r=e.constructor;switch(t){case ne:return ja(e);case T:case E:return new r(+e);case H:return Ma(e,n);case re:case ie:case ae:case oe:case se:case ce:case le:case ue:case de:return Fa(e,n);case j:return new r;case M:case z:return new r(e);case L:return Na(e);case R:return new r;case B:return Pa(e)}}function Bo(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(Oe,`{
|
|
4
4
|
/* [wrapped with `+t+`] */
|
|
5
5
|
`)}function Vo(e){return $(e)||Ul(e)||!!(pt&&e&&e[pt])}function Ho(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&ze.test(e))&&e>-1&&e%1==0&&e<t}function Uo(e,t,n){if(!au(n))return!1;var r=typeof t;return(r==`number`?Gl(n)&&Ho(t,n.length):r==`string`&&t in n)?Bl(n[t],e):!1}function Wo(e,t){if($(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||bu(e)?!0:Ce.test(e)||!Se.test(e)||t!=null&&e in Ke(t)}function Go(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Ko(e){var t=To(e),n=X[t];if(typeof n!=`function`||!(t in Z.prototype))return!1;if(e===n)return!0;var r=wo(n);return!!r&&e===r[0]}function qo(e){return!!tt&&tt in e}var Jo=Ze?nu:Af;function Yo(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||K)}function Xo(e){return e===e&&!au(e)}function Zo(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==n||e in Ke(r))}}function Qo(e){var t=Sl(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function $o(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?Ra(m,d,t[4]):d,e[4]=m?Kn(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?za(m,d,t[6]):d,e[6]=m?Kn(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:Pt(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function es(e){var t=[];if(e!=null)for(var n in Ke(e))t.push(n);return t}function ts(e){return nt.call(e)}function ns(e,t,r){return t=kt(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=kt(n.length-t,0),o=U(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=U(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),en(e,this,s)}}function rs(e,t){return t.length<2?e:_i(e,ua(t,0,-1))}function is(e,t){for(var r=e.length,i=Pt(t.length,r),a=Ba(e);i--;){var o=t[i];e[i]=Ho(o,r)?a[o]:n}return e}function as(e,t){if(!(t===`constructor`&&typeof e[t]==`function`)&&t!=`__proto__`)return e[t]}var os=us(sa),ss=yt||function(e,t){return Ht.setTimeout(e,t)},cs=us(ca);function ls(e,t,n){var r=t+``;return cs(e,Bo(r,hs(Fo(r),n)))}function us(e){var t=0,r=0;return function(){var i=Ft(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function ds(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=ea(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var fs=Qo(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(we,function(e,n,r,i){t.push(r?i.replace(Ne,`$1`):n||e)}),t});function ps(e){if(typeof e==`string`||bu(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function ms(e){if(e!=null){try{return Qe.call(e)}catch{}try{return e+``}catch{}}return``}function hs(e,t){return nn(x,function(n){var r=`_.`+n[0];t&n[1]&&!sn(e,r)&&e.push(r)}),e.sort()}function gs(e){if(e instanceof Z)return e.clone();var t=new ur(e.__wrapped__,e.__chain__);return t.__actions__=Ba(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function _s(e,t,r){t=(r?Uo(e,t,r):t===n)?1:kt(ku(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=U(bt(i/t));a<i;)s[o++]=ua(e,a,a+=t);return s}function vs(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 ys(){var e=arguments.length;if(!e)return[];for(var t=U(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return un($(n)?Ba(n):[n],di(t,1))}var bs=ra(function(e,t){return Kl(e)?ii(e,di(t,1,Kl,!0)):[]}),xs=ra(function(e,t){var r=Vs(t);return Kl(r)&&(r=n),Kl(e)?ii(e,di(t,1,Kl,!0),Q(r,2)):[]}),Ss=ra(function(e,t){var r=Vs(t);return Kl(r)&&(r=n),Kl(e)?ii(e,di(t,1,Kl,!0),n,r):[]});function Cs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),ua(e,t<0?0:t,i)):[]}function ws(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),t=i-t,ua(e,0,t<0?0:t)):[]}function Ts(e,t){return e&&e.length?ba(e,Q(t,3),!0,!0):[]}function Es(e,t){return e&&e.length?ba(e,Q(t,3),!0):[]}function Ds(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&Uo(e,t,n)&&(n=0,r=i),li(e,t,n,r)):[]}function Os(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=kt(r+i,0)),vn(e,Q(t,3),i)}function ks(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?kt(i+a,0):Pt(a,i-1)),vn(e,Q(t,3),a,!0)}function As(e){return e!=null&&e.length?di(e,1):[]}function js(e){return e!=null&&e.length?di(e,h):[]}function Ms(e,t){return e!=null&&e.length?(t=t===n?1:ku(t),di(e,t)):[]}function Ns(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];Zr(r,i[0],i[1])}return r}function Ps(e){return e&&e.length?e[0]:n}function Fs(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=kt(r+i,0)),yn(e,t,i)}function Is(e){return e!=null&&e.length?ua(e,0,-1):[]}var Ls=ra(function(e){var t=ln(e,wa);return t.length&&t[0]===e[0]?wi(t):[]}),Rs=ra(function(e){var t=Vs(e),r=ln(e,wa);return t===Vs(r)?t=n:r.pop(),r.length&&r[0]===e[0]?wi(r,Q(t,2)):[]}),zs=ra(function(e){var t=Vs(e),r=ln(e,wa);return t=typeof t==`function`?t:n,t&&r.pop(),r.length&&r[0]===e[0]?wi(r,n,t):[]});function Bs(e,t){return e==null?``:Dt.call(e,t)}function Vs(e){var t=e==null?0:e.length;return t?e[t-1]:n}function Hs(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?kt(i+a,0):Pt(a,i-1)),t===t?Xn(e,t,a):vn(e,xn,a,!0)}function Us(e,t){return e&&e.length?qi(e,ku(t)):n}var Ws=ra(Gs);function Gs(e,t){return e&&e.length&&t&&t.length?Qi(e,t):e}function Ks(e,t,n){return e&&e.length&&t&&t.length?Qi(e,t,Q(n,2)):e}function qs(e,t,r){return e&&e.length&&t&&t.length?Qi(e,t,n,r):e}var Js=xo(function(e,t){var n=e==null?0:e.length,r=Qr(e,t);return $i(e,ln(t,function(e){return Ho(e,n)?+e:e}).sort(Ia)),r});function Ys(e,t){var n=[];if(!(e&&e.length))return n;var r=-1,i=[],a=e.length;for(t=Q(t,3);++r<a;){var o=e[r];t(o,r,e)&&(n.push(o),i.push(r))}return $i(e,i),n}function Xs(e){return e==null?e:Bt.call(e)}function Zs(e,t,r){var i=e==null?0:e.length;return i?(r&&typeof r!=`number`&&Uo(e,t,r)?(t=0,r=i):(t=t==null?0:ku(t),r=r===n?i:ku(r)),ua(e,t,r)):[]}function Qs(e,t){return fa(e,t)}function $s(e,t,n){return pa(e,t,Q(n,2))}function ec(e,t){var n=e==null?0:e.length;if(n){var r=fa(e,t);if(r<n&&Bl(e[r],t))return r}return-1}function tc(e,t){return fa(e,t,!0)}function nc(e,t,n){return pa(e,t,Q(n,2),!0)}function rc(e,t){if(e!=null&&e.length){var n=fa(e,t,!0)-1;if(Bl(e[n],t))return n}return-1}function ic(e){return e&&e.length?ma(e):[]}function ac(e,t){return e&&e.length?ma(e,Q(t,2)):[]}function oc(e){var t=e==null?0:e.length;return t?ua(e,1,t):[]}function sc(e,t,r){return e&&e.length?(t=r||t===n?1:ku(t),ua(e,0,t<0?0:t)):[]}function cc(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:ku(t),t=i-t,ua(e,t<0?0:t,i)):[]}function lc(e,t){return e&&e.length?ba(e,Q(t,3),!1,!0):[]}function uc(e,t){return e&&e.length?ba(e,Q(t,3)):[]}var dc=ra(function(e){return _a(di(e,1,Kl,!0))}),fc=ra(function(e){var t=Vs(e);return Kl(t)&&(t=n),_a(di(e,1,Kl,!0),Q(t,2))}),pc=ra(function(e){var t=Vs(e);return t=typeof t==`function`?t:n,_a(di(e,1,Kl,!0),n,t)});function mc(e){return e&&e.length?_a(e):[]}function hc(e,t){return e&&e.length?_a(e,Q(t,2)):[]}function gc(e,t){return t=typeof t==`function`?t:n,e&&e.length?_a(e,n,t):[]}function _c(e){if(!(e&&e.length))return[];var t=0;return e=on(e,function(e){if(Kl(e))return t=kt(e.length,t),!0}),On(t,function(t){return ln(e,Cn(t))})}function vc(e,t){if(!(e&&e.length))return[];var r=_c(e);return t==null?r:ln(r,function(e){return en(t,n,e)})}var yc=ra(function(e,t){return Kl(e)?ii(e,t):[]}),bc=ra(function(e){return Sa(on(e,Kl))}),xc=ra(function(e){var t=Vs(e);return Kl(t)&&(t=n),Sa(on(e,Kl),Q(t,2))}),Sc=ra(function(e){var t=Vs(e);return t=typeof t==`function`?t:n,Sa(on(e,Kl),n,t)}),Cc=ra(_c);function wc(e,t){return Ca(e||[],t||[],Kr)}function Tc(e,t){return Ca(e||[],t||[],oa)}var Ec=ra(function(e){var t=e.length,r=t>1?e[t-1]:n;return r=typeof r==`function`?(e.pop(),r):n,vc(e,r)});function Dc(e){var t=X(e);return t.__chain__=!0,t}function Oc(e,t){return t(e),e}function kc(e,t){return t(e)}var Ac=xo(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,a=function(t){return Qr(t,e)};return t>1||this.__actions__.length||!(i instanceof Z)||!Ho(r)?this.thru(a):(i=i.slice(r,+r+ +!!t),i.__actions__.push({func:kc,args:[a],thisArg:n}),new ur(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e}))});function jc(){return Dc(this)}function Mc(){return new ur(this.value(),this.__chain__)}function Nc(){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 Pc(){return this}function Fc(e){for(var t,r=this;r instanceof lr;){var i=gs(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 Ic(){var e=this.__wrapped__;if(e instanceof Z){var t=e;return this.__actions__.length&&(t=new Z(this)),t=t.reverse(),t.__actions__.push({func:kc,args:[Xs],thisArg:n}),new ur(t,this.__chain__)}return this.thru(Xs)}function Lc(){return xa(this.__wrapped__,this.__actions__)}var Rc=Wa(function(e,t,n){$e.call(e,n)?++e[n]:Zr(e,n,1)});function zc(e,t,r){var i=$(e)?an:si;return r&&Uo(e,t,r)&&(t=n),i(e,Q(t,3))}function Bc(e,t){return($(e)?on:ui)(e,Q(t,3))}var Vc=$a(Os),Hc=$a(ks);function Uc(e,t){return di(Qc(e,t),1)}function Wc(e,t){return di(Qc(e,t),h)}function Gc(e,t,r){return r=r===n?1:ku(r),di(Qc(e,t),r)}function Kc(e,t){return($(e)?nn:ai)(e,Q(t,3))}function qc(e,t){return($(e)?rn:oi)(e,Q(t,3))}var Jc=Wa(function(e,t,n){$e.call(e,n)?e[n].push(t):Zr(e,n,[t])});function Yc(e,t,n,r){e=Gl(e)?e:Sd(e),n=n&&!r?ku(n):0;var i=e.length;return n<0&&(n=kt(i+n,0)),yu(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&yn(e,t,n)>-1}var Xc=ra(function(e,t,n){var r=-1,i=typeof t==`function`,a=Gl(e)?U(e.length):[];return ai(e,function(e){a[++r]=i?en(t,e,n):Ei(e,t,n)}),a}),Zc=Wa(function(e,t,n){Zr(e,n,t)});function Qc(e,t){return($(e)?ln:Hi)(e,Q(t,3))}function $c(e,t,r,i){return e==null?[]:($(t)||(t=t==null?[]:[t]),r=i?n:r,$(r)||(r=r==null?[]:[r]),Ji(e,t,r))}var el=Wa(function(e,t,n){e[+!n].push(t)},function(){return[[],[]]});function tl(e,t,n){var r=$(e)?dn:Tn,i=arguments.length<3;return r(e,Q(t,4),n,i,ai)}function nl(e,t,n){var r=$(e)?fn:Tn,i=arguments.length<3;return r(e,Q(t,4),n,i,oi)}function rl(e,t){return($(e)?on:ui)(e,Cl(Q(t,3)))}function il(e){return($(e)?Hr:ia)(e)}function al(e,t,r){return t=(r?Uo(e,t,r):t===n)?1:ku(t),($(e)?Ur:aa)(e,t)}function ol(e){return($(e)?Wr:la)(e)}function sl(e){if(e==null)return 0;if(Gl(e))return yu(e)?Zn(e):e.length;var t=No(e);return t==j||t==R?e.size:zi(e).length}function cl(e,t,r){var i=$(e)?pn:da;return r&&Uo(e,t,r)&&(t=n),i(e,Q(t,3))}var ll=ra(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Uo(e,t[0],t[1])?t=[]:n>2&&Uo(t[0],t[1],t[2])&&(t=[t[0]]),Ji(e,di(t,1),[])}),ul=vt||function(){return Ht.Date.now()};function dl(e,t){if(typeof t!=`function`)throw new Je(r);return e=ku(e),function(){if(--e<1)return t.apply(this,arguments)}}function fl(e,t,r){return t=r?n:t,t=e&&t==null?e.length:t,mo(e,f,n,n,n,n,t)}function pl(e,t){var i;if(typeof t!=`function`)throw new Je(r);return e=ku(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var ml=ra(function(e,t,n){var r=o;if(n.length){var i=Kn(n,Eo(ml));r|=u}return mo(e,r,t,n,i)}),hl=ra(function(e,t,n){var r=o|s;if(n.length){var i=Kn(n,Eo(hl));r|=u}return mo(t,r,e,n,i)});function gl(e,t,r){t=r?n:t;var i=mo(e,c,n,n,n,n,n,t);return i.placeholder=gl.placeholder,i}function _l(e,t,r){t=r?n:t;var i=mo(e,l,n,n,n,n,n,t);return i.placeholder=_l.placeholder,i}function vl(e,t,i){var a,o,s,c,l,u,d=0,f=!1,p=!1,m=!0;if(typeof e!=`function`)throw new Je(r);t=ju(t)||0,au(i)&&(f=!!i.leading,p=`maxWait`in i,s=p?kt(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=ss(y,t),f?h(e):c}function _(e){var n=e-u,r=e-d,i=t-n;return p?Pt(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=ul();if(v(e))return b(e);l=ss(y,_(e))}function b(e){return l=n,m&&a?h(e):(a=o=n,c)}function x(){l!==n&&ka(l),d=0,a=u=o=l=n}function S(){return l===n?c:b(ul())}function C(){var e=ul(),r=v(e);if(a=arguments,o=this,u=e,r){if(l===n)return g(u);if(p)return ka(l),l=ss(y,t),h(u)}return l===n&&(l=ss(y,t)),c}return C.cancel=x,C.flush=S,C}var yl=ra(function(e,t){return ri(e,1,t)}),bl=ra(function(e,t,n){return ri(e,ju(t)||0,n)});function xl(e){return mo(e,m)}function Sl(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw new Je(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(Sl.Cache||Er),n}Sl.Cache=Er;function Cl(e){if(typeof e!=`function`)throw new Je(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 wl(e){return pl(2,e)}var Tl=Da(function(e,t){t=t.length==1&&$(t[0])?ln(t[0],jn(Q())):ln(di(t,1),jn(Q()));var n=t.length;return ra(function(r){for(var i=-1,a=Pt(r.length,n);++i<a;)r[i]=t[i].call(this,r[i]);return en(e,this,r)})}),El=ra(function(e,t){return mo(e,u,n,t,Kn(t,Eo(El)))}),Dl=ra(function(e,t){return mo(e,d,n,t,Kn(t,Eo(Dl)))}),Ol=xo(function(e,t){return mo(e,p,n,n,n,t)});function kl(e,t){if(typeof e!=`function`)throw new Je(r);return t=t===n?t:ku(t),ra(e,t)}function Al(e,t){if(typeof e!=`function`)throw new Je(r);return t=t==null?0:kt(ku(t),0),ra(function(n){var r=n[t],i=Oa(n,0,t);return r&&un(i,r),en(e,this,i)})}function jl(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw new Je(r);return au(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),vl(e,t,{leading:i,maxWait:t,trailing:a})}function Ml(e){return fl(e,1)}function Nl(e,t){return El(Ta(t),e)}function Pl(){if(!arguments.length)return[];var e=arguments[0];return $(e)?e:[e]}function Fl(e){return ei(e,4)}function Il(e,t){return t=typeof t==`function`?t:n,ei(e,4,t)}function Ll(e){return ei(e,5)}function Rl(e,t){return t=typeof t==`function`?t:n,ei(e,5,t)}function zl(e,t){return t==null||ni(e,t,rd(t))}function Bl(e,t){return e===t||e!==e&&t!==t}var Vl=co(bi),Hl=co(function(e,t){return e>=t}),Ul=Di(function(){return arguments}())?Di:function(e){return ou(e)&&$e.call(e,`callee`)&&!dt.call(e,`callee`)},$=U.isArray,Wl=Jt?jn(Jt):Oi;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)&&yi(e)==T}var Jl=Ct||Af,Yl=Yt?jn(Yt):ki;function Xl(e){return ou(e)&&e.nodeType===1&&!hu(e)}function Zl(e){if(e==null)return!0;if(Gl(e)&&($(e)||typeof e==`string`||typeof e.splice==`function`||Jl(e)||xu(e)||Ul(e)))return!e.length;var t=No(e);if(t==j||t==R)return!e.size;if(Yo(e))return!zi(e).length;for(var n in e)if($e.call(e,n))return!1;return!0}function Ql(e,t){return Ai(e,t)}function $l(e,t,r){r=typeof r==`function`?r:n;var i=r?r(e,t):n;return i===n?Ai(e,t,n,r):!!i}function eu(e){if(!ou(e))return!1;var t=yi(e);return t==O||t==D||typeof e.message==`string`&&typeof e.name==`string`&&!hu(e)}function tu(e){return typeof e==`number`&&Et(e)}function nu(e){if(!au(e))return!1;var t=yi(e);return t==k||t==A||t==w||t==I}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=Xt?jn(Xt):Mi;function cu(e,t){return e===t||Ni(e,t,Oo(t))}function lu(e,t,r){return r=typeof r==`function`?r:n,Ni(e,t,Oo(t),r)}function uu(e){return mu(e)&&e!=+e}function du(e){if(Jo(e))throw new Ue(`Unsupported core-js use. Try https://npms.io/search?q=ponyfill.`);return Pi(e)}function fu(e){return e===null}function pu(e){return e==null}function mu(e){return typeof e==`number`||ou(e)&&yi(e)==M}function hu(e){if(!ou(e)||yi(e)!=P)return!1;var t=lt(e);if(t===null)return!0;var n=$e.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&Qe.call(n)==rt}var gu=Zt?jn(Zt):Fi;function _u(e){return ru(e)&&e>=-9007199254740991&&e<=g}var vu=Qt?jn(Qt):Ii;function yu(e){return typeof e==`string`||!$(e)&&ou(e)&&yi(e)==z}function bu(e){return typeof e==`symbol`||ou(e)&&yi(e)==B}var xu=$t?jn($t):Li;function Su(e){return e===n}function Cu(e){return ou(e)&&No(e)==V}function wu(e){return ou(e)&&yi(e)==te}var Tu=co(Vi),Eu=co(function(e,t){return e<=t});function Du(e){if(!e)return[];if(Gl(e))return yu(e)?Qn(e):Ba(e);if(mt&&e[mt])return Un(e[mt]());var t=No(e);return(t==j?Wn:t==R?qn: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?$r(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=An(e);var n=Le.test(e);return n||W.test(e)?zt(e.slice(2),n?2:8):Ie.test(e)?_:+e}function Mu(e){return Va(e,id(e))}function Nu(e){return e?$r(ku(e),-9007199254740991,g):e===0?e:0}function Pu(e){return e==null?``:ga(e)}var Fu=Ga(function(e,t){if(Yo(t)||Gl(t)){Va(t,rd(t),e);return}for(var n in t)$e.call(t,n)&&Kr(e,n,t[n])}),Iu=Ga(function(e,t){Va(t,id(t),e)}),Lu=Ga(function(e,t,n,r){Va(t,id(t),e,r)}),Ru=Ga(function(e,t,n,r){Va(t,rd(t),e,r)}),zu=xo(Qr);function Bu(e,t){var n=cr(e);return t==null?n:Yr(n,t)}var Vu=ra(function(e,t){e=Ke(e);var r=-1,i=t.length,a=i>2?t[2]:n;for(a&&Uo(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||Bl(d,K[u])&&!$e.call(e,u))&&(e[u]=o[u])}return e}),Hu=ra(function(e){return e.push(n,go),en(cd,n,e)});function Uu(e,t){return _n(e,Q(t,3),mi)}function Wu(e,t){return _n(e,Q(t,3),hi)}function Gu(e,t){return e==null?e:fi(e,Q(t,3),id)}function Ku(e,t){return e==null?e:pi(e,Q(t,3),id)}function qu(e,t){return e&&mi(e,Q(t,3))}function Ju(e,t){return e&&hi(e,Q(t,3))}function Yu(e){return e==null?[]:gi(e,rd(e))}function Xu(e){return e==null?[]:gi(e,id(e))}function Zu(e,t,r){var i=e==null?n:_i(e,t);return i===n?r:i}function Qu(e,t){return e!=null&&Io(e,t,xi)}function $u(e,t){return e!=null&&Io(e,t,Si)}var ed=no(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=nt.call(t)),e[t]=n},cf(ff)),td=no(function(e,t,n){t!=null&&typeof t.toString!=`function`&&(t=nt.call(t)),$e.call(e,t)?e[t].push(n):e[t]=[n]},Q),nd=ra(Ei);function rd(e){return Gl(e)?Vr(e):zi(e)}function id(e){return Gl(e)?Vr(e,!0):Bi(e)}function ad(e,t){var n={};return t=Q(t,3),mi(e,function(e,r,i){Zr(n,t(e,r,i),e)}),n}function od(e,t){var n={};return t=Q(t,3),mi(e,function(e,r,i){Zr(n,r,t(e,r,i))}),n}var sd=Ga(function(e,t,n){Gi(e,t,n)}),cd=Ga(function(e,t,n,r){Gi(e,t,n,r)}),ld=xo(function(e,t){var n={};if(e==null)return n;var r=!1;t=ln(t,function(t){return t=Ea(t,e),r||=t.length>1,t}),Va(e,Co(e),n),r&&(n=ei(n,7,_o));for(var i=t.length;i--;)va(n,t[i]);return n});function ud(e,t){return fd(e,Cl(Q(t)))}var dd=xo(function(e,t){return e==null?{}:Yi(e,t)});function fd(e,t){if(e==null)return{};var n=ln(Co(e),function(e){return[e]});return t=Q(t),Xi(e,n,function(e,n){return t(e,n[0])})}function pd(e,t,r){t=Ea(t,e);var i=-1,a=t.length;for(a||(a=1,e=n);++i<a;){var o=e==null?n:e[ps(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:oa(e,t,n)}function hd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:oa(e,t,r,i)}var gd=po(rd),_d=po(id);function vd(e,t,n){var r=$(e),i=r||Jl(e)||xu(e);if(t=Q(t,4),n==null){var a=e&&e.constructor;n=i?r?new a:[]:au(e)&&nu(a)?cr(lt(e)):{}}return(i?nn:mi)(e,function(e,r,i){return t(n,e,r,i)}),n}function yd(e,t){return e==null?!0:va(e,t)}function bd(e,t,n){return e==null?e:ya(e,t,Ta(n))}function xd(e,t,r,i){return i=typeof i==`function`?i:n,e==null?e:ya(e,t,Ta(r),i)}function Sd(e){return e==null?[]:Mn(e,rd(e))}function Cd(e){return e==null?[]:Mn(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),$r(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),Ci(e,t,r)}function Ed(e,t,r){if(r&&typeof r!=`boolean`&&Uo(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=Lt();return Pt(e+a*(t-e+Rt(`1e-`+((a+``).length-1))),t)}return ea(e,t)}var Dd=Xa(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(Be,Ln).replace(Tt,``)}function Ad(e,t,r){e=Pu(e),t=ga(t);var i=e.length;r=r===n?i:$r(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&&ve.test(e)?e.replace(ge,Rn):e}function Md(e){return e=Pu(e),e&&Ee.test(e)?e.replace(Te,`\\$&`):e}var Nd=Xa(function(e,t,n){return e+(n?`-`:``)+t.toLowerCase()}),Pd=Xa(function(e,t,n){return e+(n?` `:``)+t.toLowerCase()}),Fd=Ya(`toLowerCase`);function Id(e,t,n){e=Pu(e),t=ku(t);var r=t?Zn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return ao(xt(i),n)+e+ao(bt(i),n)}function Ld(e,t,n){e=Pu(e),t=ku(t);var r=t?Zn(e):0;return t&&r<t?e+ao(t-r,n):e}function Rd(e,t,n){e=Pu(e),t=ku(t);var r=t?Zn(e):0;return t&&r<t?ao(t-r,n)+e:e}function zd(e,t,n){return n||t==null?t=0:t&&=+t,It(Pu(e).replace(De,``),t||0)}function Bd(e,t,r){return t=(r?Uo(e,t,r):t===n)?1:ku(t),na(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=Xa(function(e,t,n){return e+(n?`_`:``)+t.toLowerCase()});function Ud(e,t,r){return r&&typeof r!=`number`&&Uo(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=ga(t),!t&&Vn(e))?Oa(Qn(e),0,r):e.split(t,r)):[]}var Wd=Xa(function(e,t,n){return e+(n?` `:``)+tf(t)});function Gd(e,t,n){return e=Pu(e),n=n==null?0:$r(ku(n),0,e.length),t=ga(t),e.slice(n,n+t.length)==t}function Kd(e,t,r){var i=X.templateSettings;r&&Uo(e,t,r)&&(t=n),e=Pu(e),t=Ru({},t,i,ho);var a=Ru({},t.imports,i.imports,ho),o=rd(a),s=Mn(a,o);nn(o,function(e){if(Me.test(e))throw new Ue("Invalid `imports` option passed into `_.template`")});var c,l,u=0,d=t.interpolate||Ve,f=`__p += '`,p=qe((t.escape||Ve).source+`|`+d.source+`|`+(d===xe?Pe:Ve).source+`|`+(t.evaluate||Ve).source+`|$`,`g`),m=`//# sourceURL=`+($e.call(t,`sourceURL`)?(t.sourceURL+``).replace(/\s/g,` `):`lodash.templateSources[`+ ++jt+`]`)+`
|
|
@@ -19,8 +19,8 @@ __p += '`),r&&(f+=`' +
|
|
|
19
19
|
function print() { __p += __j.call(arguments, '') }
|
|
20
20
|
`:`;
|
|
21
21
|
`)+f+`return __p
|
|
22
|
-
}`;var g=rf(function(){return We(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 An(e);if(!e||!(t=ga(t)))return e;var i=Qn(e),a=Qn(t);return Oa(i,Pn(i,a),Fn(i,a)+1).join(``)}function Xd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.slice(0,$n(e)+1);if(!e||!(t=ga(t)))return e;var i=Qn(e);return Oa(i,0,Fn(i,Qn(t))+1).join(``)}function Zd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.replace(De,``);if(!e||!(t=ga(t)))return e;var i=Qn(e);return Oa(i,Pn(i,Qn(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?ga(t.omission):i}e=Pu(e);var o=e.length;if(Vn(e)){var s=Qn(e);o=s.length}if(r>=o)return e;var c=r-Zn(i);if(c<1)return i;var l=s?Oa(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=qe(a.source,Pu(Fe.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(ga(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&&_e.test(e)?e.replace(he,er):e}var ef=Xa(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),tf=Ya(`toUpperCase`);function nf(e,t,r){return e=Pu(e),t=r?n:t,t===n?Hn(e)?rr(e):gn(e):e.match(t)||[]}var rf=ra(function(e,t){try{return en(e,n,t)}catch(e){return eu(e)?e:new Ue(e)}}),af=xo(function(e,t){return nn(t,function(t){t=ps(t),Zr(e,t,ml(e[t],e))}),e});function of(e){var t=e==null?0:e.length,n=Q();return e=t?ln(e,function(e){if(typeof e[1]!=`function`)throw new Je(r);return[n(e[0]),e[1]]}):[],ra(function(n){for(var r=-1;++r<t;){var i=e[r];if(en(i[0],this,n))return en(i[1],this,n)}})}function sf(e){return ti(ei(e,1))}function cf(e){return function(){return e}}function lf(e,t){return e==null||e!==e?t:e}var uf=eo(),df=eo(!0);function ff(e){return e}function pf(e){return Ri(typeof e==`function`?e:ei(e,1))}function mf(e){return Ui(ei(e,1))}function hf(e,t){return Wi(e,ei(t,1))}var gf=ra(function(e,t){return function(n){return Ei(n,e,t)}}),_f=ra(function(e,t){return function(n){return Ei(e,n,t)}});function vf(e,t,n){var r=rd(t),i=gi(t,r);n==null&&!(au(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=gi(t,rd(t)));var a=!(au(n)&&`chain`in n)||!!n.chain,o=nu(e);return nn(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__=Ba(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,un([this.value()],arguments))})}),e}function yf(){return Ht._===this&&(Ht._=it),this}function bf(){}function xf(e){return e=ku(e),ra(function(t){return qi(t,e)})}var Sf=io(ln),Cf=io(an),wf=io(pn);function Tf(e){return Wo(e)?Cn(ps(e)):Zi(e)}function Ef(e){return function(t){return e==null?n:_i(e,t)}}var Df=so(),Of=so(!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=Pt(e,v);t=Q(t),e-=v;for(var i=On(r,t);++n<e;)t(n);return i}function Ff(e){return $(e)?ln(e,ps):bu(e)?[e]:Ba(fs(Pu(e)))}function If(e){var t=++et;return Pu(e)+t}var Lf=ro(function(e,t){return e+t},0),Rf=uo(`ceil`),zf=ro(function(e,t){return e/t},1),Bf=uo(`floor`);function Vf(e){return e&&e.length?ci(e,ff,bi):n}function Hf(e,t){return e&&e.length?ci(e,Q(t,2),bi):n}function Uf(e){return Sn(e,ff)}function Wf(e,t){return Sn(e,Q(t,2))}function Gf(e){return e&&e.length?ci(e,ff,Vi):n}function Kf(e,t){return e&&e.length?ci(e,Q(t,2),Vi):n}var qf=ro(function(e,t){return e*t},1),Jf=uo(`round`),Yf=ro(function(e,t){return e-t},0);function Xf(e){return e&&e.length?Dn(e,ff):0}function Zf(e,t){return e&&e.length?Dn(e,Q(t,2)):0}return X.after=dl,X.ary=fl,X.assign=Fu,X.assignIn=Iu,X.assignInWith=Lu,X.assignWith=Ru,X.at=zu,X.before=pl,X.bind=ml,X.bindAll=af,X.bindKey=hl,X.castArray=Pl,X.chain=Dc,X.chunk=_s,X.compact=vs,X.concat=ys,X.cond=of,X.conforms=sf,X.constant=cf,X.countBy=Rc,X.create=Bu,X.curry=gl,X.curryRight=_l,X.debounce=vl,X.defaults=Vu,X.defaultsDeep=Hu,X.defer=yl,X.delay=bl,X.difference=bs,X.differenceBy=xs,X.differenceWith=Ss,X.drop=Cs,X.dropRight=ws,X.dropRightWhile=Ts,X.dropWhile=Es,X.fill=Ds,X.filter=Bc,X.flatMap=Uc,X.flatMapDeep=Wc,X.flatMapDepth=Gc,X.flatten=As,X.flattenDeep=js,X.flattenDepth=Ms,X.flip=xl,X.flow=uf,X.flowRight=df,X.fromPairs=Ns,X.functions=Yu,X.functionsIn=Xu,X.groupBy=Jc,X.initial=Is,X.intersection=Ls,X.intersectionBy=Rs,X.intersectionWith=zs,X.invert=ed,X.invertBy=td,X.invokeMap=Xc,X.iteratee=pf,X.keyBy=Zc,X.keys=rd,X.keysIn=id,X.map=Qc,X.mapKeys=ad,X.mapValues=od,X.matches=mf,X.matchesProperty=hf,X.memoize=Sl,X.merge=sd,X.mergeWith=cd,X.method=gf,X.methodOf=_f,X.mixin=vf,X.negate=Cl,X.nthArg=xf,X.omit=ld,X.omitBy=ud,X.once=wl,X.orderBy=$c,X.over=Sf,X.overArgs=Tl,X.overEvery=Cf,X.overSome=wf,X.partial=El,X.partialRight=Dl,X.partition=el,X.pick=dd,X.pickBy=fd,X.property=Tf,X.propertyOf=Ef,X.pull=Ws,X.pullAll=Gs,X.pullAllBy=Ks,X.pullAllWith=qs,X.pullAt=Js,X.range=Df,X.rangeRight=Of,X.rearg=Ol,X.reject=rl,X.remove=Ys,X.rest=kl,X.reverse=Xs,X.sampleSize=al,X.set=md,X.setWith=hd,X.shuffle=ol,X.slice=Zs,X.sortBy=ll,X.sortedUniq=ic,X.sortedUniqBy=ac,X.split=Ud,X.spread=Al,X.tail=oc,X.take=sc,X.takeRight=cc,X.takeRightWhile=lc,X.takeWhile=uc,X.tap=Oc,X.throttle=jl,X.thru=kc,X.toArray=Du,X.toPairs=gd,X.toPairsIn=_d,X.toPath=Ff,X.toPlainObject=Mu,X.transform=vd,X.unary=Ml,X.union=dc,X.unionBy=fc,X.unionWith=pc,X.uniq=mc,X.uniqBy=hc,X.uniqWith=gc,X.unset=yd,X.unzip=_c,X.unzipWith=vc,X.update=bd,X.updateWith=xd,X.values=Sd,X.valuesIn=Cd,X.without=yc,X.words=nf,X.wrap=Nl,X.xor=bc,X.xorBy=xc,X.xorWith=Sc,X.zip=Cc,X.zipObject=wc,X.zipObjectDeep=Tc,X.zipWith=Ec,X.entries=gd,X.entriesIn=_d,X.extend=Iu,X.extendWith=Lu,vf(X,X),X.add=Lf,X.attempt=rf,X.camelCase=Dd,X.capitalize=Od,X.ceil=Rf,X.clamp=wd,X.clone=Fl,X.cloneDeep=Ll,X.cloneDeepWith=Rl,X.cloneWith=Il,X.conformsTo=zl,X.deburr=kd,X.defaultTo=lf,X.divide=zf,X.endsWith=Ad,X.eq=Bl,X.escape=jd,X.escapeRegExp=Md,X.every=zc,X.find=Vc,X.findIndex=Os,X.findKey=Uu,X.findLast=Hc,X.findLastIndex=ks,X.findLastKey=Wu,X.floor=Bf,X.forEach=Kc,X.forEachRight=qc,X.forIn=Gu,X.forInRight=Ku,X.forOwn=qu,X.forOwnRight=Ju,X.get=Zu,X.gt=Vl,X.gte=Hl,X.has=Qu,X.hasIn=$u,X.head=Ps,X.identity=ff,X.includes=Yc,X.indexOf=Fs,X.inRange=Td,X.invoke=nd,X.isArguments=Ul,X.isArray=$,X.isArrayBuffer=Wl,X.isArrayLike=Gl,X.isArrayLikeObject=Kl,X.isBoolean=ql,X.isBuffer=Jl,X.isDate=Yl,X.isElement=Xl,X.isEmpty=Zl,X.isEqual=Ql,X.isEqualWith=$l,X.isError=eu,X.isFinite=tu,X.isFunction=nu,X.isInteger=ru,X.isLength=iu,X.isMap=su,X.isMatch=cu,X.isMatchWith=lu,X.isNaN=uu,X.isNative=du,X.isNil=pu,X.isNull=fu,X.isNumber=mu,X.isObject=au,X.isObjectLike=ou,X.isPlainObject=hu,X.isRegExp=gu,X.isSafeInteger=_u,X.isSet=vu,X.isString=yu,X.isSymbol=bu,X.isTypedArray=xu,X.isUndefined=Su,X.isWeakMap=Cu,X.isWeakSet=wu,X.join=Bs,X.kebabCase=Nd,X.last=Vs,X.lastIndexOf=Hs,X.lowerCase=Pd,X.lowerFirst=Fd,X.lt=Tu,X.lte=Eu,X.max=Vf,X.maxBy=Hf,X.mean=Uf,X.meanBy=Wf,X.min=Gf,X.minBy=Kf,X.stubArray=kf,X.stubFalse=Af,X.stubObject=jf,X.stubString=Mf,X.stubTrue=Nf,X.multiply=qf,X.nth=Us,X.noConflict=yf,X.noop=bf,X.now=ul,X.pad=Id,X.padEnd=Ld,X.padStart=Rd,X.parseInt=zd,X.random=Ed,X.reduce=tl,X.reduceRight=nl,X.repeat=Bd,X.replace=Vd,X.result=pd,X.round=Jf,X.runInContext=e,X.sample=il,X.size=sl,X.snakeCase=Hd,X.some=cl,X.sortedIndex=Qs,X.sortedIndexBy=$s,X.sortedIndexOf=ec,X.sortedLastIndex=tc,X.sortedLastIndexBy=nc,X.sortedLastIndexOf=rc,X.startCase=Wd,X.startsWith=Gd,X.subtract=Yf,X.sum=Xf,X.sumBy=Zf,X.template=Kd,X.times=Pf,X.toFinite=Ou,X.toInteger=ku,X.toLength=Au,X.toLower=qd,X.toNumber=ju,X.toSafeInteger=Nu,X.toString=Pu,X.toUpper=Jd,X.trim=Yd,X.trimEnd=Xd,X.trimStart=Zd,X.truncate=Qd,X.unescape=$d,X.uniqueId=If,X.upperCase=ef,X.upperFirst=tf,X.each=Kc,X.eachRight=qc,X.first=Ps,vf(X,function(){var e={};return mi(X,function(t,n){$e.call(X.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),X.VERSION=`4.18.1`,nn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){X[e].placeholder=X}),nn([`drop`,`take`],function(e,t){Z.prototype[e]=function(r){r=r===n?1:kt(ku(r),0);var i=this.__filtered__&&!t?new Z(this):this.clone();return i.__filtered__?i.__takeCount__=Pt(r,i.__takeCount__):i.__views__.push({size:Pt(r,v),type:e+(i.__dir__<0?`Right`:``)}),i},Z.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),nn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;Z.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Q(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),nn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);Z.prototype[e]=function(){return this[n](1).value()[0]}}),nn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);Z.prototype[e]=function(){return this.__filtered__?new Z(this):this[n](1)}}),Z.prototype.compact=function(){return this.filter(ff)},Z.prototype.find=function(e){return this.filter(e).head()},Z.prototype.findLast=function(e){return this.reverse().find(e)},Z.prototype.invokeMap=ra(function(e,t){return typeof e==`function`?new Z(this):this.map(function(n){return Ei(n,e,t)})}),Z.prototype.reject=function(e){return this.filter(Cl(Q(e)))},Z.prototype.slice=function(e,t){e=ku(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Z(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)},Z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Z.prototype.toArray=function(){return this.take(v)},mi(Z.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=X[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(X.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Z,l=s[0],u=c||$(t),d=function(e){var t=a.apply(X,un([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 Z(this);var g=e.apply(t,s);return g.__actions__.push({func:kc,args:[d],thisArg:n}),new ur(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),nn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=Ye[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);X.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply($(i)?i:[],e)}return this[n](function(n){return t.apply($(n)?n:[],e)})}}),mi(Z.prototype,function(e,t){var n=X[t];if(n){var r=n.name+``;$e.call(wn,r)||(wn[r]=[]),wn[r].push({name:t,func:n})}}),wn[to(n,s).name]=[{name:`wrapper`,func:n}],Z.prototype.clone=dr,Z.prototype.reverse=fr,Z.prototype.value=pr,X.prototype.at=Ac,X.prototype.chain=jc,X.prototype.commit=Mc,X.prototype.next=Nc,X.prototype.plant=Fc,X.prototype.reverse=Ic,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=Lc,X.prototype.first=X.prototype.head,mt&&(X.prototype[mt]=Pc),X})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(Ht._=J,define(function(){return J})):Wt?((Wt.exports=J)._=J,Ut._=J):Ht._=J}).call(e)})),Ao=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`:``)}})),jo=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=Ao(),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})),Mo=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=jo()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),No=n(((e,t)=>{var n=ko(),r=Mo()(`mongo-knex:converter`),i=Mo()(`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}})),Po=n(((e,t)=>{t.exports=No()})),Fo=n(((e,t)=>{var n=ko(),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:_}})),Io=n(((e,t)=>{t.exports=Fo()})),Lo=n(((e,t)=>{var n=Io(),r=er(),i=ko(),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}})),Ro=n(((e,t)=>{var n=Oo(),r=er(),i=Po(),a=Lo();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:Io().mapQuery,mapKeyValues:Io().mapKeyValues}})),zo=t(n(((e,t)=>{t.exports=Ro()}))(),1);function Bo(e,t){return e.visibility?(0,zo.default)(e.visibility).queryJSON(t):!0}function Vo({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]=Bo(e,c)?e.value:null}),l.append(`custom`,JSON.stringify(u)),l.toString()}var Ho=({settings:e,url:t})=>{let n=Vo({...e});return(0,Y.jsx)(aa,{addDelay:!1,className:`absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]`,generateContent:(0,J.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`,testId:`theme-preview`,width:`100%`})},Uo=({setting:e,setSetting:t})=>{let[n,r]=(0,J.useState)({});(0,J.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}=pt(),s=g(),c=async e=>{try{t(Ne(await o({file:e})))}catch(e){s(e)}};switch(e.type){case`text`:return(0,Y.jsx)(I,{hint:e.description,title:Hn(e.key),value:n[e.key]||``,onBlur:()=>i(e.key),onChange:t=>a(e.key,t.target.value)});case`boolean`:return(0,Y.jsx)(vt,{checked:e.value,direction:`rtl`,hint:e.description,label:Hn(e.key),onChange:e=>t(e.target.checked)});case`select`:return(0,Y.jsx)(Te,{hint:e.description,options:e.options.map(e=>({label:e,value:e})),selectedOption:{label:e.value,value:e.value},testId:`setting-select-${e.key}`,title:Hn(e.key),onSelect:e=>t(e?.value||null)});case`color`:return(0,Y.jsx)(Yr,{debounceMs:200,direction:`rtl`,hint:e.description,title:Hn(e.key),value:e.value||``,onChange:e=>t(e)});case`image`:return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{useLabelTag:!0,children:Hn(e.key)}),(0,Y.jsx)(Ee,{height:e.value?`100px`:`32px`,id:`custom-${e.key}`,imageURL:e.value||``,onDelete:()=>t(null),onUpload:e=>c(e),children:`Upload image`}),e.description&&(0,Y.jsx)(E,{children:e.description})]})}},Wo={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`]},Go=({sections:e,updateSetting:t})=>{let{data:n}=_n(),r=n?.themes.find(e=>e.active),i=r?.package.name?.toLowerCase()||``,a=r?.package.author?.name||``,{supportsCustomFonts:o}=Na();return(0,Y.jsx)(Y.Fragment,{children:e.map(e=>{let n=e.settings.filter(t=>Bo(t,e.settings.reduce((e,{key:t,value:n})=>({...e,[t]:n}),{}))),r;return(0,Y.jsx)(U,{className:`first-of-type:mt-6`,gap:`xs`,margins:`lg`,title:e.title,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=Wo[i];return s&&s.includes(e.key)&&a===`Ghost Foundation`&&o&&(n+=` hidden`),r=e.type,(0,Y.jsx)(`div`,{className:n,children:(0,Y.jsx)(Uo,{setSetting:n=>t({...e,value:n}),setting:e},e.key)},e.key)})},e.id)})})},Ko=({globalSettings:e,themeSettingSections:t,updateGlobalSetting:n,updateThemeSetting:r,onTabChange:i})=>{let[a,o]=(0,J.useState)(`global`),s=[{id:`global`,title:`Brand`,contents:(0,Y.jsx)(Do,{updateSetting:n,values:e})}];return t.length>0&&s.push({id:`theme-settings`,title:`Theme`,contents:(0,Y.jsx)(Go,{sections:t,updateSetting:r})}),(0,Y.jsx)(`div`,{className:`flex h-full flex-col justify-between`,children:(0,Y.jsx)(`div`,{className:`grow p-7 pt-0`,"data-testid":`design-setting-tabs`,children:s.length>1?(0,Y.jsx)(Xe,{selectedTab:a,stickyHeader:!0,tabs:s,onTabChange:e=>{o(e),i(e)}}):(0,Y.jsx)(Do,{updateSetting:n,values:e})})})},qo=()=>{let{settings:e,siteData:t}=K(),{mutateAsync:n}=An(),{data:{posts:[r]}={posts:[]}}=Rt({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),{data:i}=kn(),{mutateAsync:a}=On(),o=g(),[s,c]=(0,J.useState)(`homepage`),{updateRoute:l}=W(),u=je().getParam(`ref`),{formState:d,saveState:f,handleSave:p,updateForm:m,setFormState:h,okProps:_}=jt({initialState:{settings:e,themeSettings:i?i.custom_theme_settings:void 0},savingDelay:500,onSave:async()=>{if(d.themeSettings?.some(e=>e.dirty)){let e=await a(d.themeSettings);h(t=>({...t,themeSettings:e.custom_theme_settings}))}if(d.settings.some(e=>e.dirty)){let{settings:e}=await n(d.settings.filter(e=>e.dirty));h(t=>({...t,settings:e}))}},onSaveError:o});(0,J.useEffect)(()=>{i&&h(e=>({...e,themeSettings:i.custom_theme_settings}))},[h,i]);let v=(e,t)=>{m(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},y=e=>{m(t=>({...t,themeSettings:t.themeSettings?.map(t=>t.key===e.key?{...e,dirty:!0}:t)}))},[b,x,S,C,w,T,E]=Fn(d.settings,[`description`,`accent_color`,`icon`,`logo`,`cover_image`,`heading_font`,`body_font`]),D=(d.themeSettings||[]).reduce((e,t)=>{let n=t.group===`homepage`||t.group===`post`?t.group:`site-wide`;return{...e,[n]:(e[n]||[]).concat(t)}},{}),O=Object.entries(D).map(([e,t])=>({id:e,settings:t||[],title:e===`site-wide`?`Site wide`:e===`homepage`?`Homepage`:`Post`})),k=[];r&&(k=[{id:`homepage`,title:`Homepage`},{id:`post`,title:`Post`}]);let A=e=>{k.length&&c(e)},j=e=>{c(e===`post`&&r?`post`:`homepage`)},M=jn(t);switch(s){case`homepage`:M=jn(t);break;case`post`:M=r.url;break}let N=(0,Y.jsx)(Ho,{settings:{description:b,accentColor:x,icon:S,logo:C,coverImage:w,themeSettings:d.themeSettings,headingFont:T,bodyFont:E},url:M}),P=(0,Y.jsx)(Ko,{globalSettings:{description:b,accentColor:x,icon:S,logo:C,coverImage:w,headingFont:T,bodyFont:E},handleSave:p,themeSettingSections:O,updateGlobalSetting:v,updateThemeSetting:y,onTabChange:j});return(0,Y.jsx)(Ii,{afterClose:()=>{l(u===`setup`?{isExternal:!0,route:`analytics`}:`design`)},buttonsDisabled:_.disabled,cancelLabel:`Close`,defaultTab:`homepage`,dirty:f===`unsaved`,okColor:_.color,okLabel:_.label||`Save`,preview:N,previewToolbarTabs:k,selectedURL:s,sidebar:P,sidebarPadding:!1,siteLink:jn(t),size:`full`,testId:`design-modal`,title:`Design`,onOk:async()=>{await p({fakeWhenUnchanged:!0})},onSelectURL:A})},Jo=O.create(({title:e,prompt:t,cancelLabel:n=`Cancel`,okLabel:r=`OK`,okColor:i=`black`})=>{let a=N(),o=e=>{a.resolve(e),a.remove()};return(0,Y.jsx)(L,{backDropClick:!1,cancelLabel:n,okColor:i,okLabel:r,testId:`theme-editor-confirm-modal`,title:e,width:540,onCancel:()=>o(!1),onOk:()=>o(!0),children:(0,Y.jsx)(`div`,{className:`py-4`,children:t})})}),Yo=O.create(({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a=`Cancel`,okLabel:o=`Continue`})=>{let s=N(),[c,l]=(0,J.useState)(r),u=e=>{s.resolve(e),s.remove()};return(0,Y.jsx)(L,{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,Y.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[t,(0,Y.jsx)(I,{clearBg:!1,placeholder:i,title:n,value:c,autoFocus:!0,onChange:e=>l(e.target.value)})]})})}),Xo=`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`,Zo=`${Xo} border-[#2f333b] bg-transparent text-[#e6e7ea] hover:bg-[#1f2228]`,Qo=`${Xo} border-transparent bg-green text-black hover:bg-green-400`,$o=({currentThemeName:e,changes:t,isSaving:n,onClose:r,onSave:i})=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[#23262c] bg-[#1a1d21] px-4 py-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(`h2`,{className:`truncate text-[14px] font-semibold text-[#f4f5f7]`,children:`Edit theme`}),(0,Y.jsx)(`span`,{className:`truncate text-[12px] text-[#8a8f98]`,children:e})]}),t.length>0&&(0,Y.jsxs)(`span`,{className:`rounded-full border border-transparent bg-[#3b2a16] px-2.5 py-1 text-[11px] leading-none text-[#f5a623]`,children:[Kt(t.length),` `,t.length===1?`file modified`:`files modified`]}),(0,Y.jsx)(`div`,{className:`grow`}),(0,Y.jsxs)(`button`,{className:Zo,type:`button`,onClick:r,children:[(0,Y.jsx)(Yt,{size:14}),`Close`]}),(0,Y.jsxs)(`button`,{className:Qo,disabled:n,type:`button`,onClick:i,children:[(0,Y.jsx)(Ut,{size:14}),n?`Saving…`:`Save`]})]}),es=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},ts=e=>e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`dir`?-1:1),ns=`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`,rs=({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,Y.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,Y.jsx)(`span`,{className:`w-3 shrink-0`}),(0,Y.jsx)(qt,{size:14}),(0,Y.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.name}),r&&(0,Y.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=ts(Array.from(e.children?.values()||[]));return(0,Y.jsxs)(`div`,{children:[e.path&&(0,Y.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,Y.jsx)(Zt,{className:`shrink-0 text-[#6a6f78]`,size:12}):(0,Y.jsx)(Qt,{className:`shrink-0 text-[#6a6f78]`,size:12}),s?(0,Y.jsx)(Gt,{className:`shrink-0 text-[#8a8f98]`,size:14}):(0,Y.jsx)(Wt,{className:`shrink-0 text-[#8a8f98]`,size:14}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name})]}),(e.path===``||s)&&(0,Y.jsx)(`div`,{children:l.map(t=>d(t,e.path?o+1:o))})]},e.path||`root`)};return(0,Y.jsxs)(`aside`,{className:`flex w-[280px] shrink-0 flex-col border-r border-[#23262c] bg-[#16181c]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-[#23262c] px-3 py-2`,children:[(0,Y.jsxs)(`div`,{className:`text-[12px] font-medium text-[#c8ccd3]`,children:[Object.keys(e).length,` files`]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`button`,{"aria-label":`New file`,className:ns,type:`button`,onClick:s,children:(0,Y.jsx)(Jt,{size:13})}),(0,Y.jsx)(`button`,{"aria-label":`Rename selected item`,className:ns,disabled:!t,type:`button`,onClick:c,children:(0,Y.jsx)($t,{size:13})}),(0,Y.jsx)(`button`,{"aria-label":`Delete selected item`,className:ns,disabled:!t,type:`button`,onClick:l,children:(0,Y.jsx)(Vt,{size:13})})]})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:o?(0,Y.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center text-[13px] text-[#8a8f98]`,children:[(0,Y.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-[#2f333b] border-t-[#14b886]`}),(0,Y.jsx)(`span`,{children:`Loading theme files…`})]}):Object.keys(e).length===0?(0,Y.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#8a8f98]`,children:`This theme archive does not contain any files.`}):d(es(e))})]})},is=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 N(e){return(e<<1)-(4<e?9:0)}function P(e){for(var t=e.length;0<=--t;)e[t]=0}function F(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 I(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,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(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 B(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 ee(e,t){for(var n,r;;){if(e.lookahead<T){if(B(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=z(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function V(e,t){for(var n,r,i;;){if(e.lookahead<T){if(B(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=z(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&&(I(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]))&&I(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?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function te(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 ne(){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)),P(this.dyn_ltree),P(this.dyn_dtree),P(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),P(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),P(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 H(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 re(e){var t=H(e);return t===d&&function(e){e.window_size=2*e.w_size,P(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 ie(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 ne;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,re(e)}r=[new te(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(B(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,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new te(4,4,8,4,ee),new te(4,5,16,8,ee),new te(4,6,32,32,ee),new te(4,4,16,16,V),new te(8,16,32,32,V),new te(8,16,128,128,V),new te(8,32,128,256,V),new te(32,128,258,1024,V),new te(32,258,258,4096,V)],n.deflateInit=function(e,t){return ie(e,t,g,15,8,0)},n.deflateInit2=ie,n.deflateReset=re,n.deflateResetKeep=H,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,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(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):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(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,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(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)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(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)),F(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,L(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)),F(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,L(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&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(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&&(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(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&&(P(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,B(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,B(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,N,P,F,I,L,R,z=0,B=new r.Buf8(4),ee=[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,I=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){B[n.check=0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<F,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(F=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,F)),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;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)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;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)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[ee[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){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=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>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(R=k+2;x<R;){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}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(R=k+7;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=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++]=F}}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,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){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=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,N=A,P=j;A=(z=n.lencode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x<R;){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=(z=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,N=A,P=j;A=(z=n.distcode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x<R;){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:I=1;break e;case 30:I=-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)&&I===u&&(I=-5),I)},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,N=null,P=0,F=new r.Buf16(16),I=new r.Buf16(16),L=null,R=0;for(C=0;C<=15;C++)F[C]=0;for(w=0;w<c;w++)F[t[n+w]]++;for(D=S,E=15;1<=E&&F[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&&F[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=F[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(I[1]=0,C=1;C<15;C++)I[C+1]=I[C]+F[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[I[t[n+w]]++]=w);if(v=e===0?(N=L=d,19):e===1?(N=i,P-=257,L=a,R-=257,256):(N=o,L=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=L[R+d[w]],N[P+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++,--F[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-=F[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,N=Array(d);function P(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 F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function I(e){return e<256?D[e]:D[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,L(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 z(e,t,n){R(e,n[2*t],n[2*t+1])}function B(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function ee(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]=B(a[s]++,s))}}function V(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 te(e){8<e.bi_valid?L(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 ne(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 H(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ne(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ne(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function re(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?z(e,i,t):(z(e,(a=O[i])+l+1,t),(o=x[a])!==0&&R(e,i-=k[a],o),z(e,a=I(--r),n),(o=S[a])!==0&&R(e,r-=N[a],o)),s<e.last_lit;);z(e,_,t)}function ie(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--)H(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],H(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++,H(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),ee(a,l,e.bl_count)}function ae(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 oe(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(;z(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(z(e,y,e.bl_tree),R(e,s-3,3)):(z(e,b,e.bl_tree),R(e,s-11,7)):(i!==a&&(z(e,i,e.bl_tree),s--),z(e,v,e.bl_tree),R(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(N);var se=!1;function ce(e,t,n,i){R(e,(s<<1)+ +!!i,3),function(e,t,n,i){te(e),i&&(L(e,n),L(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){se||=(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(N[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(N[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(ee(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=B(e,5);A=new P(T,x,l+1,u,m),j=new P(E,S,0,d,m),M=new P([],C,0,f,g)}(),!0),e.l_desc=new F(e.dyn_ltree,A),e.d_desc=new F(e.dyn_dtree,j),e.bl_desc=new F(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,V(e)},n._tr_stored_block=ce,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)),ie(e,e.l_desc),ie(e,e.d_desc),c=function(e){var t;for(ae(e,e.dyn_ltree,e.l_desc.max_code),ae(e,e.dyn_dtree,e.d_desc.max_code),ie(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?ce(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),re(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i<r;i++)R(e,e.bl_tree[2*w[i]+1],3);oe(e,e.dyn_ltree,t-1),oe(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),re(e,e.dyn_ltree,e.dyn_dtree)),V(e),r&&te(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*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(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),as={maxFiles:1e3,maxExtractedBytes:32*1024*1024},os=class extends Error{reason;constructor(e,t){super(t),this.name=`ThemeArchiveExtractionError`,this.reason=e}},ss=new Set([`css`,`cjs`,`hbs`,`handlebars`,`htm`,`html`,`js`,`json`,`less`,`md`,`markdown`,`mjs`,`sass`,`scss`,`svg`,`txt`,`xml`,`yaml`,`yml`]),cs=new Set([`.editorconfig`,`.eslintignore`,`.eslintrc`,`.gitattributes`,`.gitignore`,`.npmignore`,`.prettierignore`,`.prettierrc`,`CODEOWNERS`,`LICENSE`,`LICENCE`,`NOTICE`,`Procfile`]),ls=e=>{if(ss.has(us(e)))return!0;let t=e.split(`/`).at(-1)||e;return cs.has(t)},us=e=>{let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()},ds=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(`/`)},fs=e=>[`casper`,`source`].includes(e.toLowerCase()),ps=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:``},ms=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t,date:new Date(t.date),binary:t.binary?new Uint8Array(t.binary):null}])),hs=`Failed to open the theme archive. Download the theme again and retry.`,gs=e=>{let t=e/(1024*1024);return Number.isInteger(t)?`${t} MB`:`${t.toFixed(1)} MB`},_s=e=>{let t=[];return e.forEach((e,n)=>{n.dir||t.push([e,n])}),t},vs=e=>{if(e.length>as.maxFiles)throw new os(`too_many_files`,`This theme archive contains too many files for the browser editor (${e.length}/${as.maxFiles}).`)},ys=async e=>{try{return await is.default.loadAsync(e)}catch{throw new os(`invalid_archive`,hs)}},bs=async e=>{try{return await e.async(`uint8array`)}catch{throw new os(`invalid_archive`,hs)}},xs=async e=>{try{return await e.async(`string`)}catch{throw new os(`invalid_archive`,hs)}},Ss=e=>{let t=ds(e);if(!t||t!==e)throw new os(`invalid_archive`,hs);return t},Cs=(e,t)=>{let n=e+t;if(n>as.maxExtractedBytes)throw new os(`too_large`,`This theme archive is too large to open in the browser editor. Extracted files must stay under ${gs(as.maxExtractedBytes)}.`);return n},ws=async e=>{let t=_s(await ys(e));vs(t);let n=ps(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=Ss(t);if(ls(s))try{let e=await xs(o);a=Cs(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 bs(o);a=Cs(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}},Ts=async({files:e,rootPrefix:t})=>{let n=new is.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}})},Es=({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},Ds=({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},Os=e=>{switch(us(e)){case`css`:case`scss`:case`sass`:case`less`:return Dt(()=>import(`./dist-CMhLtvG_.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 Dt(()=>import(`./dist-C30sqimN.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([4,1,2,5,3]),import.meta.url);case`json`:return Dt(()=>import(`./dist-CVmVbSNW.js`).then(e=>e.json()),__vite__mapDeps([6,2,3]),import.meta.url);case`md`:case`markdown`:return Dt(()=>import(`./dist-DGtq6W4I.js`).then(e=>e.markdown()),__vite__mapDeps([7,2,5,8,3,0,1,4]),import.meta.url);case`yaml`:case`yml`:return Dt(()=>import(`./dist-Bw1d5xrJ.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 Dt(()=>import(`./dist-DVfKxKHo.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url);default:return Dt(()=>import(`./dist-DVfKxKHo.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url)}},ks=e=>{let t=us(e);if(!t)return`text`;switch(t){case`hbs`:return`handlebars`;case`htm`:return`html`;case`yml`:return`yaml`;default:return t}},As=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},js=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},Ms=[`theme`,`design`],Ns=e=>Ms.some(t=>e===t||e.startsWith(`${t}/`)),Ps=()=>{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===``||Ns(r)?r:null},Fs=(e,t)=>{let n=`theme/edit/${encodeURIComponent(e)}`;return t===null?n:`${n}?from=${encodeURIComponent(t)}`},Is=(e,t)=>!e.editable&&ls(t),Ls=/^[a-z0-9][\w-]{0,63}$/,Rs={COMPRESSED_TOO_LARGE:`Theme too large to upload`,ENTRY_TOO_LARGE:`File too large`,TOTAL_TOO_LARGE:`Theme contents too large`},zs=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`},Bs=e=>{let{entryName:t,limitBytes:n}=e.errorDetails??{},r=zs(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.`}},Vs=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`}`,Hs=`flex h-full items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]`,Us=Xn.theme({"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`#355070`},".cm-content ::selection":{color:`#ffffff`}},{dark:!0}),Ws=({themeName:e})=>{let t=N(),{updateRoute:n}=W(),r=s(),i=g(),{data:a}=_n(),[o,c]=(0,J.useState)(e),[l,u]=(0,J.useState)({}),[f,m]=(0,J.useState)({}),[h,_]=(0,J.useState)(``),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(new Set([``])),[S,C]=(0,J.useState)(!0),[w,T]=(0,J.useState)(!1),[E,D]=(0,J.useState)(null),[A,P]=(0,J.useState)(!1),[F,I]=(0,J.useState)([]);(0,J.useEffect)(()=>{let t=!0,n=()=>{c(e),u({}),m({}),_(``),y(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 ws(await r.arrayBuffer()),a=ms(i.files),o=As(a);if(!t)return;c(e),u(ms(i.files)),m(a),_(i.rootPrefix),y(o),x(new Set(o?.type===`file`?js(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,J.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[]);let L=(0,J.useMemo)(()=>Es({baseFiles:l,currentFiles:f}),[l,f]),R=(0,J.useMemo)(()=>new Map(L.map(e=>[e.path,e.status])),[L]),z=v?.type===`file`?f[v.path]:null;(0,J.useEffect)(()=>{let e=!0;return z?.editable?(Os(z.path).then(t=>{e&&I([j({top:!0}),k,t,...A?[Xn.lineWrapping]:[],Us])}).catch(()=>{e&&I([j({top:!0}),k,...A?[Xn.lineWrapping]:[],Us])}),()=>{e=!1}):(I([]),()=>{e=!1})},[A,z]);let B=async({title:e,prompt:t,cancelLabel:n,okLabel:r,okColor:i})=>!!await O.show(Jo,{title:e,prompt:t,cancelLabel:n,okLabel:r,okColor:i}),ee=async({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o})=>await O.show(Yo,{title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o}),V=async()=>{L.length>0&&!await B({title:`Discard changes?`,prompt:`You have unsaved theme changes. Close the editor and discard them?`,okLabel:`Discard changes`,okColor:`red`})||(t.remove(),n(Ps()??`design/change-theme`))},te=(0,J.useRef)(()=>{});(0,J.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`){e.preventDefault(),te.current();return}e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[]);let ne=e=>{x(t=>{let n=new Set(t);for(let t of js(e))n.add(t);return n})},H=(e,t)=>{if(m(e),t){y(t),t.type===`file`&&ne(t.path);return}v?.type===`file`&&e[v.path]||y(As(e))},re=async()=>{let e=await ee({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?ds(e):null;if(!t)return;if(!ls(t)){p({type:`error`,title:`Only text files can be created here`,message:`Use a text-based theme file extension such as .hbs, .css, .js, or .json.`});return}if(f[t]){p({type:`error`,title:`File already exists`});return}let n={...f,[t]:{path:t,editable:!0,content:``,binary:null,date:new Date,unixPermissions:null,dosPermissions:null}};H(n,{type:`file`,path:t})},ie=async()=>{if(!v)return;let e=v.type===`dir`?v.path.replace(/\/$/,``):v.path,t=v.type===`dir`?`Rename folder to`:`Rename file to`,n=await ee({title:v.type===`dir`?`Rename folder`:`Rename file`,fieldTitle:`Path`,initialValue:e,okLabel:`Rename`,prompt:t}),r=n?ds(n):null;if(!r||r===e)return;if(v.type===`file`){let e=f[v.path];if(!ls(r)&&e.editable){p({type:`error`,title:`Text files must keep a text file extension`});return}if(Is(e,r)){p({type:`error`,title:`Binary files cannot be renamed to a text file`,message:`Rename this file with a non-text extension to keep its contents intact.`});return}if(f[r]){p({type:`error`,title:`A file with that name already exists`});return}let t={...f},n=t[v.path];delete t[v.path],t[r]={...n,path:r,editable:ls(r)},H(t,{type:`file`,path:r});return}let i=`${r}/`;if(i.startsWith(v.path)){p({type:`error`,title:`A folder cannot be renamed inside itself`});return}if(Object.keys(f).find(e=>e.startsWith(i))){p({type:`error`,title:`A folder with that path already exists`});return}let a=Ds({files:f,oldPrefix:v.path,newPrefix:i});H(a,{type:`dir`,path:i}),x(e=>{let t=new Set;for(let n of e){if(!n.startsWith(v.path)){t.add(n);continue}t.add(`${i}${n.slice(v.path.length)}`)}return t})},ae=async()=>{if(!v)return;if(v.type===`file`){if(!await B({title:`Delete file`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Delete `,(0,Y.jsx)(`strong`,{children:v.path}),` from this theme?`]}),okLabel:`Delete`,okColor:`red`}))return;let e={...f};delete e[v.path],H(e);return}let e=Object.keys(f).filter(e=>e.startsWith(v.path));if(!e.length||!await B({title:`Delete folder`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Delete `,e.length,` file`,e.length===1?``:`s`,` from `,(0,Y.jsx)(`strong`,{children:v.path}),`?`]}),okLabel:`Delete`,okColor:`red`}))return;let t={...f};for(let n of e)delete t[n];H(t)},oe=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}),H(r)},se=async()=>{let e=(await ee({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?Ls.test(e)?fs(e)?(p({type:`error`,title:`Built-in themes cannot be overwritten`}),null):e:(p({type:`error`,title:`Invalid theme name`,message:`Use 1-64 characters, starting with a letter or number. Allowed: letters, numbers, dashes, and underscores.`}),null):null},ce=async()=>{if(w)return;if(L.length===0){p({type:`info`,title:`No changes to save`});return}let e=o,t=fs(e)?await se():e;if(!t)return;let s=t!==e,l=a?.themes.some(e=>e.name===t)||!1,m=s?`Save your edits as "${t}"?`:`Upload ${L.length} changed file${L.length===1?``:`s`} and replace "${e}"?`;if(await B({title:s?`Save theme as new copy`:`Update theme`,prompt:m,okLabel:s?`Save theme`:`Replace theme`})&&!(s&&l&&!await B({title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:t}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,okColor:`red`}))){T(!0);try{let e=await Ts({files:f,rootPrefix:h}),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){O.show(Ma,{title:`Theme not saved`,fatalErrors:o.errors});return}let e=o?.errors?.[0];if(e?.code&&Rs[e.code]){p({type:`error`,title:Rs[e.code],message:Bs(e)});return}throw Error(e?.message||`Theme upload failed.`)}let l=o.themes[0],m=Ps();u(ms(f)),s&&(c(t),_(h?`${t}/`:``),n(Fs(t,m))),await r.invalidateQueries([`ThemesResponseType`]),s||l.errors?.length||l.warnings?.length?O.show(Wa,{title:s?`Theme saved`:`Theme updated`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:l.name}),` saved successfully.`]}),installedTheme:l}):p({type:`success`,title:`Theme saved`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:l.name}),` has been updated.`]})})}catch(e){i(e)}finally{T(!1)}}};(0,J.useEffect)(()=>{te.current=ce});let le=e=>{y({type:`file`,path:e}),ne(e)},ue=z?R.get(z.path):null;return(0,Y.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&&V()},children:(0,Y.jsxs)(`div`,{className:`relative flex size-full flex-col overflow-hidden bg-[#15171a]`,children:[(0,Y.jsx)($o,{changes:L,currentThemeName:o,isSaving:w,onClose:V,onSave:()=>void ce()}),E&&(0,Y.jsx)(`div`,{className:`border-b border-[#512828] bg-[#3a1d1d] px-4 py-2 text-[12px] text-[#ffbdbd]`,children:E}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Y.jsx)(rs,{changesMap:R,currentFiles:f,expandedDirectories:b,isLoading:S,selectedNode:v,setExpandedDirectories:x,setSelectedNode:y,onCreateFile:re,onDeleteSelected:ae,onOpenFile:le,onRenameSelected:ie}),(0,Y.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-[#16181c]`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 border-b border-[#23262c] bg-[#17191d] px-4 py-2 text-[12px] text-[#8a8f98]`,children:z?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-medium text-[#e6e7ea]`,children:z.path}),(0,Y.jsx)(`span`,{className:`rounded bg-[#2a2d33] px-2 py-0.5 text-[10px] tracking-[0.04em] text-[#c8ccd3] uppercase`,children:ks(z.path)}),ue&&(0,Y.jsxs)(`button`,{className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] tracking-[0.04em] uppercase ${ue===`deleted`?`bg-[#4a2222] text-[#ffbdbd]`:ue===`added`?`bg-[#17342a] text-[#a5e8c8]`:`bg-[#3b2a16] text-[#f5a623]`}`,type:`button`,onClick:()=>oe(z.path),children:[(0,Y.jsx)(Xt,{size:11}),`Revert`]}),(0,Y.jsx)(`div`,{className:`grow`}),z.editable&&(0,Y.jsx)(`button`,{"aria-label":A?`Disable text wrap`:`Enable text wrap`,"aria-pressed":A,className:Vs(A),title:A?`Disable text wrap`:`Enable text wrap`,type:`button`,onClick:()=>P(e=>!e),children:(0,Y.jsx)(Ht,{className:`shrink-0`,size:14,strokeWidth:2})})]}):(0,Y.jsx)(`span`,{children:`No file selected`})}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[!v&&!S&&(0,Y.jsx)(`div`,{className:Hs,children:`Select a file from the tree to start editing.`}),v?.type===`dir`&&(0,Y.jsx)(`div`,{className:Hs,children:`Folder selected. Choose a file to edit, or rename or delete the folder from the file pane.`}),z&&!z.editable&&(0,Y.jsx)(`div`,{className:Hs,children:`This file cannot be edited in the browser.`}),z?.editable&&(0,Y.jsx)(M,{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:F,height:`full`,theme:k,value:z.content||``,autoFocus:!0,onChange:e=>{m(t=>({...t,[z.path]:{...t[z.path],content:e}}))}},`${z.path}:${F.length}`)]})]})]})]})})},Gs=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}}},Ks=O.create(({pathName:e})=>{let t=N(),{route:n,updateRoute:r}=W(),i=n||e,[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(!1),{checkThemeLimitError:h,isThemeLimitCheckReady:g,noThemeChangesAllowed:_,isThemeLimited:v}=ht(),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(!1),{themeName:C,isInvalid:w}=Gs(i),T=(0,J.useCallback)(e=>{O.show(he,{prompt:e,onOk:()=>r({route:`/pro`,isExternal:!0})})},[r]);if((0,J.useEffect)(()=>{i===`design/change-theme`&&g?(async()=>{if(!_){c(!1),o(null);return}c(!0);let e=await h();o(e),c(!1),e&&(T(e),t.remove())})():(o(null),c(!1))},[h,i,g,t,_,T]),(0,J.useEffect)(()=>{i!==`theme/install`&&(S(!1),b(null),u(!1))},[i]),(0,J.useEffect)(()=>{w&&(t.remove(),r(`theme`))},[w,t,r]),(0,J.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&&(T(n),t.remove(),r(`theme`)))})(),()=>{e=!0}},[h,C,g,v,t,T,r]),(0,J.useEffect)(()=>{let e=()=>{let e=window.location.href.split(`#`)[1]?.split(`?`)[1];return e?new URLSearchParams(e).get(`ref`):null},n=e=>{b(!1),_?(T(e),window.history.replaceState({},``,window.location.pathname+window.location.hash.split(`?`)[0]),t.remove(),r(`theme`)):(T(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,T,r]),i===`design/edit`)return(0,Y.jsx)(qo,{});if(i===`design/change-theme`)return s||a?null:(0,Y.jsx)(Qa,{});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,Y.jsx)(Qa,{source:n,themeRef:t})}else if(i.startsWith(`theme/edit/`))return w||!C||p||d?null:(0,Y.jsx)(Ws,{themeName:C});else return t.remove(),null}),qs=({html:e,style:t})=>(0,Y.jsx)(aa,{className:`absolute size-full overflow-hidden transition-opacity duration-500`,generateContent:n=>{let r=n.contentDocument||n.contentWindow?.document;if(!r)return;let i=`
|
|
22
|
+
}`;var g=rf(function(){return We(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 An(e);if(!e||!(t=ga(t)))return e;var i=Qn(e),a=Qn(t);return Oa(i,Pn(i,a),Fn(i,a)+1).join(``)}function Xd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.slice(0,$n(e)+1);if(!e||!(t=ga(t)))return e;var i=Qn(e);return Oa(i,0,Fn(i,Qn(t))+1).join(``)}function Zd(e,t,r){if(e=Pu(e),e&&(r||t===n))return e.replace(De,``);if(!e||!(t=ga(t)))return e;var i=Qn(e);return Oa(i,Pn(i,Qn(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?ga(t.omission):i}e=Pu(e);var o=e.length;if(Vn(e)){var s=Qn(e);o=s.length}if(r>=o)return e;var c=r-Zn(i);if(c<1)return i;var l=s?Oa(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=qe(a.source,Pu(Fe.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(ga(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&&_e.test(e)?e.replace(he,er):e}var ef=Xa(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),tf=Ya(`toUpperCase`);function nf(e,t,r){return e=Pu(e),t=r?n:t,t===n?Hn(e)?rr(e):gn(e):e.match(t)||[]}var rf=ra(function(e,t){try{return en(e,n,t)}catch(e){return eu(e)?e:new Ue(e)}}),af=xo(function(e,t){return nn(t,function(t){t=ps(t),Zr(e,t,ml(e[t],e))}),e});function of(e){var t=e==null?0:e.length,n=Q();return e=t?ln(e,function(e){if(typeof e[1]!=`function`)throw new Je(r);return[n(e[0]),e[1]]}):[],ra(function(n){for(var r=-1;++r<t;){var i=e[r];if(en(i[0],this,n))return en(i[1],this,n)}})}function sf(e){return ti(ei(e,1))}function cf(e){return function(){return e}}function lf(e,t){return e==null||e!==e?t:e}var uf=eo(),df=eo(!0);function ff(e){return e}function pf(e){return Ri(typeof e==`function`?e:ei(e,1))}function mf(e){return Ui(ei(e,1))}function hf(e,t){return Wi(e,ei(t,1))}var gf=ra(function(e,t){return function(n){return Ei(n,e,t)}}),_f=ra(function(e,t){return function(n){return Ei(e,n,t)}});function vf(e,t,n){var r=rd(t),i=gi(t,r);n==null&&!(au(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=gi(t,rd(t)));var a=!(au(n)&&`chain`in n)||!!n.chain,o=nu(e);return nn(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__=Ba(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,un([this.value()],arguments))})}),e}function yf(){return Ht._===this&&(Ht._=it),this}function bf(){}function xf(e){return e=ku(e),ra(function(t){return qi(t,e)})}var Sf=io(ln),Cf=io(an),wf=io(pn);function Tf(e){return Wo(e)?Cn(ps(e)):Zi(e)}function Ef(e){return function(t){return e==null?n:_i(e,t)}}var Df=so(),Of=so(!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=Pt(e,v);t=Q(t),e-=v;for(var i=On(r,t);++n<e;)t(n);return i}function Ff(e){return $(e)?ln(e,ps):bu(e)?[e]:Ba(fs(Pu(e)))}function If(e){var t=++et;return Pu(e)+t}var Lf=ro(function(e,t){return e+t},0),Rf=uo(`ceil`),zf=ro(function(e,t){return e/t},1),Bf=uo(`floor`);function Vf(e){return e&&e.length?ci(e,ff,bi):n}function Hf(e,t){return e&&e.length?ci(e,Q(t,2),bi):n}function Uf(e){return Sn(e,ff)}function Wf(e,t){return Sn(e,Q(t,2))}function Gf(e){return e&&e.length?ci(e,ff,Vi):n}function Kf(e,t){return e&&e.length?ci(e,Q(t,2),Vi):n}var qf=ro(function(e,t){return e*t},1),Jf=uo(`round`),Yf=ro(function(e,t){return e-t},0);function Xf(e){return e&&e.length?Dn(e,ff):0}function Zf(e,t){return e&&e.length?Dn(e,Q(t,2)):0}return X.after=dl,X.ary=fl,X.assign=Fu,X.assignIn=Iu,X.assignInWith=Lu,X.assignWith=Ru,X.at=zu,X.before=pl,X.bind=ml,X.bindAll=af,X.bindKey=hl,X.castArray=Pl,X.chain=Dc,X.chunk=_s,X.compact=vs,X.concat=ys,X.cond=of,X.conforms=sf,X.constant=cf,X.countBy=Rc,X.create=Bu,X.curry=gl,X.curryRight=_l,X.debounce=vl,X.defaults=Vu,X.defaultsDeep=Hu,X.defer=yl,X.delay=bl,X.difference=bs,X.differenceBy=xs,X.differenceWith=Ss,X.drop=Cs,X.dropRight=ws,X.dropRightWhile=Ts,X.dropWhile=Es,X.fill=Ds,X.filter=Bc,X.flatMap=Uc,X.flatMapDeep=Wc,X.flatMapDepth=Gc,X.flatten=As,X.flattenDeep=js,X.flattenDepth=Ms,X.flip=xl,X.flow=uf,X.flowRight=df,X.fromPairs=Ns,X.functions=Yu,X.functionsIn=Xu,X.groupBy=Jc,X.initial=Is,X.intersection=Ls,X.intersectionBy=Rs,X.intersectionWith=zs,X.invert=ed,X.invertBy=td,X.invokeMap=Xc,X.iteratee=pf,X.keyBy=Zc,X.keys=rd,X.keysIn=id,X.map=Qc,X.mapKeys=ad,X.mapValues=od,X.matches=mf,X.matchesProperty=hf,X.memoize=Sl,X.merge=sd,X.mergeWith=cd,X.method=gf,X.methodOf=_f,X.mixin=vf,X.negate=Cl,X.nthArg=xf,X.omit=ld,X.omitBy=ud,X.once=wl,X.orderBy=$c,X.over=Sf,X.overArgs=Tl,X.overEvery=Cf,X.overSome=wf,X.partial=El,X.partialRight=Dl,X.partition=el,X.pick=dd,X.pickBy=fd,X.property=Tf,X.propertyOf=Ef,X.pull=Ws,X.pullAll=Gs,X.pullAllBy=Ks,X.pullAllWith=qs,X.pullAt=Js,X.range=Df,X.rangeRight=Of,X.rearg=Ol,X.reject=rl,X.remove=Ys,X.rest=kl,X.reverse=Xs,X.sampleSize=al,X.set=md,X.setWith=hd,X.shuffle=ol,X.slice=Zs,X.sortBy=ll,X.sortedUniq=ic,X.sortedUniqBy=ac,X.split=Ud,X.spread=Al,X.tail=oc,X.take=sc,X.takeRight=cc,X.takeRightWhile=lc,X.takeWhile=uc,X.tap=Oc,X.throttle=jl,X.thru=kc,X.toArray=Du,X.toPairs=gd,X.toPairsIn=_d,X.toPath=Ff,X.toPlainObject=Mu,X.transform=vd,X.unary=Ml,X.union=dc,X.unionBy=fc,X.unionWith=pc,X.uniq=mc,X.uniqBy=hc,X.uniqWith=gc,X.unset=yd,X.unzip=_c,X.unzipWith=vc,X.update=bd,X.updateWith=xd,X.values=Sd,X.valuesIn=Cd,X.without=yc,X.words=nf,X.wrap=Nl,X.xor=bc,X.xorBy=xc,X.xorWith=Sc,X.zip=Cc,X.zipObject=wc,X.zipObjectDeep=Tc,X.zipWith=Ec,X.entries=gd,X.entriesIn=_d,X.extend=Iu,X.extendWith=Lu,vf(X,X),X.add=Lf,X.attempt=rf,X.camelCase=Dd,X.capitalize=Od,X.ceil=Rf,X.clamp=wd,X.clone=Fl,X.cloneDeep=Ll,X.cloneDeepWith=Rl,X.cloneWith=Il,X.conformsTo=zl,X.deburr=kd,X.defaultTo=lf,X.divide=zf,X.endsWith=Ad,X.eq=Bl,X.escape=jd,X.escapeRegExp=Md,X.every=zc,X.find=Vc,X.findIndex=Os,X.findKey=Uu,X.findLast=Hc,X.findLastIndex=ks,X.findLastKey=Wu,X.floor=Bf,X.forEach=Kc,X.forEachRight=qc,X.forIn=Gu,X.forInRight=Ku,X.forOwn=qu,X.forOwnRight=Ju,X.get=Zu,X.gt=Vl,X.gte=Hl,X.has=Qu,X.hasIn=$u,X.head=Ps,X.identity=ff,X.includes=Yc,X.indexOf=Fs,X.inRange=Td,X.invoke=nd,X.isArguments=Ul,X.isArray=$,X.isArrayBuffer=Wl,X.isArrayLike=Gl,X.isArrayLikeObject=Kl,X.isBoolean=ql,X.isBuffer=Jl,X.isDate=Yl,X.isElement=Xl,X.isEmpty=Zl,X.isEqual=Ql,X.isEqualWith=$l,X.isError=eu,X.isFinite=tu,X.isFunction=nu,X.isInteger=ru,X.isLength=iu,X.isMap=su,X.isMatch=cu,X.isMatchWith=lu,X.isNaN=uu,X.isNative=du,X.isNil=pu,X.isNull=fu,X.isNumber=mu,X.isObject=au,X.isObjectLike=ou,X.isPlainObject=hu,X.isRegExp=gu,X.isSafeInteger=_u,X.isSet=vu,X.isString=yu,X.isSymbol=bu,X.isTypedArray=xu,X.isUndefined=Su,X.isWeakMap=Cu,X.isWeakSet=wu,X.join=Bs,X.kebabCase=Nd,X.last=Vs,X.lastIndexOf=Hs,X.lowerCase=Pd,X.lowerFirst=Fd,X.lt=Tu,X.lte=Eu,X.max=Vf,X.maxBy=Hf,X.mean=Uf,X.meanBy=Wf,X.min=Gf,X.minBy=Kf,X.stubArray=kf,X.stubFalse=Af,X.stubObject=jf,X.stubString=Mf,X.stubTrue=Nf,X.multiply=qf,X.nth=Us,X.noConflict=yf,X.noop=bf,X.now=ul,X.pad=Id,X.padEnd=Ld,X.padStart=Rd,X.parseInt=zd,X.random=Ed,X.reduce=tl,X.reduceRight=nl,X.repeat=Bd,X.replace=Vd,X.result=pd,X.round=Jf,X.runInContext=e,X.sample=il,X.size=sl,X.snakeCase=Hd,X.some=cl,X.sortedIndex=Qs,X.sortedIndexBy=$s,X.sortedIndexOf=ec,X.sortedLastIndex=tc,X.sortedLastIndexBy=nc,X.sortedLastIndexOf=rc,X.startCase=Wd,X.startsWith=Gd,X.subtract=Yf,X.sum=Xf,X.sumBy=Zf,X.template=Kd,X.times=Pf,X.toFinite=Ou,X.toInteger=ku,X.toLength=Au,X.toLower=qd,X.toNumber=ju,X.toSafeInteger=Nu,X.toString=Pu,X.toUpper=Jd,X.trim=Yd,X.trimEnd=Xd,X.trimStart=Zd,X.truncate=Qd,X.unescape=$d,X.uniqueId=If,X.upperCase=ef,X.upperFirst=tf,X.each=Kc,X.eachRight=qc,X.first=Ps,vf(X,function(){var e={};return mi(X,function(t,n){$e.call(X.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),X.VERSION=`4.18.1`,nn([`bind`,`bindKey`,`curry`,`curryRight`,`partial`,`partialRight`],function(e){X[e].placeholder=X}),nn([`drop`,`take`],function(e,t){Z.prototype[e]=function(r){r=r===n?1:kt(ku(r),0);var i=this.__filtered__&&!t?new Z(this):this.clone();return i.__filtered__?i.__takeCount__=Pt(r,i.__takeCount__):i.__views__.push({size:Pt(r,v),type:e+(i.__dir__<0?`Right`:``)}),i},Z.prototype[e+`Right`]=function(t){return this.reverse()[e](t).reverse()}}),nn([`filter`,`map`,`takeWhile`],function(e,t){var n=t+1,r=n==1||n==3;Z.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Q(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),nn([`head`,`last`],function(e,t){var n=`take`+(t?`Right`:``);Z.prototype[e]=function(){return this[n](1).value()[0]}}),nn([`initial`,`tail`],function(e,t){var n=`drop`+(t?``:`Right`);Z.prototype[e]=function(){return this.__filtered__?new Z(this):this[n](1)}}),Z.prototype.compact=function(){return this.filter(ff)},Z.prototype.find=function(e){return this.filter(e).head()},Z.prototype.findLast=function(e){return this.reverse().find(e)},Z.prototype.invokeMap=ra(function(e,t){return typeof e==`function`?new Z(this):this.map(function(n){return Ei(n,e,t)})}),Z.prototype.reject=function(e){return this.filter(Cl(Q(e)))},Z.prototype.slice=function(e,t){e=ku(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Z(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)},Z.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Z.prototype.toArray=function(){return this.take(v)},mi(Z.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),a=X[i?`take`+(t==`last`?`Right`:``):t],o=i||/^find/.test(t);a&&(X.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Z,l=s[0],u=c||$(t),d=function(e){var t=a.apply(X,un([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 Z(this);var g=e.apply(t,s);return g.__actions__.push({func:kc,args:[d],thisArg:n}),new ur(g,f)}return m&&h?e.apply(this,s):(g=this.thru(d),m?i?g.value()[0]:g.value():g)})}),nn([`pop`,`push`,`shift`,`sort`,`splice`,`unshift`],function(e){var t=Ye[e],n=/^(?:push|sort|unshift)$/.test(e)?`tap`:`thru`,r=/^(?:pop|shift)$/.test(e);X.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply($(i)?i:[],e)}return this[n](function(n){return t.apply($(n)?n:[],e)})}}),mi(Z.prototype,function(e,t){var n=X[t];if(n){var r=n.name+``;$e.call(wn,r)||(wn[r]=[]),wn[r].push({name:t,func:n})}}),wn[to(n,s).name]=[{name:`wrapper`,func:n}],Z.prototype.clone=dr,Z.prototype.reverse=fr,Z.prototype.value=pr,X.prototype.at=Ac,X.prototype.chain=jc,X.prototype.commit=Mc,X.prototype.next=Nc,X.prototype.plant=Fc,X.prototype.reverse=Ic,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=Lc,X.prototype.first=X.prototype.head,mt&&(X.prototype[mt]=Pc),X})();typeof define==`function`&&typeof define.amd==`object`&&define.amd?(Ht._=J,define(function(){return J})):Wt?((Wt.exports=J)._=J,Ut._=J):Ht._=J}).call(e)})),Ao=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`:``)}})),jo=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=Ao(),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})),Mo=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=jo()(e);var{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),No=n(((e,t)=>{var n=ko(),r=Mo()(`mongo-knex:converter`),i=Mo()(`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}})),Po=n(((e,t)=>{t.exports=No()})),Fo=n(((e,t)=>{var n=ko(),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:_}})),Io=n(((e,t)=>{t.exports=Fo()})),Lo=n(((e,t)=>{var n=Io(),r=er(),i=ko(),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}})),Ro=n(((e,t)=>{var n=Oo(),r=er(),i=Po(),a=Lo();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:Io().mapQuery,mapKeyValues:Io().mapKeyValues}})),zo=t(n(((e,t)=>{t.exports=Ro()}))(),1);function Bo(e,t){return e.visibility?(0,zo.default)(e.visibility).queryJSON(t):!0}function Vo({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]=Bo(e,c)?e.value:null}),l.append(`custom`,JSON.stringify(u)),l.toString()}var Ho=({settings:e,url:t})=>{let n=Vo({...e});return(0,Y.jsx)(aa,{addDelay:!1,className:`absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]`,generateContent:(0,J.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`,testId:`theme-preview`,width:`100%`})},Uo=({setting:e,setSetting:t})=>{let[n,r]=(0,J.useState)({});(0,J.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}=pt(),s=g(),c=async e=>{try{t(Ne(await o({file:e})))}catch(e){s(e)}};switch(e.type){case`text`:return(0,Y.jsx)(I,{hint:e.description,title:Fn(e.key),value:n[e.key]||``,onBlur:()=>i(e.key),onChange:t=>a(e.key,t.target.value)});case`boolean`:return(0,Y.jsx)(vt,{checked:e.value,direction:`rtl`,hint:e.description,label:Fn(e.key),onChange:e=>t(e.target.checked)});case`select`:return(0,Y.jsx)(Te,{hint:e.description,options:e.options.map(e=>({label:e,value:e})),selectedOption:{label:e.value,value:e.value},testId:`setting-select-${e.key}`,title:Fn(e.key),onSelect:e=>t(e?.value||null)});case`color`:return(0,Y.jsx)(Yr,{debounceMs:200,direction:`rtl`,hint:e.description,title:Fn(e.key),value:e.value||``,onChange:e=>t(e)});case`image`:return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{useLabelTag:!0,children:Fn(e.key)}),(0,Y.jsx)(Ee,{height:e.value?`100px`:`32px`,id:`custom-${e.key}`,imageURL:e.value||``,onDelete:()=>t(null),onUpload:e=>c(e),children:`Upload image`}),e.description&&(0,Y.jsx)(E,{children:e.description})]})}},Wo={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`]},Go=({sections:e,updateSetting:t})=>{let{data:n}=On(),r=n?.themes.find(e=>e.active),i=r?.package.name?.toLowerCase()||``,a=r?.package.author?.name||``,{supportsCustomFonts:o}=Na();return(0,Y.jsx)(Y.Fragment,{children:e.map(e=>{let n=e.settings.filter(t=>Bo(t,e.settings.reduce((e,{key:t,value:n})=>({...e,[t]:n}),{}))),r;return(0,Y.jsx)(U,{className:`first-of-type:mt-6`,gap:`xs`,margins:`lg`,title:e.title,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=Wo[i];return s&&s.includes(e.key)&&a===`Ghost Foundation`&&o&&(n+=` hidden`),r=e.type,(0,Y.jsx)(`div`,{className:n,children:(0,Y.jsx)(Uo,{setSetting:n=>t({...e,value:n}),setting:e},e.key)},e.key)})},e.id)})})},Ko=({globalSettings:e,themeSettingSections:t,updateGlobalSetting:n,updateThemeSetting:r,onTabChange:i})=>{let[a,o]=(0,J.useState)(`global`),s=[{id:`global`,title:`Brand`,contents:(0,Y.jsx)(Do,{updateSetting:n,values:e})}];return t.length>0&&s.push({id:`theme-settings`,title:`Theme`,contents:(0,Y.jsx)(Go,{sections:t,updateSetting:r})}),(0,Y.jsx)(`div`,{className:`flex h-full flex-col justify-between`,children:(0,Y.jsx)(`div`,{className:`grow p-7 pt-0`,"data-testid":`design-setting-tabs`,children:s.length>1?(0,Y.jsx)(Xe,{selectedTab:a,stickyHeader:!0,tabs:s,onTabChange:e=>{o(e),i(e)}}):(0,Y.jsx)(Do,{updateSetting:n,values:e})})})},qo=()=>{let{settings:e,siteData:t}=K(),{mutateAsync:n}=In(),{data:{posts:[r]}={posts:[]}}=Rt({searchParams:{filter:`status:published`,order:`published_at DESC`,limit:`1`,fields:`id,url`}}),{data:i}=yn(),{mutateAsync:a}=kn(),o=g(),[s,c]=(0,J.useState)(`homepage`),{updateRoute:l}=W(),u=je().getParam(`ref`),{formState:d,saveState:f,handleSave:p,updateForm:m,setFormState:h,okProps:_}=jt({initialState:{settings:e,themeSettings:i?i.custom_theme_settings:void 0},savingDelay:500,onSave:async()=>{if(d.themeSettings?.some(e=>e.dirty)){let e=await a(d.themeSettings);h(t=>({...t,themeSettings:e.custom_theme_settings}))}if(d.settings.some(e=>e.dirty)){let{settings:e}=await n(d.settings.filter(e=>e.dirty));h(t=>({...t,settings:e}))}},onSaveError:o});(0,J.useEffect)(()=>{i&&h(e=>({...e,themeSettings:i.custom_theme_settings}))},[h,i]);let v=(e,t)=>{m(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},y=e=>{m(t=>({...t,themeSettings:t.themeSettings?.map(t=>t.key===e.key?{...e,dirty:!0}:t)}))},[b,x,S,C,w,T,E]=Nn(d.settings,[`description`,`accent_color`,`icon`,`logo`,`cover_image`,`heading_font`,`body_font`]),D=(d.themeSettings||[]).reduce((e,t)=>{let n=t.group===`homepage`||t.group===`post`?t.group:`site-wide`;return{...e,[n]:(e[n]||[]).concat(t)}},{}),O=Object.entries(D).map(([e,t])=>({id:e,settings:t||[],title:e===`site-wide`?`Site wide`:e===`homepage`?`Homepage`:`Post`})),k=[];r&&(k=[{id:`homepage`,title:`Homepage`},{id:`post`,title:`Post`}]);let A=e=>{k.length&&c(e)},j=e=>{c(e===`post`&&r?`post`:`homepage`)},M=Wn(t);switch(s){case`homepage`:M=Wn(t);break;case`post`:M=r.url;break}let N=(0,Y.jsx)(Ho,{settings:{description:b,accentColor:x,icon:S,logo:C,coverImage:w,themeSettings:d.themeSettings,headingFont:T,bodyFont:E},url:M}),P=(0,Y.jsx)(Ko,{globalSettings:{description:b,accentColor:x,icon:S,logo:C,coverImage:w,headingFont:T,bodyFont:E},handleSave:p,themeSettingSections:O,updateGlobalSetting:v,updateThemeSetting:y,onTabChange:j});return(0,Y.jsx)(Ii,{afterClose:()=>{l(u===`setup`?{isExternal:!0,route:`analytics`}:`design`)},buttonsDisabled:_.disabled,cancelLabel:`Close`,defaultTab:`homepage`,dirty:f===`unsaved`,okColor:_.color,okLabel:_.label||`Save`,preview:N,previewToolbarTabs:k,selectedURL:s,sidebar:P,sidebarPadding:!1,siteLink:Wn(t),size:`full`,testId:`design-modal`,title:`Design`,onOk:async()=>{await p({fakeWhenUnchanged:!0})},onSelectURL:A})},Jo=O.create(({title:e,prompt:t,cancelLabel:n=`Cancel`,okLabel:r=`OK`,okColor:i=`black`})=>{let a=N(),o=e=>{a.resolve(e),a.remove()};return(0,Y.jsx)(L,{backDropClick:!1,cancelLabel:n,okColor:i,okLabel:r,testId:`theme-editor-confirm-modal`,title:e,width:540,onCancel:()=>o(!1),onOk:()=>o(!0),children:(0,Y.jsx)(`div`,{className:`py-4`,children:t})})}),Yo=O.create(({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a=`Cancel`,okLabel:o=`Continue`})=>{let s=N(),[c,l]=(0,J.useState)(r),u=e=>{s.resolve(e),s.remove()};return(0,Y.jsx)(L,{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,Y.jsxs)(`div`,{className:`flex flex-col gap-4 py-4`,children:[t,(0,Y.jsx)(I,{clearBg:!1,placeholder:i,title:n,value:c,autoFocus:!0,onChange:e=>l(e.target.value)})]})})}),Xo=`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`,Zo=`${Xo} border-[#2f333b] bg-transparent text-[#e6e7ea] hover:bg-[#1f2228]`,Qo=`${Xo} border-transparent bg-green text-black hover:bg-green-400`,$o=({currentThemeName:e,changes:t,isSaving:n,onClose:r,onSave:i})=>(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[#23262c] bg-[#1a1d21] px-4 py-3`,children:[(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(`h2`,{className:`truncate text-[14px] font-semibold text-[#f4f5f7]`,children:`Edit theme`}),(0,Y.jsx)(`span`,{className:`truncate text-[12px] text-[#8a8f98]`,children:e})]}),t.length>0&&(0,Y.jsxs)(`span`,{className:`rounded-full border border-transparent bg-[#3b2a16] px-2.5 py-1 text-[11px] leading-none text-[#f5a623]`,children:[Kt(t.length),` `,t.length===1?`file modified`:`files modified`]}),(0,Y.jsx)(`div`,{className:`grow`}),(0,Y.jsxs)(`button`,{className:Zo,type:`button`,onClick:r,children:[(0,Y.jsx)(Yt,{size:14}),`Close`]}),(0,Y.jsxs)(`button`,{className:Qo,disabled:n,type:`button`,onClick:i,children:[(0,Y.jsx)(Ut,{size:14}),n?`Saving…`:`Save`]})]}),es=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},ts=e=>e.sort((e,t)=>e.type===t.type?e.name.localeCompare(t.name):e.type===`dir`?-1:1),ns=`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`,rs=({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,Y.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,Y.jsx)(`span`,{className:`w-3 shrink-0`}),(0,Y.jsx)(qt,{size:14}),(0,Y.jsx)(`span`,{className:`min-w-0 grow truncate`,children:e.name}),r&&(0,Y.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=ts(Array.from(e.children?.values()||[]));return(0,Y.jsxs)(`div`,{children:[e.path&&(0,Y.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,Y.jsx)(Zt,{className:`shrink-0 text-[#6a6f78]`,size:12}):(0,Y.jsx)(Qt,{className:`shrink-0 text-[#6a6f78]`,size:12}),s?(0,Y.jsx)(Gt,{className:`shrink-0 text-[#8a8f98]`,size:14}):(0,Y.jsx)(Wt,{className:`shrink-0 text-[#8a8f98]`,size:14}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.name})]}),(e.path===``||s)&&(0,Y.jsx)(`div`,{children:l.map(t=>d(t,e.path?o+1:o))})]},e.path||`root`)};return(0,Y.jsxs)(`aside`,{className:`flex w-[280px] shrink-0 flex-col border-r border-[#23262c] bg-[#16181c]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-[#23262c] px-3 py-2`,children:[(0,Y.jsxs)(`div`,{className:`text-[12px] font-medium text-[#c8ccd3]`,children:[Object.keys(e).length,` files`]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`button`,{"aria-label":`New file`,className:ns,type:`button`,onClick:s,children:(0,Y.jsx)(Jt,{size:13})}),(0,Y.jsx)(`button`,{"aria-label":`Rename selected item`,className:ns,disabled:!t,type:`button`,onClick:c,children:(0,Y.jsx)($t,{size:13})}),(0,Y.jsx)(`button`,{"aria-label":`Delete selected item`,className:ns,disabled:!t,type:`button`,onClick:l,children:(0,Y.jsx)(Vt,{size:13})})]})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:o?(0,Y.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-center text-[13px] text-[#8a8f98]`,children:[(0,Y.jsx)(`div`,{className:`size-5 animate-spin rounded-full border-2 border-[#2f333b] border-t-[#14b886]`}),(0,Y.jsx)(`span`,{children:`Loading theme files…`})]}):Object.keys(e).length===0?(0,Y.jsx)(`div`,{className:`px-3 py-4 text-[12px] text-[#8a8f98]`,children:`This theme archive does not contain any files.`}):d(es(e))})]})},is=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 N(e){return(e<<1)-(4<e?9:0)}function P(e){for(var t=e.length;0<=--t;)e[t]=0}function F(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 I(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,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function z(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 B(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 ee(e,t){for(var n,r;;){if(e.lookahead<T){if(B(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=z(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function V(e,t){for(var n,r,i;;){if(e.lookahead<T){if(B(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=z(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&&(I(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]))&&I(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?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function te(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 ne(){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)),P(this.dyn_ltree),P(this.dyn_dtree),P(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),P(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),P(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 H(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 re(e){var t=H(e);return t===d&&function(e){e.window_size=2*e.w_size,P(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 ie(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 ne;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,re(e)}r=[new te(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(B(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,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new te(4,4,8,4,ee),new te(4,5,16,8,ee),new te(4,6,32,32,ee),new te(4,4,16,16,V),new te(8,16,32,32,V),new te(8,16,128,128,V),new te(8,32,128,256,V),new te(32,128,258,1024,V),new te(32,258,258,4096,V)],n.deflateInit=function(e,t){return ie(e,t,g,15,8,0)},n.deflateInit2=ie,n.deflateReset=re,n.deflateResetKeep=H,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,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(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):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(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,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(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)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(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)),F(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,L(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)),F(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,L(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&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(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&&(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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(B(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&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(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&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(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&&(P(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,B(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,B(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,N,P,F,I,L,R,z=0,B=new r.Buf8(4),ee=[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,I=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){B[n.check=0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<F,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,B[2]=b>>>16&255,B[3]=b>>>24&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(B[0]=255&b,B[1]=b>>>8&255,n.check=a(n.check,B,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&&(F=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,F)),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;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)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;F=p[g+E++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)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[ee[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){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=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>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(R=k+2;x<R;){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}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(R=k+7;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=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++]=F}}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,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){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=(z=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,N=A,P=j;A=(z=n.lencode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x<R;){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=(z=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&z,!((k=z>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,N=A,P=j;A=(z=n.distcode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&z,!(M+(k=z>>>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(R=n.extra;x<R;){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:I=1;break e;case 30:I=-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)&&I===u&&(I=-5),I)},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,N=null,P=0,F=new r.Buf16(16),I=new r.Buf16(16),L=null,R=0;for(C=0;C<=15;C++)F[C]=0;for(w=0;w<c;w++)F[t[n+w]]++;for(D=S,E=15;1<=E&&F[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&&F[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=F[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(I[1]=0,C=1;C<15;C++)I[C+1]=I[C]+F[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[I[t[n+w]]++]=w);if(v=e===0?(N=L=d,19):e===1?(N=i,P-=257,L=a,R-=257,256):(N=o,L=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=L[R+d[w]],N[P+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++,--F[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-=F[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,N=Array(d);function P(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 F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function I(e){return e<256?D[e]:D[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,L(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 z(e,t,n){R(e,n[2*t],n[2*t+1])}function B(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function ee(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]=B(a[s]++,s))}}function V(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 te(e){8<e.bi_valid?L(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 ne(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 H(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ne(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ne(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function re(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?z(e,i,t):(z(e,(a=O[i])+l+1,t),(o=x[a])!==0&&R(e,i-=k[a],o),z(e,a=I(--r),n),(o=S[a])!==0&&R(e,r-=N[a],o)),s<e.last_lit;);z(e,_,t)}function ie(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--)H(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],H(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++,H(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),ee(a,l,e.bl_count)}function ae(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 oe(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(;z(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(z(e,y,e.bl_tree),R(e,s-3,3)):(z(e,b,e.bl_tree),R(e,s-11,7)):(i!==a&&(z(e,i,e.bl_tree),s--),z(e,v,e.bl_tree),R(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(N);var se=!1;function ce(e,t,n,i){R(e,(s<<1)+ +!!i,3),function(e,t,n,i){te(e),i&&(L(e,n),L(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){se||=(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(N[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(N[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(ee(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=B(e,5);A=new P(T,x,l+1,u,m),j=new P(E,S,0,d,m),M=new P([],C,0,f,g)}(),!0),e.l_desc=new F(e.dyn_ltree,A),e.d_desc=new F(e.dyn_dtree,j),e.bl_desc=new F(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,V(e)},n._tr_stored_block=ce,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)),ie(e,e.l_desc),ie(e,e.d_desc),c=function(e){var t;for(ae(e,e.dyn_ltree,e.l_desc.max_code),ae(e,e.dyn_dtree,e.d_desc.max_code),ie(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?ce(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),re(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i<r;i++)R(e,e.bl_tree[2*w[i]+1],3);oe(e,e.dyn_ltree,t-1),oe(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),re(e,e.dyn_ltree,e.dyn_dtree)),V(e),r&&te(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*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),z(e,_,T),function(e){e.bi_valid===16?(L(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),as={maxFiles:1e3,maxExtractedBytes:32*1024*1024},os=class extends Error{reason;constructor(e,t){super(t),this.name=`ThemeArchiveExtractionError`,this.reason=e}},ss=new Set([`css`,`cjs`,`hbs`,`handlebars`,`htm`,`html`,`js`,`json`,`less`,`md`,`markdown`,`mjs`,`sass`,`scss`,`svg`,`txt`,`xml`,`yaml`,`yml`]),cs=new Set([`.editorconfig`,`.eslintignore`,`.eslintrc`,`.gitattributes`,`.gitignore`,`.npmignore`,`.prettierignore`,`.prettierrc`,`CODEOWNERS`,`LICENSE`,`LICENCE`,`NOTICE`,`Procfile`]),ls=e=>{if(ss.has(us(e)))return!0;let t=e.split(`/`).at(-1)||e;return cs.has(t)},us=e=>{let t=e.lastIndexOf(`.`);return t===-1?``:e.slice(t+1).toLowerCase()},ds=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(`/`)},fs=e=>[`casper`,`source`].includes(e.toLowerCase()),ps=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:``},ms=e=>Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t,date:new Date(t.date),binary:t.binary?new Uint8Array(t.binary):null}])),hs=`Failed to open the theme archive. Download the theme again and retry.`,gs=e=>{let t=e/(1024*1024);return Number.isInteger(t)?`${t} MB`:`${t.toFixed(1)} MB`},_s=e=>{let t=[];return e.forEach((e,n)=>{n.dir||t.push([e,n])}),t},vs=e=>{if(e.length>as.maxFiles)throw new os(`too_many_files`,`This theme archive contains too many files for the browser editor (${e.length}/${as.maxFiles}).`)},ys=async e=>{try{return await is.default.loadAsync(e)}catch{throw new os(`invalid_archive`,hs)}},bs=async e=>{try{return await e.async(`uint8array`)}catch{throw new os(`invalid_archive`,hs)}},xs=async e=>{try{return await e.async(`string`)}catch{throw new os(`invalid_archive`,hs)}},Ss=e=>{let t=ds(e);if(!t||t!==e)throw new os(`invalid_archive`,hs);return t},Cs=(e,t)=>{let n=e+t;if(n>as.maxExtractedBytes)throw new os(`too_large`,`This theme archive is too large to open in the browser editor. Extracted files must stay under ${gs(as.maxExtractedBytes)}.`);return n},ws=async e=>{let t=_s(await ys(e));vs(t);let n=ps(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=Ss(t);if(ls(s))try{let e=await xs(o);a=Cs(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 bs(o);a=Cs(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}},Ts=async({files:e,rootPrefix:t})=>{let n=new is.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}})},Es=({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},Ds=({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},Os=e=>{switch(us(e)){case`css`:case`scss`:case`sass`:case`less`:return Dt(()=>import(`./dist-CMhLtvG_.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 Dt(()=>import(`./dist-C30sqimN.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([4,1,2,5,3]),import.meta.url);case`json`:return Dt(()=>import(`./dist-CVmVbSNW.js`).then(e=>e.json()),__vite__mapDeps([6,2,3]),import.meta.url);case`md`:case`markdown`:return Dt(()=>import(`./dist-DGtq6W4I.js`).then(e=>e.markdown()),__vite__mapDeps([7,2,5,8,3,0,1,4]),import.meta.url);case`yaml`:case`yml`:return Dt(()=>import(`./dist-Bw1d5xrJ.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 Dt(()=>import(`./dist-DVfKxKHo.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url);default:return Dt(()=>import(`./dist-DVfKxKHo.js`).then(e=>e.html()),__vite__mapDeps([8,2,3,0,1,4,5]),import.meta.url)}},ks=e=>{let t=us(e);if(!t)return`text`;switch(t){case`hbs`:return`handlebars`;case`htm`:return`html`;case`yml`:return`yaml`;default:return t}},As=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},js=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},Ms=[`theme`,`design`],Ns=e=>Ms.some(t=>e===t||e.startsWith(`${t}/`)),Ps=()=>{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===``||Ns(r)?r:null},Fs=(e,t)=>{let n=`theme/edit/${encodeURIComponent(e)}`;return t===null?n:`${n}?from=${encodeURIComponent(t)}`},Is=(e,t)=>!e.editable&&ls(t),Ls=/^[a-z0-9][\w-]{0,63}$/,Rs={COMPRESSED_TOO_LARGE:`Theme too large to upload`,ENTRY_TOO_LARGE:`File too large`,TOTAL_TOO_LARGE:`Theme contents too large`},zs=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`},Bs=e=>{let{entryName:t,limitBytes:n}=e.errorDetails??{},r=zs(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.`}},Vs=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`}`,Hs=`flex h-full items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]`,Us=Xn.theme({"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:`#355070`},".cm-content ::selection":{color:`#ffffff`}},{dark:!0}),Ws=({themeName:e})=>{let t=N(),{updateRoute:n}=W(),r=s(),i=g(),{data:a}=On(),[o,c]=(0,J.useState)(e),[l,u]=(0,J.useState)({}),[f,m]=(0,J.useState)({}),[h,_]=(0,J.useState)(``),[v,y]=(0,J.useState)(null),[b,x]=(0,J.useState)(new Set([``])),[S,C]=(0,J.useState)(!0),[w,T]=(0,J.useState)(!1),[E,D]=(0,J.useState)(null),[A,P]=(0,J.useState)(!1),[F,I]=(0,J.useState)([]);(0,J.useEffect)(()=>{let t=!0,n=()=>{c(e),u({}),m({}),_(``),y(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 ws(await r.arrayBuffer()),a=ms(i.files),o=As(a);if(!t)return;c(e),u(ms(i.files)),m(a),_(i.rootPrefix),y(o),x(new Set(o?.type===`file`?js(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,J.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[]);let L=(0,J.useMemo)(()=>Es({baseFiles:l,currentFiles:f}),[l,f]),R=(0,J.useMemo)(()=>new Map(L.map(e=>[e.path,e.status])),[L]),z=v?.type===`file`?f[v.path]:null;(0,J.useEffect)(()=>{let e=!0;return z?.editable?(Os(z.path).then(t=>{e&&I([j({top:!0}),k,t,...A?[Xn.lineWrapping]:[],Us])}).catch(()=>{e&&I([j({top:!0}),k,...A?[Xn.lineWrapping]:[],Us])}),()=>{e=!1}):(I([]),()=>{e=!1})},[A,z]);let B=async({title:e,prompt:t,cancelLabel:n,okLabel:r,okColor:i})=>!!await O.show(Jo,{title:e,prompt:t,cancelLabel:n,okLabel:r,okColor:i}),ee=async({title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o})=>await O.show(Yo,{title:e,prompt:t,fieldTitle:n,initialValue:r,placeholder:i,cancelLabel:a,okLabel:o}),V=async()=>{L.length>0&&!await B({title:`Discard changes?`,prompt:`You have unsaved theme changes. Close the editor and discard them?`,okLabel:`Discard changes`,okColor:`red`})||(t.remove(),n(Ps()??`design/change-theme`))},te=(0,J.useRef)(()=>{});(0,J.useEffect)(()=>{let e=e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`){e.preventDefault(),te.current();return}e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())};return window.addEventListener(`keydown`,e,!0),()=>{window.removeEventListener(`keydown`,e,!0)}},[]);let ne=e=>{x(t=>{let n=new Set(t);for(let t of js(e))n.add(t);return n})},H=(e,t)=>{if(m(e),t){y(t),t.type===`file`&&ne(t.path);return}v?.type===`file`&&e[v.path]||y(As(e))},re=async()=>{let e=await ee({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?ds(e):null;if(!t)return;if(!ls(t)){p({type:`error`,title:`Only text files can be created here`,message:`Use a text-based theme file extension such as .hbs, .css, .js, or .json.`});return}if(f[t]){p({type:`error`,title:`File already exists`});return}let n={...f,[t]:{path:t,editable:!0,content:``,binary:null,date:new Date,unixPermissions:null,dosPermissions:null}};H(n,{type:`file`,path:t})},ie=async()=>{if(!v)return;let e=v.type===`dir`?v.path.replace(/\/$/,``):v.path,t=v.type===`dir`?`Rename folder to`:`Rename file to`,n=await ee({title:v.type===`dir`?`Rename folder`:`Rename file`,fieldTitle:`Path`,initialValue:e,okLabel:`Rename`,prompt:t}),r=n?ds(n):null;if(!r||r===e)return;if(v.type===`file`){let e=f[v.path];if(!ls(r)&&e.editable){p({type:`error`,title:`Text files must keep a text file extension`});return}if(Is(e,r)){p({type:`error`,title:`Binary files cannot be renamed to a text file`,message:`Rename this file with a non-text extension to keep its contents intact.`});return}if(f[r]){p({type:`error`,title:`A file with that name already exists`});return}let t={...f},n=t[v.path];delete t[v.path],t[r]={...n,path:r,editable:ls(r)},H(t,{type:`file`,path:r});return}let i=`${r}/`;if(i.startsWith(v.path)){p({type:`error`,title:`A folder cannot be renamed inside itself`});return}if(Object.keys(f).find(e=>e.startsWith(i))){p({type:`error`,title:`A folder with that path already exists`});return}let a=Ds({files:f,oldPrefix:v.path,newPrefix:i});H(a,{type:`dir`,path:i}),x(e=>{let t=new Set;for(let n of e){if(!n.startsWith(v.path)){t.add(n);continue}t.add(`${i}${n.slice(v.path.length)}`)}return t})},ae=async()=>{if(!v)return;if(v.type===`file`){if(!await B({title:`Delete file`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Delete `,(0,Y.jsx)(`strong`,{children:v.path}),` from this theme?`]}),okLabel:`Delete`,okColor:`red`}))return;let e={...f};delete e[v.path],H(e);return}let e=Object.keys(f).filter(e=>e.startsWith(v.path));if(!e.length||!await B({title:`Delete folder`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Delete `,e.length,` file`,e.length===1?``:`s`,` from `,(0,Y.jsx)(`strong`,{children:v.path}),`?`]}),okLabel:`Delete`,okColor:`red`}))return;let t={...f};for(let n of e)delete t[n];H(t)},oe=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}),H(r)},se=async()=>{let e=(await ee({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?Ls.test(e)?fs(e)?(p({type:`error`,title:`Built-in themes cannot be overwritten`}),null):e:(p({type:`error`,title:`Invalid theme name`,message:`Use 1-64 characters, starting with a letter or number. Allowed: letters, numbers, dashes, and underscores.`}),null):null},ce=async()=>{if(w)return;if(L.length===0){p({type:`info`,title:`No changes to save`});return}let e=o,t=fs(e)?await se():e;if(!t)return;let s=t!==e,l=a?.themes.some(e=>e.name===t)||!1,m=s?`Save your edits as "${t}"?`:`Upload ${L.length} changed file${L.length===1?``:`s`} and replace "${e}"?`;if(await B({title:s?`Save theme as new copy`:`Update theme`,prompt:m,okLabel:s?`Save theme`:`Replace theme`})&&!(s&&l&&!await B({title:`Overwrite theme`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:t}),` already exists. Do you want to overwrite it?`]}),okLabel:`Overwrite`,okColor:`red`}))){T(!0);try{let e=await Ts({files:f,rootPrefix:h}),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){O.show(Ma,{title:`Theme not saved`,fatalErrors:o.errors});return}let e=o?.errors?.[0];if(e?.code&&Rs[e.code]){p({type:`error`,title:Rs[e.code],message:Bs(e)});return}throw Error(e?.message||`Theme upload failed.`)}let l=o.themes[0],m=Ps();u(ms(f)),s&&(c(t),_(h?`${t}/`:``),n(Fs(t,m))),await r.invalidateQueries([`ThemesResponseType`]),s||l.errors?.length||l.warnings?.length?O.show(Wa,{title:s?`Theme saved`:`Theme updated`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:l.name}),` saved successfully.`]}),installedTheme:l}):p({type:`success`,title:`Theme saved`,message:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`capitalize`,children:l.name}),` has been updated.`]})})}catch(e){i(e)}finally{T(!1)}}};(0,J.useEffect)(()=>{te.current=ce});let le=e=>{y({type:`file`,path:e}),ne(e)},ue=z?R.get(z.path):null;return(0,Y.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&&V()},children:(0,Y.jsxs)(`div`,{className:`relative flex size-full flex-col overflow-hidden bg-[#15171a]`,children:[(0,Y.jsx)($o,{changes:L,currentThemeName:o,isSaving:w,onClose:V,onSave:()=>void ce()}),E&&(0,Y.jsx)(`div`,{className:`border-b border-[#512828] bg-[#3a1d1d] px-4 py-2 text-[12px] text-[#ffbdbd]`,children:E}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Y.jsx)(rs,{changesMap:R,currentFiles:f,expandedDirectories:b,isLoading:S,selectedNode:v,setExpandedDirectories:x,setSelectedNode:y,onCreateFile:re,onDeleteSelected:ae,onOpenFile:le,onRenameSelected:ie}),(0,Y.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-[#16181c]`,children:[(0,Y.jsx)(`div`,{className:`flex items-center gap-2 border-b border-[#23262c] bg-[#17191d] px-4 py-2 text-[12px] text-[#8a8f98]`,children:z?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-medium text-[#e6e7ea]`,children:z.path}),(0,Y.jsx)(`span`,{className:`rounded bg-[#2a2d33] px-2 py-0.5 text-[10px] tracking-[0.04em] text-[#c8ccd3] uppercase`,children:ks(z.path)}),ue&&(0,Y.jsxs)(`button`,{className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] tracking-[0.04em] uppercase ${ue===`deleted`?`bg-[#4a2222] text-[#ffbdbd]`:ue===`added`?`bg-[#17342a] text-[#a5e8c8]`:`bg-[#3b2a16] text-[#f5a623]`}`,type:`button`,onClick:()=>oe(z.path),children:[(0,Y.jsx)(Xt,{size:11}),`Revert`]}),(0,Y.jsx)(`div`,{className:`grow`}),z.editable&&(0,Y.jsx)(`button`,{"aria-label":A?`Disable text wrap`:`Enable text wrap`,"aria-pressed":A,className:Vs(A),title:A?`Disable text wrap`:`Enable text wrap`,type:`button`,onClick:()=>P(e=>!e),children:(0,Y.jsx)(Ht,{className:`shrink-0`,size:14,strokeWidth:2})})]}):(0,Y.jsx)(`span`,{children:`No file selected`})}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1`,children:[!v&&!S&&(0,Y.jsx)(`div`,{className:Hs,children:`Select a file from the tree to start editing.`}),v?.type===`dir`&&(0,Y.jsx)(`div`,{className:Hs,children:`Folder selected. Choose a file to edit, or rename or delete the folder from the file pane.`}),z&&!z.editable&&(0,Y.jsx)(`div`,{className:Hs,children:`This file cannot be edited in the browser.`}),z?.editable&&(0,Y.jsx)(M,{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:F,height:`full`,theme:k,value:z.content||``,autoFocus:!0,onChange:e=>{m(t=>({...t,[z.path]:{...t[z.path],content:e}}))}},`${z.path}:${F.length}`)]})]})]})]})})},Gs=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}}},Ks=O.create(({pathName:e})=>{let t=N(),{route:n,updateRoute:r}=W(),i=n||e,[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),[l,u]=(0,J.useState)(!1),[d,f]=(0,J.useState)(null),[p,m]=(0,J.useState)(!1),{checkThemeLimitError:h,isThemeLimitCheckReady:g,noThemeChangesAllowed:_,isThemeLimited:v}=ht(),[y,b]=(0,J.useState)(null),[x,S]=(0,J.useState)(!1),{themeName:C,isInvalid:w}=Gs(i),T=(0,J.useCallback)(e=>{O.show(he,{prompt:e,onOk:()=>r({route:`/pro`,isExternal:!0})})},[r]);if((0,J.useEffect)(()=>{i===`design/change-theme`&&g?(async()=>{if(!_){c(!1),o(null);return}c(!0);let e=await h();o(e),c(!1),e&&(T(e),t.remove())})():(o(null),c(!1))},[h,i,g,t,_,T]),(0,J.useEffect)(()=>{i!==`theme/install`&&(S(!1),b(null),u(!1))},[i]),(0,J.useEffect)(()=>{w&&(t.remove(),r(`theme`))},[w,t,r]),(0,J.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&&(T(n),t.remove(),r(`theme`)))})(),()=>{e=!0}},[h,C,g,v,t,T,r]),(0,J.useEffect)(()=>{let e=()=>{let e=window.location.href.split(`#`)[1]?.split(`?`)[1];return e?new URLSearchParams(e).get(`ref`):null},n=e=>{b(!1),_?(T(e),window.history.replaceState({},``,window.location.pathname+window.location.hash.split(`?`)[0]),t.remove(),r(`theme`)):(T(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,T,r]),i===`design/edit`)return(0,Y.jsx)(qo,{});if(i===`design/change-theme`)return s||a?null:(0,Y.jsx)(Qa,{});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,Y.jsx)(Qa,{source:n,themeRef:t})}else if(i.startsWith(`theme/edit/`))return w||!C||p||d?null:(0,Y.jsx)(Ws,{themeName:C});else return t.remove(),null}),qs=({html:e,style:t})=>(0,Y.jsx)(aa,{className:`absolute size-full overflow-hidden transition-opacity duration-500`,generateContent:n=>{let r=n.contentDocument||n.contentWindow?.document;if(!r)return;let i=`
|
|
24
24
|
<html>
|
|
25
25
|
<head>
|
|
26
26
|
<style>body, html {padding: 0; margin: 0; overflow: hidden;}</style>
|
|
@@ -28,4 +28,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
28
28
|
</head>
|
|
29
29
|
<body>${e}</body>
|
|
30
30
|
</html>
|
|
31
|
-
`;r.open(),r.write(i),r.close()},height:`100%`,parentClassName:`relative h-full min-h-[400px] w-full`,width:`100%`}),Js=({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}=Mt({path:`/labels/`,filterKey:`name`,responseKey:`labels`});return(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{className:`mb-8`,level:4,children:`Embed signup form`}),(0,Y.jsxs)(U,{gap:`sm`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,Y.jsx)(`div`,{children:`Layout`}),(0,Y.jsx)(re,{activeKey:e,buttons:[{key:`all-in-one`,label:`Branded`,size:`md`,className:`w-auto px-3!`,onClick:()=>s(`all-in-one`)},{key:`minimal`,label:`Minimal`,size:`md`,className:`w-auto px-3!`,onClick:()=>s(`minimal`)}],clearBg:!1})]}),e===`all-in-one`&&(0,Y.jsx)(Yr,{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,Y.jsx)(se,{hint:`Will be applied to all members signing up via this form`,loadOptions:Ie(async(e,t)=>{t((await d(e)).map(e=>({label:e.name,value:e.name})))},500),placeholder:`Pick one or more labels (optional)`,title:`Labels at signup`,values:i||[],async:!0,canCreate:!0,defaultOptions:!0,onChange:a}),(0,Y.jsx)(z,{className:`text-grey-800`,fontStyle:`mono`,hint:`Paste this code onto any website where you'd like your signup to appear.`,title:`Embed code`,value:`${o}`,onChange:()=>{}})]})]}),(0,Y.jsx)(ge,{height:74,children:(0,Y.jsxs)(`div`,{className:`flex w-full justify-end gap-3`,children:[(0,Y.jsx)(q,{className:`lg:hidden`,color:`outline`,label:`Close`,onClick:u}),(0,Y.jsx)(q,{color:l?`green`:`black`,label:l?`Copied!`:`Copy code`,onClick:c})]})})]})};function Ys(e){return e?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):``}var Xs=({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":Ve(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`]=Ve(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}="${Ys(t)}"`}let p=`<div style="${Ys(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},Zs=O.create(()=>{let e=N(),[t,n]=(0,J.useState)(`#08090c`),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)(`all-in-one`),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),{updateRoute:p}=W(),{config:m}=K(),{localSettings:h,siteData:g}=be(),[_,v,y,b,x]=Fn(h,[`accent_color`,`title`,`description`,`locale`,`icon`]),[S,C]=(0,J.useState)({active:!1});return(0,J.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=Xs({preview:!0,...e});c(n);let i=Xs({preview:!1,...e});u(i)},[g,_,r,m,v,t,a,b,x,y]),(0,Y.jsx)(L,{afterClose:()=>{p(`embed-signup-form`)},cancelLabel:``,footer:!1,height:645,padding:!1,testId:`embed-signup-form`,title:``,topRightContent:`close`,width:1120,children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[5.2fr_2.8fr]`,children:[(0,Y.jsx)(qs,{html:s,style:a}),(0,Y.jsx)(Js,{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(({value:e})=>({label:e,value:e}));i(t)}else i([])},handleLayoutSelect:o,isCopied:d,selectedColor:t,selectedLabels:r,selectedLayout:a,setCustomColor:C})]})})}),Qs=O.create(()=>{let{updateRoute:e}=W(),{settings:t}=K(),{mutateAsync:n}=An(),r=g(),[i,a]=(0,J.useState)(``),[o]=Fn(t,[`firstpromoter`]),[s]=Fn(t,[`firstpromoter_id`]),[c,l]=(0,J.useState)(`Save`),[u,d]=(0,J.useState)(!!o);(0,J.useEffect)(()=>{d(o||!1),a(s||null)},[o,s]);let p=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,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:u!==o||i!==s,okColor:c===`Saved`?`green`:`black`,okLabel:c,testId:`firstpromoter-modal`,title:``,onOk:async()=>{try{await p()}catch(e){r(e)}},children:[(0,Y.jsx)(it,{detail:`Launch your own member referral program`,icon:(0,Y.jsx)(f,{className:`-mt-2`,name:`firstpromoter`,size:56}),title:`FirstPromoter`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{marginBottom:!1,title:`FirstPromoter configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:u,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://firstpromoter.com/?fpr=ghost&fp_sid=admin`,rel:`noopener noreferrer`,target:`_blank`,children:`FirstPromoter`}),` for tracking referrals`]}),label:`Enable FirstPromoter`,onChange:e=>{d(e.target.checked)}}),u&&(0,Y.jsx)(I,{hint:(0,Y.jsxs)(Y.Fragment,{children:[`Affiliate and referral tracking, find your ID `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/help/firstpromoter-id/`,rel:`noopener noreferrer`,target:`_blank`,children:`here`})]}),placeholder:`XXXXXXXX`,title:`FirstPromoter account ID`,value:i||``,onChange:e=>{a(e.target.value)}})]})})]})}),$s=`ActionsResponseType`,ec=(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)},tc=v({dataType:$s,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&&ec(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}}}),nc=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}`}}},rc=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===`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`),e.context?.count&&e.context?.count>1?`${e.context?.count} ${t}s ${n}`:`${t.slice(0,1).toUpperCase()}${t.slice(1)} ${n}`},ic=e=>{if(e.resource_type===`setting`&&e.context?.group&&e.context?.key)return{group:e.context?.group,key:e.context?.key}},ac=e=>typeof e.context?.count==`number`&&e.context?.count>1,oc=({action:e})=>{let t=`pen`;switch(e.event){case`added`:t=`add`;break;case`deleted`:t=`trash`;break}return(0,Y.jsx)(f,{name:t,size:`xs`})},sc=({action:e})=>(0,Y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Y.jsx)(V,{bgColor:Ke(e.actor?.name||e.actor?.slug||``),image:e.actor?.image??void 0,label:pe(e.actor?.name||e.actor?.slug),labelColor:`white`,size:`md`}),(0,Y.jsx)(`div`,{className:`absolute -right-1 -bottom-1 z-30 flex items-center justify-center rounded-full border border-grey-100 bg-white p-1 shadow-sm dark:border-grey-900 dark:bg-black`,children:(0,Y.jsx)(oc,{action:e})})]}),cc=({label:e,item:t,excludedItems:n,toggleItem:r})=>(0,Y.jsx)(vt,{checked:!n.includes(t),direction:`rtl`,label:e,onChange:e=>r(t,e.target.checked)}),lc=({excludedEvents:e,excludedResources:t,toggleEventType:n,toggleResourceType:r})=>{let{updateRoute:i}=W(),a=Mt({path:`/users/`,filterKey:`name`,responseKey:`users`}),o=async(e,t)=>{t((await a.loadData(e)).map(e=>({label:e.name,value:e.id})))},[s,c]=(0,J.useState)(),l=()=>{c(null)};return(0,Y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Y.jsx)(Pe,{position:`end`,trigger:(0,Y.jsx)(q,{color:`outline`,label:`Filter`}),children:(0,Y.jsxs)(`div`,{className:`flex w-[220px] flex-col gap-8 p-5`,children:[(0,Y.jsxs)(Ni,{children:[(0,Y.jsx)(cc,{excludedItems:e,item:`added`,label:`Added`,toggleItem:n}),(0,Y.jsx)(cc,{excludedItems:e,item:`edited`,label:`Edited`,toggleItem:n}),(0,Y.jsx)(cc,{excludedItems:e,item:`deleted`,label:`Deleted`,toggleItem:n})]}),(0,Y.jsxs)(Ni,{children:[(0,Y.jsx)(cc,{excludedItems:t,item:`post`,label:`Posts`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`page`,label:`Pages`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`tag`,label:`Tags`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`offer,product`,label:`Tiers & offers`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`api_key,integration,setting,user,webhook`,label:`Settings & staff`,toggleItem:r})]})]})}),(0,Y.jsx)(`div`,{className:`w-[200px]`,children:(0,Y.jsx)(Te,{loadOptions:Ie(o,500),placeholder:`Search staff`,value:s,async:!0,defaultOptions:!0,isClearable:!0,onSelect:e=>{e?(c(e),i(`history/view/${e.value}`)):(l(),i(`history/view`))}})})]})},uc=({action:e})=>{let{updateRoute:t}=W(),n=ic(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:`${t} API ${t===1?`key`:`keys`} rotated`,n===null?null:`${n} ${n===1?`user`:`users`} locked`].filter(Boolean);return(0,Y.jsx)(Y.Fragment,{children:r.length?r.join(`, `):`Authentication reset`})}else if(n){let{group:e,key:t}=n;return(0,Y.jsxs)(Y.Fragment,{children:[e.slice(0,1).toUpperCase(),e.slice(1),e!==t&&(0,Y.jsxs)(`span`,{children:[` `,(0,Y.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=nc(e);return n?(0,Y.jsx)(`a`,{className:`cursor-pointer font-bold`,onClick:e=>{e.preventDefault(),t(n)},children:e.resource?.title||e.resource?.name}):(0,Y.jsx)(Y.Fragment,{children:e.resource?.title||e.resource?.name||e.context?.primary_name})}else return(0,Y.jsx)(`span`,{className:`text-grey-500`,children:`(unknown)`})},dc=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}`},fc=200,pc=O.create(({params:e})=>{let t=N(),{updateRoute:n}=W(),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)([`label`]),{data:s,fetchNextPage:c,isFetchingNextPage:l}=tc({searchParams:{include:`actor,resource`,limit:fc.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:<'${dc(new Date(e.actions[e.actions.length-1].created_at))}'`].join(`+`)}),keepPreviousData:!0}),u=(0,J.useCallback)(()=>{s?.isEnd||c()},[s?.isEnd,c]),d=(e,t,n)=>{e(e=>n?e.concat(t):e.filter(e=>e!==t))},f=r.length>0||a.length>0||e?.user;return(0,Y.jsx)(L,{afterClose:()=>{n(`history`)},cancelLabel:``,okLabel:`Close`,scrolling:!0,size:`md`,stickyFooter:!0,stickyHeader:!0,testId:`history-modal`,title:`History`,topRightContent:(0,Y.jsx)(lc,{excludedEvents:r,excludedResources:a,toggleEventType:(e,t)=>d(i,e,!t),toggleResourceType:(e,t)=>d(o,e,!t),userId:e?.user}),onOk:()=>{t.remove(),n(`history`)},children:(0,Y.jsx)(`div`,{className:`relative mt-6`,children:(0,Y.jsx)(ne,{hint:s?.isEnd&&s.actions.length>0?`End of history log`:void 0,children:s?.actions?s.actions.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Li,{offset:250,onTrigger:u}),s.actions.map(e=>!e.skip&&(0,Y.jsx)(Se,{avatar:(0,Y.jsx)(sc,{action:e}),detail:[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(` | `),title:(0,Y.jsxs)(`div`,{children:[rc(e),ac(e)?``:`: `,!ac(e)&&(0,Y.jsx)(uc,{action:e}),e.count?(0,Y.jsxs)(Y.Fragment,{children:[` `,e.count,` times`]}):null,(0,Y.jsxs)(`span`,{children:[` — by `,e.actor?.name||e.actor?.slug]})]}),separator:!0},e.id)),l&&(0,Y.jsx)(`div`,{className:`flex items-center justify-center p-5`,children:(0,Y.jsx)(Fe,{size:`md`})})]}):(0,Y.jsx)(ee,{icon:`time-back`,children:f?`No entries match your current filters.`:`No history entries found.`}):s===void 0?(0,Y.jsx)(`div`,{className:`flex items-center justify-center px-5 pt-12 pb-10`,children:(0,Y.jsx)(Fe,{})}):(0,Y.jsx)(ee,{children:`No entries found.`})})})})}),mc=`USER_ALREADY_REGISTERED`,hc=`A user with that email address already exists.`,gc=O.create(()=>{let e=O.useModal(),t=R(),n=R({searchParams:{limit:`100`,permissions:`assign`}}),r=ve(),{updateRoute:i}=W(),{config:a}=K(),o=a.labs.superEditors,s=(0,J.useRef)(null),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[f,m]=(0,J.useState)(`contributor`),[h,_]=(0,J.useState)({}),{data:{users:v}={}}=on(),{data:{invites:y}={}}=oe(),{mutateAsync:S}=we(),C=g();if((0,J.useEffect)(()=>{s.current&&s.current.focus()},[]),(0,J.useEffect)(()=>{u===`saved`&&setTimeout(()=>{d(``)},2e3)},[u]),(0,J.useEffect)(()=>{f!==`contributor`&&r?.isLimited(`staff`)?r.errorIfWouldGoOverLimit(`staff`).then(()=>{_(e=>({...e,role:void 0}))}).catch(e=>{if(e instanceof de){_(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(!ua.default.isEmail(c)){_({email:`Please enter a valid email address.`});return}if(v?.some(({email:e})=>e===c)){_({email:hc});return}if(y?.some(({email:e})=>e===c)){_({email:`A user with that email address was already invited.`});return}if(!h.role){d(`saving`);try{await S({email:c,roleId:w.find(({name:e})=>e.toLowerCase()===f.toLowerCase()).id}),d(`saved`),p({title:`Invitation sent`,message:`${c}`,type:`success`}),e.remove(),i(`staff?tab=invited`)}catch(e){if((e instanceof b?e.data?.errors[0]:void 0)?.code===mc){d(``),_({email:hc});return}d(`error`);let t=(0,Y.jsxs)(`span`,{children:[`If the problem persists, `,(0,Y.jsxs)(`a`,{href:`https://ghost.org/contact`,children:[(0,Y.jsx)(`u`,{children:`contact support`}),`.`]}),`.`]});e instanceof x&&e.data?.errors?.[0]?.type===`EmailError`&&(t=(0,Y.jsx)(`span`,{children:`Check your Mailgun configuration.`})),p({title:`Failed to send invitation`,message:t,type:`error`}),C(e,{withToast:!1});return}}}},k=[{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&&(k[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 A=k.filter(e=>T.some(t=>t.name===e.label||t.name===`Super Editor`&&e.label===`Editor (beta mode)`));return h.email&&(E=`Retry`),(0,Y.jsx)(L,{afterClose:()=>{i(`staff`)},cancelLabel:``,okColor:u===`error`||h.email?`red`:`black`,okLabel:E,testId:`invite-user-modal`,title:`Invite a new staff user`,width:540,onOk:D,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[(0,Y.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,Y.jsx)(I,{error:!!h.email,hint:h.email,inputRef:s,placeholder:`jamie@example.com`,title:`Email address`,value:c,onChange:e=>{l(e.target.value)},onKeyDown:()=>_(e=>({...e,email:void 0}))}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Mi,{error:!!h.role,hint:h.role,id:`role`,options:A,selectedOption:f,separator:!0,title:`Role`,onSelect:e=>{m(e)}})})]})})}),_c=({items:e,setItems:t})=>{let n=e=>!!(e.label&&!e.label.match(/^\s*$/)||e.url!==`/`),r=tt({items:e.map(e=>({...e,errors:{}})),setItems:e=>t(e.map(({url:e,label:t})=>({url:e,label:t}))),blank:{url:`/`,label:``,errors:{}},canAddNewItem:n}),i=new RegExp(/^(\/|#|[a-zA-Z0-9-]+:)/),a=e=>{let t={};return(!e.label||e.label.match(/^\s*$/))&&(t.label=`You must specify a label`),(!e.url||e.url.match(/\s/)||!ua.default.isURL(e.url,{require_protocol:!0})&&!e.url.match(i))&&(t.url=`You must specify a valid URL or relative path`),t},o=(e,t)=>{let n=r.items.find(t=>t.id===e);r.updateItem(e,{...n.item,...t})},s=()=>{let e=a(r.newItem);Object.values(e).some(e=>e)?r.setNewItem({...r.newItem,errors:e}):r.addItem()},c=e=>{r.removeItem(e)},l=(e,t)=>{r.moveItem(e,t)},u=(e,t)=>{if(e===`new`)r.setNewItem({...r.newItem,errors:{...r.newItem.errors,[t]:void 0}});else{let n=r.items.find(t=>t.id===e).item;r.updateItem(e,{...n,errors:{...n.errors,[t]:void 0}})}};return{items:r.items.map(({item:e,id:t})=>({...e,id:t})),updateItem:o,addItem:s,removeItem:c,moveItem:l,newItem:{...r.newItem,id:`new`},setNewItem:e=>r.setNewItem({...r.newItem,...e}),clearError:u,validate:()=>{let e=!0;if(r.items.forEach(({item:t,id:n})=>{let i=a(t);Object.values(i).some(e=>e)&&(e=!1,r.updateItem(n,{...t,errors:i}))}),n(r.newItem)){let t=a(r.newItem);Object.values(t).some(e=>e)&&(e=!1,r.setNewItem({...r.newItem,errors:t}))}return e}}},vc=({baseUrl:e,item:t,updateItem:n,addItem:r,clearError:i,labelPlaceholder:a,unstyled:o,textFieldClasses:s,action:c,className:l,...u})=>(0,Y.jsxs)(`div`,{className:P(`flex w-full items-start gap-3`,l),"data-testid":`navigation-item-editor`,...u,children:[(0,Y.jsx)(`div`,{className:`flex flex-1 pt-1`,children:(0,Y.jsx)(I,{className:s,containerClassName:`grow`,error:!!t.errors.label,hint:t.errors.label,placeholder:a,title:`Label`,unstyled:o,value:t.label,hideTitle:!0,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`)}})}),(0,Y.jsx)(`div`,{className:`flex flex-1 pt-1`,children:(0,Y.jsx)(fe,{baseUrl:e,className:s,containerClassName:`grow`,error:!!t.errors.url,hint:t.errors.url,title:`URL`,unstyled:o,value:t.url,hideTitle:!0,onChange:e=>n?.({url:e||``}),onKeyDown:t=>{let r=ye(t.target.value,e,!0);n?.({url:r.save||``})},onKeyUp:a=>{if(a.key===`Enter`){a.preventDefault();let t=ye(a.target.value,e,!0);n?.({url:t.save||``}),r?.()}t.errors.url&&i?.(`url`)}})}),c]}),yc=({baseUrl:e,navigation:t})=>(0,Y.jsxs)(`div`,{className:`w-full pt-2`,children:[(0,Y.jsx)(mt,{items:t.items,itemSeparator:!1,renderItem:n=>(0,Y.jsx)(vc,{action:(0,Y.jsx)(q,{className:`mt-1 self-center`,icon:`trash`,iconColorClass:`dark:text-white`,size:`sm`,onClick:()=>t.removeItem(n.id)}),baseUrl:e,clearError:e=>t.clearError(n.id,e),item:n,updateItem:e=>t.updateItem(n.id,e)}),onMove:t.moveItem}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(f,{colorClass:`text-grey-300 dark:text-grey-900 mt-1`,name:`add`,size:`sm`}),(0,Y.jsx)(vc,{action:(0,Y.jsx)(q,{className:`mx-2 mt-1 self-center rounded bg-green p-1`,"data-testid":`add-button`,icon:`add`,iconColorClass:`text-white`,size:`sm`,unstyled:!0,onClick:t.addItem}),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})]})]}),bc=O.create(()=>{let e=N(),{updateRoute:t}=W(),{localSettings:n,updateSetting:r,saveState:i,handleSave:a,siteData:o}=be(),[s,c]=Fn(n,[`navigation`,`secondary_navigation`]).map(e=>JSON.parse(e||`[]`)),l=_c({items:s,setItems:e=>{r(`navigation`,JSON.stringify(e))}}),u=_c({items:c,setItems:e=>r(`secondary_navigation`,JSON.stringify(e))}),[d,f]=(0,J.useState)(`primary-nav`);return(0,Y.jsx)(L,{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()=>{l.validate()&&u.validate()&&(await a(),e.remove(),t(`navigation`))},children:(0,Y.jsx)(`div`,{className:`mt-6 mb-1`,children:(0,Y.jsx)(Xe,{selectedTab:d,tabs:[{id:`primary-nav`,title:`Primary`,contents:(0,Y.jsx)(yc,{baseUrl:o.url,navigation:l})},{id:`secondary-nav`,title:`Secondary`,contents:(0,Y.jsx)(yc,{baseUrl:o.url,navigation:u})}],onTabChange:f})})})});``+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 xc=({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:p,authorPlaceholder:m,showCommentCta:h,showFeatureImage:g,showFeedback:_,showShareButton:v,showLatestPosts:y,showSubscriptionDetails:b,siteTitle:x,footerContent:S,showBadge:C,backgroundColor:w,headerBackgroundColor:T,accentColor:E,textColor:D,secondaryTextColor:O,headerTextColor:k,secondaryHeaderTextColor:A,postTitleColor:j,sectionTitleColor:M,dividerColor:N,buttonColor:F,buttonTextColor:I,linkColor:L,buttonCorners:R,buttonStyle:z,imageCorners:B,linkStyle:ee,dividerStyle:V})=>{let te=i||a,{config:ne}=K(),H=new Date().toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`numeric`}),re=new Date().getFullYear(),ie=S?S.replace(/<a/g,`<a target="_blank" rel="noopener noreferrer"`):``,ae;ae=Mn(ne)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`From: `}),(0,Y.jsxs)(`span`,{children:[e,` (`,t,`)`]})]}),(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`Reply-to: `}),n||t]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:e}),(0,Y.jsxs)(`span`,{children:[` `,t]})]}),(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`To:`}),` Jamie Larson jamie@example.com`]})]});let oe=`mb-5 text-pretty leading-[1.7] text-black`;return oe=u===`serif`&&p===`serif`?P(oe,`mb-8 font-serif text-[2.0rem] leading-tight`):u!==`serif`&&p===`serif`?P(oe,`mb-8 text-[1.7rem] leading-tight tracking-tight`):u===`serif`&&p!==`serif`?P(oe,`mb-8 font-serif text-[2.0rem] leading-tight`):P(oe,`mb-8 text-[1.9rem] leading-tight tracking-tight`),l===`center`&&(oe=P(oe,`text-center`)),(0,Y.jsx)(`div`,{className:`relative flex grow flex-col`,children:(0,Y.jsx)(`div`,{className:`absolute inset-0 m-5 flex items-center justify-center`,children:(0,Y.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,Y.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:ae}),(0,Y.jsxs)(`div`,{className:`overflow-y-auto`,style:{backgroundColor:w},children:[(0,Y.jsxs)(`div`,{className:`px-[7rem]`,style:{backgroundColor:T},children:[r&&(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`img`,{alt:``,className:`mb-4 block pt-6`,src:r})}),te&&(0,Y.jsxs)(`div`,{className:`py-3`,children:[i&&(0,Y.jsx)(`img`,{alt:``,className:`mx-auto mb-2 size-10`,role:`presentation`,src:i}),a&&(0,Y.jsx)(`h4`,{className:`mb-1 text-center text-[1.6rem] leading-tight font-bold tracking-tight text-grey-900 uppercase`,style:{color:k},children:a}),o&&(0,Y.jsx)(`h5`,{className:`mb-1 text-center text-[1.3rem] font-normal text-grey-700`,style:{color:A},children:o})]}),s&&(0,Y.jsxs)(`div`,{className:P(`flex flex-col py-8`,l===`center`?`items-center`:`items-start`),children:[(0,Y.jsx)(`h2`,{className:P(`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:j},children:`Your email newsletter`}),c&&(0,Y.jsx)(`p`,{className:oe,style:{color:k},children:`A subtitle to highlight key points and engage your readers.`}),(0,Y.jsxs)(`div`,{className:P(`flex w-full justify-between text-center text-md leading-none text-grey-700`,l===`center`?`flex-col gap-1`:`flex-row`),children:[(0,Y.jsxs)(`p`,{className:`pb-1 text-[1.3rem]`,style:{color:A},children:[`By `,m,(0,Y.jsx)(`span`,{className:`before:pr-1 before:pl-0.5 before:content-['•']`,children:H})]}),(0,Y.jsx)(`p`,{className:`pb-1 text-[1.3rem] underline`,style:{color:A},children:(0,Y.jsx)(`span`,{children:`View in browser`})})]})]}),g&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:P(`h-[unset] w-full max-w-[600px] bg-cover bg-no-repeat`,s?``:`pt-6`),children:(0,Y.jsx)(`img`,{alt:`Feature`,className:P(`min-h-full min-w-full shrink-0`,B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`user-cover-yM4cP_Mo.jpg`,import.meta.url).href})}),(0,Y.jsx)(`div`,{className:`mt-1 w-full max-w-[600px] pb-8 text-center text-[1.3rem] text-grey-700`,style:{color:A},children:`Feature image caption`})]})]}),(0,Y.jsxs)(`div`,{className:P(`px-[7rem]`,T!==`transparent`&&`pt-10`),children:[(0,Y.jsxs)(`div`,{className:P(`max-w-[600px] border-b border-grey-200 pb-[52px] leading-[27.2px] text-black`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`,p===`serif`?`font-serif text-[1.8rem]`:`text-[1.7rem] tracking-tight`,g||s?``:`pt-8`),style:{borderColor:N},children:[(0,Y.jsx)(`p`,{className:`mb-6`,style:{color:D},children:`This is what your content will look like when you send one of your posts as an email newsletter to your subscribers.`}),(0,Y.jsx)(`p`,{className:`mb-6`,style:{color:D},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,Y.jsx)(`p`,{className:`mb-[52px]`,style:{color:D},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,Y.jsx)(`hr`,{className:P(`my-[52px] border-[#e0e7eb]`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-t-0 border-b-2 border-dotted`),style:{borderColor:N}}),(0,Y.jsx)(`h3`,{className:P(`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:M},children:`Need inspiration?`}),(0,Y.jsxs)(`p`,{className:`mb-[27px]`,style:{color:D},children:[`We've put together a `,(0,Y.jsx)(`a`,{className:P(ee===`underline`&&`underline`,ee===`bold`&&`font-bold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:{color:L||E},target:`_blank`,children:`quick guide`}),` that walks through all of the available settings, along with a few examples of what's possible.`]}),(0,Y.jsx)(`a`,{className:P(`inline-block border px-[18px] py-2 font-sans text-[15px]`,R===`rounded`&&`rounded-[6px]`,R===`pill`&&`rounded-full`,R===`square`&&`rounded-none`,z===`outline`?`bg-transparent`:`border-transparent text-white`,ee===`bold`?`font-bold`:`font-semibold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:z===`outline`?{borderColor:F||E,color:F||E}:{backgroundColor:F||E,color:I},target:`_blank`,children:`Learn more`})]}),(_||h||v)&&(0,Y.jsx)(`div`,{className:P(`grid gap-5 border-b border-grey-200 px-6 py-5`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:(0,Y.jsxs)(`div`,{className:`grid auto-cols-fr grid-flow-col gap-4`,children:[_&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`thumbs-up`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`More like this`})]}),(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`thumbs-down`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Less like this`})]})]}),h&&(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`comment`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Comment`})]}),v&&(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`share`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Share`})]})]})}),y&&(0,Y.jsxs)(`div`,{className:P(`border-b border-grey-200 py-6`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:[(0,Y.jsx)(`h3`,{className:`mt-2 mb-4 pb-1 text-[1.2rem] font-semibold tracking-wide text-black uppercase`,style:{color:D},children:`Keep reading`}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`The three latest posts published on your site`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Posts sent as an email only will never be shown here.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-1-D7-ilqhR.jpg`,import.meta.url).href})})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`Displayed at the bottom of each newsletter`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Giving your readers one more place to discover your stories.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-2-BPfbGB8B.jpg`,import.meta.url).href})})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`To keep your work front and center`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Making sure that your audience stays engaged.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-3-D72O3dn8.jpg`,import.meta.url).href})})]})]}),b&&(0,Y.jsxs)(`div`,{className:P(`border-b border-grey-200 py-8`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:[(0,Y.jsx)(`h4`,{className:`mb-3 text-[1.2rem] tracking-wide text-black uppercase`,style:{color:D},children:`Subscription details`}),(0,Y.jsxs)(`p`,{className:`m-0 mb-4 text-base`,style:{color:D},children:[`You are receiving this because you are a paid subscriber to `,x,`. Your subscription will renew on 17 Jul 2024.`]}),(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsxs)(`div`,{className:`shrink-0 text-base`,children:[(0,Y.jsx)(`p`,{style:{color:D},children:`Name: Jamie Larson`}),(0,Y.jsx)(`p`,{style:{color:D},children:`Email: jamie@example.com`}),(0,Y.jsx)(`p`,{style:{color:D},children:`Member since: 17 July 2023`})]}),(0,Y.jsx)(`span`,{className:P(`w-full self-end text-right text-base whitespace-nowrap`,ee===`underline`&&`underline`,ee===`bold`&&`font-bold`),style:{color:L||E},children:`Manage subscription`})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center pt-10`,children:[(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:ie||``},className:`text px-8 py-3 text-center text-[1.3rem] leading-base break-words text-grey-700 [&_a]:underline`,style:{color:O}}),(0,Y.jsxs)(`div`,{className:`px-8 pt-3 pb-14 text-center text-[1.3rem] text-grey-700`,children:[(0,Y.jsxs)(`span`,{style:{color:O},children:[x,` © `,re,` — `]}),(0,Y.jsx)(`span`,{className:`pointer-events-none cursor-auto underline`,style:{color:O},children:`Unsubscribe`})]}),C&&(0,Y.jsx)(`div`,{className:`flex flex-col items-center pt-[10px] pb-[40px]`,children:(0,Y.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:D},children:[(0,Y.jsx)(We,{className:`mr-[6px] size-4`}),(0,Y.jsx)(`span`,{children:`Powered by Ghost`})]})})]})]})]})]})})})},Sc=({newsletter:e})=>{let{currentUser:t,settings:n,siteData:r,config:i}=K(),[a,o,s,c,l]=Fn(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?Ve(h()).hex():r.accent_color},v=()=>{let t=e.button_style,n=_();if(n&&t===`fill`)return Ve(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:Ve(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 Ve(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:Ve(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=Ve(h()).hex(),w=Ve(h()).alpha(.5).toString(),T=g()===`transparent`?C:Ve(g()).hex(),E=g()===`transparent`?w:Ve(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,Y.jsx)(xc,{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:Ze(e,i,l),senderName:e.sender_name||a,senderReplyTo:Re(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})},Cc=({newsletter:e,updateNewsletter:t,errors:n,clearError:r})=>{let{settings:i,config:a}=K(),[o,s]=Fn(i,[`default_email_address`,`support_email_address`]),[c,l]=(0,J.useState)(Re(e,a,s,o)||``),u=Ze(e,a,o),d=(0,J.useCallback)(e=>{l(e.target.value),t({sender_reply_to:e.target.value||`newsletter`})},[t,l]);return(0,Y.jsx)(I,{error:!!n.sender_reply_to,hint:n.sender_reply_to,maxLength:191,placeholder:u||``,title:`Reply-to email`,value:c,onBlur:()=>{let t=Re(e,a,s,o)||``;l(t)},onChange:d,onKeyDown:()=>r(`sender_reply_to`)})},wc=({newsletter:e,onlyOne:t,updateNewsletter:n,validate:r,errors:i,clearError:a})=>{let{updateRoute:o}=W(),{mutateAsync:s}=Zn(),c=ve(),{settings:l,config:u,siteData:d}=K(),[m,h]=Fn(l,[`icon`,`default_email_address`]),{mutateAsync:_}=pt(),[v,y]=(0,J.useState)(`generalSettings`),{localSettings:b}=be(),[x]=Fn(b,[`title`]),S=g(),{data:{newsletters:C}={}}=$n(),w=[`all`,`paid`].includes(Nn(l,`comments_enabled`)||``),T=Ze(e,u,h),[k,j]=(0,J.useState)(C||[]),M=k.filter(e=>e.status===`active`);(0,J.useEffect)(()=>{j(C||[])},[C]);let N=[{value:`serif`,label:`Elegant serif`,className:`font-serif`},{value:`sans_serif`,label:`Clean sans-serif`}],P={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`}}},F=()=>e.background_color===`light`?!1:Ve(e.background_color).hex().toLowerCase()===`#ffffff`,L=async()=>{if(e.status===`active`)O.show(me,{title:`Archive newsletter`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`mb-6`,children:[`Your newsletter `,(0,Y.jsx)(`strong`,{children:e.name}),` will no longer be visible to members or available as an option when publishing new posts.`]}),(0,Y.jsx)(`div`,{children:`Existing posts previously sent as this newsletter will remain unchanged.`})]}),okLabel:`Archive`,okColor:`red`,onOk:async t=>{try{await s({...e,status:`archived`}),t?.remove(),p({type:`success`,message:`Newsletter archived`})}catch(e){S(e)}}});else{try{await c?.errorIfWouldGoOverLimit(`newsletters`)}catch(e){if(e instanceof de){O.show(he,{prompt:e.message||`Your current plan doesn't support more newsletters.`,onOk:()=>o({route:`/pro`,isExternal:!0})});return}else throw e}O.show(me,{title:`Reactivate newsletter`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Reactivating `,(0,Y.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(),p({type:`success`,message:`Newsletter reactivated`})}})}},R=()=>{if(!Mn(u))return(0,Y.jsx)(I,{error:!!i.sender_email,hint:i.sender_email,placeholder:T||``,title:`Sender email address`,value:e.sender_email||``,onChange:e=>n({sender_email:e.target.value}),onKeyDown:()=>a(`sender_email`)});if(Gn(u))return(0,Y.jsx)(I,{error:!!i.sender_email,hint:i.sender_email,maxLength:191,placeholder:h,title:`Sender email address`,value:e.sender_email||``,onChange:e=>{n({sender_email:e.target.value})},onKeyDown:()=>a(`sender_email`)})},B=P[e.title_font_category||`sans_serif`].options,ee=[{id:`generalSettings`,title:`General`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Name and description`,children:[(0,Y.jsx)(I,{error:!!i.name,hint:i.name,maxLength:191,placeholder:`Weekly Roundup`,title:`Name`,value:e.name||``,onChange:e=>n({name:e.target.value}),onKeyDown:()=>a(`name`)}),(0,Y.jsx)(z,{maxLength:2e3,rows:2,title:`Description`,value:e.description||``,onChange:e=>n({description:e.target.value})})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Email info`,children:[(0,Y.jsx)(I,{maxLength:191,placeholder:x,title:`Sender name`,value:e.sender_name||``,onChange:e=>n({sender_name:e.target.value})}),R(),(0,Y.jsx)(Cc,{clearError:a,errors:i,newsletter:e,updateNewsletter:n,validate:r})]}),(0,Y.jsx)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Member settings`,children:(0,Y.jsx)(vt,{checked:e.subscribe_on_signup,direction:`rtl`,label:`Subscribe new members on signup`,labelStyle:`value`,onChange:e=>n({subscribe_on_signup:e.target.checked})})}),(0,Y.jsx)(`div`,{className:`mt-10 mb-5`,children:e.status===`active`?!t&&(0,Y.jsx)(q,{color:`red`,disabled:M.length===1,label:`Archive newsletter`,link:!0,onClick:L}):(0,Y.jsx)(q,{color:`green`,label:`Reactivate newsletter`,link:!0,onClick:L})})]})},{id:`content`,title:`Content`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Header`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(A,{className:`mb-2`,level:6,children:`Header image`})}),(0,Y.jsxs)(`div`,{className:`flex-column flex gap-1`,children:[(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,height:e.header_image?`66px`:`64px`,id:`logo`,imageURL:e.header_image||void 0,onDelete:()=>{n({header_image:null})},onUpload:async e=>{try{n({header_image:Ne(await _({file:e}))})}catch(e){S(e)}},children:(0,Y.jsx)(f,{colorClass:`text-grey-700 dark:text-grey-300`,name:`picture`})}),(0,Y.jsx)(E,{children:`1200×600 recommended. Use a transparent PNG for best results on any background.`})]})]}),(0,Y.jsxs)(Ni,{children:[m&&(0,Y.jsx)(vt,{checked:e.show_header_icon,direction:`rtl`,label:`Publication icon`,onChange:e=>n({show_header_icon:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_header_title,direction:`rtl`,label:`Publication title`,onChange:e=>n({show_header_title:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_header_name,direction:`rtl`,label:`Newsletter name`,onChange:e=>n({show_header_name:e.target.checked})})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Title section`,children:[(0,Y.jsx)(vt,{checked:e.show_post_title_section,direction:`rtl`,label:`Post title`,onChange:e=>n({show_post_title_section:e.target.checked})}),e.show_post_title_section&&(0,Y.jsx)(vt,{checked:e.show_excerpt,direction:`rtl`,label:`Post excerpt`,onChange:e=>n({show_excerpt:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_feature_image,direction:`rtl`,label:`Feature image`,onChange:e=>n({show_feature_image:e.target.checked})})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Footer`,children:[(0,Y.jsxs)(Ni,{gap:`lg`,children:[(0,Y.jsx)(vt,{checked:e.feedback_enabled,direction:`rtl`,label:`Ask your readers for feedback`,onChange:e=>n({feedback_enabled:e.target.checked})}),w&&(0,Y.jsx)(vt,{checked:e.show_comment_cta,direction:`rtl`,label:`Add a link to your comments`,onChange:e=>n({show_comment_cta:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_share_button,direction:`rtl`,label:`Show share button`,onChange:e=>n({show_share_button:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_latest_posts,direction:`rtl`,label:`Share your latest posts`,onChange:e=>n({show_latest_posts:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_subscription_details,direction:`rtl`,label:`Show subscription details`,onChange:e=>n({show_subscription_details:e.target.checked})})]}),(0,Y.jsx)(Zr,{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,Y.jsx)(D,{}),(0,Y.jsxs)(`div`,{className:`my-5 flex w-full items-start`,children:[(0,Y.jsx)(`span`,{children:(0,Y.jsx)(f,{className:`mt-[-1px] mr-2`,colorClass:`text-red`,name:`heart`})}),(0,Y.jsx)(U,{marginBottom:!1,children:(0,Y.jsx)(vt,{checked:e.show_badge,direction:`rtl`,label:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`md:text-base`,children:`Promote independent publishing`}),(0,Y.jsx)(`span`,{className:`text-[11px] leading-tight text-grey-700 md:text-sm md:leading-tight`,children:`Show you're a part of the indie publishing movement with a small badge in the footer`})]}),labelStyle:`value`,onChange:e=>n({show_badge:e.target.checked})})})]})]})},{id:`design`,title:`Design`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Global`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Heading font`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:N,selectedOption:N.find(t=>t.value===e.title_font_category),onSelect:t=>{let r=t?.value||`sans_serif`,i=e.title_font_weight,a=i;return P[r].options.find(e=>e.value===i)||(a=P[r].map?.[i]||`bold`),n({title_font_category:r,title_font_weight:a})}})]}),(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Heading weight`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:B,selectedOption:(()=>{let t=e.title_font_category||`sans_serif`,n=e.title_font_weight,r=P[t].map,i=r&&r[n]||n;return B.find(e=>e.value===i)||B[0]})(),onSelect:e=>n({title_font_weight:e?.value})})]}),(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Body font`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:N,selectedOption:N.find(t=>t.value===e.body_font_category),testId:`body-font-select`,onSelect:e=>n({body_font_category:e?.value})})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Header`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:F()?`#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,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Title alignment`}),(0,Y.jsx)(re,{activeKey:e.title_alignment,buttons:[{key:`left`,icon:`align-left`,iconSize:14,label:`Align left`,tooltip:`Left`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({title_alignment:`left`}),disabled:!e.show_post_title_section},{key:`center`,icon:`align-center`,iconSize:14,label:`Align center`,tooltip:`Center`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({title_alignment:`center`}),disabled:!e.show_post_title_section}],clearBg:!1})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Body`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:F()?`#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,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:F()?`#ffffff`:`#000000`}],title:`Button color`,value:e.button_color,onChange:e=>n({button_color:e})})}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Button style`}),(0,Y.jsx)(re,{activeKey:e.button_style||`fill`,buttons:[{key:`fill`,icon:`squircle-fill`,iconSize:14,label:`Fill`,tooltip:`Fill`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_style:`fill`})},{key:`outline`,icon:`squircle`,iconSize:14,label:`Outline`,tooltip:`Outline`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_style:`outline`})}],clearBg:!1})]}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Button corners`}),(0,Y.jsx)(re,{activeKey:e.button_corners||`rounded`,buttons:[{key:`square`,icon:`square`,iconSize:14,label:`Square`,tooltip:`Squared`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`square`})},{key:`rounded`,icon:`squircle`,iconSize:14,label:`Rounded`,tooltip:`Rounded`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`rounded`})},{key:`pill`,icon:`circle`,iconSize:14,label:`Pill`,tooltip:`Pill`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`pill`})}],clearBg:!1})]}),(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:F()?`#ffffff`:`#000000`}],title:`Link color`,value:e.link_color,onChange:e=>n({link_color:e})})}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Link style`}),(0,Y.jsx)(re,{activeKey:e.link_style||`underline`,buttons:[{key:`underline`,icon:`text-underline`,iconSize:14,label:`Underline`,tooltip:`Underline`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`underline`})},{key:`regular`,icon:`text-regular`,iconSize:14,label:`Regular`,tooltip:`Regular`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`regular`})},{key:`bold`,icon:`text-bold`,iconSize:14,label:`Bold`,tooltip:`Bold`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`bold`})}],clearBg:!1})]}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Image corners`}),(0,Y.jsx)(re,{activeKey:e.image_corners||`square`,buttons:[{key:`square`,icon:`square`,iconSize:14,label:`Square`,tooltip:`Squared`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({image_corners:`square`})},{key:`rounded`,icon:`squircle`,iconSize:14,label:`Rounded`,tooltip:`Rounded`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({image_corners:`rounded`})}],clearBg:!1})]}),(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsx)(`div`,{className:`flex flex-col`,children:(0,Y.jsx)(`div`,{className:`px-7 pt-0 pb-7`,children:(0,Y.jsx)(Xe,{selectedTab:v,stickyHeader:!0,tabs:ee,onTabChange:e=>{y(e)}})})})},Tc=({newsletter:e,onlyOne:t})=>{let{config:n}=K(),{mutateAsync:r}=Zn(),{updateRoute:i}=W(),a=ce(`automations`)?`emails`:`newsletters`,{formState:o,saveState:s,updateForm:c,setFormState:l,handleSave:u,validate:d,errors:f,clearError:m,okProps:h}=jt({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,Y.jsx)(`div`,{children:`We‘ve sent a confirmation email to the new address.`})),t&&p({icon:`email`,message:t,type:`info`})},onSaveError:g(),onValidate:()=>{let e={};return o.name||(e.name=`A name is required for your newsletter`),o.sender_email&&!ua.default.isEmail(o.sender_email)?e.sender_email=`Enter a valid email address`:o.sender_email&&Gn(n)&&o.sender_email.split(`@`)[1]!==Pn(n)&&(e.sender_email=`Email address must end with @${Pn(n)}`),o.sender_reply_to&&!ua.default.isEmail(o.sender_reply_to)&&![`newsletter`,`support`].includes(o.sender_reply_to)&&(e.sender_reply_to=`Enter a valid email address`),e}}),_=e=>{c(t=>({...t,...e}))};(0,J.useEffect)(()=>{l(()=>e)},[l,e]);let v=(0,Y.jsx)(Sc,{newsletter:o}),y=(0,Y.jsx)(wc,{clearError:m,errors:f,newsletter:o,onlyOne:t,updateNewsletter:_,validate:d});return(0,Y.jsx)(Ii,{afterClose:()=>i(a),buttonsDisabled:h.disabled,cancelLabel:`Close`,deviceSelector:!1,dirty:s===`unsaved`,okColor:h.color,okLabel:h.label||`Save`,preview:v,previewBgColor:`grey`,previewToolbar:!1,sidebar:y,sidebarPadding:!1,testId:`newsletter-modal`,title:`Newsletter`,onOk:async()=>{await u({fakeWhenUnchanged:!0})}})},Ec=O.create(({params:e})=>{let{data:{newsletters:t,isEnd:n}={},fetchNextPage:r}=$n(),i=t?.find(({id:t})=>t===e?.id);return(0,J.useEffect)(()=>{!i&&!n&&r()},[r,n,i]),i?(0,Y.jsx)(Tc,{newsletter:i,onlyOne:t.length===1}):null}),Dc=({id:e})=>{let{updateRoute:t}=W(),{data:{offers:n=[]}={}}=It(e||``),[r,i]=(0,J.useState)(),[a,o]=(0,J.useState)(``),{siteData:s}=K();(0,J.useEffect)(()=>{if(n.length>0){let e=n[0],t=`${jn(s)}${e?.code}`;o(t),i(e)}},[n,s]);let[c,l]=(0,J.useState)(!1),u=()=>{let e=``;switch(r?.type){case`percent`:e=r?.amount+`% discount`;break;case`fixed`:e=H(Ye(r?.amount))+` `+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,Y.jsx)(L,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,footer:!1,height:`full`,size:`lg`,testId:`offer-success-modal`,topRightContent:`close`,width:1140,children:(0,Y.jsxs)(`div`,{className:`-mt-6 flex h-full flex-col items-center justify-center text-center`,children:[(0,Y.jsx)(`div`,{className:`absolute top-5 left-6`,children:(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:block! md:visible!`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:block! md:visible!`,items:[{label:`Offers`,onClick:()=>{t(`offers/edit`)}},{label:r?.name||``}],separatorClassName:`hidden md:block! md:visible!`,backIcon:!0,onBack:()=>{t(`offers/edit`)}})}),(0,Y.jsx)(f,{colorClass:`text-grey-700 -mt-4`,name:`tags-check`,size:`xl`}),(0,Y.jsx)(`h1`,{className:`mt-6 text-4xl`,children:`Your new offer is live!`}),(0,Y.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,Y.jsxs)(`div`,{className:`mt-8 flex w-full max-w-md flex-col gap-8`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse gap-2`,children:[(0,Y.jsx)(I,{name:`offer-url`,type:`url`,value:a,disabled:!0}),(0,Y.jsx)(q,{color:`green`,label:c?`Copied!`:`Copy link`,fullWidth:!0,onClick:async()=>{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}})]}),(0,Y.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,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`twitter-x`,iconColorClass:`w-[14px] h-[14px]`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`https://twitter.com/intent/tweet?url=${encodeURI(a)}&text=${u()}`,`_blank`)}}),(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`facebook`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(a)}`,`_blank`)}}),(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`linkedin`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`http://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(a)}&title=${u()}`,`_blank`)}})]})]})]})})},Oc=({href:e,onDestroyed:t,selectedTab:n,portalParent:r})=>{n||=`signup`;let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!0),l=(0,J.useCallback)(()=>{setTimeout(()=>{i.current&&c(!1)},300)},[i]);if((0,J.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,Y.jsxs)(Y.Fragment,{children:[s&&(0,Y.jsx)(`div`,{className:u,children:(0,Y.jsx)(`span`,{children:(0,Y.jsx)(Fe,{})})}),(0,Y.jsx)(`iframe`,{ref:i,className:!s&&a?``:d,"data-testid":`portal-preview`,height:`100%`,src:e,title:`Portal Preview`,width:`100%`,onLoad:()=>{o(!0)}})]})},kc=(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()}`},Ac=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 jc(e){return e.toString().toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\w-]+/g,``).replace(/--+/g,`-`)}var Mc=191,Nc=({type:e,checked:t,onClick:n})=>(0,Y.jsx)(`button`,{className:`text-left`,type:`button`,onClick:n,children:(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Y.jsx)(`div`,{className:`mt-0.5 flex size-4 items-center justify-center rounded-full ${t?`bg-black text-white dark:bg-white dark:text-black`:`border border-grey-300 dark:border-grey-800`}`,children:t?(0,Y.jsx)(f,{className:`w-[7px] stroke-[4]`,name:`check`,size:`custom`}):null}),(0,Y.jsxs)(`div`,{className:`-mt-px flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,Y.jsx)(`span`,{className:`text-gray-700`,children:e.description})]})]})}),Pc=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}},Fc=({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,J.useState)(0),w=S>40?`text-red`:`text-green`,{siteData:T}=K(),[E,D]=(0,J.useState)(!1),O=jn(T),k=`${O}${s.code.value}`;return(0,Y.jsx)(`div`,{className:`pt-7`,"data-testId":_,children:(0,Y.jsxs)(U,{children:[(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{error:!!g.name,hint:g.name||(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Y.jsxs)(`strong`,{children:[(0,Y.jsx)(`span`,{className:`${w}`,children:S}),` / 40`]})]}),maxLength:40,placeholder:`Black Friday`,title:`Offer name`,onChange:e=>{l(e),C(e.target.value.length)},onKeyDown:()=>h(`name`)}),(0,Y.jsx)(I,{error:!!g.displayTitle,hint:g.displayTitle,maxLength:Mc,placeholder:`Black Friday Special`,title:`Display title`,value:s.displayTitle.value,onChange:e=>{d(e)},onKeyDown:()=>h(`displayTitle`)}),(0,Y.jsx)(z,{maxLength:Mc,placeholder:`Take advantage of this limited-time offer.`,title:`Display description`,value:s.displayDescription,onChange:e=>{u(e)}})]})]}),(0,Y.jsxs)(`section`,{className:`mt-4`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-md border border-grey-200 p-4 dark:border-grey-800`,children:[(0,Y.jsx)(Nc,{checked:s.type!==`trial`,type:r[0],onClick:()=>{a(`percent`)}}),(0,Y.jsx)(Nc,{checked:s.type===`trial`,type:r[1],onClick:()=>{a(`trial`)}})]}),(0,Y.jsx)(Te,{options:e,selectedOption:n,testId:`tier-cadence-select-offers`,title:`Tier —\xA0Cadence`,onSelect:e=>{e&&t(e)}}),s.type!==`trial`&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(I,{error:!!g.amount,hint:g.amount,title:`Amount off`,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,Y.jsx)(`div`,{className:`absolute top-6 right-1.5 z-10`,children:(0,Y.jsx)(Te,{clearBg:!0,controlClasses:{menu:`w-20 right-0`},options:y,selectedOption:s.type===`percent`?y[0]:y[1],testId:`amount-type-select-offers`,onSelect:e=>{c(e?.value||``)}})})]}),(0,Y.jsx)(Te,{options:x,selectedOption:x.find(e=>e.value===s.duration),testId:`duration-select-offers`,title:`Duration`,onSelect:e=>{h(`durationInMonths`),o(e?.value||``)}}),s.duration===`repeating`&&!b&&(0,Y.jsx)(`div`,{className:`-mt-4`,children:(0,Y.jsx)(I,{"data-testid":`duration-months-input`,error:!!g.durationInMonths,hint:g.durationInMonths,rightPlaceholder:`${s.durationInMonths===1?`month`:`months`}`,type:`number`,value:s.durationInMonths===0?``:String(s.durationInMonths),onChange:e=>{f(e)},onKeyDown:()=>h(`durationInMonths`)})})]}),s.type===`trial`&&(0,Y.jsx)(I,{error:!!g.amount,hint:g.amount,title:`Trial duration`,type:`number`,value:s.trialAmount?.toString(),onChange:e=>{v(e)},onKeyDown:()=>h(`amount`)}),(0,Y.jsx)(I,{error:!!g.code,hint:g.code||(s.code.value===``?null:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[O,(0,Y.jsx)(`span`,{className:`font-bold`,children:s.code.value})]}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(q,{className:`text-sm`,color:`green`,label:`${E?`Copied`:`Copy`}`,size:`sm`,link:!0,onClick:async()=>{await navigator.clipboard.writeText(k),D(!0),setTimeout(()=>D(!1),2e3)}})]})),placeholder:`black-friday`,title:`Offer code`,value:s.code.value,onChange:e=>{m(e)},onKeyDown:()=>h(`code`)})]})]})]})})},Ic=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}},Lc=()=>{let{siteData:e}=K(),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,J.useState)(``),{updateRoute:a}=W(),{data:{tiers:o}={}}=tr(),s=rr(o||[]),l=Ac(s),{mutateAsync:u}=Lt(),[d,f]=(0,J.useState)({tier:l[0]||{},dataset:{id:l[0]?.value?Ic(l[0]?.value).id:``,period:l[0]?.value?Ic(l[0]?.value).period:``,currency:l[0]?.value?Ic(l[0]?.value).currency:``}}),{data:{offers:m=[]}={}}=Ft(),{formState:h,updateForm:g,handleSave:_,saveState:v,okProps:y,validate:b,errors:x,clearError:S}=jt({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=h.type===`trial`?`trial`:h.duration,t={name:h.name,code:h.code.value,display_title:h.displayTitle.value,display_description:h.displayDescription,cadence:h.cadence,amount:Pc(h)||0,duration:e,...e===`repeating`?{duration_in_months:h.durationInMonths}:{},currency:h.currency,status:h.status,redemption_type:`signup`,tier:{id:h.tierId},type:h.type,currency_restriction:!1},n=await u(t);n&&n.offers&&n.offers.length>0&&a(`offers/success/${n.offers[0].id}`)},onSaveError:()=>{},onValidate:()=>{let e={};return!h.name&&h.name.length===0&&(e.name=`Name is required`),!h.code.value&&h.code.value.length===0&&(e.code=`Code is required`),!h.displayTitle.value&&h.displayTitle.value.length===0&&(e.displayTitle=`Display title is required`),h.type===`percent`&&h.percentAmount===0&&(e.amount=`Enter an amount greater than 0.`),h.type===`percent`&&(h.percentAmount<1||h.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),(h.type===`fixed`&&h.fixedAmount===0||h.type===`fixed`&&h.fixedAmount<1)&&(e.amount=`Enter an amount greater than 0.`),h.type===`trial`&&h.trialAmount===0&&(e.amount=`Enter an amount greater than 0.`),h.type===`trial`&&h.trialAmount<1&&(e.amount=`Free trial must be at least 1 day.`),h.type!==`trial`&&h.duration===`repeating`&&(!Number.isInteger(h.durationInMonths)||h.durationInMonths<1)&&(e.durationInMonths=`Enter a whole number of months (1 or more).`),e},savingDelay:500}),C=[{value:`percent`,label:`%`},{value:`fixed`,label:h.currency}],w=e=>{let t=Ic(e.value),n=t.period===`year`;f({tier:e,dataset:t}),g(e=>({...e,cadence:t.period,currency:t.currency,tierId:t.id,duration:n&&e.duration===`repeating`?`once`:e.duration})),n&&S(`durationInMonths`)},T=e=>{e===`trial`&&(S(`amount`),S(`durationInMonths`)),g(t=>({...t,type:e}))},E=e=>{g(t=>({...t,type:e===`percent`?`percent`:`fixed`}))},D=e=>{let t=e.target;h.type===`fixed`?g(e=>({...e,fixedAmount:Number(t.value)})):h.type===`percent`?g(e=>({...e,percentAmount:Number(t.value)})):g(e=>({...e,amount:Number(t.value)}))},O=e=>{let t=e.target,n=Number(t.value);g(e=>({...e,durationInMonths:Number.isNaN(n)?0:n}))},k=e=>{let t=e.target.value;g(e=>{let n={...e};return n.name=t,e.code.isDirty||(S(`code`),n.code={...e.code,value:jc(t)}),e.displayTitle.isDirty||(S(`displayTitle`),n.displayTitle={...e.displayTitle,value:t}),n})},A=e=>{let t=e.target;g(e=>({...e,displayTitle:{...e.displayTitle,isDirty:!0,value:t.value}}))},j=e=>{let t=e.target;g(e=>({...e,displayDescription:t.value}))},M=e=>{let t=e.target;g(e=>({...e,trialAmount:Number(t.value)}))},N=e=>{g(t=>({...t,duration:e}))},P=e=>{let t=e.target;g(e=>({...e,code:{...e.code,isDirty:!0,value:t.value}}))},F=()=>{m.length>0?a(`offers/edit`):a(`offers`)},I=(0,J.useMemo)(()=>({name:h.name||``,code:h.code.value||``,displayTitle:h.displayTitle.value||``,displayDescription:h.displayDescription||``,type:h.type||`percent`,cadence:h.cadence||`month`,amount:Pc(h)||0,duration:h.type===`trial`?`trial`:h.duration||`once`,durationInMonths:h.durationInMonths||0,currency:h.currency||`USD`,status:h.status||`active`,tierId:h.tierId||s[0]?.id,redemptionType:`signup`}),[h,s]);(0,J.useEffect)(()=>{let t=kc(I,e.url);i(t)},[h,e.url,h.type,I]);let L=(0,Y.jsx)(Fc,{amountOptions:C,clearError:S,durationOptions:n,errors:x,handleAmountInput:D,handleAmountTypeChange:E,handleCodeInput:P,handleDisplayTitleInput:A,handleDurationChange:N,handleDurationInMonthsInput:O,handleNameInput:k,handleTextAreaInput:j,handleTierChange:w,handleTrialAmountInput:M,handleTypeChange:T,overrides:h,selectedTier:d.tier,testId:`add-offer-sidebar`,tierOptions:l,typeOptions:t,validate:b}),R=(0,Y.jsx)(Oc,{href:r||``,portalParent:`offers`});return(0,Y.jsx)(Ii,{afterClose:()=>{a(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:v===`unsaved`,height:`full`,okColor:y.color,okLabel:`Publish`,preview:R,previewToolbar:!1,sidebar:L,size:`lg`,testId:`add-offer-modal`,title:`Offer`,width:1140,onCancel:F,onOk:async()=>{if(b(),!Object.values(x).every(e=>!e)){kt.remove(),p({title:`Can't save offer`,type:`info`,message:`Make sure you filled all required fields`});return}try{if(await _({force:!0}))return}catch(e){let t;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),kt.remove(),t&&p({title:`Can't save offer`,type:`error`,message:t||`Please try again later`})}}})},Rc=e=>new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`}),zc=e=>{let t=`offer_redemptions:[${e.join(`,`)}]`;return`/ghost/#/members?filter=${encodeURIComponent(t)}`},Bc=e=>zc([e]),Vc=({amount:e,duration:t})=>e===100&&t===`repeating`,Hc=(e,t)=>`Retention ${e} (${t})`,Uc=({amount:e,duration:t,durationInMonths:n})=>Vc({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`,Wc=(e,t)=>{let n=t.trim(),r=Uc(e),i=Hc(r,n);if(i.length<=40)return i;let a=i.length-40,o=Math.max(3,n.length-a);return Hc(r,n.slice(0,o))};function Gc(e){return new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})}var Kc=({clearError:e,errors:t,offer:n,updateOffer:r})=>{let{siteData:i}=K(),[a,o]=(0,J.useState)(!1),s=g(),{mutateAsync:c}=Pt(),[l,u]=(0,J.useState)(n?.name.length||0),d=l>40?`text-red`:`text-green`,{updateRoute:f}=W();(0,J.useEffect)(()=>{n?.name&&u(n?.name.length)},[n?.name]);let m=jn(i),h=`${m}${n?.code}`,_=async()=>{await navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3)},v=async()=>{n?.status===`active`?O.show(me,{title:`Archive offer`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:`New members will no longer be able to subscribe using this offer.`}),(0,Y.jsxs)(`p`,{children:[`All members that previously redeemed `,(0,Y.jsx)(`strong`,{children:n?.name}),` will remain unchanged.`]})]}),okLabel:`Archive`,okColor:`red`,onOk:async e=>{try{await c({...n,status:`archived`}),e?.remove(),p({type:`success`,title:`Offer archived`}),f(`offers/edit`)}catch(e){s(e)}}}):O.show(me,{title:`Reactivate offer`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`p`,{children:[`Reactivating `,(0,Y.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(),p({type:`success`,title:`Offer reactivated`}),f(`offers/edit`)}catch(e){s(e)}}})};return(0,Y.jsxs)(`div`,{className:`flex grow flex-col pt-2`,children:[(0,Y.jsxs)(U,{className:` grow`,children:[(0,Y.jsx)(`section`,{children:(0,Y.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,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Created on`}),(0,Y.jsx)(`span`,{children:Gc(n?.created_at?n.created_at:``)})]}),(0,Y.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Y.jsxs)(`span`,{children:[n?.redemption_count,` `,n?.redemption_count===1?`redemption`:`redemptions`]})]}),n?.redemption_count>0&&n?.last_redeemed?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Y.jsx)(`span`,{children:Gc(n?.last_redeemed)})]}):null]}),n?.redemption_count>0?(0,Y.jsx)(`a`,{className:`font-semibold text-green`,href:Bc(n?.id),children:`See members →`}):null]})]})}),(0,Y.jsxs)(`section`,{className:`mt-2`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{error:!!t.name,hint:t.name||(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Y.jsxs)(`strong`,{children:[(0,Y.jsx)(`span`,{className:`${d}`,children:l}),` / 40`]})]}),maxLength:40,placeholder:`Black Friday`,title:`Offer name`,value:n?.name,onChange:e=>{u(e.target.value.length),r({name:e.target.value})},onKeyDown:()=>e(`name`)}),(0,Y.jsx)(I,{containerClassName:`group`,error:!!t.code,hint:t.code||(n?.code===``?null:(0,Y.jsxs)(`span`,{className:`truncate text-grey-700`,children:[m,(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:n?.code})]})),placeholder:`black-friday`,rightPlaceholder:n?.code===``?null:(0,Y.jsx)(q,{className:`mt-1 mr-0.5`,color:`green`,label:a?`Copied!`:`Copy link`,size:`sm`,onClick:_}),title:`Offer code`,value:n?.code,onChange:e=>r({code:e.target.value}),onKeyDown:()=>e(`code`)}),(0,Y.jsx)(I,{error:!!t.displayTitle,hint:t.displayTitle,placeholder:`Black Friday Special`,title:`Display title`,value:n?.display_title,onChange:e=>r({display_title:e.target.value}),onKeyDown:()=>e(`displayTitle`)}),(0,Y.jsx)(z,{placeholder:`Take advantage of this limited-time offer.`,title:`Display description`,value:n?.display_description,onChange:e=>r({display_description:e.target.value})})]})]})]}),(0,Y.jsx)(`div`,{className:`mb-2`,children:n?.status===`active`?(0,Y.jsx)(q,{color:`red`,label:`Archive offer`,link:!0,onClick:v}):(0,Y.jsx)(q,{color:`green`,label:`Reactivate offer`,link:!0,onClick:v})})]})},qc=({id:e})=>{let{siteData:t}=K(),{updateRoute:n}=W(),r=g(),{mutateAsync:i}=Pt(),[a,o]=(0,J.useState)(``),{data:{offers:s=[]}={}}=It(e||``),{formState:l,saveState:u,updateForm:d,setFormState:f,handleSave:m,validate:h,errors:_,clearError:v,okProps:y}=jt({initialState:s[0],savingDelay:500,onSave:async()=>{await i(l)},onSaveError:r,onValidate:()=>{let e={};return l?.name||(e.name=`Name is required`),l?.display_title||(e.displayTitle=`Display title is required`),l?.code||(e.code=`Please enter a code`),e}});(0,J.useEffect)(()=>{f(()=>s[0])},[f,s]);let b=(0,Y.jsx)(Kc,{clearError:v,errors:_,offer:l,updateOffer:e=>{d(t=>({...t,...e}))},validate:h});(0,J.useEffect)(()=>{let e=kc({name:l?.name||``,code:l?.code||``,displayTitle:l?.display_title||``,displayDescription:l?.display_description||``,type:l?.type||``,cadence:l?.cadence||``,amount:l?.amount,duration:l?.duration||``,durationInMonths:l?.duration_in_months||0,currency:l?.currency||``,status:l?.status||``,tierId:l?.tier?.id||``,redemptionType:`signup`},t.url);o(e)},[l,t]);let x=(0,Y.jsx)(Oc,{href:a||``,portalParent:`offers`}),S=()=>{n(`offers/edit`)};return s?(0,Y.jsx)(Ii,{afterClose:()=>{n(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:u===`unsaved`,height:`full`,okColor:y.color,okLabel:y.label||`Save`,preview:x,previewToolbarBreadcrumbs:[{label:`Offers`,onClick:S},{label:l?.name||`Offer`}],sidebar:b,size:`lg`,testId:`offer-update-modal`,title:`Offer`,width:1140,onBreadcrumbsBack:S,onCancel:S,onOk:async()=>{try{if(await m({force:!0}))return}catch(e){let t;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),kt.remove(),t&&p({title:`Can't save offer`,type:`error`,message:`Please try again later`})}}}):null},Jc=[{title:`Percentage discount`,description:`Offer a special reduced price`},{title:`Free month(s)`,description:`Give free access for a limited time`}],Yc=[{value:`once`,label:`First-payment`},{value:`repeating`,label:`Multiple-months`},{value:`forever`,label:`Forever`}],Xc=191,Zc=99,Qc=`Enter a whole number of months between 1 and ${Zc}.`,$c=e=>Math.max(1,Number.isFinite(e)?Math.trunc(e):0),el=({type:e,percentAmount:t,freeMonths:n,lastPercentAmount:r,lastFreeMonths:i})=>e===`free_months`?n>0?n:i:t>0?t:r,tl=(e=`monthly`)=>({enabled:!1,displayTitle:``,displayDescription:``,type:e===`yearly`?`percent`:`free_months`,percentAmount:20,duration:`once`,durationInMonths:1,freeMonths:1}),nl=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,rl=(e,t=`monthly`)=>{let n=tl(t);if(!e)return n;let r=nl(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}},il=({formState:e,lastPercentAmount:t,lastFreeMonths:n})=>{let r=el({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:$c(r)};let i=e.duration;return{type:`percent`,amount:r,duration:i,durationInMonths:i===`repeating`?$c(e.durationInMonths):0}},al=e=>{if(!e)return null;let t=e.duration_in_months??0;return{type:`percent`,amount:e.amount,duration:e.duration,durationInMonths:t}},ol=e=>e?`${e.type}:${e.amount}:${e.duration}:${e.durationInMonths}`:``,sl=e=>Number.isInteger(e)&&e>0&&e<=Zc,cl=(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,ll=({formState:e,updateForm:t,clearError:n,errors:r,cadence:i,lastRedeemed:a,membersFilterUrl:o,redemptions:s})=>{let c=i===`yearly`?Yc.filter(e=>e.value!==`repeating`):Yc;return(0,Y.jsx)(`div`,{className:`flex grow flex-col pt-2`,children:(0,Y.jsxs)(U,{className:`grow`,children:[(0,Y.jsx)(`section`,{children:(0,Y.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,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:(0,Y.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Y.jsxs)(`span`,{children:[s,` `,s===1?`redemption`:`redemptions`]})]}),s>0&&a?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Y.jsx)(`span`,{children:Rc(a)})]}):null]}),s>0&&o?(0,Y.jsx)(`a`,{className:`font-semibold text-green`,href:o,children:`See members →`}):null]})})})}),(0,Y.jsx)(`section`,{className:`mt-2`,children:(0,Y.jsx)(vt,{align:`center`,checked:e.enabled,direction:`rtl`,hint:i===`monthly`?`Applied to monthly plans`:`Applied to annual plans`,label:`Enable ${i} retention`,onChange:e=>{t(t=>({...t,enabled:e.target.checked}))}},`retention-toggle-${i}-${e.enabled?`enabled`:`disabled`}`)}),e.enabled&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{className:`mt-2`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{maxLength:Xc,placeholder:`Before you go`,title:`Display title`,value:e.displayTitle,onChange:e=>{t(t=>({...t,displayTitle:e.target.value}))}}),(0,Y.jsx)(z,{maxLength:Xc,placeholder:`We'd hate to see you leave. How about a special offer to stay?`,title:`Display description`,value:e.displayDescription,onChange:e=>{t(t=>({...t,displayDescription:e.target.value}))}})]})]}),(0,Y.jsxs)(`section`,{className:`mt-4`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i===`monthly`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-md border border-grey-200 p-4 dark:border-grey-800`,children:[(0,Y.jsx)(Nc,{checked:e.type===`percent`,type:Jc[0],onClick:()=>{n(`amount`),n(`durationInMonths`),t(e=>({...e,type:`percent`,percentAmount:e.percentAmount}))}}),(0,Y.jsx)(Nc,{checked:e.type===`free_months`,type:Jc[1],onClick:()=>{n(`amount`),n(`durationInMonths`),t(e=>({...e,type:`free_months`}))}})]}),e.type===`percent`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{error:!!r.amount,hint:r.amount,rightPlaceholder:`%`,title:`Amount off`,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,Y.jsx)(Te,{options:c,selectedOption:c.find(t=>t.value===e.duration),title:`Duration`,onSelect:e=>{e&&(n(`durationInMonths`),t(t=>({...t,duration:e.value})))}}),e.duration===`repeating`&&(0,Y.jsx)(`div`,{className:`-mt-4`,children:(0,Y.jsx)(I,{"data-testid":`duration-months-input`,error:!!r.durationInMonths,hint:r.durationInMonths,rightPlaceholder:`${e.durationInMonths===1?`month`:`months`}`,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`)})})]}),e.type===`free_months`&&(0,Y.jsx)(I,{error:!!r.amount,hint:r.amount,rightPlaceholder:`${e.freeMonths===1?`month`:`months`}`,title:`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`)})]})]})]})]})})},ul=({id:e})=>{let{updateRoute:t}=W(),{siteData:n}=K(),{data:{tiers:r=[]}={}}=tr(),{data:{offers:i=[]}={},isFetched:a,isFetching:o}=Ft(),{mutateAsync:s}=Lt(),{mutateAsync:l}=Pt(),u=Nt(),[d,f]=(0,J.useState)(``),m=e===`monthly`?`monthly`:`yearly`,h=m===`monthly`?`Monthly retention`:`Yearly retention`,g=m===`monthly`?`month`:`year`,_=rr(r||[]),v=(0,J.useMemo)(()=>i.filter(e=>e.redemption_type===`retention`&&e.cadence===g).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,g]),y=(0,J.useMemo)(()=>v.find(e=>e.status===`active`)||null,[v]),b=v[0]||null,x=y||b,S=(0,J.useMemo)(()=>v.reduce((e,t)=>e+(t.redemption_count||0),0),[v]),C=(0,J.useMemo)(()=>v.map(e=>e.id),[v]),w=(0,J.useMemo)(()=>v.map(e=>e.last_redeemed).filter(e=>!!e).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime())[0]||null,[v]),T=(0,J.useMemo)(()=>S===0||C.length===0?null:zc(C),[C,S]),[E,D]=(0,J.useState)(20),[O,k]=(0,J.useState)(1),[A,j]=(0,J.useState)(null),{formState:M,setFormState:N,updateForm:P,handleSave:F,saveState:I,okProps:L,errors:R,clearError:z}=jt({initialState:tl(m),savingDelay:500,onSave:async()=>{let e=!1,t=il({formState:M,lastPercentAmount:E,lastFreeMonths:O}),n=ol(al(x))!==ol(t),r=M.enabled?`active`:`archived`,i=M.displayTitle||``,a=M.displayDescription||``,o=x?i!==(x.display_title||``)||a!==(x.display_description||``):i!==``||a!==``,c=tl(m),d=!M.enabled&&!x&&cl(M,c),f=async n=>{let r=crypto.getRandomValues(new Uint32Array(1))[0].toString(16).padStart(8,`0`),o=Wc(t,r);await s({name:o,code:r,display_title:i,display_description:a,cadence:g,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},p=async()=>{e&&await u()};if(!(!x&&!M.enabled&&!d)){if(n){!M.enabled&&y&&(await l({...y,status:`archived`}),e=!0),await f(r),await p();return}if(x){let t=x.status!==r;(o||t)&&(await l({...x,display_title:i,display_description:a,status:r}),e=!0),await p();return}(M.enabled||d)&&await f(r),await p()}},onSaveError:e=>{let t=`Please try again later`;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message||t),kt.remove(),p({title:`Failed to save offer`,type:`error`,message:t})},onValidate:()=>{let e={};return M.enabled?(M.type===`percent`&&((M.percentAmount<1||M.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),M.duration===`repeating`&&!sl(M.durationInMonths)&&(e.durationInMonths=Qc)),M.type===`free_months`&&(sl(M.freeMonths)||(e.amount=Qc)),e):e}}),B=`${e}:${x?.id||`none`}`;(0,J.useEffect)(()=>{!a||o||I===`unsaved`||A===B||(N(()=>rl(x,m)),j(B))},[m,B,x,a,A,o,I,N]),(0,J.useEffect)(()=>{M.percentAmount>0&&D(M.percentAmount)},[M.percentAmount]),(0,J.useEffect)(()=>{M.freeMonths>0&&k(M.freeMonths)},[M.freeMonths]);let ee=()=>{t(`offers/edit`)},V=(0,Y.jsx)(ll,{cadence:m,clearError:z,errors:R,formState:M,lastRedeemed:w,membersFilterUrl:T,redemptions:S,updateForm:P}),te=async()=>{try{await F({force:!0})&&ee()}catch{}},ne=(0,J.useMemo)(()=>{let e=il({formState:M,lastPercentAmount:E,lastFreeMonths:O}),t=_.find(e=>g===`month`?e.monthly_price:e.yearly_price);return{enabled:M.enabled,name:`${m} retention`,code:`${m}-retention`,displayTitle:M.displayTitle||``,displayDescription:M.displayDescription||``,type:e.type,cadence:g,amount:e.amount,duration:e.duration,durationInMonths:e.durationInMonths,currency:``,status:`active`,tierId:t?.id||``,redemptionType:`retention`}},[_,m,M,O,E,g]);(0,J.useEffect)(()=>{if(!n.url){f(``);return}let e=kc(ne,n.url);f(e)},[ne,n.url]);let H=(0,Y.jsx)(Oc,{href:d||``,portalParent:`offers`});return(0,Y.jsx)(Ii,{afterClose:()=>t(`offers`),backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:I===`unsaved`,height:`full`,okColor:L.color,okLabel:L.label||`Save`,preview:H,previewToolbarBreadcrumbs:[{label:`Offers`,onClick:ee},{label:h}],sidebar:V,size:`lg`,testId:`retention-offer-modal`,title:`Offer`,width:1140,onBreadcrumbsBack:ee,onCancel:ee,onOk:te})},dl=(e,t)=>e.find(e=>e.redemption_type===`retention`&&e.cadence===t&&e.status===`active`)||null,fl=(e,t)=>e.reduce((e,n)=>n.redemption_type!==`retention`||n.cadence!==t?e:e+(n.redemption_count||0),0),pl=(e,t)=>e.filter(e=>e.redemption_type===`retention`&&e.cadence===t).map(e=>e.id),ml=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,hl=e=>{if(!e)return null;if(ml(e)){let t=e.duration_in_months||0;return`${t} ${t===1?`month`:`months`} free`}return e.type===`percent`?`${e.amount}% OFF`:null},gl=e=>{if(!e)return null;if(ml(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 ${e.duration_in_months} ${t}`}return e.duration===`forever`?`Forever`:null},_l=e=>{let t=dl(e,`month`),n=dl(e,`year`),r=pl(e,`month`),i=pl(e,`year`),a=fl(e,`month`),o=fl(e,`year`);return[{id:`monthly`,name:`Monthly retention`,description:`Applied to monthly plans`,terms:hl(t),termsDetail:gl(t),redemptionOfferIds:r,redemptions:a,status:t?`active`:`inactive`},{id:`yearly`,name:`Yearly retention`,description:`Applied to annual plans`,terms:hl(n),termsDetail:gl(n),redemptionOfferIds:i,redemptions:o,status:n?`active`:`inactive`}]},vl=e=>e===`month`?`monthly`:`yearly`,yl=e=>e===`once`?`First payment`:e===`repeating`?`Repeating`:`Forever`,bl=(e,t,n,r,i)=>{let a=``,o=``,s=n===`month`?i?.monthly_price??0:i?.yearly_price??0,c=s,l=e=>parseFloat(e.toFixed(2)),u=ct(r)+H(l(Ye(s)));switch(e){case`percent`:a=`text-green`,o=t+`% off`,c=s-s*t/100;break;case`fixed`:a=`text-blue`,o=H(l(Ye(t)))+` `+r+` off`,c=s-t;break;case`trial`:a=`text-pink`,o=t+` days free`,u=``;break;default:break}c<0&&(c=0);let d=ct(r)+H(l(Ye(c)));return{discountColor:a,discountOffer:o,originalPriceWithCurrency:u,updatedPriceWithCurrency:d}},xl=({showArchived:e,setShowArchived:t,sortOption:n,sortDirection:r,onSortChange:i,onDirectionChange:a})=>(0,Y.jsx)(Pe,{position:`end`,trigger:(0,Y.jsx)(q,{"aria-label":`Filter options`,className:`p-1 hover:text-black dark:hover:text-white`,label:(0,Y.jsx)(zt,{size:16,strokeWidth:1.5}),unstyled:!0}),children:(0,Y.jsxs)(`div`,{className:`flex min-w-[200px] flex-col p-1 normal-case`,children:[(0,Y.jsx)(`div`,{className:`cursor-default pt-2 pl-3 text-sm font-medium tracking-wide text-grey-700 uppercase select-none`,children:`Sort by`}),(0,Y.jsx)(`div`,{className:`flex flex-col py-1`,children:[{id:`date-added`,label:`Date added`},{id:`name`,label:`Name`},{id:`redemptions`,label:`Redemptions`}].map(e=>(0,Y.jsxs)(`div`,{className:`group relative mx-1 flex items-center rounded-[2.5px] hover:bg-grey-100 dark:hover:bg-grey-800`,children:[(0,Y.jsxs)(`button`,{className:`flex w-full cursor-pointer items-center px-8 py-1.5 pr-12 text-left text-black dark:text-white`,type:`button`,onClick:()=>i(e.id),children:[n===e.id&&(0,Y.jsx)(f,{className:`absolute left-2`,name:`check`,size:`xs`}),e.label]}),n===e.id&&(0,Y.jsx)(`button`,{className:`absolute right-1 flex size-6 cursor-pointer items-center justify-center rounded-full hover:bg-grey-300 dark:hover:bg-grey-700`,title:r===`asc`?`Ascending`:`Descending`,type:`button`,onClick:()=>a(),children:(0,Y.jsx)(f,{name:r===`asc`?`arrow-up`:`arrow-down`,size:`xs`})})]},e.id))}),(0,Y.jsx)(`div`,{className:`-mx-1 mt-1 border-t border-t-grey-200 dark:border-t-grey-800`,children:(0,Y.jsx)(`div`,{className:`group relative mx-2 mt-1 flex items-center rounded-[2.5px] py-1`,children:(0,Y.jsxs)(`div`,{className:`flex w-full items-center px-8 py-1.5 pr-2 text-black dark:text-white`,children:[(0,Y.jsx)(Bt,{className:`absolute left-2 -mt-0.5 text-black dark:text-white`,size:14,strokeWidth:1.5}),(0,Y.jsx)(`div`,{className:`grow [&>div]:w-full`,children:(0,Y.jsx)(vt,{checked:e,direction:`rtl`,label:`Show archived`,labelClasses:`text-black dark:text-white`,onChange:e=>{t(e.target.checked)}})})]})})})]})}),Sl=({offer:e,onClick:t})=>{let n=e.redemptions>0&&e.redemptionOfferIds.length>0?zc(e.redemptionOfferIds):void 0;return(0,Y.jsxs)(`tr`,{className:`group relative border-b border-b-grey-200 dark:border-grey-800`,"data-testid":`retention-offer-item`,children:[(0,Y.jsx)(`td`,{className:`sticky left-0 z-10 bg-white p-0 dark:bg-black`,children:(0,Y.jsxs)(`button`,{className:`block w-full cursor-pointer p-5 pl-0 text-left`,type:`button`,onClick:t,children:[(0,Y.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.description})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.terms?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-[1.3rem] font-medium uppercase`,children:e.terms}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.termsDetail})]}):(0,Y.jsx)(`span`,{className:`text-grey-700`,children:`–`})})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:(0,Y.jsx)(`span`,{className:`text-grey-700`,children:`–`})})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:n?(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5 hover:underline`,"data-testid":`retention-redemptions-link-${e.id}`,href:n,children:e.redemptions}):(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,"data-testid":`retention-redemptions-link-${e.id}`,type:`button`,onClick:t,children:e.redemptions})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.status===`active`?(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-[rgba(48,207,67,0.15)] px-2 py-0.5 text-xs font-semibold tracking-wide text-green uppercase`,children:`Active`}):(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-grey-200 px-2 py-0.5 text-xs font-semibold tracking-wide text-grey-700 uppercase dark:bg-grey-900 dark:text-grey-500`,children:`Inactive`})})})]})},Cl=()=>{let e=N(),{updateRoute:t}=W(),{data:{offers:n=[]}={}}=Ft(),{data:{tiers:r}={}}=tr(),i=n.filter(e=>e.redemption_type===`signup`),a=_l(n),{sortingState:o,setSortingState:s}=le(),c=o?.find(e=>e.type===`offers`),{offersShowArchived:l,setOffersShowArchived:u}=ie(),d=c?.option||`date-added`,f=c?.direction||`desc`,m=e=>{e&&t(`offers/edit/${e}`)},h=e=>{t(`offers/edit/retention/${e}`)},g=i.sort((e,t)=>{let n=f===`desc`?-1:1;switch(d){case`name`:return n*e.name.localeCompare(t.name);case`redemptions`:return n*(e.redemption_count-t.redemption_count);default:return n*((e.created_at?new Date(e.created_at).getTime():0)-(t.created_at?new Date(t.created_at).getTime():0))}}),_=rr(r||[]),v=g.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)}),y=e=>{s?.([{type:`offers`,option:e,direction:f}])},b=()=>{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&&t.active===!1},S=[{key:`cancel-modal`,label:`Close`,onClick:()=>{e.remove(),t(`offers`)}},{key:`new-offer`,icon:`add`,label:`New offer`,color:`green`,onClick:()=>{_.length===0?p({type:`info`,title:`You must have an active tier to create an offer.`}):t(`offers/new`)}}],C=(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`m-0 min-w-[900px]`,children:[(0,Y.jsxs)(`colgroup`,{children:[(0,Y.jsx)(`col`,{className:`w-[25%]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[220px]`})]}),(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-b-grey-200 dark:border-grey-800`,children:[(0,Y.jsx)(`th`,{className:`sticky left-0 z-10 bg-white p-0 pb-2.5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase dark:bg-black`,children:`Name`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Terms`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Price`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Redemptions`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:(0,Y.jsxs)(`span`,{className:`flex items-center justify-between`,children:[`Status`,(0,Y.jsx)(xl,{setShowArchived:u,showArchived:l,sortDirection:f,sortOption:d,onDirectionChange:b,onSortChange:y})]})})]})}),(0,Y.jsxs)(`tbody`,{children:[a.map(e=>(0,Y.jsx)(Sl,{offer:e,onClick:()=>h(e.id)},e.id)),v.map(e=>{let t=r?.find(t=>t.id===e?.tier?.id);if(!t)return null;let n=x(e),{discountOffer:i,originalPriceWithCurrency:a,updatedPriceWithCurrency:o}=bl(e.type,e.amount,e.cadence,e.currency||`USD`,t);return(0,Y.jsxs)(`tr`,{className:`group relative border-b border-b-grey-200 dark:border-grey-800 ${n?`opacity-60`:``}`,"data-testid":`offer-item`,children:[(0,Y.jsx)(`td`,{className:`sticky left-0 z-10 bg-white p-0 dark:bg-black`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5 pl-0`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`font-semibold`,children:e?.name}),(0,Y.jsx)(`br`,{}),(0,Y.jsxs)(`span`,{className:`text-grey-700`,children:[t.name,` `,vl(e.cadence)]})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`text-[1.3rem] font-medium uppercase`,children:i}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.type===`trial`?`Trial period`:yl(e.duration)})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:o}),` `,e.type===`trial`?null:(0,Y.jsx)(`span`,{className:`relative text-sm text-grey-700 before:absolute before:-inset-x-0.5 before:top-1/2 before:rotate-[-20deg] before:border-t before:content-[""]`,children:a})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5 ${e.redemption_count===0?``:`hover:underline`}`,href:e.redemption_count>0&&e.id?Bc(e.id):void 0,onClick:e.redemption_count===0&&e.id?()=>m(e.id):void 0,children:e.redemption_count})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:n?(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-grey-200 px-2 py-0.5 text-xs font-semibold tracking-wide text-grey-700 uppercase dark:bg-grey-900 dark:text-grey-500`,children:`Archived`}):(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-[rgba(48,207,67,0.15)] px-2 py-0.5 text-xs font-semibold tracking-wide text-green uppercase`,children:`Active`})})})]},e.id)})]})]})});return(0,Y.jsx)(L,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,cancelLabel:``,footer:!1,height:`full`,size:`lg`,testId:`offers-modal`,title:`Offers`,topRightContent:(0,Y.jsx)(re,{buttons:S}),width:1140,children:(0,Y.jsx)(`div`,{className:`flex h-full flex-col pt-8`,children:C})})},wl=({route:e})=>{if(e===`offers/new`)return(0,Y.jsx)(Lc,{});if(e.startsWith(`offers/edit/retention/`)&&e.length>22){let t=e.split(`/`).pop();return(0,Y.jsx)(ul,{id:t||``})}else if(e===`offers/edit/retention/`||e===`offers/edit/retention`)return(0,Y.jsx)(Cl,{});else if(e.startsWith(`offers/edit/`)&&e.length>12){let t=e.split(`/`).pop();return(0,Y.jsx)(qc,{id:t||``})}else if(e.startsWith(`offers/success/`)&&e.length>15){let t=e.split(`/`).pop();return(0,Y.jsx)(Dc,{id:t||``})}else if(e===`offers/edit`||e===`offers/edit/`)return(0,Y.jsx)(Cl,{})},Tl=O.create(()=>{let{route:e}=W();return(0,Y.jsx)(wl,{route:e})});``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href;var El=h({method:`POST`,path:()=>`/files/upload/`,body:({file:e})=>{let t=new FormData;return t.append(`file`,e),t}}),Dl=O.create(()=>{let{updateRoute:e}=W(),[t,n]=(0,J.useState)({js:!1,css:!1}),{settings:r,config:i}=K(),[a]=Fn(r,[`pintura`]),{mutateAsync:o}=An(),{mutateAsync:s}=El(),c=g();(0,J.useEffect)(()=>{m(a||!1)},[a]);let[l,u]=(0,J.useState)(`Save`),[d,m]=(0,J.useState)(!!a),h=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)}},_=(0,J.useRef)(null),v=(0,J.useRef)(null),y=e=>{e===`js`&&_.current?.click(),e===`css`&&v.current?.click()},b=async(e,t)=>{try{n(e=>({...e,[t]:!0}));let r=e.target?.files?.[0];if(!r)return;let{files:i}=await s({file:r}),a=i[0].url,c=[{key:`pintura_${t}_url`,value:a}];await o(c),n(e=>({...e,[t]:!1})),p({type:`success`,title:`Pintura ${t} uploaded`})}catch(e){n({js:!1,css:!1}),c(e)}};return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:d!==a,okColor:l===`Saved`?`green`:`black`,okLabel:l,testId:`pintura-modal`,title:``,onOk:h,children:[(0,Y.jsx)(it,{detail:`Advanced image editing`,icon:(0,Y.jsx)(f,{name:`pintura`,size:48}),title:`Pintura`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[!i.pintura&&(0,Y.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,Y.jsxs)(`div`,{className:`md:basis-1/2`,children:[(0,Y.jsx)(`p`,{className:`mb-4 text-md font-semibold`,children:`Add advanced image editing to Ghost, with Pintura`}),(0,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex grow flex-col items-end justify-between gap-2 md:basis-1/2`,children:[(0,Y.jsx)(`img`,{alt:`Pintura screenshot`,src:``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href}),(0,Y.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,Y.jsxs)(U,{marginBottom:!1,title:`Pintura configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:d,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.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`]}),label:`Enable Pintura`,onChange:e=>{m(e.target.checked)}}),d&&!i.pintura&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Upload Pintura script`}),(0,Y.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Y.jsx)(`code`,{children:`pintura-umd.js`}),` file from the Pintura package`]})]}),(0,Y.jsx)(`input`,{ref:_,accept:`.js`,type:`file`,hidden:!0,onChange:async e=>{await b(e,`js`)}}),(0,Y.jsx)(q,{color:`outline`,disabled:t.js,label:`Upload`,onClick:()=>{y(`js`)}})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Upload Pintura styles`}),(0,Y.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Y.jsx)(`code`,{children:`pintura.css`}),` file from the Pintura package`]})]}),(0,Y.jsx)(`input`,{ref:v,accept:`.css`,type:`file`,hidden:!0,onChange:async e=>{await b(e,`css`)}}),(0,Y.jsx)(q,{color:`outline`,disabled:t.css,label:`Upload`,onClick:()=>{y(`css`)}})]})]})]})]})]})}),Ol=({localSettings:e,updateSetting:t})=>{let[n,r,i,a,o,s]=Fn(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,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D,{}),(0,Y.jsx)(A,{level:5,children:`Transistor`}),(0,Y.jsx)(vt,{checked:c,direction:`rtl`,hint:`Show a section on the account page for members to access private podcasts`,label:`Enable Transistor integration`,onChange:e=>t(`transistor_portal_enabled`,e.target.checked)}),c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{hint:`The heading displayed above the Transistor section`,placeholder:`Podcasts`,title:`Heading`,value:i,onChange:e=>t(`transistor_portal_heading`,e.target.value)}),(0,Y.jsx)(I,{hint:`A short description of what members can do`,placeholder:`Access your RSS feeds`,title:`Description`,value:a,onChange:e=>t(`transistor_portal_description`,e.target.value)}),(0,Y.jsx)(I,{hint:`The text displayed on the button`,placeholder:`Manage`,title:`Button text`,value:o,onChange:e=>t(`transistor_portal_button_text`,e.target.value)}),(0,Y.jsx)(I,{hint:`Use {memberUuid} as a placeholder for the member ID`,placeholder:`https://partner.transistor.fm/ghost/{memberUuid}`,title:`URL template`,value:s,onChange:e=>t(`transistor_portal_url_template`,e.target.value)})]})]})},kl=({localSettings:e,updateSetting:t,errors:n,setError:r})=>{let{siteData:i,settings:a,config:o}=K(),[s,c]=Fn(a,[`members_support_address`,`support_email_address`]),l=c?.toString()||Bn(s?.toString()||``,i,o),u=Wn(i,o),[d,f]=(0,J.useState)(l);return(0,J.useEffect)(()=>{f(l)},[l]),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(I,{error:!!n.members_support_address,hint:n.members_support_address,title:`Support email address`,value:d,onBlur:e=>{let n=e.target.value;n?ua.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(Bn(a,i,o))},onChange:e=>f(e.target.value)}),(0,Y.jsx)(Ol,{localSettings:e,updateSetting:t})]})})},Al=[{icon:`portal-icon-1`,value:`icon-1`},{icon:`portal-icon-2`,value:`icon-2`},{icon:`portal-icon-3`,value:`icon-3`},{icon:`portal-icon-4`,value:`icon-4`},{icon:`portal-icon-5`,value:`icon-5`}],jl=({localSettings:e,updateSetting:t})=>{let{mutateAsync:n}=pt(),r=g(),[i,a,o,s]=Fn(e,[`portal_button`,`portal_button_style`,`portal_button_icon`,`portal_button_signup_text`]),c=o||Al[0].value,[l,u]=(0,J.useState)(Al.map(({value:e})=>e).includes(c)?void 0:c),d=async e=>{try{let r=Ne(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)}},p=()=>{t(`portal_button_icon`,null),u(void 0)},m=[{value:`icon-and-text`,label:`Icon and text`},{value:`icon-only`,label:`Icon only`},{value:`text-only`,label:`Text only`}];return(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(vt,{checked:!!i,direction:`rtl`,label:`Show portal button`,onChange:e=>t(`portal_button`,e.target.checked)}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Te,{options:m,selectedOption:m.find(e=>e.value===a),title:`Button style`,onSelect:e=>t(`portal_button_style`,e?.value||null)}),a?.toString()?.includes(`icon`)&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(A,{level:6,grey:!0,children:`Icon`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[Al.map(e=>(0,Y.jsx)(`button`,{className:P(`border p-3`,c===e.value?`border-green`:`border-transparent`),type:`button`,onClick:()=>t(`portal_button_icon`,e.value),children:(0,Y.jsx)(f,{className:`size-5 ${c===e.value?`text-green`:`text-black opacity-70 transition-all hover:opacity-100 dark:text-white`}`,name:e.icon})},e.value)),(0,Y.jsx)(`div`,{className:P(`relative w-[46px] border`,c===l?`border-green`:`border-transparent`),children:(0,Y.jsx)(Ee,{deleteButtonClassName:`invisible absolute -right-2 -top-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white hover:bg-black group-hover:visible!`,deleteButtonContent:(0,Y.jsx)(f,{colorClass:`text-white`,name:`trash`,size:`sm`}),height:`46px`,id:`test`,imageClassName:`cursor-pointer`,imageURL:l,width:`46px`,deleteButtonUnstyled:!0,onDelete:p,onImageClick:()=>l&&t(`portal_button_icon`,l),onUpload:d,children:(0,Y.jsx)(f,{className:`dark:text-white`,name:`upload`,size:`md`})})})]})]}),a?.toString()?.includes(`text`)&&(0,Y.jsx)(I,{title:`Signup button text`,value:s,onChange:e=>t(`portal_button_signup_text`,e.target.value)})]})]})})},Ml=({name:e,value:t})=>{let n=(0,J.useId)();return(0,Y.jsx)(Se,{action:(0,Y.jsx)(q,{color:`black`,label:`Copy`,link:!0,onClick:e=>{navigator.clipboard.writeText(t);let n=e?.target;n.innerText=`Copied`,setTimeout(()=>{n.innerText=`Copy`},1e3)}}),separator:!0,children:(0,Y.jsxs)(`div`,{className:`flex w-full grow flex-col py-3 lg:flex-row lg:items-center lg:gap-5`,children:[(0,Y.jsxs)(`label`,{className:`inline-block whitespace-nowrap lg:w-[180px] lg:min-w-[180px]`,htmlFor:n,children:[e,`:`]}),(0,Y.jsx)(I,{className:`grow border-b-grey-500 bg-transparent py-1 text-grey-700 lg:p-1`,id:n,value:t,disabled:!0,unstyled:!0})]})})},Nl=()=>{let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(``),{siteData:i,settings:a}=K(),{data:{tiers:o}={}}=tr(),s=rr(o||[]),[c]=Fn(a,[`paid_members_enabled`]),l=()=>{t(!e)};(0,J.useEffect)(()=>{s?.length&&!n&&r(s[0].id)},[s,n]);let u=s?.map(e=>({label:e.name,value:e.id})),d=jn(i);return(0,Y.jsxs)(Pi,{className:`max-w-[920px] text-base text-black dark:text-white`,heading:`Links`,children:[(0,Y.jsxs)(`p`,{className:`-mt-6 mb-16`,children:[`Use these `,e?`data attributes`:`links`,` in your theme to show pages of Portal.`]}),(0,Y.jsxs)(ne,{actions:(0,Y.jsx)(q,{color:`green`,label:e?`Links`:`Data attributes`,link:!0,onClick:l}),title:`Generic`,titleSize:`lg`,children:[(0,Y.jsx)(Ml,{name:`Default`,value:e?`data-portal`:`${d}#/portal`}),(0,Y.jsx)(Ml,{name:`Sign in`,value:e?`data-portal="signin"`:`${d}#/portal/signin`}),(0,Y.jsx)(Ml,{name:`Sign up`,value:e?`data-portal="signup"`:`${d}#/portal/signup`}),c&&(0,Y.jsx)(Ml,{name:`Gift subscriptions`,value:e?`data-portal="gift"`:`${d}#/portal/gift`})]}),(0,Y.jsxs)(ne,{className:`mt-14`,title:`Tiers`,titleSize:`lg`,children:[(0,Y.jsx)(Se,{hideActions:!0,separator:!0,children:(0,Y.jsxs)(`div`,{className:`flex w-full items-center gap-2 py-2`,children:[(0,Y.jsx)(`span`,{className:`inline-block w-[180px] min-w-[180px] shrink-0`,children:`Tier:`}),(0,Y.jsx)(Te,{options:u,selectedOption:u.find(e=>e.value===n),onSelect:e=>{e&&r(e?.value)}})]})}),(0,Y.jsx)(Ml,{name:`Signup / Monthly`,value:e?`data-portal="signup/${n}/monthly"`:`${d}#/portal/signup/${n}/monthly`}),(0,Y.jsx)(Ml,{name:`Signup / Yearly`,value:e?`data-portal="signup/${n}/yearly"`:`${d}#/portal/signup/${n}/yearly`}),(0,Y.jsx)(Ml,{name:`Signup / Free`,value:e?`data-portal="signup/free"`:`${d}#/portal/signup/free`})]}),(0,Y.jsxs)(ne,{className:`mt-14`,title:`Account`,titleSize:`lg`,children:[(0,Y.jsx)(Ml,{name:`Account`,value:e?`data-portal="account"`:`${d}#/portal/account`}),(0,Y.jsx)(Ml,{name:`Account / Plans`,value:e?`data-portal="account/plans"`:`${d}#/portal/account/plans`}),(0,Y.jsx)(Ml,{name:`Account / Profile`,value:e?`data-portal="account/profile"`:`${d}#/portal/account/profile`}),(0,Y.jsx)(Ml,{name:`Account / Newsletters`,value:e?`data-portal="account/newsletters"`:`${d}#/portal/account/newsletters`}),(0,Y.jsx)(Ml,{name:`Account / Newsletter help`,value:e?`data-portal="account/newsletters/help"`:`${d}#/portal/account/newsletters/help`})]})]})},Pl=({settings:e,config:t,tiers:n,siteData:r,selectedTab:i})=>{if(!r?.url)return null;let a=n.filter(e=>e.visibility===`public`&&e.type===`paid`).map(e=>e.id),o=r.url.replace(/\/$/,``),s=JSON.parse(Nn(e,`portal_plans`)||``),c=new URLSearchParams;c.append(`button`,Nn(e,`portal_button`)?`true`:`false`),c.append(`name`,Nn(e,`portal_name`)?`true`:`false`),c.append(`isFree`,s.includes(`free`)?`true`:`false`),c.append(`isMonthly`,Kn(e,t)&&s.includes(`monthly`)?`true`:`false`),c.append(`isYearly`,Kn(e,t)&&s.includes(`yearly`)?`true`:`false`),c.append(`page`,i===`account`?`accountHome`:`signup`),c.append(`buttonIcon`,encodeURIComponent(Nn(e,`portal_button_icon`)||`icon-1`)),c.append(`signupButtonText`,encodeURIComponent(Nn(e,`portal_button_signup_text`)||``)),c.append(`membersSignupAccess`,Nn(e,`members_signup_access`)||`all`),c.append(`allowSelfSignup`,Nn(e,`allow_self_signup`)||`false`),c.append(`signupTermsHtml`,Nn(e,`portal_signup_terms_html`)||``),c.append(`signupCheckboxRequired`,Nn(e,`portal_signup_checkbox_required`)?`true`:`false`),c.append(`portalProducts`,a.join(`,`));let l=Nn(e,`portal_default_plan`);l&&c.append(`portalDefaultPlan`,l),s&&s.length&&c.append(`portalPrices`,encodeURIComponent(s.join(`,`)));let u=Nn(e,`accent_color`);u!=null&&c.append(`accentColor`,encodeURIComponent(u));let d=Nn(e,`portal_button_style`);return d&&c.append(`buttonStyle`,encodeURIComponent(d)),c.append(`disableBackground`,`false`),Nn(e,`transistor`)&&c.append(`transistorPortalSettings`,JSON.stringify({enabled:Nn(e,`transistor_portal_enabled`),heading:Nn(e,`transistor_portal_heading`)||`Podcasts`,description:Nn(e,`transistor_portal_description`)||`Access your RSS feeds`,button_text:Nn(e,`transistor_portal_button_text`)||`Manage`,url_template:Nn(e,`transistor_portal_url_template`)||`https://partner.transistor.fm/ghost/{memberUuid}`})),c.append(`admin_toolbar`,`0`),`${o}/?v=modal-portal-settings#/portal/preview?${c.toString()}`},Fl=({selectedTab:e=`signup`,localSettings:t,localTiers:n})=>{let{siteData:r,config:i}=K(),a=Pl({settings:t,tiers:n,selectedTab:e,siteData:r,config:i}),o=(0,Y.jsx)(Y.Fragment,{});switch(e){case`account`:o=(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsx)(Oc,{href:a||``,portalParent:`preview`,selectedTab:e})});break;case`links`:o=(0,Y.jsx)(Nl,{});break;default:o=(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsx)(Oc,{href:a||``,portalParent:`preview`,selectedTab:e})});break}return o},Il=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a})=>{let{config:o}=K(),[s,c,l,u,d,f]=Fn(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,J.useMemo)(()=>{let e=document.createElement(`div`);return e.innerHTML=l?.toString()||``,e.innerText.length},[l]),h=(0,J.useCallback)((e,t)=>{a(e,t)},[]);(0,J.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=Kn(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=rr(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,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(vt,{checked:!!c,direction:`rtl`,disabled:!_,label:`Display name in signup form`,onChange:e=>t(`portal_name`,e.target.checked)}),(0,Y.jsx)(sr,{checkboxes:b,title:`Available tiers`}),C&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(sr,{checkboxes:[{checked:p.includes(`monthly`),disabled:!_,label:`Monthly`,value:`monthly`,onChange:()=>{g(`monthly`)}},{checked:p.includes(`yearly`),disabled:!_,label:`Yearly`,value:`yearly`,onChange:()=>{g(`yearly`)}}],title:`Available prices`}),p.includes(`yearly`)&&p.includes(`monthly`)&&(0,Y.jsx)(Te,{options:S,selectedOption:S.find(e=>e.value===f),title:`Default price at signup`,onSelect:e=>{t(`portal_default_plan`,e?.value??`yearly`)}})]}),(0,Y.jsx)(Zr,{error:!!i.portal_signup_terms_html,hint:i.portal_signup_terms_html||(0,Y.jsxs)(Y.Fragment,{children:[`Recommended: `,(0,Y.jsx)(`strong`,{children:`115`}),` characters. You've used `,(0,Y.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,Y.jsx)(vt,{checked:!!u,disabled:!_,label:`Require agreement`,labelStyle:`heading`,onChange:e=>t(`portal_signup_checkbox_required`,e.target.checked)})]})})},Ll=h({path:()=>`/settings/verifications`,method:`PUT`,body:({token:e})=>({token:e}),updateQueries:{dataType:`SettingsResponseType`,emberUpdateType:`createOrUpdate`,update:e=>({...e,settings:e.settings})}}),Rl=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a,selectedTab:o,onTabChange:s})=>(0,Y.jsx)(`div`,{className:`pt-4`,children:(0,Y.jsx)(Xe,{selectedTab:o,tabs:[{id:`signupOptions`,title:`Signup options`,contents:(0,Y.jsx)(Il,{errors:i,localSettings:e,localTiers:n,setError:a,updateSetting:t,updateTier:r})},{id:`lookAndFeel`,title:`Look & feel`,contents:(0,Y.jsx)(jl,{localSettings:e,updateSetting:t})},{id:`accountPage`,title:`Account page`,contents:(0,Y.jsx)(kl,{errors:i,localSettings:e,setError:a,updateSetting:t})}],onTabChange:s})}),zl=O.create(()=>{let{updateRoute:e}=W(),[t,n]=(0,J.useState)(`signup`),[r,i]=(0,J.useState)(`signupOptions`),a=g(),{settings:o,siteData:s,config:c}=K(),{mutateAsync:l}=An(),{data:{tiers:u}={}}=tr(),{mutateAsync:d}=nr(),{mutateAsync:f}=Ll(),{getParam:p}=je(),m=p(`verifyEmail`);(0,J.useEffect)(()=>{m&&(async({token:e})=>{try{let{settings:t}=await f({token:e}),[n]=Fn(t,[`members_support_address`]);O.show(me,{title:`Support address verified`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Your support email address has been changed to `,(0,Y.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.`),O.show(me,{title:`Error verifying support address`,prompt:t,okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()}),a(e,{withToast:!1})}})({token:m})},[a,m,f]);let{formState:h,setFormState:_,saveState:v,handleSave:y,updateForm:b,okProps:x}=jt({initialState:{settings:o,tiers:u||[]},savingDelay:500,onSave:async()=>{await Promise.all(h.tiers.filter(({dirty:e})=>e).map(e=>d(e))),_(e=>({...e,tiers:h.tiers.map(e=>({...e,dirty:!1}))}));let e=h.settings.filter(e=>e.dirty);if(!e.length)return;let{meta:t,settings:n}=await l(e);if(_(e=>({...e,settings:h.settings.map(e=>({...e,dirty:!1}))})),t?.sent_email_verification){let e=h.settings.find(e=>e.key===`members_support_address`)?.value,t=n.find(e=>e.key===`support_email_address`)?.value||Bn(n.find(e=>e.key===`members_support_address`)?.value?.toString()||`noreply`,s,c);O.show(me,{title:`Confirm email address`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`We've sent a confirmation email to `,(0,Y.jsx)(`strong`,{children:e}),`. Until verified, your support email address will remain `,t,`.`]}),okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()})}},onSaveError:a});(0,J.useEffect)(()=>{!h.tiers.length&&u?.length&&_(e=>({...e,tiers:u}))},[u,h.tiers,_]);let[S,C]=(0,J.useState)({}),w=(e,t)=>{b(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},T=(e,t)=>{C(n=>({...n,[e]:t}))},E=e=>{b(t=>({...t,tiers:t.tiers.map(t=>t.id===e.id?{...e,dirty:!0}:t)}))},D=e=>{n(e),e===`signup`?i(`signupOptions`):e===`account`&&i(`accountPage`)},k=(0,Y.jsx)(Rl,{errors:S,localSettings:h.settings,localTiers:h.tiers,selectedTab:r,setError:T,updateSetting:w,updateTier:E,onTabChange:e=>{i(e),e===`signupOptions`?n(`signup`):e===`accountPage`&&n(`account`)}}),A=(0,Y.jsx)(Fl,{localSettings:h.settings,localTiers:h.tiers,selectedTab:t});return(0,Y.jsx)(Ii,{afterClose:()=>{e(`portal`)},buttonsDisabled:x.disabled,cancelLabel:`Close`,deviceSelector:!1,dirty:v===`unsaved`,okColor:x.color,okLabel:x.label||`Save`,preview:A,previewBgColor:t===`links`?`white`:`greygradient`,previewToolbarTabs:[{id:`signup`,title:`Signup`},{id:`account`,title:`Account page`},{id:`links`,title:`Links`}],selectedURL:t,sidebar:k,testId:`portal-modal`,title:`Portal`,onOk:async()=>{Object.values(S).filter(Boolean).length||await y({force:!0})},onSelectURL:D})}),Bl=O.create(()=>{let{updateRoute:e}=W(),{localSettings:t,updateSetting:n,handleSave:r,validate:i,errors:a,clearError:o,okProps:s}=be({onValidate:()=>{let e={};return c&&!ua.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]=Fn(t,[`slack_url`,`slack_username`]),{mutateAsync:u}=Jn();return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:t.some(e=>e.dirty),okColor:s.color,okLabel:s.label||`Save`,testId:`slack-modal`,title:``,onOk:async()=>{kt.remove(),await r()},children:[(0,Y.jsx)(it,{detail:`A messaging app for teams`,icon:(0,Y.jsx)(f,{name:`slack`,size:56}),title:`Slack`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{marginBottom:!1,title:`Slack configuration`,grouped:!0,children:[(0,Y.jsx)(I,{error:!!a.slackUrl,hint:a.slackUrl||(0,Y.jsxs)(Y.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,Y.jsx)(`a`,{href:`https://my.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks`,children:`here`}),`, and grab the URL.`]}),placeholder:`https://hooks.slack.com/services/...`,title:`Webhook URL`,value:c,onBlur:i,onChange:e=>n(`slack_url`,e.target.value),onKeyDown:()=>o(`slackUrl`)}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2 md:flex-row md:items-center`,children:[(0,Y.jsx)(I,{containerClassName:`grow`,hint:`The username to display messages from`,title:`Username`,value:l,onChange:e=>n(`slack_username`,e.target.value)}),(0,Y.jsx)(q,{color:`outline`,label:`Send test notification`,onClick:async()=>{kt.remove(),await r()&&(await u(null),p({title:`Check your Slack channel for the test message`,type:`info`}))}})]})]})})]})}),Vl=``+new URL(`stripe-thumb-Cu2h4McY.jpg`,import.meta.url).href,Hl=``+new URL(`orb-squircle-DUFLvKu-.png`,import.meta.url).href,Ul=`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`,$=``+new URL(`stripe-verified-DM7Q8nrY.svg`,import.meta.url).href,Wl=1e3,Gl=15*Wl,Kl=({onNext:e})=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(A,{level:3,children:`Getting paid`}),(0,Y.jsx)(`img`,{alt:`Stripe Verified Partner Badge`,src:$})]}),(0,Y.jsxs)(`div`,{className:`mt-6 mb-7`,children:[`Stripe is our exclusive direct payments partner. Ghost collects `,(0,Y.jsx)(`strong`,{children:`no fees`}),` on any payments! If you don’t have a Stripe account yet, you can `,(0,Y.jsx)(`a`,{className:`underline`,href:`https://stripe.com`,rel:`noopener noreferrer`,target:`_blank`,children:`sign up here`}),`.`]}),(0,Y.jsx)(Qe,{label:(0,Y.jsx)(Y.Fragment,{children:`I have a Stripe account, let's go →`}),onClick:e})]}),ql=()=>{let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),{refetch:l}=tr({searchParams:{filter:`type:paid+active:true`},enabled:!1}),{mutateAsync:u}=nr(),{mutateAsync:f}=An(),p=g(),m=e=>{r(e.target.value),t(!!e.target.value)},h=async()=>{let{data:e}=await l(),t=e?.pages[0].tiers[0];if(t){t.monthly_price=500,t.yearly_price=5e3,t.currency=`USD`;let e=0;for(;e<Gl;){await new Promise(e=>{setTimeout(e,Wl)});try{await u(t);break}catch(t){if(t instanceof c&&t.data?.errors?.[0].code===`STRIPE_NOT_CONFIGURED`){e+=Wl;continue}else{p(t);return}}}}},_=async()=>{if(s(``),n)try{await f([{key:`stripe_connect_integration_token`,value:n}]),await h(),await f([{key:`portal_plans`,value:JSON.stringify([`free`,`monthly`,`yearly`])}])}catch(e){if(e instanceof c&&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,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,Y.jsx)(A,{level:3,children:`Connect with Stripe`}),(0,Y.jsx)(vt,{checked:i,direction:`rtl`,label:`Test mode`,labelClasses:`translate-y-[1px] ${i?`text-[#EC6803]`:`text-grey-800`}`,toggleBg:`stripetest`,onChange:e=>a(e.target.checked)})]}),(0,Y.jsxs)(A,{level:6,grey:!0,children:[`Step 1 — `,(0,Y.jsx)(`span`,{className:`text-black dark:text-white`,children:`Generate secure key`})]}),(0,Y.jsxs)(`div`,{className:`mt-2 mb-4`,children:[`Click on the `,(0,Y.jsx)(`strong`,{children:`“Connect with Stripe”`}),` button to generate a secure key that connects your Ghost site with Stripe.`]}),(0,Y.jsx)(Qe,{href:y,tag:`a`,target:`_blank`}),(0,Y.jsxs)(A,{className:`mt-8 mb-2`,level:6,grey:!0,children:[`Step 2 — `,(0,Y.jsx)(`span`,{className:`text-black dark:text-white`,children:`Paste secure key`})]}),(0,Y.jsx)(z,{error:!!o,hint:o||void 0,placeholder:`Paste your secure key here`,onChange:m}),e&&(0,Y.jsx)(q,{className:`mt-5`,color:`green`,label:`Save Stripe settings`,onClick:_})]})},Jl=({onClose:e})=>{let{settings:t}=K(),[n,r]=Fn(t,[`stripe_connect_display_name`,`stripe_connect_livemode`]),{refetch:i,isFetching:a}=qn({searchParams:{filter:`status:paid`,limit:`0`},enabled:!1}),{mutateAsync:o}=In(),s=g();return(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(q,{color:`red`,disabled:a,icon:`link-broken`,iconColorClass:`text-red`,label:`Disconnect`,link:!0,onClick:async()=>{let{data:t}=await i(),r=!!t?.meta?.pagination.total;O.show(me,{title:`Disconnect Stripe`,prompt:r?`Cannot disconnect while there are members with active Stripe subscriptions.`:(0,Y.jsxs)(Y.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)}}})}}),(0,Y.jsx)(q,{icon:`close`,iconColorClass:`dark:text-white`,label:`Close`,size:`sm`,hideLabel:!0,link:!0,onClick:e})]}),(0,Y.jsxs)(`div`,{className:`my-20 flex flex-col items-center`,children:[(0,Y.jsxs)(`div`,{className:`relative h-20 w-[200px]`,children:[(0,Y.jsx)(`img`,{alt:`Ghost Logo`,className:`absolute left-10 size-16`,src:Hl}),(0,Y.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:Ul})]}),(0,Y.jsxs)(A,{className:`text-center`,level:3,children:[`You are connected with Stripe!`,r?null:` (Test mode)`]}),(0,Y.jsxs)(`div`,{className:`mt-1`,children:[`Connected to `,(0,Y.jsx)(`strong`,{children:n||`Test mode`})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,Y.jsx)(A,{level:6,children:`Read next`}),(0,Y.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,Y.jsxs)(`div`,{className:`order-2 p-4 md:order-1`,children:[(0,Y.jsx)(`div`,{className:`text-md font-semibold`,children:`How to setup and manage your Stripe account`}),(0,Y.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,Y.jsxs)(`div`,{className:`mt-3 flex items-center gap-1 text-grey-800 dark:text-grey-500`,children:[(0,Y.jsx)(`img`,{alt:`Ghost Logo`,className:`size-4`,src:at}),(0,Y.jsx)(`span`,{className:`font-semibold`,children:`Ghost Resources`})]})]}),(0,Y.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,Y.jsx)(`img`,{alt:`Bookmark Thumb`,className:`min-h-full min-w-full shrink-0`,src:Vl})})]})]})]})},Yl=({onClose:e})=>{let{localSettings:t,updateSetting:n,handleSave:r,saveState:i}=be(),[a,o]=Fn(t,[`stripe_publishable_key`,`stripe_secret_key`]);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{level:3,children:`Connect Stripe`}),(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!0,children:[(0,Y.jsx)(I,{title:`Publishable key`,value:a?.toString(),onChange:e=>n(`stripe_publishable_key`,e.target.value)}),(0,Y.jsx)(I,{title:`Secure key`,value:o?.toString(),onChange:e=>n(`stripe_secret_key`,e.target.value)}),(0,Y.jsx)(q,{className:`mt-5`,color:`green`,disabled:i===`saving`,label:`Save Stripe settings`,onClick:async()=>{try{Ot.remove(),await r(),e()}catch(e){if(e instanceof c){p({title:`Failed to save settings`,type:`error`,message:`Check you copied both keys correctly`});return}throw e}}})]})]})},Xl=O.create(()=>{let{config:e,settings:t}=K(),n=Nn(t,`stripe_connect_account_id`),{updateRoute:r}=W(),[i,a]=(0,J.useState)(`start`),o=N(),s=ve(),c=Kn(t,e),l=s?.isDisabled(`limitStripeConnect`);(0,J.useEffect)(()=>{(async()=>{if(l&&!c)try{await s?.errorIfWouldGoOverLimit(`limitStripeConnect`)}catch(e){e instanceof de&&(o.remove(),O.show(he,{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||Kn(t||[],e||{})&&!n?(0,Y.jsx)(Yl,{onClose:d}):n?(0,Y.jsx)(Jl,{onClose:d}):i===`start`?(0,Y.jsx)(Kl,{onNext:u}):(0,Y.jsx)(ql,{}),(0,Y.jsx)(L,{afterClose:()=>{r(`tiers`)},cancelLabel:``,footer:(0,Y.jsx)(`div`,{className:`mt-8`}),testId:`stripe-modal`,title:``,width:n?740:520,hideXOnMobile:!0,children:f})}),Zl=``+new URL(`ali-abdaal-DqO7DmHM.png`,import.meta.url).href,Ql=``+new URL(`isaac-saul-WLit1kCf.png`,import.meta.url).href,$l=``+new URL(`joel-warner-DUevCA8i.png`,import.meta.url).href,eu=O.create(()=>{let{updateRoute:e}=W(),t=g(),n=N(),{settings:r,currentUser:i,siteData:a,config:o}=K(),s=o.exploreTestimonialsUrl,c=a.site_uuid,[l]=Fn(r,[`title`]),u=i.name,d=i.email,f=i.roles[0].name,m=i.profile_image,{formState:h,updateForm:_,saveState:v,handleSave:y,errors:b,clearError:x}=jt({initialState:{content:``,prev_platform:``},onSave:async()=>{let t=[`none`,`other`,``].includes(h.prev_platform)?void 0:h.prev_platform,r={ghost_uuid:c,staff_user_email:d,content:h.content,prev_platform:t};if(!s||!(await fetch(s,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(r)})).ok)throw Error(`Something went wrong, please try again later.`);p({message:`Thank you for your testimonial!`,type:`success`}),e(`explore`),n.remove()},onSaveError:t,onValidate:()=>{let e={};return h.content.trim()||(e.content=`This field is required`),e}}),S=[{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`}];return(0,Y.jsx)(L,{afterClose:()=>{e(`explore`)},cancelLabel:``,footer:!1,padding:!1,testId:`explore-testimonials-modal`,title:``,topRightContent:`close`,width:920,children:(0,Y.jsx)(U,{className:`mb-0!`,children:(0,Y.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`pr-6`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${$l})`}}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Joel Warner`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Lever News`})]})]})]}),(0,Y.jsxs)(`div`,{className:`mt-8 ml-6`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] mr-2 flex items-center justify-end gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Isaac Saul`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Tangle`})]}),(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${Ql})`}})]})]}),(0,Y.jsxs)(`div`,{className:`mt-8 hidden pr-6 [@media(min-width:940px)]:visible! [@media(min-width:940px)]:block!`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${Zl})`}}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Ali Abdaal`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`YouTuber`})]})]})]})]}),(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`flex size-[60px] items-center justify-center rounded-full bg-gradient-to-t from-[#CFB0FF] to-[#B27EFF]`,children:(0,Y.jsx)(`svg`,{fill:`none`,height:`26`,viewBox:`0 0 32 26`,width:`32`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Y.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,Y.jsxs)(`div`,{className:`mt-6`,children:[(0,Y.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:`A quote about Ghost`}),(0,Y.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,Y.jsx)(`div`,{className:`mt-8`,children:(0,Y.jsx)(z,{error:!!b.content,hint:b.content,placeholder:`What changed for the better since you switched to Ghost?`,rows:7,value:h.content,autoFocus:!0,onChange:e=>_(t=>({...t,content:e.target.value})),onKeyDown:()=>x(`content`)})}),(0,Y.jsx)(`div`,{className:`mt-4 ml-0.5`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(V,{bgColor:Ke(u||d),image:m??void 0,label:pe(u),labelColor:`white`,size:`md`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`By `,u||d]}),(0,Y.jsxs)(`span`,{className:`text-sm text-grey-700`,children:[f,` — `,l]})]})]})})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4`,children:[(0,Y.jsx)(`div`,{className:`grow`,children:(0,Y.jsx)(Te,{error:!!b.prev_platform,hint:b.prev_platform,options:S,placeholder:`Previous platform`,selectedOption:S.find(e=>e.value===h.prev_platform),testId:`migrated-from`,onSelect:e=>{_(t=>({...t,prev_platform:e?.value||``})),x(`prev_platform`)}})}),(0,Y.jsx)(q,{className:`h-[38px]! rounded-lg`,color:`black`,disabled:v===`saving`,label:`Send testimonial`,loading:v===`saving`,onClick:async()=>{await y()}})]})})]})]})})})});``+new URL(`ghost-transistor-sWk3BgP7.png`,import.meta.url).href;var tu=O.create(()=>{let{updateRoute:e}=W(),{config:t,settings:n}=K(),{mutateAsync:r}=An(),{data:{integrations:i}={integrations:[]}}=F(),{mutateAsync:a}=ke(),o=g(),[s,c]=(0,J.useState)(!1),l=t.hostSettings?.limits?.customIntegrations?.disabled,[u]=Fn(n,[`transistor`]),[p,m]=(0,J.useState)(!!u),[h,_]=(0,J.useState)(`Save`);(0,J.useEffect)(()=>{m(u||!1)},[u]),(0,J.useEffect)(()=>{l&&e(`integrations`)},[l,e]);let v=i.find(({slug:e})=>e===`transistor`),y=v?.api_keys?.find(e=>e.type===`admin`);return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:p!==u,okColor:h===`Saved`?`green`:`black`,okLabel:h,testId:`transistor-modal`,title:``,onOk:async()=>{let e=[{key:`transistor`,value:p}];try{_(`Saving...`),await Promise.all([r(e),new Promise(e=>{setTimeout(e,1e3)})]),_(`Saved`)}catch(e){o(e)}finally{setTimeout(()=>_(`Save`),1e3)}},children:[(0,Y.jsx)(it,{detail:`Give your members access to private podcasts`,icon:(0,Y.jsx)(f,{name:`transistor`,size:56}),title:`Transistor.fm`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[(0,Y.jsxs)(U,{marginBottom:!1,title:`Transistor configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:p,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Connect your Ghost site with `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://transistor.fm`,rel:`noopener noreferrer`,target:`_blank`,children:`Transistor.fm`}),` to offer members private podcasts.`]}),label:`Enable Transistor`,onChange:e=>{m(e.target.checked)}}),p&&(0,Y.jsx)(Ge,{keys:[{label:`Admin API key`,text:y?.secret,hint:s?(0,Y.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>{if(!v||!y)throw Error(`Transistor integration or Admin API key not found`);c(!1),O.show(me,{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:v.id,apiKeyId:y.id}),c(!0),e?.remove()}catch(e){o(e)}}})}},{label:`API URL`,text:window.location.origin+d().subdir}]})]}),p&&(0,Y.jsx)(`div`,{className:`mt-5 flex flex-col items-center`,children:(0,Y.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,Y.jsxs)(`div`,{className:`order-2 px-7 py-5 md:order-1`,children:[(0,Y.jsx)(`div`,{className:`text-md font-semibold`,children:`How to use Transistor in Ghost`}),(0,Y.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,Y.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,Y.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})})]})})]})]})}),nu=O.create(()=>{let{updateRoute:e}=W(),{settings:t}=K(),[n]=Fn(t,[`unsplash`]),{mutateAsync:r}=An(),i=g(),[a,o]=(0,J.useState)(`Save`),[s,c]=(0,J.useState)(!!n);return(0,J.useEffect)(()=>{c(n||!1)},[n]),(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:s!==n,okColor:a===`Saved`?`green`:`black`,okLabel:a,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,Y.jsx)(it,{detail:`Beautiful, free photos`,icon:(0,Y.jsx)(f,{name:`unsplash`,size:48}),title:`Unsplash`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsx)(U,{marginBottom:!1,grouped:!0,children:(0,Y.jsx)(vt,{checked:s,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://unsplash.com`,rel:`noopener noreferrer`,target:`_blank`,children:`Unsplash`}),` image integration for your posts`]}),label:`Enable Unsplash`,onChange:e=>{c(e.target.checked)}})})})]})}),ru=({user:e,setUserData:t})=>{let{config:n,settings:r}=K(),i=Kn(r||[],n||{});return(0,Y.jsxs)(He,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Engagement`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.comment_notifications,direction:`rtl`,hint:`Every time a member comments on one of your posts`,label:`Comments`,onChange:n=>{t?.({...e,comment_notifications:n.target.checked})}}),un(e)&&(0,Y.jsx)(vt,{align:`center`,checked:e.recommendation_notifications,direction:`rtl`,hint:`Every time another publisher recommends you to their audience`,label:`Recommendations`,onChange:n=>{t?.({...e,recommendation_notifications:n.target.checked})}})]})]}),un(e)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Members`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.free_member_signup_notification,direction:`rtl`,hint:`Every time a new free member signs up`,label:`New signups`,onChange:n=>{t?.({...e,free_member_signup_notification:n.target.checked})}}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(vt,{align:`center`,checked:e.paid_subscription_started_notification,direction:`rtl`,hint:`Every time a member starts a new paid subscription`,label:`New paid members`,onChange:n=>{t?.({...e,paid_subscription_started_notification:n.target.checked})}}),(0,Y.jsx)(vt,{align:`center`,checked:e.paid_subscription_canceled_notification,direction:`rtl`,hint:`Every time a member cancels their paid subscription`,label:`Paid member cancellations`,onChange:n=>{t?.({...e,paid_subscription_canceled_notification:n.target.checked})}})]})]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Revenue`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.milestone_notifications,direction:`rtl`,hint:i?`Occasional summaries of your audience & revenue growth`:`Occasional summaries of your audience growth`,label:`Milestones`,onChange:n=>{t?.({...e,milestone_notifications:n.target.checked})}}),i&&(0,Y.jsx)(vt,{align:`center`,checked:e.donation_notifications,direction:`rtl`,hint:`Every time you receive a one-time payment`,label:`Tips & donations`,onChange:n=>{t?.({...e,donation_notifications:n.target.checked})}}),i&&(0,Y.jsx)(vt,{align:`center`,checked:e.gift_subscription_notifications,direction:`rtl`,hint:`Every time someone purchases or redeems a gift subscription`,label:`Gift subscriptions`,onChange:n=>{t?.({...e,gift_subscription_notifications:n.target.checked})}})]})]})]})]})},iu=({user:e,setUserData:t})=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(ru,{setUserData:t,user:e})}),au=[`1234567890`,`qwertyuiop`,`qwertzuiop`,`asdfghjkl;`,`abcdefghij`,`0987654321`,`1q2w3e4r5t`,`12345asdfg`],ou=[`ghost`,`password`,`passw0rd`],su=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},cu=({user:e})=>{let{currentUser:t,config:n,siteData:r}=K(),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[f,m]=(0,J.useState)(``),[h,_]=(0,J.useState)({}),v=(0,J.useRef)(null),y=(0,J.useRef)(null),x=(0,J.useRef)(null),{mutateAsync:S}=nn(),C=g(),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 au)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 ou)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||!su(t)?{newPassword:`Sorry, you cannot use an insecure password.`}:{}};(0,J.useEffect)(()=>{f===`saved`&&setTimeout(()=>{m(``),a(!1)},2500)},[f]),(0,J.useEffect)(()=>{i&&setTimeout(()=>{w?x.current?.focus():v.current?.focus()},100)},[i,w]);let E=()=>{a(!0)},D=`Save password`;f===`saving`?D=`Saving...`:f===`saved`&&(D=`Saved`);let O=(0,Y.jsxs)(Y.Fragment,{children:[w&&(0,Y.jsx)(I,{"data-testid":`old-password`,error:!!h.oldPassword,hint:h.oldPassword,inputRef:x,title:`Old password`,type:`password`,value:o,onChange:e=>{s(e.target.value)}}),(0,Y.jsx)(I,{"data-testid":`new-password`,error:!!h.newPassword,hint:h.newPassword,inputRef:v,title:`New password`,type:`password`,value:c,onChange:e=>{l(e.target.value)}}),(0,Y.jsx)(I,{"data-testid":`confirm-password`,error:!!h.confirmNewPassword,hint:h.confirmNewPassword,inputRef:y,title:`Confirm new password`,type:`password`,value:u,onChange:e=>{d(e.target.value)}}),(0,Y.jsxs)(`div`,{className:`mt-1 flex items-center justify-end gap-3`,children:[(0,Y.jsx)(q,{color:`outline`,label:`Cancel`,onClick:()=>{a(!1),s(``),l(``),d(``),_({})}}),(0,Y.jsx)(q,{color:`green`,"data-testid":`save-password-button`,label:D,onClick:async()=>{m(`saving`);let t=T({password:c,confirmPassword:u});if(_(t),Object.keys(t).length>0){m(``);return}try{await S({newPassword:c,confirmNewPassword:u,oldPassword:o,userId:e?.id}),m(`saved`)}catch(e){m(``),p({type:`error`,title:e instanceof b?e.message:`Couldn't update password. Please try again.`}),C(e,{withToast:!1})}}})]})]});return(0,Y.jsx)(Y.Fragment,{children:i?O:(0,Y.jsxs)(`div`,{className:`relative flex flex-col`,children:[(0,Y.jsx)(I,{containerClassName:`grow`,disabled:!0,title:`Password`,type:`password`,value:`••••••••••••`}),(0,Y.jsx)(q,{className:`absolute top-0 right-0`,color:`green`,"data-testid":`change-password-button`,label:`Change`,link:!0,onClick:E})]})})},lu=({user:e,setUserData:t})=>{let{data:{roles:n}={}}=R(),{config:r}=K(),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)),an(e)){let e={label:`Owner`,value:`owner`};return(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Te,{disabled:!0,hint:(0,Y.jsxs)(Y.Fragment,{children:[`This user is the owner of the site. `,(0,Y.jsx)(`a`,{className:`font-medium text-grey-800 transition-colors hover:text-grey-900 dark:text-grey-500 dark:hover:text-grey-400`,href:`https://ghost.org/help/transfer-publication-ownership/`,rel:`noopener noreferrer`,target:`_blank`,children:`Transfer ownership`}),` first to change their role.`]}),options:[e],selectedOption:e,title:`Role`,onSelect:()=>{}})})}return(0,Y.jsx)(Te,{options:a,selectedOption:a.find(t=>t.value===e.roles[0].name.toLowerCase()),testId:`role-select`,title:`Role`,onSelect:r=>{if(r){let i=n?.find(e=>e.name.toLowerCase()===r.value.toLowerCase());i&&t?.({...e,roles:[i]})}}})},uu=_({dataType:`StaffTokenResponseType`,path:`/users/me/token/`}),du=h({path:()=>`/users/me/token/`,method:`PUT`}),fu=()=>{let{refetch:e}=uu({enabled:!1}),t=g(),[n,r]=(0,J.useState)(``),{mutateAsync:i}=du();return(0,J.useEffect)(()=>{(async()=>{let t=await e();t?.data?.apiKey&&r(`${t.data.apiKey.id}:${t.data.apiKey.secret}`)})()},[e]),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{className:`mb-2`,level:6,grey:!0,children:`Staff access token`}),(0,Y.jsx)(Ge,{hasLabel:!1,keys:[{text:n||``,onRegenerate:()=>{O.show(me,{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`,okColor:`red`,onOk:async e=>{try{let t=await i([]);r(`${t.apiKey.id}:${t.apiKey.secret}`),e?.remove()}catch(e){t(e)}}})}}]})]})},pu=({errors:e,clearError:t,user:n,setUserData:r})=>{let{currentUser:i,siteData:a}=K(),o=jn(a);return(0,Y.jsxs)(He,{children:[(0,Y.jsx)(I,{error:!!e?.email,hint:e?.email||`Used for notifications`,maxLength:191,title:`Email`,value:n.email,onChange:e=>{r({...n,email:e.target.value})},onKeyDown:()=>t(`email`)}),(0,Y.jsx)(cu,{user:n}),un(i)&&(0,Y.jsx)(lu,{setUserData:r,user:n}),(0,Y.jsx)(I,{error:!!e?.name,hint:e?.name||`Use your real name so people can recognize you`,maxLength:191,title:`Full name`,value:n.name,onChange:e=>{r({...n,name:e.target.value})},onKeyDown:()=>t(`name`)}),(0,Y.jsx)(I,{hint:`${o}author/${n.slug}`,maxLength:191,title:`Slug`,value:n.slug,onChange:e=>{r({...n,slug:e.target.value})}}),(0,Y.jsx)(I,{error:!!e?.location,hint:e?.location||`Where in the world do you live?`,maxLength:65535,title:`Location`,value:n.location||``,onChange:e=>{r({...n,location:e.target.value})},onKeyDown:()=>t(`location`)}),(0,Y.jsx)(z,{error:!!e?.bio,hint:e?.bio||(0,Y.jsxs)(Y.Fragment,{children:[`Recommended: 250 characters. You‘ve used `,(0,Y.jsx)(`span`,{className:`font-bold`,children:n.bio?.length||0})]}),maxLength:65535,title:`Bio`,value:n.bio||``,onChange:e=>{r({...n,bio:e.target.value})},onKeyDown:()=>t(`bio`)}),n.id===i.id&&(0,Y.jsx)(fu,{})]})},mu=e=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(pu,{...e})}),hu=({errors:e,clearError:t,validateField:n,user:r,setUserData:i})=>{let[a,o]=(0,J.useState)(()=>Object.fromEntries(st.map(e=>{let t=r[e.key];return[e.key,e.toDisplayValue(t)]})));return(0,Y.jsxs)(He,{children:[(0,Y.jsx)(I,{"data-testid":`website-input`,error:!!e?.website,hint:e?.website,maxLength:2e3,placeholder:`https://example.com`,title:`Website`,value:r.website||``,onChange:e=>{i({...r,website:e.target.value})},onKeyDown:()=>t(`website`)}),st.map(s=>(0,Y.jsx)(I,{"data-testid":s.testId,error:!!e?.[s.key],hint:e?.[s.key],maxLength:2e3,placeholder:s.placeholder,title:s.staffTitle,value:a[s.key],onBlur:e=>{if(n(s.key,e.target.value)){let{displayValue:t,storedValue:n}=Ue(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)},s.key))]})},gu=e=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(hu,{...e})}),_u={name:({name:e})=>{let t=``;return e||(t=`Name is required`),e&&e.length>191&&(t=`Name is too long`),t},email:({email:e})=>ua.default.isEmail(e||``)?``:`Enter a valid email address`,url:({url:e})=>!e||ua.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||ua.default.isURL(e)&&e.length<=2e3?``:`Enter a valid URL`,...Object.fromEntries(st.map(e=>[e.key,t=>nt(e.key,t[e.key])]))},vu=({user:e})=>{let{updateRoute:t,route:n}=W(),r=e=>{let t=e.split(`/`).pop()||``;return t===`social-links`||t===`email-notifications`?t:`profile`},{ownerUser:i}=_t(),{currentUser:a}=K(),o=g(),{formState:s,setFormState:c,saveState:l,handleSave:u,updateForm:d,errors:m,setErrors:h,clearError:_,okProps:v}=jt({initialState:e,savingDelay:500,savedDelay:500,onValidate:t=>Object.entries(_u).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 i=>{let a=(await C?.(i))?.users?.[0];if(a&&(c(()=>a),a.slug!==e.slug)){let e=r(n),i=e===`profile`?``:`/${e}`;t({route:`staff/${a.slug}${i}`,replace:!0})}},onSaveError:o}),y=e=>d(()=>e),b=(e,t)=>{let n=_u[e]?.({[e]:t});return n?(h({...m,[e]:n}),!1):(_(e),!0)},x=N(),{mutateAsync:S}=pt(),{mutateAsync:C}=ln(),{mutateAsync:w}=dn(),{mutateAsync:T}=sn(),E=ve(),D=lt(),k=(0,J.useCallback)(()=>{pn(a)?t(`staff`):t({isExternal:!0,route:``})},[a,t]),j=async e=>{if(e.status===`inactive`&&e.roles[0].name!==`Contributor`)try{await E?.errorIfWouldGoOverLimit(`staff`)}catch(e){if(e instanceof de){O.show(he,{formSheet:!0,prompt:e.message||`Your current plan doesn't support more users.`,onOk:()=>t({route:`/pro`,isExternal:!0})});return}else throw e}let n=`This user will no longer be able to log in but their posts will be kept.`;e.status===`inactive`&&(n=`This user will be able to log in again and will have the same permissions they had previously.`),O.show(me,{title:`Are you sure you want to suspend this user?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:`WARNING:`}),` `,n]}),okLabel:e.status===`inactive`?`Un-suspend`:`Suspend`,okRunningLabel:e.status===`inactive`?`Un-suspending...`:`Suspending...`,okColor:`red`,onOk:async t=>{let n={...e,status:e.status===`inactive`?`active`:`inactive`};try{await C(n),c(()=>n),t?.remove(),p({title:e.status===`inactive`?`User un-suspended`:`User suspended`,type:`success`})}catch(e){o(e)}}})},M=(t,{owner:n})=>{O.show(me,{title:`Are you sure you want to delete this user?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`mb-3`,children:[(0,Y.jsx)(`span`,{className:`font-bold`,children:t.name||t.email}),` will be permanently deleted and all their posts will be automatically assigned to `,(0,Y.jsx)(`span`,{className:`font-bold`,children:n.name}),`.`]}),(0,Y.jsxs)(`p`,{children:[`To make these easy to find in the future, each post will be given an internal tag of `,(0,Y.jsxs)(`span`,{className:`font-bold`,children:[`#`,e.slug]})]})]}),okLabel:`Delete user`,okColor:`red`,onOk:async e=>{try{await w(t?.id),e?.remove(),x?.remove(),k(),p({title:`User deleted`,type:`success`})}catch(e){o(e)}}})},F=()=>{O.show(me,{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`,okColor:`red`,onOk:async t=>{try{await T(e.id),t?.remove(),p({title:`Ownership transferred`,type:`success`})}catch(e){o(e)}}})},I=async(e,t)=>{try{let n=Ne(await S({file:t}));switch(e){case`cover_image`:d(e=>({...e,cover_image:n}));break;case`profile_image`:d(e=>({...e,profile_image:n}));break}}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),o(t)}},R=e=>{switch(e){case`cover_image`:d(e=>({...e,cover_image:``}));break;case`profile_image`:d(e=>({...e,profile_image:``}));break}},z=un(a)||mn(a)&&rn(e),B=[];if(an(a)&&fn(s)&&s.status!==`inactive`&&B.push({id:`make-owner`,label:`Make owner`,onClick:F}),B.push({id:`view-user-activity`,label:`View user activity`,onClick:()=>{x.remove(),t(`history/view/${s.id}`)}}),s.id!==a.id&&(un(a)&&!an(e)||mn(a)&&rn(e))){let t=s.status===`inactive`?`Un-suspend user`:`Suspend user`;B.push({id:`suspend-user`,label:t,onClick:()=>{j(s)}},{id:`delete-user`,label:`Delete user`,destructive:!0,onClick:()=>{M(e,{owner:i})}})}let ee=`flex flex-nowrap items-center justify-center px-3 h-8 opacity-80 hover:opacity-100 bg-[rgba(0,0,0,0.75)] rounded text-white transition-all cursor-pointer font-medium nowrap`,V=s.status===`inactive`?` (Suspended)`:``,[te,ne]=(0,J.useState)(r(n));return(0,Y.jsx)(L,{afterClose:k,animate:pn(a),backDrop:pn(a),buttonsDisabled:v.disabled,cancelLabel:`Close`,dirty:l===`unsaved`,hideXOnMobile:!0,okColor:v.color,okLabel:v.label||`Save`,size:pn(a)?`md`:`bleed`,stickyFooter:!0,testId:`user-detail-modal`,width:pn(a)?600:`full`,onOk:async()=>{await u({fakeWhenUnchanged:!0})},children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`relative ${pn(a)?`-mx-8 -mt-8 rounded-t`:`-mx-10 -mt-10`}`,children:(0,Y.jsx)(`div`,{className:`flex flex-wrap items-end justify-between gap-8 p-8 ${s.cover_image?`bg-cover bg-center`:``} ${!pn(a)&&`min-h-[30vmin]`}`,style:{backgroundImage:s.cover_image?`url(${s.cover_image})`:`none`},children:(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-nowrap items-start justify-between gap-3`,children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{deleteButtonClassName:`md:invisible absolute -right-1 -top-2 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white group-hover:visible!`,deleteButtonContent:(0,Y.jsx)(f,{colorClass:`text-white`,name:`trash`,size:`sm`}),editButtonClassName:`md:invisible absolute -left-1 -top-2 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white group-hover:visible!`,fileUploadClassName:`rounded-full bg-black flex items-center justify-center opacity-80 transition hover:opacity-100 -ml-2 cursor-pointer h-[80px] w-[80px]`,fileUploadProps:{dragIndicatorClassName:`rounded-full`},id:`avatar`,imageClassName:`w-full h-full object-cover rounded-full shrink-0`,imageContainerClassName:`relative group bg-cover bg-center -ml-1 h-[80px] w-[80px] shrink-0`,imageURL:s.profile_image??void 0,pintura:{isEnabled:D.isEnabled,openEditor:async()=>D.openEditor({image:s.profile_image||``,handleSave:async e=>{I(`profile_image`,e)}})},unstyled:!0,width:`80px`,onDelete:()=>{R(`profile_image`)},onUpload:e=>{I(`profile_image`,e)},children:(0,Y.jsx)(f,{colorClass:`black`,name:`user-add`,size:`lg`})})}),(0,Y.jsxs)(`div`,{className:`flex flex-nowrap items-start gap-3`,children:[(0,Y.jsx)(Ee,{buttonContainerClassName:`flex items-end gap-4 justify-end flex-nowrap`,deleteButtonClassName:ee,deleteButtonContent:`Delete cover image`,editButtonClassName:ee,fileUploadClassName:`rounded flex flex-nowrap items-center justify-center px-3 h-8 transition-all cursor-pointer font-medium border border-grey-300 bg-transparent text-black dark:border-grey-800 dark:text-white`,id:`cover-image`,imageClassName:`hidden`,imageURL:s.cover_image||``,pintura:{isEnabled:D.isEnabled,openEditor:async()=>D.openEditor({image:s.cover_image||``,handleSave:async e=>{I(`cover_image`,e)}})},unstyled:!0,onDelete:()=>{R(`cover_image`)},onUpload:e=>{I(`cover_image`,e)},children:`Upload cover image`}),z&&(0,Y.jsx)(`div`,{className:`z-10`,children:(0,Y.jsx)(ft,{items:B,position:`end`,trigger:(0,Y.jsxs)(`button`,{className:P(`flex h-8 cursor-pointer items-center justify-center rounded px-3`,s.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,Y.jsx)(`span`,{className:`sr-only`,children:`Actions`}),(0,Y.jsx)(f,{colorClass:s.cover_image?`text-white`:void 0,name:`ellipsis`,size:`md`})]})})})]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(A,{level:3,styles:P(`break-words md:break-normal`,s.cover_image?`text-white`:`text-black dark:text-white`),children:[e.name,V]}),(0,Y.jsx)(`span`,{className:P(`text-md font-medium capitalize`,s.cover_image?`text-white`:`text-black dark:text-white`),children:e.roles[0].name.toLowerCase()})]})]})})}),(0,Y.jsx)(`div`,{className:`${!pn(a)&&`mx-auto max-w-[536px]`} mt-6 flex flex-col`,children:(0,Y.jsx)(Xe,{selectedTab:te,tabs:[{id:`profile`,title:`Profile`,contents:(0,Y.jsx)(mu,{clearError:_,errors:m,setUserData:y,user:s,validateField:b})},{id:`social-links`,title:`Social Links`,contents:(0,Y.jsx)(gu,{clearError:_,errors:m,setUserData:y,user:s,validateField:b})},{id:`email-notifications`,title:`Email Notifications`,contents:(0,Y.jsx)(iu,{setUserData:y,user:s})}],onTabChange:n=>{let r=n===`profile`?``:`/${n}`;t(`staff/${e.slug}${r}`),ne(n)}})})]})})},yu={AddIntegrationModal:Zi,AddNewsletterModal:Qi,ContentApiModal:$i,AddRecommendationModal:ra,CustomIntegrationModal:ya,DesignAndThemeModal:Ks,EditRecommendationModal:ze,FirstPromoterModal:Qs,HistoryModal:pc,InviteUserModal:gc,NavigationModal:bc,NewsletterDetailModal:Ec,PinturaModal:Dl,PortalModal:zl,SlackModal:Bl,StripeConnectModal:Xl,TestimonialsModal:eu,TierDetailModal:Me,TransistorModal:tu,UnsplashModal:nu,UserDetailModal:O.create(({params:e})=>{let{currentUser:t}=K(),{updateRoute:n}=W(),r=g(),i=t.slug===e?.slug,{data:a,error:o}=cn(e?.slug||``,{enabled:!i&&!!e?.slug,defaultErrorHandler:!1}),s=i?t:a?.users?.[0],c=o instanceof x&&o.response?.status===404;(0,J.useEffect)(()=>{o&&!c&&r(o)},[o,c,r]);let l=!i&&!!e?.slug&&!s&&(c||a!==void 0),u=(0,J.useRef)(void 0);s&&(u.current=s);let d=s||(l?void 0:u.current),f=l?e?.slug??null:null,m=(0,J.useRef)(null);return(0,J.useEffect)(()=>{!f||m.current===f||(m.current=f,p({type:`error`,message:`User not found`}),pn(t)?n({route:`staff`,replace:!0}):n({isExternal:!0,route:``}))},[f,t,n]),d?(0,Y.jsx)(vu,{user:d}):null}),ZapierModal:De,AnnouncementBarModal:la,EmbedSignupFormModal:Zs,OffersContainerModal:Tl,AboutModal:Xi,OfferSuccess:Dc};export{yu as default};
|
|
31
|
+
`;r.open(),r.write(i),r.close()},height:`100%`,parentClassName:`relative h-full min-h-[400px] w-full`,width:`100%`}),Js=({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}=Mt({path:`/labels/`,filterKey:`name`,responseKey:`labels`});return(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{className:`mb-8`,level:4,children:`Embed signup form`}),(0,Y.jsxs)(U,{gap:`sm`,children:[(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,Y.jsx)(`div`,{children:`Layout`}),(0,Y.jsx)(re,{activeKey:e,buttons:[{key:`all-in-one`,label:`Branded`,size:`md`,className:`w-auto px-3!`,onClick:()=>s(`all-in-one`)},{key:`minimal`,label:`Minimal`,size:`md`,className:`w-auto px-3!`,onClick:()=>s(`minimal`)}],clearBg:!1})]}),e===`all-in-one`&&(0,Y.jsx)(Yr,{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,Y.jsx)(se,{hint:`Will be applied to all members signing up via this form`,loadOptions:Ie(async(e,t)=>{t((await d(e)).map(e=>({label:e.name,value:e.name})))},500),placeholder:`Pick one or more labels (optional)`,title:`Labels at signup`,values:i||[],async:!0,canCreate:!0,defaultOptions:!0,onChange:a}),(0,Y.jsx)(z,{className:`text-grey-800`,fontStyle:`mono`,hint:`Paste this code onto any website where you'd like your signup to appear.`,title:`Embed code`,value:`${o}`,onChange:()=>{}})]})]}),(0,Y.jsx)(ge,{height:74,children:(0,Y.jsxs)(`div`,{className:`flex w-full justify-end gap-3`,children:[(0,Y.jsx)(q,{className:`lg:hidden`,color:`outline`,label:`Close`,onClick:u}),(0,Y.jsx)(q,{color:l?`green`:`black`,label:l?`Copied!`:`Copy code`,onClick:c})]})})]})};function Ys(e){return e?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):``}var Xs=({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":Ve(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`]=Ve(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}="${Ys(t)}"`}let p=`<div style="${Ys(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},Zs=O.create(()=>{let e=N(),[t,n]=(0,J.useState)(`#08090c`),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)(`all-in-one`),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(``),[d,f]=(0,J.useState)(!1),{updateRoute:p}=W(),{config:m}=K(),{localSettings:h,siteData:g}=be(),[_,v,y,b,x]=Nn(h,[`accent_color`,`title`,`description`,`locale`,`icon`]),[S,C]=(0,J.useState)({active:!1});return(0,J.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=Xs({preview:!0,...e});c(n);let i=Xs({preview:!1,...e});u(i)},[g,_,r,m,v,t,a,b,x,y]),(0,Y.jsx)(L,{afterClose:()=>{p(`embed-signup-form`)},cancelLabel:``,footer:!1,height:645,padding:!1,testId:`embed-signup-form`,title:``,topRightContent:`close`,width:1120,children:(0,Y.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[5.2fr_2.8fr]`,children:[(0,Y.jsx)(qs,{html:s,style:a}),(0,Y.jsx)(Js,{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(({value:e})=>({label:e,value:e}));i(t)}else i([])},handleLayoutSelect:o,isCopied:d,selectedColor:t,selectedLabels:r,selectedLayout:a,setCustomColor:C})]})})}),Qs=O.create(()=>{let{updateRoute:e}=W(),{settings:t}=K(),{mutateAsync:n}=In(),r=g(),[i,a]=(0,J.useState)(``),[o]=Nn(t,[`firstpromoter`]),[s]=Nn(t,[`firstpromoter_id`]),[c,l]=(0,J.useState)(`Save`),[u,d]=(0,J.useState)(!!o);(0,J.useEffect)(()=>{d(o||!1),a(s||null)},[o,s]);let p=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,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:u!==o||i!==s,okColor:c===`Saved`?`green`:`black`,okLabel:c,testId:`firstpromoter-modal`,title:``,onOk:async()=>{try{await p()}catch(e){r(e)}},children:[(0,Y.jsx)(it,{detail:`Launch your own member referral program`,icon:(0,Y.jsx)(f,{className:`-mt-2`,name:`firstpromoter`,size:56}),title:`FirstPromoter`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{marginBottom:!1,title:`FirstPromoter configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:u,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://firstpromoter.com/?fpr=ghost&fp_sid=admin`,rel:`noopener noreferrer`,target:`_blank`,children:`FirstPromoter`}),` for tracking referrals`]}),label:`Enable FirstPromoter`,onChange:e=>{d(e.target.checked)}}),u&&(0,Y.jsx)(I,{hint:(0,Y.jsxs)(Y.Fragment,{children:[`Affiliate and referral tracking, find your ID `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://ghost.org/help/firstpromoter-id/`,rel:`noopener noreferrer`,target:`_blank`,children:`here`})]}),placeholder:`XXXXXXXX`,title:`FirstPromoter account ID`,value:i||``,onChange:e=>{a(e.target.value)}})]})})]})}),$s=`ActionsResponseType`,ec=(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)},tc=v({dataType:$s,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&&ec(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}}}),nc=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}`}}},rc=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===`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`),e.context?.count&&e.context?.count>1?`${e.context?.count} ${t}s ${n}`:`${t.slice(0,1).toUpperCase()}${t.slice(1)} ${n}`},ic=e=>{if(e.resource_type===`setting`&&e.context?.group&&e.context?.key)return{group:e.context?.group,key:e.context?.key}},ac=e=>typeof e.context?.count==`number`&&e.context?.count>1,oc=({action:e})=>{let t=`pen`;switch(e.event){case`added`:t=`add`;break;case`deleted`:t=`trash`;break}return(0,Y.jsx)(f,{name:t,size:`xs`})},sc=({action:e})=>(0,Y.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,Y.jsx)(V,{bgColor:Ke(e.actor?.name||e.actor?.slug||``),image:e.actor?.image??void 0,label:pe(e.actor?.name||e.actor?.slug),labelColor:`white`,size:`md`}),(0,Y.jsx)(`div`,{className:`absolute -right-1 -bottom-1 z-30 flex items-center justify-center rounded-full border border-grey-100 bg-white p-1 shadow-sm dark:border-grey-900 dark:bg-black`,children:(0,Y.jsx)(oc,{action:e})})]}),cc=({label:e,item:t,excludedItems:n,toggleItem:r})=>(0,Y.jsx)(vt,{checked:!n.includes(t),direction:`rtl`,label:e,onChange:e=>r(t,e.target.checked)}),lc=({excludedEvents:e,excludedResources:t,toggleEventType:n,toggleResourceType:r})=>{let{updateRoute:i}=W(),a=Mt({path:`/users/`,filterKey:`name`,responseKey:`users`}),o=async(e,t)=>{t((await a.loadData(e)).map(e=>({label:e.name,value:e.id})))},[s,c]=(0,J.useState)(),l=()=>{c(null)};return(0,Y.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,Y.jsx)(Pe,{position:`end`,trigger:(0,Y.jsx)(q,{color:`outline`,label:`Filter`}),children:(0,Y.jsxs)(`div`,{className:`flex w-[220px] flex-col gap-8 p-5`,children:[(0,Y.jsxs)(Ni,{children:[(0,Y.jsx)(cc,{excludedItems:e,item:`added`,label:`Added`,toggleItem:n}),(0,Y.jsx)(cc,{excludedItems:e,item:`edited`,label:`Edited`,toggleItem:n}),(0,Y.jsx)(cc,{excludedItems:e,item:`deleted`,label:`Deleted`,toggleItem:n})]}),(0,Y.jsxs)(Ni,{children:[(0,Y.jsx)(cc,{excludedItems:t,item:`post`,label:`Posts`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`page`,label:`Pages`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`tag`,label:`Tags`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`offer,product`,label:`Tiers & offers`,toggleItem:r}),(0,Y.jsx)(cc,{excludedItems:t,item:`api_key,integration,setting,user,webhook`,label:`Settings & staff`,toggleItem:r})]})]})}),(0,Y.jsx)(`div`,{className:`w-[200px]`,children:(0,Y.jsx)(Te,{loadOptions:Ie(o,500),placeholder:`Search staff`,value:s,async:!0,defaultOptions:!0,isClearable:!0,onSelect:e=>{e?(c(e),i(`history/view/${e.value}`)):(l(),i(`history/view`))}})})]})},uc=({action:e})=>{let{updateRoute:t}=W(),n=ic(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:`${t} API ${t===1?`key`:`keys`} rotated`,n===null?null:`${n} ${n===1?`user`:`users`} locked`].filter(Boolean);return(0,Y.jsx)(Y.Fragment,{children:r.length?r.join(`, `):`Authentication reset`})}else if(n){let{group:e,key:t}=n;return(0,Y.jsxs)(Y.Fragment,{children:[e.slice(0,1).toUpperCase(),e.slice(1),e!==t&&(0,Y.jsxs)(`span`,{children:[` `,(0,Y.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=nc(e);return n?(0,Y.jsx)(`a`,{className:`cursor-pointer font-bold`,onClick:e=>{e.preventDefault(),t(n)},children:e.resource?.title||e.resource?.name}):(0,Y.jsx)(Y.Fragment,{children:e.resource?.title||e.resource?.name||e.context?.primary_name})}else return(0,Y.jsx)(`span`,{className:`text-grey-500`,children:`(unknown)`})},dc=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}`},fc=200,pc=O.create(({params:e})=>{let t=N(),{updateRoute:n}=W(),[r,i]=(0,J.useState)([]),[a,o]=(0,J.useState)([`label`]),{data:s,fetchNextPage:c,isFetchingNextPage:l}=tc({searchParams:{include:`actor,resource`,limit:fc.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:<'${dc(new Date(e.actions[e.actions.length-1].created_at))}'`].join(`+`)}),keepPreviousData:!0}),u=(0,J.useCallback)(()=>{s?.isEnd||c()},[s?.isEnd,c]),d=(e,t,n)=>{e(e=>n?e.concat(t):e.filter(e=>e!==t))},f=r.length>0||a.length>0||e?.user;return(0,Y.jsx)(L,{afterClose:()=>{n(`history`)},cancelLabel:``,okLabel:`Close`,scrolling:!0,size:`md`,stickyFooter:!0,stickyHeader:!0,testId:`history-modal`,title:`History`,topRightContent:(0,Y.jsx)(lc,{excludedEvents:r,excludedResources:a,toggleEventType:(e,t)=>d(i,e,!t),toggleResourceType:(e,t)=>d(o,e,!t),userId:e?.user}),onOk:()=>{t.remove(),n(`history`)},children:(0,Y.jsx)(`div`,{className:`relative mt-6`,children:(0,Y.jsx)(ne,{hint:s?.isEnd&&s.actions.length>0?`End of history log`:void 0,children:s?.actions?s.actions.length>0?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Li,{offset:250,onTrigger:u}),s.actions.map(e=>!e.skip&&(0,Y.jsx)(Se,{avatar:(0,Y.jsx)(sc,{action:e}),detail:[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(` | `),title:(0,Y.jsxs)(`div`,{children:[rc(e),ac(e)?``:`: `,!ac(e)&&(0,Y.jsx)(uc,{action:e}),e.count?(0,Y.jsxs)(Y.Fragment,{children:[` `,e.count,` times`]}):null,(0,Y.jsxs)(`span`,{children:[` — by `,e.actor?.name||e.actor?.slug]})]}),separator:!0},e.id)),l&&(0,Y.jsx)(`div`,{className:`flex items-center justify-center p-5`,children:(0,Y.jsx)(Fe,{size:`md`})})]}):(0,Y.jsx)(ee,{icon:`time-back`,children:f?`No entries match your current filters.`:`No history entries found.`}):s===void 0?(0,Y.jsx)(`div`,{className:`flex items-center justify-center px-5 pt-12 pb-10`,children:(0,Y.jsx)(Fe,{})}):(0,Y.jsx)(ee,{children:`No entries found.`})})})})}),mc=`USER_ALREADY_REGISTERED`,hc=`A user with that email address already exists.`,gc=O.create(()=>{let e=O.useModal(),t=R(),n=R({searchParams:{limit:`100`,permissions:`assign`}}),r=ve(),{updateRoute:i}=W(),{config:a}=K(),o=a.labs.superEditors,s=(0,J.useRef)(null),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[f,m]=(0,J.useState)(`contributor`),[h,_]=(0,J.useState)({}),{data:{users:v}={}}=on(),{data:{invites:y}={}}=oe(),{mutateAsync:S}=we(),C=g();if((0,J.useEffect)(()=>{s.current&&s.current.focus()},[]),(0,J.useEffect)(()=>{u===`saved`&&setTimeout(()=>{d(``)},2e3)},[u]),(0,J.useEffect)(()=>{f!==`contributor`&&r?.isLimited(`staff`)?r.errorIfWouldGoOverLimit(`staff`).then(()=>{_(e=>({...e,role:void 0}))}).catch(e=>{if(e instanceof de){_(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(!ua.default.isEmail(c)){_({email:`Please enter a valid email address.`});return}if(v?.some(({email:e})=>e===c)){_({email:hc});return}if(y?.some(({email:e})=>e===c)){_({email:`A user with that email address was already invited.`});return}if(!h.role){d(`saving`);try{await S({email:c,roleId:w.find(({name:e})=>e.toLowerCase()===f.toLowerCase()).id}),d(`saved`),p({title:`Invitation sent`,message:`${c}`,type:`success`}),e.remove(),i(`staff?tab=invited`)}catch(e){if((e instanceof b?e.data?.errors[0]:void 0)?.code===mc){d(``),_({email:hc});return}d(`error`);let t=(0,Y.jsxs)(`span`,{children:[`If the problem persists, `,(0,Y.jsxs)(`a`,{href:`https://ghost.org/contact`,children:[(0,Y.jsx)(`u`,{children:`contact support`}),`.`]}),`.`]});e instanceof x&&e.data?.errors?.[0]?.type===`EmailError`&&(t=(0,Y.jsx)(`span`,{children:`Check your Mailgun configuration.`})),p({title:`Failed to send invitation`,message:t,type:`error`}),C(e,{withToast:!1});return}}}},k=[{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&&(k[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 A=k.filter(e=>T.some(t=>t.name===e.label||t.name===`Super Editor`&&e.label===`Editor (beta mode)`));return h.email&&(E=`Retry`),(0,Y.jsx)(L,{afterClose:()=>{i(`staff`)},cancelLabel:``,okColor:u===`error`||h.email?`red`:`black`,okLabel:E,testId:`invite-user-modal`,title:`Invite a new staff user`,width:540,onOk:D,children:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6 py-4`,children:[(0,Y.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,Y.jsx)(I,{error:!!h.email,hint:h.email,inputRef:s,placeholder:`jamie@example.com`,title:`Email address`,value:c,onChange:e=>{l(e.target.value)},onKeyDown:()=>_(e=>({...e,email:void 0}))}),(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Mi,{error:!!h.role,hint:h.role,id:`role`,options:A,selectedOption:f,separator:!0,title:`Role`,onSelect:e=>{m(e)}})})]})})}),_c=({items:e,setItems:t})=>{let n=e=>!!(e.label&&!e.label.match(/^\s*$/)||e.url!==`/`),r=tt({items:e.map(e=>({...e,errors:{}})),setItems:e=>t(e.map(({url:e,label:t})=>({url:e,label:t}))),blank:{url:`/`,label:``,errors:{}},canAddNewItem:n}),i=new RegExp(/^(\/|#|[a-zA-Z0-9-]+:)/),a=e=>{let t={};return(!e.label||e.label.match(/^\s*$/))&&(t.label=`You must specify a label`),(!e.url||e.url.match(/\s/)||!ua.default.isURL(e.url,{require_protocol:!0})&&!e.url.match(i))&&(t.url=`You must specify a valid URL or relative path`),t},o=(e,t)=>{let n=r.items.find(t=>t.id===e);r.updateItem(e,{...n.item,...t})},s=()=>{let e=a(r.newItem);Object.values(e).some(e=>e)?r.setNewItem({...r.newItem,errors:e}):r.addItem()},c=e=>{r.removeItem(e)},l=(e,t)=>{r.moveItem(e,t)},u=(e,t)=>{if(e===`new`)r.setNewItem({...r.newItem,errors:{...r.newItem.errors,[t]:void 0}});else{let n=r.items.find(t=>t.id===e).item;r.updateItem(e,{...n,errors:{...n.errors,[t]:void 0}})}};return{items:r.items.map(({item:e,id:t})=>({...e,id:t})),updateItem:o,addItem:s,removeItem:c,moveItem:l,newItem:{...r.newItem,id:`new`},setNewItem:e=>r.setNewItem({...r.newItem,...e}),clearError:u,validate:()=>{let e=!0;if(r.items.forEach(({item:t,id:n})=>{let i=a(t);Object.values(i).some(e=>e)&&(e=!1,r.updateItem(n,{...t,errors:i}))}),n(r.newItem)){let t=a(r.newItem);Object.values(t).some(e=>e)&&(e=!1,r.setNewItem({...r.newItem,errors:t}))}return e}}},vc=({baseUrl:e,item:t,updateItem:n,addItem:r,clearError:i,labelPlaceholder:a,unstyled:o,textFieldClasses:s,action:c,className:l,...u})=>(0,Y.jsxs)(`div`,{className:P(`flex w-full items-start gap-3`,l),"data-testid":`navigation-item-editor`,...u,children:[(0,Y.jsx)(`div`,{className:`flex flex-1 pt-1`,children:(0,Y.jsx)(I,{className:s,containerClassName:`grow`,error:!!t.errors.label,hint:t.errors.label,placeholder:a,title:`Label`,unstyled:o,value:t.label,hideTitle:!0,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`)}})}),(0,Y.jsx)(`div`,{className:`flex flex-1 pt-1`,children:(0,Y.jsx)(fe,{baseUrl:e,className:s,containerClassName:`grow`,error:!!t.errors.url,hint:t.errors.url,title:`URL`,unstyled:o,value:t.url,hideTitle:!0,onChange:e=>n?.({url:e||``}),onKeyDown:t=>{let r=ye(t.target.value,e,!0);n?.({url:r.save||``})},onKeyUp:a=>{if(a.key===`Enter`){a.preventDefault();let t=ye(a.target.value,e,!0);n?.({url:t.save||``}),r?.()}t.errors.url&&i?.(`url`)}})}),c]}),yc=({baseUrl:e,navigation:t})=>(0,Y.jsxs)(`div`,{className:`w-full pt-2`,children:[(0,Y.jsx)(mt,{items:t.items,itemSeparator:!1,renderItem:n=>(0,Y.jsx)(vc,{action:(0,Y.jsx)(q,{className:`mt-1 self-center`,icon:`trash`,iconColorClass:`dark:text-white`,size:`sm`,onClick:()=>t.removeItem(n.id)}),baseUrl:e,clearError:e=>t.clearError(n.id,e),item:n,updateItem:e=>t.updateItem(n.id,e)}),onMove:t.moveItem}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(f,{colorClass:`text-grey-300 dark:text-grey-900 mt-1`,name:`add`,size:`sm`}),(0,Y.jsx)(vc,{action:(0,Y.jsx)(q,{className:`mx-2 mt-1 self-center rounded bg-green p-1`,"data-testid":`add-button`,icon:`add`,iconColorClass:`text-white`,size:`sm`,unstyled:!0,onClick:t.addItem}),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})]})]}),bc=O.create(()=>{let e=N(),{updateRoute:t}=W(),{localSettings:n,updateSetting:r,saveState:i,handleSave:a,siteData:o}=be(),[s,c]=Nn(n,[`navigation`,`secondary_navigation`]).map(e=>JSON.parse(e||`[]`)),l=_c({items:s,setItems:e=>{r(`navigation`,JSON.stringify(e))}}),u=_c({items:c,setItems:e=>r(`secondary_navigation`,JSON.stringify(e))}),[d,f]=(0,J.useState)(`primary-nav`);return(0,Y.jsx)(L,{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()=>{l.validate()&&u.validate()&&(await a(),e.remove(),t(`navigation`))},children:(0,Y.jsx)(`div`,{className:`mt-6 mb-1`,children:(0,Y.jsx)(Xe,{selectedTab:d,tabs:[{id:`primary-nav`,title:`Primary`,contents:(0,Y.jsx)(yc,{baseUrl:o.url,navigation:l})},{id:`secondary-nav`,title:`Secondary`,contents:(0,Y.jsx)(yc,{baseUrl:o.url,navigation:u})}],onTabChange:f})})})});``+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 xc=({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:p,authorPlaceholder:m,showCommentCta:h,showFeatureImage:g,showFeedback:_,showShareButton:v,showLatestPosts:y,showSubscriptionDetails:b,siteTitle:x,footerContent:S,showBadge:C,backgroundColor:w,headerBackgroundColor:T,accentColor:E,textColor:D,secondaryTextColor:O,headerTextColor:k,secondaryHeaderTextColor:A,postTitleColor:j,sectionTitleColor:M,dividerColor:N,buttonColor:F,buttonTextColor:I,linkColor:L,buttonCorners:R,buttonStyle:z,imageCorners:B,linkStyle:ee,dividerStyle:V})=>{let te=i||a,{config:ne}=K(),H=new Date().toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`numeric`}),re=new Date().getFullYear(),ie=S?S.replace(/<a/g,`<a target="_blank" rel="noopener noreferrer"`):``,ae;ae=Gn(ne)?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`From: `}),(0,Y.jsxs)(`span`,{children:[e,` (`,t,`)`]})]}),(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`Reply-to: `}),n||t]})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:e}),(0,Y.jsxs)(`span`,{children:[` `,t]})]}),(0,Y.jsxs)(`p`,{className:`leading-normal`,children:[(0,Y.jsx)(`span`,{className:`font-semibold text-grey-900`,children:`To:`}),` Jamie Larson jamie@example.com`]})]});let oe=`mb-5 text-pretty leading-[1.7] text-black`;return oe=u===`serif`&&p===`serif`?P(oe,`mb-8 font-serif text-[2.0rem] leading-tight`):u!==`serif`&&p===`serif`?P(oe,`mb-8 text-[1.7rem] leading-tight tracking-tight`):u===`serif`&&p!==`serif`?P(oe,`mb-8 font-serif text-[2.0rem] leading-tight`):P(oe,`mb-8 text-[1.9rem] leading-tight tracking-tight`),l===`center`&&(oe=P(oe,`text-center`)),(0,Y.jsx)(`div`,{className:`relative flex grow flex-col`,children:(0,Y.jsx)(`div`,{className:`absolute inset-0 m-5 flex items-center justify-center`,children:(0,Y.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,Y.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:ae}),(0,Y.jsxs)(`div`,{className:`overflow-y-auto`,style:{backgroundColor:w},children:[(0,Y.jsxs)(`div`,{className:`px-[7rem]`,style:{backgroundColor:T},children:[r&&(0,Y.jsx)(`div`,{children:(0,Y.jsx)(`img`,{alt:``,className:`mb-4 block pt-6`,src:r})}),te&&(0,Y.jsxs)(`div`,{className:`py-3`,children:[i&&(0,Y.jsx)(`img`,{alt:``,className:`mx-auto mb-2 size-10`,role:`presentation`,src:i}),a&&(0,Y.jsx)(`h4`,{className:`mb-1 text-center text-[1.6rem] leading-tight font-bold tracking-tight text-grey-900 uppercase`,style:{color:k},children:a}),o&&(0,Y.jsx)(`h5`,{className:`mb-1 text-center text-[1.3rem] font-normal text-grey-700`,style:{color:A},children:o})]}),s&&(0,Y.jsxs)(`div`,{className:P(`flex flex-col py-8`,l===`center`?`items-center`:`items-start`),children:[(0,Y.jsx)(`h2`,{className:P(`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:j},children:`Your email newsletter`}),c&&(0,Y.jsx)(`p`,{className:oe,style:{color:k},children:`A subtitle to highlight key points and engage your readers.`}),(0,Y.jsxs)(`div`,{className:P(`flex w-full justify-between text-center text-md leading-none text-grey-700`,l===`center`?`flex-col gap-1`:`flex-row`),children:[(0,Y.jsxs)(`p`,{className:`pb-1 text-[1.3rem]`,style:{color:A},children:[`By `,m,(0,Y.jsx)(`span`,{className:`before:pr-1 before:pl-0.5 before:content-['•']`,children:H})]}),(0,Y.jsx)(`p`,{className:`pb-1 text-[1.3rem] underline`,style:{color:A},children:(0,Y.jsx)(`span`,{children:`View in browser`})})]})]}),g&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`div`,{className:P(`h-[unset] w-full max-w-[600px] bg-cover bg-no-repeat`,s?``:`pt-6`),children:(0,Y.jsx)(`img`,{alt:`Feature`,className:P(`min-h-full min-w-full shrink-0`,B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`user-cover-yM4cP_Mo.jpg`,import.meta.url).href})}),(0,Y.jsx)(`div`,{className:`mt-1 w-full max-w-[600px] pb-8 text-center text-[1.3rem] text-grey-700`,style:{color:A},children:`Feature image caption`})]})]}),(0,Y.jsxs)(`div`,{className:P(`px-[7rem]`,T!==`transparent`&&`pt-10`),children:[(0,Y.jsxs)(`div`,{className:P(`max-w-[600px] border-b border-grey-200 pb-[52px] leading-[27.2px] text-black`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`,p===`serif`?`font-serif text-[1.8rem]`:`text-[1.7rem] tracking-tight`,g||s?``:`pt-8`),style:{borderColor:N},children:[(0,Y.jsx)(`p`,{className:`mb-6`,style:{color:D},children:`This is what your content will look like when you send one of your posts as an email newsletter to your subscribers.`}),(0,Y.jsx)(`p`,{className:`mb-6`,style:{color:D},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,Y.jsx)(`p`,{className:`mb-[52px]`,style:{color:D},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,Y.jsx)(`hr`,{className:P(`my-[52px] border-[#e0e7eb]`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-t-0 border-b-2 border-dotted`),style:{borderColor:N}}),(0,Y.jsx)(`h3`,{className:P(`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:M},children:`Need inspiration?`}),(0,Y.jsxs)(`p`,{className:`mb-[27px]`,style:{color:D},children:[`We've put together a `,(0,Y.jsx)(`a`,{className:P(ee===`underline`&&`underline`,ee===`bold`&&`font-bold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:{color:L||E},target:`_blank`,children:`quick guide`}),` that walks through all of the available settings, along with a few examples of what's possible.`]}),(0,Y.jsx)(`a`,{className:P(`inline-block border px-[18px] py-2 font-sans text-[15px]`,R===`rounded`&&`rounded-[6px]`,R===`pill`&&`rounded-full`,R===`square`&&`rounded-none`,z===`outline`?`bg-transparent`:`border-transparent text-white`,ee===`bold`?`font-bold`:`font-semibold`),href:`https://ghost.org/help/email-design/`,rel:`noopener noreferrer`,style:z===`outline`?{borderColor:F||E,color:F||E}:{backgroundColor:F||E,color:I},target:`_blank`,children:`Learn more`})]}),(_||h||v)&&(0,Y.jsx)(`div`,{className:P(`grid gap-5 border-b border-grey-200 px-6 py-5`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:(0,Y.jsxs)(`div`,{className:`grid auto-cols-fr grid-flow-col gap-4`,children:[_&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`thumbs-up`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`More like this`})]}),(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`thumbs-down`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Less like this`})]})]}),h&&(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`comment`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Comment`})]}),v&&(0,Y.jsxs)(`div`,{className:`pointer-events-none flex min-w-[120px] cursor-default flex-col items-center gap-[11px] text-center`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-[54px] items-center justify-center rounded-full border`,style:{borderColor:N,color:D},children:(0,Y.jsx)(f,{colorClass:``,name:`share`,size:`md`})}),(0,Y.jsx)(`span`,{className:`font-sans text-[1.3rem] leading-[1.4] font-medium`,style:{color:D},children:`Share`})]})]})}),y&&(0,Y.jsxs)(`div`,{className:P(`border-b border-grey-200 py-6`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:[(0,Y.jsx)(`h3`,{className:`mt-2 mb-4 pb-1 text-[1.2rem] font-semibold tracking-wide text-black uppercase`,style:{color:D},children:`Keep reading`}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`The three latest posts published on your site`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Posts sent as an email only will never be shown here.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-1-D7-ilqhR.jpg`,import.meta.url).href})})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`Displayed at the bottom of each newsletter`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Giving your readers one more place to discover your stories.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-2-BPfbGB8B.jpg`,import.meta.url).href})})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between gap-4 py-2`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h4`,{className:P(`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:M},children:`To keep your work front and center`}),(0,Y.jsx)(`p`,{className:`m-0 text-base text-grey-700`,style:{color:O},children:`Making sure that your audience stays engaged.`})]}),(0,Y.jsx)(`div`,{className:`aspect-square h-auto w-full max-w-[100px] bg-cover bg-no-repeat`,children:(0,Y.jsx)(`img`,{alt:`Latest post`,className:P(B===`square`&&`rounded-none`,B===`rounded`&&`rounded-md`),src:``+new URL(`latest-posts-3-D72O3dn8.jpg`,import.meta.url).href})})]})]}),b&&(0,Y.jsxs)(`div`,{className:P(`border-b border-grey-200 py-8`,V===`dashed`&&`border-dashed`,V===`dotted`&&`border-b-2 border-dotted`),style:{borderColor:N},children:[(0,Y.jsx)(`h4`,{className:`mb-3 text-[1.2rem] tracking-wide text-black uppercase`,style:{color:D},children:`Subscription details`}),(0,Y.jsxs)(`p`,{className:`m-0 mb-4 text-base`,style:{color:D},children:[`You are receiving this because you are a paid subscriber to `,x,`. Your subscription will renew on 17 Jul 2024.`]}),(0,Y.jsxs)(`div`,{className:`flex`,children:[(0,Y.jsxs)(`div`,{className:`shrink-0 text-base`,children:[(0,Y.jsx)(`p`,{style:{color:D},children:`Name: Jamie Larson`}),(0,Y.jsx)(`p`,{style:{color:D},children:`Email: jamie@example.com`}),(0,Y.jsx)(`p`,{style:{color:D},children:`Member since: 17 July 2023`})]}),(0,Y.jsx)(`span`,{className:P(`w-full self-end text-right text-base whitespace-nowrap`,ee===`underline`&&`underline`,ee===`bold`&&`font-bold`),style:{color:L||E},children:`Manage subscription`})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center pt-10`,children:[(0,Y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:ie||``},className:`text px-8 py-3 text-center text-[1.3rem] leading-base break-words text-grey-700 [&_a]:underline`,style:{color:O}}),(0,Y.jsxs)(`div`,{className:`px-8 pt-3 pb-14 text-center text-[1.3rem] text-grey-700`,children:[(0,Y.jsxs)(`span`,{style:{color:O},children:[x,` © `,re,` — `]}),(0,Y.jsx)(`span`,{className:`pointer-events-none cursor-auto underline`,style:{color:O},children:`Unsubscribe`})]}),C&&(0,Y.jsx)(`div`,{className:`flex flex-col items-center pt-[10px] pb-[40px]`,children:(0,Y.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:D},children:[(0,Y.jsx)(We,{className:`mr-[6px] size-4`}),(0,Y.jsx)(`span`,{children:`Powered by Ghost`})]})})]})]})]})]})})})},Sc=({newsletter:e})=>{let{currentUser:t,settings:n,siteData:r,config:i}=K(),[a,o,s,c,l]=Nn(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?Ve(h()).hex():r.accent_color},v=()=>{let t=e.button_style,n=_();if(n&&t===`fill`)return Ve(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:Ve(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 Ve(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:Ve(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=Ve(h()).hex(),w=Ve(h()).alpha(.5).toString(),T=g()===`transparent`?C:Ve(g()).hex(),E=g()===`transparent`?w:Ve(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,Y.jsx)(xc,{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:Ze(e,i,l),senderName:e.sender_name||a,senderReplyTo:Re(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})},Cc=({newsletter:e,updateNewsletter:t,errors:n,clearError:r})=>{let{settings:i,config:a}=K(),[o,s]=Nn(i,[`default_email_address`,`support_email_address`]),[c,l]=(0,J.useState)(Re(e,a,s,o)||``),u=Ze(e,a,o),d=(0,J.useCallback)(e=>{l(e.target.value),t({sender_reply_to:e.target.value||`newsletter`})},[t,l]);return(0,Y.jsx)(I,{error:!!n.sender_reply_to,hint:n.sender_reply_to,maxLength:191,placeholder:u||``,title:`Reply-to email`,value:c,onBlur:()=>{let t=Re(e,a,s,o)||``;l(t)},onChange:d,onKeyDown:()=>r(`sender_reply_to`)})},wc=({newsletter:e,onlyOne:t,updateNewsletter:n,validate:r,errors:i,clearError:a})=>{let{updateRoute:o}=W(),{mutateAsync:s}=Zn(),c=ve(),{settings:l,config:u,siteData:d}=K(),[m,h]=Nn(l,[`icon`,`default_email_address`]),{mutateAsync:_}=pt(),[v,y]=(0,J.useState)(`generalSettings`),{localSettings:b}=be(),[x]=Nn(b,[`title`]),S=g(),{data:{newsletters:C}={}}=$n(),w=[`all`,`paid`].includes(Kn(l,`comments_enabled`)||``),T=Ze(e,u,h),[k,j]=(0,J.useState)(C||[]),M=k.filter(e=>e.status===`active`);(0,J.useEffect)(()=>{j(C||[])},[C]);let N=[{value:`serif`,label:`Elegant serif`,className:`font-serif`},{value:`sans_serif`,label:`Clean sans-serif`}],P={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`}}},F=()=>e.background_color===`light`?!1:Ve(e.background_color).hex().toLowerCase()===`#ffffff`,L=async()=>{if(e.status===`active`)O.show(me,{title:`Archive newsletter`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`mb-6`,children:[`Your newsletter `,(0,Y.jsx)(`strong`,{children:e.name}),` will no longer be visible to members or available as an option when publishing new posts.`]}),(0,Y.jsx)(`div`,{children:`Existing posts previously sent as this newsletter will remain unchanged.`})]}),okLabel:`Archive`,okColor:`red`,onOk:async t=>{try{await s({...e,status:`archived`}),t?.remove(),p({type:`success`,message:`Newsletter archived`})}catch(e){S(e)}}});else{try{await c?.errorIfWouldGoOverLimit(`newsletters`)}catch(e){if(e instanceof de){O.show(he,{prompt:e.message||`Your current plan doesn't support more newsletters.`,onOk:()=>o({route:`/pro`,isExternal:!0})});return}else throw e}O.show(me,{title:`Reactivate newsletter`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Reactivating `,(0,Y.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(),p({type:`success`,message:`Newsletter reactivated`})}})}},R=()=>{if(!Gn(u))return(0,Y.jsx)(I,{error:!!i.sender_email,hint:i.sender_email,placeholder:T||``,title:`Sender email address`,value:e.sender_email||``,onChange:e=>n({sender_email:e.target.value}),onKeyDown:()=>a(`sender_email`)});if(Bn(u))return(0,Y.jsx)(I,{error:!!i.sender_email,hint:i.sender_email,maxLength:191,placeholder:h,title:`Sender email address`,value:e.sender_email||``,onChange:e=>{n({sender_email:e.target.value})},onKeyDown:()=>a(`sender_email`)})},B=P[e.title_font_category||`sans_serif`].options,ee=[{id:`generalSettings`,title:`General`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Name and description`,children:[(0,Y.jsx)(I,{error:!!i.name,hint:i.name,maxLength:191,placeholder:`Weekly Roundup`,title:`Name`,value:e.name||``,onChange:e=>n({name:e.target.value}),onKeyDown:()=>a(`name`)}),(0,Y.jsx)(z,{maxLength:2e3,rows:2,title:`Description`,value:e.description||``,onChange:e=>n({description:e.target.value})})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Email info`,children:[(0,Y.jsx)(I,{maxLength:191,placeholder:x,title:`Sender name`,value:e.sender_name||``,onChange:e=>n({sender_name:e.target.value})}),R(),(0,Y.jsx)(Cc,{clearError:a,errors:i,newsletter:e,updateNewsletter:n,validate:r})]}),(0,Y.jsx)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Member settings`,children:(0,Y.jsx)(vt,{checked:e.subscribe_on_signup,direction:`rtl`,label:`Subscribe new members on signup`,labelStyle:`value`,onChange:e=>n({subscribe_on_signup:e.target.checked})})}),(0,Y.jsx)(`div`,{className:`mt-10 mb-5`,children:e.status===`active`?!t&&(0,Y.jsx)(q,{color:`red`,disabled:M.length===1,label:`Archive newsletter`,link:!0,onClick:L}):(0,Y.jsx)(q,{color:`green`,label:`Reactivate newsletter`,link:!0,onClick:L})})]})},{id:`content`,title:`Content`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Header`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(A,{className:`mb-2`,level:6,children:`Header image`})}),(0,Y.jsxs)(`div`,{className:`flex-column flex gap-1`,children:[(0,Y.jsx)(Ee,{deleteButtonClassName:`top-1! right-1!`,height:e.header_image?`66px`:`64px`,id:`logo`,imageURL:e.header_image||void 0,onDelete:()=>{n({header_image:null})},onUpload:async e=>{try{n({header_image:Ne(await _({file:e}))})}catch(e){S(e)}},children:(0,Y.jsx)(f,{colorClass:`text-grey-700 dark:text-grey-300`,name:`picture`})}),(0,Y.jsx)(E,{children:`1200×600 recommended. Use a transparent PNG for best results on any background.`})]})]}),(0,Y.jsxs)(Ni,{children:[m&&(0,Y.jsx)(vt,{checked:e.show_header_icon,direction:`rtl`,label:`Publication icon`,onChange:e=>n({show_header_icon:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_header_title,direction:`rtl`,label:`Publication title`,onChange:e=>n({show_header_title:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_header_name,direction:`rtl`,label:`Newsletter name`,onChange:e=>n({show_header_name:e.target.checked})})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Title section`,children:[(0,Y.jsx)(vt,{checked:e.show_post_title_section,direction:`rtl`,label:`Post title`,onChange:e=>n({show_post_title_section:e.target.checked})}),e.show_post_title_section&&(0,Y.jsx)(vt,{checked:e.show_excerpt,direction:`rtl`,label:`Post excerpt`,onChange:e=>n({show_excerpt:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_feature_image,direction:`rtl`,label:`Feature image`,onChange:e=>n({show_feature_image:e.target.checked})})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`sm`,margins:`lg`,title:`Footer`,children:[(0,Y.jsxs)(Ni,{gap:`lg`,children:[(0,Y.jsx)(vt,{checked:e.feedback_enabled,direction:`rtl`,label:`Ask your readers for feedback`,onChange:e=>n({feedback_enabled:e.target.checked})}),w&&(0,Y.jsx)(vt,{checked:e.show_comment_cta,direction:`rtl`,label:`Add a link to your comments`,onChange:e=>n({show_comment_cta:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_share_button,direction:`rtl`,label:`Show share button`,onChange:e=>n({show_share_button:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_latest_posts,direction:`rtl`,label:`Share your latest posts`,onChange:e=>n({show_latest_posts:e.target.checked})}),(0,Y.jsx)(vt,{checked:e.show_subscription_details,direction:`rtl`,label:`Show subscription details`,onChange:e=>n({show_subscription_details:e.target.checked})})]}),(0,Y.jsx)(Zr,{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,Y.jsx)(D,{}),(0,Y.jsxs)(`div`,{className:`my-5 flex w-full items-start`,children:[(0,Y.jsx)(`span`,{children:(0,Y.jsx)(f,{className:`mt-[-1px] mr-2`,colorClass:`text-red`,name:`heart`})}),(0,Y.jsx)(U,{marginBottom:!1,children:(0,Y.jsx)(vt,{checked:e.show_badge,direction:`rtl`,label:(0,Y.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[(0,Y.jsx)(`span`,{className:`md:text-base`,children:`Promote independent publishing`}),(0,Y.jsx)(`span`,{className:`text-[11px] leading-tight text-grey-700 md:text-sm md:leading-tight`,children:`Show you're a part of the indie publishing movement with a small badge in the footer`})]}),labelStyle:`value`,onChange:e=>n({show_badge:e.target.checked})})})]})]})},{id:`design`,title:`Design`,contents:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Global`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Heading font`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:N,selectedOption:N.find(t=>t.value===e.title_font_category),onSelect:t=>{let r=t?.value||`sans_serif`,i=e.title_font_weight,a=i;return P[r].options.find(e=>e.value===i)||(a=P[r].map?.[i]||`bold`),n({title_font_category:r,title_font_weight:a})}})]}),(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Heading weight`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:B,selectedOption:(()=>{let t=e.title_font_category||`sans_serif`,n=e.title_font_weight,r=P[t].map,i=r&&r[n]||n;return B.find(e=>e.value===i)||B[0]})(),onSelect:e=>n({title_font_weight:e?.value})})]}),(0,Y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,Y.jsx)(`div`,{className:`shrink-0`,children:`Body font`}),(0,Y.jsx)(Te,{containerClassName:`max-w-[200px]`,options:N,selectedOption:N.find(t=>t.value===e.body_font_category),testId:`body-font-select`,onSelect:e=>n({body_font_category:e?.value})})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Header`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:F()?`#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,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Title alignment`}),(0,Y.jsx)(re,{activeKey:e.title_alignment,buttons:[{key:`left`,icon:`align-left`,iconSize:14,label:`Align left`,tooltip:`Left`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({title_alignment:`left`}),disabled:!e.show_post_title_section},{key:`center`,icon:`align-center`,iconSize:14,label:`Align center`,tooltip:`Center`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({title_alignment:`center`}),disabled:!e.show_post_title_section}],clearBg:!1})]})]}),(0,Y.jsxs)(U,{className:`mt-6`,gap:`xs`,margins:`lg`,title:`Body`,children:[(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:null,title:`Auto`,hex:F()?`#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,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:F()?`#ffffff`:`#000000`}],title:`Button color`,value:e.button_color,onChange:e=>n({button_color:e})})}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Button style`}),(0,Y.jsx)(re,{activeKey:e.button_style||`fill`,buttons:[{key:`fill`,icon:`squircle-fill`,iconSize:14,label:`Fill`,tooltip:`Fill`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_style:`fill`})},{key:`outline`,icon:`squircle`,iconSize:14,label:`Outline`,tooltip:`Outline`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_style:`outline`})}],clearBg:!1})]}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Button corners`}),(0,Y.jsx)(re,{activeKey:e.button_corners||`rounded`,buttons:[{key:`square`,icon:`square`,iconSize:14,label:`Square`,tooltip:`Squared`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`square`})},{key:`rounded`,icon:`squircle`,iconSize:14,label:`Rounded`,tooltip:`Rounded`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`rounded`})},{key:`pill`,icon:`circle`,iconSize:14,label:`Pill`,tooltip:`Pill`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({button_corners:`pill`})}],clearBg:!1})]}),(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{direction:`rtl`,eyedropper:!0,swatches:[{value:`accent`,title:`Accent`,hex:d.accent_color},{value:null,title:`Auto`,hex:F()?`#ffffff`:`#000000`}],title:`Link color`,value:e.link_color,onChange:e=>n({link_color:e})})}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Link style`}),(0,Y.jsx)(re,{activeKey:e.link_style||`underline`,buttons:[{key:`underline`,icon:`text-underline`,iconSize:14,label:`Underline`,tooltip:`Underline`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`underline`})},{key:`regular`,icon:`text-regular`,iconSize:14,label:`Regular`,tooltip:`Regular`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`regular`})},{key:`bold`,icon:`text-bold`,iconSize:14,label:`Bold`,tooltip:`Bold`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({link_style:`bold`})}],clearBg:!1})]}),(0,Y.jsxs)(`div`,{className:`flex w-full justify-between`,children:[(0,Y.jsx)(`div`,{children:`Image corners`}),(0,Y.jsx)(re,{activeKey:e.image_corners||`square`,buttons:[{key:`square`,icon:`square`,iconSize:14,label:`Square`,tooltip:`Squared`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({image_corners:`square`})},{key:`rounded`,icon:`squircle`,iconSize:14,label:`Rounded`,tooltip:`Rounded`,hideLabel:!0,link:!1,size:`sm`,onClick:()=>n({image_corners:`rounded`})}],clearBg:!1})]}),(0,Y.jsx)(`div`,{className:`mb-1`,children:(0,Y.jsx)(Yr,{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,Y.jsx)(`div`,{className:`flex flex-col`,children:(0,Y.jsx)(`div`,{className:`px-7 pt-0 pb-7`,children:(0,Y.jsx)(Xe,{selectedTab:v,stickyHeader:!0,tabs:ee,onTabChange:e=>{y(e)}})})})},Tc=({newsletter:e,onlyOne:t})=>{let{config:n}=K(),{mutateAsync:r}=Zn(),{updateRoute:i}=W(),a=ce(`automations`)?`emails`:`newsletters`,{formState:o,saveState:s,updateForm:c,setFormState:l,handleSave:u,validate:d,errors:f,clearError:m,okProps:h}=jt({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,Y.jsx)(`div`,{children:`We‘ve sent a confirmation email to the new address.`})),t&&p({icon:`email`,message:t,type:`info`})},onSaveError:g(),onValidate:()=>{let e={};return o.name||(e.name=`A name is required for your newsletter`),o.sender_email&&!ua.default.isEmail(o.sender_email)?e.sender_email=`Enter a valid email address`:o.sender_email&&Bn(n)&&o.sender_email.split(`@`)[1]!==Mn(n)&&(e.sender_email=`Email address must end with @${Mn(n)}`),o.sender_reply_to&&!ua.default.isEmail(o.sender_reply_to)&&![`newsletter`,`support`].includes(o.sender_reply_to)&&(e.sender_reply_to=`Enter a valid email address`),e}}),_=e=>{c(t=>({...t,...e}))};(0,J.useEffect)(()=>{l(()=>e)},[l,e]);let v=(0,Y.jsx)(Sc,{newsletter:o}),y=(0,Y.jsx)(wc,{clearError:m,errors:f,newsletter:o,onlyOne:t,updateNewsletter:_,validate:d});return(0,Y.jsx)(Ii,{afterClose:()=>i(a),buttonsDisabled:h.disabled,cancelLabel:`Close`,deviceSelector:!1,dirty:s===`unsaved`,okColor:h.color,okLabel:h.label||`Save`,preview:v,previewBgColor:`grey`,previewToolbar:!1,sidebar:y,sidebarPadding:!1,testId:`newsletter-modal`,title:`Newsletter`,onOk:async()=>{await u({fakeWhenUnchanged:!0})}})},Ec=O.create(({params:e})=>{let{data:{newsletters:t,isEnd:n}={},fetchNextPage:r}=$n(),i=t?.find(({id:t})=>t===e?.id);return(0,J.useEffect)(()=>{!i&&!n&&r()},[r,n,i]),i?(0,Y.jsx)(Tc,{newsletter:i,onlyOne:t.length===1}):null}),Dc=({id:e})=>{let{updateRoute:t}=W(),{data:{offers:n=[]}={}}=It(e||``),[r,i]=(0,J.useState)(),[a,o]=(0,J.useState)(``),{siteData:s}=K();(0,J.useEffect)(()=>{if(n.length>0){let e=n[0],t=`${Wn(s)}${e?.code}`;o(t),i(e)}},[n,s]);let[c,l]=(0,J.useState)(!1),u=()=>{let e=``;switch(r?.type){case`percent`:e=r?.amount+`% discount`;break;case`fixed`:e=H(Ye(r?.amount))+` `+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,Y.jsx)(L,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,footer:!1,height:`full`,size:`lg`,testId:`offer-success-modal`,topRightContent:`close`,width:1140,children:(0,Y.jsxs)(`div`,{className:`-mt-6 flex h-full flex-col items-center justify-center text-center`,children:[(0,Y.jsx)(`div`,{className:`absolute top-5 left-6`,children:(0,Y.jsx)(Fi,{activeItemClassName:`hidden md:block! md:visible!`,containerClassName:`whitespace-nowrap`,itemClassName:`hidden md:block! md:visible!`,items:[{label:`Offers`,onClick:()=>{t(`offers/edit`)}},{label:r?.name||``}],separatorClassName:`hidden md:block! md:visible!`,backIcon:!0,onBack:()=>{t(`offers/edit`)}})}),(0,Y.jsx)(f,{colorClass:`text-grey-700 -mt-4`,name:`tags-check`,size:`xl`}),(0,Y.jsx)(`h1`,{className:`mt-6 text-4xl`,children:`Your new offer is live!`}),(0,Y.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,Y.jsxs)(`div`,{className:`mt-8 flex w-full max-w-md flex-col gap-8`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col-reverse gap-2`,children:[(0,Y.jsx)(I,{name:`offer-url`,type:`url`,value:a,disabled:!0}),(0,Y.jsx)(q,{color:`green`,label:c?`Copied!`:`Copy link`,fullWidth:!0,onClick:async()=>{await navigator.clipboard.writeText(a),l(!0),setTimeout(()=>l(!1),2e3)}})]}),(0,Y.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,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`twitter-x`,iconColorClass:`w-[14px] h-[14px]`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`https://twitter.com/intent/tweet?url=${encodeURI(a)}&text=${u()}`,`_blank`)}}),(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`facebook`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURI(a)}`,`_blank`)}}),(0,Y.jsx)(q,{className:`h-8 border border-grey-300 dark:border-grey-800`,icon:`linkedin`,size:`sm`,fullWidth:!0,onClick:()=>{window.open(`http://www.linkedin.com/shareArticle?mini=true&url=${encodeURI(a)}&title=${u()}`,`_blank`)}})]})]})]})})},Oc=({href:e,onDestroyed:t,selectedTab:n,portalParent:r})=>{n||=`signup`;let i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!0),l=(0,J.useCallback)(()=>{setTimeout(()=>{i.current&&c(!1)},300)},[i]);if((0,J.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,Y.jsxs)(Y.Fragment,{children:[s&&(0,Y.jsx)(`div`,{className:u,children:(0,Y.jsx)(`span`,{children:(0,Y.jsx)(Fe,{})})}),(0,Y.jsx)(`iframe`,{ref:i,className:!s&&a?``:d,"data-testid":`portal-preview`,height:`100%`,src:e,title:`Portal Preview`,width:`100%`,onLoad:()=>{o(!0)}})]})},kc=(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()}`},Ac=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 jc(e){return e.toString().toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\w-]+/g,``).replace(/--+/g,`-`)}var Mc=191,Nc=({type:e,checked:t,onClick:n})=>(0,Y.jsx)(`button`,{className:`text-left`,type:`button`,onClick:n,children:(0,Y.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Y.jsx)(`div`,{className:`mt-0.5 flex size-4 items-center justify-center rounded-full ${t?`bg-black text-white dark:bg-white dark:text-black`:`border border-grey-300 dark:border-grey-800`}`,children:t?(0,Y.jsx)(f,{className:`w-[7px] stroke-[4]`,name:`check`,size:`custom`}):null}),(0,Y.jsxs)(`div`,{className:`-mt-px flex flex-col`,children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,Y.jsx)(`span`,{className:`text-gray-700`,children:e.description})]})]})}),Pc=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}},Fc=({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,J.useState)(0),w=S>40?`text-red`:`text-green`,{siteData:T}=K(),[E,D]=(0,J.useState)(!1),O=Wn(T),k=`${O}${s.code.value}`;return(0,Y.jsx)(`div`,{className:`pt-7`,"data-testId":_,children:(0,Y.jsxs)(U,{children:[(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{error:!!g.name,hint:g.name||(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Y.jsxs)(`strong`,{children:[(0,Y.jsx)(`span`,{className:`${w}`,children:S}),` / 40`]})]}),maxLength:40,placeholder:`Black Friday`,title:`Offer name`,onChange:e=>{l(e),C(e.target.value.length)},onKeyDown:()=>h(`name`)}),(0,Y.jsx)(I,{error:!!g.displayTitle,hint:g.displayTitle,maxLength:Mc,placeholder:`Black Friday Special`,title:`Display title`,value:s.displayTitle.value,onChange:e=>{d(e)},onKeyDown:()=>h(`displayTitle`)}),(0,Y.jsx)(z,{maxLength:Mc,placeholder:`Take advantage of this limited-time offer.`,title:`Display description`,value:s.displayDescription,onChange:e=>{u(e)}})]})]}),(0,Y.jsxs)(`section`,{className:`mt-4`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-md border border-grey-200 p-4 dark:border-grey-800`,children:[(0,Y.jsx)(Nc,{checked:s.type!==`trial`,type:r[0],onClick:()=>{a(`percent`)}}),(0,Y.jsx)(Nc,{checked:s.type===`trial`,type:r[1],onClick:()=>{a(`trial`)}})]}),(0,Y.jsx)(Te,{options:e,selectedOption:n,testId:`tier-cadence-select-offers`,title:`Tier —\xA0Cadence`,onSelect:e=>{e&&t(e)}}),s.type!==`trial`&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(I,{error:!!g.amount,hint:g.amount,title:`Amount off`,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,Y.jsx)(`div`,{className:`absolute top-6 right-1.5 z-10`,children:(0,Y.jsx)(Te,{clearBg:!0,controlClasses:{menu:`w-20 right-0`},options:y,selectedOption:s.type===`percent`?y[0]:y[1],testId:`amount-type-select-offers`,onSelect:e=>{c(e?.value||``)}})})]}),(0,Y.jsx)(Te,{options:x,selectedOption:x.find(e=>e.value===s.duration),testId:`duration-select-offers`,title:`Duration`,onSelect:e=>{h(`durationInMonths`),o(e?.value||``)}}),s.duration===`repeating`&&!b&&(0,Y.jsx)(`div`,{className:`-mt-4`,children:(0,Y.jsx)(I,{"data-testid":`duration-months-input`,error:!!g.durationInMonths,hint:g.durationInMonths,rightPlaceholder:`${s.durationInMonths===1?`month`:`months`}`,type:`number`,value:s.durationInMonths===0?``:String(s.durationInMonths),onChange:e=>{f(e)},onKeyDown:()=>h(`durationInMonths`)})})]}),s.type===`trial`&&(0,Y.jsx)(I,{error:!!g.amount,hint:g.amount,title:`Trial duration`,type:`number`,value:s.trialAmount?.toString(),onChange:e=>{v(e)},onKeyDown:()=>h(`amount`)}),(0,Y.jsx)(I,{error:!!g.code,hint:g.code||(s.code.value===``?null:(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[O,(0,Y.jsx)(`span`,{className:`font-bold`,children:s.code.value})]}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(q,{className:`text-sm`,color:`green`,label:`${E?`Copied`:`Copy`}`,size:`sm`,link:!0,onClick:async()=>{await navigator.clipboard.writeText(k),D(!0),setTimeout(()=>D(!1),2e3)}})]})),placeholder:`black-friday`,title:`Offer code`,value:s.code.value,onChange:e=>{m(e)},onKeyDown:()=>h(`code`)})]})]})]})})},Ic=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}},Lc=()=>{let{siteData:e}=K(),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,J.useState)(``),{updateRoute:a}=W(),{data:{tiers:o}={}}=tr(),s=rr(o||[]),l=Ac(s),{mutateAsync:u}=Lt(),[d,f]=(0,J.useState)({tier:l[0]||{},dataset:{id:l[0]?.value?Ic(l[0]?.value).id:``,period:l[0]?.value?Ic(l[0]?.value).period:``,currency:l[0]?.value?Ic(l[0]?.value).currency:``}}),{data:{offers:m=[]}={}}=Ft(),{formState:h,updateForm:g,handleSave:_,saveState:v,okProps:y,validate:b,errors:x,clearError:S}=jt({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=h.type===`trial`?`trial`:h.duration,t={name:h.name,code:h.code.value,display_title:h.displayTitle.value,display_description:h.displayDescription,cadence:h.cadence,amount:Pc(h)||0,duration:e,...e===`repeating`?{duration_in_months:h.durationInMonths}:{},currency:h.currency,status:h.status,redemption_type:`signup`,tier:{id:h.tierId},type:h.type,currency_restriction:!1},n=await u(t);n&&n.offers&&n.offers.length>0&&a(`offers/success/${n.offers[0].id}`)},onSaveError:()=>{},onValidate:()=>{let e={};return!h.name&&h.name.length===0&&(e.name=`Name is required`),!h.code.value&&h.code.value.length===0&&(e.code=`Code is required`),!h.displayTitle.value&&h.displayTitle.value.length===0&&(e.displayTitle=`Display title is required`),h.type===`percent`&&h.percentAmount===0&&(e.amount=`Enter an amount greater than 0.`),h.type===`percent`&&(h.percentAmount<1||h.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),(h.type===`fixed`&&h.fixedAmount===0||h.type===`fixed`&&h.fixedAmount<1)&&(e.amount=`Enter an amount greater than 0.`),h.type===`trial`&&h.trialAmount===0&&(e.amount=`Enter an amount greater than 0.`),h.type===`trial`&&h.trialAmount<1&&(e.amount=`Free trial must be at least 1 day.`),h.type!==`trial`&&h.duration===`repeating`&&(!Number.isInteger(h.durationInMonths)||h.durationInMonths<1)&&(e.durationInMonths=`Enter a whole number of months (1 or more).`),e},savingDelay:500}),C=[{value:`percent`,label:`%`},{value:`fixed`,label:h.currency}],w=e=>{let t=Ic(e.value),n=t.period===`year`;f({tier:e,dataset:t}),g(e=>({...e,cadence:t.period,currency:t.currency,tierId:t.id,duration:n&&e.duration===`repeating`?`once`:e.duration})),n&&S(`durationInMonths`)},T=e=>{e===`trial`&&(S(`amount`),S(`durationInMonths`)),g(t=>({...t,type:e}))},E=e=>{g(t=>({...t,type:e===`percent`?`percent`:`fixed`}))},D=e=>{let t=e.target;h.type===`fixed`?g(e=>({...e,fixedAmount:Number(t.value)})):h.type===`percent`?g(e=>({...e,percentAmount:Number(t.value)})):g(e=>({...e,amount:Number(t.value)}))},O=e=>{let t=e.target,n=Number(t.value);g(e=>({...e,durationInMonths:Number.isNaN(n)?0:n}))},k=e=>{let t=e.target.value;g(e=>{let n={...e};return n.name=t,e.code.isDirty||(S(`code`),n.code={...e.code,value:jc(t)}),e.displayTitle.isDirty||(S(`displayTitle`),n.displayTitle={...e.displayTitle,value:t}),n})},A=e=>{let t=e.target;g(e=>({...e,displayTitle:{...e.displayTitle,isDirty:!0,value:t.value}}))},j=e=>{let t=e.target;g(e=>({...e,displayDescription:t.value}))},M=e=>{let t=e.target;g(e=>({...e,trialAmount:Number(t.value)}))},N=e=>{g(t=>({...t,duration:e}))},P=e=>{let t=e.target;g(e=>({...e,code:{...e.code,isDirty:!0,value:t.value}}))},F=()=>{m.length>0?a(`offers/edit`):a(`offers`)},I=(0,J.useMemo)(()=>({name:h.name||``,code:h.code.value||``,displayTitle:h.displayTitle.value||``,displayDescription:h.displayDescription||``,type:h.type||`percent`,cadence:h.cadence||`month`,amount:Pc(h)||0,duration:h.type===`trial`?`trial`:h.duration||`once`,durationInMonths:h.durationInMonths||0,currency:h.currency||`USD`,status:h.status||`active`,tierId:h.tierId||s[0]?.id,redemptionType:`signup`}),[h,s]);(0,J.useEffect)(()=>{let t=kc(I,e.url);i(t)},[h,e.url,h.type,I]);let L=(0,Y.jsx)(Fc,{amountOptions:C,clearError:S,durationOptions:n,errors:x,handleAmountInput:D,handleAmountTypeChange:E,handleCodeInput:P,handleDisplayTitleInput:A,handleDurationChange:N,handleDurationInMonthsInput:O,handleNameInput:k,handleTextAreaInput:j,handleTierChange:w,handleTrialAmountInput:M,handleTypeChange:T,overrides:h,selectedTier:d.tier,testId:`add-offer-sidebar`,tierOptions:l,typeOptions:t,validate:b}),R=(0,Y.jsx)(Oc,{href:r||``,portalParent:`offers`});return(0,Y.jsx)(Ii,{afterClose:()=>{a(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:v===`unsaved`,height:`full`,okColor:y.color,okLabel:`Publish`,preview:R,previewToolbar:!1,sidebar:L,size:`lg`,testId:`add-offer-modal`,title:`Offer`,width:1140,onCancel:F,onOk:async()=>{if(b(),!Object.values(x).every(e=>!e)){kt.remove(),p({title:`Can't save offer`,type:`info`,message:`Make sure you filled all required fields`});return}try{if(await _({force:!0}))return}catch(e){let t;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),kt.remove(),t&&p({title:`Can't save offer`,type:`error`,message:t||`Please try again later`})}}})},Rc=e=>new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`}),zc=e=>{let t=`offer_redemptions:[${e.join(`,`)}]`;return`/ghost/#/members?filter=${encodeURIComponent(t)}`},Bc=e=>zc([e]),Vc=({amount:e,duration:t})=>e===100&&t===`repeating`,Hc=(e,t)=>`Retention ${e} (${t})`,Uc=({amount:e,duration:t,durationInMonths:n})=>Vc({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`,Wc=(e,t)=>{let n=t.trim(),r=Uc(e),i=Hc(r,n);if(i.length<=40)return i;let a=i.length-40,o=Math.max(3,n.length-a);return Hc(r,n.slice(0,o))};function Gc(e){return new Date(e).toLocaleDateString(`default`,{year:`numeric`,month:`short`,day:`2-digit`})}var Kc=({clearError:e,errors:t,offer:n,updateOffer:r})=>{let{siteData:i}=K(),[a,o]=(0,J.useState)(!1),s=g(),{mutateAsync:c}=Pt(),[l,u]=(0,J.useState)(n?.name.length||0),d=l>40?`text-red`:`text-green`,{updateRoute:f}=W();(0,J.useEffect)(()=>{n?.name&&u(n?.name.length)},[n?.name]);let m=Wn(i),h=`${m}${n?.code}`,_=async()=>{await navigator.clipboard.writeText(h),o(!0),setTimeout(()=>o(!1),2e3)},v=async()=>{n?.status===`active`?O.show(me,{title:`Archive offer`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`p`,{children:`New members will no longer be able to subscribe using this offer.`}),(0,Y.jsxs)(`p`,{children:[`All members that previously redeemed `,(0,Y.jsx)(`strong`,{children:n?.name}),` will remain unchanged.`]})]}),okLabel:`Archive`,okColor:`red`,onOk:async e=>{try{await c({...n,status:`archived`}),e?.remove(),p({type:`success`,title:`Offer archived`}),f(`offers/edit`)}catch(e){s(e)}}}):O.show(me,{title:`Reactivate offer`,prompt:(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsxs)(`p`,{children:[`Reactivating `,(0,Y.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(),p({type:`success`,title:`Offer reactivated`}),f(`offers/edit`)}catch(e){s(e)}}})};return(0,Y.jsxs)(`div`,{className:`flex grow flex-col pt-2`,children:[(0,Y.jsxs)(U,{className:` grow`,children:[(0,Y.jsx)(`section`,{children:(0,Y.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,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Created on`}),(0,Y.jsx)(`span`,{children:Gc(n?.created_at?n.created_at:``)})]}),(0,Y.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Y.jsxs)(`span`,{children:[n?.redemption_count,` `,n?.redemption_count===1?`redemption`:`redemptions`]})]}),n?.redemption_count>0&&n?.last_redeemed?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Y.jsx)(`span`,{children:Gc(n?.last_redeemed)})]}):null]}),n?.redemption_count>0?(0,Y.jsx)(`a`,{className:`font-semibold text-green`,href:Bc(n?.id),children:`See members →`}):null]})]})}),(0,Y.jsxs)(`section`,{className:`mt-2`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{error:!!t.name,hint:t.name||(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{children:`Visible to members on Stripe Checkout page`}),(0,Y.jsxs)(`strong`,{children:[(0,Y.jsx)(`span`,{className:`${d}`,children:l}),` / 40`]})]}),maxLength:40,placeholder:`Black Friday`,title:`Offer name`,value:n?.name,onChange:e=>{u(e.target.value.length),r({name:e.target.value})},onKeyDown:()=>e(`name`)}),(0,Y.jsx)(I,{containerClassName:`group`,error:!!t.code,hint:t.code||(n?.code===``?null:(0,Y.jsxs)(`span`,{className:`truncate text-grey-700`,children:[m,(0,Y.jsx)(`span`,{className:`font-bold text-black dark:text-white`,children:n?.code})]})),placeholder:`black-friday`,rightPlaceholder:n?.code===``?null:(0,Y.jsx)(q,{className:`mt-1 mr-0.5`,color:`green`,label:a?`Copied!`:`Copy link`,size:`sm`,onClick:_}),title:`Offer code`,value:n?.code,onChange:e=>r({code:e.target.value}),onKeyDown:()=>e(`code`)}),(0,Y.jsx)(I,{error:!!t.displayTitle,hint:t.displayTitle,placeholder:`Black Friday Special`,title:`Display title`,value:n?.display_title,onChange:e=>r({display_title:e.target.value}),onKeyDown:()=>e(`displayTitle`)}),(0,Y.jsx)(z,{placeholder:`Take advantage of this limited-time offer.`,title:`Display description`,value:n?.display_description,onChange:e=>r({display_description:e.target.value})})]})]})]}),(0,Y.jsx)(`div`,{className:`mb-2`,children:n?.status===`active`?(0,Y.jsx)(q,{color:`red`,label:`Archive offer`,link:!0,onClick:v}):(0,Y.jsx)(q,{color:`green`,label:`Reactivate offer`,link:!0,onClick:v})})]})},qc=({id:e})=>{let{siteData:t}=K(),{updateRoute:n}=W(),r=g(),{mutateAsync:i}=Pt(),[a,o]=(0,J.useState)(``),{data:{offers:s=[]}={}}=It(e||``),{formState:l,saveState:u,updateForm:d,setFormState:f,handleSave:m,validate:h,errors:_,clearError:v,okProps:y}=jt({initialState:s[0],savingDelay:500,onSave:async()=>{await i(l)},onSaveError:r,onValidate:()=>{let e={};return l?.name||(e.name=`Name is required`),l?.display_title||(e.displayTitle=`Display title is required`),l?.code||(e.code=`Please enter a code`),e}});(0,J.useEffect)(()=>{f(()=>s[0])},[f,s]);let b=(0,Y.jsx)(Kc,{clearError:v,errors:_,offer:l,updateOffer:e=>{d(t=>({...t,...e}))},validate:h});(0,J.useEffect)(()=>{let e=kc({name:l?.name||``,code:l?.code||``,displayTitle:l?.display_title||``,displayDescription:l?.display_description||``,type:l?.type||``,cadence:l?.cadence||``,amount:l?.amount,duration:l?.duration||``,durationInMonths:l?.duration_in_months||0,currency:l?.currency||``,status:l?.status||``,tierId:l?.tier?.id||``,redemptionType:`signup`},t.url);o(e)},[l,t]);let x=(0,Y.jsx)(Oc,{href:a||``,portalParent:`offers`}),S=()=>{n(`offers/edit`)};return s?(0,Y.jsx)(Ii,{afterClose:()=>{n(`offers`)},backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:u===`unsaved`,height:`full`,okColor:y.color,okLabel:y.label||`Save`,preview:x,previewToolbarBreadcrumbs:[{label:`Offers`,onClick:S},{label:l?.name||`Offer`}],sidebar:b,size:`lg`,testId:`offer-update-modal`,title:`Offer`,width:1140,onBreadcrumbsBack:S,onCancel:S,onOk:async()=>{try{if(await m({force:!0}))return}catch(e){let t;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message),kt.remove(),t&&p({title:`Can't save offer`,type:`error`,message:`Please try again later`})}}}):null},Jc=[{title:`Percentage discount`,description:`Offer a special reduced price`},{title:`Free month(s)`,description:`Give free access for a limited time`}],Yc=[{value:`once`,label:`First-payment`},{value:`repeating`,label:`Multiple-months`},{value:`forever`,label:`Forever`}],Xc=191,Zc=99,Qc=`Enter a whole number of months between 1 and ${Zc}.`,$c=e=>Math.max(1,Number.isFinite(e)?Math.trunc(e):0),el=({type:e,percentAmount:t,freeMonths:n,lastPercentAmount:r,lastFreeMonths:i})=>e===`free_months`?n>0?n:i:t>0?t:r,tl=(e=`monthly`)=>({enabled:!1,displayTitle:``,displayDescription:``,type:e===`yearly`?`percent`:`free_months`,percentAmount:20,duration:`once`,durationInMonths:1,freeMonths:1}),nl=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,rl=(e,t=`monthly`)=>{let n=tl(t);if(!e)return n;let r=nl(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}},il=({formState:e,lastPercentAmount:t,lastFreeMonths:n})=>{let r=el({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:$c(r)};let i=e.duration;return{type:`percent`,amount:r,duration:i,durationInMonths:i===`repeating`?$c(e.durationInMonths):0}},al=e=>{if(!e)return null;let t=e.duration_in_months??0;return{type:`percent`,amount:e.amount,duration:e.duration,durationInMonths:t}},ol=e=>e?`${e.type}:${e.amount}:${e.duration}:${e.durationInMonths}`:``,sl=e=>Number.isInteger(e)&&e>0&&e<=Zc,cl=(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,ll=({formState:e,updateForm:t,clearError:n,errors:r,cadence:i,lastRedeemed:a,membersFilterUrl:o,redemptions:s})=>{let c=i===`yearly`?Yc.filter(e=>e.value!==`repeating`):Yc;return(0,Y.jsx)(`div`,{className:`flex grow flex-col pt-2`,children:(0,Y.jsxs)(U,{className:`grow`,children:[(0,Y.jsx)(`section`,{children:(0,Y.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,Y.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:(0,Y.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Performance`}),(0,Y.jsxs)(`span`,{children:[s,` `,s===1?`redemption`:`redemptions`]})]}),s>0&&a?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-sm leading-none font-semibold text-grey-700`,children:`Last redemption`}),(0,Y.jsx)(`span`,{children:Rc(a)})]}):null]}),s>0&&o?(0,Y.jsx)(`a`,{className:`font-semibold text-green`,href:o,children:`See members →`}):null]})})})}),(0,Y.jsx)(`section`,{className:`mt-2`,children:(0,Y.jsx)(vt,{align:`center`,checked:e.enabled,direction:`rtl`,hint:i===`monthly`?`Applied to monthly plans`:`Applied to annual plans`,label:`Enable ${i} retention`,onChange:e=>{t(t=>({...t,enabled:e.target.checked}))}},`retention-toggle-${i}-${e.enabled?`enabled`:`disabled`}`)}),e.enabled&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`section`,{className:`mt-2`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`General`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,Y.jsx)(I,{maxLength:Xc,placeholder:`Before you go`,title:`Display title`,value:e.displayTitle,onChange:e=>{t(t=>({...t,displayTitle:e.target.value}))}}),(0,Y.jsx)(z,{maxLength:Xc,placeholder:`We'd hate to see you leave. How about a special offer to stay?`,title:`Display description`,value:e.displayDescription,onChange:e=>{t(t=>({...t,displayDescription:e.target.value}))}})]})]}),(0,Y.jsxs)(`section`,{className:`mt-4`,children:[(0,Y.jsx)(`h2`,{className:`mb-4 text-lg`,children:`Details`}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i===`monthly`&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-4 rounded-md border border-grey-200 p-4 dark:border-grey-800`,children:[(0,Y.jsx)(Nc,{checked:e.type===`percent`,type:Jc[0],onClick:()=>{n(`amount`),n(`durationInMonths`),t(e=>({...e,type:`percent`,percentAmount:e.percentAmount}))}}),(0,Y.jsx)(Nc,{checked:e.type===`free_months`,type:Jc[1],onClick:()=>{n(`amount`),n(`durationInMonths`),t(e=>({...e,type:`free_months`}))}})]}),e.type===`percent`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{error:!!r.amount,hint:r.amount,rightPlaceholder:`%`,title:`Amount off`,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,Y.jsx)(Te,{options:c,selectedOption:c.find(t=>t.value===e.duration),title:`Duration`,onSelect:e=>{e&&(n(`durationInMonths`),t(t=>({...t,duration:e.value})))}}),e.duration===`repeating`&&(0,Y.jsx)(`div`,{className:`-mt-4`,children:(0,Y.jsx)(I,{"data-testid":`duration-months-input`,error:!!r.durationInMonths,hint:r.durationInMonths,rightPlaceholder:`${e.durationInMonths===1?`month`:`months`}`,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`)})})]}),e.type===`free_months`&&(0,Y.jsx)(I,{error:!!r.amount,hint:r.amount,rightPlaceholder:`${e.freeMonths===1?`month`:`months`}`,title:`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`)})]})]})]})]})})},ul=({id:e})=>{let{updateRoute:t}=W(),{siteData:n}=K(),{data:{tiers:r=[]}={}}=tr(),{data:{offers:i=[]}={},isFetched:a,isFetching:o}=Ft(),{mutateAsync:s}=Lt(),{mutateAsync:l}=Pt(),u=Nt(),[d,f]=(0,J.useState)(``),m=e===`monthly`?`monthly`:`yearly`,h=m===`monthly`?`Monthly retention`:`Yearly retention`,g=m===`monthly`?`month`:`year`,_=rr(r||[]),v=(0,J.useMemo)(()=>i.filter(e=>e.redemption_type===`retention`&&e.cadence===g).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,g]),y=(0,J.useMemo)(()=>v.find(e=>e.status===`active`)||null,[v]),b=v[0]||null,x=y||b,S=(0,J.useMemo)(()=>v.reduce((e,t)=>e+(t.redemption_count||0),0),[v]),C=(0,J.useMemo)(()=>v.map(e=>e.id),[v]),w=(0,J.useMemo)(()=>v.map(e=>e.last_redeemed).filter(e=>!!e).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime())[0]||null,[v]),T=(0,J.useMemo)(()=>S===0||C.length===0?null:zc(C),[C,S]),[E,D]=(0,J.useState)(20),[O,k]=(0,J.useState)(1),[A,j]=(0,J.useState)(null),{formState:M,setFormState:N,updateForm:P,handleSave:F,saveState:I,okProps:L,errors:R,clearError:z}=jt({initialState:tl(m),savingDelay:500,onSave:async()=>{let e=!1,t=il({formState:M,lastPercentAmount:E,lastFreeMonths:O}),n=ol(al(x))!==ol(t),r=M.enabled?`active`:`archived`,i=M.displayTitle||``,a=M.displayDescription||``,o=x?i!==(x.display_title||``)||a!==(x.display_description||``):i!==``||a!==``,c=tl(m),d=!M.enabled&&!x&&cl(M,c),f=async n=>{let r=crypto.getRandomValues(new Uint32Array(1))[0].toString(16).padStart(8,`0`),o=Wc(t,r);await s({name:o,code:r,display_title:i,display_description:a,cadence:g,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},p=async()=>{e&&await u()};if(!(!x&&!M.enabled&&!d)){if(n){!M.enabled&&y&&(await l({...y,status:`archived`}),e=!0),await f(r),await p();return}if(x){let t=x.status!==r;(o||t)&&(await l({...x,display_title:i,display_description:a,status:r}),e=!0),await p();return}(M.enabled||d)&&await f(r),await p()}},onSaveError:e=>{let t=`Please try again later`;e instanceof c&&e.data&&e.data.errors[0]&&(t=e.data.errors[0].context||e.data.errors[0].message||t),kt.remove(),p({title:`Failed to save offer`,type:`error`,message:t})},onValidate:()=>{let e={};return M.enabled?(M.type===`percent`&&((M.percentAmount<1||M.percentAmount>100)&&(e.amount=`Enter an amount between 1 and 100%.`),M.duration===`repeating`&&!sl(M.durationInMonths)&&(e.durationInMonths=Qc)),M.type===`free_months`&&(sl(M.freeMonths)||(e.amount=Qc)),e):e}}),B=`${e}:${x?.id||`none`}`;(0,J.useEffect)(()=>{!a||o||I===`unsaved`||A===B||(N(()=>rl(x,m)),j(B))},[m,B,x,a,A,o,I,N]),(0,J.useEffect)(()=>{M.percentAmount>0&&D(M.percentAmount)},[M.percentAmount]),(0,J.useEffect)(()=>{M.freeMonths>0&&k(M.freeMonths)},[M.freeMonths]);let ee=()=>{t(`offers/edit`)},V=(0,Y.jsx)(ll,{cadence:m,clearError:z,errors:R,formState:M,lastRedeemed:w,membersFilterUrl:T,redemptions:S,updateForm:P}),te=async()=>{try{await F({force:!0})&&ee()}catch{}},ne=(0,J.useMemo)(()=>{let e=il({formState:M,lastPercentAmount:E,lastFreeMonths:O}),t=_.find(e=>g===`month`?e.monthly_price:e.yearly_price);return{enabled:M.enabled,name:`${m} retention`,code:`${m}-retention`,displayTitle:M.displayTitle||``,displayDescription:M.displayDescription||``,type:e.type,cadence:g,amount:e.amount,duration:e.duration,durationInMonths:e.durationInMonths,currency:``,status:`active`,tierId:t?.id||``,redemptionType:`retention`}},[_,m,M,O,E,g]);(0,J.useEffect)(()=>{if(!n.url){f(``);return}let e=kc(ne,n.url);f(e)},[ne,n.url]);let H=(0,Y.jsx)(Oc,{href:d||``,portalParent:`offers`});return(0,Y.jsx)(Ii,{afterClose:()=>t(`offers`),backDropClick:!1,cancelLabel:`Cancel`,deviceSelector:!1,dirty:I===`unsaved`,height:`full`,okColor:L.color,okLabel:L.label||`Save`,preview:H,previewToolbarBreadcrumbs:[{label:`Offers`,onClick:ee},{label:h}],sidebar:V,size:`lg`,testId:`retention-offer-modal`,title:`Offer`,width:1140,onBreadcrumbsBack:ee,onCancel:ee,onOk:te})},dl=(e,t)=>e.find(e=>e.redemption_type===`retention`&&e.cadence===t&&e.status===`active`)||null,fl=(e,t)=>e.reduce((e,n)=>n.redemption_type!==`retention`||n.cadence!==t?e:e+(n.redemption_count||0),0),pl=(e,t)=>e.filter(e=>e.redemption_type===`retention`&&e.cadence===t).map(e=>e.id),ml=e=>e.type===`percent`&&e.amount===100&&e.duration===`repeating`,hl=e=>{if(!e)return null;if(ml(e)){let t=e.duration_in_months||0;return`${t} ${t===1?`month`:`months`} free`}return e.type===`percent`?`${e.amount}% OFF`:null},gl=e=>{if(!e)return null;if(ml(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 ${e.duration_in_months} ${t}`}return e.duration===`forever`?`Forever`:null},_l=e=>{let t=dl(e,`month`),n=dl(e,`year`),r=pl(e,`month`),i=pl(e,`year`),a=fl(e,`month`),o=fl(e,`year`);return[{id:`monthly`,name:`Monthly retention`,description:`Applied to monthly plans`,terms:hl(t),termsDetail:gl(t),redemptionOfferIds:r,redemptions:a,status:t?`active`:`inactive`},{id:`yearly`,name:`Yearly retention`,description:`Applied to annual plans`,terms:hl(n),termsDetail:gl(n),redemptionOfferIds:i,redemptions:o,status:n?`active`:`inactive`}]},vl=e=>e===`month`?`monthly`:`yearly`,yl=e=>e===`once`?`First payment`:e===`repeating`?`Repeating`:`Forever`,bl=(e,t,n,r,i)=>{let a=``,o=``,s=n===`month`?i?.monthly_price??0:i?.yearly_price??0,c=s,l=e=>parseFloat(e.toFixed(2)),u=ct(r)+H(l(Ye(s)));switch(e){case`percent`:a=`text-green`,o=t+`% off`,c=s-s*t/100;break;case`fixed`:a=`text-blue`,o=H(l(Ye(t)))+` `+r+` off`,c=s-t;break;case`trial`:a=`text-pink`,o=t+` days free`,u=``;break;default:break}c<0&&(c=0);let d=ct(r)+H(l(Ye(c)));return{discountColor:a,discountOffer:o,originalPriceWithCurrency:u,updatedPriceWithCurrency:d}},xl=({showArchived:e,setShowArchived:t,sortOption:n,sortDirection:r,onSortChange:i,onDirectionChange:a})=>(0,Y.jsx)(Pe,{position:`end`,trigger:(0,Y.jsx)(q,{"aria-label":`Filter options`,className:`p-1 hover:text-black dark:hover:text-white`,label:(0,Y.jsx)(zt,{size:16,strokeWidth:1.5}),unstyled:!0}),children:(0,Y.jsxs)(`div`,{className:`flex min-w-[200px] flex-col p-1 normal-case`,children:[(0,Y.jsx)(`div`,{className:`cursor-default pt-2 pl-3 text-sm font-medium tracking-wide text-grey-700 uppercase select-none`,children:`Sort by`}),(0,Y.jsx)(`div`,{className:`flex flex-col py-1`,children:[{id:`date-added`,label:`Date added`},{id:`name`,label:`Name`},{id:`redemptions`,label:`Redemptions`}].map(e=>(0,Y.jsxs)(`div`,{className:`group relative mx-1 flex items-center rounded-[2.5px] hover:bg-grey-100 dark:hover:bg-grey-800`,children:[(0,Y.jsxs)(`button`,{className:`flex w-full cursor-pointer items-center px-8 py-1.5 pr-12 text-left text-black dark:text-white`,type:`button`,onClick:()=>i(e.id),children:[n===e.id&&(0,Y.jsx)(f,{className:`absolute left-2`,name:`check`,size:`xs`}),e.label]}),n===e.id&&(0,Y.jsx)(`button`,{className:`absolute right-1 flex size-6 cursor-pointer items-center justify-center rounded-full hover:bg-grey-300 dark:hover:bg-grey-700`,title:r===`asc`?`Ascending`:`Descending`,type:`button`,onClick:()=>a(),children:(0,Y.jsx)(f,{name:r===`asc`?`arrow-up`:`arrow-down`,size:`xs`})})]},e.id))}),(0,Y.jsx)(`div`,{className:`-mx-1 mt-1 border-t border-t-grey-200 dark:border-t-grey-800`,children:(0,Y.jsx)(`div`,{className:`group relative mx-2 mt-1 flex items-center rounded-[2.5px] py-1`,children:(0,Y.jsxs)(`div`,{className:`flex w-full items-center px-8 py-1.5 pr-2 text-black dark:text-white`,children:[(0,Y.jsx)(Bt,{className:`absolute left-2 -mt-0.5 text-black dark:text-white`,size:14,strokeWidth:1.5}),(0,Y.jsx)(`div`,{className:`grow [&>div]:w-full`,children:(0,Y.jsx)(vt,{checked:e,direction:`rtl`,label:`Show archived`,labelClasses:`text-black dark:text-white`,onChange:e=>{t(e.target.checked)}})})]})})})]})}),Sl=({offer:e,onClick:t})=>{let n=e.redemptions>0&&e.redemptionOfferIds.length>0?zc(e.redemptionOfferIds):void 0;return(0,Y.jsxs)(`tr`,{className:`group relative border-b border-b-grey-200 dark:border-grey-800`,"data-testid":`retention-offer-item`,children:[(0,Y.jsx)(`td`,{className:`sticky left-0 z-10 bg-white p-0 dark:bg-black`,children:(0,Y.jsxs)(`button`,{className:`block w-full cursor-pointer p-5 pl-0 text-left`,type:`button`,onClick:t,children:[(0,Y.jsx)(`span`,{className:`font-semibold`,children:e.name}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.description})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.terms?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`text-[1.3rem] font-medium uppercase`,children:e.terms}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.termsDetail})]}):(0,Y.jsx)(`span`,{className:`text-grey-700`,children:`–`})})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:(0,Y.jsx)(`span`,{className:`text-grey-700`,children:`–`})})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:n?(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5 hover:underline`,"data-testid":`retention-redemptions-link-${e.id}`,href:n,children:e.redemptions}):(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,"data-testid":`retention-redemptions-link-${e.id}`,type:`button`,onClick:t,children:e.redemptions})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`button`,{className:`block w-full cursor-pointer p-5 text-left`,type:`button`,onClick:t,children:e.status===`active`?(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-[rgba(48,207,67,0.15)] px-2 py-0.5 text-xs font-semibold tracking-wide text-green uppercase`,children:`Active`}):(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-grey-200 px-2 py-0.5 text-xs font-semibold tracking-wide text-grey-700 uppercase dark:bg-grey-900 dark:text-grey-500`,children:`Inactive`})})})]})},Cl=()=>{let e=N(),{updateRoute:t}=W(),{data:{offers:n=[]}={}}=Ft(),{data:{tiers:r}={}}=tr(),i=n.filter(e=>e.redemption_type===`signup`),a=_l(n),{sortingState:o,setSortingState:s}=le(),c=o?.find(e=>e.type===`offers`),{offersShowArchived:l,setOffersShowArchived:u}=ie(),d=c?.option||`date-added`,f=c?.direction||`desc`,m=e=>{e&&t(`offers/edit/${e}`)},h=e=>{t(`offers/edit/retention/${e}`)},g=i.sort((e,t)=>{let n=f===`desc`?-1:1;switch(d){case`name`:return n*e.name.localeCompare(t.name);case`redemptions`:return n*(e.redemption_count-t.redemption_count);default:return n*((e.created_at?new Date(e.created_at).getTime():0)-(t.created_at?new Date(t.created_at).getTime():0))}}),_=rr(r||[]),v=g.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)}),y=e=>{s?.([{type:`offers`,option:e,direction:f}])},b=()=>{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&&t.active===!1},S=[{key:`cancel-modal`,label:`Close`,onClick:()=>{e.remove(),t(`offers`)}},{key:`new-offer`,icon:`add`,label:`New offer`,color:`green`,onClick:()=>{_.length===0?p({type:`info`,title:`You must have an active tier to create an offer.`}):t(`offers/new`)}}],C=(0,Y.jsx)(`div`,{className:`overflow-x-auto`,children:(0,Y.jsxs)(`table`,{className:`m-0 min-w-[900px]`,children:[(0,Y.jsxs)(`colgroup`,{children:[(0,Y.jsx)(`col`,{className:`w-[25%]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[200px]`}),(0,Y.jsx)(`col`,{className:`w-[220px]`})]}),(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b border-b-grey-200 dark:border-grey-800`,children:[(0,Y.jsx)(`th`,{className:`sticky left-0 z-10 bg-white p-0 pb-2.5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase dark:bg-black`,children:`Name`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Terms`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Price`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Redemptions`}),(0,Y.jsx)(`th`,{className:`p-0 pb-2.5 pl-5 text-left text-sm font-medium tracking-wide text-grey-700 uppercase`,children:(0,Y.jsxs)(`span`,{className:`flex items-center justify-between`,children:[`Status`,(0,Y.jsx)(xl,{setShowArchived:u,showArchived:l,sortDirection:f,sortOption:d,onDirectionChange:b,onSortChange:y})]})})]})}),(0,Y.jsxs)(`tbody`,{children:[a.map(e=>(0,Y.jsx)(Sl,{offer:e,onClick:()=>h(e.id)},e.id)),v.map(e=>{let t=r?.find(t=>t.id===e?.tier?.id);if(!t)return null;let n=x(e),{discountOffer:i,originalPriceWithCurrency:a,updatedPriceWithCurrency:o}=bl(e.type,e.amount,e.cadence,e.currency||`USD`,t);return(0,Y.jsxs)(`tr`,{className:`group relative border-b border-b-grey-200 dark:border-grey-800 ${n?`opacity-60`:``}`,"data-testid":`offer-item`,children:[(0,Y.jsx)(`td`,{className:`sticky left-0 z-10 bg-white p-0 dark:bg-black`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5 pl-0`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`font-semibold`,children:e?.name}),(0,Y.jsx)(`br`,{}),(0,Y.jsxs)(`span`,{className:`text-grey-700`,children:[t.name,` `,vl(e.cadence)]})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`text-[1.3rem] font-medium uppercase`,children:i}),(0,Y.jsx)(`br`,{}),(0,Y.jsx)(`span`,{className:`text-grey-700`,children:e.type===`trial`?`Trial period`:yl(e.duration)})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsxs)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:[(0,Y.jsx)(`span`,{className:`font-medium`,children:o}),` `,e.type===`trial`?null:(0,Y.jsx)(`span`,{className:`relative text-sm text-grey-700 before:absolute before:-inset-x-0.5 before:top-1/2 before:rotate-[-20deg] before:border-t before:content-[""]`,children:a})]})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5 ${e.redemption_count===0?``:`hover:underline`}`,href:e.redemption_count>0&&e.id?Bc(e.id):void 0,onClick:e.redemption_count===0&&e.id?()=>m(e.id):void 0,children:e.redemption_count})}),(0,Y.jsx)(`td`,{className:`p-0 whitespace-nowrap`,children:(0,Y.jsx)(`a`,{className:`block cursor-pointer p-5`,onClick:()=>m(e.id),children:n?(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-grey-200 px-2 py-0.5 text-xs font-semibold tracking-wide text-grey-700 uppercase dark:bg-grey-900 dark:text-grey-500`,children:`Archived`}):(0,Y.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-[rgba(48,207,67,0.15)] px-2 py-0.5 text-xs font-semibold tracking-wide text-green uppercase`,children:`Active`})})})]},e.id)})]})]})});return(0,Y.jsx)(L,{afterClose:()=>{t(`offers`)},animate:!1,backDropClick:!1,cancelLabel:``,footer:!1,height:`full`,size:`lg`,testId:`offers-modal`,title:`Offers`,topRightContent:(0,Y.jsx)(re,{buttons:S}),width:1140,children:(0,Y.jsx)(`div`,{className:`flex h-full flex-col pt-8`,children:C})})},wl=({route:e})=>{if(e===`offers/new`)return(0,Y.jsx)(Lc,{});if(e.startsWith(`offers/edit/retention/`)&&e.length>22){let t=e.split(`/`).pop();return(0,Y.jsx)(ul,{id:t||``})}else if(e===`offers/edit/retention/`||e===`offers/edit/retention`)return(0,Y.jsx)(Cl,{});else if(e.startsWith(`offers/edit/`)&&e.length>12){let t=e.split(`/`).pop();return(0,Y.jsx)(qc,{id:t||``})}else if(e.startsWith(`offers/success/`)&&e.length>15){let t=e.split(`/`).pop();return(0,Y.jsx)(Dc,{id:t||``})}else if(e===`offers/edit`||e===`offers/edit/`)return(0,Y.jsx)(Cl,{})},Tl=O.create(()=>{let{route:e}=W();return(0,Y.jsx)(wl,{route:e})});``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href;var El=h({method:`POST`,path:()=>`/files/upload/`,body:({file:e})=>{let t=new FormData;return t.append(`file`,e),t}}),Dl=O.create(()=>{let{updateRoute:e}=W(),[t,n]=(0,J.useState)({js:!1,css:!1}),{settings:r,config:i}=K(),[a]=Nn(r,[`pintura`]),{mutateAsync:o}=In(),{mutateAsync:s}=El(),c=g();(0,J.useEffect)(()=>{m(a||!1)},[a]);let[l,u]=(0,J.useState)(`Save`),[d,m]=(0,J.useState)(!!a),h=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)}},_=(0,J.useRef)(null),v=(0,J.useRef)(null),y=e=>{e===`js`&&_.current?.click(),e===`css`&&v.current?.click()},b=async(e,t)=>{try{n(e=>({...e,[t]:!0}));let r=e.target?.files?.[0];if(!r)return;let{files:i}=await s({file:r}),a=i[0].url,c=[{key:`pintura_${t}_url`,value:a}];await o(c),n(e=>({...e,[t]:!1})),p({type:`success`,title:`Pintura ${t} uploaded`})}catch(e){n({js:!1,css:!1}),c(e)}};return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:d!==a,okColor:l===`Saved`?`green`:`black`,okLabel:l,testId:`pintura-modal`,title:``,onOk:h,children:[(0,Y.jsx)(it,{detail:`Advanced image editing`,icon:(0,Y.jsx)(f,{name:`pintura`,size:48}),title:`Pintura`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[!i.pintura&&(0,Y.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,Y.jsxs)(`div`,{className:`md:basis-1/2`,children:[(0,Y.jsx)(`p`,{className:`mb-4 text-md font-semibold`,children:`Add advanced image editing to Ghost, with Pintura`}),(0,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex grow flex-col items-end justify-between gap-2 md:basis-1/2`,children:[(0,Y.jsx)(`img`,{alt:`Pintura screenshot`,src:``+new URL(`pintura-screenshot-DTzk1LjU.png`,import.meta.url).href}),(0,Y.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,Y.jsxs)(U,{marginBottom:!1,title:`Pintura configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:d,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.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`]}),label:`Enable Pintura`,onChange:e=>{m(e.target.checked)}}),d&&!i.pintura&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Upload Pintura script`}),(0,Y.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Y.jsx)(`code`,{children:`pintura-umd.js`}),` file from the Pintura package`]})]}),(0,Y.jsx)(`input`,{ref:_,accept:`.js`,type:`file`,hidden:!0,onChange:async e=>{await b(e,`js`)}}),(0,Y.jsx)(q,{color:`outline`,disabled:t.js,label:`Upload`,onClick:()=>{y(`js`)}})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col justify-between gap-1 md:flex-row md:items-center`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{children:`Upload Pintura styles`}),(0,Y.jsxs)(`div`,{className:`text-sm text-grey-600`,children:[`Upload the `,(0,Y.jsx)(`code`,{children:`pintura.css`}),` file from the Pintura package`]})]}),(0,Y.jsx)(`input`,{ref:v,accept:`.css`,type:`file`,hidden:!0,onChange:async e=>{await b(e,`css`)}}),(0,Y.jsx)(q,{color:`outline`,disabled:t.css,label:`Upload`,onClick:()=>{y(`css`)}})]})]})]})]})]})}),Ol=({localSettings:e,updateSetting:t})=>{let[n,r,i,a,o,s]=Nn(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,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(D,{}),(0,Y.jsx)(A,{level:5,children:`Transistor`}),(0,Y.jsx)(vt,{checked:c,direction:`rtl`,hint:`Show a section on the account page for members to access private podcasts`,label:`Enable Transistor integration`,onChange:e=>t(`transistor_portal_enabled`,e.target.checked)}),c&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(I,{hint:`The heading displayed above the Transistor section`,placeholder:`Podcasts`,title:`Heading`,value:i,onChange:e=>t(`transistor_portal_heading`,e.target.value)}),(0,Y.jsx)(I,{hint:`A short description of what members can do`,placeholder:`Access your RSS feeds`,title:`Description`,value:a,onChange:e=>t(`transistor_portal_description`,e.target.value)}),(0,Y.jsx)(I,{hint:`The text displayed on the button`,placeholder:`Manage`,title:`Button text`,value:o,onChange:e=>t(`transistor_portal_button_text`,e.target.value)}),(0,Y.jsx)(I,{hint:`Use {memberUuid} as a placeholder for the member ID`,placeholder:`https://partner.transistor.fm/ghost/{memberUuid}`,title:`URL template`,value:s,onChange:e=>t(`transistor_portal_url_template`,e.target.value)})]})]})},kl=({localSettings:e,updateSetting:t,errors:n,setError:r})=>{let{siteData:i,settings:a,config:o}=K(),[s,c]=Nn(a,[`members_support_address`,`support_email_address`]),l=c?.toString()||An(s?.toString()||``,i,o),u=Hn(i,o),[d,f]=(0,J.useState)(l);return(0,J.useEffect)(()=>{f(l)},[l]),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(I,{error:!!n.members_support_address,hint:n.members_support_address,title:`Support email address`,value:d,onBlur:e=>{let n=e.target.value;n?ua.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(An(a,i,o))},onChange:e=>f(e.target.value)}),(0,Y.jsx)(Ol,{localSettings:e,updateSetting:t})]})})},Al=[{icon:`portal-icon-1`,value:`icon-1`},{icon:`portal-icon-2`,value:`icon-2`},{icon:`portal-icon-3`,value:`icon-3`},{icon:`portal-icon-4`,value:`icon-4`},{icon:`portal-icon-5`,value:`icon-5`}],jl=({localSettings:e,updateSetting:t})=>{let{mutateAsync:n}=pt(),r=g(),[i,a,o,s]=Nn(e,[`portal_button`,`portal_button_style`,`portal_button_icon`,`portal_button_signup_text`]),c=o||Al[0].value,[l,u]=(0,J.useState)(Al.map(({value:e})=>e).includes(c)?void 0:c),d=async e=>{try{let r=Ne(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)}},p=()=>{t(`portal_button_icon`,null),u(void 0)},m=[{value:`icon-and-text`,label:`Icon and text`},{value:`icon-only`,label:`Icon only`},{value:`text-only`,label:`Text only`}];return(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(vt,{checked:!!i,direction:`rtl`,label:`Show portal button`,onChange:e=>t(`portal_button`,e.target.checked)}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Te,{options:m,selectedOption:m.find(e=>e.value===a),title:`Button style`,onSelect:e=>t(`portal_button_style`,e?.value||null)}),a?.toString()?.includes(`icon`)&&(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(A,{level:6,grey:!0,children:`Icon`}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[Al.map(e=>(0,Y.jsx)(`button`,{className:P(`border p-3`,c===e.value?`border-green`:`border-transparent`),type:`button`,onClick:()=>t(`portal_button_icon`,e.value),children:(0,Y.jsx)(f,{className:`size-5 ${c===e.value?`text-green`:`text-black opacity-70 transition-all hover:opacity-100 dark:text-white`}`,name:e.icon})},e.value)),(0,Y.jsx)(`div`,{className:P(`relative w-[46px] border`,c===l?`border-green`:`border-transparent`),children:(0,Y.jsx)(Ee,{deleteButtonClassName:`invisible absolute -right-2 -top-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white hover:bg-black group-hover:visible!`,deleteButtonContent:(0,Y.jsx)(f,{colorClass:`text-white`,name:`trash`,size:`sm`}),height:`46px`,id:`test`,imageClassName:`cursor-pointer`,imageURL:l,width:`46px`,deleteButtonUnstyled:!0,onDelete:p,onImageClick:()=>l&&t(`portal_button_icon`,l),onUpload:d,children:(0,Y.jsx)(f,{className:`dark:text-white`,name:`upload`,size:`md`})})})]})]}),a?.toString()?.includes(`text`)&&(0,Y.jsx)(I,{title:`Signup button text`,value:s,onChange:e=>t(`portal_button_signup_text`,e.target.value)})]})]})})},Ml=({name:e,value:t})=>{let n=(0,J.useId)();return(0,Y.jsx)(Se,{action:(0,Y.jsx)(q,{color:`black`,label:`Copy`,link:!0,onClick:e=>{navigator.clipboard.writeText(t);let n=e?.target;n.innerText=`Copied`,setTimeout(()=>{n.innerText=`Copy`},1e3)}}),separator:!0,children:(0,Y.jsxs)(`div`,{className:`flex w-full grow flex-col py-3 lg:flex-row lg:items-center lg:gap-5`,children:[(0,Y.jsxs)(`label`,{className:`inline-block whitespace-nowrap lg:w-[180px] lg:min-w-[180px]`,htmlFor:n,children:[e,`:`]}),(0,Y.jsx)(I,{className:`grow border-b-grey-500 bg-transparent py-1 text-grey-700 lg:p-1`,id:n,value:t,disabled:!0,unstyled:!0})]})})},Nl=()=>{let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(``),{siteData:i,settings:a}=K(),{data:{tiers:o}={}}=tr(),s=rr(o||[]),[c]=Nn(a,[`paid_members_enabled`]),l=()=>{t(!e)};(0,J.useEffect)(()=>{s?.length&&!n&&r(s[0].id)},[s,n]);let u=s?.map(e=>({label:e.name,value:e.id})),d=Wn(i);return(0,Y.jsxs)(Pi,{className:`max-w-[920px] text-base text-black dark:text-white`,heading:`Links`,children:[(0,Y.jsxs)(`p`,{className:`-mt-6 mb-16`,children:[`Use these `,e?`data attributes`:`links`,` in your theme to show pages of Portal.`]}),(0,Y.jsxs)(ne,{actions:(0,Y.jsx)(q,{color:`green`,label:e?`Links`:`Data attributes`,link:!0,onClick:l}),title:`Generic`,titleSize:`lg`,children:[(0,Y.jsx)(Ml,{name:`Default`,value:e?`data-portal`:`${d}#/portal`}),(0,Y.jsx)(Ml,{name:`Sign in`,value:e?`data-portal="signin"`:`${d}#/portal/signin`}),(0,Y.jsx)(Ml,{name:`Sign up`,value:e?`data-portal="signup"`:`${d}#/portal/signup`}),c&&(0,Y.jsx)(Ml,{name:`Gift subscriptions`,value:e?`data-portal="gift"`:`${d}#/portal/gift`})]}),(0,Y.jsxs)(ne,{className:`mt-14`,title:`Tiers`,titleSize:`lg`,children:[(0,Y.jsx)(Se,{hideActions:!0,separator:!0,children:(0,Y.jsxs)(`div`,{className:`flex w-full items-center gap-2 py-2`,children:[(0,Y.jsx)(`span`,{className:`inline-block w-[180px] min-w-[180px] shrink-0`,children:`Tier:`}),(0,Y.jsx)(Te,{options:u,selectedOption:u.find(e=>e.value===n),onSelect:e=>{e&&r(e?.value)}})]})}),(0,Y.jsx)(Ml,{name:`Signup / Monthly`,value:e?`data-portal="signup/${n}/monthly"`:`${d}#/portal/signup/${n}/monthly`}),(0,Y.jsx)(Ml,{name:`Signup / Yearly`,value:e?`data-portal="signup/${n}/yearly"`:`${d}#/portal/signup/${n}/yearly`}),(0,Y.jsx)(Ml,{name:`Signup / Free`,value:e?`data-portal="signup/free"`:`${d}#/portal/signup/free`})]}),(0,Y.jsxs)(ne,{className:`mt-14`,title:`Account`,titleSize:`lg`,children:[(0,Y.jsx)(Ml,{name:`Account`,value:e?`data-portal="account"`:`${d}#/portal/account`}),(0,Y.jsx)(Ml,{name:`Account / Plans`,value:e?`data-portal="account/plans"`:`${d}#/portal/account/plans`}),(0,Y.jsx)(Ml,{name:`Account / Profile`,value:e?`data-portal="account/profile"`:`${d}#/portal/account/profile`}),(0,Y.jsx)(Ml,{name:`Account / Newsletters`,value:e?`data-portal="account/newsletters"`:`${d}#/portal/account/newsletters`}),(0,Y.jsx)(Ml,{name:`Account / Newsletter help`,value:e?`data-portal="account/newsletters/help"`:`${d}#/portal/account/newsletters/help`})]})]})},Pl=({settings:e,config:t,tiers:n,siteData:r,selectedTab:i})=>{if(!r?.url)return null;let a=n.filter(e=>e.visibility===`public`&&e.type===`paid`).map(e=>e.id),o=r.url.replace(/\/$/,``),s=JSON.parse(Kn(e,`portal_plans`)||``),c=new URLSearchParams;c.append(`button`,Kn(e,`portal_button`)?`true`:`false`),c.append(`name`,Kn(e,`portal_name`)?`true`:`false`),c.append(`isFree`,s.includes(`free`)?`true`:`false`),c.append(`isMonthly`,Vn(e,t)&&s.includes(`monthly`)?`true`:`false`),c.append(`isYearly`,Vn(e,t)&&s.includes(`yearly`)?`true`:`false`),c.append(`page`,i===`account`?`accountHome`:`signup`),c.append(`buttonIcon`,encodeURIComponent(Kn(e,`portal_button_icon`)||`icon-1`)),c.append(`signupButtonText`,encodeURIComponent(Kn(e,`portal_button_signup_text`)||``)),c.append(`membersSignupAccess`,Kn(e,`members_signup_access`)||`all`),c.append(`allowSelfSignup`,Kn(e,`allow_self_signup`)||`false`),c.append(`signupTermsHtml`,Kn(e,`portal_signup_terms_html`)||``),c.append(`signupCheckboxRequired`,Kn(e,`portal_signup_checkbox_required`)?`true`:`false`),c.append(`portalProducts`,a.join(`,`));let l=Kn(e,`portal_default_plan`);l&&c.append(`portalDefaultPlan`,l),s&&s.length&&c.append(`portalPrices`,encodeURIComponent(s.join(`,`)));let u=Kn(e,`accent_color`);u!=null&&c.append(`accentColor`,encodeURIComponent(u));let d=Kn(e,`portal_button_style`);return d&&c.append(`buttonStyle`,encodeURIComponent(d)),c.append(`disableBackground`,`false`),Kn(e,`transistor`)&&c.append(`transistorPortalSettings`,JSON.stringify({enabled:Kn(e,`transistor_portal_enabled`),heading:Kn(e,`transistor_portal_heading`)||`Podcasts`,description:Kn(e,`transistor_portal_description`)||`Access your RSS feeds`,button_text:Kn(e,`transistor_portal_button_text`)||`Manage`,url_template:Kn(e,`transistor_portal_url_template`)||`https://partner.transistor.fm/ghost/{memberUuid}`})),c.append(`admin_toolbar`,`0`),`${o}/?v=modal-portal-settings#/portal/preview?${c.toString()}`},Fl=({selectedTab:e=`signup`,localSettings:t,localTiers:n})=>{let{siteData:r,config:i}=K(),a=Pl({settings:t,tiers:n,selectedTab:e,siteData:r,config:i}),o=(0,Y.jsx)(Y.Fragment,{});switch(e){case`account`:o=(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsx)(Oc,{href:a||``,portalParent:`preview`,selectedTab:e})});break;case`links`:o=(0,Y.jsx)(Nl,{});break;default:o=(0,Y.jsx)(Y.Fragment,{children:(0,Y.jsx)(Oc,{href:a||``,portalParent:`preview`,selectedTab:e})});break}return o},Il=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a})=>{let{config:o}=K(),[s,c,l,u,d,f]=Nn(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,J.useMemo)(()=>{let e=document.createElement(`div`);return e.innerHTML=l?.toString()||``,e.innerText.length},[l]),h=(0,J.useCallback)((e,t)=>{a(e,t)},[]);(0,J.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=Vn(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=rr(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,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{children:[(0,Y.jsx)(vt,{checked:!!c,direction:`rtl`,disabled:!_,label:`Display name in signup form`,onChange:e=>t(`portal_name`,e.target.checked)}),(0,Y.jsx)(sr,{checkboxes:b,title:`Available tiers`}),C&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(sr,{checkboxes:[{checked:p.includes(`monthly`),disabled:!_,label:`Monthly`,value:`monthly`,onChange:()=>{g(`monthly`)}},{checked:p.includes(`yearly`),disabled:!_,label:`Yearly`,value:`yearly`,onChange:()=>{g(`yearly`)}}],title:`Available prices`}),p.includes(`yearly`)&&p.includes(`monthly`)&&(0,Y.jsx)(Te,{options:S,selectedOption:S.find(e=>e.value===f),title:`Default price at signup`,onSelect:e=>{t(`portal_default_plan`,e?.value??`yearly`)}})]}),(0,Y.jsx)(Zr,{error:!!i.portal_signup_terms_html,hint:i.portal_signup_terms_html||(0,Y.jsxs)(Y.Fragment,{children:[`Recommended: `,(0,Y.jsx)(`strong`,{children:`115`}),` characters. You've used `,(0,Y.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,Y.jsx)(vt,{checked:!!u,disabled:!_,label:`Require agreement`,labelStyle:`heading`,onChange:e=>t(`portal_signup_checkbox_required`,e.target.checked)})]})})},Ll=h({path:()=>`/settings/verifications`,method:`PUT`,body:({token:e})=>({token:e}),updateQueries:{dataType:`SettingsResponseType`,emberUpdateType:`createOrUpdate`,update:e=>({...e,settings:e.settings})}}),Rl=({localSettings:e,updateSetting:t,localTiers:n,updateTier:r,errors:i,setError:a,selectedTab:o,onTabChange:s})=>(0,Y.jsx)(`div`,{className:`pt-4`,children:(0,Y.jsx)(Xe,{selectedTab:o,tabs:[{id:`signupOptions`,title:`Signup options`,contents:(0,Y.jsx)(Il,{errors:i,localSettings:e,localTiers:n,setError:a,updateSetting:t,updateTier:r})},{id:`lookAndFeel`,title:`Look & feel`,contents:(0,Y.jsx)(jl,{localSettings:e,updateSetting:t})},{id:`accountPage`,title:`Account page`,contents:(0,Y.jsx)(kl,{errors:i,localSettings:e,setError:a,updateSetting:t})}],onTabChange:s})}),zl=O.create(()=>{let{updateRoute:e}=W(),[t,n]=(0,J.useState)(`signup`),[r,i]=(0,J.useState)(`signupOptions`),a=g(),{settings:o,siteData:s,config:c}=K(),{mutateAsync:l}=In(),{data:{tiers:u}={}}=tr(),{mutateAsync:d}=nr(),{mutateAsync:f}=Ll(),{getParam:p}=je(),m=p(`verifyEmail`);(0,J.useEffect)(()=>{m&&(async({token:e})=>{try{let{settings:t}=await f({token:e}),[n]=Nn(t,[`members_support_address`]);O.show(me,{title:`Support address verified`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`Your support email address has been changed to `,(0,Y.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.`),O.show(me,{title:`Error verifying support address`,prompt:t,okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()}),a(e,{withToast:!1})}})({token:m})},[a,m,f]);let{formState:h,setFormState:_,saveState:v,handleSave:y,updateForm:b,okProps:x}=jt({initialState:{settings:o,tiers:u||[]},savingDelay:500,onSave:async()=>{await Promise.all(h.tiers.filter(({dirty:e})=>e).map(e=>d(e))),_(e=>({...e,tiers:h.tiers.map(e=>({...e,dirty:!1}))}));let e=h.settings.filter(e=>e.dirty);if(!e.length)return;let{meta:t,settings:n}=await l(e);if(_(e=>({...e,settings:h.settings.map(e=>({...e,dirty:!1}))})),t?.sent_email_verification){let e=h.settings.find(e=>e.key===`members_support_address`)?.value,t=n.find(e=>e.key===`support_email_address`)?.value||An(n.find(e=>e.key===`members_support_address`)?.value?.toString()||`noreply`,s,c);O.show(me,{title:`Confirm email address`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[`We've sent a confirmation email to `,(0,Y.jsx)(`strong`,{children:e}),`. Until verified, your support email address will remain `,t,`.`]}),okLabel:`Close`,cancelLabel:``,onOk:e=>e?.remove()})}},onSaveError:a});(0,J.useEffect)(()=>{!h.tiers.length&&u?.length&&_(e=>({...e,tiers:u}))},[u,h.tiers,_]);let[S,C]=(0,J.useState)({}),w=(e,t)=>{b(n=>({...n,settings:n.settings.map(n=>n.key===e?{...n,value:t,dirty:!0}:n)}))},T=(e,t)=>{C(n=>({...n,[e]:t}))},E=e=>{b(t=>({...t,tiers:t.tiers.map(t=>t.id===e.id?{...e,dirty:!0}:t)}))},D=e=>{n(e),e===`signup`?i(`signupOptions`):e===`account`&&i(`accountPage`)},k=(0,Y.jsx)(Rl,{errors:S,localSettings:h.settings,localTiers:h.tiers,selectedTab:r,setError:T,updateSetting:w,updateTier:E,onTabChange:e=>{i(e),e===`signupOptions`?n(`signup`):e===`accountPage`&&n(`account`)}}),A=(0,Y.jsx)(Fl,{localSettings:h.settings,localTiers:h.tiers,selectedTab:t});return(0,Y.jsx)(Ii,{afterClose:()=>{e(`portal`)},buttonsDisabled:x.disabled,cancelLabel:`Close`,deviceSelector:!1,dirty:v===`unsaved`,okColor:x.color,okLabel:x.label||`Save`,preview:A,previewBgColor:t===`links`?`white`:`greygradient`,previewToolbarTabs:[{id:`signup`,title:`Signup`},{id:`account`,title:`Account page`},{id:`links`,title:`Links`}],selectedURL:t,sidebar:k,testId:`portal-modal`,title:`Portal`,onOk:async()=>{Object.values(S).filter(Boolean).length||await y({force:!0})},onSelectURL:D})}),Bl=O.create(()=>{let{updateRoute:e}=W(),{localSettings:t,updateSetting:n,handleSave:r,validate:i,errors:a,clearError:o,okProps:s}=be({onValidate:()=>{let e={};return c&&!ua.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]=Nn(t,[`slack_url`,`slack_username`]),{mutateAsync:u}=Jn();return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:t.some(e=>e.dirty),okColor:s.color,okLabel:s.label||`Save`,testId:`slack-modal`,title:``,onOk:async()=>{kt.remove(),await r()},children:[(0,Y.jsx)(it,{detail:`A messaging app for teams`,icon:(0,Y.jsx)(f,{name:`slack`,size:56}),title:`Slack`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsxs)(U,{marginBottom:!1,title:`Slack configuration`,grouped:!0,children:[(0,Y.jsx)(I,{error:!!a.slackUrl,hint:a.slackUrl||(0,Y.jsxs)(Y.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,Y.jsx)(`a`,{href:`https://my.slack.com/apps/new/A0F7XDUAZ-incoming-webhooks`,children:`here`}),`, and grab the URL.`]}),placeholder:`https://hooks.slack.com/services/...`,title:`Webhook URL`,value:c,onBlur:i,onChange:e=>n(`slack_url`,e.target.value),onKeyDown:()=>o(`slackUrl`)}),(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2 md:flex-row md:items-center`,children:[(0,Y.jsx)(I,{containerClassName:`grow`,hint:`The username to display messages from`,title:`Username`,value:l,onChange:e=>n(`slack_username`,e.target.value)}),(0,Y.jsx)(q,{color:`outline`,label:`Send test notification`,onClick:async()=>{kt.remove(),await r()&&(await u(null),p({title:`Check your Slack channel for the test message`,type:`info`}))}})]})]})})]})}),Vl=``+new URL(`stripe-thumb-Cu2h4McY.jpg`,import.meta.url).href,Hl=``+new URL(`orb-squircle-DUFLvKu-.png`,import.meta.url).href,Ul=`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`,$=``+new URL(`stripe-verified-DM7Q8nrY.svg`,import.meta.url).href,Wl=1e3,Gl=15*Wl,Kl=({onNext:e})=>(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(A,{level:3,children:`Getting paid`}),(0,Y.jsx)(`img`,{alt:`Stripe Verified Partner Badge`,src:$})]}),(0,Y.jsxs)(`div`,{className:`mt-6 mb-7`,children:[`Stripe is our exclusive direct payments partner. Ghost collects `,(0,Y.jsx)(`strong`,{children:`no fees`}),` on any payments! If you don’t have a Stripe account yet, you can `,(0,Y.jsx)(`a`,{className:`underline`,href:`https://stripe.com`,rel:`noopener noreferrer`,target:`_blank`,children:`sign up here`}),`.`]}),(0,Y.jsx)(Qe,{label:(0,Y.jsx)(Y.Fragment,{children:`I have a Stripe account, let's go →`}),onClick:e})]}),ql=()=>{let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(``),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),{refetch:l}=tr({searchParams:{filter:`type:paid+active:true`},enabled:!1}),{mutateAsync:u}=nr(),{mutateAsync:f}=In(),p=g(),m=e=>{r(e.target.value),t(!!e.target.value)},h=async()=>{let{data:e}=await l(),t=e?.pages[0].tiers[0];if(t){t.monthly_price=500,t.yearly_price=5e3,t.currency=`USD`;let e=0;for(;e<Gl;){await new Promise(e=>{setTimeout(e,Wl)});try{await u(t);break}catch(t){if(t instanceof c&&t.data?.errors?.[0].code===`STRIPE_NOT_CONFIGURED`){e+=Wl;continue}else{p(t);return}}}}},_=async()=>{if(s(``),n)try{await f([{key:`stripe_connect_integration_token`,value:n}]),await h(),await f([{key:`portal_plans`,value:JSON.stringify([`free`,`monthly`,`yearly`])}])}catch(e){if(e instanceof c&&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,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,Y.jsx)(A,{level:3,children:`Connect with Stripe`}),(0,Y.jsx)(vt,{checked:i,direction:`rtl`,label:`Test mode`,labelClasses:`translate-y-[1px] ${i?`text-[#EC6803]`:`text-grey-800`}`,toggleBg:`stripetest`,onChange:e=>a(e.target.checked)})]}),(0,Y.jsxs)(A,{level:6,grey:!0,children:[`Step 1 — `,(0,Y.jsx)(`span`,{className:`text-black dark:text-white`,children:`Generate secure key`})]}),(0,Y.jsxs)(`div`,{className:`mt-2 mb-4`,children:[`Click on the `,(0,Y.jsx)(`strong`,{children:`“Connect with Stripe”`}),` button to generate a secure key that connects your Ghost site with Stripe.`]}),(0,Y.jsx)(Qe,{href:y,tag:`a`,target:`_blank`}),(0,Y.jsxs)(A,{className:`mt-8 mb-2`,level:6,grey:!0,children:[`Step 2 — `,(0,Y.jsx)(`span`,{className:`text-black dark:text-white`,children:`Paste secure key`})]}),(0,Y.jsx)(z,{error:!!o,hint:o||void 0,placeholder:`Paste your secure key here`,onChange:m}),e&&(0,Y.jsx)(q,{className:`mt-5`,color:`green`,label:`Save Stripe settings`,onClick:_})]})},Jl=({onClose:e})=>{let{settings:t}=K(),[n,r]=Nn(t,[`stripe_connect_display_name`,`stripe_connect_livemode`]),{refetch:i,isFetching:a}=qn({searchParams:{filter:`status:paid`,limit:`0`},enabled:!1}),{mutateAsync:o}=Ln(),s=g();return(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsx)(q,{color:`red`,disabled:a,icon:`link-broken`,iconColorClass:`text-red`,label:`Disconnect`,link:!0,onClick:async()=>{let{data:t}=await i(),r=!!t?.meta?.pagination.total;O.show(me,{title:`Disconnect Stripe`,prompt:r?`Cannot disconnect while there are members with active Stripe subscriptions.`:(0,Y.jsxs)(Y.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)}}})}}),(0,Y.jsx)(q,{icon:`close`,iconColorClass:`dark:text-white`,label:`Close`,size:`sm`,hideLabel:!0,link:!0,onClick:e})]}),(0,Y.jsxs)(`div`,{className:`my-20 flex flex-col items-center`,children:[(0,Y.jsxs)(`div`,{className:`relative h-20 w-[200px]`,children:[(0,Y.jsx)(`img`,{alt:`Ghost Logo`,className:`absolute left-10 size-16`,src:Hl}),(0,Y.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:Ul})]}),(0,Y.jsxs)(A,{className:`text-center`,level:3,children:[`You are connected with Stripe!`,r?null:` (Test mode)`]}),(0,Y.jsxs)(`div`,{className:`mt-1`,children:[`Connected to `,(0,Y.jsx)(`strong`,{children:n||`Test mode`})]})]}),(0,Y.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,Y.jsx)(A,{level:6,children:`Read next`}),(0,Y.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,Y.jsxs)(`div`,{className:`order-2 p-4 md:order-1`,children:[(0,Y.jsx)(`div`,{className:`text-md font-semibold`,children:`How to setup and manage your Stripe account`}),(0,Y.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,Y.jsxs)(`div`,{className:`mt-3 flex items-center gap-1 text-grey-800 dark:text-grey-500`,children:[(0,Y.jsx)(`img`,{alt:`Ghost Logo`,className:`size-4`,src:at}),(0,Y.jsx)(`span`,{className:`font-semibold`,children:`Ghost Resources`})]})]}),(0,Y.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,Y.jsx)(`img`,{alt:`Bookmark Thumb`,className:`min-h-full min-w-full shrink-0`,src:Vl})})]})]})]})},Yl=({onClose:e})=>{let{localSettings:t,updateSetting:n,handleSave:r,saveState:i}=be(),[a,o]=Nn(t,[`stripe_publishable_key`,`stripe_secret_key`]);return(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{level:3,children:`Connect Stripe`}),(0,Y.jsxs)(U,{marginBottom:!1,marginTop:!0,children:[(0,Y.jsx)(I,{title:`Publishable key`,value:a?.toString(),onChange:e=>n(`stripe_publishable_key`,e.target.value)}),(0,Y.jsx)(I,{title:`Secure key`,value:o?.toString(),onChange:e=>n(`stripe_secret_key`,e.target.value)}),(0,Y.jsx)(q,{className:`mt-5`,color:`green`,disabled:i===`saving`,label:`Save Stripe settings`,onClick:async()=>{try{Ot.remove(),await r(),e()}catch(e){if(e instanceof c){p({title:`Failed to save settings`,type:`error`,message:`Check you copied both keys correctly`});return}throw e}}})]})]})},Xl=O.create(()=>{let{config:e,settings:t}=K(),n=Kn(t,`stripe_connect_account_id`),{updateRoute:r}=W(),[i,a]=(0,J.useState)(`start`),o=N(),s=ve(),c=Vn(t,e),l=s?.isDisabled(`limitStripeConnect`);(0,J.useEffect)(()=>{(async()=>{if(l&&!c)try{await s?.errorIfWouldGoOverLimit(`limitStripeConnect`)}catch(e){e instanceof de&&(o.remove(),O.show(he,{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||Vn(t||[],e||{})&&!n?(0,Y.jsx)(Yl,{onClose:d}):n?(0,Y.jsx)(Jl,{onClose:d}):i===`start`?(0,Y.jsx)(Kl,{onNext:u}):(0,Y.jsx)(ql,{}),(0,Y.jsx)(L,{afterClose:()=>{r(`tiers`)},cancelLabel:``,footer:(0,Y.jsx)(`div`,{className:`mt-8`}),testId:`stripe-modal`,title:``,width:n?740:520,hideXOnMobile:!0,children:f})}),Zl=``+new URL(`ali-abdaal-DqO7DmHM.png`,import.meta.url).href,Ql=``+new URL(`isaac-saul-WLit1kCf.png`,import.meta.url).href,$l=``+new URL(`joel-warner-DUevCA8i.png`,import.meta.url).href,eu=O.create(()=>{let{updateRoute:e}=W(),t=g(),n=N(),{settings:r,currentUser:i,siteData:a,config:o}=K(),s=o.exploreTestimonialsUrl,c=a.site_uuid,[l]=Nn(r,[`title`]),u=i.name,d=i.email,f=i.roles[0].name,m=i.profile_image,{formState:h,updateForm:_,saveState:v,handleSave:y,errors:b,clearError:x}=jt({initialState:{content:``,prev_platform:``},onSave:async()=>{let t=[`none`,`other`,``].includes(h.prev_platform)?void 0:h.prev_platform,r={ghost_uuid:c,staff_user_email:d,content:h.content,prev_platform:t};if(!s||!(await fetch(s,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(r)})).ok)throw Error(`Something went wrong, please try again later.`);p({message:`Thank you for your testimonial!`,type:`success`}),e(`explore`),n.remove()},onSaveError:t,onValidate:()=>{let e={};return h.content.trim()||(e.content=`This field is required`),e}}),S=[{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`}];return(0,Y.jsx)(L,{afterClose:()=>{e(`explore`)},cancelLabel:``,footer:!1,padding:!1,testId:`explore-testimonials-modal`,title:``,topRightContent:`close`,width:920,children:(0,Y.jsx)(U,{className:`mb-0!`,children:(0,Y.jsxs)(`div`,{className:`flex items-stretch`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`pr-6`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${$l})`}}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Joel Warner`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Lever News`})]})]})]}),(0,Y.jsxs)(`div`,{className:`mt-8 ml-6`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] mr-2 flex items-center justify-end gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Isaac Saul`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`Tangle`})]}),(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${Ql})`}})]})]}),(0,Y.jsxs)(`div`,{className:`mt-8 hidden pr-6 [@media(min-width:940px)]:visible! [@media(min-width:940px)]:block!`,children:[(0,Y.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,Y.jsxs)(`div`,{className:`mt-[14px] ml-2 flex items-center gap-2`,children:[(0,Y.jsx)(`div`,{className:`size-9 rounded-full bg-white bg-cover bg-center opacity-90 grayscale`,style:{backgroundImage:`url(${Zl})`}}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`font-medium text-black dark:text-white`,children:`Ali Abdaal`}),(0,Y.jsx)(`div`,{className:`-mt-0.5 text-grey-700`,children:`YouTuber`})]})]})]})]}),(0,Y.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,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`flex size-[60px] items-center justify-center rounded-full bg-gradient-to-t from-[#CFB0FF] to-[#B27EFF]`,children:(0,Y.jsx)(`svg`,{fill:`none`,height:`26`,viewBox:`0 0 32 26`,width:`32`,xmlns:`http://www.w3.org/2000/svg`,children:(0,Y.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,Y.jsxs)(`div`,{className:`mt-6`,children:[(0,Y.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:`A quote about Ghost`}),(0,Y.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,Y.jsx)(`div`,{className:`mt-8`,children:(0,Y.jsx)(z,{error:!!b.content,hint:b.content,placeholder:`What changed for the better since you switched to Ghost?`,rows:7,value:h.content,autoFocus:!0,onChange:e=>_(t=>({...t,content:e.target.value})),onKeyDown:()=>x(`content`)})}),(0,Y.jsx)(`div`,{className:`mt-4 ml-0.5`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(V,{bgColor:Ke(u||d),image:m??void 0,label:pe(u),labelColor:`white`,size:`md`}),(0,Y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Y.jsxs)(`span`,{className:`font-medium`,children:[`By `,u||d]}),(0,Y.jsxs)(`span`,{className:`text-sm text-grey-700`,children:[f,` — `,l]})]})]})})]}),(0,Y.jsx)(`div`,{children:(0,Y.jsxs)(`div`,{className:`mt-2 flex items-center gap-4`,children:[(0,Y.jsx)(`div`,{className:`grow`,children:(0,Y.jsx)(Te,{error:!!b.prev_platform,hint:b.prev_platform,options:S,placeholder:`Previous platform`,selectedOption:S.find(e=>e.value===h.prev_platform),testId:`migrated-from`,onSelect:e=>{_(t=>({...t,prev_platform:e?.value||``})),x(`prev_platform`)}})}),(0,Y.jsx)(q,{className:`h-[38px]! rounded-lg`,color:`black`,disabled:v===`saving`,label:`Send testimonial`,loading:v===`saving`,onClick:async()=>{await y()}})]})})]})]})})})});``+new URL(`ghost-transistor-sWk3BgP7.png`,import.meta.url).href;var tu=O.create(()=>{let{updateRoute:e}=W(),{config:t,settings:n}=K(),{mutateAsync:r}=In(),{data:{integrations:i}={integrations:[]}}=F(),{mutateAsync:a}=ke(),o=g(),[s,c]=(0,J.useState)(!1),l=t.hostSettings?.limits?.customIntegrations?.disabled,[u]=Nn(n,[`transistor`]),[p,m]=(0,J.useState)(!!u),[h,_]=(0,J.useState)(`Save`);(0,J.useEffect)(()=>{m(u||!1)},[u]),(0,J.useEffect)(()=>{l&&e(`integrations`)},[l,e]);let v=i.find(({slug:e})=>e===`transistor`),y=v?.api_keys?.find(e=>e.type===`admin`);return(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:p!==u,okColor:h===`Saved`?`green`:`black`,okLabel:h,testId:`transistor-modal`,title:``,onOk:async()=>{let e=[{key:`transistor`,value:p}];try{_(`Saving...`),await Promise.all([r(e),new Promise(e=>{setTimeout(e,1e3)})]),_(`Saved`)}catch(e){o(e)}finally{setTimeout(()=>_(`Save`),1e3)}},children:[(0,Y.jsx)(it,{detail:`Give your members access to private podcasts`,icon:(0,Y.jsx)(f,{name:`transistor`,size:56}),title:`Transistor.fm`}),(0,Y.jsxs)(`div`,{className:`mt-7`,children:[(0,Y.jsxs)(U,{marginBottom:!1,title:`Transistor configuration`,grouped:!0,children:[(0,Y.jsx)(vt,{checked:p,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Connect your Ghost site with `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://transistor.fm`,rel:`noopener noreferrer`,target:`_blank`,children:`Transistor.fm`}),` to offer members private podcasts.`]}),label:`Enable Transistor`,onChange:e=>{m(e.target.checked)}}),p&&(0,Y.jsx)(Ge,{keys:[{label:`Admin API key`,text:y?.secret,hint:s?(0,Y.jsx)(`div`,{className:`text-green`,children:`Admin API Key was successfully regenerated`}):void 0,onRegenerate:()=>{if(!v||!y)throw Error(`Transistor integration or Admin API key not found`);c(!1),O.show(me,{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:v.id,apiKeyId:y.id}),c(!0),e?.remove()}catch(e){o(e)}}})}},{label:`API URL`,text:window.location.origin+d().subdir}]})]}),p&&(0,Y.jsx)(`div`,{className:`mt-5 flex flex-col items-center`,children:(0,Y.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,Y.jsxs)(`div`,{className:`order-2 px-7 py-5 md:order-1`,children:[(0,Y.jsx)(`div`,{className:`text-md font-semibold`,children:`How to use Transistor in Ghost`}),(0,Y.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,Y.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,Y.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})})]})})]})]})}),nu=O.create(()=>{let{updateRoute:e}=W(),{settings:t}=K(),[n]=Nn(t,[`unsplash`]),{mutateAsync:r}=In(),i=g(),[a,o]=(0,J.useState)(`Save`),[s,c]=(0,J.useState)(!!n);return(0,J.useEffect)(()=>{c(n||!1)},[n]),(0,Y.jsxs)(L,{afterClose:()=>{e(`integrations`)},cancelLabel:`Close`,dirty:s!==n,okColor:a===`Saved`?`green`:`black`,okLabel:a,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,Y.jsx)(it,{detail:`Beautiful, free photos`,icon:(0,Y.jsx)(f,{name:`unsplash`,size:48}),title:`Unsplash`}),(0,Y.jsx)(`div`,{className:`mt-7`,children:(0,Y.jsx)(U,{marginBottom:!1,grouped:!0,children:(0,Y.jsx)(vt,{checked:s,direction:`rtl`,hint:(0,Y.jsxs)(Y.Fragment,{children:[`Enable `,(0,Y.jsx)(`a`,{className:`text-green`,href:`https://unsplash.com`,rel:`noopener noreferrer`,target:`_blank`,children:`Unsplash`}),` image integration for your posts`]}),label:`Enable Unsplash`,onChange:e=>{c(e.target.checked)}})})})]})}),ru=({user:e,setUserData:t})=>{let{config:n,settings:r}=K(),i=Vn(r||[],n||{});return(0,Y.jsxs)(He,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Engagement`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.comment_notifications,direction:`rtl`,hint:`Every time a member comments on one of your posts`,label:`Comments`,onChange:n=>{t?.({...e,comment_notifications:n.target.checked})}}),un(e)&&(0,Y.jsx)(vt,{align:`center`,checked:e.recommendation_notifications,direction:`rtl`,hint:`Every time another publisher recommends you to their audience`,label:`Recommendations`,onChange:n=>{t?.({...e,recommendation_notifications:n.target.checked})}})]})]}),un(e)&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Members`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.free_member_signup_notification,direction:`rtl`,hint:`Every time a new free member signs up`,label:`New signups`,onChange:n=>{t?.({...e,free_member_signup_notification:n.target.checked})}}),i&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(vt,{align:`center`,checked:e.paid_subscription_started_notification,direction:`rtl`,hint:`Every time a member starts a new paid subscription`,label:`New paid members`,onChange:n=>{t?.({...e,paid_subscription_started_notification:n.target.checked})}}),(0,Y.jsx)(vt,{align:`center`,checked:e.paid_subscription_canceled_notification,direction:`rtl`,hint:`Every time a member cancels their paid subscription`,label:`Paid member cancellations`,onChange:n=>{t?.({...e,paid_subscription_canceled_notification:n.target.checked})}})]})]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{className:`text-sm font-medium tracking-wide text-grey-700 uppercase`,children:`Revenue`}),(0,Y.jsxs)(`div`,{className:`mt-3 flex flex-col gap-4`,children:[(0,Y.jsx)(vt,{align:`center`,checked:e.milestone_notifications,direction:`rtl`,hint:i?`Occasional summaries of your audience & revenue growth`:`Occasional summaries of your audience growth`,label:`Milestones`,onChange:n=>{t?.({...e,milestone_notifications:n.target.checked})}}),i&&(0,Y.jsx)(vt,{align:`center`,checked:e.donation_notifications,direction:`rtl`,hint:`Every time you receive a one-time payment`,label:`Tips & donations`,onChange:n=>{t?.({...e,donation_notifications:n.target.checked})}}),i&&(0,Y.jsx)(vt,{align:`center`,checked:e.gift_subscription_notifications,direction:`rtl`,hint:`Every time someone purchases or redeems a gift subscription`,label:`Gift subscriptions`,onChange:n=>{t?.({...e,gift_subscription_notifications:n.target.checked})}})]})]})]})]})},iu=({user:e,setUserData:t})=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(ru,{setUserData:t,user:e})}),au=[`1234567890`,`qwertyuiop`,`qwertzuiop`,`asdfghjkl;`,`abcdefghij`,`0987654321`,`1q2w3e4r5t`,`12345asdfg`],ou=[`ghost`,`password`,`passw0rd`],su=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},cu=({user:e})=>{let{currentUser:t,config:n,siteData:r}=K(),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[f,m]=(0,J.useState)(``),[h,_]=(0,J.useState)({}),v=(0,J.useRef)(null),y=(0,J.useRef)(null),x=(0,J.useRef)(null),{mutateAsync:S}=nn(),C=g(),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 au)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 ou)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||!su(t)?{newPassword:`Sorry, you cannot use an insecure password.`}:{}};(0,J.useEffect)(()=>{f===`saved`&&setTimeout(()=>{m(``),a(!1)},2500)},[f]),(0,J.useEffect)(()=>{i&&setTimeout(()=>{w?x.current?.focus():v.current?.focus()},100)},[i,w]);let E=()=>{a(!0)},D=`Save password`;f===`saving`?D=`Saving...`:f===`saved`&&(D=`Saved`);let O=(0,Y.jsxs)(Y.Fragment,{children:[w&&(0,Y.jsx)(I,{"data-testid":`old-password`,error:!!h.oldPassword,hint:h.oldPassword,inputRef:x,title:`Old password`,type:`password`,value:o,onChange:e=>{s(e.target.value)}}),(0,Y.jsx)(I,{"data-testid":`new-password`,error:!!h.newPassword,hint:h.newPassword,inputRef:v,title:`New password`,type:`password`,value:c,onChange:e=>{l(e.target.value)}}),(0,Y.jsx)(I,{"data-testid":`confirm-password`,error:!!h.confirmNewPassword,hint:h.confirmNewPassword,inputRef:y,title:`Confirm new password`,type:`password`,value:u,onChange:e=>{d(e.target.value)}}),(0,Y.jsxs)(`div`,{className:`mt-1 flex items-center justify-end gap-3`,children:[(0,Y.jsx)(q,{color:`outline`,label:`Cancel`,onClick:()=>{a(!1),s(``),l(``),d(``),_({})}}),(0,Y.jsx)(q,{color:`green`,"data-testid":`save-password-button`,label:D,onClick:async()=>{m(`saving`);let t=T({password:c,confirmPassword:u});if(_(t),Object.keys(t).length>0){m(``);return}try{await S({newPassword:c,confirmNewPassword:u,oldPassword:o,userId:e?.id}),m(`saved`)}catch(e){m(``),p({type:`error`,title:e instanceof b?e.message:`Couldn't update password. Please try again.`}),C(e,{withToast:!1})}}})]})]});return(0,Y.jsx)(Y.Fragment,{children:i?O:(0,Y.jsxs)(`div`,{className:`relative flex flex-col`,children:[(0,Y.jsx)(I,{containerClassName:`grow`,disabled:!0,title:`Password`,type:`password`,value:`••••••••••••`}),(0,Y.jsx)(q,{className:`absolute top-0 right-0`,color:`green`,"data-testid":`change-password-button`,label:`Change`,link:!0,onClick:E})]})})},lu=({user:e,setUserData:t})=>{let{data:{roles:n}={}}=R(),{config:r}=K(),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)),an(e)){let e={label:`Owner`,value:`owner`};return(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Te,{disabled:!0,hint:(0,Y.jsxs)(Y.Fragment,{children:[`This user is the owner of the site. `,(0,Y.jsx)(`a`,{className:`font-medium text-grey-800 transition-colors hover:text-grey-900 dark:text-grey-500 dark:hover:text-grey-400`,href:`https://ghost.org/help/transfer-publication-ownership/`,rel:`noopener noreferrer`,target:`_blank`,children:`Transfer ownership`}),` first to change their role.`]}),options:[e],selectedOption:e,title:`Role`,onSelect:()=>{}})})}return(0,Y.jsx)(Te,{options:a,selectedOption:a.find(t=>t.value===e.roles[0].name.toLowerCase()),testId:`role-select`,title:`Role`,onSelect:r=>{if(r){let i=n?.find(e=>e.name.toLowerCase()===r.value.toLowerCase());i&&t?.({...e,roles:[i]})}}})},uu=_({dataType:`StaffTokenResponseType`,path:`/users/me/token/`}),du=h({path:()=>`/users/me/token/`,method:`PUT`}),fu=()=>{let{refetch:e}=uu({enabled:!1}),t=g(),[n,r]=(0,J.useState)(``),{mutateAsync:i}=du();return(0,J.useEffect)(()=>{(async()=>{let t=await e();t?.data?.apiKey&&r(`${t.data.apiKey.id}:${t.data.apiKey.secret}`)})()},[e]),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(A,{className:`mb-2`,level:6,grey:!0,children:`Staff access token`}),(0,Y.jsx)(Ge,{hasLabel:!1,keys:[{text:n||``,onRegenerate:()=>{O.show(me,{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`,okColor:`red`,onOk:async e=>{try{let t=await i([]);r(`${t.apiKey.id}:${t.apiKey.secret}`),e?.remove()}catch(e){t(e)}}})}}]})]})},pu=({errors:e,clearError:t,user:n,setUserData:r})=>{let{currentUser:i,siteData:a}=K(),o=Wn(a);return(0,Y.jsxs)(He,{children:[(0,Y.jsx)(I,{error:!!e?.email,hint:e?.email||`Used for notifications`,maxLength:191,title:`Email`,value:n.email,onChange:e=>{r({...n,email:e.target.value})},onKeyDown:()=>t(`email`)}),(0,Y.jsx)(cu,{user:n}),un(i)&&(0,Y.jsx)(lu,{setUserData:r,user:n}),(0,Y.jsx)(I,{error:!!e?.name,hint:e?.name||`Use your real name so people can recognize you`,maxLength:191,title:`Full name`,value:n.name,onChange:e=>{r({...n,name:e.target.value})},onKeyDown:()=>t(`name`)}),(0,Y.jsx)(I,{hint:`${o}author/${n.slug}`,maxLength:191,title:`Slug`,value:n.slug,onChange:e=>{r({...n,slug:e.target.value})}}),(0,Y.jsx)(I,{error:!!e?.location,hint:e?.location||`Where in the world do you live?`,maxLength:65535,title:`Location`,value:n.location||``,onChange:e=>{r({...n,location:e.target.value})},onKeyDown:()=>t(`location`)}),(0,Y.jsx)(z,{error:!!e?.bio,hint:e?.bio||(0,Y.jsxs)(Y.Fragment,{children:[`Recommended: 250 characters. You‘ve used `,(0,Y.jsx)(`span`,{className:`font-bold`,children:n.bio?.length||0})]}),maxLength:65535,title:`Bio`,value:n.bio||``,onChange:e=>{r({...n,bio:e.target.value})},onKeyDown:()=>t(`bio`)}),n.id===i.id&&(0,Y.jsx)(fu,{})]})},mu=e=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(pu,{...e})}),hu=({errors:e,clearError:t,validateField:n,user:r,setUserData:i})=>{let[a,o]=(0,J.useState)(()=>Object.fromEntries(st.map(e=>{let t=r[e.key];return[e.key,e.toDisplayValue(t)]})));return(0,Y.jsxs)(He,{children:[(0,Y.jsx)(I,{"data-testid":`website-input`,error:!!e?.website,hint:e?.website,maxLength:2e3,placeholder:`https://example.com`,title:`Website`,value:r.website||``,onChange:e=>{i({...r,website:e.target.value})},onKeyDown:()=>t(`website`)}),st.map(s=>(0,Y.jsx)(I,{"data-testid":s.testId,error:!!e?.[s.key],hint:e?.[s.key],maxLength:2e3,placeholder:s.placeholder,title:s.staffTitle,value:a[s.key],onBlur:e=>{if(n(s.key,e.target.value)){let{displayValue:t,storedValue:n}=Ue(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)},s.key))]})},gu=e=>(0,Y.jsx)(Be,{border:!1,children:(0,Y.jsx)(hu,{...e})}),_u={name:({name:e})=>{let t=``;return e||(t=`Name is required`),e&&e.length>191&&(t=`Name is too long`),t},email:({email:e})=>ua.default.isEmail(e||``)?``:`Enter a valid email address`,url:({url:e})=>!e||ua.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||ua.default.isURL(e)&&e.length<=2e3?``:`Enter a valid URL`,...Object.fromEntries(st.map(e=>[e.key,t=>nt(e.key,t[e.key])]))},vu=({user:e})=>{let{updateRoute:t,route:n}=W(),r=e=>{let t=e.split(`/`).pop()||``;return t===`social-links`||t===`email-notifications`?t:`profile`},{ownerUser:i}=_t(),{currentUser:a}=K(),o=g(),{formState:s,setFormState:c,saveState:l,handleSave:u,updateForm:d,errors:m,setErrors:h,clearError:_,okProps:v}=jt({initialState:e,savingDelay:500,savedDelay:500,onValidate:t=>Object.entries(_u).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 i=>{let a=(await C?.(i))?.users?.[0];if(a&&(c(()=>a),a.slug!==e.slug)){let e=r(n),i=e===`profile`?``:`/${e}`;t({route:`staff/${a.slug}${i}`,replace:!0})}},onSaveError:o}),y=e=>d(()=>e),b=(e,t)=>{let n=_u[e]?.({[e]:t});return n?(h({...m,[e]:n}),!1):(_(e),!0)},x=N(),{mutateAsync:S}=pt(),{mutateAsync:C}=ln(),{mutateAsync:w}=dn(),{mutateAsync:T}=sn(),E=ve(),D=lt(),k=(0,J.useCallback)(()=>{pn(a)?t(`staff`):t({isExternal:!0,route:``})},[a,t]),j=async e=>{if(e.status===`inactive`&&e.roles[0].name!==`Contributor`)try{await E?.errorIfWouldGoOverLimit(`staff`)}catch(e){if(e instanceof de){O.show(he,{formSheet:!0,prompt:e.message||`Your current plan doesn't support more users.`,onOk:()=>t({route:`/pro`,isExternal:!0})});return}else throw e}let n=`This user will no longer be able to log in but their posts will be kept.`;e.status===`inactive`&&(n=`This user will be able to log in again and will have the same permissions they had previously.`),O.show(me,{title:`Are you sure you want to suspend this user?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`strong`,{children:`WARNING:`}),` `,n]}),okLabel:e.status===`inactive`?`Un-suspend`:`Suspend`,okRunningLabel:e.status===`inactive`?`Un-suspending...`:`Suspending...`,okColor:`red`,onOk:async t=>{let n={...e,status:e.status===`inactive`?`active`:`inactive`};try{await C(n),c(()=>n),t?.remove(),p({title:e.status===`inactive`?`User un-suspended`:`User suspended`,type:`success`})}catch(e){o(e)}}})},M=(t,{owner:n})=>{O.show(me,{title:`Are you sure you want to delete this user?`,prompt:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`mb-3`,children:[(0,Y.jsx)(`span`,{className:`font-bold`,children:t.name||t.email}),` will be permanently deleted and all their posts will be automatically assigned to `,(0,Y.jsx)(`span`,{className:`font-bold`,children:n.name}),`.`]}),(0,Y.jsxs)(`p`,{children:[`To make these easy to find in the future, each post will be given an internal tag of `,(0,Y.jsxs)(`span`,{className:`font-bold`,children:[`#`,e.slug]})]})]}),okLabel:`Delete user`,okColor:`red`,onOk:async e=>{try{await w(t?.id),e?.remove(),x?.remove(),k(),p({title:`User deleted`,type:`success`})}catch(e){o(e)}}})},F=()=>{O.show(me,{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`,okColor:`red`,onOk:async t=>{try{await T(e.id),t?.remove(),p({title:`Ownership transferred`,type:`success`})}catch(e){o(e)}}})},I=async(e,t)=>{try{let n=Ne(await S({file:t}));switch(e){case`cover_image`:d(e=>({...e,cover_image:n}));break;case`profile_image`:d(e=>({...e,profile_image:n}));break}}catch(e){let t=e;t.response.status===415&&(t.message=`Unsupported file type`),o(t)}},R=e=>{switch(e){case`cover_image`:d(e=>({...e,cover_image:``}));break;case`profile_image`:d(e=>({...e,profile_image:``}));break}},z=un(a)||mn(a)&&rn(e),B=[];if(an(a)&&fn(s)&&s.status!==`inactive`&&B.push({id:`make-owner`,label:`Make owner`,onClick:F}),B.push({id:`view-user-activity`,label:`View user activity`,onClick:()=>{x.remove(),t(`history/view/${s.id}`)}}),s.id!==a.id&&(un(a)&&!an(e)||mn(a)&&rn(e))){let t=s.status===`inactive`?`Un-suspend user`:`Suspend user`;B.push({id:`suspend-user`,label:t,onClick:()=>{j(s)}},{id:`delete-user`,label:`Delete user`,destructive:!0,onClick:()=>{M(e,{owner:i})}})}let ee=`flex flex-nowrap items-center justify-center px-3 h-8 opacity-80 hover:opacity-100 bg-[rgba(0,0,0,0.75)] rounded text-white transition-all cursor-pointer font-medium nowrap`,V=s.status===`inactive`?` (Suspended)`:``,[te,ne]=(0,J.useState)(r(n));return(0,Y.jsx)(L,{afterClose:k,animate:pn(a),backDrop:pn(a),buttonsDisabled:v.disabled,cancelLabel:`Close`,dirty:l===`unsaved`,hideXOnMobile:!0,okColor:v.color,okLabel:v.label||`Save`,size:pn(a)?`md`:`bleed`,stickyFooter:!0,testId:`user-detail-modal`,width:pn(a)?600:`full`,onOk:async()=>{await u({fakeWhenUnchanged:!0})},children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`relative ${pn(a)?`-mx-8 -mt-8 rounded-t`:`-mx-10 -mt-10`}`,children:(0,Y.jsx)(`div`,{className:`flex flex-wrap items-end justify-between gap-8 p-8 ${s.cover_image?`bg-cover bg-center`:``} ${!pn(a)&&`min-h-[30vmin]`}`,style:{backgroundImage:s.cover_image?`url(${s.cover_image})`:`none`},children:(0,Y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex flex-nowrap items-start justify-between gap-3`,children:[(0,Y.jsx)(`div`,{children:(0,Y.jsx)(Ee,{deleteButtonClassName:`md:invisible absolute -right-1 -top-2 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white group-hover:visible!`,deleteButtonContent:(0,Y.jsx)(f,{colorClass:`text-white`,name:`trash`,size:`sm`}),editButtonClassName:`md:invisible absolute -left-1 -top-2 flex size-8 cursor-pointer items-center justify-center rounded-full bg-[rgba(0,0,0,0.75)] text-white group-hover:visible!`,fileUploadClassName:`rounded-full bg-black flex items-center justify-center opacity-80 transition hover:opacity-100 -ml-2 cursor-pointer h-[80px] w-[80px]`,fileUploadProps:{dragIndicatorClassName:`rounded-full`},id:`avatar`,imageClassName:`w-full h-full object-cover rounded-full shrink-0`,imageContainerClassName:`relative group bg-cover bg-center -ml-1 h-[80px] w-[80px] shrink-0`,imageURL:s.profile_image??void 0,pintura:{isEnabled:D.isEnabled,openEditor:async()=>D.openEditor({image:s.profile_image||``,handleSave:async e=>{I(`profile_image`,e)}})},unstyled:!0,width:`80px`,onDelete:()=>{R(`profile_image`)},onUpload:e=>{I(`profile_image`,e)},children:(0,Y.jsx)(f,{colorClass:`black`,name:`user-add`,size:`lg`})})}),(0,Y.jsxs)(`div`,{className:`flex flex-nowrap items-start gap-3`,children:[(0,Y.jsx)(Ee,{buttonContainerClassName:`flex items-end gap-4 justify-end flex-nowrap`,deleteButtonClassName:ee,deleteButtonContent:`Delete cover image`,editButtonClassName:ee,fileUploadClassName:`rounded flex flex-nowrap items-center justify-center px-3 h-8 transition-all cursor-pointer font-medium border border-grey-300 bg-transparent text-black dark:border-grey-800 dark:text-white`,id:`cover-image`,imageClassName:`hidden`,imageURL:s.cover_image||``,pintura:{isEnabled:D.isEnabled,openEditor:async()=>D.openEditor({image:s.cover_image||``,handleSave:async e=>{I(`cover_image`,e)}})},unstyled:!0,onDelete:()=>{R(`cover_image`)},onUpload:e=>{I(`cover_image`,e)},children:`Upload cover image`}),z&&(0,Y.jsx)(`div`,{className:`z-10`,children:(0,Y.jsx)(ft,{items:B,position:`end`,trigger:(0,Y.jsxs)(`button`,{className:P(`flex h-8 cursor-pointer items-center justify-center rounded px-3`,s.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,Y.jsx)(`span`,{className:`sr-only`,children:`Actions`}),(0,Y.jsx)(f,{colorClass:s.cover_image?`text-white`:void 0,name:`ellipsis`,size:`md`})]})})})]})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(A,{level:3,styles:P(`break-words md:break-normal`,s.cover_image?`text-white`:`text-black dark:text-white`),children:[e.name,V]}),(0,Y.jsx)(`span`,{className:P(`text-md font-medium capitalize`,s.cover_image?`text-white`:`text-black dark:text-white`),children:e.roles[0].name.toLowerCase()})]})]})})}),(0,Y.jsx)(`div`,{className:`${!pn(a)&&`mx-auto max-w-[536px]`} mt-6 flex flex-col`,children:(0,Y.jsx)(Xe,{selectedTab:te,tabs:[{id:`profile`,title:`Profile`,contents:(0,Y.jsx)(mu,{clearError:_,errors:m,setUserData:y,user:s,validateField:b})},{id:`social-links`,title:`Social Links`,contents:(0,Y.jsx)(gu,{clearError:_,errors:m,setUserData:y,user:s,validateField:b})},{id:`email-notifications`,title:`Email Notifications`,contents:(0,Y.jsx)(iu,{setUserData:y,user:s})}],onTabChange:n=>{let r=n===`profile`?``:`/${n}`;t(`staff/${e.slug}${r}`),ne(n)}})})]})})},yu={AddIntegrationModal:Zi,AddNewsletterModal:Qi,ContentApiModal:$i,AddRecommendationModal:ra,CustomIntegrationModal:ya,DesignAndThemeModal:Ks,EditRecommendationModal:ze,FirstPromoterModal:Qs,HistoryModal:pc,InviteUserModal:gc,NavigationModal:bc,NewsletterDetailModal:Ec,PinturaModal:Dl,PortalModal:zl,SlackModal:Bl,StripeConnectModal:Xl,TestimonialsModal:eu,TierDetailModal:Me,TransistorModal:tu,UnsplashModal:nu,UserDetailModal:O.create(({params:e})=>{let{currentUser:t}=K(),{updateRoute:n}=W(),r=g(),i=t.slug===e?.slug,{data:a,error:o}=cn(e?.slug||``,{enabled:!i&&!!e?.slug,defaultErrorHandler:!1}),s=i?t:a?.users?.[0],c=o instanceof x&&o.response?.status===404;(0,J.useEffect)(()=>{o&&!c&&r(o)},[o,c,r]);let l=!i&&!!e?.slug&&!s&&(c||a!==void 0),u=(0,J.useRef)(void 0);s&&(u.current=s);let d=s||(l?void 0:u.current),f=l?e?.slug??null:null,m=(0,J.useRef)(null);return(0,J.useEffect)(()=>{!f||m.current===f||(m.current=f,p({type:`error`,message:`User not found`}),pn(t)?n({route:`staff`,replace:!0}):n({isExternal:!0,route:``}))},[f,t,n]),d?(0,Y.jsx)(vu,{user:d}):null}),ZapierModal:De,AnnouncementBarModal:la,EmbedSignupFormModal:Zs,OffersContainerModal:Tl,AboutModal:Xi,OfferSuccess:Dc};export{yu as default};
|