ghost 6.40.0 → 6.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/boot.js +8 -8
- package/core/built/admin/assets/{PolarAngleAxis-D7m1zwVk.js → PolarAngleAxis-Bh28wbPV.js} +1 -1
- package/core/built/admin/assets/{_baseAssignValue-BDsvYKNK.js → _baseAssignValue-hdDG700N.js} +1 -1
- package/core/built/admin/assets/{a-large-small-DxRNdz0F.js → a-large-small-BiK5_5LV.js} +1 -1
- package/core/built/admin/assets/{account-migration-SYnE1jBW.js → account-migration-DsSHanIB.js} +1 -1
- package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +1 -1
- package/core/built/admin/assets/admin-x-settings/{code-editor-view-Bj9rgbLw.mjs → code-editor-view-BEIdFhw3.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-BrZ9YAzd.mjs → index-BEh3nFEy.mjs} +3 -3
- package/core/built/admin/assets/admin-x-settings/{index-DRndIh9T.mjs → index-BLF2n6YB.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-CIl25Teq.mjs → index-BmPIWs5F.mjs} +3 -3
- package/core/built/admin/assets/admin-x-settings/{index-CNyNY3Wh.mjs → index-CP9YnNzc.mjs} +3 -3
- package/core/built/admin/assets/admin-x-settings/{index-SGr5sE2h.mjs → index-Cd2Ns-D2.mjs} +2 -2
- package/core/built/admin/assets/admin-x-settings/{index-PGoLP2kh.mjs → index-CjqAcKpK.mjs} +5 -5
- package/core/built/admin/assets/admin-x-settings/{index-pCIv_7bB.mjs → index-CnMcD9aj.mjs} +6212 -6158
- package/core/built/admin/assets/admin-x-settings/{index-CPCcgad-.mjs → index-LzsrZC40.mjs} +3 -3
- package/core/built/admin/assets/admin-x-settings/{index-DPqY4h5h.mjs → index-ZYW0UW7I.mjs} +3 -3
- package/core/built/admin/assets/admin-x-settings/{modals-lo32WZLi.mjs → modals-C48Tq1rW.mjs} +9 -9
- package/core/built/admin/assets/{arrow-right-BixoEua4.js → arrow-right-Bk43nMGd.js} +1 -1
- package/core/built/admin/assets/{at-sign-BsHNViA_.js → at-sign-DWOf36uj.js} +1 -1
- package/core/built/admin/assets/{audience-0RCWjbIK.js → audience-CvP78Gug.js} +1 -1
- package/core/built/admin/assets/{automations-DTUfYvf6.js → automations-BBWZhrha.js} +1 -1
- package/core/built/admin/assets/{automations-DiGkcVt-.js → automations-CmulGWwu.js} +1 -1
- package/core/built/admin/assets/{avatar-flipboard-BgoH-wIq.js → avatar-flipboard-CVf-N6wp.js} +1 -1
- package/core/built/admin/assets/{bluesky-sharing-C2xwSoS-.js → bluesky-sharing-DVC3I9Um.js} +1 -1
- package/core/built/admin/assets/{chart-X5cLIH1X.js → chart-CUKSNmKY.js} +1 -1
- package/core/built/admin/assets/{checkbox-DMamS4oG.js → checkbox-B_yDSM8z.js} +1 -1
- package/core/built/admin/assets/{chevron-up-CVgBkTk5.js → chevron-up-DuaKtE_M.js} +1 -1
- package/core/built/admin/assets/{chunk.941.f47098cbbce89a049e03.js → chunk.331.2ec2e2702eda02de96cd.js} +3 -3
- package/core/built/admin/assets/{chunk.524.a1d668dcc84709a5d702.js → chunk.524.49cc01002e1a5dba8ef9.js} +4 -4
- package/core/built/admin/assets/{chunk.582.180bf2525cf552f5ac5f.js → chunk.582.4bbc54c5f7d3dfb93288.js} +6 -6
- package/core/built/admin/assets/{circle-alert-Dg3UkvRP.js → circle-alert-bcK_Yqap.js} +1 -1
- package/core/built/admin/assets/{code-editor-view-CAICoZJe.js → code-editor-view-Bl4Jzjhk.js} +1 -1
- package/core/built/admin/assets/{comments-BHru9ZQ8.js → comments-DMea0nul.js} +1 -1
- package/core/built/admin/assets/{content-helpers-BByMp-Y5.js → content-helpers-B2yRzdvJ.js} +1 -1
- package/core/built/admin/assets/{copy-D7jqplrv.js → copy-DVtQi_VJ.js} +1 -1
- package/core/built/admin/assets/{data-list-DUaY9nlT.js → data-list-BF4GeUmt.js} +1 -1
- package/core/built/admin/assets/{deleted-feed-item-jLcSKuul.js → deleted-feed-item-DO2u3qmi.js} +1 -1
- package/core/built/admin/assets/{dropzone-DSPf3N_o.js → dropzone-Cs4DrURS.js} +1 -1
- package/core/built/admin/assets/{edit-profile-BvU2-lW5.js → edit-profile-CnuBNQhO.js} +1 -1
- package/core/built/admin/assets/{editor-D3fcjt_F.js → editor-CTO9FIUW.js} +1 -1
- package/core/built/admin/assets/{empty-indicator-2Pjmce3n.js → empty-indicator-BvyaMcmw.js} +1 -1
- package/core/built/admin/assets/{en-Bu-6PYn5.js → en-CjPXRj8j.js} +1 -1
- package/core/built/admin/assets/{feed-CygLK1Ad.js → feed-D2wk4cCS.js} +1 -1
- package/core/built/admin/assets/{filter-query-core-a0PNU2EO.js → filter-query-core-VEnwTCyO.js} +1 -1
- package/core/built/admin/assets/{filters-jiyRsLMH.js → filters-DtIsuqv5.js} +1 -1
- package/core/built/admin/assets/{gh-chart-CEhBBu3F.js → gh-chart-JxzKqaoO.js} +1 -1
- package/core/built/admin/assets/{ghost-0ab96884815339963364804ab266c99f.js → ghost-30c3dedbe1cca943b92efa7efd2710e4.js} +36 -21
- package/core/built/admin/assets/{growth-Fz3Oatml.js → growth-CPNrBpHK.js} +1 -1
- package/core/built/admin/assets/{hash-CeFrjo3C.js → hash-CJzbTA5k.js} +1 -1
- package/core/built/admin/assets/{inbox-CCirPaG2.js → inbox-CVVAkCmd.js} +1 -1
- package/core/built/admin/assets/{index-Dd2BJRZH.js → index-AkQJUr1z.js} +1 -1
- package/core/built/admin/assets/{index-CYPN5csJ.js → index-BLWOUf31.js} +1 -1
- package/core/built/admin/assets/{index-D7Ui3Fih.js → index-BRBRkRqa.js} +1 -1
- package/core/built/admin/assets/{index-CFEzD2_M.js → index-BkbhBpVC.js} +3 -3
- package/core/built/admin/assets/{index-BYwL7gFN.js → index-BxFFWYdP.js} +1 -1
- package/core/built/admin/assets/{index-D3LfHeBl.js → index-C5_ZKpC1.js} +1 -1
- package/core/built/admin/assets/{index-Bjw2qAph.js → index-Cdbufdfy.js} +1 -1
- package/core/built/admin/assets/{index-BTf6YUBb.js → index-Cq5vsvxE.js} +1 -1
- package/core/built/admin/assets/{index-DPbi4ie_.js → index-CuGoX8Ub.js} +1 -1
- package/core/built/admin/assets/{index-CsaU9dfl.js → index-CuH5raTz.js} +1 -1
- package/core/built/admin/assets/{index-Bf83suMc.js → index-D3A8RTi0.js} +1 -1
- package/core/built/admin/assets/{index-Dskrbhv3.js → index-DIyK69JM.js} +1 -1
- package/core/built/admin/assets/{index-GExKMpy_.js → index-DLFVpwt3.js} +1 -1
- package/core/built/admin/assets/{index-BOMdiHRG.js → index-DQZp_NsL.js} +1 -1
- package/core/built/admin/assets/{index-2qcjFCQs.js → index-DR74ulj2.js} +1 -1
- package/core/built/admin/assets/{index-WKMARia9.js → index-DYE2untj.js} +1 -1
- package/core/built/admin/assets/{index-DNZUJQ8v.js → index-DssW7xhk.js} +1 -1
- package/core/built/admin/assets/{index-Cq4mS7QK.js → index-DvyNqFct.js} +1 -1
- package/core/built/admin/assets/{index-C7xLyJVb.js → index-DxB7NHpG.js} +1 -1
- package/core/built/admin/assets/{index-Bw4DM4Pr.js → index-IDaHqjnu.js} +1 -1
- package/core/built/admin/assets/{index-ClOB5u8L.js → index-TtBMzSeP.js} +1 -1
- package/core/built/admin/assets/{index-takfwHSn.js → index-UMWVIyz7.js} +1 -1
- package/core/built/admin/assets/{koenig-lexical-BJM9wAwQ.js → koenig-lexical-DVAmevhl.js} +1 -1
- package/core/built/admin/assets/{kpi-card-BP-2yicn.js → kpi-card-D3CzvsrI.js} +1 -1
- package/core/built/admin/assets/{kpi-card-DOplXdDT.js → kpi-card-DV-nN7xT.js} +1 -1
- package/core/built/admin/assets/{kpi-tabs-Rq5jJW2Z.js → kpi-tabs-B3NkaTwb.js} +1 -1
- package/core/built/admin/assets/{kpis-yHgME_iy.js → kpis-CVwF08QL.js} +1 -1
- package/core/built/admin/assets/{label-fijjy1Mb.js → label-BiPpMny2.js} +1 -1
- package/core/built/admin/assets/{links-s3IeAkbo.js → links-BY0Uo6O5.js} +1 -1
- package/core/built/admin/assets/{list-page-CUcB5ebB.js → list-page-COHNMpOi.js} +1 -1
- package/core/built/admin/assets/{loader-circle-C7mWzo52.js → loader-circle-B1uEfpbZ.js} +1 -1
- package/core/built/admin/assets/{mail-9TFkAaAh.js → mail-ccQhEr7k.js} +1 -1
- package/core/built/admin/assets/{main-layout-XtviVkg1.js → main-layout-BYKdA6Z1.js} +1 -1
- package/core/built/admin/assets/{members-XkHao5Yf.js → members-DkpEnvG5.js} +1 -1
- package/core/built/admin/assets/minus-C68D81nx.js +1 -0
- package/core/built/admin/assets/{modals-B6R7oqvb.js → modals-X6RSWn5Y.js} +3 -3
- package/core/built/admin/assets/{moderation-B2Tixfce.js → moderation-BFrrwfvx.js} +1 -1
- package/core/built/admin/assets/{newsletter-CbESXhxf.js → newsletter-n7kc6cxR.js} +1 -1
- package/core/built/admin/assets/{newsletters-DOIL_cOY.js → newsletters-CSCa3QdE.js} +1 -1
- package/core/built/admin/assets/{note-mUikaB-p.js → note-CMZjeK8e.js} +1 -1
- package/core/built/admin/assets/{onboarding-route-Dqv2nP7b.js → onboarding-route-BaX0a-pu.js} +1 -1
- package/core/built/admin/assets/{overview-yZ-7KJdx.js → overview-CS9dmE_6.js} +1 -1
- package/core/built/admin/assets/{pagemenu-TxGvHwRO.js → pagemenu-O_y8Jm4v.js} +1 -1
- package/core/built/admin/assets/{pencil-CKTgzafp.js → pencil-BcymGPnE.js} +1 -1
- package/core/built/admin/assets/{pin-BU_u-xRX.js → pin-Bl3nSr7I.js} +1 -1
- package/core/built/admin/assets/{post-analytics-CWA8invj.js → post-analytics-DW-TKu-t.js} +1 -1
- package/core/built/admin/assets/{post-analytics-context-BWDhMRq_.js → post-analytics-context-D7PgEMo8.js} +1 -1
- package/core/built/admin/assets/{post-analytics-header-Bm0mcxjK.js → post-analytics-header-B8C0vA5Y.js} +1 -1
- package/core/built/admin/assets/{post-share-modal-D8BtRD2u.js → post-share-modal-D0OlASBQ.js} +1 -1
- package/core/built/admin/assets/{posts-u-CAKddc.js → posts-BZaw4-dc.js} +1 -1
- package/core/built/admin/assets/{power-DR9gpiQR.js → power-DWm6pts5.js} +1 -1
- package/core/built/admin/assets/{referrers-DV_Ihg9y.js → referrers-BsZ85Z0a.js} +1 -1
- package/core/built/admin/assets/{repeat-uXmOJ6y8.js → repeat-DQay9e22.js} +1 -1
- package/core/built/admin/assets/{reply-9ZyqaxI-.js → reply-CoNqmExw.js} +1 -1
- package/core/built/admin/assets/{rocket-DMOr1OCt.js → rocket-Dne6P_8f.js} +1 -1
- package/core/built/admin/assets/{select-CPSy44ld.js → select-BfWJkrKc.js} +1 -1
- package/core/built/admin/assets/{settings-krk0432u.js → settings-BoXzKMhL.js} +1 -1
- package/core/built/admin/assets/{settings-66Zv8QvL.js → settings-rRY210wx.js} +25 -25
- package/core/built/admin/assets/{share-modal-BRmGllZq.js → share-modal-CtdLQbnQ.js} +1 -1
- package/core/built/admin/assets/{sort-button-5fyeViQL.js → sort-button-7pVgpa0d.js} +1 -1
- package/core/built/admin/assets/{source-icon-DeeHyZRn.js → source-icon-Dtua85oN.js} +1 -1
- package/core/built/admin/assets/{sprout-956Q4On2.js → sprout-CpwUJAPT.js} +1 -1
- package/core/built/admin/assets/{square-BaCvbKJY.js → square-CDrQjv8R.js} +1 -1
- package/core/built/admin/assets/{stats-BVKNZJO6.js → stats-Yo9Gco0_.js} +1 -1
- package/core/built/admin/assets/{stats-view-gtyaqudG.js → stats-view-DubukX9V.js} +1 -1
- package/core/built/admin/assets/{step-1-09wdjzdX.js → step-1-CH8jWKi7.js} +1 -1
- package/core/built/admin/assets/{step-2-8iaQ0efq.js → step-2-CWy7Qi0Q.js} +1 -1
- package/core/built/admin/assets/{step-3-BuHAZbdD.js → step-3-CNiDFH17.js} +1 -1
- package/core/built/admin/assets/{table-DTofVyjA.js → table-qQi9EXB1.js} +1 -1
- package/core/built/admin/assets/{tabs-CL5eaCGL.js → tabs-M6kFEqPE.js} +1 -1
- package/core/built/admin/assets/{tags-DJrbEw5-.js → tags-74U6lgwY.js} +1 -1
- package/core/built/admin/assets/{tags-U3lciBmd.js → tags-DuMshkTz.js} +1 -1
- package/core/built/admin/assets/{textarea-DdDuNixZ.js → textarea-CGBp9nOo.js} +1 -1
- package/core/built/admin/assets/{tiers-DXKbghdk.js → tiers-D2DYHaeO.js} +1 -1
- package/core/built/admin/assets/{toggle-group-DaZKTYDS.js → toggle-group-GYp_w6Po.js} +1 -1
- package/core/built/admin/assets/{topic-filter-BzqiVOAU.js → topic-filter-N3CzJ01P.js} +1 -1
- package/core/built/admin/assets/{trash-CKK_p9G5.js → trash-CUqAK3SQ.js} +1 -1
- package/core/built/admin/assets/{underline-Bq0P-5Zy.js → underline-CwuJG-Ql.js} +1 -1
- package/core/built/admin/assets/{undo-2-CcBtw-tW.js → undo-2-D6ZRqONE.js} +1 -1
- package/core/built/admin/assets/{upload-BcylHEMw.js → upload-BLiT66bJ.js} +1 -1
- package/core/built/admin/assets/{use-growth-stats-Ci0gymWp.js → use-growth-stats-u18So4Gq.js} +1 -1
- package/core/built/admin/assets/{use-simple-pagination-ByaFwxfZ.js → use-simple-pagination-Dp2sTt2S.js} +1 -1
- package/core/built/admin/assets/{user-round-check-D0I7NO1g.js → user-round-check-BDomHaso.js} +1 -1
- package/core/built/admin/assets/{user-round-x-DeGVH29o.js → user-round-x-Cc0RL-V9.js} +1 -1
- package/core/built/admin/assets/{virtual-list-window-S0xZxQAf.js → virtual-list-window-BnjCoNIr.js} +1 -1
- package/core/built/admin/assets/{wallet-cards-B9TQg4x3.js → wallet-cards-CVZ99Nm3.js} +1 -1
- package/core/built/admin/assets/{web-BRN2mUpo.js → web-B_MLxGxZ.js} +1 -1
- package/core/built/admin/index.html +5 -5
- package/core/server/{services/custom-redirects/file-store.js → adapters/redirects/FileStore.js} +6 -5
- package/core/server/{services/custom-redirects/file-store.ts → adapters/redirects/FileStore.ts} +6 -4
- package/core/server/adapters/redirects/RedirectsStoreBase.d.ts +9 -0
- package/core/server/adapters/redirects/RedirectsStoreBase.js +8 -0
- package/core/server/{services/custom-redirects/gcs-store.js → adapters/redirects/S3RedirectsStore.js} +50 -18
- package/core/server/adapters/redirects/S3RedirectsStore.ts +163 -0
- package/core/server/adapters/scheduling/scheduling-base.js +41 -0
- package/core/server/adapters/scheduling/types.js +2 -0
- package/core/server/adapters/scheduling/types.ts +36 -0
- package/core/server/api/endpoints/authentication.js +26 -5
- package/core/server/api/endpoints/schedules.js +0 -30
- package/core/server/api/endpoints/utils/serializers/output/authentication.js +10 -0
- package/core/server/data/migrations/versions/6.41/2026-05-13-12-00-00-rename-reset-all-passwords-permission.js +21 -0
- package/core/server/data/schema/fixtures/fixtures.json +3 -3
- package/core/server/models/api-key.js +18 -0
- package/core/server/models/user.js +18 -0
- package/core/server/services/adapter-manager/config.js +6 -0
- package/core/server/services/adapter-manager/index.js +1 -0
- package/core/server/services/auth/index.js +4 -0
- package/core/server/services/auth/reset-authentication.js +50 -0
- package/core/server/services/auth/reset-authentication.ts +75 -0
- package/core/server/services/automations/index.js +21 -15
- package/core/server/services/custom-redirects/index.js +2 -4
- package/core/server/services/gifts/gift-bookshelf-repository.js +7 -0
- package/core/server/services/gifts/gift-bookshelf-repository.ts +10 -0
- package/core/server/services/gifts/gift-reminder-scheduler.js +94 -0
- package/core/server/services/gifts/gift-reminder-scheduler.ts +109 -0
- package/core/server/services/gifts/gift-repository.ts +1 -0
- package/core/server/services/gifts/gift-service-wrapper.js +10 -7
- package/core/server/services/gifts/gift-service.js +1 -32
- package/core/server/services/gifts/gift-service.ts +3 -59
- package/core/server/services/internal-keys/index.js +1 -3
- package/core/server/services/internal-keys/index.ts +11 -3
- package/core/server/services/post-scheduling/index.js +16 -28
- package/core/server/services/post-scheduling/index.ts +14 -0
- package/core/server/services/post-scheduling/post-scheduling.js +115 -0
- package/core/server/services/post-scheduling/post-scheduling.ts +138 -0
- package/core/server/services/users.js +29 -16
- package/core/server/web/api/endpoints/admin/middleware.js +8 -4
- package/core/server/web/api/endpoints/admin/routes.js +1 -1
- package/core/shared/config/defaults.json +5 -0
- package/core/shared/labs.js +2 -1
- package/package.json +1 -1
- package/core/built/admin/assets/minus-DPrXh11r.js +0 -1
- package/core/server/services/custom-redirects/gcs-store.ts +0 -117
- package/core/server/services/post-scheduling/post-scheduler-service.js +0 -126
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-
|
|
2
|
-
import{j as n,r as B,aF as Oe,t as xt,dM as Pv,aR as Hv,au as Uv,aT as Bv,at as Ro,av as $u,aV as Wv,aw as pu,aU as Lp,as as Yv,az as Fp,ax as qv,ay as Gv,dN as dt,ag as ss,b6 as pt,dp as $r,dB as zr,dO as jt,dP as et,c2 as Lu,dl as zp,dQ as Pp,dR as Uf,dS as Xv,dT as Qn,dU as Zv,dV as Kv,dW as Vv,dX as Hp,dY as Fu,dZ as Qv,d_ as Jv,d$ as Ha,e0 as e1,e1 as Lr,e2 as $o,e3 as t1,e4 as n1,aB as r1,e5 as s1,dD as Or,e6 as a1,e7 as Oa,e8 as i1,e9 as o1,X as Up,bi as l1,aK as c1,bz as u1,C as d1,cM as f1,aC as ns,ai as h1,aX as p1,ea as m1,eb as Bp,ec as Wp,ed as Bf,cz as Bt,ee as zs,ef as mu,eg as g1,eh as Ps,ei as x1,ej as b1,ek as w1,el as Ua,em as v1,en as _1,eo as gu,af as y1,ep as k1,eq as j1,er as M1,es as E1,et as Ir,eu as Wf,ev as Yf,ew as T1}from"./index-CFEzD2_M.js";import{H as Et,c as Jn,S as Hs,Q as Ke,U as Lo,V as N1,W as Wt,X as C1,Y as Ht,Z as yt,_ as Vn,$ as S1,a0 as Fr,a1 as I1,a2 as Fo,a3 as Ae,a4 as rt,a5 as A1,a6 as zo,a7 as lt,a8 as pr,a9 as Pr,aa as Dt,ab as as,ac as gn,ad as D1,ae as ut,af as He,ag as qf,ah as Gf,ai as ot,aj as Yp,ak as qp,al as O1,am as Xf,an as R1,ao as $1,ap as L1,aq as Bs,ar as Ws,as as gr,at as xr,au as La,av as F1,aw as z1,ax as P1,ay as H1,az as U1,aA as No,aB as Co,aC as er,aD as B1,aE as Zf,aF as Kf,aG as W1,aH as Ys,aI as mr,aJ as hr,aK as Gp,aL as Po,aM as Xp,aN as Y1,aO as q1,aP as Zp,aQ as Kp,aR as Vp,aS as Uc,E as xu,aT as Vf,R as G1,aU as Qp,aV as X1,aW as Z1,aX as In,aY as Qf,aZ as Jp,a_ as em,a$ as tm,b0 as nm,b1 as bu,b2 as K1,b3 as V1,b4 as Q1,b5 as wu,b6 as zu,b7 as Eo,b8 as J1,b9 as e_,ba as Jf,bb as rm,bc as t_,bd as sm,be as Pu,bf as Hu,bg as vu,bh as n_,bi as r_,bj as s_,bk as a_}from"./settings-66Zv8QvL.js";import{a as i_,u as am,b as im}from"./newsletters-DOIL_cOY.js";import{C as o_,a as l_}from"./index-BTf6YUBb.js";import{u as om}from"./posts-u-CAKddc.js";import{r as lm,c as xo}from"./index-ClOB5u8L.js";import{S as c_,F as u_,a as d_,b as f_,C as h_,U as cm,T as p_,A as m_,L as g_}from"./undo-2-CcBtw-tW.js";import{P as x_}from"./pencil-CKTgzafp.js";import{a as um,b as dm,u as Uu,c as Bu,d as b_}from"./dropzone-DSPf3N_o.js";import{u as is,a as Wu,b as w_,g as Za}from"./tiers-DXKbghdk.js";import"./tabs-CL5eaCGL.js";import"./typeof-QjJsDpFa.js";import"./referrers-DV_Ihg9y.js";import"./select-CPSy44ld.js";import"./chevron-up-CVgBkTk5.js";import"./underline-Bq0P-5Zy.js";import"./toggle-group-DaZKTYDS.js";import"./textarea-DdDuNixZ.js";import"./index-WKMARia9.js";const fm=({children:t,...a})=>n.jsx("div",{className:"flex size-full flex-col px-8",...a,children:n.jsx("div",{className:"size-full overflow-hidden rounded-t-[4px] shadow-sm",children:t})}),hm=({children:t,...a})=>n.jsx("div",{className:"flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900",...a,children:n.jsx("div",{className:"h-100 w-100 grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950",children:t})}),v_=({title:t,label:a,value:s,onChange:o,disabled:c,error:u,hint:d,checked:l,separator:f,testId:m})=>{const p=B.useId(),b=w=>{o(w===!0)};return n.jsxs("div",{children:[n.jsxs("div",{className:`flex flex-col gap-1 ${f&&"pb-2"}`,children:[t&&n.jsx(Et,{grey:!0,level:6,children:t}),n.jsxs("label",{className:`flex cursor-pointer items-start ${t&&"mt-1 -mb-1"}`,htmlFor:p,children:[n.jsx(o_,{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":m,defaultChecked:l,disabled:c,id:p,value:s,onCheckedChange:b,children:n.jsx(l_,{children:n.jsx("svg",{fill:"none",height:"11",viewBox:"0 0 10 11",width:"10",children:n.jsx("path",{d:"M1 5.88889L4.6 9L9 1",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})})}),n.jsxs("div",{className:`ml-2 flex flex-col ${d&&"mb-2"}`,children:[n.jsx("span",{className:`inline-block text-[1.425rem] dark:text-white ${d&&"-mb-1"}`,children:a}),d&&n.jsx(Jn,{color:u?"red":"",children:d})]})]})]}),(f||u)&&n.jsx(Hs,{className:u?"border-red":""})]})},_u=({title:t,checkboxes:a,hint:s,error:o})=>n.jsxs("div",{children:[t&&n.jsx(Et,{grey:!0,level:6,children:t}),n.jsx("div",{className:"mt-2 flex flex-col gap-1",children:a?.map(({key:c,...u})=>n.jsx(v_,{...u},c))}),n.jsx("div",{className:`flex flex-col ${s&&"mb-2"}`,children:s&&n.jsx(Jn,{color:o?"red":"",children:s})})]}),__=({hex:t,value:a,title:s,size:o="md",isSelected:c,onSelect:u})=>{const d=B.useRef(null),l=p=>{p.preventDefault(),u(a!==void 0?a:t)},f=t.length===4&&t[3]==="0"||t.length===8&&t.slice(6)==="00";let m="h-5 w-5";return o==="lg"&&(m="w-6 h-6"),n.jsx("button",{ref:d,className:Oe("relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800",m,c&&"outline outline-2 outline-green"),style:{backgroundColor:t},title:s,type:"button",onClick:l,children:f&&n.jsx("div",{className:"absolute top-0 left-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})},pm=({title:t,value:a,swatches:s,swatchSize:o="md",onSwatchChange:c,onTogglePicker:u,isExpanded:d,picker:l=!0,containerClassName:f})=>{const m=s.find(b=>b.value===a||b.hex===a);f=Oe("flex flex-col gap-3");const p=d||!l;return n.jsxs("div",{className:f,children:[t&&n.jsx(Et,{useLabelTag:!0,children:t}),n.jsxs("div",{className:"flex gap-1",children:[p&&n.jsx("div",{className:"flex items-center gap-1",children:s.map(({customContent:b,...w})=>b?n.jsx(B.Fragment,{children:b},w.title):n.jsx(__,{isSelected:m?.title===w.title,size:o,onSelect:c,...w},w.title))}),l&&n.jsxs("button",{"aria-label":"Pick color",className:"relative size-6 cursor-pointer rounded-full border border-grey-250 dark:border-grey-800",type:"button",onClick:u,children:[n.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%))]"}),m&&n.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:m.hex},children:m.hex==="transparent"&&n.jsx("div",{className:"absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})}),!m&&a&&n.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:a},children:a==="transparent"&&n.jsx("div",{className:"absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})]})]})]})};function qs(){return(qs=Object.assign||function(t){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t}).apply(this,arguments)}function Ho(t,a){if(t==null)return{};var s,o,c={},u=Object.keys(t);for(o=0;o<u.length;o++)a.indexOf(s=u[o])>=0||(c[s]=t[s]);return c}function Ba(t){var a=B.useRef(t),s=B.useRef(function(o){a.current&&a.current(o)});return a.current=t,s.current}var Wa=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=1),t>s?s:t<a?a:t},Fa=function(t){return"touches"in t},yu=function(t){return t&&t.ownerDocument.defaultView||self},eh=function(t,a,s){var o=t.getBoundingClientRect(),c=Fa(a)?(function(u,d){for(var l=0;l<u.length;l++)if(u[l].identifier===d)return u[l];return u[0]})(a.touches,s):a;return{left:Wa((c.pageX-(o.left+yu(t).pageXOffset))/o.width),top:Wa((c.pageY-(o.top+yu(t).pageYOffset))/o.height)}},th=function(t){!Fa(t)&&t.preventDefault()},mm=xt.memo(function(t){var a=t.onMove,s=t.onKey,o=Ho(t,["onMove","onKey"]),c=B.useRef(null),u=Ba(a),d=Ba(s),l=B.useRef(null),f=B.useRef(!1),m=B.useMemo(function(){var h=function(j){th(j),(Fa(j)?j.touches.length>0:j.buttons>0)&&c.current?u(eh(c.current,j,l.current)):x(!1)},M=function(){return x(!1)};function x(j){var _=f.current,E=yu(c.current),C=j?E.addEventListener:E.removeEventListener;C(_?"touchmove":"mousemove",h),C(_?"touchend":"mouseup",M)}return[function(j){var _=j.nativeEvent,E=c.current;if(E&&(th(_),!(function(A,D){return D&&!Fa(A)})(_,f.current)&&E)){if(Fa(_)){f.current=!0;var C=_.changedTouches||[];C.length&&(l.current=C[0].identifier)}E.focus(),u(eh(E,_,l.current)),x(!0)}},function(j){var _=j.which||j.keyCode;_<37||_>40||(j.preventDefault(),d({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},x]},[d,u]),p=m[0],b=m[1],w=m[2];return B.useEffect(function(){return w},[w]),xt.createElement("div",qs({},o,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:c,onKeyDown:b,tabIndex:0,role:"slider"}))}),Yu=function(t){return t.filter(Boolean).join(" ")},gm=function(t){var a=t.color,s=t.left,o=t.top,c=o===void 0?.5:o,u=Yu(["react-colorful__pointer",t.className]);return xt.createElement("div",{className:u,style:{top:100*c+"%",left:100*s+"%"}},xt.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:a}}))},Qt=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=Math.pow(10,a)),Math.round(s*t)/s},y_=function(t){return T_(ku(t))},ku=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Qt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Qt(parseInt(t.substring(6,8),16)/255,2):1}},k_=function(t){return E_(M_(t))},j_=function(t){var a=t.s,s=t.v,o=t.a,c=(200-a)*s/100;return{h:Qt(t.h),s:Qt(c>0&&c<200?a*s/100/(c<=100?c:200-c)*100:0),l:Qt(c/2),a:Qt(o,2)}},ju=function(t){var a=j_(t);return"hsl("+a.h+", "+a.s+"%, "+a.l+"%)"},M_=function(t){var a=t.h,s=t.s,o=t.v,c=t.a;a=a/360*6,s/=100,o/=100;var u=Math.floor(a),d=o*(1-s),l=o*(1-(a-u)*s),f=o*(1-(1-a+u)*s),m=u%6;return{r:Qt(255*[o,l,d,d,f,o][m]),g:Qt(255*[f,o,o,l,d,d][m]),b:Qt(255*[d,d,f,o,o,l][m]),a:Qt(c,2)}},bo=function(t){var a=t.toString(16);return a.length<2?"0"+a:a},E_=function(t){var a=t.r,s=t.g,o=t.b,c=t.a,u=c<1?bo(Qt(255*c)):"";return"#"+bo(a)+bo(s)+bo(o)+u},T_=function(t){var a=t.r,s=t.g,o=t.b,c=t.a,u=Math.max(a,s,o),d=u-Math.min(a,s,o),l=d?u===a?(s-o)/d:u===s?2+(o-a)/d:4+(a-s)/d:0;return{h:Qt(60*(l<0?l+6:l)),s:Qt(u?d/u*100:0),v:Qt(u/255*100),a:c}},N_=xt.memo(function(t){var a=t.hue,s=t.onChange,o=Yu(["react-colorful__hue",t.className]);return xt.createElement("div",{className:o},xt.createElement(mm,{onMove:function(c){s({h:360*c.left})},onKey:function(c){s({h:Wa(a+360*c.left,0,360)})},"aria-label":"Hue","aria-valuenow":Qt(a),"aria-valuemax":"360","aria-valuemin":"0"},xt.createElement(gm,{className:"react-colorful__hue-pointer",left:a/360,color:ju({h:a,s:100,v:100,a:1})})))}),C_=xt.memo(function(t){var a=t.hsva,s=t.onChange,o={backgroundColor:ju({h:a.h,s:100,v:100,a:1})};return xt.createElement("div",{className:"react-colorful__saturation",style:o},xt.createElement(mm,{onMove:function(c){s({s:100*c.left,v:100-100*c.top})},onKey:function(c){s({s:Wa(a.s+100*c.left,0,100),v:Wa(a.v-100*c.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Qt(a.s)+"%, Brightness "+Qt(a.v)+"%"},xt.createElement(gm,{className:"react-colorful__saturation-pointer",top:1-a.v/100,left:a.s/100,color:ju(a)})))}),xm=function(t,a){if(t===a)return!0;for(var s in t)if(t[s]!==a[s])return!1;return!0},S_=function(t,a){return t.toLowerCase()===a.toLowerCase()||xm(ku(t),ku(a))};function I_(t,a,s){var o=Ba(s),c=B.useState(function(){return t.toHsva(a)}),u=c[0],d=c[1],l=B.useRef({color:a,hsva:u});B.useEffect(function(){if(!t.equal(a,l.current.color)){var m=t.toHsva(a);l.current={hsva:m,color:a},d(m)}},[a,t]),B.useEffect(function(){var m;xm(u,l.current.hsva)||t.equal(m=t.fromHsva(u),l.current.color)||(l.current={hsva:u,color:m},o(m))},[u,t,o]);var f=B.useCallback(function(m){d(function(p){return Object.assign({},p,m)})},[]);return[u,f]}var A_=typeof window<"u"?B.useLayoutEffect:B.useEffect,D_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},nh=new Map,O_=function(t){A_(function(){var a=t.current?t.current.ownerDocument:document;if(a!==void 0&&!nh.has(a)){var s=a.createElement("style");s.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}`,nh.set(a,s);var o=D_();o&&s.setAttribute("nonce",o),a.head.appendChild(s)}},[])},R_=function(t){var a=t.className,s=t.colorModel,o=t.color,c=o===void 0?s.defaultColor:o,u=t.onChange,d=Ho(t,["className","colorModel","color","onChange"]),l=B.useRef(null);O_(l);var f=I_(s,c,u),m=f[0],p=f[1],b=Yu(["react-colorful",a]);return xt.createElement("div",qs({},d,{ref:l,className:b}),xt.createElement(C_,{hsva:m,onChange:p}),xt.createElement(N_,{hue:m.h,onChange:p,className:"react-colorful__last-control"}))},$_={defaultColor:"000",toHsva:y_,fromHsva:function(t){return k_({h:t.h,s:t.s,v:t.v,a:1})},equal:S_},L_=function(t){return xt.createElement(R_,qs({},t,{colorModel:$_}))},F_=/^#?([0-9A-F]{3,8})$/i,z_=function(t){var a=t.color,s=a===void 0?"":a,o=t.onChange,c=t.onBlur,u=t.escape,d=t.validate,l=t.format,f=t.process,m=Ho(t,["color","onChange","onBlur","escape","validate","format","process"]),p=B.useState(function(){return u(s)}),b=p[0],w=p[1],h=Ba(o),M=Ba(c),x=B.useCallback(function(_){var E=u(_.target.value);w(E),d(E)&&h(f?f(E):E)},[u,f,d,h]),j=B.useCallback(function(_){d(_.target.value)||w(u(s)),M(_)},[s,u,d,M]);return B.useEffect(function(){w(u(s))},[s,u]),xt.createElement("input",qs({},m,{value:l?l(b):b,spellCheck:"false",onChange:x,onBlur:j}))},rh=function(t){return"#"+t},P_=function(t){var a=t.prefixed,s=t.alpha,o=Ho(t,["prefixed","alpha"]),c=B.useCallback(function(d){return d.replace(/([^0-9A-F]+)/gi,"").substring(0,s?8:6)},[s]),u=B.useCallback(function(d){return(function(l,f){var m=F_.exec(l),p=m?m[1].length:0;return p===3||p===6||!!f&&p===4||!!f&&p===8})(d,s)},[s]);return xt.createElement(z_,qs({},o,{escape:c,format:a?rh:void 0,process:rh,validate:u}))};const H_=({hexValue:t,eyedropper:a,clearButtonValue:s,containerClassName:o,onChange:c})=>{const u=B.useRef(null),d=B.useCallback(w=>{w.stopPropagation();const h=u.current?.querySelector("input");w.target!==h&&(u.current?.querySelector("input")?.focus(),w.preventDefault())},[]),l=B.useRef(!1),f=B.useCallback(()=>{l.current=!1,u.current?.querySelector("input")?.focus(),document.removeEventListener("mouseup",f),document.removeEventListener("touchend",f)},[]),m=B.useCallback(()=>{l.current=!0,document.addEventListener("mouseup",f),document.addEventListener("touchend",f)},[f]),p=B.useCallback(w=>{if(w.preventDefault(),!window.EyeDropper)return;l.current=!0,document.body.style.setProperty("pointer-events","none"),new window.EyeDropper().open().then(M=>c?.(M.sRGBHex)).finally(()=>{l.current=!1,document.body.style.removeProperty("pointer-events"),u.current?.querySelector("input")?.focus()})},[c]);B.useEffect(()=>{u.current?.querySelector("input")?.focus()},[]);const b=B.useCallback(()=>{u.current?.querySelector("input")?.focus()},[]);return o=Oe("mt-2",o),n.jsxs("div",{className:o,onMouseDown:d,onTouchStart:d,children:[n.jsx(L_,{className:"w-full",color:t||"#ffffff",onChange:c,onMouseDown:m,onTouchStart:m}),n.jsxs("div",{className:"mt-3 flex gap-2",children:[n.jsxs("div",{ref:u,className:"peer relative order-2 flex h-10 w-full items-center",onClick:b,children:[n.jsx("span",{className:"absolute top-[9px] left-2 z-10 mr-2 ml-1 text-grey-700",children:"#"}),n.jsx(P_,{"aria-label":"Color value",className:"z-[1] w-full rounded-md border border-transparent bg-grey-150 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-925",color:t,onChange:c}),a&&!!window.EyeDropper&&n.jsx("button",{className:"absolute inset-y-0 right-3 z-50 my-auto size-4 p-[1px]",type:"button",onClick:p,children:n.jsx(Pv,{className:"size-full"})})]}),s!==void 0&&n.jsx(Ke,{color:"grey",value:"Clear",onClick:()=>c?.(s)})]})]})},U_=B.createContext({colorPickers:[]}),sh=t=>t.length===4?t.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3"):t,Kn=({testId:t,title:a,direction:s,value:o,hint:c,error:u,eyedropper:d,clearButtonValue:l,onChange:f,swatches:m=[],alwaysOpen:p=!1,debounceMs:b})=>{const[w,h]=B.useState(!1),[M,x]=B.useState(o),j=B.useContext(U_),_=B.useId();B.useEffect(()=>{x(F=>sh(F||"")===o?F:o)},[o]),B.useEffect(()=>(j.colorPickers.push({id:_,setExpanded:h}),()=>{j.colorPickers=j.colorPickers.filter(F=>F.id!==_)}),[j,_]),B.useEffect(()=>{if(w){j.colorPickers.filter(O=>O.id!==_).forEach(O=>O.setExpanded(!1));const F=()=>{h(!1)};return document.addEventListener("click",F),()=>{document.removeEventListener("click",F)}}},[j,_,w]);const E=B.useMemo(()=>f&&b?Lo(f,b):f,[b,f]),C=F=>{x(F),E?.(F?sh(F):null)};let A=n.jsx(pm,{isExpanded:w,swatches:m,value:M,onSwatchChange:F=>{C(F),h(!1)},onTogglePicker:()=>!p&&h(!w)});a&&(A=n.jsxs("div",{className:Oe("flex w-full cursor-pointer items-start first:mt-0 dark:text-white",s==="rtl"&&"flex-row-reverse"),children:[n.jsx("div",{className:"shrink-0",children:A}),n.jsxs("div",{className:Oe("flex-1",s==="rtl"?"pr-2":"pl-2",c?"mt-[-2px]":"mt-[1px]"),onClick:()=>!p&&h(!w),children:[a,c&&n.jsx("div",{className:`text-xs ${u?"text-red":"text-grey-700"}`,children:c})]})]}));const D=m.find(F=>F.value===M);return n.jsxs("div",{className:"flex-col","data-testid":t,onClick:F=>F.stopPropagation(),children:[A,(p||w)&&n.jsx(H_,{clearButtonValue:l,eyedropper:d,hexValue:D?.hex||M||void 0,onChange:C})]})},B_=({value:t,onChange:a,singleParagraph:s=!0,...o})=>{const c=B.useCallback(u=>{const l=new DOMParser().parseFromString(u,"text/html");l.querySelectorAll("*").forEach(m=>{m.style.removeProperty("white-space"),m.getAttribute("style")||m.removeAttribute("style")}),l.body.innerHTML!==t&&a?.(l.body.innerHTML)},[t,a]);return n.jsx(N1,{...o,singleParagraph:s,children:u=>n.jsx(u.HtmlOutputPlugin,{html:t,setHtml:c})})},qu=({title:t,hideTitle:a,error:s,hint:o,value:c,clearBg:u=!1,className:d="",containerClassName:l="",hintClassName:f="",unstyled:m=!1,...p})=>{const b=m?"":Oe("flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[36px]",u?"bg-transparent":"bg-grey-150 px-3 dark:bg-grey-900",s?"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-925 dark:has-[:focus]:bg-grey-950",t&&!a&&!u&&"mt-2",d);return n.jsxs("div",{className:`flex flex-col ${l}`,children:[t&&n.jsx(Et,{className:a?"sr-only":"",grey:!0,useLabelTag:!0,children:t}),n.jsx("div",{className:b,children:n.jsx(B_,{...p,value:c})}),o&&n.jsx(Jn,{className:f,color:s?"red":"",children:o})]})};var Gu="Radio",[W_,bm]=Fp(Gu),[Y_,q_]=W_(Gu),wm=B.forwardRef((t,a)=>{const{__scopeRadio:s,name:o,checked:c=!1,required:u,disabled:d,value:l="on",onCheck:f,form:m,...p}=t,[b,w]=B.useState(null),h=$u(a,j=>w(j)),M=B.useRef(!1),x=b?m||!!b.closest("form"):!0;return n.jsxs(Y_,{scope:s,checked:c,disabled:d,children:[n.jsx(Ro.button,{type:"button",role:"radio","aria-checked":c,"data-state":km(c),"data-disabled":d?"":void 0,disabled:d,value:l,...p,ref:h,onClick:pu(t.onClick,j=>{c||f?.(),x&&(M.current=j.isPropagationStopped(),M.current||j.stopPropagation())})}),x&&n.jsx(ym,{control:b,bubbles:!M.current,name:o,value:l,checked:c,required:u,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});wm.displayName=Gu;var vm="RadioIndicator",_m=B.forwardRef((t,a)=>{const{__scopeRadio:s,forceMount:o,...c}=t,u=q_(vm,s);return n.jsx(Yv,{present:o||u.checked,children:n.jsx(Ro.span,{"data-state":km(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:a})})});_m.displayName=vm;var G_="RadioBubbleInput",ym=B.forwardRef(({__scopeRadio:t,control:a,checked:s,bubbles:o=!0,...c},u)=>{const d=B.useRef(null),l=$u(d,u),f=qv(s),m=Gv(a);return B.useEffect(()=>{const p=d.current;if(!p)return;const b=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(b,"checked").set;if(f!==s&&h){const M=new Event("click",{bubbles:o});h.call(p,s),p.dispatchEvent(M)}},[f,s,o]),n.jsx(Ro.input,{type:"radio","aria-hidden":!0,defaultChecked:s,...c,tabIndex:-1,ref:l,style:{...c.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ym.displayName=G_;function km(t){return t?"checked":"unchecked"}var X_=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Uo="RadioGroup",[Z_]=Fp(Uo,[Lp,bm]),jm=Lp(),Mm=bm(),[K_,V_]=Z_(Uo),Em=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,name:o,defaultValue:c,value:u,required:d=!1,disabled:l=!1,orientation:f,dir:m,loop:p=!0,onValueChange:b,...w}=t,h=jm(s),M=Hv(m),[x,j]=Uv({prop:u,defaultProp:c??null,onChange:b,caller:Uo});return n.jsx(K_,{scope:s,name:o,required:d,disabled:l,value:x,onValueChange:j,children:n.jsx(Bv,{asChild:!0,...h,orientation:f,dir:M,loop:p,children:n.jsx(Ro.div,{role:"radiogroup","aria-required":d,"aria-orientation":f,"data-disabled":l?"":void 0,dir:M,...w,ref:a})})})});Em.displayName=Uo;var Tm="RadioGroupItem",Nm=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,disabled:o,...c}=t,u=V_(Tm,s),d=u.disabled||o,l=jm(s),f=Mm(s),m=B.useRef(null),p=$u(a,m),b=u.value===c.value,w=B.useRef(!1);return B.useEffect(()=>{const h=x=>{X_.includes(x.key)&&(w.current=!0)},M=()=>w.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",M),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",M)}},[]),n.jsx(Wv,{asChild:!0,...l,focusable:!d,active:b,children:n.jsx(wm,{disabled:d,required:u.required,checked:b,...f,...c,name:u.name,ref:p,onCheck:()=>u.onValueChange(c.value),onKeyDown:pu(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:pu(c.onFocus,()=>{w.current&&m.current?.click()})})})});Nm.displayName=Tm;var Q_="RadioGroupIndicator",Cm=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,...o}=t,c=Mm(s);return n.jsx(_m,{...c,...o,ref:a})});Cm.displayName=Q_;var J_=Em,ey=Nm,ty=Cm;const ny=({id:t,title:a,options:s,onSelect:o,error:c,hint:u,selectedOption:d,separator:l})=>n.jsxs(J_,{defaultValue:d,name:t,onValueChange:o,children:[n.jsxs("div",{className:`flex flex-col gap-2 ${l&&"pb-2"}`,children:[a&&n.jsx(Et,{level:6,children:a}),s.map(f=>n.jsxs("label",{className:`flex cursor-pointer items-start ${a&&"mt-1 -mb-1"}`,htmlFor:f.value,children:[n.jsx(ey,{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:f.value,value:f.value,children:n.jsx(ty,{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"})}),n.jsxs("div",{className:`ml-2 flex flex-col ${f.hint&&"mb-2"}`,children:[n.jsx("span",{className:`inline-block text-md dark:text-white ${f.hint&&"-mb-1"}`,children:f.label}),f.hint&&n.jsx(Jn,{children:f.hint})]})]},f.value)),u&&n.jsx(Jn,{color:c?"red":"",children:u})]}),(l||c)&&n.jsx(Hs,{className:c?"border-red":""})]}),So=({children:t,gap:a="md",className:s})=>{let o="gap-3";switch(a){case"sm":o="gap-2";break;case"md":o="gap-3";break;case"lg":o="gap-4";break}return s=Oe("flex flex-col",o,s),n.jsx("div",{className:s,children:t})},Xu=({heading:t,children:a,className:s})=>(s=Oe("w-full p-[8vmin] pt-5",s),n.jsxs("div",{className:s,children:[t&&n.jsx(Et,{className:"mb-8",children:t}),a]})),Zu=({items:t,backIcon:a=!1,snapBackIcon:s=!0,onBack:o,containerClassName:c,itemClassName:u,activeItemClassName:d,separatorClassName:l})=>{const f=t.length;let m=0;return c=Oe("flex items-center gap-2 text-sm",c),d=Oe("font-bold",d),u=Oe("text-sm",u),n.jsxs("div",{className:c,children:[a&&n.jsx(Ke,{className:s?"mr-1":"mr-6",icon:"arrow-left",iconColorClass:"dark:text-white",size:"sm",link:!0,onClick:o}),t.map(p=>{const b=m===f-1?n.jsx("span",{className:d,children:p.label}):n.jsxs(n.Fragment,{children:[n.jsx("button",{className:`${u} ${p.onClick&&"-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900"}`,type:"button",onClick:p.onClick,children:p.label},`bc-${m}`),n.jsx("span",{className:l,children:"/"})]});return m=m+1,b})]})},os=({testId:t,title:a,titleHeadingLevel:s=4,size:o="full",width:c,height:u,sidebar:d="",preview:l,dirty:f=!1,cancelLabel:m="Cancel",okLabel:p="OK",okColor:b="black",previewToolbar:w=!0,leftToolbar:h=!0,rightToolbar:M=!0,deviceSelector:x=!0,siteLink:j,previewToolbarURLs:_,previewBgColor:E="grey",selectedURL:C,previewToolbarTabs:A,previewToolbarBreadcrumbs:D,buttonsDisabled:F,sidebarButtons:O,sidebarHeader:q,sidebarPadding:P=!0,sidebarContentClasses:U,enableCMDS:K=!0,backDropClick:$,onCancel:Q,onOk:N,afterClose:W,onSelectURL:ae,onSelectDesktopView:ue,onSelectMobileView:be,onBreadcrumbsBack:de})=>{const ie=Wt(),{setGlobalDirtyState:V}=C1();B.useEffect(()=>{V(f)},[f,V]),B.useEffect(()=>{if(N){const xe=Fe=>{(Fe.metaKey||Fe.ctrlKey)&&Fe.key==="s"&&(Fe.preventDefault(),N())};if(K)return window.addEventListener("keydown",xe),()=>{window.removeEventListener("keydown",xe)}}});const[G,me]=B.useState("desktop");if(G==="mobile"&&x?l=n.jsx(hm,{"data-testid":"preview-mobile",children:l}):G==="desktop"&&x&&(l=n.jsx(fm,{"data-testid":"preview-desktop",children:l})),w){let xe=n.jsx(n.Fragment,{});_?xe=n.jsx(Ht,{options:_,selectedOption:_.find(Ee=>Ee.value===C),onSelect:Ee=>Ee&&ae?.(Ee.value)}):A?xe=n.jsx(Fr,{border:!1,selectedTab:C,tabs:A,width:"wide",onTabChange:ae}):D&&(xe=n.jsx(Zu,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:D,separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:de}));const Fe="text-black dark:text-green",qe="text-grey-500 dark:text-grey-600",Ue=[{icon:"laptop",label:"Desktop",hideLabel:!0,link:!0,size:"sm",iconColorClass:G==="desktop"?Fe:qe,onClick:ue||(()=>{me("desktop")})},{icon:"mobile",label:"Mobile",hideLabel:!0,link:!0,size:"sm",iconColorClass:G==="mobile"?Fe:qe,onClick:be||(()=>{me("mobile")})}],Xe=x&&n.jsx(Vn,{buttons:Ue});let we="";E==="grey"?we="bg-grey-50 dark:bg-black":E==="greygradient"&&(we="bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black");const Le=Oe("absolute inset-y-0 right-[400px] left-0 flex w-full min-w-100 grow flex-col overflow-y-auto",we);let Ie;j&&(Ie=n.jsx("div",{className:"ml-3 border-l border-grey-400 dark:border-grey-800",children:n.jsxs("a",{className:"ml-3 flex items-center gap-1 text-sm",href:j,rel:"noopener noreferrer",target:"_blank",children:["View site ",n.jsx(dt,{name:"arrow-top-right",size:"xs"})]})})),l=n.jsxs("div",{className:Le,children:[w&&n.jsxs("header",{className:"relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5","data-testid":"design-toolbar",children:[h&&n.jsx("div",{className:"absolute left-8 flex h-full items-center",children:xe}),M&&n.jsxs("div",{className:"absolute right-8 flex h-full items-center",children:[Xe,Ie]})]}),n.jsx("div",{className:"flex grow items-center justify-center text-sm text-grey-400",children:l})]})}const ee=[];return O||(ee.push({key:"cancel-modal",label:m,onClick:Q||(()=>{S1(f,()=>{ie.remove(),W?.()})}),disabled:F}),ee.push({key:"ok-modal",label:p,color:b,onClick:N,disabled:F})),n.jsx(yt,{afterClose:W,animate:!1,backDropClick:$,dirty:f,footer:!1,height:u,padding:!1,size:o,testId:t,title:"",width:c,hideXOnMobile:!0,children:n.jsxs("div",{className:"flex h-full grow",children:[n.jsx("div",{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${E==="grey"?"bg-grey-50":"bg-white dark:bg-black"}`,children:l}),d&&n.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:[q||n.jsxs("div",{className:"flex max-h-[82px] items-center justify-between gap-3 px-7 py-6",children:[n.jsx(Et,{level:s,children:a}),O||n.jsx(Vn,{buttons:ee})]}),n.jsx("div",{className:`${q?"":"absolute inset-x-0 top-[80px] bottom-0 grow"} ${P&&"p-7 pt-0"} flex flex-col justify-between overflow-y-auto ${U&&U}`,children:d})]})]})})},ry=({offset:t,onTrigger:a})=>{const s=B.useRef(null);return B.useEffect(()=>{const o=new IntersectionObserver(c=>{c[0].intersectionRatio<=0||a()});return s.current&&o.observe(s.current),()=>o.disconnect()},[a]),n.jsx("div",{ref:s,className:"absolute w-full",style:{bottom:t}})};var Sm=typeof global=="object"&&global&&global.Object===Object&&global,sy=typeof self=="object"&&self&&self.Object===Object&&self,br=Sm||sy||Function("return this")(),Us=br.Symbol,Im=Object.prototype,ay=Im.hasOwnProperty,iy=Im.toString,Ra=Us?Us.toStringTag:void 0;function oy(t){var a=ay.call(t,Ra),s=t[Ra];try{t[Ra]=void 0;var o=!0}catch{}var c=iy.call(t);return o&&(a?t[Ra]=s:delete t[Ra]),c}var ly=Object.prototype,cy=ly.toString;function uy(t){return cy.call(t)}var dy="[object Null]",fy="[object Undefined]",ah=Us?Us.toStringTag:void 0;function Ka(t){return t==null?t===void 0?fy:dy:ah&&ah in Object(t)?oy(t):uy(t)}function Ya(t){return t!=null&&typeof t=="object"}var Io=Array.isArray;function Am(t){var a=typeof t;return t!=null&&(a=="object"||a=="function")}var hy="[object AsyncFunction]",py="[object Function]",my="[object GeneratorFunction]",gy="[object Proxy]";function Dm(t){if(!Am(t))return!1;var a=Ka(t);return a==py||a==my||a==hy||a==gy}var Bc=br["__core-js_shared__"],ih=(function(){var t=/[^.]+$/.exec(Bc&&Bc.keys&&Bc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function xy(t){return!!ih&&ih in t}var by=Function.prototype,wy=by.toString;function ls(t){if(t!=null){try{return wy.call(t)}catch{}try{return t+""}catch{}}return""}var vy=/[\\^$.*+?()[\]{}|]/g,_y=/^\[object .+?Constructor\]$/,yy=Function.prototype,ky=Object.prototype,jy=yy.toString,My=ky.hasOwnProperty,Ey=RegExp("^"+jy.call(My).replace(vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ty(t){if(!Am(t)||xy(t))return!1;var a=Dm(t)?Ey:_y;return a.test(ls(t))}function Ny(t,a){return t?.[a]}function Gs(t,a){var s=Ny(t,a);return Ty(s)?s:void 0}var Mu=Gs(br,"WeakMap"),Cy=9007199254740991,Sy=/^(?:0|[1-9]\d*)$/;function Iy(t,a){var s=typeof t;return a=a??Cy,!!a&&(s=="number"||s!="symbol"&&Sy.test(t))&&t>-1&&t%1==0&&t<a}function Om(t,a){return t===a||t!==t&&a!==a}var Ay=9007199254740991;function Rm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ay}function Dy(t){return t!=null&&Rm(t.length)&&!Dm(t)}var Oy=Object.prototype;function Ry(t){var a=t&&t.constructor,s=typeof a=="function"&&a.prototype||Oy;return t===s}function $y(t,a){for(var s=-1,o=Array(t);++s<t;)o[s]=a(s);return o}var Ly="[object Arguments]";function oh(t){return Ya(t)&&Ka(t)==Ly}var $m=Object.prototype,Fy=$m.hasOwnProperty,zy=$m.propertyIsEnumerable,Py=oh((function(){return arguments})())?oh:function(t){return Ya(t)&&Fy.call(t,"callee")&&!zy.call(t,"callee")};function Hy(){return!1}var Lm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lh=Lm&&typeof module=="object"&&module&&!module.nodeType&&module,Uy=lh&&lh.exports===Lm,ch=Uy?br.Buffer:void 0,By=ch?ch.isBuffer:void 0,Eu=By||Hy,Wy="[object Arguments]",Yy="[object Array]",qy="[object Boolean]",Gy="[object Date]",Xy="[object Error]",Zy="[object Function]",Ky="[object Map]",Vy="[object Number]",Qy="[object Object]",Jy="[object RegExp]",e3="[object Set]",t3="[object String]",n3="[object WeakMap]",r3="[object ArrayBuffer]",s3="[object DataView]",a3="[object Float32Array]",i3="[object Float64Array]",o3="[object Int8Array]",l3="[object Int16Array]",c3="[object Int32Array]",u3="[object Uint8Array]",d3="[object Uint8ClampedArray]",f3="[object Uint16Array]",h3="[object Uint32Array]",It={};It[a3]=It[i3]=It[o3]=It[l3]=It[c3]=It[u3]=It[d3]=It[f3]=It[h3]=!0;It[Wy]=It[Yy]=It[r3]=It[qy]=It[s3]=It[Gy]=It[Xy]=It[Zy]=It[Ky]=It[Vy]=It[Qy]=It[Jy]=It[e3]=It[t3]=It[n3]=!1;function p3(t){return Ya(t)&&Rm(t.length)&&!!It[Ka(t)]}function m3(t){return function(a){return t(a)}}var Fm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,za=Fm&&typeof module=="object"&&module&&!module.nodeType&&module,g3=za&&za.exports===Fm,Wc=g3&&Sm.process,uh=(function(){try{var t=za&&za.require&&za.require("util").types;return t||Wc&&Wc.binding&&Wc.binding("util")}catch{}})(),dh=uh&&uh.isTypedArray,zm=dh?m3(dh):p3,x3=Object.prototype,b3=x3.hasOwnProperty;function w3(t,a){var s=Io(t),o=!s&&Py(t),c=!s&&!o&&Eu(t),u=!s&&!o&&!c&&zm(t),d=s||o||c||u,l=d?$y(t.length,String):[],f=l.length;for(var m in t)b3.call(t,m)&&!(d&&(m=="length"||c&&(m=="offset"||m=="parent")||u&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Iy(m,f)))&&l.push(m);return l}function v3(t,a){return function(s){return t(a(s))}}var _3=v3(Object.keys,Object),y3=Object.prototype,k3=y3.hasOwnProperty;function j3(t){if(!Ry(t))return _3(t);var a=[];for(var s in Object(t))k3.call(t,s)&&s!="constructor"&&a.push(s);return a}function M3(t){return Dy(t)?w3(t):j3(t)}var qa=Gs(Object,"create");function E3(){this.__data__=qa?qa(null):{},this.size=0}function T3(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a}var N3="__lodash_hash_undefined__",C3=Object.prototype,S3=C3.hasOwnProperty;function I3(t){var a=this.__data__;if(qa){var s=a[t];return s===N3?void 0:s}return S3.call(a,t)?a[t]:void 0}var A3=Object.prototype,D3=A3.hasOwnProperty;function O3(t){var a=this.__data__;return qa?a[t]!==void 0:D3.call(a,t)}var R3="__lodash_hash_undefined__";function $3(t,a){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=qa&&a===void 0?R3:a,this}function rs(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}rs.prototype.clear=E3;rs.prototype.delete=T3;rs.prototype.get=I3;rs.prototype.has=O3;rs.prototype.set=$3;function L3(){this.__data__=[],this.size=0}function Bo(t,a){for(var s=t.length;s--;)if(Om(t[s][0],a))return s;return-1}var F3=Array.prototype,z3=F3.splice;function P3(t){var a=this.__data__,s=Bo(a,t);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():z3.call(a,s,1),--this.size,!0}function H3(t){var a=this.__data__,s=Bo(a,t);return s<0?void 0:a[s][1]}function U3(t){return Bo(this.__data__,t)>-1}function B3(t,a){var s=this.__data__,o=Bo(s,t);return o<0?(++this.size,s.push([t,a])):s[o][1]=a,this}function wr(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}wr.prototype.clear=L3;wr.prototype.delete=P3;wr.prototype.get=H3;wr.prototype.has=U3;wr.prototype.set=B3;var Ga=Gs(br,"Map");function W3(){this.size=0,this.__data__={hash:new rs,map:new(Ga||wr),string:new rs}}function Y3(t){var a=typeof t;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?t!=="__proto__":t===null}function Wo(t,a){var s=t.__data__;return Y3(a)?s[typeof a=="string"?"string":"hash"]:s.map}function q3(t){var a=Wo(this,t).delete(t);return this.size-=a?1:0,a}function G3(t){return Wo(this,t).get(t)}function X3(t){return Wo(this,t).has(t)}function Z3(t,a){var s=Wo(this,t),o=s.size;return s.set(t,a),this.size+=s.size==o?0:1,this}function cs(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}cs.prototype.clear=W3;cs.prototype.delete=q3;cs.prototype.get=G3;cs.prototype.has=X3;cs.prototype.set=Z3;function K3(t,a){for(var s=-1,o=a.length,c=t.length;++s<o;)t[c+s]=a[s];return t}function V3(){this.__data__=new wr,this.size=0}function Q3(t){var a=this.__data__,s=a.delete(t);return this.size=a.size,s}function J3(t){return this.__data__.get(t)}function e2(t){return this.__data__.has(t)}var t2=200;function n2(t,a){var s=this.__data__;if(s instanceof wr){var o=s.__data__;if(!Ga||o.length<t2-1)return o.push([t,a]),this.size=++s.size,this;s=this.__data__=new cs(o)}return s.set(t,a),this.size=s.size,this}function Rr(t){var a=this.__data__=new wr(t);this.size=a.size}Rr.prototype.clear=V3;Rr.prototype.delete=Q3;Rr.prototype.get=J3;Rr.prototype.has=e2;Rr.prototype.set=n2;function r2(t,a){for(var s=-1,o=t==null?0:t.length,c=0,u=[];++s<o;){var d=t[s];a(d,s,t)&&(u[c++]=d)}return u}function s2(){return[]}var a2=Object.prototype,i2=a2.propertyIsEnumerable,fh=Object.getOwnPropertySymbols,o2=fh?function(t){return t==null?[]:(t=Object(t),r2(fh(t),function(a){return i2.call(t,a)}))}:s2;function l2(t,a,s){var o=a(t);return Io(t)?o:K3(o,s(t))}function hh(t){return l2(t,M3,o2)}var Tu=Gs(br,"DataView"),Nu=Gs(br,"Promise"),Cu=Gs(br,"Set"),ph="[object Map]",c2="[object Object]",mh="[object Promise]",gh="[object Set]",xh="[object WeakMap]",bh="[object DataView]",u2=ls(Tu),d2=ls(Ga),f2=ls(Nu),h2=ls(Cu),p2=ls(Mu),Dr=Ka;(Tu&&Dr(new Tu(new ArrayBuffer(1)))!=bh||Ga&&Dr(new Ga)!=ph||Nu&&Dr(Nu.resolve())!=mh||Cu&&Dr(new Cu)!=gh||Mu&&Dr(new Mu)!=xh)&&(Dr=function(t){var a=Ka(t),s=a==c2?t.constructor:void 0,o=s?ls(s):"";if(o)switch(o){case u2:return bh;case d2:return ph;case f2:return mh;case h2:return gh;case p2:return xh}return a});var wh=br.Uint8Array,m2="__lodash_hash_undefined__";function g2(t){return this.__data__.set(t,m2),this}function x2(t){return this.__data__.has(t)}function Ao(t){var a=-1,s=t==null?0:t.length;for(this.__data__=new cs;++a<s;)this.add(t[a])}Ao.prototype.add=Ao.prototype.push=g2;Ao.prototype.has=x2;function b2(t,a){for(var s=-1,o=t==null?0:t.length;++s<o;)if(a(t[s],s,t))return!0;return!1}function w2(t,a){return t.has(a)}var v2=1,_2=2;function Pm(t,a,s,o,c,u){var d=s&v2,l=t.length,f=a.length;if(l!=f&&!(d&&f>l))return!1;var m=u.get(t),p=u.get(a);if(m&&p)return m==a&&p==t;var b=-1,w=!0,h=s&_2?new Ao:void 0;for(u.set(t,a),u.set(a,t);++b<l;){var M=t[b],x=a[b];if(o)var j=d?o(x,M,b,a,t,u):o(M,x,b,t,a,u);if(j!==void 0){if(j)continue;w=!1;break}if(h){if(!b2(a,function(_,E){if(!w2(h,E)&&(M===_||c(M,_,s,o,u)))return h.push(E)})){w=!1;break}}else if(!(M===x||c(M,x,s,o,u))){w=!1;break}}return u.delete(t),u.delete(a),w}function y2(t){var a=-1,s=Array(t.size);return t.forEach(function(o,c){s[++a]=[c,o]}),s}function k2(t){var a=-1,s=Array(t.size);return t.forEach(function(o){s[++a]=o}),s}var j2=1,M2=2,E2="[object Boolean]",T2="[object Date]",N2="[object Error]",C2="[object Map]",S2="[object Number]",I2="[object RegExp]",A2="[object Set]",D2="[object String]",O2="[object Symbol]",R2="[object ArrayBuffer]",$2="[object DataView]",vh=Us?Us.prototype:void 0,Yc=vh?vh.valueOf:void 0;function L2(t,a,s,o,c,u,d){switch(s){case $2:if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case R2:return!(t.byteLength!=a.byteLength||!u(new wh(t),new wh(a)));case E2:case T2:case S2:return Om(+t,+a);case N2:return t.name==a.name&&t.message==a.message;case I2:case D2:return t==a+"";case C2:var l=y2;case A2:var f=o&j2;if(l||(l=k2),t.size!=a.size&&!f)return!1;var m=d.get(t);if(m)return m==a;o|=M2,d.set(t,a);var p=Pm(l(t),l(a),o,c,u,d);return d.delete(t),p;case O2:if(Yc)return Yc.call(t)==Yc.call(a)}return!1}var F2=1,z2=Object.prototype,P2=z2.hasOwnProperty;function H2(t,a,s,o,c,u){var d=s&F2,l=hh(t),f=l.length,m=hh(a),p=m.length;if(f!=p&&!d)return!1;for(var b=f;b--;){var w=l[b];if(!(d?w in a:P2.call(a,w)))return!1}var h=u.get(t),M=u.get(a);if(h&&M)return h==a&&M==t;var x=!0;u.set(t,a),u.set(a,t);for(var j=d;++b<f;){w=l[b];var _=t[w],E=a[w];if(o)var C=d?o(E,_,w,a,t,u):o(_,E,w,t,a,u);if(!(C===void 0?_===E||c(_,E,s,o,u):C)){x=!1;break}j||(j=w=="constructor")}if(x&&!j){var A=t.constructor,D=a.constructor;A!=D&&"constructor"in t&&"constructor"in a&&!(typeof A=="function"&&A instanceof A&&typeof D=="function"&&D instanceof D)&&(x=!1)}return u.delete(t),u.delete(a),x}var U2=1,_h="[object Arguments]",yh="[object Array]",wo="[object Object]",B2=Object.prototype,kh=B2.hasOwnProperty;function W2(t,a,s,o,c,u){var d=Io(t),l=Io(a),f=d?yh:Dr(t),m=l?yh:Dr(a);f=f==_h?wo:f,m=m==_h?wo:m;var p=f==wo,b=m==wo,w=f==m;if(w&&Eu(t)){if(!Eu(a))return!1;d=!0,p=!1}if(w&&!p)return u||(u=new Rr),d||zm(t)?Pm(t,a,s,o,c,u):L2(t,a,f,s,o,c,u);if(!(s&U2)){var h=p&&kh.call(t,"__wrapped__"),M=b&&kh.call(a,"__wrapped__");if(h||M){var x=h?t.value():t,j=M?a.value():a;return u||(u=new Rr),c(x,j,s,o,u)}}return w?(u||(u=new Rr),H2(t,a,s,o,c,u)):!1}function Hm(t,a,s,o,c){return t===a?!0:t==null||a==null||!Ya(t)&&!Ya(a)?t!==t&&a!==a:W2(t,a,s,o,Hm,c)}function Y2(t,a){return Hm(t,a)}const jh=({className:t,children:a,colSpan:s,sticky:o=!1,...c})=>{const u=Oe("py-2! pr-6! pl-0! text-left align-top",o&&"sticky top-0 bg-white",c.onClick&&"hover:cursor-pointer",t);return n.jsx("th",{className:u,colSpan:s,...c,children:n.jsx(Et,{className:"whitespace-nowrap",level:6,children:a})})},Um=({left:t,center:a,right:s,sticky:o=!0,containerClassName:c,children:u})=>{const d=Oe("z-50 h-22 min-h-[92px] p-8",!u&&"flex items-center justify-between gap-3",o&&"sticky top-0",c);if(!u){if(t){const l=Oe("flex flex-auto items-center",s&&a&&"basis-1/3",!s&&a&&"basis-1/2");t=n.jsx("div",{className:l,children:t})}if(a){const l=Oe("flex flex-auto items-center justify-center",t&&s&&"basis-1/3",(t&&!s||!t&&s)&&"basis-1/2");a=n.jsx("div",{className:l,children:a})}if(s){const l=Oe("flex flex-auto items-center justify-end",t&&a&&"basis-1/3",!t&&a&&"basis-1/2");s=n.jsx("div",{className:l,children:s})}}return n.jsx("div",{className:d,children:u||n.jsxs(n.Fragment,{children:[t,a,s]})})},Bm=({items:t,setItems:a,blank:s,canAddNewItem:o})=>{const[c,u]=B.useState(t.map((w,h)=>({item:w,id:h.toString()}))),[d,l]=B.useState(s);return B.useEffect(()=>{const w=c.map(({item:h})=>h);o(d)&&w.push(d),Y2(JSON.parse(JSON.stringify(w)),JSON.parse(JSON.stringify(t)))||a(w)},[c,d,t,a,o]),{items:c,updateItem:(w,h)=>{const M=c.map(x=>x.id===w?{...x,item:h}:x);u(M),a(M.map(x=>x.item))},addItem:()=>{if(o(d)){const w=c.reduce((M,x)=>Math.max(M,parseInt(x.id)),0),h=c.concat({item:d,id:(w+1).toString()});u(h),a(h.map(M=>M.item)),l(s)}},removeItem:w=>{const h=c.filter(M=>M.id!==w);u(h),a(h.map(M=>M.item))},moveItem:(w,h)=>{if(w!==h){const M=c.findIndex(_=>_.id===w),x=h?c.findIndex(_=>_.id===h):0,j=I1(c,M,x);u(j),a(j.map(_=>_.item))}},newItem:d,setNewItem:l}},q2=({label:t,text:a="",hint:s,onRegenerate:o})=>{const[c,u]=B.useState(!1),d=()=>{navigator.clipboard.writeText(a),u(!0),setTimeout(()=>u(!1),2e3)},l=Oe("group/api-keys relative -mt-1 mb-1 w-full overflow-hidden border-b border-transparent py-2 hover:border-grey-300 dark:hover:border-grey-600");return n.jsxs("div",{className:"mb-3 grid grid-cols-1",children:[t&&n.jsx(Et,{level:6,grey:!0,children:t}),n.jsxs("div",{className:l,children:[n.jsx("span",{children:a}),s,n.jsxs("div",{className:"visible absolute top-1/2 right-0 flex translate-y-[-50%] gap-1 bg-white pl-1 text-sm group-hover/api-keys:visible md:invisible dark:bg-black",children:[o&&n.jsx(Ke,{color:"outline",label:"Regenerate",size:"sm",onClick:o}),n.jsx(Ke,{color:"outline",label:c?"Copied":"Copy",size:"sm",onClick:d})]})]})]})},Va=({keys:t})=>n.jsx("div",{"data-testid":"api-keys",children:t.map(a=>n.jsx(q2,{...a},a.label))}),us=({icon:t,title:a,detail:s,extra:o})=>n.jsxs("div",{className:"-mx-8 -mt-8 flex flex-col gap-4 bg-grey-75 p-8 md:flex-row dark:bg-grey-950",children:[n.jsx("div",{className:"size-14",children:t}),n.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-1 flex-col",children:[n.jsx("h3",{children:a}),n.jsx("div",{children:s}),o&&n.jsx("div",{className:"mt-4",children:o})]})]}),G2=""+new URL("zapier-logo-D8a11oW_.svg",import.meta.url).href,Ku=ss({method:"POST",path:({integrationId:t,apiKeyId:a})=>`/integrations/${t}/api_key/${a}/refresh/`,body:({integrationId:t})=>({integrations:[{id:t}]}),updateQueries:{emberUpdateType:"createOrUpdate",dataType:Fo,update:(t,a)=>a&&{...a,integrations:a.integrations.map(s=>t.integrations.find(({id:c})=>c===s.id)||s)}}}),X2=Ae.create(()=>{const t=Ae.useModal(),{updateRoute:a}=rt(),{zapierTemplates:s}=A1(),{data:{integrations:o}={integrations:[]}}=zo(),{config:c}=lt(),{mutateAsync:u}=Ku(),d=pt(),[l,f]=B.useState(!1),m=c.hostSettings?.limits?.customIntegrations?.disabled,p=o.find(({slug:h})=>h==="zapier"),b=p?.api_keys?.find(h=>h.type==="admin");B.useEffect(()=>{m&&a("integrations")},[m,a]);const w=()=>{!p||!b||(f(!1),Ae.show(Dt,{title:"Regenerate Admin API Key",prompt:'You will need to locate the Ghost App within your Zapier account and click on "Reconnect" to enter the new Admin API Key.',okLabel:"Regenerate Admin API Key",onOk:async h=>{try{await u({integrationId:p.id,apiKeyId:b.id}),f(!0),h?.remove()}catch(M){d(M)}}}))};return n.jsxs(yt,{afterClose:()=>{a("integrations")},cancelLabel:"",footer:n.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[n.jsxs("a",{className:"mt-1 self-baseline text-sm font-bold",href:"https://zapier.com/apps/ghost/integrations?utm_medium=partner_api&utm_source=widget&utm_campaign=Widget",rel:"noopener noreferrer",target:"_blank",children:["View more Ghost integrations powered by ",n.jsx("span",{children:n.jsx("img",{alt:"Zapier",className:"relative top-[-2px] inline-block",src:G2})})]}),n.jsx(Ke,{color:"black",label:"Close",onClick:()=>{t.remove()}})]}),okColor:"black",okLabel:"Close",testId:"zapier-modal",title:"",stickyFooter:!0,onOk:()=>{a("integrations"),t.remove()},children:[n.jsx(us,{detail:"Automation for your favorite apps",extra:n.jsx("div",{className:"mt-1 -mb-4",children:n.jsx(Va,{keys:[{label:"Admin API key",text:b?.secret,hint:l?n.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:w},{label:"API URL",text:window.location.origin+$r().subdir}]})}),icon:n.jsx(dt,{name:"zapier",size:56}),title:"Zapier"}),n.jsx(pr,{children:s.map(h=>n.jsx(Pr,{action:n.jsx(Ke,{className:"text-sm font-semibold whitespace-nowrap text-[#FF4A00]",href:h.url,label:"Use this Zap",tag:"a",target:"_blank",link:!0,unstyled:!0}),bgOnHover:!1,className:"flex items-center gap-3 py-2 pl-3",title:n.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[n.jsxs("div",{className:"flex shrink-0 flex-nowrap items-center gap-2",children:[n.jsx("img",{className:"size-8 object-contain dark:invert",role:"presentation",src:h.ghostImage}),n.jsx(dt,{name:"arrow-right",size:"xs"}),n.jsx("img",{className:"size-8 object-contain",role:"presentation",src:h.appImage})]}),n.jsx("span",{className:"text-sm",children:h.title})]}),hideActions:!0}))})]})}),Z2=({tier:t})=>{const a=t?.type==="free",{updateRoute:s}=rt(),{mutateAsync:o}=Wu(),{mutateAsync:c}=w_(),{mutateAsync:u}=zr(),[d,l]=xt.useState(!!t?.trial_days),f=pt(),{localSettings:m,siteData:p}=as(),[b]=jt(m,["portal_plans"]),w=JSON.parse(b?.toString()||"[]"),h={name:()=>M.name?void 0:"Enter a name for the tier",monthly_price:()=>M.type!=="free"?Xf(M.monthly_price||0,M.currency,{allowZero:!1}):void 0,yearly_price:()=>M.type!=="free"?Xf(M.yearly_price||0,M.currency,{allowZero:!1}):void 0},{formState:M,saveState:x,updateForm:j,handleSave:_,errors:E,clearError:C,okProps:A}=gn({initialState:{...t||{},trial_days:t?.trial_days?.toString()||"",currency:t?.currency||D1[0].isoCode,visibility:t?.visibility||"none",welcome_page_url:t?.welcome_page_url||null},savingDelay:500,savedDelay:500,onValidate:()=>{const U={};return Object.entries(h).forEach(([K,$])=>{U[K]=$?.()}),U},onSave:async()=>{const{trial_days:U,currency:K,...$}=M,Q=$;if(Q.benefits=Q.benefits?.filter(N=>N),a||(Q.currency=K,Q.trial_days=parseInt(U)),t?.id?await o({...t,...Q}):await c(Q),a){const N=M.visibility==="public";let W=!1;w.includes("free")&&!N&&(w.splice(w.indexOf("free"),1),W=!0),!w.includes("free")&&N&&(w.push("free"),W=!0),W&&await u([{key:"portal_plans",value:JSON.stringify(w)}])}},onSaveError:f}),D=Bm({items:M.benefits||[],setItems:U=>j(K=>({...K,benefits:U})),blank:"",canAddNewItem:U=>!!U}),F=U=>{U.target.checked?(l(!0),j(K=>({...K,trial_days:t?.trial_days?t?.trial_days.toString():"7"}))):(l(!1),j(K=>({...K,trial_days:"0"})))},O=B.useRef(!1);B.useEffect(()=>{O.current&&(h.monthly_price?.(),h.yearly_price?.()),O.current=!0},[M.currency]);const q=()=>{if(t){const U=t.active?"Archive tier":"Reactivate tier",K=t.active?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-6",children:["Members will no longer be able to subscribe to ",n.jsx("strong",{children:t.name})," and it will be removed from the list of available tiers in portal."]}),n.jsx("div",{children:"Existing members on this tier will remain unchanged. Offers using this tier will be disabled."})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-6",children:["Reactivating ",n.jsx("strong",{children:t.name})," will re-enable it as an option in portal and allow new members to subscribe to this tier."]}),n.jsx("div",{children:"Existing members will remain unchanged."})]}),$=t.active?"Archive":"Reactivate";Ae.show(Dt,{title:U,prompt:K,okLabel:$,cancelLabel:"Cancel",okColor:t.active?"red":"black",onOk:Q=>{o({...t,active:!t.active}),Q?.remove(),et({type:"success",title:`Tier ${t.active?"archived":"reactivated"}`})}})}};let P={};return t&&(t.active&&t.type!=="free"?P={label:"Archive tier",color:"red",link:!0,onClick:q}:t.active||(P={label:"Reactivate tier",color:"green",link:!0,onClick:q})),n.jsx(yt,{afterClose:()=>{s("tiers")},buttonsDisabled:A.disabled,cancelLabel:"Close",dirty:x==="unsaved",leftButtonProps:P,okColor:A.color,okLabel:A.label||"Save",size:"lg",testId:"tier-detail-modal",title:t?t.active?"Edit tier":"Edit archived tier":"New tier",stickyFooter:!0,onOk:async()=>{await _({fakeWhenUnchanged:!0})},children:n.jsxs("div",{className:"mt-8 -mb-8 flex items-start gap-8",children:[n.jsxs("div",{className:"flex grow flex-col gap-8",children:[n.jsxs(ut,{marginBottom:!1,title:"Basic",grouped:!0,children:[n.jsx(He,{autoComplete:"off",error:!!E.name,hint:E.name,maxLength:191,placeholder:a?"Free":"Bronze",title:"Name",value:M.name||"",autoFocus:!0,onChange:U=>j(K=>({...K,name:U.target.value})),onKeyDown:()=>C("name")}),n.jsx(He,{autoComplete:"off",autoFocus:a,maxLength:191,placeholder:a?"Free preview":"Full access to premium content",title:"Description",value:M.description||"",onChange:U=>j(K=>({...K,description:U.target.value}))}),!a&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"flex flex-col gap-10 md:flex-row",children:[n.jsxs("div",{className:"basis-1/2",children:[n.jsxs("div",{className:"mb-1 flex h-6 items-center justify-between",children:[n.jsx(Et,{level:6,children:"Prices"}),n.jsx("div",{className:"-mr-2 w-[50px]",children:n.jsx(Ht,{border:!1,containerClassName:"font-medium",controlClasses:{menu:"w-18"},options:qf(),selectedOption:qf().flatMap(U=>U.options).find(U=>U.value===M.currency),size:"xs",clearBg:!0,isSearchable:!0,onSelect:U=>j(K=>({...K,currency:U?.value}))})})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(Gf,{error:!!E.monthly_price,hint:E.monthly_price,placeholder:"5",rightPlaceholder:`${M.currency}/month`,title:"Monthly price",valueInCents:M.monthly_price||"",hideTitle:!0,onBlur:U=>U.target.value===""?j(K=>({...K,monthly_price:0})):null,onChange:U=>j(K=>({...K,monthly_price:U})),onKeyDown:()=>C("monthly_price")}),n.jsx(Gf,{error:!!E.yearly_price,hint:E.yearly_price,placeholder:"50",rightPlaceholder:`${M.currency}/year`,title:"Yearly price",valueInCents:M.yearly_price||"",hideTitle:!0,onBlur:U=>U.target.value===""?j(K=>({...K,yearly_price:0})):null,onChange:U=>j(K=>({...K,yearly_price:U})),onKeyDown:()=>C("yearly_price")})]})]}),n.jsxs("div",{className:"basis-1/2",children:[n.jsx("div",{className:"mb-1 flex h-6 flex-col justify-center",children:n.jsx(ot,{checked:d,label:"Add a free trial",labelStyle:"heading",onChange:F})}),n.jsx(He,{disabled:!d,hint:n.jsxs("div",{className:"mt-1",children:["Members will be subscribed at full price once the trial ends. ",n.jsx("a",{className:"text-green",href:"https://ghost.org/help/free-trials/",rel:"noreferrer",target:"_blank",children:"Learn more"})]}),placeholder:"0",rightPlaceholder:"days",title:"Trial days",value:M.trial_days,hideTitle:!0,onChange:U=>j(K=>({...K,trial_days:U.target.value.replace(/[^\d]/,"")}))})]})]})}),n.jsx(Yp,{baseUrl:p?.url,hint:`Redirect to this URL after signup ${a?"":" for premium membership"}`,maxLength:2e3,placeholder:p?.url,title:"Welcome page",value:M.welcome_page_url||null,nullable:!0,transformPathWithoutSlash:!0,onChange:U=>j(K=>({...K,welcome_page_url:U||null}))})]}),n.jsxs(ut,{gap:"none",title:"Benefits",grouped:!0,children:[n.jsx("div",{className:"-mt-3",children:n.jsx(qp,{items:D.items,itemSeparator:!1,renderItem:({id:U,item:K})=>n.jsxs("div",{className:"relative flex w-full items-center gap-5",children:[n.jsx("div",{className:"absolute top-[7px] left-[-32px] flex size-6 items-center justify-center bg-white group-hover:hidden dark:bg-black",children:n.jsx(dt,{name:"check",size:"sm"})}),n.jsx(He,{maxLength:191,value:K,onChange:$=>D.updateItem(U,$.target.value)}),n.jsx(Ke,{className:"absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100",color:"grey",icon:"trash",size:"sm",onClick:()=>D.removeItem(U)})]}),onMove:D.moveItem})}),n.jsxs("div",{className:"relative mt-1 flex items-center gap-3",children:[n.jsx(dt,{className:"dark:text-white",name:"check",size:"sm"}),n.jsx(He,{className:"grow",containerClassName:"w-100",maxLength:191,placeholder:"Expert analysis",title:"New benefit",value:D.newItem,hideTitle:!0,onChange:U=>D.setNewItem(U.target.value),onKeyDown:U=>{U.key==="Enter"&&D.addItem()}}),n.jsx(Ke,{className:"absolute top-[5px] right-[5px] z-10",color:"green",icon:"add",iconColorClass:"text-white",label:"Add",size:"sm",hideLabel:!0,onClick:()=>D.addItem()})]})]})]}),n.jsx("div",{className:"sticky top-[96px] hidden shrink-0 basis-[380px] min-[920px]:!visible min-[920px]:!block",children:n.jsx(O1,{isFreeTier:a,tier:M})})]})})},K2=({params:t})=>{const{data:{tiers:a,isEnd:s}={},fetchNextPage:o}=is();let c;return B.useEffect(()=>{t?.id&&!c&&!s&&o()},[o,s,t?.id,c]),t?.id&&(c=a?.find(({id:u})=>u===t?.id),!c)?null:n.jsx(Z2,{tier:c})},V2=Ae.create(K2);var qc,Mh;function Wm(){if(Mh)return qc;Mh=1;var t={};return qc=typeof process=="object"&&t&&t.NODE_DEBUG&&/\bsemver\b/i.test(t.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{},qc}var Gc,Eh;function Ym(){if(Eh)return Gc;Eh=1;const t="2.0.0",a=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=a-6;return Gc={MAX_LENGTH:a,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:s,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Gc}var vo={exports:{}},Th;function Q2(){return Th||(Th=1,(function(t,a){const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=Ym(),u=Wm();a=t.exports={};const d=a.re=[],l=a.safeRe=[],f=a.src=[],m=a.safeSrc=[],p=a.t={};let b=0;const w="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",c],[w,o]],M=j=>{for(const[_,E]of h)j=j.split(`${_}*`).join(`${_}{0,${E}}`).split(`${_}+`).join(`${_}{1,${E}}`);return j},x=(j,_,E)=>{const C=M(_),A=b++;u(j,A,_),p[j]=A,f[A]=_,m[A]=C,d[A]=new RegExp(_,E?"g":void 0),l[A]=new RegExp(C,E?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),x("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${w}+`),x("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),x("FULL",`^${f[p.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),x("LOOSE",`^${f[p.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),x("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),x("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),x("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),x("COERCERTL",f[p.COERCE],!0),x("COERCERTLFULL",f[p.COERCEFULL],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",x("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",x("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vo,vo.exports)),vo.exports}var Xc,Nh;function J2(){if(Nh)return Xc;Nh=1;const t=Object.freeze({loose:!0}),a=Object.freeze({});return Xc=o=>o?typeof o!="object"?t:o:a,Xc}var Zc,Ch;function ek(){if(Ch)return Zc;Ch=1;const t=/^[0-9]+$/,a=(o,c)=>{if(typeof o=="number"&&typeof c=="number")return o===c?0:o<c?-1:1;const u=t.test(o),d=t.test(c);return u&&d&&(o=+o,c=+c),o===c?0:u&&!d?-1:d&&!u?1:o<c?-1:1};return Zc={compareIdentifiers:a,rcompareIdentifiers:(o,c)=>a(c,o)},Zc}var Kc,Sh;function tk(){if(Sh)return Kc;Sh=1;const t=Wm(),{MAX_LENGTH:a,MAX_SAFE_INTEGER:s}=Ym(),{safeRe:o,t:c}=Q2(),u=J2(),{compareIdentifiers:d}=ek();class l{constructor(m,p){if(p=u(p),m instanceof l){if(m.loose===!!p.loose&&m.includePrerelease===!!p.includePrerelease)return m;m=m.version}else if(typeof m!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof m}".`);if(m.length>a)throw new TypeError(`version is longer than ${a} characters`);t("SemVer",m,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const b=m.trim().match(p.loose?o[c.LOOSE]:o[c.FULL]);if(!b)throw new TypeError(`Invalid Version: ${m}`);if(this.raw=m,this.major=+b[1],this.minor=+b[2],this.patch=+b[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");b[4]?this.prerelease=b[4].split(".").map(w=>{if(/^[0-9]+$/.test(w)){const h=+w;if(h>=0&&h<s)return h}return w}):this.prerelease=[],this.build=b[5]?b[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(m){if(t("SemVer.compare",this.version,this.options,m),!(m instanceof l)){if(typeof m=="string"&&m===this.version)return 0;m=new l(m,this.options)}return m.version===this.version?0:this.compareMain(m)||this.comparePre(m)}compareMain(m){return m instanceof l||(m=new l(m,this.options)),this.major<m.major?-1:this.major>m.major?1:this.minor<m.minor?-1:this.minor>m.minor?1:this.patch<m.patch?-1:this.patch>m.patch?1:0}comparePre(m){if(m instanceof l||(m=new l(m,this.options)),this.prerelease.length&&!m.prerelease.length)return-1;if(!this.prerelease.length&&m.prerelease.length)return 1;if(!this.prerelease.length&&!m.prerelease.length)return 0;let p=0;do{const b=this.prerelease[p],w=m.prerelease[p];if(t("prerelease compare",p,b,w),b===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(b===void 0)return-1;if(b===w)continue;return d(b,w)}while(++p)}compareBuild(m){m instanceof l||(m=new l(m,this.options));let p=0;do{const b=this.build[p],w=m.build[p];if(t("build compare",p,b,w),b===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(b===void 0)return-1;if(b===w)continue;return d(b,w)}while(++p)}inc(m,p,b){if(m.startsWith("pre")){if(!p&&b===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const w=`-${p}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!w||w[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(m){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,b),this.inc("pre",p,b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,b),this.inc("pre",p,b);break;case"release":if(this.prerelease.length===0)throw new 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":{const w=Number(b)?1:0;if(this.prerelease.length===0)this.prerelease=[w];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(p===this.prerelease.join(".")&&b===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(w)}}if(p){let h=[p,w];b===!1&&(h=[p]),d(this.prerelease[0],p)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${m}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Kc=l,Kc}var Vc,Ih;function nk(){if(Ih)return Vc;Ih=1;const t=tk();return Vc=(s,o,c=!1)=>{if(s instanceof t)return s;try{return new t(s,o)}catch(u){if(!c)return null;throw u}},Vc}var rk=nk();const sk=Lu(rk);function ak(t){if(!t)return"";const a=t.indexOf("+"),s=a!==-1?t.slice(a+1):"",o=a!==-1?t.slice(0,a):t;if(s&&s!=="moya"){const c=s.split("."),u=c[c.length-1];if(u&&/^[0-9a-f]{7,40}$/.test(u))return`https://github.com/TryGhost/Ghost/commit/${u}`}try{const u=sk(o,{includePrerelease:!0})?.prerelease;if(u&&u.length>0){const l=String(u[0]).split("-")[1];return l?.startsWith("g")?`https://github.com/TryGhost/Ghost/commit/${l.slice(1)}`:""}}catch{return""}return`https://github.com/TryGhost/Ghost/releases/tag/v${o}`}function ik(t,a){const s=!!t.match?.(/production/i);return!!(s&&a!=="mysql8"||!s&&a==="mysql5")}function ok({label:t,version:a}){const s=ak(a);return n.jsxs("div",{children:[n.jsxs("strong",{children:[t,":"]})," ",s?n.jsx("a",{className:"text-green",href:s,rel:"noopener noreferrer",target:"_blank",children:a}):a]})}const lk=Ae.create(({})=>{const{updateRoute:t}=rt();let s=lt().config;const o=R1();function c(){return new Date().getFullYear()}function u(){return!!s.enableDeveloperExperiments}function d(){return!s.hostSettings?.siteId}return n.jsx(yt,{afterClose:()=>{t("")},cancelLabel:"",footer:n.jsx(n.Fragment,{}),topRightContent:"close",width:540,children:n.jsxs("div",{className:"flex flex-col gap-4 pb-7 text-sm",children:[n.jsx($1,{className:"h-auto w-[120px] dark:invert"}),n.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[o?.message&&n.jsxs("div",{className:"gh-prose-links mb-4 rounded-sm border border-green p-5",children:[n.jsx("strong",{children:"Update available!"}),n.jsx("div",{dangerouslySetInnerHTML:{__html:o.message}})]}),n.jsx(ok,{label:"Version",version:s.version}),d()&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("strong",{children:"Environment:"})," ",s.environment]}),n.jsxs("div",{children:[n.jsx("strong",{children:"Database:"})," ",s.database]}),n.jsxs("div",{children:[n.jsx("strong",{children:"Mail:"})," ",s.mail?s.mail:"Native"]})]}),u()&&n.jsxs("div",{children:[n.jsx("strong",{children:"Developer experiments:"})," Enabled"]}),d()&&ik(s.environment,s.database)&&n.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["You are running an unsupported database in production. Please ",n.jsx("a",{href:"https://ghost.org/docs/faq/supported-databases/",rel:"noopener noreferrer",target:"_blank",children:"upgrade to MySQL 8"}),"."]})]}),n.jsx(Hs,{}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.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:[n.jsx(dt,{name:"book-open",size:"sm"})," User documentation"]}),n.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:[n.jsx(dt,{name:"question-circle",size:"sm"})," Get help with Ghost"]}),n.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:[n.jsx(dt,{name:"angle-brackets",size:"sm"})," Get involved"]})]}),n.jsx(Hs,{}),n.jsxs("p",{className:"max-w-[460px] text-xs",children:["Copyright © 2013 – ",c()," Ghost Foundation, released under the ",n.jsx("a",{className:"text-green",href:"https://github.com/TryGhost/Ghost/blob/main/LICENSE",rel:"noopener noreferrer",target:"_blank",children:"MIT license"}),". ",n.jsx("a",{className:"text-green",href:"https://ghost.org/",rel:"noopener noreferrer",target:"_blank",children:"Ghost"})," is a registered trademark of ",n.jsx("a",{className:"text-green",href:"https://ghost.org/trademark/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Foundation Ltd"}),"."]})]})})}),ck=()=>{const t=Wt(),{updateRoute:a}=rt(),[s,o]=B.useState(""),[c,u]=B.useState({name:""}),{mutateAsync:d}=L1(),l=Bs(),f=pt();return B.useEffect(()=>{l?.isLimited("customIntegrations")&&l.errorIfWouldGoOverLimit("customIntegrations").catch(m=>{m instanceof Ws&&(Ae.show(gr,{prompt:m.message||"Your current plan doesn't support more custom integrations.",onOk:()=>a({route:"/pro",isExternal:!0})}),t.remove(),a("integrations"))})},[l,t,a]),n.jsx(yt,{afterClose:()=>{a("integrations")},okColor:"black",okLabel:"Add",size:"sm",testId:"add-integration-modal",title:"Add integration",onOk:async()=>{if(!s){u({name:"Name is required"});return}try{const m=await d({name:s});t.remove(),a({route:`integrations/${m.integrations[0].id}`})}catch(m){f(m)}},children:n.jsx("div",{className:"mt-5",children:n.jsx(ut,{marginBottom:!1,marginTop:!1,children:n.jsx(He,{autoFocus:!0,error:!!c.name,hint:c.name,maxLength:191,placeholder:"Custom integration",title:"Name",value:s,onChange:m=>o(m.target.value),onInput:()=>{c.name&&u({name:""})}})})})})},uk=Ae.create(ck),dk=()=>{const t=Wt(),{updateRoute:a}=rt(),s=pt(),[o,c]=B.useState(!0),[u,d]=B.useState(null),{data:l}=zp({searchParams:{filter:"newsletters.status:active+email_disabled:0",limit:"1",page:"1",include:"newsletters,labels"}}),{mutateAsync:f}=i_(),{formState:m,updateForm:p,saveState:b,handleSave:w,errors:h,clearError:M}=gn({initialState:{name:"",description:"",optInExistingSubscribers:!0},onSave:async()=>{const _=await f({name:m.name,description:m.description,opt_in_existing:m.optInExistingSubscribers,feedback_enabled:!0});a({route:`newsletters/${_.newsletters[0].id}`})},onSaveError:s,onValidate:()=>{const _={};return m.name||(_.name="A name is required for your newsletter"),_}}),x=Bs();B.useEffect(()=>{if(!x){c(!1);return}x.errorIfWouldGoOverLimit("newsletters").catch(_=>{if(_ instanceof Ws)d(_);else throw _}).finally(()=>{c(!1)})},[x]);const j=l?.meta?.pagination.total;return B.useEffect(()=>{u&&(Ae.show(gr,{prompt:u.message||"Your current plan doesn't support more newsletters.",onOk:()=>a({route:"/pro",isExternal:!0})}),t.remove(),a("newsletters"))},[u,t,a]),o||u?null:n.jsx(yt,{afterClose:()=>{a("newsletters")},backDropClick:!1,okColor:"black",okDisabled:b==="saving",okLabel:"Create",okLoading:b==="saving",size:"sm",testId:"add-newsletter-modal",title:"Create newsletter",onOk:async()=>{await w()&&t.remove()},children:n.jsxs(ut,{marginBottom:!1,marginTop:!0,children:[n.jsx(He,{autoFocus:!0,error:!!h.name,hint:h.name,maxLength:191,placeholder:"Weekly roundup",title:"Name",value:m.name,onChange:_=>p(E=>({...E,name:_.target.value})),onKeyDown:()=>M("name")}),n.jsx(xr,{maxLength:2e3,title:"Description",value:m.description,onChange:_=>p(E=>({...E,description:_.target.value}))}),n.jsx(ot,{checked:m.optInExistingSubscribers,direction:"rtl",hint:m.optInExistingSubscribers?`This newsletter will be available to all members. Your ${j===void 0?"":La(j)} existing subscriber${l?.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:_=>p(E=>({...E,optInExistingSubscribers:_.target.checked}))})]})})},fk=Ae.create(dk),hk=Ae.create(()=>{const t=Ae.useModal(),{updateRoute:a}=rt(),{data:{integrations:s}={integrations:[]}}=zo(),c=s.find(({slug:u})=>u==="ghost-core-content")?.api_keys?.find(u=>u.type==="content");return n.jsxs(yt,{afterClose:()=>{a("integrations")},cancelLabel:"",footer:n.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[n.jsx(Ke,{color:"outline",href:"https://ghost.org/docs/content-api/",label:n.jsxs("span",{className:"flex items-center gap-1",children:["Open docs ",n.jsx(dt,{name:"arrow-top-right",size:"xs"})]}),rel:"noopener noreferrer",tag:"a",target:"_blank"}),n.jsx(Ke,{color:"black",label:"Close",onClick:()=>{a("integrations"),t.remove()}})]}),testId:"content-api-modal",title:"",stickyFooter:!0,children:[n.jsx(us,{detail:"Access your content programmatically",icon:n.jsx(dt,{name:"angle-brackets",size:56}),title:"Content API"}),n.jsxs("div",{className:"mt-7",children:[n.jsx("p",{className:"mb-6 text-sm text-grey-700",children:"This key provides read-only access to your published content. For full read/write access, create a custom integration."}),n.jsx(Va,{keys:[{label:"Content API key",text:c?.secret},{label:"API URL",text:window.location.origin+$r().subdir}]})]})]})}),pk=({recommendation:t,animate:a})=>{const s=Wt(),{updateRoute:o,route:c}=rt(),{mutateAsync:u}=F1(),d=pt(),{formState:l,updateForm:f,handleSave:m,saveState:p,errors:b,clearError:w,setErrors:h}=gn({initialState:{...t},onSave:async _=>{await u(_),s.remove(),et({title:"Recommendation added",type:"success"}),P1("Recommendation Added",{oneClickSubscribe:_.one_click_subscribe}),o("recommendations")},onSaveError:d,onValidate:_=>z1(_)});let M="Add",x=!1;p==="saving"?x=!0:p==="saved"&&(M="Added");let j={label:"Back",icon:"arrow-left",iconColorClass:"text-black dark:text-white",link:!0,size:"sm",onClick:()=>{p!=="saving"&&(s.remove(),Ae.show(qm,{pathName:c,animate:!1,recommendation:{...l}}))}};return n.jsx(yt,{afterClose:()=>{o("recommendations")},animate:a??!0,backDropClick:!1,cancelLabel:"Cancel",dirty:!0,leftButtonProps:j,okColor:"black",okLabel:M,okLoading:x,size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",stickyFooter:!0,onCancel:()=>{p!=="saving"&&(s.remove(),o("recommendations"))},onOk:async()=>{if(p!=="saving"){Pp();try{await m({force:!0})}catch{et({type:"error",title:"Something went wrong when adding this recommendation, please try again."})}}},children:n.jsx(H1,{clearError:w,errors:b,formState:l,setErrors:h,showURL:!1,updateForm:f})})},mk=Ae.create(pk),Ah=t=>No(t).save||"",gk=function(t,a){try{new URL(a).hostname.includes(".")?delete t.url:t.url="Enter a valid URL"}catch{t.url="Enter a valid URL"}return t},xk=({searchParams:t,recommendation:a,animate:s})=>{const[o,c]=B.useState(!1),u=Wt(),{updateRoute:d}=rt(),{mutateAsync:l}=U1(),f=a?"":t?.get("url")??"",{save:m}=f?No(f):{save:""},p=xt.useRef(!1),[b,w]=xt.useState(!!m),{formState:h,updateForm:M,handleSave:x,errors:j,saveState:_,clearError:E}=gn({initialState:a??{title:"",url:m||"",description:"",excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let A;A=new URL(h.url);const D=A.hostname.replace("www.",""),F={...h,url:A.toString()},{recommendations:O=[]}=await l(A);if(!O||O.length===0)return;const q=O[0];if(q.id)throw new Uf("A recommendation with this URL already exists.");F.title=q.title??D,F.excerpt=q.excerpt??F.excerpt,F.featured_image=q.featured_image??F.featured_image??null,F.favicon=q.favicon??F.favicon??null,F.one_click_subscribe=q.one_click_subscribe??F.one_click_subscribe??!1,F.description=F.excerpt||null,u.remove(),Ae.show(mk,{animate:!1,recommendation:F})},onValidate:()=>{const A={};return gk(A,h.url),b&&w(Object.keys(A).length===0),A}}),C=xt.useCallback(async()=>{if(_!=="saving"){Pp();try{if(await x({force:!0}))return}catch(A){const D=A instanceof Uf?A.message:"Something went wrong while checking this URL, please try again.";et({type:"error",title:D})}b&&w(!1)}},[x,_,b,w]);return xt.useEffect(()=>{b&&!p.current&&(p.current=!0,C())},[b,C]),B.useEffect(()=>{o&&(C(),c(!1))},[h]),b?n.jsx(yt,{afterClose:()=>{d("recommendations")},animate:s??!0,backDropClick:!1,footer:!1,header:!1,size:"sm",children:n.jsx("div",{className:"flex flex-col items-center justify-center p-8",children:n.jsx(Co,{})})}):n.jsxs(yt,{afterClose:()=>{d("recommendations")},animate:s??!0,backDropClick:!1,okColor:"black",okLabel:"Next",okLoading:_==="saving",size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",onOk:C,children:[n.jsxs("p",{className:"mt-4",children:["You can recommend ",n.jsx("strong",{children:"any site"})," your audience will find valuable, not just those published on Ghost."]}),n.jsx(ut,{marginBottom:!1,marginTop:!0,children:n.jsx(He,{autoFocus:!0,error:!!j.url,hint:j.url||n.jsxs(n.Fragment,{children:["Need inspiration? ",n.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:h.url,onBlur:()=>{const A=Ah(h.url);M(D=>({...D,url:A}))},onChange:A=>{E?.("url"),M(D=>({...D,url:A.target.value}))},onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),M(D=>({...D,url:Ah(h.url)})),c(!0))}})})]})},qm=Ae.create(xk);function bk(t,a){let s;return function(...c){const u=()=>{clearTimeout(s),t(...c)};clearTimeout(s),s=setTimeout(u,a)}}const Vu=({generateContent:t,className:a,height:s,width:o,parentClassName:c,testId:u,addDelay:d=!1})=>{const[l,f]=B.useState(0),m=[B.useRef(null),B.useRef(null)],[p,b]=B.useState(0);return B.useEffect(()=>{const w=l===0?1:0,h=m[w].current;if(h){t(h);const M=()=>{d?setTimeout(()=>{f(w)},500):f(w)};return h.addEventListener("load",M),()=>{h.removeEventListener("load",M)}}},[t]),B.useEffect(()=>{const w=m[l].current,h=bk(()=>{b(w?.contentWindow?.scrollY||0)},250);return w?.contentWindow?.addEventListener("scroll",h),()=>{w?.contentWindow?.removeEventListener("scroll",h)}},[l,m]),B.useEffect(()=>{const w=m[l].current;if(w)try{w.contentWindow?.scrollTo(0,p)}catch(h){Xv(h)}},[p,l,m]),n.jsxs("div",{className:c,"data-testid":u,children:[n.jsx("iframe",{ref:m[0],className:`${a} ${l!==0?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":l===0,frameBorder:"0",height:s,title:"Buffered Preview 1",width:o}),n.jsx("iframe",{ref:m[1],className:`${a} ${l!==1?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":l===1,frameBorder:"0",height:s,title:"Buffered Preview 2",width:o})]})},wk=(t,a,s)=>{const o=new URLSearchParams;return o.append("announcement_bg",t||"accent"),o.append("announcement",a||""),s&&s.length>0&&o.append("announcement_vis",s?.join(",")||""),o.toString()},vk=({announcementBackgroundColor:t,announcementContent:a,url:s,visibility:o})=>{const c=B.useMemo(()=>o,[o?.join(",")]),u=B.useCallback(d=>{s&&fetch(s,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":wk(t,a,c),Accept:"text/plain"},mode:"cors",credentials:"include"}).then(l=>l.text()).then(l=>{const f="html { pointer-events: none; }",p=new DOMParser().parseFromString(l,"text/html"),b=p.querySelector("style"),w=b.innerHTML;b.innerHTML=`${w}
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DIyK69JM.js","./index-DQZp_NsL.js","./settings-rRY210wx.js","./index-BkbhBpVC.js","./index-C2Ws6omJ.css","./tabs-M6kFEqPE.js","./newsletters-CSCa3QdE.js","./posts-BZaw4-dc.js","./typeof-QjJsDpFa.js","./tiers-D2DYHaeO.js","./dropzone-Cs4DrURS.js","./index-DYE2untj.js","./referrers-BsZ85Z0a.js","./select-BfWJkrKc.js","./chevron-up-DuaKtE_M.js","./underline-CwuJG-Ql.js","./toggle-group-GYp_w6Po.js","./textarea-CGBp9nOo.js","./index-D3A8RTi0.js","./index-CuH5raTz.js","./index-UMWVIyz7.js","./index-DLFVpwt3.js","./index-DssW7xhk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as n,r as B,aF as Oe,t as xt,dM as Pv,aR as Hv,au as Uv,aT as Bv,at as Ro,av as $u,aV as Wv,aw as pu,aU as Lp,as as Yv,az as Fp,ax as qv,ay as Gv,dN as dt,ag as ss,b6 as pt,dp as $r,dB as zr,dO as jt,dP as et,c2 as Lu,dl as zp,dQ as Pp,dR as Uf,dS as Xv,dT as Qn,dU as Zv,dV as Kv,dW as Vv,dX as Hp,dY as Fu,dZ as Qv,d_ as Jv,d$ as Ha,e0 as e1,e1 as Lr,e2 as $o,e3 as t1,e4 as n1,aB as r1,e5 as s1,dD as Or,e6 as a1,e7 as Oa,e8 as i1,e9 as o1,X as Up,bi as l1,aK as c1,bz as u1,C as d1,cM as f1,aC as ns,ai as h1,aX as p1,ea as m1,eb as Bp,ec as Wp,ed as Bf,cz as Bt,ee as zs,ef as mu,eg as g1,eh as Ps,ei as x1,ej as b1,ek as w1,el as Ua,em as v1,en as _1,eo as gu,af as y1,ep as k1,eq as j1,er as M1,es as E1,et as Ir,eu as Wf,ev as Yf,ew as T1}from"./index-BkbhBpVC.js";import{H as Et,c as Jn,S as Hs,Q as Ke,U as Lo,V as N1,W as Wt,X as C1,Y as Ht,Z as yt,_ as Vn,$ as S1,a0 as Fr,a1 as I1,a2 as Fo,a3 as Ae,a4 as rt,a5 as A1,a6 as zo,a7 as lt,a8 as pr,a9 as Pr,aa as Dt,ab as as,ac as gn,ad as D1,ae as ut,af as He,ag as qf,ah as Gf,ai as ot,aj as Yp,ak as qp,al as O1,am as Xf,an as R1,ao as $1,ap as L1,aq as Bs,ar as Ws,as as gr,at as xr,au as La,av as F1,aw as z1,ax as P1,ay as H1,az as U1,aA as No,aB as Co,aC as er,aD as B1,aE as Zf,aF as Kf,aG as W1,aH as Ys,aI as mr,aJ as hr,aK as Gp,aL as Po,aM as Xp,aN as Y1,aO as q1,aP as Zp,aQ as Kp,aR as Vp,aS as Uc,E as xu,aT as Vf,R as G1,aU as Qp,aV as X1,aW as Z1,aX as In,aY as Qf,aZ as Jp,a_ as em,a$ as tm,b0 as nm,b1 as bu,b2 as K1,b3 as V1,b4 as Q1,b5 as wu,b6 as zu,b7 as Eo,b8 as J1,b9 as e_,ba as Jf,bb as rm,bc as t_,bd as sm,be as Pu,bf as Hu,bg as vu,bh as n_,bi as r_,bj as s_,bk as a_}from"./settings-rRY210wx.js";import{a as i_,u as am,b as im}from"./newsletters-CSCa3QdE.js";import{C as o_,a as l_}from"./index-Cq5vsvxE.js";import{u as om}from"./posts-BZaw4-dc.js";import{r as lm,c as xo}from"./index-TtBMzSeP.js";import{S as c_,F as u_,a as d_,b as f_,C as h_,U as cm,T as p_,A as m_,L as g_}from"./undo-2-D6ZRqONE.js";import{P as x_}from"./pencil-BcymGPnE.js";import{a as um,b as dm,u as Uu,c as Bu,d as b_}from"./dropzone-Cs4DrURS.js";import{u as is,a as Wu,b as w_,g as Za}from"./tiers-D2DYHaeO.js";import"./tabs-M6kFEqPE.js";import"./typeof-QjJsDpFa.js";import"./referrers-BsZ85Z0a.js";import"./select-BfWJkrKc.js";import"./chevron-up-DuaKtE_M.js";import"./underline-CwuJG-Ql.js";import"./toggle-group-GYp_w6Po.js";import"./textarea-CGBp9nOo.js";import"./index-DYE2untj.js";const fm=({children:t,...a})=>n.jsx("div",{className:"flex size-full flex-col px-8",...a,children:n.jsx("div",{className:"size-full overflow-hidden rounded-t-[4px] shadow-sm",children:t})}),hm=({children:t,...a})=>n.jsx("div",{className:"flex h-[775px] w-[380px] flex-col rounded-3xl bg-white p-2 shadow-xl dark:bg-grey-900",...a,children:n.jsx("div",{className:"h-100 w-100 grow overflow-auto rounded-2xl border border-grey-100 dark:border-grey-950",children:t})}),v_=({title:t,label:a,value:s,onChange:o,disabled:c,error:u,hint:d,checked:l,separator:f,testId:m})=>{const p=B.useId(),b=w=>{o(w===!0)};return n.jsxs("div",{children:[n.jsxs("div",{className:`flex flex-col gap-1 ${f&&"pb-2"}`,children:[t&&n.jsx(Et,{grey:!0,level:6,children:t}),n.jsxs("label",{className:`flex cursor-pointer items-start ${t&&"mt-1 -mb-1"}`,htmlFor:p,children:[n.jsx(o_,{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":m,defaultChecked:l,disabled:c,id:p,value:s,onCheckedChange:b,children:n.jsx(l_,{children:n.jsx("svg",{fill:"none",height:"11",viewBox:"0 0 10 11",width:"10",children:n.jsx("path",{d:"M1 5.88889L4.6 9L9 1",stroke:"white",strokeLinecap:"round",strokeWidth:"2"})})})}),n.jsxs("div",{className:`ml-2 flex flex-col ${d&&"mb-2"}`,children:[n.jsx("span",{className:`inline-block text-[1.425rem] dark:text-white ${d&&"-mb-1"}`,children:a}),d&&n.jsx(Jn,{color:u?"red":"",children:d})]})]})]}),(f||u)&&n.jsx(Hs,{className:u?"border-red":""})]})},_u=({title:t,checkboxes:a,hint:s,error:o})=>n.jsxs("div",{children:[t&&n.jsx(Et,{grey:!0,level:6,children:t}),n.jsx("div",{className:"mt-2 flex flex-col gap-1",children:a?.map(({key:c,...u})=>n.jsx(v_,{...u},c))}),n.jsx("div",{className:`flex flex-col ${s&&"mb-2"}`,children:s&&n.jsx(Jn,{color:o?"red":"",children:s})})]}),__=({hex:t,value:a,title:s,size:o="md",isSelected:c,onSelect:u})=>{const d=B.useRef(null),l=p=>{p.preventDefault(),u(a!==void 0?a:t)},f=t.length===4&&t[3]==="0"||t.length===8&&t.slice(6)==="00";let m="h-5 w-5";return o==="lg"&&(m="w-6 h-6"),n.jsx("button",{ref:d,className:Oe("relative flex shrink-0 cursor-pointer items-center rounded-full border border-grey-300 dark:border-grey-800",m,c&&"outline outline-2 outline-green"),style:{backgroundColor:t},title:s,type:"button",onClick:l,children:f&&n.jsx("div",{className:"absolute top-0 left-0 z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})},pm=({title:t,value:a,swatches:s,swatchSize:o="md",onSwatchChange:c,onTogglePicker:u,isExpanded:d,picker:l=!0,containerClassName:f})=>{const m=s.find(b=>b.value===a||b.hex===a);f=Oe("flex flex-col gap-3");const p=d||!l;return n.jsxs("div",{className:f,children:[t&&n.jsx(Et,{useLabelTag:!0,children:t}),n.jsxs("div",{className:"flex gap-1",children:[p&&n.jsx("div",{className:"flex items-center gap-1",children:s.map(({customContent:b,...w})=>b?n.jsx(B.Fragment,{children:b},w.title):n.jsx(__,{isSelected:m?.title===w.title,size:o,onSelect:c,...w},w.title))}),l&&n.jsxs("button",{"aria-label":"Pick color",className:"relative size-6 cursor-pointer rounded-full border border-grey-250 dark:border-grey-800",type:"button",onClick:u,children:[n.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%))]"}),m&&n.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:m.hex},children:m.hex==="transparent"&&n.jsx("div",{className:"absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})}),!m&&a&&n.jsx("div",{className:"absolute inset-[3px] overflow-hidden rounded-full border border-white dark:border-grey-950",style:{backgroundColor:a},children:a==="transparent"&&n.jsx("div",{className:"absolute top-[3px] left-[3px] z-10 w-[136%] origin-left rotate-45 border-b border-b-red"})})]})]})]})};function qs(){return(qs=Object.assign||function(t){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(t[o]=s[o])}return t}).apply(this,arguments)}function Ho(t,a){if(t==null)return{};var s,o,c={},u=Object.keys(t);for(o=0;o<u.length;o++)a.indexOf(s=u[o])>=0||(c[s]=t[s]);return c}function Ba(t){var a=B.useRef(t),s=B.useRef(function(o){a.current&&a.current(o)});return a.current=t,s.current}var Wa=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=1),t>s?s:t<a?a:t},Fa=function(t){return"touches"in t},yu=function(t){return t&&t.ownerDocument.defaultView||self},eh=function(t,a,s){var o=t.getBoundingClientRect(),c=Fa(a)?(function(u,d){for(var l=0;l<u.length;l++)if(u[l].identifier===d)return u[l];return u[0]})(a.touches,s):a;return{left:Wa((c.pageX-(o.left+yu(t).pageXOffset))/o.width),top:Wa((c.pageY-(o.top+yu(t).pageYOffset))/o.height)}},th=function(t){!Fa(t)&&t.preventDefault()},mm=xt.memo(function(t){var a=t.onMove,s=t.onKey,o=Ho(t,["onMove","onKey"]),c=B.useRef(null),u=Ba(a),d=Ba(s),l=B.useRef(null),f=B.useRef(!1),m=B.useMemo(function(){var h=function(j){th(j),(Fa(j)?j.touches.length>0:j.buttons>0)&&c.current?u(eh(c.current,j,l.current)):x(!1)},M=function(){return x(!1)};function x(j){var _=f.current,E=yu(c.current),C=j?E.addEventListener:E.removeEventListener;C(_?"touchmove":"mousemove",h),C(_?"touchend":"mouseup",M)}return[function(j){var _=j.nativeEvent,E=c.current;if(E&&(th(_),!(function(A,D){return D&&!Fa(A)})(_,f.current)&&E)){if(Fa(_)){f.current=!0;var C=_.changedTouches||[];C.length&&(l.current=C[0].identifier)}E.focus(),u(eh(E,_,l.current)),x(!0)}},function(j){var _=j.which||j.keyCode;_<37||_>40||(j.preventDefault(),d({left:_===39?.05:_===37?-.05:0,top:_===40?.05:_===38?-.05:0}))},x]},[d,u]),p=m[0],b=m[1],w=m[2];return B.useEffect(function(){return w},[w]),xt.createElement("div",qs({},o,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:c,onKeyDown:b,tabIndex:0,role:"slider"}))}),Yu=function(t){return t.filter(Boolean).join(" ")},gm=function(t){var a=t.color,s=t.left,o=t.top,c=o===void 0?.5:o,u=Yu(["react-colorful__pointer",t.className]);return xt.createElement("div",{className:u,style:{top:100*c+"%",left:100*s+"%"}},xt.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:a}}))},Qt=function(t,a,s){return a===void 0&&(a=0),s===void 0&&(s=Math.pow(10,a)),Math.round(s*t)/s},y_=function(t){return T_(ku(t))},ku=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Qt(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?Qt(parseInt(t.substring(6,8),16)/255,2):1}},k_=function(t){return E_(M_(t))},j_=function(t){var a=t.s,s=t.v,o=t.a,c=(200-a)*s/100;return{h:Qt(t.h),s:Qt(c>0&&c<200?a*s/100/(c<=100?c:200-c)*100:0),l:Qt(c/2),a:Qt(o,2)}},ju=function(t){var a=j_(t);return"hsl("+a.h+", "+a.s+"%, "+a.l+"%)"},M_=function(t){var a=t.h,s=t.s,o=t.v,c=t.a;a=a/360*6,s/=100,o/=100;var u=Math.floor(a),d=o*(1-s),l=o*(1-(a-u)*s),f=o*(1-(1-a+u)*s),m=u%6;return{r:Qt(255*[o,l,d,d,f,o][m]),g:Qt(255*[f,o,o,l,d,d][m]),b:Qt(255*[d,d,f,o,o,l][m]),a:Qt(c,2)}},bo=function(t){var a=t.toString(16);return a.length<2?"0"+a:a},E_=function(t){var a=t.r,s=t.g,o=t.b,c=t.a,u=c<1?bo(Qt(255*c)):"";return"#"+bo(a)+bo(s)+bo(o)+u},T_=function(t){var a=t.r,s=t.g,o=t.b,c=t.a,u=Math.max(a,s,o),d=u-Math.min(a,s,o),l=d?u===a?(s-o)/d:u===s?2+(o-a)/d:4+(a-s)/d:0;return{h:Qt(60*(l<0?l+6:l)),s:Qt(u?d/u*100:0),v:Qt(u/255*100),a:c}},N_=xt.memo(function(t){var a=t.hue,s=t.onChange,o=Yu(["react-colorful__hue",t.className]);return xt.createElement("div",{className:o},xt.createElement(mm,{onMove:function(c){s({h:360*c.left})},onKey:function(c){s({h:Wa(a+360*c.left,0,360)})},"aria-label":"Hue","aria-valuenow":Qt(a),"aria-valuemax":"360","aria-valuemin":"0"},xt.createElement(gm,{className:"react-colorful__hue-pointer",left:a/360,color:ju({h:a,s:100,v:100,a:1})})))}),C_=xt.memo(function(t){var a=t.hsva,s=t.onChange,o={backgroundColor:ju({h:a.h,s:100,v:100,a:1})};return xt.createElement("div",{className:"react-colorful__saturation",style:o},xt.createElement(mm,{onMove:function(c){s({s:100*c.left,v:100-100*c.top})},onKey:function(c){s({s:Wa(a.s+100*c.left,0,100),v:Wa(a.v-100*c.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Qt(a.s)+"%, Brightness "+Qt(a.v)+"%"},xt.createElement(gm,{className:"react-colorful__saturation-pointer",top:1-a.v/100,left:a.s/100,color:ju(a)})))}),xm=function(t,a){if(t===a)return!0;for(var s in t)if(t[s]!==a[s])return!1;return!0},S_=function(t,a){return t.toLowerCase()===a.toLowerCase()||xm(ku(t),ku(a))};function I_(t,a,s){var o=Ba(s),c=B.useState(function(){return t.toHsva(a)}),u=c[0],d=c[1],l=B.useRef({color:a,hsva:u});B.useEffect(function(){if(!t.equal(a,l.current.color)){var m=t.toHsva(a);l.current={hsva:m,color:a},d(m)}},[a,t]),B.useEffect(function(){var m;xm(u,l.current.hsva)||t.equal(m=t.fromHsva(u),l.current.color)||(l.current={hsva:u,color:m},o(m))},[u,t,o]);var f=B.useCallback(function(m){d(function(p){return Object.assign({},p,m)})},[]);return[u,f]}var A_=typeof window<"u"?B.useLayoutEffect:B.useEffect,D_=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},nh=new Map,O_=function(t){A_(function(){var a=t.current?t.current.ownerDocument:document;if(a!==void 0&&!nh.has(a)){var s=a.createElement("style");s.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}`,nh.set(a,s);var o=D_();o&&s.setAttribute("nonce",o),a.head.appendChild(s)}},[])},R_=function(t){var a=t.className,s=t.colorModel,o=t.color,c=o===void 0?s.defaultColor:o,u=t.onChange,d=Ho(t,["className","colorModel","color","onChange"]),l=B.useRef(null);O_(l);var f=I_(s,c,u),m=f[0],p=f[1],b=Yu(["react-colorful",a]);return xt.createElement("div",qs({},d,{ref:l,className:b}),xt.createElement(C_,{hsva:m,onChange:p}),xt.createElement(N_,{hue:m.h,onChange:p,className:"react-colorful__last-control"}))},$_={defaultColor:"000",toHsva:y_,fromHsva:function(t){return k_({h:t.h,s:t.s,v:t.v,a:1})},equal:S_},L_=function(t){return xt.createElement(R_,qs({},t,{colorModel:$_}))},F_=/^#?([0-9A-F]{3,8})$/i,z_=function(t){var a=t.color,s=a===void 0?"":a,o=t.onChange,c=t.onBlur,u=t.escape,d=t.validate,l=t.format,f=t.process,m=Ho(t,["color","onChange","onBlur","escape","validate","format","process"]),p=B.useState(function(){return u(s)}),b=p[0],w=p[1],h=Ba(o),M=Ba(c),x=B.useCallback(function(_){var E=u(_.target.value);w(E),d(E)&&h(f?f(E):E)},[u,f,d,h]),j=B.useCallback(function(_){d(_.target.value)||w(u(s)),M(_)},[s,u,d,M]);return B.useEffect(function(){w(u(s))},[s,u]),xt.createElement("input",qs({},m,{value:l?l(b):b,spellCheck:"false",onChange:x,onBlur:j}))},rh=function(t){return"#"+t},P_=function(t){var a=t.prefixed,s=t.alpha,o=Ho(t,["prefixed","alpha"]),c=B.useCallback(function(d){return d.replace(/([^0-9A-F]+)/gi,"").substring(0,s?8:6)},[s]),u=B.useCallback(function(d){return(function(l,f){var m=F_.exec(l),p=m?m[1].length:0;return p===3||p===6||!!f&&p===4||!!f&&p===8})(d,s)},[s]);return xt.createElement(z_,qs({},o,{escape:c,format:a?rh:void 0,process:rh,validate:u}))};const H_=({hexValue:t,eyedropper:a,clearButtonValue:s,containerClassName:o,onChange:c})=>{const u=B.useRef(null),d=B.useCallback(w=>{w.stopPropagation();const h=u.current?.querySelector("input");w.target!==h&&(u.current?.querySelector("input")?.focus(),w.preventDefault())},[]),l=B.useRef(!1),f=B.useCallback(()=>{l.current=!1,u.current?.querySelector("input")?.focus(),document.removeEventListener("mouseup",f),document.removeEventListener("touchend",f)},[]),m=B.useCallback(()=>{l.current=!0,document.addEventListener("mouseup",f),document.addEventListener("touchend",f)},[f]),p=B.useCallback(w=>{if(w.preventDefault(),!window.EyeDropper)return;l.current=!0,document.body.style.setProperty("pointer-events","none"),new window.EyeDropper().open().then(M=>c?.(M.sRGBHex)).finally(()=>{l.current=!1,document.body.style.removeProperty("pointer-events"),u.current?.querySelector("input")?.focus()})},[c]);B.useEffect(()=>{u.current?.querySelector("input")?.focus()},[]);const b=B.useCallback(()=>{u.current?.querySelector("input")?.focus()},[]);return o=Oe("mt-2",o),n.jsxs("div",{className:o,onMouseDown:d,onTouchStart:d,children:[n.jsx(L_,{className:"w-full",color:t||"#ffffff",onChange:c,onMouseDown:m,onTouchStart:m}),n.jsxs("div",{className:"mt-3 flex gap-2",children:[n.jsxs("div",{ref:u,className:"peer relative order-2 flex h-10 w-full items-center",onClick:b,children:[n.jsx("span",{className:"absolute top-[9px] left-2 z-10 mr-2 ml-1 text-grey-700",children:"#"}),n.jsx(P_,{"aria-label":"Color value",className:"z-[1] w-full rounded-md border border-transparent bg-grey-150 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-925",color:t,onChange:c}),a&&!!window.EyeDropper&&n.jsx("button",{className:"absolute inset-y-0 right-3 z-50 my-auto size-4 p-[1px]",type:"button",onClick:p,children:n.jsx(Pv,{className:"size-full"})})]}),s!==void 0&&n.jsx(Ke,{color:"grey",value:"Clear",onClick:()=>c?.(s)})]})]})},U_=B.createContext({colorPickers:[]}),sh=t=>t.length===4?t.replace(/#(.)(.)(.)/,"#$1$1$2$2$3$3"):t,Kn=({testId:t,title:a,direction:s,value:o,hint:c,error:u,eyedropper:d,clearButtonValue:l,onChange:f,swatches:m=[],alwaysOpen:p=!1,debounceMs:b})=>{const[w,h]=B.useState(!1),[M,x]=B.useState(o),j=B.useContext(U_),_=B.useId();B.useEffect(()=>{x(F=>sh(F||"")===o?F:o)},[o]),B.useEffect(()=>(j.colorPickers.push({id:_,setExpanded:h}),()=>{j.colorPickers=j.colorPickers.filter(F=>F.id!==_)}),[j,_]),B.useEffect(()=>{if(w){j.colorPickers.filter(O=>O.id!==_).forEach(O=>O.setExpanded(!1));const F=()=>{h(!1)};return document.addEventListener("click",F),()=>{document.removeEventListener("click",F)}}},[j,_,w]);const E=B.useMemo(()=>f&&b?Lo(f,b):f,[b,f]),C=F=>{x(F),E?.(F?sh(F):null)};let A=n.jsx(pm,{isExpanded:w,swatches:m,value:M,onSwatchChange:F=>{C(F),h(!1)},onTogglePicker:()=>!p&&h(!w)});a&&(A=n.jsxs("div",{className:Oe("flex w-full cursor-pointer items-start first:mt-0 dark:text-white",s==="rtl"&&"flex-row-reverse"),children:[n.jsx("div",{className:"shrink-0",children:A}),n.jsxs("div",{className:Oe("flex-1",s==="rtl"?"pr-2":"pl-2",c?"mt-[-2px]":"mt-[1px]"),onClick:()=>!p&&h(!w),children:[a,c&&n.jsx("div",{className:`text-xs ${u?"text-red":"text-grey-700"}`,children:c})]})]}));const D=m.find(F=>F.value===M);return n.jsxs("div",{className:"flex-col","data-testid":t,onClick:F=>F.stopPropagation(),children:[A,(p||w)&&n.jsx(H_,{clearButtonValue:l,eyedropper:d,hexValue:D?.hex||M||void 0,onChange:C})]})},B_=({value:t,onChange:a,singleParagraph:s=!0,...o})=>{const c=B.useCallback(u=>{const l=new DOMParser().parseFromString(u,"text/html");l.querySelectorAll("*").forEach(m=>{m.style.removeProperty("white-space"),m.getAttribute("style")||m.removeAttribute("style")}),l.body.innerHTML!==t&&a?.(l.body.innerHTML)},[t,a]);return n.jsx(N1,{...o,singleParagraph:s,children:u=>n.jsx(u.HtmlOutputPlugin,{html:t,setHtml:c})})},qu=({title:t,hideTitle:a,error:s,hint:o,value:c,clearBg:u=!1,className:d="",containerClassName:l="",hintClassName:f="",unstyled:m=!1,...p})=>{const b=m?"":Oe("flex min-h-[32px] items-center rounded-md border border-transparent py-1.5 md:min-h-[36px]",u?"bg-transparent":"bg-grey-150 px-3 dark:bg-grey-900",s?"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-925 dark:has-[:focus]:bg-grey-950",t&&!a&&!u&&"mt-2",d);return n.jsxs("div",{className:`flex flex-col ${l}`,children:[t&&n.jsx(Et,{className:a?"sr-only":"",grey:!0,useLabelTag:!0,children:t}),n.jsx("div",{className:b,children:n.jsx(B_,{...p,value:c})}),o&&n.jsx(Jn,{className:f,color:s?"red":"",children:o})]})};var Gu="Radio",[W_,bm]=Fp(Gu),[Y_,q_]=W_(Gu),wm=B.forwardRef((t,a)=>{const{__scopeRadio:s,name:o,checked:c=!1,required:u,disabled:d,value:l="on",onCheck:f,form:m,...p}=t,[b,w]=B.useState(null),h=$u(a,j=>w(j)),M=B.useRef(!1),x=b?m||!!b.closest("form"):!0;return n.jsxs(Y_,{scope:s,checked:c,disabled:d,children:[n.jsx(Ro.button,{type:"button",role:"radio","aria-checked":c,"data-state":km(c),"data-disabled":d?"":void 0,disabled:d,value:l,...p,ref:h,onClick:pu(t.onClick,j=>{c||f?.(),x&&(M.current=j.isPropagationStopped(),M.current||j.stopPropagation())})}),x&&n.jsx(ym,{control:b,bubbles:!M.current,name:o,value:l,checked:c,required:u,disabled:d,form:m,style:{transform:"translateX(-100%)"}})]})});wm.displayName=Gu;var vm="RadioIndicator",_m=B.forwardRef((t,a)=>{const{__scopeRadio:s,forceMount:o,...c}=t,u=q_(vm,s);return n.jsx(Yv,{present:o||u.checked,children:n.jsx(Ro.span,{"data-state":km(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:a})})});_m.displayName=vm;var G_="RadioBubbleInput",ym=B.forwardRef(({__scopeRadio:t,control:a,checked:s,bubbles:o=!0,...c},u)=>{const d=B.useRef(null),l=$u(d,u),f=qv(s),m=Gv(a);return B.useEffect(()=>{const p=d.current;if(!p)return;const b=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(b,"checked").set;if(f!==s&&h){const M=new Event("click",{bubbles:o});h.call(p,s),p.dispatchEvent(M)}},[f,s,o]),n.jsx(Ro.input,{type:"radio","aria-hidden":!0,defaultChecked:s,...c,tabIndex:-1,ref:l,style:{...c.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});ym.displayName=G_;function km(t){return t?"checked":"unchecked"}var X_=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Uo="RadioGroup",[Z_]=Fp(Uo,[Lp,bm]),jm=Lp(),Mm=bm(),[K_,V_]=Z_(Uo),Em=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,name:o,defaultValue:c,value:u,required:d=!1,disabled:l=!1,orientation:f,dir:m,loop:p=!0,onValueChange:b,...w}=t,h=jm(s),M=Hv(m),[x,j]=Uv({prop:u,defaultProp:c??null,onChange:b,caller:Uo});return n.jsx(K_,{scope:s,name:o,required:d,disabled:l,value:x,onValueChange:j,children:n.jsx(Bv,{asChild:!0,...h,orientation:f,dir:M,loop:p,children:n.jsx(Ro.div,{role:"radiogroup","aria-required":d,"aria-orientation":f,"data-disabled":l?"":void 0,dir:M,...w,ref:a})})})});Em.displayName=Uo;var Tm="RadioGroupItem",Nm=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,disabled:o,...c}=t,u=V_(Tm,s),d=u.disabled||o,l=jm(s),f=Mm(s),m=B.useRef(null),p=$u(a,m),b=u.value===c.value,w=B.useRef(!1);return B.useEffect(()=>{const h=x=>{X_.includes(x.key)&&(w.current=!0)},M=()=>w.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",M),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",M)}},[]),n.jsx(Wv,{asChild:!0,...l,focusable:!d,active:b,children:n.jsx(wm,{disabled:d,required:u.required,checked:b,...f,...c,name:u.name,ref:p,onCheck:()=>u.onValueChange(c.value),onKeyDown:pu(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:pu(c.onFocus,()=>{w.current&&m.current?.click()})})})});Nm.displayName=Tm;var Q_="RadioGroupIndicator",Cm=B.forwardRef((t,a)=>{const{__scopeRadioGroup:s,...o}=t,c=Mm(s);return n.jsx(_m,{...c,...o,ref:a})});Cm.displayName=Q_;var J_=Em,ey=Nm,ty=Cm;const ny=({id:t,title:a,options:s,onSelect:o,error:c,hint:u,selectedOption:d,separator:l})=>n.jsxs(J_,{defaultValue:d,name:t,onValueChange:o,children:[n.jsxs("div",{className:`flex flex-col gap-2 ${l&&"pb-2"}`,children:[a&&n.jsx(Et,{level:6,children:a}),s.map(f=>n.jsxs("label",{className:`flex cursor-pointer items-start ${a&&"mt-1 -mb-1"}`,htmlFor:f.value,children:[n.jsx(ey,{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:f.value,value:f.value,children:n.jsx(ty,{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"})}),n.jsxs("div",{className:`ml-2 flex flex-col ${f.hint&&"mb-2"}`,children:[n.jsx("span",{className:`inline-block text-md dark:text-white ${f.hint&&"-mb-1"}`,children:f.label}),f.hint&&n.jsx(Jn,{children:f.hint})]})]},f.value)),u&&n.jsx(Jn,{color:c?"red":"",children:u})]}),(l||c)&&n.jsx(Hs,{className:c?"border-red":""})]}),So=({children:t,gap:a="md",className:s})=>{let o="gap-3";switch(a){case"sm":o="gap-2";break;case"md":o="gap-3";break;case"lg":o="gap-4";break}return s=Oe("flex flex-col",o,s),n.jsx("div",{className:s,children:t})},Xu=({heading:t,children:a,className:s})=>(s=Oe("w-full p-[8vmin] pt-5",s),n.jsxs("div",{className:s,children:[t&&n.jsx(Et,{className:"mb-8",children:t}),a]})),Zu=({items:t,backIcon:a=!1,snapBackIcon:s=!0,onBack:o,containerClassName:c,itemClassName:u,activeItemClassName:d,separatorClassName:l})=>{const f=t.length;let m=0;return c=Oe("flex items-center gap-2 text-sm",c),d=Oe("font-bold",d),u=Oe("text-sm",u),n.jsxs("div",{className:c,children:[a&&n.jsx(Ke,{className:s?"mr-1":"mr-6",icon:"arrow-left",iconColorClass:"dark:text-white",size:"sm",link:!0,onClick:o}),t.map(p=>{const b=m===f-1?n.jsx("span",{className:d,children:p.label}):n.jsxs(n.Fragment,{children:[n.jsx("button",{className:`${u} ${p.onClick&&"-mx-1 cursor-pointer rounded-sm px-1 py-px hover:bg-grey-100 dark:hover:bg-grey-900"}`,type:"button",onClick:p.onClick,children:p.label},`bc-${m}`),n.jsx("span",{className:l,children:"/"})]});return m=m+1,b})]})},os=({testId:t,title:a,titleHeadingLevel:s=4,size:o="full",width:c,height:u,sidebar:d="",preview:l,dirty:f=!1,cancelLabel:m="Cancel",okLabel:p="OK",okColor:b="black",previewToolbar:w=!0,leftToolbar:h=!0,rightToolbar:M=!0,deviceSelector:x=!0,siteLink:j,previewToolbarURLs:_,previewBgColor:E="grey",selectedURL:C,previewToolbarTabs:A,previewToolbarBreadcrumbs:D,buttonsDisabled:F,sidebarButtons:O,sidebarHeader:q,sidebarPadding:P=!0,sidebarContentClasses:U,enableCMDS:K=!0,backDropClick:$,onCancel:Q,onOk:N,afterClose:W,onSelectURL:ae,onSelectDesktopView:ue,onSelectMobileView:be,onBreadcrumbsBack:de})=>{const ie=Wt(),{setGlobalDirtyState:V}=C1();B.useEffect(()=>{V(f)},[f,V]),B.useEffect(()=>{if(N){const xe=Fe=>{(Fe.metaKey||Fe.ctrlKey)&&Fe.key==="s"&&(Fe.preventDefault(),N())};if(K)return window.addEventListener("keydown",xe),()=>{window.removeEventListener("keydown",xe)}}});const[G,me]=B.useState("desktop");if(G==="mobile"&&x?l=n.jsx(hm,{"data-testid":"preview-mobile",children:l}):G==="desktop"&&x&&(l=n.jsx(fm,{"data-testid":"preview-desktop",children:l})),w){let xe=n.jsx(n.Fragment,{});_?xe=n.jsx(Ht,{options:_,selectedOption:_.find(Ee=>Ee.value===C),onSelect:Ee=>Ee&&ae?.(Ee.value)}):A?xe=n.jsx(Fr,{border:!1,selectedTab:C,tabs:A,width:"wide",onTabChange:ae}):D&&(xe=n.jsx(Zu,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:D,separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:de}));const Fe="text-black dark:text-green",qe="text-grey-500 dark:text-grey-600",Ue=[{icon:"laptop",label:"Desktop",hideLabel:!0,link:!0,size:"sm",iconColorClass:G==="desktop"?Fe:qe,onClick:ue||(()=>{me("desktop")})},{icon:"mobile",label:"Mobile",hideLabel:!0,link:!0,size:"sm",iconColorClass:G==="mobile"?Fe:qe,onClick:be||(()=>{me("mobile")})}],Xe=x&&n.jsx(Vn,{buttons:Ue});let we="";E==="grey"?we="bg-grey-50 dark:bg-black":E==="greygradient"&&(we="bg-gradient-to-tr from-white to-[#f9f9fa] dark:from-grey-950 dark:to-black");const Le=Oe("absolute inset-y-0 right-[400px] left-0 flex w-full min-w-100 grow flex-col overflow-y-auto",we);let Ie;j&&(Ie=n.jsx("div",{className:"ml-3 border-l border-grey-400 dark:border-grey-800",children:n.jsxs("a",{className:"ml-3 flex items-center gap-1 text-sm",href:j,rel:"noopener noreferrer",target:"_blank",children:["View site ",n.jsx(dt,{name:"arrow-top-right",size:"xs"})]})})),l=n.jsxs("div",{className:Le,children:[w&&n.jsxs("header",{className:"relative flex h-[80px] shrink-0 items-center justify-center px-8 py-5","data-testid":"design-toolbar",children:[h&&n.jsx("div",{className:"absolute left-8 flex h-full items-center",children:xe}),M&&n.jsxs("div",{className:"absolute right-8 flex h-full items-center",children:[Xe,Ie]})]}),n.jsx("div",{className:"flex grow items-center justify-center text-sm text-grey-400",children:l})]})}const ee=[];return O||(ee.push({key:"cancel-modal",label:m,onClick:Q||(()=>{S1(f,()=>{ie.remove(),W?.()})}),disabled:F}),ee.push({key:"ok-modal",label:p,color:b,onClick:N,disabled:F})),n.jsx(yt,{afterClose:W,animate:!1,backDropClick:$,dirty:f,footer:!1,height:u,padding:!1,size:o,testId:t,title:"",width:c,hideXOnMobile:!0,children:n.jsxs("div",{className:"flex h-full grow",children:[n.jsx("div",{className:`relative hidden grow flex-col [@media(min-width:801px)]:!visible [@media(min-width:801px)]:!flex ${E==="grey"?"bg-grey-50":"bg-white dark:bg-black"}`,children:l}),d&&n.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:[q||n.jsxs("div",{className:"flex max-h-[82px] items-center justify-between gap-3 px-7 py-6",children:[n.jsx(Et,{level:s,children:a}),O||n.jsx(Vn,{buttons:ee})]}),n.jsx("div",{className:`${q?"":"absolute inset-x-0 top-[80px] bottom-0 grow"} ${P&&"p-7 pt-0"} flex flex-col justify-between overflow-y-auto ${U&&U}`,children:d})]})]})})},ry=({offset:t,onTrigger:a})=>{const s=B.useRef(null);return B.useEffect(()=>{const o=new IntersectionObserver(c=>{c[0].intersectionRatio<=0||a()});return s.current&&o.observe(s.current),()=>o.disconnect()},[a]),n.jsx("div",{ref:s,className:"absolute w-full",style:{bottom:t}})};var Sm=typeof global=="object"&&global&&global.Object===Object&&global,sy=typeof self=="object"&&self&&self.Object===Object&&self,br=Sm||sy||Function("return this")(),Us=br.Symbol,Im=Object.prototype,ay=Im.hasOwnProperty,iy=Im.toString,Ra=Us?Us.toStringTag:void 0;function oy(t){var a=ay.call(t,Ra),s=t[Ra];try{t[Ra]=void 0;var o=!0}catch{}var c=iy.call(t);return o&&(a?t[Ra]=s:delete t[Ra]),c}var ly=Object.prototype,cy=ly.toString;function uy(t){return cy.call(t)}var dy="[object Null]",fy="[object Undefined]",ah=Us?Us.toStringTag:void 0;function Ka(t){return t==null?t===void 0?fy:dy:ah&&ah in Object(t)?oy(t):uy(t)}function Ya(t){return t!=null&&typeof t=="object"}var Io=Array.isArray;function Am(t){var a=typeof t;return t!=null&&(a=="object"||a=="function")}var hy="[object AsyncFunction]",py="[object Function]",my="[object GeneratorFunction]",gy="[object Proxy]";function Dm(t){if(!Am(t))return!1;var a=Ka(t);return a==py||a==my||a==hy||a==gy}var Bc=br["__core-js_shared__"],ih=(function(){var t=/[^.]+$/.exec(Bc&&Bc.keys&&Bc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function xy(t){return!!ih&&ih in t}var by=Function.prototype,wy=by.toString;function ls(t){if(t!=null){try{return wy.call(t)}catch{}try{return t+""}catch{}}return""}var vy=/[\\^$.*+?()[\]{}|]/g,_y=/^\[object .+?Constructor\]$/,yy=Function.prototype,ky=Object.prototype,jy=yy.toString,My=ky.hasOwnProperty,Ey=RegExp("^"+jy.call(My).replace(vy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ty(t){if(!Am(t)||xy(t))return!1;var a=Dm(t)?Ey:_y;return a.test(ls(t))}function Ny(t,a){return t?.[a]}function Gs(t,a){var s=Ny(t,a);return Ty(s)?s:void 0}var Mu=Gs(br,"WeakMap"),Cy=9007199254740991,Sy=/^(?:0|[1-9]\d*)$/;function Iy(t,a){var s=typeof t;return a=a??Cy,!!a&&(s=="number"||s!="symbol"&&Sy.test(t))&&t>-1&&t%1==0&&t<a}function Om(t,a){return t===a||t!==t&&a!==a}var Ay=9007199254740991;function Rm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ay}function Dy(t){return t!=null&&Rm(t.length)&&!Dm(t)}var Oy=Object.prototype;function Ry(t){var a=t&&t.constructor,s=typeof a=="function"&&a.prototype||Oy;return t===s}function $y(t,a){for(var s=-1,o=Array(t);++s<t;)o[s]=a(s);return o}var Ly="[object Arguments]";function oh(t){return Ya(t)&&Ka(t)==Ly}var $m=Object.prototype,Fy=$m.hasOwnProperty,zy=$m.propertyIsEnumerable,Py=oh((function(){return arguments})())?oh:function(t){return Ya(t)&&Fy.call(t,"callee")&&!zy.call(t,"callee")};function Hy(){return!1}var Lm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lh=Lm&&typeof module=="object"&&module&&!module.nodeType&&module,Uy=lh&&lh.exports===Lm,ch=Uy?br.Buffer:void 0,By=ch?ch.isBuffer:void 0,Eu=By||Hy,Wy="[object Arguments]",Yy="[object Array]",qy="[object Boolean]",Gy="[object Date]",Xy="[object Error]",Zy="[object Function]",Ky="[object Map]",Vy="[object Number]",Qy="[object Object]",Jy="[object RegExp]",e3="[object Set]",t3="[object String]",n3="[object WeakMap]",r3="[object ArrayBuffer]",s3="[object DataView]",a3="[object Float32Array]",i3="[object Float64Array]",o3="[object Int8Array]",l3="[object Int16Array]",c3="[object Int32Array]",u3="[object Uint8Array]",d3="[object Uint8ClampedArray]",f3="[object Uint16Array]",h3="[object Uint32Array]",It={};It[a3]=It[i3]=It[o3]=It[l3]=It[c3]=It[u3]=It[d3]=It[f3]=It[h3]=!0;It[Wy]=It[Yy]=It[r3]=It[qy]=It[s3]=It[Gy]=It[Xy]=It[Zy]=It[Ky]=It[Vy]=It[Qy]=It[Jy]=It[e3]=It[t3]=It[n3]=!1;function p3(t){return Ya(t)&&Rm(t.length)&&!!It[Ka(t)]}function m3(t){return function(a){return t(a)}}var Fm=typeof exports=="object"&&exports&&!exports.nodeType&&exports,za=Fm&&typeof module=="object"&&module&&!module.nodeType&&module,g3=za&&za.exports===Fm,Wc=g3&&Sm.process,uh=(function(){try{var t=za&&za.require&&za.require("util").types;return t||Wc&&Wc.binding&&Wc.binding("util")}catch{}})(),dh=uh&&uh.isTypedArray,zm=dh?m3(dh):p3,x3=Object.prototype,b3=x3.hasOwnProperty;function w3(t,a){var s=Io(t),o=!s&&Py(t),c=!s&&!o&&Eu(t),u=!s&&!o&&!c&&zm(t),d=s||o||c||u,l=d?$y(t.length,String):[],f=l.length;for(var m in t)b3.call(t,m)&&!(d&&(m=="length"||c&&(m=="offset"||m=="parent")||u&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Iy(m,f)))&&l.push(m);return l}function v3(t,a){return function(s){return t(a(s))}}var _3=v3(Object.keys,Object),y3=Object.prototype,k3=y3.hasOwnProperty;function j3(t){if(!Ry(t))return _3(t);var a=[];for(var s in Object(t))k3.call(t,s)&&s!="constructor"&&a.push(s);return a}function M3(t){return Dy(t)?w3(t):j3(t)}var qa=Gs(Object,"create");function E3(){this.__data__=qa?qa(null):{},this.size=0}function T3(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a}var N3="__lodash_hash_undefined__",C3=Object.prototype,S3=C3.hasOwnProperty;function I3(t){var a=this.__data__;if(qa){var s=a[t];return s===N3?void 0:s}return S3.call(a,t)?a[t]:void 0}var A3=Object.prototype,D3=A3.hasOwnProperty;function O3(t){var a=this.__data__;return qa?a[t]!==void 0:D3.call(a,t)}var R3="__lodash_hash_undefined__";function $3(t,a){var s=this.__data__;return this.size+=this.has(t)?0:1,s[t]=qa&&a===void 0?R3:a,this}function rs(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}rs.prototype.clear=E3;rs.prototype.delete=T3;rs.prototype.get=I3;rs.prototype.has=O3;rs.prototype.set=$3;function L3(){this.__data__=[],this.size=0}function Bo(t,a){for(var s=t.length;s--;)if(Om(t[s][0],a))return s;return-1}var F3=Array.prototype,z3=F3.splice;function P3(t){var a=this.__data__,s=Bo(a,t);if(s<0)return!1;var o=a.length-1;return s==o?a.pop():z3.call(a,s,1),--this.size,!0}function H3(t){var a=this.__data__,s=Bo(a,t);return s<0?void 0:a[s][1]}function U3(t){return Bo(this.__data__,t)>-1}function B3(t,a){var s=this.__data__,o=Bo(s,t);return o<0?(++this.size,s.push([t,a])):s[o][1]=a,this}function wr(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}wr.prototype.clear=L3;wr.prototype.delete=P3;wr.prototype.get=H3;wr.prototype.has=U3;wr.prototype.set=B3;var Ga=Gs(br,"Map");function W3(){this.size=0,this.__data__={hash:new rs,map:new(Ga||wr),string:new rs}}function Y3(t){var a=typeof t;return a=="string"||a=="number"||a=="symbol"||a=="boolean"?t!=="__proto__":t===null}function Wo(t,a){var s=t.__data__;return Y3(a)?s[typeof a=="string"?"string":"hash"]:s.map}function q3(t){var a=Wo(this,t).delete(t);return this.size-=a?1:0,a}function G3(t){return Wo(this,t).get(t)}function X3(t){return Wo(this,t).has(t)}function Z3(t,a){var s=Wo(this,t),o=s.size;return s.set(t,a),this.size+=s.size==o?0:1,this}function cs(t){var a=-1,s=t==null?0:t.length;for(this.clear();++a<s;){var o=t[a];this.set(o[0],o[1])}}cs.prototype.clear=W3;cs.prototype.delete=q3;cs.prototype.get=G3;cs.prototype.has=X3;cs.prototype.set=Z3;function K3(t,a){for(var s=-1,o=a.length,c=t.length;++s<o;)t[c+s]=a[s];return t}function V3(){this.__data__=new wr,this.size=0}function Q3(t){var a=this.__data__,s=a.delete(t);return this.size=a.size,s}function J3(t){return this.__data__.get(t)}function e2(t){return this.__data__.has(t)}var t2=200;function n2(t,a){var s=this.__data__;if(s instanceof wr){var o=s.__data__;if(!Ga||o.length<t2-1)return o.push([t,a]),this.size=++s.size,this;s=this.__data__=new cs(o)}return s.set(t,a),this.size=s.size,this}function Rr(t){var a=this.__data__=new wr(t);this.size=a.size}Rr.prototype.clear=V3;Rr.prototype.delete=Q3;Rr.prototype.get=J3;Rr.prototype.has=e2;Rr.prototype.set=n2;function r2(t,a){for(var s=-1,o=t==null?0:t.length,c=0,u=[];++s<o;){var d=t[s];a(d,s,t)&&(u[c++]=d)}return u}function s2(){return[]}var a2=Object.prototype,i2=a2.propertyIsEnumerable,fh=Object.getOwnPropertySymbols,o2=fh?function(t){return t==null?[]:(t=Object(t),r2(fh(t),function(a){return i2.call(t,a)}))}:s2;function l2(t,a,s){var o=a(t);return Io(t)?o:K3(o,s(t))}function hh(t){return l2(t,M3,o2)}var Tu=Gs(br,"DataView"),Nu=Gs(br,"Promise"),Cu=Gs(br,"Set"),ph="[object Map]",c2="[object Object]",mh="[object Promise]",gh="[object Set]",xh="[object WeakMap]",bh="[object DataView]",u2=ls(Tu),d2=ls(Ga),f2=ls(Nu),h2=ls(Cu),p2=ls(Mu),Dr=Ka;(Tu&&Dr(new Tu(new ArrayBuffer(1)))!=bh||Ga&&Dr(new Ga)!=ph||Nu&&Dr(Nu.resolve())!=mh||Cu&&Dr(new Cu)!=gh||Mu&&Dr(new Mu)!=xh)&&(Dr=function(t){var a=Ka(t),s=a==c2?t.constructor:void 0,o=s?ls(s):"";if(o)switch(o){case u2:return bh;case d2:return ph;case f2:return mh;case h2:return gh;case p2:return xh}return a});var wh=br.Uint8Array,m2="__lodash_hash_undefined__";function g2(t){return this.__data__.set(t,m2),this}function x2(t){return this.__data__.has(t)}function Ao(t){var a=-1,s=t==null?0:t.length;for(this.__data__=new cs;++a<s;)this.add(t[a])}Ao.prototype.add=Ao.prototype.push=g2;Ao.prototype.has=x2;function b2(t,a){for(var s=-1,o=t==null?0:t.length;++s<o;)if(a(t[s],s,t))return!0;return!1}function w2(t,a){return t.has(a)}var v2=1,_2=2;function Pm(t,a,s,o,c,u){var d=s&v2,l=t.length,f=a.length;if(l!=f&&!(d&&f>l))return!1;var m=u.get(t),p=u.get(a);if(m&&p)return m==a&&p==t;var b=-1,w=!0,h=s&_2?new Ao:void 0;for(u.set(t,a),u.set(a,t);++b<l;){var M=t[b],x=a[b];if(o)var j=d?o(x,M,b,a,t,u):o(M,x,b,t,a,u);if(j!==void 0){if(j)continue;w=!1;break}if(h){if(!b2(a,function(_,E){if(!w2(h,E)&&(M===_||c(M,_,s,o,u)))return h.push(E)})){w=!1;break}}else if(!(M===x||c(M,x,s,o,u))){w=!1;break}}return u.delete(t),u.delete(a),w}function y2(t){var a=-1,s=Array(t.size);return t.forEach(function(o,c){s[++a]=[c,o]}),s}function k2(t){var a=-1,s=Array(t.size);return t.forEach(function(o){s[++a]=o}),s}var j2=1,M2=2,E2="[object Boolean]",T2="[object Date]",N2="[object Error]",C2="[object Map]",S2="[object Number]",I2="[object RegExp]",A2="[object Set]",D2="[object String]",O2="[object Symbol]",R2="[object ArrayBuffer]",$2="[object DataView]",vh=Us?Us.prototype:void 0,Yc=vh?vh.valueOf:void 0;function L2(t,a,s,o,c,u,d){switch(s){case $2:if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case R2:return!(t.byteLength!=a.byteLength||!u(new wh(t),new wh(a)));case E2:case T2:case S2:return Om(+t,+a);case N2:return t.name==a.name&&t.message==a.message;case I2:case D2:return t==a+"";case C2:var l=y2;case A2:var f=o&j2;if(l||(l=k2),t.size!=a.size&&!f)return!1;var m=d.get(t);if(m)return m==a;o|=M2,d.set(t,a);var p=Pm(l(t),l(a),o,c,u,d);return d.delete(t),p;case O2:if(Yc)return Yc.call(t)==Yc.call(a)}return!1}var F2=1,z2=Object.prototype,P2=z2.hasOwnProperty;function H2(t,a,s,o,c,u){var d=s&F2,l=hh(t),f=l.length,m=hh(a),p=m.length;if(f!=p&&!d)return!1;for(var b=f;b--;){var w=l[b];if(!(d?w in a:P2.call(a,w)))return!1}var h=u.get(t),M=u.get(a);if(h&&M)return h==a&&M==t;var x=!0;u.set(t,a),u.set(a,t);for(var j=d;++b<f;){w=l[b];var _=t[w],E=a[w];if(o)var C=d?o(E,_,w,a,t,u):o(_,E,w,t,a,u);if(!(C===void 0?_===E||c(_,E,s,o,u):C)){x=!1;break}j||(j=w=="constructor")}if(x&&!j){var A=t.constructor,D=a.constructor;A!=D&&"constructor"in t&&"constructor"in a&&!(typeof A=="function"&&A instanceof A&&typeof D=="function"&&D instanceof D)&&(x=!1)}return u.delete(t),u.delete(a),x}var U2=1,_h="[object Arguments]",yh="[object Array]",wo="[object Object]",B2=Object.prototype,kh=B2.hasOwnProperty;function W2(t,a,s,o,c,u){var d=Io(t),l=Io(a),f=d?yh:Dr(t),m=l?yh:Dr(a);f=f==_h?wo:f,m=m==_h?wo:m;var p=f==wo,b=m==wo,w=f==m;if(w&&Eu(t)){if(!Eu(a))return!1;d=!0,p=!1}if(w&&!p)return u||(u=new Rr),d||zm(t)?Pm(t,a,s,o,c,u):L2(t,a,f,s,o,c,u);if(!(s&U2)){var h=p&&kh.call(t,"__wrapped__"),M=b&&kh.call(a,"__wrapped__");if(h||M){var x=h?t.value():t,j=M?a.value():a;return u||(u=new Rr),c(x,j,s,o,u)}}return w?(u||(u=new Rr),H2(t,a,s,o,c,u)):!1}function Hm(t,a,s,o,c){return t===a?!0:t==null||a==null||!Ya(t)&&!Ya(a)?t!==t&&a!==a:W2(t,a,s,o,Hm,c)}function Y2(t,a){return Hm(t,a)}const jh=({className:t,children:a,colSpan:s,sticky:o=!1,...c})=>{const u=Oe("py-2! pr-6! pl-0! text-left align-top",o&&"sticky top-0 bg-white",c.onClick&&"hover:cursor-pointer",t);return n.jsx("th",{className:u,colSpan:s,...c,children:n.jsx(Et,{className:"whitespace-nowrap",level:6,children:a})})},Um=({left:t,center:a,right:s,sticky:o=!0,containerClassName:c,children:u})=>{const d=Oe("z-50 h-22 min-h-[92px] p-8",!u&&"flex items-center justify-between gap-3",o&&"sticky top-0",c);if(!u){if(t){const l=Oe("flex flex-auto items-center",s&&a&&"basis-1/3",!s&&a&&"basis-1/2");t=n.jsx("div",{className:l,children:t})}if(a){const l=Oe("flex flex-auto items-center justify-center",t&&s&&"basis-1/3",(t&&!s||!t&&s)&&"basis-1/2");a=n.jsx("div",{className:l,children:a})}if(s){const l=Oe("flex flex-auto items-center justify-end",t&&a&&"basis-1/3",!t&&a&&"basis-1/2");s=n.jsx("div",{className:l,children:s})}}return n.jsx("div",{className:d,children:u||n.jsxs(n.Fragment,{children:[t,a,s]})})},Bm=({items:t,setItems:a,blank:s,canAddNewItem:o})=>{const[c,u]=B.useState(t.map((w,h)=>({item:w,id:h.toString()}))),[d,l]=B.useState(s);return B.useEffect(()=>{const w=c.map(({item:h})=>h);o(d)&&w.push(d),Y2(JSON.parse(JSON.stringify(w)),JSON.parse(JSON.stringify(t)))||a(w)},[c,d,t,a,o]),{items:c,updateItem:(w,h)=>{const M=c.map(x=>x.id===w?{...x,item:h}:x);u(M),a(M.map(x=>x.item))},addItem:()=>{if(o(d)){const w=c.reduce((M,x)=>Math.max(M,parseInt(x.id)),0),h=c.concat({item:d,id:(w+1).toString()});u(h),a(h.map(M=>M.item)),l(s)}},removeItem:w=>{const h=c.filter(M=>M.id!==w);u(h),a(h.map(M=>M.item))},moveItem:(w,h)=>{if(w!==h){const M=c.findIndex(_=>_.id===w),x=h?c.findIndex(_=>_.id===h):0,j=I1(c,M,x);u(j),a(j.map(_=>_.item))}},newItem:d,setNewItem:l}},q2=({label:t,text:a="",hint:s,onRegenerate:o})=>{const[c,u]=B.useState(!1),d=()=>{navigator.clipboard.writeText(a),u(!0),setTimeout(()=>u(!1),2e3)},l=Oe("group/api-keys relative -mt-1 mb-1 w-full overflow-hidden border-b border-transparent py-2 hover:border-grey-300 dark:hover:border-grey-600");return n.jsxs("div",{className:"mb-3 grid grid-cols-1",children:[t&&n.jsx(Et,{level:6,grey:!0,children:t}),n.jsxs("div",{className:l,children:[n.jsx("span",{children:a}),s,n.jsxs("div",{className:"visible absolute top-1/2 right-0 flex translate-y-[-50%] gap-1 bg-white pl-1 text-sm group-hover/api-keys:visible md:invisible dark:bg-black",children:[o&&n.jsx(Ke,{color:"outline",label:"Regenerate",size:"sm",onClick:o}),n.jsx(Ke,{color:"outline",label:c?"Copied":"Copy",size:"sm",onClick:d})]})]})]})},Va=({keys:t})=>n.jsx("div",{"data-testid":"api-keys",children:t.map(a=>n.jsx(q2,{...a},a.label))}),us=({icon:t,title:a,detail:s,extra:o})=>n.jsxs("div",{className:"-mx-8 -mt-8 flex flex-col gap-4 bg-grey-75 p-8 md:flex-row dark:bg-grey-950",children:[n.jsx("div",{className:"size-14",children:t}),n.jsxs("div",{className:"mt-1.5 flex min-w-0 flex-1 flex-col",children:[n.jsx("h3",{children:a}),n.jsx("div",{children:s}),o&&n.jsx("div",{className:"mt-4",children:o})]})]}),G2=""+new URL("zapier-logo-D8a11oW_.svg",import.meta.url).href,Ku=ss({method:"POST",path:({integrationId:t,apiKeyId:a})=>`/integrations/${t}/api_key/${a}/refresh/`,body:({integrationId:t})=>({integrations:[{id:t}]}),updateQueries:{emberUpdateType:"createOrUpdate",dataType:Fo,update:(t,a)=>a&&{...a,integrations:a.integrations.map(s=>t.integrations.find(({id:c})=>c===s.id)||s)}}}),X2=Ae.create(()=>{const t=Ae.useModal(),{updateRoute:a}=rt(),{zapierTemplates:s}=A1(),{data:{integrations:o}={integrations:[]}}=zo(),{config:c}=lt(),{mutateAsync:u}=Ku(),d=pt(),[l,f]=B.useState(!1),m=c.hostSettings?.limits?.customIntegrations?.disabled,p=o.find(({slug:h})=>h==="zapier"),b=p?.api_keys?.find(h=>h.type==="admin");B.useEffect(()=>{m&&a("integrations")},[m,a]);const w=()=>{!p||!b||(f(!1),Ae.show(Dt,{title:"Regenerate Admin API Key",prompt:'You will need to locate the Ghost App within your Zapier account and click on "Reconnect" to enter the new Admin API Key.',okLabel:"Regenerate Admin API Key",onOk:async h=>{try{await u({integrationId:p.id,apiKeyId:b.id}),f(!0),h?.remove()}catch(M){d(M)}}}))};return n.jsxs(yt,{afterClose:()=>{a("integrations")},cancelLabel:"",footer:n.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[n.jsxs("a",{className:"mt-1 self-baseline text-sm font-bold",href:"https://zapier.com/apps/ghost/integrations?utm_medium=partner_api&utm_source=widget&utm_campaign=Widget",rel:"noopener noreferrer",target:"_blank",children:["View more Ghost integrations powered by ",n.jsx("span",{children:n.jsx("img",{alt:"Zapier",className:"relative top-[-2px] inline-block",src:G2})})]}),n.jsx(Ke,{color:"black",label:"Close",onClick:()=>{t.remove()}})]}),okColor:"black",okLabel:"Close",testId:"zapier-modal",title:"",stickyFooter:!0,onOk:()=>{a("integrations"),t.remove()},children:[n.jsx(us,{detail:"Automation for your favorite apps",extra:n.jsx("div",{className:"mt-1 -mb-4",children:n.jsx(Va,{keys:[{label:"Admin API key",text:b?.secret,hint:l?n.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:w},{label:"API URL",text:window.location.origin+$r().subdir}]})}),icon:n.jsx(dt,{name:"zapier",size:56}),title:"Zapier"}),n.jsx(pr,{children:s.map(h=>n.jsx(Pr,{action:n.jsx(Ke,{className:"text-sm font-semibold whitespace-nowrap text-[#FF4A00]",href:h.url,label:"Use this Zap",tag:"a",target:"_blank",link:!0,unstyled:!0}),bgOnHover:!1,className:"flex items-center gap-3 py-2 pl-3",title:n.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[n.jsxs("div",{className:"flex shrink-0 flex-nowrap items-center gap-2",children:[n.jsx("img",{className:"size-8 object-contain dark:invert",role:"presentation",src:h.ghostImage}),n.jsx(dt,{name:"arrow-right",size:"xs"}),n.jsx("img",{className:"size-8 object-contain",role:"presentation",src:h.appImage})]}),n.jsx("span",{className:"text-sm",children:h.title})]}),hideActions:!0}))})]})}),Z2=({tier:t})=>{const a=t?.type==="free",{updateRoute:s}=rt(),{mutateAsync:o}=Wu(),{mutateAsync:c}=w_(),{mutateAsync:u}=zr(),[d,l]=xt.useState(!!t?.trial_days),f=pt(),{localSettings:m,siteData:p}=as(),[b]=jt(m,["portal_plans"]),w=JSON.parse(b?.toString()||"[]"),h={name:()=>M.name?void 0:"Enter a name for the tier",monthly_price:()=>M.type!=="free"?Xf(M.monthly_price||0,M.currency,{allowZero:!1}):void 0,yearly_price:()=>M.type!=="free"?Xf(M.yearly_price||0,M.currency,{allowZero:!1}):void 0},{formState:M,saveState:x,updateForm:j,handleSave:_,errors:E,clearError:C,okProps:A}=gn({initialState:{...t||{},trial_days:t?.trial_days?.toString()||"",currency:t?.currency||D1[0].isoCode,visibility:t?.visibility||"none",welcome_page_url:t?.welcome_page_url||null},savingDelay:500,savedDelay:500,onValidate:()=>{const U={};return Object.entries(h).forEach(([K,$])=>{U[K]=$?.()}),U},onSave:async()=>{const{trial_days:U,currency:K,...$}=M,Q=$;if(Q.benefits=Q.benefits?.filter(N=>N),a||(Q.currency=K,Q.trial_days=parseInt(U)),t?.id?await o({...t,...Q}):await c(Q),a){const N=M.visibility==="public";let W=!1;w.includes("free")&&!N&&(w.splice(w.indexOf("free"),1),W=!0),!w.includes("free")&&N&&(w.push("free"),W=!0),W&&await u([{key:"portal_plans",value:JSON.stringify(w)}])}},onSaveError:f}),D=Bm({items:M.benefits||[],setItems:U=>j(K=>({...K,benefits:U})),blank:"",canAddNewItem:U=>!!U}),F=U=>{U.target.checked?(l(!0),j(K=>({...K,trial_days:t?.trial_days?t?.trial_days.toString():"7"}))):(l(!1),j(K=>({...K,trial_days:"0"})))},O=B.useRef(!1);B.useEffect(()=>{O.current&&(h.monthly_price?.(),h.yearly_price?.()),O.current=!0},[M.currency]);const q=()=>{if(t){const U=t.active?"Archive tier":"Reactivate tier",K=t.active?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-6",children:["Members will no longer be able to subscribe to ",n.jsx("strong",{children:t.name})," and it will be removed from the list of available tiers in portal."]}),n.jsx("div",{children:"Existing members on this tier will remain unchanged. Offers using this tier will be disabled."})]}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"mb-6",children:["Reactivating ",n.jsx("strong",{children:t.name})," will re-enable it as an option in portal and allow new members to subscribe to this tier."]}),n.jsx("div",{children:"Existing members will remain unchanged."})]}),$=t.active?"Archive":"Reactivate";Ae.show(Dt,{title:U,prompt:K,okLabel:$,cancelLabel:"Cancel",okColor:t.active?"red":"black",onOk:Q=>{o({...t,active:!t.active}),Q?.remove(),et({type:"success",title:`Tier ${t.active?"archived":"reactivated"}`})}})}};let P={};return t&&(t.active&&t.type!=="free"?P={label:"Archive tier",color:"red",link:!0,onClick:q}:t.active||(P={label:"Reactivate tier",color:"green",link:!0,onClick:q})),n.jsx(yt,{afterClose:()=>{s("tiers")},buttonsDisabled:A.disabled,cancelLabel:"Close",dirty:x==="unsaved",leftButtonProps:P,okColor:A.color,okLabel:A.label||"Save",size:"lg",testId:"tier-detail-modal",title:t?t.active?"Edit tier":"Edit archived tier":"New tier",stickyFooter:!0,onOk:async()=>{await _({fakeWhenUnchanged:!0})},children:n.jsxs("div",{className:"mt-8 -mb-8 flex items-start gap-8",children:[n.jsxs("div",{className:"flex grow flex-col gap-8",children:[n.jsxs(ut,{marginBottom:!1,title:"Basic",grouped:!0,children:[n.jsx(He,{autoComplete:"off",error:!!E.name,hint:E.name,maxLength:191,placeholder:a?"Free":"Bronze",title:"Name",value:M.name||"",autoFocus:!0,onChange:U=>j(K=>({...K,name:U.target.value})),onKeyDown:()=>C("name")}),n.jsx(He,{autoComplete:"off",autoFocus:a,maxLength:191,placeholder:a?"Free preview":"Full access to premium content",title:"Description",value:M.description||"",onChange:U=>j(K=>({...K,description:U.target.value}))}),!a&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"flex flex-col gap-10 md:flex-row",children:[n.jsxs("div",{className:"basis-1/2",children:[n.jsxs("div",{className:"mb-1 flex h-6 items-center justify-between",children:[n.jsx(Et,{level:6,children:"Prices"}),n.jsx("div",{className:"-mr-2 w-[50px]",children:n.jsx(Ht,{border:!1,containerClassName:"font-medium",controlClasses:{menu:"w-18"},options:qf(),selectedOption:qf().flatMap(U=>U.options).find(U=>U.value===M.currency),size:"xs",clearBg:!0,isSearchable:!0,onSelect:U=>j(K=>({...K,currency:U?.value}))})})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(Gf,{error:!!E.monthly_price,hint:E.monthly_price,placeholder:"5",rightPlaceholder:`${M.currency}/month`,title:"Monthly price",valueInCents:M.monthly_price||"",hideTitle:!0,onBlur:U=>U.target.value===""?j(K=>({...K,monthly_price:0})):null,onChange:U=>j(K=>({...K,monthly_price:U})),onKeyDown:()=>C("monthly_price")}),n.jsx(Gf,{error:!!E.yearly_price,hint:E.yearly_price,placeholder:"50",rightPlaceholder:`${M.currency}/year`,title:"Yearly price",valueInCents:M.yearly_price||"",hideTitle:!0,onBlur:U=>U.target.value===""?j(K=>({...K,yearly_price:0})):null,onChange:U=>j(K=>({...K,yearly_price:U})),onKeyDown:()=>C("yearly_price")})]})]}),n.jsxs("div",{className:"basis-1/2",children:[n.jsx("div",{className:"mb-1 flex h-6 flex-col justify-center",children:n.jsx(ot,{checked:d,label:"Add a free trial",labelStyle:"heading",onChange:F})}),n.jsx(He,{disabled:!d,hint:n.jsxs("div",{className:"mt-1",children:["Members will be subscribed at full price once the trial ends. ",n.jsx("a",{className:"text-green",href:"https://ghost.org/help/free-trials/",rel:"noreferrer",target:"_blank",children:"Learn more"})]}),placeholder:"0",rightPlaceholder:"days",title:"Trial days",value:M.trial_days,hideTitle:!0,onChange:U=>j(K=>({...K,trial_days:U.target.value.replace(/[^\d]/,"")}))})]})]})}),n.jsx(Yp,{baseUrl:p?.url,hint:`Redirect to this URL after signup ${a?"":" for premium membership"}`,maxLength:2e3,placeholder:p?.url,title:"Welcome page",value:M.welcome_page_url||null,nullable:!0,transformPathWithoutSlash:!0,onChange:U=>j(K=>({...K,welcome_page_url:U||null}))})]}),n.jsxs(ut,{gap:"none",title:"Benefits",grouped:!0,children:[n.jsx("div",{className:"-mt-3",children:n.jsx(qp,{items:D.items,itemSeparator:!1,renderItem:({id:U,item:K})=>n.jsxs("div",{className:"relative flex w-full items-center gap-5",children:[n.jsx("div",{className:"absolute top-[7px] left-[-32px] flex size-6 items-center justify-center bg-white group-hover:hidden dark:bg-black",children:n.jsx(dt,{name:"check",size:"sm"})}),n.jsx(He,{maxLength:191,value:K,onChange:$=>D.updateItem(U,$.target.value)}),n.jsx(Ke,{className:"absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100",color:"grey",icon:"trash",size:"sm",onClick:()=>D.removeItem(U)})]}),onMove:D.moveItem})}),n.jsxs("div",{className:"relative mt-1 flex items-center gap-3",children:[n.jsx(dt,{className:"dark:text-white",name:"check",size:"sm"}),n.jsx(He,{className:"grow",containerClassName:"w-100",maxLength:191,placeholder:"Expert analysis",title:"New benefit",value:D.newItem,hideTitle:!0,onChange:U=>D.setNewItem(U.target.value),onKeyDown:U=>{U.key==="Enter"&&D.addItem()}}),n.jsx(Ke,{className:"absolute top-[5px] right-[5px] z-10",color:"green",icon:"add",iconColorClass:"text-white",label:"Add",size:"sm",hideLabel:!0,onClick:()=>D.addItem()})]})]})]}),n.jsx("div",{className:"sticky top-[96px] hidden shrink-0 basis-[380px] min-[920px]:!visible min-[920px]:!block",children:n.jsx(O1,{isFreeTier:a,tier:M})})]})})},K2=({params:t})=>{const{data:{tiers:a,isEnd:s}={},fetchNextPage:o}=is();let c;return B.useEffect(()=>{t?.id&&!c&&!s&&o()},[o,s,t?.id,c]),t?.id&&(c=a?.find(({id:u})=>u===t?.id),!c)?null:n.jsx(Z2,{tier:c})},V2=Ae.create(K2);var qc,Mh;function Wm(){if(Mh)return qc;Mh=1;var t={};return qc=typeof process=="object"&&t&&t.NODE_DEBUG&&/\bsemver\b/i.test(t.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{},qc}var Gc,Eh;function Ym(){if(Eh)return Gc;Eh=1;const t="2.0.0",a=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,o=16,c=a-6;return Gc={MAX_LENGTH:a,MAX_SAFE_COMPONENT_LENGTH:o,MAX_SAFE_BUILD_LENGTH:c,MAX_SAFE_INTEGER:s,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Gc}var vo={exports:{}},Th;function Q2(){return Th||(Th=1,(function(t,a){const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:o,MAX_LENGTH:c}=Ym(),u=Wm();a=t.exports={};const d=a.re=[],l=a.safeRe=[],f=a.src=[],m=a.safeSrc=[],p=a.t={};let b=0;const w="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",c],[w,o]],M=j=>{for(const[_,E]of h)j=j.split(`${_}*`).join(`${_}{0,${E}}`).split(`${_}+`).join(`${_}{1,${E}}`);return j},x=(j,_,E)=>{const C=M(_),A=b++;u(j,A,_),p[j]=A,f[A]=_,m[A]=C,d[A]=new RegExp(_,E?"g":void 0),l[A]=new RegExp(C,E?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),x("MAINVERSION",`(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})\\.(${f[p.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})\\.(${f[p.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${f[p.NONNUMERICIDENTIFIER]}|${f[p.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASE",`(?:-(${f[p.PRERELEASEIDENTIFIER]}(?:\\.${f[p.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${f[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${f[p.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${w}+`),x("BUILD",`(?:\\+(${f[p.BUILDIDENTIFIER]}(?:\\.${f[p.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${f[p.MAINVERSION]}${f[p.PRERELEASE]}?${f[p.BUILD]}?`),x("FULL",`^${f[p.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${f[p.MAINVERSIONLOOSE]}${f[p.PRERELEASELOOSE]}?${f[p.BUILD]}?`),x("LOOSE",`^${f[p.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${f[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${f[p.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:\\.(${f[p.XRANGEIDENTIFIER]})(?:${f[p.PRERELEASE]})?${f[p.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${f[p.XRANGEIDENTIFIERLOOSE]})(?:${f[p.PRERELEASELOOSE]})?${f[p.BUILD]}?)?)?`),x("XRANGE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${f[p.GTLT]}\\s*${f[p.XRANGEPLAINLOOSE]}$`),x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),x("COERCE",`${f[p.COERCEPLAIN]}(?:$|[^\\d])`),x("COERCEFULL",f[p.COERCEPLAIN]+`(?:${f[p.PRERELEASE]})?(?:${f[p.BUILD]})?(?:$|[^\\d])`),x("COERCERTL",f[p.COERCE],!0),x("COERCERTLFULL",f[p.COERCEFULL],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${f[p.LONETILDE]}\\s+`,!0),a.tildeTrimReplace="$1~",x("TILDE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${f[p.LONETILDE]}${f[p.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${f[p.LONECARET]}\\s+`,!0),a.caretTrimReplace="$1^",x("CARET",`^${f[p.LONECARET]}${f[p.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${f[p.LONECARET]}${f[p.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${f[p.GTLT]}\\s*(${f[p.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${f[p.GTLT]}\\s*(${f[p.LOOSEPLAIN]}|${f[p.XRANGEPLAIN]})`,!0),a.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${f[p.XRANGEPLAIN]})\\s+-\\s+(${f[p.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${f[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${f[p.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(vo,vo.exports)),vo.exports}var Xc,Nh;function J2(){if(Nh)return Xc;Nh=1;const t=Object.freeze({loose:!0}),a=Object.freeze({});return Xc=o=>o?typeof o!="object"?t:o:a,Xc}var Zc,Ch;function ek(){if(Ch)return Zc;Ch=1;const t=/^[0-9]+$/,a=(o,c)=>{if(typeof o=="number"&&typeof c=="number")return o===c?0:o<c?-1:1;const u=t.test(o),d=t.test(c);return u&&d&&(o=+o,c=+c),o===c?0:u&&!d?-1:d&&!u?1:o<c?-1:1};return Zc={compareIdentifiers:a,rcompareIdentifiers:(o,c)=>a(c,o)},Zc}var Kc,Sh;function tk(){if(Sh)return Kc;Sh=1;const t=Wm(),{MAX_LENGTH:a,MAX_SAFE_INTEGER:s}=Ym(),{safeRe:o,t:c}=Q2(),u=J2(),{compareIdentifiers:d}=ek();class l{constructor(m,p){if(p=u(p),m instanceof l){if(m.loose===!!p.loose&&m.includePrerelease===!!p.includePrerelease)return m;m=m.version}else if(typeof m!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof m}".`);if(m.length>a)throw new TypeError(`version is longer than ${a} characters`);t("SemVer",m,p),this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease;const b=m.trim().match(p.loose?o[c.LOOSE]:o[c.FULL]);if(!b)throw new TypeError(`Invalid Version: ${m}`);if(this.raw=m,this.major=+b[1],this.minor=+b[2],this.patch=+b[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");b[4]?this.prerelease=b[4].split(".").map(w=>{if(/^[0-9]+$/.test(w)){const h=+w;if(h>=0&&h<s)return h}return w}):this.prerelease=[],this.build=b[5]?b[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(m){if(t("SemVer.compare",this.version,this.options,m),!(m instanceof l)){if(typeof m=="string"&&m===this.version)return 0;m=new l(m,this.options)}return m.version===this.version?0:this.compareMain(m)||this.comparePre(m)}compareMain(m){return m instanceof l||(m=new l(m,this.options)),this.major<m.major?-1:this.major>m.major?1:this.minor<m.minor?-1:this.minor>m.minor?1:this.patch<m.patch?-1:this.patch>m.patch?1:0}comparePre(m){if(m instanceof l||(m=new l(m,this.options)),this.prerelease.length&&!m.prerelease.length)return-1;if(!this.prerelease.length&&m.prerelease.length)return 1;if(!this.prerelease.length&&!m.prerelease.length)return 0;let p=0;do{const b=this.prerelease[p],w=m.prerelease[p];if(t("prerelease compare",p,b,w),b===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(b===void 0)return-1;if(b===w)continue;return d(b,w)}while(++p)}compareBuild(m){m instanceof l||(m=new l(m,this.options));let p=0;do{const b=this.build[p],w=m.build[p];if(t("build compare",p,b,w),b===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(b===void 0)return-1;if(b===w)continue;return d(b,w)}while(++p)}inc(m,p,b){if(m.startsWith("pre")){if(!p&&b===!1)throw new Error("invalid increment argument: identifier is empty");if(p){const w=`-${p}`.match(this.options.loose?o[c.PRERELEASELOOSE]:o[c.PRERELEASE]);if(!w||w[1]!==p)throw new Error(`invalid identifier: ${p}`)}}switch(m){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",p,b);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",p,b);break;case"prepatch":this.prerelease.length=0,this.inc("patch",p,b),this.inc("pre",p,b);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",p,b),this.inc("pre",p,b);break;case"release":if(this.prerelease.length===0)throw new 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":{const w=Number(b)?1:0;if(this.prerelease.length===0)this.prerelease=[w];else{let h=this.prerelease.length;for(;--h>=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(p===this.prerelease.join(".")&&b===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(w)}}if(p){let h=[p,w];b===!1&&(h=[p]),d(this.prerelease[0],p)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${m}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Kc=l,Kc}var Vc,Ih;function nk(){if(Ih)return Vc;Ih=1;const t=tk();return Vc=(s,o,c=!1)=>{if(s instanceof t)return s;try{return new t(s,o)}catch(u){if(!c)return null;throw u}},Vc}var rk=nk();const sk=Lu(rk);function ak(t){if(!t)return"";const a=t.indexOf("+"),s=a!==-1?t.slice(a+1):"",o=a!==-1?t.slice(0,a):t;if(s&&s!=="moya"){const c=s.split("."),u=c[c.length-1];if(u&&/^[0-9a-f]{7,40}$/.test(u))return`https://github.com/TryGhost/Ghost/commit/${u}`}try{const u=sk(o,{includePrerelease:!0})?.prerelease;if(u&&u.length>0){const l=String(u[0]).split("-")[1];return l?.startsWith("g")?`https://github.com/TryGhost/Ghost/commit/${l.slice(1)}`:""}}catch{return""}return`https://github.com/TryGhost/Ghost/releases/tag/v${o}`}function ik(t,a){const s=!!t.match?.(/production/i);return!!(s&&a!=="mysql8"||!s&&a==="mysql5")}function ok({label:t,version:a}){const s=ak(a);return n.jsxs("div",{children:[n.jsxs("strong",{children:[t,":"]})," ",s?n.jsx("a",{className:"text-green",href:s,rel:"noopener noreferrer",target:"_blank",children:a}):a]})}const lk=Ae.create(({})=>{const{updateRoute:t}=rt();let s=lt().config;const o=R1();function c(){return new Date().getFullYear()}function u(){return!!s.enableDeveloperExperiments}function d(){return!s.hostSettings?.siteId}return n.jsx(yt,{afterClose:()=>{t("")},cancelLabel:"",footer:n.jsx(n.Fragment,{}),topRightContent:"close",width:540,children:n.jsxs("div",{className:"flex flex-col gap-4 pb-7 text-sm",children:[n.jsx($1,{className:"h-auto w-[120px] dark:invert"}),n.jsxs("div",{className:"mt-3 flex flex-col gap-1.5",children:[o?.message&&n.jsxs("div",{className:"gh-prose-links mb-4 rounded-sm border border-green p-5",children:[n.jsx("strong",{children:"Update available!"}),n.jsx("div",{dangerouslySetInnerHTML:{__html:o.message}})]}),n.jsx(ok,{label:"Version",version:s.version}),d()&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{children:[n.jsx("strong",{children:"Environment:"})," ",s.environment]}),n.jsxs("div",{children:[n.jsx("strong",{children:"Database:"})," ",s.database]}),n.jsxs("div",{children:[n.jsx("strong",{children:"Mail:"})," ",s.mail?s.mail:"Native"]})]}),u()&&n.jsxs("div",{children:[n.jsx("strong",{children:"Developer experiments:"})," Enabled"]}),d()&&ik(s.environment,s.database)&&n.jsxs("div",{className:"text-red-500 dark:text-red-400",children:["You are running an unsupported database in production. Please ",n.jsx("a",{href:"https://ghost.org/docs/faq/supported-databases/",rel:"noopener noreferrer",target:"_blank",children:"upgrade to MySQL 8"}),"."]})]}),n.jsx(Hs,{}),n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.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:[n.jsx(dt,{name:"book-open",size:"sm"})," User documentation"]}),n.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:[n.jsx(dt,{name:"question-circle",size:"sm"})," Get help with Ghost"]}),n.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:[n.jsx(dt,{name:"angle-brackets",size:"sm"})," Get involved"]})]}),n.jsx(Hs,{}),n.jsxs("p",{className:"max-w-[460px] text-xs",children:["Copyright © 2013 – ",c()," Ghost Foundation, released under the ",n.jsx("a",{className:"text-green",href:"https://github.com/TryGhost/Ghost/blob/main/LICENSE",rel:"noopener noreferrer",target:"_blank",children:"MIT license"}),". ",n.jsx("a",{className:"text-green",href:"https://ghost.org/",rel:"noopener noreferrer",target:"_blank",children:"Ghost"})," is a registered trademark of ",n.jsx("a",{className:"text-green",href:"https://ghost.org/trademark/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Foundation Ltd"}),"."]})]})})}),ck=()=>{const t=Wt(),{updateRoute:a}=rt(),[s,o]=B.useState(""),[c,u]=B.useState({name:""}),{mutateAsync:d}=L1(),l=Bs(),f=pt();return B.useEffect(()=>{l?.isLimited("customIntegrations")&&l.errorIfWouldGoOverLimit("customIntegrations").catch(m=>{m instanceof Ws&&(Ae.show(gr,{prompt:m.message||"Your current plan doesn't support more custom integrations.",onOk:()=>a({route:"/pro",isExternal:!0})}),t.remove(),a("integrations"))})},[l,t,a]),n.jsx(yt,{afterClose:()=>{a("integrations")},okColor:"black",okLabel:"Add",size:"sm",testId:"add-integration-modal",title:"Add integration",onOk:async()=>{if(!s){u({name:"Name is required"});return}try{const m=await d({name:s});t.remove(),a({route:`integrations/${m.integrations[0].id}`})}catch(m){f(m)}},children:n.jsx("div",{className:"mt-5",children:n.jsx(ut,{marginBottom:!1,marginTop:!1,children:n.jsx(He,{autoFocus:!0,error:!!c.name,hint:c.name,maxLength:191,placeholder:"Custom integration",title:"Name",value:s,onChange:m=>o(m.target.value),onInput:()=>{c.name&&u({name:""})}})})})})},uk=Ae.create(ck),dk=()=>{const t=Wt(),{updateRoute:a}=rt(),s=pt(),[o,c]=B.useState(!0),[u,d]=B.useState(null),{data:l}=zp({searchParams:{filter:"newsletters.status:active+email_disabled:0",limit:"1",page:"1",include:"newsletters,labels"}}),{mutateAsync:f}=i_(),{formState:m,updateForm:p,saveState:b,handleSave:w,errors:h,clearError:M}=gn({initialState:{name:"",description:"",optInExistingSubscribers:!0},onSave:async()=>{const _=await f({name:m.name,description:m.description,opt_in_existing:m.optInExistingSubscribers,feedback_enabled:!0});a({route:`newsletters/${_.newsletters[0].id}`})},onSaveError:s,onValidate:()=>{const _={};return m.name||(_.name="A name is required for your newsletter"),_}}),x=Bs();B.useEffect(()=>{if(!x){c(!1);return}x.errorIfWouldGoOverLimit("newsletters").catch(_=>{if(_ instanceof Ws)d(_);else throw _}).finally(()=>{c(!1)})},[x]);const j=l?.meta?.pagination.total;return B.useEffect(()=>{u&&(Ae.show(gr,{prompt:u.message||"Your current plan doesn't support more newsletters.",onOk:()=>a({route:"/pro",isExternal:!0})}),t.remove(),a("newsletters"))},[u,t,a]),o||u?null:n.jsx(yt,{afterClose:()=>{a("newsletters")},backDropClick:!1,okColor:"black",okDisabled:b==="saving",okLabel:"Create",okLoading:b==="saving",size:"sm",testId:"add-newsletter-modal",title:"Create newsletter",onOk:async()=>{await w()&&t.remove()},children:n.jsxs(ut,{marginBottom:!1,marginTop:!0,children:[n.jsx(He,{autoFocus:!0,error:!!h.name,hint:h.name,maxLength:191,placeholder:"Weekly roundup",title:"Name",value:m.name,onChange:_=>p(E=>({...E,name:_.target.value})),onKeyDown:()=>M("name")}),n.jsx(xr,{maxLength:2e3,title:"Description",value:m.description,onChange:_=>p(E=>({...E,description:_.target.value}))}),n.jsx(ot,{checked:m.optInExistingSubscribers,direction:"rtl",hint:m.optInExistingSubscribers?`This newsletter will be available to all members. Your ${j===void 0?"":La(j)} existing subscriber${l?.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:_=>p(E=>({...E,optInExistingSubscribers:_.target.checked}))})]})})},fk=Ae.create(dk),hk=Ae.create(()=>{const t=Ae.useModal(),{updateRoute:a}=rt(),{data:{integrations:s}={integrations:[]}}=zo(),c=s.find(({slug:u})=>u==="ghost-core-content")?.api_keys?.find(u=>u.type==="content");return n.jsxs(yt,{afterClose:()=>{a("integrations")},cancelLabel:"",footer:n.jsxs("div",{className:"mx-8 flex w-full items-center justify-between",children:[n.jsx(Ke,{color:"outline",href:"https://ghost.org/docs/content-api/",label:n.jsxs("span",{className:"flex items-center gap-1",children:["Open docs ",n.jsx(dt,{name:"arrow-top-right",size:"xs"})]}),rel:"noopener noreferrer",tag:"a",target:"_blank"}),n.jsx(Ke,{color:"black",label:"Close",onClick:()=>{a("integrations"),t.remove()}})]}),testId:"content-api-modal",title:"",stickyFooter:!0,children:[n.jsx(us,{detail:"Access your content programmatically",icon:n.jsx(dt,{name:"angle-brackets",size:56}),title:"Content API"}),n.jsxs("div",{className:"mt-7",children:[n.jsx("p",{className:"mb-6 text-sm text-grey-700",children:"This key provides read-only access to your published content. For full read/write access, create a custom integration."}),n.jsx(Va,{keys:[{label:"Content API key",text:c?.secret},{label:"API URL",text:window.location.origin+$r().subdir}]})]})]})}),pk=({recommendation:t,animate:a})=>{const s=Wt(),{updateRoute:o,route:c}=rt(),{mutateAsync:u}=F1(),d=pt(),{formState:l,updateForm:f,handleSave:m,saveState:p,errors:b,clearError:w,setErrors:h}=gn({initialState:{...t},onSave:async _=>{await u(_),s.remove(),et({title:"Recommendation added",type:"success"}),P1("Recommendation Added",{oneClickSubscribe:_.one_click_subscribe}),o("recommendations")},onSaveError:d,onValidate:_=>z1(_)});let M="Add",x=!1;p==="saving"?x=!0:p==="saved"&&(M="Added");let j={label:"Back",icon:"arrow-left",iconColorClass:"text-black dark:text-white",link:!0,size:"sm",onClick:()=>{p!=="saving"&&(s.remove(),Ae.show(qm,{pathName:c,animate:!1,recommendation:{...l}}))}};return n.jsx(yt,{afterClose:()=>{o("recommendations")},animate:a??!0,backDropClick:!1,cancelLabel:"Cancel",dirty:!0,leftButtonProps:j,okColor:"black",okLabel:M,okLoading:x,size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",stickyFooter:!0,onCancel:()=>{p!=="saving"&&(s.remove(),o("recommendations"))},onOk:async()=>{if(p!=="saving"){Pp();try{await m({force:!0})}catch{et({type:"error",title:"Something went wrong when adding this recommendation, please try again."})}}},children:n.jsx(H1,{clearError:w,errors:b,formState:l,setErrors:h,showURL:!1,updateForm:f})})},mk=Ae.create(pk),Ah=t=>No(t).save||"",gk=function(t,a){try{new URL(a).hostname.includes(".")?delete t.url:t.url="Enter a valid URL"}catch{t.url="Enter a valid URL"}return t},xk=({searchParams:t,recommendation:a,animate:s})=>{const[o,c]=B.useState(!1),u=Wt(),{updateRoute:d}=rt(),{mutateAsync:l}=U1(),f=a?"":t?.get("url")??"",{save:m}=f?No(f):{save:""},p=xt.useRef(!1),[b,w]=xt.useState(!!m),{formState:h,updateForm:M,handleSave:x,errors:j,saveState:_,clearError:E}=gn({initialState:a??{title:"",url:m||"",description:"",excerpt:null,featured_image:null,favicon:null,one_click_subscribe:!1},onSave:async()=>{let A;A=new URL(h.url);const D=A.hostname.replace("www.",""),F={...h,url:A.toString()},{recommendations:O=[]}=await l(A);if(!O||O.length===0)return;const q=O[0];if(q.id)throw new Uf("A recommendation with this URL already exists.");F.title=q.title??D,F.excerpt=q.excerpt??F.excerpt,F.featured_image=q.featured_image??F.featured_image??null,F.favicon=q.favicon??F.favicon??null,F.one_click_subscribe=q.one_click_subscribe??F.one_click_subscribe??!1,F.description=F.excerpt||null,u.remove(),Ae.show(mk,{animate:!1,recommendation:F})},onValidate:()=>{const A={};return gk(A,h.url),b&&w(Object.keys(A).length===0),A}}),C=xt.useCallback(async()=>{if(_!=="saving"){Pp();try{if(await x({force:!0}))return}catch(A){const D=A instanceof Uf?A.message:"Something went wrong while checking this URL, please try again.";et({type:"error",title:D})}b&&w(!1)}},[x,_,b,w]);return xt.useEffect(()=>{b&&!p.current&&(p.current=!0,C())},[b,C]),B.useEffect(()=>{o&&(C(),c(!1))},[h]),b?n.jsx(yt,{afterClose:()=>{d("recommendations")},animate:s??!0,backDropClick:!1,footer:!1,header:!1,size:"sm",children:n.jsx("div",{className:"flex flex-col items-center justify-center p-8",children:n.jsx(Co,{})})}):n.jsxs(yt,{afterClose:()=>{d("recommendations")},animate:s??!0,backDropClick:!1,okColor:"black",okLabel:"Next",okLoading:_==="saving",size:"sm",testId:"add-recommendation-modal",title:"Add recommendation",onOk:C,children:[n.jsxs("p",{className:"mt-4",children:["You can recommend ",n.jsx("strong",{children:"any site"})," your audience will find valuable, not just those published on Ghost."]}),n.jsx(ut,{marginBottom:!1,marginTop:!0,children:n.jsx(He,{autoFocus:!0,error:!!j.url,hint:j.url||n.jsxs(n.Fragment,{children:["Need inspiration? ",n.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:h.url,onBlur:()=>{const A=Ah(h.url);M(D=>({...D,url:A}))},onChange:A=>{E?.("url"),M(D=>({...D,url:A.target.value}))},onKeyDown:A=>{A.key==="Enter"&&(A.preventDefault(),M(D=>({...D,url:Ah(h.url)})),c(!0))}})})]})},qm=Ae.create(xk);function bk(t,a){let s;return function(...c){const u=()=>{clearTimeout(s),t(...c)};clearTimeout(s),s=setTimeout(u,a)}}const Vu=({generateContent:t,className:a,height:s,width:o,parentClassName:c,testId:u,addDelay:d=!1})=>{const[l,f]=B.useState(0),m=[B.useRef(null),B.useRef(null)],[p,b]=B.useState(0);return B.useEffect(()=>{const w=l===0?1:0,h=m[w].current;if(h){t(h);const M=()=>{d?setTimeout(()=>{f(w)},500):f(w)};return h.addEventListener("load",M),()=>{h.removeEventListener("load",M)}}},[t]),B.useEffect(()=>{const w=m[l].current,h=bk(()=>{b(w?.contentWindow?.scrollY||0)},250);return w?.contentWindow?.addEventListener("scroll",h),()=>{w?.contentWindow?.removeEventListener("scroll",h)}},[l,m]),B.useEffect(()=>{const w=m[l].current;if(w)try{w.contentWindow?.scrollTo(0,p)}catch(h){Xv(h)}},[p,l,m]),n.jsxs("div",{className:c,"data-testid":u,children:[n.jsx("iframe",{ref:m[0],className:`${a} ${l!==0?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":l===0,frameBorder:"0",height:s,title:"Buffered Preview 1",width:o}),n.jsx("iframe",{ref:m[1],className:`${a} ${l!==1?"z-10 opacity-0":"z-20 opacity-100"}`,"data-visible":l===1,frameBorder:"0",height:s,title:"Buffered Preview 2",width:o})]})},wk=(t,a,s)=>{const o=new URLSearchParams;return o.append("announcement_bg",t||"accent"),o.append("announcement",a||""),s&&s.length>0&&o.append("announcement_vis",s?.join(",")||""),o.toString()},vk=({announcementBackgroundColor:t,announcementContent:a,url:s,visibility:o})=>{const c=B.useMemo(()=>o,[o?.join(",")]),u=B.useCallback(d=>{s&&fetch(s,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":wk(t,a,c),Accept:"text/plain"},mode:"cors",credentials:"include"}).then(l=>l.text()).then(l=>{const f="html { pointer-events: none; }",p=new DOMParser().parseFromString(l,"text/html"),b=p.querySelector("style"),w=b.innerHTML;b.innerHTML=`${w}
|
|
3
3
|
|
|
4
4
|
${f}`;let M=(p.doctype?new XMLSerializer().serializeToString(p.doctype):"")+p.documentElement.outerHTML;d.contentDocument?.open(),d.contentDocument?.write(M),d.contentDocument?.close()}).catch(()=>{})},[t,a,s,c]);return n.jsx(Vu,{addDelay:!0,className:"absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]",generateContent:u,height:"100%",parentClassName:"relative h-full w-full",testId:"announcement-bar-preview-iframe",width:"100%"})},_k=({announcementContent:t,announcementTextHandler:a,accentColor:s,announcementBackgroundColor:o,toggleColorSwatch:c,toggleVisibility:u,visibility:d=[],paidMembersEnabled:l,onBlur:f})=>{const m=[{label:"Public visitors",onChange:p=>{u("visitors",p)},value:"visitors",checked:d.includes("visitors")},{label:"Free members",onChange:p=>{u("free_members",p)},value:"free_members",checked:d.includes("free_members")},...l?[{label:"Paid members",onChange:p=>{u("paid_members",p)},value:"paid_members",checked:d.includes("paid_members")}]:[]];return n.jsxs(ut,{children:[n.jsx(qu,{nodes:"MINIMAL_NODES",placeholder:"Highlight breaking news, offers or updates",title:"Announcement",value:t,onBlur:f,onChange:a}),n.jsx(pm,{isExpanded:!1,picker:!1,swatches:[{hex:"#08090c",title:"Dark",value:"dark"},{hex:"#ffffff",title:"Light",value:"light"},{hex:s||"#ffdd00",title:"Accent",value:"accent"}],swatchSize:"lg",title:"Background color",value:o,onSwatchChange:p=>{p!==null&&c(p)},onTogglePicker:()=>{}}),n.jsx(_u,{checkboxes:m,title:"Visibility"})]})},yk=()=>{const{siteData:t}=lt(),{localSettings:a,updateSetting:s,handleSave:o,okProps:c}=as({savingDelay:500}),[u]=jt(a,["announcement_content"]),[d]=jt(a,["accent_color"]),[l]=jt(a,["announcement_background"]),[f]=jt(a,["announcement_visibility"]),[m]=jt(a,["paid_members_enabled"]),p=JSON.parse(f?.toString()||"[]"),{updateRoute:b}=rt(),[w,h]=B.useState("homepage"),M=O=>{s("announcement_background",O)},x=(O,q)=>{const P=p.indexOf(O);P===-1&&q?p.push(O):p.splice(P,1),s("announcement_visibility",JSON.stringify(p))},j=B.useRef(Lo(O=>{s("announcement_content",O)},500)),_=n.jsx(_k,{accentColor:d,announcementBackgroundColor:l,announcementContent:u,announcementTextHandler:O=>{j.current(O)},paidMembersEnabled:m,toggleColorSwatch:M,toggleVisibility:x,visibility:f,onBlur:()=>{}}),{data:{posts:[E]}={posts:[]}}=om({searchParams:{filter:"status:published",order:"published_at DESC",limit:"1",fields:"id,url"}});let C=[];E&&(C=[{id:"homepage",title:"Homepage"},{id:"post",title:"Post"}]);const A=O=>{C.length&&h(O)};let D=Qn(t);switch(w){case"homepage":D=Qn(t);break;case"post":D=E.url;break}const F=n.jsx(vk,{announcementBackgroundColor:l,announcementContent:u,url:D,visibility:p});return n.jsx(os,{afterClose:()=>{b("announcement-bar")},buttonsDisabled:c.disabled,cancelLabel:"Close",deviceSelector:!0,dirty:!1,okColor:c.color,okLabel:c.label||"Save",preview:F,previewBgColor:"greygradient",previewToolbarTabs:C,selectedURL:w,sidebar:_,testId:"announcement-bar-modal",title:"Announcement",titleHeadingLevel:5,onOk:async()=>{await o({fakeWhenUnchanged:!0})||et({type:"error",message:"An error occurred while saving your changes. Please try again."})},onSelectURL:A})},kk=Ae.create(yk),Su=[{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"}]}],jk=t=>Su.flatMap(({options:s})=>s).find(s=>s.value===t)?.label,Mk=ss({method:"POST",path:()=>"/webhooks/",body:t=>({webhooks:[t]}),updateQueries:{dataType:Fo,emberUpdateType:"createOrUpdate",update:(t,a)=>a&&{...a,integrations:a.integrations.map(s=>{const o=t.webhooks[0];return o.integration_id===s.id?{...s,webhooks:[...s.webhooks||[],o]}:s})}}}),Ek=ss({method:"PUT",path:t=>`/webhooks/${t.id}/`,body:t=>({webhooks:[t]}),updateQueries:{dataType:Fo,emberUpdateType:"createOrUpdate",update:(t,a)=>a&&{...a,integrations:a.integrations.map(s=>({...s,webhooks:s.webhooks?.map(o=>o.id===t.webhooks[0].id?t.webhooks[0]:o)}))}}}),Tk=ss({method:"DELETE",path:t=>`/webhooks/${t}/`,updateQueries:{dataType:Fo,emberUpdateType:"createOrUpdate",update:(t,a,s)=>({...a,integrations:a.integrations.map(o=>({...o,webhooks:o.webhooks?.filter(c=>c.id!==s)}))})}}),Nk=({webhook:t,integrationId:a})=>{const s=Wt(),{mutateAsync:o}=Mk(),{mutateAsync:c}=Ek(),u=pt(),{formState:d,updateForm:l,handleSave:f,errors:m,clearError:p}=gn({initialState:t||{},onSave:async()=>{d.id?await c(d):await o({...d,integration_id:a})},onSaveError:u,onValidate:()=>{const b={};return d.name||(b.name="Enter a name"),d.event||(b.event="Select an event"),d.target_url||(b.target_url="Enter a target URL"),d.target_url&&!er.isURL(d.target_url,{require_tld:!1})&&(b.target_url="Enter a valid URL"),b}});return n.jsx(yt,{okColor:"black",okLabel:t?"Update":"Add",size:"sm",testId:"webhook-modal",title:"Add webhook",formSheet:!0,onOk:async()=>{await f()&&s.remove()},children:n.jsx("div",{className:"mt-5",children:n.jsxs(ut,{marginBottom:!1,marginTop:!1,children:[n.jsx(He,{error:!!m.name,hint:m.name,maxLength:191,placeholder:"Custom webhook",title:"Name",value:d.name,onChange:b=>l(w=>({...w,name:b.target.value})),onKeyDown:()=>p("name")}),n.jsx(Ht,{error:!!m.event,hint:m.event,options:Su,prompt:"Select an event",selectedOption:Su.flatMap(b=>b.options).find(b=>b.value===d.event),testId:"event-select",title:"Event",hideTitle:!0,onSelect:b=>{l(w=>({...w,event:b?.value})),p("event")}}),n.jsx(He,{error:!!m.target_url,hint:m.target_url,maxLength:2e3,placeholder:"https://example.com",title:"Target URL",type:"url",value:d.target_url,onChange:b=>l(w=>({...w,target_url:b.target.value})),onKeyDown:()=>p("target_url")}),n.jsx(He,{maxLength:191,placeholder:"https://example.com",title:"Secret",value:d.secret||void 0,onChange:b=>l(w=>({...w,secret:b.target.value}))})]})})})},Dh=Ae.create(Nk),Ck=({integration:t})=>{const{mutateAsync:a}=Tk(),s=pt(),o=c=>{Ae.show(Dt,{title:"Are you sure?",prompt:"Deleting this webhook may prevent the integration from functioning.",okColor:"red",okLabel:"Delete Webhook",onOk:async u=>{try{await a(c),u?.remove(),et({message:"Webhook deleted",type:"info"})}catch(d){s(d)}}})};return n.jsxs("div",{children:[n.jsxs(B1,{children:[n.jsxs(Zf,{bgOnHover:!1,children:[n.jsxs(jh,{children:[t.webhooks?.length||0," ",t.webhooks?.length===1?"webhook":"webhooks"]}),n.jsx(jh,{children:"Last triggered"})]}),t.webhooks?.map(c=>n.jsxs(Zf,{action:n.jsx(Ke,{color:"red",label:"Delete",link:!0,onClick:u=>{u?.stopPropagation(),o(c.id)}}),bgOnHover:!1,hideActions:!0,onClick:()=>{Ae.show(Dh,{webhook:c,integrationId:t.id})},children:[n.jsxs(Kf,{className:"w-3/4",children:[n.jsx("div",{className:"text-sm font-semibold",children:c.name}),n.jsxs("div",{className:"grid grid-cols-[max-content_1fr] gap-x-1 text-xs leading-snug",children:[n.jsx("span",{className:"text-grey-600",children:"Event:"}),n.jsx("span",{children:jk(c.event)}),n.jsx("span",{className:"text-grey-600",children:"URL:"}),n.jsx("span",{className:"line-clamp-3 break-all",title:c.target_url,children:c.target_url})]})]}),n.jsx(Kf,{className:"w-1/4 text-sm",children:c.last_triggered_at&&new Date(c.last_triggered_at).toLocaleString("default",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}))]}),n.jsx("div",{className:"mt-5",children:n.jsx(Ke,{color:"green",icon:"add",iconColorClass:"text-green",label:"Add webhook",size:"sm",link:!0,onClick:()=>{Ae.show(Dh,{integrationId:t.id})}})})]})},Sk=({integration:t})=>{const a=Wt(),{updateRoute:s}=rt(),{mutateAsync:o}=W1(),{mutateAsync:c}=Ku(),{mutateAsync:u}=Ys(),d=pt(),{formState:l,updateForm:f,handleSave:m,saveState:p,errors:b,clearError:w,okProps:h}=gn({initialState:t,savingDelay:500,savedDelay:500,onSave:async()=>{await o(l)},onSavedStateReset:()=>{s("integrations")},onSaveError:d,onValidate:()=>{const D={};return l.name||(D.name="Enter integration title"),D}}),M=t.api_keys?.find(D=>D.type==="admin"),x=t.api_keys?.find(D=>D.type==="content"),[j,_]=B.useState(!1),[E,C]=B.useState(!1);B.useEffect(()=>{t.type!=="custom"&&(a.remove(),s("integrations"))},[t.type,a,s]);const A=(D,F)=>{F(!1);const O=D.type==="content"?"Content":"Admin";Ae.show(Dt,{title:`Regenerate ${O} API Key`,prompt:`You can regenerate ${O} API Key any time, but any scripts or applications using it will need to be updated.`,okLabel:`Regenerate ${O} API Key`,onOk:async q=>{try{await c({integrationId:t.id,apiKeyId:D.id}),F(!0),q?.remove()}catch(P){d(P)}}})};return n.jsxs(yt,{afterClose:()=>{s("integrations")},buttonsDisabled:h.disabled,cancelLabel:"Close",dirty:p==="unsaved",okColor:h.color,okLabel:h.label||"Save",size:"md",testId:"custom-integration-modal",title:l.name||"Custom integration",stickyFooter:!0,onOk:async()=>{await m({fakeWhenUnchanged:!0})},children:[n.jsxs("div",{className:"mt-7 flex w-full flex-col gap-7 md:flex-row",children:[n.jsx("div",{children:n.jsx(mr,{height:"100px",id:"custom-integration-icon",imageURL:l.icon_image||void 0,width:"100px",onDelete:()=>f(D=>({...D,icon_image:null})),onUpload:async D=>{try{const F=hr(await u({file:D}));f(O=>({...O,icon_image:F}))}catch(F){const O=F;O.response.status===415&&(O.message="Unsupported file type"),d(O)}},children:"Upload icon"})}),n.jsx("div",{className:"flex grow flex-col",children:n.jsxs(ut,{children:[n.jsx(He,{error:!!b.name,hint:b.name,maxLength:191,title:"Title",value:l.name,onChange:D=>f(F=>({...F,name:D.target.value})),onKeyDown:()=>w("name")}),n.jsx(He,{maxLength:2e3,title:"Description",value:l.description||"",onChange:D=>f(F=>({...F,description:D.target.value}))}),n.jsx(Va,{keys:[{label:"Content API key",text:x?.secret,hint:E?n.jsx("div",{className:"text-green",children:"Content API Key was successfully regenerated"}):void 0,onRegenerate:()=>x&&A(x,C)},{label:"Admin API key",text:M?.secret,hint:j?n.jsx("div",{className:"text-green",children:"Admin API Key was successfully regenerated"}):void 0,onRegenerate:()=>M&&A(M,_)},{label:"API URL",text:window.location.origin+$r().subdir}]})]})})]}),n.jsx("div",{children:n.jsx(Ck,{integration:t})})]})},Ik=({params:t})=>{const{data:{integrations:a}={}}=zo(),s=a?.find(({id:o})=>o===t?.id);return s?n.jsx(Sk,{integration:s}):null},Ak=Ae.create(Ik),Dk=({problem:t})=>{const[a,s]=B.useState(!1),o=()=>{s(!a)};return n.jsx(Pr,{title:n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`${t.level==="error"?"before:bg-red":"before:bg-yellow"} relative px-4 text-sm before:absolute before:top-1.5 before:left-0 before:block before:size-2 before:rounded-full before:content-['']`,children:[t?.fatal?n.jsx("strong",{children:"Fatal: "}):n.jsx("strong",{children:t.level==="error"?"Error: ":"Warning: "}),n.jsx("span",{dangerouslySetInnerHTML:{__html:t.rule}}),n.jsx("div",{className:"absolute top-1 -right-4",children:n.jsx(Ke,{color:"green",icon:a?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>o()})})]}),a?n.jsxs("div",{className:"mt-2 px-4 text-[13px]",children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:t.details},className:"mb-4"}),n.jsx(Et,{level:6,children:"Affected files:"}),n.jsx("ul",{className:"mt-1",children:t.failures.map(c=>n.jsxs("li",{children:[n.jsx("code",{children:c.ref}),c.message?`: ${c.message}`:""]}))})]}):null]}),hideActions:!0,separator:!0})},Ok=({title:t,prompt:a,fatalErrors:s,onRetry:o})=>{let c=null;return s&&(c=n.jsx("div",{className:"mt-10",children:n.jsx(pr,{title:"Errors",children:s.map(u=>typeof u.details=="object"&&u.details.errors&&u.details.errors.length>0?u.details.errors.map(d=>n.jsx(Dk,{problem:d})):typeof u.details=="string"?n.jsx(Pr,{title:u.details}):null)})})),n.jsx(Gp,{cancelLabel:"Close",okColor:"black",okLabel:"Retry",prompt:n.jsxs(n.Fragment,{children:[a,c]}),title:t,onOk:o})},Qu=Ae.create(Ok),Ju=()=>{const t=Zv(),s=!t.data?.themes[0]?.warnings?.some(c=>c.code==="GS051-CUSTOM-FONTS"),o=B.useCallback(()=>{t.refetch()},[t]);return{supportsCustomFonts:s,refreshActiveThemeData:o}};function Rk(t){let a=t.package?.name||t.name;return Kv(t)?a+=" (default)":Vv(t)?a+=" (legacy)":t.package?.name!==t.name&&(a=n.jsxs("span",{className:"text-sm md:text-base",children:[a," ",n.jsxs("span",{className:"text-grey-600",children:["(",t.name,")"]})]})),Hp(t)&&(a=n.jsxs("span",{className:"text-sm font-bold md:text-base",children:[a," — ",n.jsx("span",{className:"text-green",children:" Active"})]})),a}function $k(t){return t.package?.version||"1.0"}const Lk=({theme:t})=>{const{mutateAsync:a}=Fu(),{mutateAsync:s}=Qv(),{refreshActiveThemeData:o}=Ju(),c=pt(),{route:u,updateRoute:d}=rt(),{checkThemeLimitError:l}=Po(),f=async()=>{try{await a(t.name),o(),et({title:"Theme activated",type:"success",message:n.jsxs("div",{children:[n.jsx("span",{className:"capitalize",children:t.name})," is now your active theme"]})})}catch(x){let j=null;x instanceof Lr&&x.response?.status===422&&x.data?.errors?j=x.data.errors:c(x);let _="Invalid Theme",E=n.jsx(n.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});j&&Ae.show(Qu,{title:_,prompt:E,fatalErrors:j,onRetry:async C=>{C?.remove(),f()}})}},m=async()=>{const{apiRoot:x}=$r();e1(`${x}/themes/${t.name}/download`)},p=async()=>{Ae.show(Dt,{title:"Are you sure you want to delete this?",prompt:n.jsxs(n.Fragment,{children:["You are about to delete ",n.jsxs("strong",{children:['"',t.name,'".']})," This is permanent! We warned you, k? Maybe download"," ",n.jsx("span",{className:"cursor-pointer text-green-500",onClick:()=>{m()},children:"your theme before continuing"})]}),okLabel:"Delete",okRunningLabel:"Deleting",okColor:"red",onOk:async x=>{try{await s(t.name),x?.remove()}catch(j){c(j)}}})},b=async()=>{const x=await l(Ha(t)?".":t.name);if(x){Ae.show(gr,{prompt:x,onOk:()=>d({route:"/pro",isExternal:!0})});return}d(`theme/edit/${encodeURIComponent(t.name)}?from=${encodeURIComponent(u??"")}`)};let w=[];Hp(t)||w.push(n.jsx(Ke,{className:"ml-2",color:"green",label:"Activate",link:!0,onClick:f},"activate"));let h=[{id:"edit-code",label:"Edit code",onClick:b},{id:"download",label:"Download",onClick:m}];Jv(t)&&h.push({id:"delete",label:"Delete",onClick:p});const M={iconColorClass:"text-base",size:"sm"};return n.jsxs("div",{className:"-mr-3 flex items-center gap-4",children:[w,n.jsx(Xp,{items:h,position:"end",triggerButtonProps:M})]})},Fk=({themes:t})=>(t.sort((a,s)=>a.active&&!s.active?-1:!a.active&&s.active?1:a.package?.name&&s.package?.name?a.package.name.localeCompare(s.package.name):a.name.localeCompare(s.name)),n.jsx(pr,{pageTitle:"Installed themes",children:t.map(a=>{const s=Rk(a),o=$k(a);return n.jsx(Pr,{action:n.jsx(Lk,{theme:a}),detail:o,id:`theme-${a.name}`,separator:!1,testId:"theme-list-item",title:s},a.name)})})),zk=({themes:t})=>n.jsx(Xu,{children:n.jsx(Fk,{themes:t})}),Pk=""+new URL("footer-marketplace-bg-BpIYEF6z.png",import.meta.url).href,Hk=3e3,Oh=t=>t.variants&&t.variants.length>0,Qc=t=>{const a=[{category:t.category,previewUrl:t.previewUrl,image:t.image}];return t.variants&&t.variants.length>0&&a.push(...t.variants),a},Uk=({onSelectTheme:t})=>{const a=Y1(),[s,o]=B.useState(null),[c,u]=B.useState(0),d=l=>{o(l),u(l!==null&&Oh(l)&&Qc(l).length>1?1:0)};return B.useEffect(()=>{if(s===null)return;const l=setInterval(()=>{u((c+1)%(Qc(s).length||0))},Hk);return()=>clearInterval(l)},[s,c]),n.jsxs(Xu,{heading:"Themes",children:[n.jsx("div",{className:"mt-[6vmin] grid grid-cols-1 gap-[6vmin] sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4",children:a.map(l=>{const f=Oh(l),m=Qc(l),p=s===l;return n.jsxs("button",{className:"flex cursor-pointer flex-col gap-3 text-left",type:"button",onClick:()=>{t?.(l)},children:[n.jsx("div",{className:"relative w-full bg-grey-100 shadow-md transition-all duration-500 hover:scale-[1.05]",onMouseEnter:()=>d(l),onMouseLeave:()=>d(null),children:f?n.jsx(n.Fragment,{children:m.map((b,w)=>n.jsx("img",{alt:`${l.name} Theme - ${b.category}`,className:Oe("size-full object-contain opacity-0 transition-opacity duration-500",{"opacity-100":w===c&&p||!p&&w===0,relative:w===c,absolute:w!==c,"left-0":w!==c,"top-0":w!==c}),src:b.image},`theme-variant-${b.category.toLowerCase()}`))}):n.jsx("img",{alt:`${l.name} Theme`,className:"size-full object-contain",src:l.image})}),n.jsxs("div",{className:"relative mt-3",children:[n.jsx(Et,{level:4,children:l.name}),f?m.map((b,w)=>n.jsx("span",{className:Oe("absolute left-0 translate-y-px text-sm text-grey-700 opacity-0",{"opacity-100":w===c&&p||!p&&w===0}),children:b.category})):n.jsx("span",{className:"text-sm text-grey-700",children:l.category})]})]},l.name)})}),n.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(${Pk}) 100% 100% / 35vw no-repeat`},children:["Find and buy third-party, premium themes from independent developers in the ",n.jsx("a",{className:"inline-block font-semibold text-lime",href:"https://ghost.org/themes/",rel:"noopener noreferrer",target:"_blank",children:"Ghost Marketplace →"})]})]})},Rh=({problem:t})=>{const[a,s]=B.useState(!1);return n.jsx(Pr,{title:n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:`${t.level==="error"?"before:bg-red":"before:bg-yellow"} relative px-4 text-sm before:absolute before:top-1.5 before:left-0 before:block before:size-2 before:rounded-full before:content-['']`,children:[n.jsx("strong",{children:t.level==="error"?"Error: ":"Warning: "}),n.jsx("span",{dangerouslySetInnerHTML:{__html:t.rule}}),n.jsx("div",{className:"absolute top-1 -right-4",children:n.jsx(Ke,{color:"green",icon:a?"chevron-down":"chevron-right",iconColorClass:"text-grey-700",size:"sm",link:!0,onClick:()=>s(!a)})})]}),a?n.jsxs("div",{className:"mt-2 px-4 text-[13px]",children:[n.jsx("div",{dangerouslySetInnerHTML:{__html:t.details},className:"mb-4"}),n.jsx(Et,{level:6,children:"Affected files:"}),n.jsx("ul",{className:"mt-1",children:t.failures.map(o=>n.jsxs("li",{children:[n.jsx("code",{children:o.ref}),o.message?`: ${o.message}`:""]},o.ref))})]}):null]}),hideActions:!0,separator:!0})},Bk=({title:t,prompt:a,installedTheme:s,onActivate:o})=>{const{mutateAsync:c}=Fu(),{refreshActiveThemeData:u}=Ju(),d=pt();let l=null;s&&s.errors&&(l=n.jsx("div",{className:"mt-6",children:n.jsx(pr,{hint:n.jsxs(n.Fragment,{children:["Highly recommended to fix, functionality ",n.jsx("strong",{children:"could"})," be restricted"]}),title:"Errors",children:s.errors?.map((p,b)=>n.jsx(Rh,{problem:p},b))})}));let f=null;s&&s.warnings&&(f=n.jsx("div",{className:"mt-10",children:n.jsx(pr,{title:"Warnings",children:s.warnings?.map((p,b)=>n.jsx(Rh,{problem:p},b))})}));let m=`Activate${s.errors?.length?" with errors":""}`;return s.active&&(m="OK"),n.jsx(Gp,{cancelLabel:"Close",okColor:"black",okLabel:m,okRunningLabel:"Activating...",prompt:n.jsxs(n.Fragment,{children:[a,l,f]}),title:t,onOk:async p=>{if(!s.active)try{const w=(await c(s.name)).themes[0];u(),et({title:"Theme activated",type:"success",message:n.jsxs("div",{children:[n.jsx("span",{className:"capitalize",children:w.name})," is now your active theme."]})})}catch(b){d(b)}o?.(),p?.remove()}})},ed=Ae.create(Bk),$h=t=>t.variants&&t.variants.length>0,Lh=t=>{const a=[{image:t.image,category:t.category,previewUrl:t.previewUrl}];return t.variants&&t.variants.length>0&&a.push(...t.variants),a},Fh=t=>t.category.toLowerCase(),Wk=({selectedTheme:t,isInstalling:a,installedTheme:s,onBack:o,onInstall:c})=>{const[u,d]=B.useState("desktop"),[l,f]=B.useState(void 0);if(!t)return null;let m=t.previewUrl;const p=Lh(t).map(x=>({label:x.category,value:Fh(x)}));$h(t)&&(l===void 0&&f(p[0]),m=Lh(t).find(x=>Fh(x)===l?.value)?.previewUrl||m);let b=`Install ${t.name}`;a?b="Installing...":Ha(t)&&!s?.active?b=`Activate ${t.name}`:s&&(b=`Update ${t.name}`);const w=()=>{c?.()},h=n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Zu,{activeItemClassName:"hidden md:!block md:!visible",containerClassName:"whitespace-nowrap",itemClassName:"hidden md:!block md:!visible",items:[{label:"Change theme",onClick:o},{label:t.name}],separatorClassName:"hidden md:!block md:!visible",backIcon:!0,onBack:o}),$h(t)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"hidden md:!visible md:!block",children:"–"}),n.jsx(Ht,{border:!1,containerClassName:"text-sm font-bold",controlClasses:{menu:"min-w-max"},fullWidth:!1,options:p,selectedOption:l,clearBg:!0,onSelect:x=>{f(x||void 0)}})]}):null]}),M=n.jsxs("div",{className:"flex justify-end gap-8",children:[n.jsx(Vn,{buttons:[{icon:"laptop",iconColorClass:u==="desktop"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{d("desktop")}},{icon:"mobile",iconColorClass:u==="mobile"?"text-black dark:text-green":"text-grey-500 dark:text-grey-600",link:!0,size:"sm",onClick:()=>{d("mobile")}}]}),n.jsx(Ke,{color:"green",disabled:a,label:a?"Installing...":b,onClick:w})]});return n.jsxs("div",{className:"absolute inset-0 z-[100]",children:[n.jsx(Um,{containerClassName:"bg-grey-50 dark:bg-black z-[100]",left:h,right:M,sticky:!1}),n.jsx("div",{className:"flex h-[calc(100%-92px)] grow flex-col items-center justify-center bg-grey-50 dark:bg-black",children:u==="desktop"?n.jsx(fm,{children:n.jsx("iframe",{className:"size-full",src:m,title:"Theme preview"})}):n.jsx(hm,{children:n.jsx("iframe",{className:"size-full",src:m,title:"Theme preview"})})})]})},Yk=({onUpload:t})=>{const a=Wt();return n.jsx("div",{className:"-mb-6",children:n.jsx(q1,{id:"theme-upload",onUpload:s=>{a.remove(),t(s)},children:n.jsx("div",{className:"cursor-pointer bg-grey-75 p-10 text-center dark:bg-grey-950",children:"Click to select or drag & drop zip file"})})})},qk=({currentTab:t,setCurrentTab:a,themes:s})=>{const o=Wt(),{updateRoute:c}=rt(),{mutateAsync:u}=n1(),{checkThemeLimitError:d,isThemeLimited:l}=Po(),f=pt(),[m,p]=B.useState(),[b,w]=B.useState(!1);B.useEffect(()=>{(async()=>{if(l){const A=await d(".");p({enabled:!1,error:A||"Your current plan doesn't support uploading custom themes."})}else p({enabled:!0})})()},[d,l]);const h=()=>{o.remove(),c("/")},M=async C=>{const A=C?.name.replace(/\.zip$/,""),D=s.map(F=>F.name);Ha({name:A})?Ae.show(Dt,{title:"Upload failed",cancelLabel:"Cancel",okLabel:"",prompt:n.jsxs(n.Fragment,{children:[n.jsxs("p",{children:["The default ",n.jsx("strong",{children:A})," theme cannot be overwritten."]}),n.jsx("p",{children:"Rename your zip file and try again."})]}),onOk:async F=>{F?.remove()}}):D.includes(A)?Ae.show(Dt,{title:"Overwrite theme",prompt:n.jsxs(n.Fragment,{children:["The theme ",n.jsx("strong",{children:A})," already exists. Do you want to overwrite it?"]}),okLabel:"Overwrite",cancelLabel:"Cancel",okRunningLabel:"Overwriting...",okColor:"red",onOk:async F=>{w(!0);const O=D.indexOf(A);s.splice(O,1),await x({file:C,onActivate:h}),w(!1),a("installed"),F?.remove()}}):(a("installed"),x({file:C,onActivate:h}))},x=async({file:C,onActivate:A})=>{let D,F=null;try{w(!0),D=await u({file:C}),w(!1)}catch(U){w(!1),U instanceof Lr&&U.response?.status===422&&U.data?.errors?F=U.data.errors:f(U)}if(F&&!D){let U="Invalid Theme",K=n.jsx(n.Fragment,{children:"This theme is invalid and cannot be activated. Fix the following errors and re-upload the theme"});Ae.show(Qu,{title:U,prompt:K,fatalErrors:F,onRetry:async()=>{o?.remove(),_()}})}if(!D)return;const O=D.themes[0];let q="Upload successful",P=n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:O.name})," uploaded"]});if(O.active||(P=n.jsxs(n.Fragment,{children:[P," ","Do you want to activate it now?"]})),O?.errors?.length||O.warnings?.length){const U=O?.errors?.length;q=`Upload successful with ${U?"errors":"warnings"}`,P=n.jsxs(n.Fragment,{children:["The theme ",n.jsxs("strong",{children:['"',O.name,'"']})," was installed but we detected some ",U?"errors":"warnings","."]}),O.active||(P=n.jsxs(n.Fragment,{children:[P,"You are still able to activate and use the theme but it is recommended to fix these ",U?"errors":"warnings"," before you do so."]}))}Ae.show(ed,{title:q,prompt:P,installedTheme:O,onActivate:A})},j=n.jsx("div",{className:"hidden md:!visible md:!block",children:n.jsx(Fr,{border:!1,selectedTab:t,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:C=>{a(C)}})}),_=()=>{m&&(m.enabled?Ae.show(Dt,{title:"Upload theme",prompt:n.jsx(Yk,{onUpload:M}),okLabel:"",formSheet:!1}):Ae.show(gr,{title:"Upgrade to enable custom themes",prompt:m.error||n.jsxs(n.Fragment,{children:["Your current plan only supports official themes. You can install them from the ",n.jsx("a",{href:"https://ghost.org/marketplace/",children:"Ghost theme marketplace"}),"."]}),onOk:()=>c({route:"/pro",isExternal:!0})}))},E=n.jsx("div",{className:"flex items-center gap-14",children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Ke,{label:"Close",onClick:()=>{o.remove(),h()}}),n.jsx(Ke,{color:"black",label:"Upload theme",loading:b,onClick:_})]})});return n.jsxs(n.Fragment,{children:[n.jsx(Um,{containerClassName:"bg-white dark:bg-black",left:j,right:E}),n.jsx("div",{className:"px-[8vmin] md:hidden",children:n.jsx(Fr,{border:!1,selectedTab:t,tabs:[{id:"official",title:"Official themes"},{id:"installed",title:"Installed"}],onTabChange:C=>{a(C)}})})]})},Gk=({currentTab:t,onSelectTheme:a,themes:s})=>{switch(t){case"official":return n.jsx(Uk,{onSelectTheme:a});case"installed":return n.jsx(zk,{themes:s})}return null},zh=({source:t,themeRef:a})=>{const[s,o]=B.useState("official"),[c,u]=B.useState(null),[d,l]=B.useState("desktop"),[f,m]=B.useState(!1),[p,b]=B.useState(!1),[w,h]=B.useState(!1),{updateRoute:M}=rt(),x=Wt(),{data:{themes:j}={}}=$o(),{mutateAsync:_}=t1(),{mutateAsync:E}=Fu(),{checkThemeLimitError:C}=Po(),A=pt(),D=q=>{u(q)};if(B.useEffect(()=>{h(!0)},[]),B.useEffect(()=>{(async()=>{if(t&&a&&!p&&w){const P=a.split("/")[1];if(await C(P)){x.remove();return}let K="Install Theme";const $=j?.map(ue=>ue.name)||[];let Q=$.includes(P.toLowerCase());const N=$.indexOf(P.toLowerCase()),W=j?.[N];let ae=n.jsxs(n.Fragment,{children:["By clicking below, ",n.jsx("strong",{children:P})," will automatically be activated as the theme for your site.",Q&&n.jsxs(n.Fragment,{children:[n.jsx("br",{}),n.jsx("br",{}),"This will overwrite your existing version of ",n.jsx("strong",{children:P}),W?.active?" which is your active theme":"",". All custom changes will be lost."]})]});Ae.show(Dt,{title:K,prompt:ae,okLabel:"Install",cancelLabel:"Cancel",okRunningLabel:"Installing...",okColor:"black",onOk:async ue=>{let be;b(!0);try{Q&&j&&j.splice(N,1),be=await _(a),be?.themes[0]&&(await E(be.themes[0].name),et({title:"Theme activated",type:"success",message:n.jsxs("div",{children:[n.jsx("span",{className:"capitalize",children:be.themes[0].name})," is now your active theme"]})})),ue?.remove(),M("")}catch(de){A(de)}}})}})()},[a,t,_,A,E,M,j,p,C,x,w]),!j)return;let F,O;if(c){F=j.find(P=>P.name.toLowerCase()===c.name.toLowerCase()),O=async()=>{const P=await C(c.name);if(P){Ae.show(gr,{prompt:P,onOk:()=>M({route:"/pro",isExternal:!0})});return}return F&&!Ha(c)?new Promise(U=>{Ae.show(Dt,{title:"Overwrite theme",prompt:n.jsxs(n.Fragment,{children:["This will overwrite your existing version of ",c.name,F?.active?", which is your active theme":"",". All custom changes will be lost."]}),okLabel:"Overwrite",okRunningLabel:"Installing...",cancelLabel:"Cancel",okColor:"red",onOk:async K=>{K?.remove(),await q(),U()}})}):q()};const q=async()=>{let P="Success",U=n.jsx(n.Fragment,{});if(Ha(c))P="Activate theme",U=n.jsxs(n.Fragment,{children:["By clicking below, ",n.jsx("strong",{children:c.name})," will automatically be activated as the theme for your site."]});else{m(!0);let K;try{K=await _(c.ref)}catch(Q){A(Q)}finally{m(!1)}if(!K)return;const $=K.themes[0];if(P="Success",U=n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:$.name})," has been successfully installed."]}),$.active||(U=n.jsxs(n.Fragment,{children:[U," ","Do you want to activate it now?"]})),$.errors?.length||$.warnings?.length){const Q=$.errors?.length;P=`Installed with ${Q?"errors":"warnings"}`,U=n.jsxs(n.Fragment,{children:["The theme ",n.jsxs("strong",{children:['"',$.name,'"']})," was installed successfully but we detected some ",Q?"errors":"warnings","."]}),$.active||(U=n.jsxs(n.Fragment,{children:[U,"You are still able to activate and use the theme but it is recommended to contact the theme developer fix these ",Q?"errors":"warnings"," before you do so."]}))}F=$}Ae.show(ed,{title:P,prompt:U,installedTheme:F,onActivate:()=>{x.remove(),M("")}})}}return n.jsx(yt,{afterClose:()=>{M("")},animate:!1,cancelLabel:"",footer:!1,padding:!1,size:"full",testId:"theme-modal",title:"",scrolling:!0,onCancel:()=>{x.remove(),M("")},children:n.jsx("div",{className:"flex h-full justify-between",children:n.jsxs("div",{className:"grow",children:[c&&n.jsx(Wk,{installedTheme:F,isInstalling:f,selectedTheme:c,onBack:()=>{u(null)},onClose:()=>{M("")},onInstall:O}),n.jsx(qk,{currentTab:s,modal:x,previewMode:d,selectedTheme:c,setCurrentTab:o,setPreviewMode:l,setSelectedTheme:u,themes:j}),!c&&n.jsx(Gk,{currentTab:s,themes:j,onSelectTheme:D})]})})})},Xk=({children:t,to:a,classNames:s})=>{const o=a||document.body;if(!o)return n.jsx(n.Fragment,{children:t});const c=u=>{u.stopPropagation()};return r1.createPortal(n.jsx("div",{className:s,onMouseDown:c,children:n.jsx("div",{children:t})}),o)};var Zk=class{columnCount;columns=[];columnHeights;constructor(t=3){this.columnCount=t,this.columns=[[]],this.columnHeights=null}reset(){let t=[],a=[];for(let s=0;s<this.columnCount;s+=1)t[s]=[],a[s]=0;this.columns=t,this.columnHeights=a}addColumns(){for(let t=0;t<this.columnCount;t++)this.columns.push([]),this.columnHeights.push(0)}addPhotoToColumns(t){this.columns||this.reset();let a=Math.min(...this.columnHeights),s=this.columnHeights.indexOf(a);this.columnHeights[s]+=300*t.ratio,this.columns[s].push(t)}getColumns(){return this.columns}changeColumnCount(t){t!==this.columnCount&&(this.columnCount=t,this.reset())}},Kk={heart:t=>n.jsx("svg",{viewBox:"0 0 32 32",...t,children:n.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:t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t,children:n.jsx("path",{d:"M20 5.5l-8 8-8-8m-3.5 13h23",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,fill:"none"})})},Jc=({icon:t,label:a,...s})=>{let o=null;return t&&(o=Kk[t]),n.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:c=>c.stopPropagation(),...s,children:[t&&o&&n.jsx(o,{className:`size-4 ${t==="heart"?"fill-red":""} stroke-[3px] ${a&&"mr-1"}`}),a&&n.jsx("span",{children:a})]})},Gm=({payload:t,srcUrl:a,links:s,likes:o,user:c,alt:u,urls:d,height:l,width:f,zoomed:m,insertImage:p,selectImg:b})=>n.jsxs("div",{className:`relative mb-6 block ${m?"h-full w-[max-content] cursor-zoom-out":"w-full cursor-zoom-in"}`,style:{backgroundColor:t.color||"transparent"},"data-kg-unsplash-gallery-item":!0,onClick:w=>{w.stopPropagation(),b(m?null:t)},children:[n.jsx("img",{alt:u,className:`${m?"h-full w-auto object-contain":"block h-auto"}`,height:l,loading:"lazy",src:a,width:f,"data-kg-unsplash-gallery-img":!0}),n.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:[n.jsxs("div",{className:"flex items-center justify-end gap-3",children:[n.jsx(Jc,{"data-kg-button":"unsplash-like",href:`${s.html}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit`,icon:"heart",label:o.toString(),rel:"noopener noreferrer",target:"_blank"}),n.jsx(Jc,{"data-kg-button":"unsplash-download",href:`${s.download}/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit&force=true`,icon:"download"})]}),n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("img",{alt:"author",className:"mr-2 size-8 rounded-full",src:c.profile_image.medium}),n.jsx("div",{className:"mr-2 truncate font-sans text-sm font-medium text-white",children:c.name})]}),n.jsx(Jc,{label:"Insert image","data-kg-unsplash-insert-button":!0,onClick:w=>{w.stopPropagation(),p({src:d.regular.replace(/&w=1080/,"&w=2000"),caption:`<span>Photo by <a href="${c.links.html}">${c.name}</a> / <a href="https://unsplash.com/?utm_source=ghost&utm_medium=referral&utm_campaign=api-credit">Unsplash</a></span>`,height:l,width:f,alt:u,links:s})}})]})]})]}),Vk=({payload:t,insertImage:a,selectImg:s,zoomed:o})=>n.jsx("div",{className:"flex h-full grow basis-0 justify-center","data-kg-unsplash-zoomed":!0,onClick:()=>s(null),children:n.jsx(Gm,{alt:t.alt_description,height:t.height,insertImage:a,likes:t.likes,links:t.links,payload:t,selectImg:s,srcUrl:t.urls.regular,urls:t.urls,user:t.user,width:t.width,zoomed:o})}),Qk=()=>n.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:n.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"})}),Jk=t=>n.jsx("div",{className:"mr-6 flex grow basis-0 flex-col justify-start last-of-type:mr-0",children:t.children}),e8=t=>t?.columns?t?.columns.map((a,s)=>n.jsx(Jk,{children:a.map(o=>n.jsx(Gm,{alt:o.alt_description,height:o.height,insertImage:t?.insertImage,likes:o.likes,links:o.links,payload:o,selectImg:t?.selectImg,srcUrl:o.urls.regular,urls:o.urls,user:o.user,width:o.width,zoomed:t?.zoomed||null},o.id))},a[0]?.id??`empty-${s}`)):null,eu=t=>n.jsx("div",{className:"relative h-full overflow-hidden","data-kg-unsplash-gallery":!0,children:n.jsxs("div",{ref:t.galleryRef,className:`flex size-full justify-center overflow-auto px-20 ${t?.zoomed?"pb-10":""}`,"data-kg-unsplash-gallery-scrollref":!0,children:[t.children,t?.isLoading&&n.jsx(Qk,{})]})}),t8=({zoomed:t,error:a,galleryRef:s,isLoading:o,dataset:c,selectImg:u,insertImage:d})=>t?n.jsx(eu,{galleryRef:s,zoomed:t,children:n.jsx(Vk,{alt:t.alt_description,height:t.height,insertImage:d,likes:t.likes,links:t.links,payload:t,selectImg:u,srcUrl:t.urls.regular,urls:t.urls,user:t.user,width:t.width,zoomed:t})}):a?n.jsx(eu,{galleryRef:s,zoomed:t,children:n.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[n.jsx("h1",{className:"mb-4 text-2xl font-bold",children:"Error"}),n.jsx("p",{className:"text-lg font-medium",children:a})]})}):n.jsx(eu,{galleryRef:s,isLoading:o,zoomed:t,children:n.jsx(e8,{columns:c,insertImage:d,selectImg:u,zoomed:t})}),n8=t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",strokeWidth:1.5,viewBox:"0 0 24 24",...t,children:n.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M.75 23.249l22.5-22.5M23.25 23.249L.75.749"})}),r8=t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",strokeWidth:1.5,viewBox:"0 0 24 24",...t,children:n.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"})}),s8=t=>n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 122.43 122.41",...t,children:n.jsx("path",{d:"M83.86 54.15v34.13H38.57V54.15H0v68.26h122.43V54.15H83.86zM38.57 0h45.3v34.13h-45.3z"})}),a8=({closeModal:t,handleSearch:a,children:s})=>n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 h-[100vh] bg-black opacity-60"}),n.jsxs("div",{className:"not-kg-prose fixed inset-8 z-50 overflow-hidden rounded bg-white shadow-xl","data-kg-modal":"unsplash",children:[n.jsx("button",{className:"absolute right-6 top-6 cursor-pointer",type:"button",children:n.jsx(n8,{className:"text-grey-400 size-4 stroke-2","data-kg-modal-close-button":!0,onClick:()=>t()})}),n.jsxs("div",{className:"flex h-full flex-col",children:[n.jsxs("header",{className:"flex shrink-0 items-center justify-between px-20 py-10",children:[n.jsxs("h1",{className:"flex items-center gap-2 font-sans text-3xl font-bold text-black",children:[n.jsx(s8,{className:"mb-1"}),"Unsplash"]}),n.jsxs("div",{className:"relative w-full max-w-sm",children:[n.jsx(r8,{className:"text-grey-700 absolute left-4 top-1/2 size-4 -translate-y-2"}),n.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:a})]})]}),s]})]})]}),i8=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}}}]`),o8=class{photos=i8;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 t=(this.currentPage-1)*30,a=this.currentPage*30;return this.currentPage+=1,this.IS_LOADING=!1,this.photos.slice(t,a)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;let t=await this.fetchPhotos();return t.length>0?t:null}async searchPhotos(t){this.SEARCH_IS_RUNNING=!0;let a=this.photos.filter(s=>s.description&&s.description.toLowerCase().includes(t.toLowerCase())||s.alt_description&&s.alt_description.toLowerCase().includes(t.toLowerCase()));return this.SEARCH_IS_RUNNING=!1,a}searchIsRunning(){return this.SEARCH_IS_RUNNING}triggerDownload(t){}},l8=class{_provider;constructor(t){this._provider=t}async fetchPhotos(){return await this._provider.fetchPhotos()}async searchPhotos(t){return await this._provider.searchPhotos(t)}async triggerDownload(t){this._provider.triggerDownload(t)}async fetchNextPage(){return await this._provider.fetchNextPage()||null}searchIsRunning(){return this._provider.searchIsRunning()}},c8=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(t){this.HEADERS=t}async makeRequest(t){if(this.REQUEST_IS_RUNNING)return null;this.LAST_REQUEST_URL=t;let a={method:"GET",headers:this.HEADERS};try{this.REQUEST_IS_RUNNING=!0,this.IS_LOADING=!0;let s=await fetch(t,a),o=await this.checkStatus(s);this.extractPagination(o);let c=await o.json();return"results"in c?c.results:c}catch(s){return this.ERROR=s,null}finally{this.REQUEST_IS_RUNNING=!1,this.IS_LOADING=!1}}extractPagination(t){let a=RegExp('<(.*)>; rel="(.*)"'),s=[],o={};for(let c of t.headers.entries())c[0]==="link"&&s.push(c[1]);return s&&s.toString().split(",").forEach(c=>{if(c){let u=a.exec(c);u&&(o[u[2]]=u[1])}}),this.PAGINATION=o,t}async fetchPhotos(){let t=`${this.API_URL}/photos?per_page=30`;return await this.makeRequest(t)}async fetchNextPage(){if(this.REQUEST_IS_RUNNING||this.SEARCH_IS_RUNNING)return null;if(this.PAGINATION.next){let t=`${this.PAGINATION.next}`,a=await this.makeRequest(t);if(a)return a}return null}async searchPhotos(t){let a=`${this.API_URL}/search/photos?query=${t}&per_page=30`;return await this.makeRequest(a)||[]}async triggerDownload(t){t.links.download_location&&await this.makeRequest(t.links.download_location)}async checkStatus(t){if(t.status>=200&&t.status<300)return t;let a="",s,o=t.headers.get("content-type");if(o==="application/json")s=t.json().then(c=>c.errors[0]);else if(o==="text/xml")s=t.text();else throw Error("Unsupported content type");return s.then(c=>{throw t.status===403&&t.headers.get("x-ratelimit-remaining")==="0"&&(a="Unsplash API rate limit reached, please try again later."),a=a||c||`Error ${t.status}: Uh-oh! Trouble reaching the Unsplash API`,this.ERROR=a,Error(a)})}searchIsRunning(){return this.SEARCH_IS_RUNNING}},u8=class{photoUseCases;masonryService;photos=[];constructor(t,a){this.photoUseCases=t,this.masonryService=a}async loadNew(){let t=await this.photoUseCases.fetchPhotos();this.photos=t,await this.layoutPhotos()}async layoutPhotos(){this.masonryService.reset(),this.photos&&this.photos.forEach(t=>{t.ratio=t.height/t.width,this.masonryService.addPhotoToColumns(t)})}getColumns(){return this.masonryService.getColumns()}async updateSearch(t){let a=await this.photoUseCases.searchPhotos(t);this.photos=a,this.layoutPhotos()}async loadNextPage(){let t=await this.photoUseCases.fetchNextPage()||[];this.photos=[...this.photos,...t],this.layoutPhotos()}clearPhotos(){this.photos=[]}triggerDownload(t){this.photoUseCases.triggerDownload(t)}searchIsRunning(){return this.photoUseCases.searchIsRunning()}},d8=({onClose:t,onImageInsert:a,unsplashProviderConfig:s})=>{let o=B.useMemo(()=>s?new c8(s):new o8,[s]),c=B.useMemo(()=>new l8(o),[o]),u=B.useMemo(()=>new Zk(3),[]),d=B.useMemo(()=>new u8(c,u),[c,u]),l=B.useRef(null),[f,m]=B.useState(0),[p,b]=B.useState(0),[w,h]=B.useState(d.searchIsRunning()||!0),M=B.useRef(!1),[x,j]=B.useState(""),[_,E]=B.useState(null),[C,A]=B.useState([]);xt.useEffect(()=>{l.current&&_===null&&p!==0&&(l.current.scrollTop=p,b(0))},[_,f,p]),xt.useEffect(()=>{let K=$=>{$.key==="Escape"&&t()};return window.addEventListener("keydown",K),()=>{window.removeEventListener("keydown",K)}},[t]),xt.useEffect(()=>{let K=l.current;if(!_)return K&&K.addEventListener("scroll",()=>{m(K.scrollTop)}),()=>{K&&K.removeEventListener("scroll",()=>{m(K.scrollTop)})}},[l,_]);let D=xt.useCallback(async()=>{(M.current===!1||x.length===0)&&(A([]),d.clearPhotos(),await d.loadNew(),A(d.getColumns()||[]),l.current&&l.current.scrollTop!==0&&(l.current.scrollTop=0),h(!1))},[d,x]),F=async K=>{let $=K.target.value;$.length>2&&(E(null),j($)),$.length===0&&(j(""),M.current=!1,await D())},O=xt.useCallback(async()=>{if(x){h(!0),A([]),d.clearPhotos(),await d.updateSearch(x);let K=d.getColumns();K&&A(K),l.current&&l.current.scrollTop!==0&&(l.current.scrollTop=0),h(!1)}},[x,d]);xt.useEffect(()=>{let K=setTimeout(async()=>{x.length>2?await O():await D()},300);return()=>{M.current=!0,clearTimeout(K)}},[x,O,D]);let q=xt.useCallback(async()=>{h(!0),await d.loadNextPage(),A(d.getColumns()||[]),h(!1)},[d]);xt.useEffect(()=>{let K=l.current;if(K){let $=async()=>{_===null&&K.scrollTop+K.clientHeight>=K.scrollHeight-1e3&&await q()};return K.addEventListener("scroll",$),()=>{K.removeEventListener("scroll",$)}}},[l,q,_]);let P=K=>{K&&(E(K),b(f)),K===null&&(E(null),l.current&&(l.current.scrollTop=p))};async function U(K){K.src&&(d.triggerDownload(K),a(K))}return n.jsx(a8,{closeModal:t,handleSearch:F,children:n.jsx(t8,{dataset:C,error:null,galleryRef:l,insertImage:U,isLoading:w,selectImg:P,zoomed:_})})};const f8=({unsplashProviderConfig:t,onClose:a,onImageInsert:s})=>n.jsx(Xk,{classNames:"admin-x-settings",children:n.jsx(d8,{unsplashProviderConfig:t,onClose:a,onImageInsert:s})}),Fs={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"}]},Hn="Theme default",Ph=({children:t,...a})=>n.jsx(Kp.SingleValue,{...a,children:n.jsx("div",{className:"group","data-testid":"select-current-option","data-value":a.data.value,children:n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex size-12 items-center justify-center rounded-md bg-white text-2xl font-bold dark:bg-black",children:"Aa"}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-md",children:t}),n.jsx("span",{className:"font-sans text-xs font-normal text-grey-700 dark:text-grey-600",children:a.data.creator})]})]})})}),Hh=({children:t,...a})=>n.jsx(Kp.Option,{...a,children:n.jsxs("div",{className:a.isSelected?"relative flex w-full items-center justify-between gap-2":"group","data-testid":"select-option","data-value":a.data.value,children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"flex size-12 items-center justify-center rounded-md bg-grey-150 text-2xl font-bold group-hover:bg-grey-250 dark:bg-grey-900 dark:group-hover:bg-grey-800",children:"Aa"}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("span",{className:"text-md",children:t}),n.jsx("span",{className:"font-sans text-xs font-normal text-grey-700 dark:text-grey-600",children:a.data.creator})]})]}),a.isSelected&&n.jsx("span",{children:n.jsx(dt,{name:"check",size:14})})]})}),h8=t=>t.split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "),Uh=({values:t,updateSetting:a})=>{const{mutateAsync:s}=Ys(),{settings:o}=lt(),[c]=jt(o,["unsplash"]),[u,d]=B.useState(!1),{unsplashConfig:l}=s1(),f=pt(),m=Zp(),{data:p}=$o(),b=p?.themes.find(O=>O.active),w=b?`${h8(b.name)} (v${b.package?.version||"1.0"})`:"Loading...",[h,M]=B.useState(Fs.heading.find(O=>O.name===t.headingFont)||{name:Hn,creator:w}),[x,j]=B.useState(Fs.heading.find(O=>O.name===t.bodyFont)||{name:Hn,creator:w}),_=(O,q=!0)=>{let P="";return O==="Cardo"?P=Oe("font-cardo",q&&"font-bold"):O==="Manrope"?P=Oe("font-manrope",q&&"font-bold"):O==="Merriweather"?P=Oe("font-merriweather",q&&"font-bold"):O==="Nunito"?P=Oe("font-nunito",q&&"font-semibold"):O==="Old Standard TT"?P=Oe("font-old-standard-tt",q&&"font-bold"):O==="Prata"?P=Oe("font-prata",q&&"font-normal"):O==="Roboto"?P=Oe("font-roboto",q&&"font-bold"):O==="Rufina"?P=Oe("font-rufina",q&&"font-bold"):O==="Tenor Sans"?P=Oe("font-tenor-sans",q&&"font-normal"):O==="Chakra Petch"?P=Oe("font-chakra-petch",q&&"font-normal"):O==="Fira Mono"?P=Oe("font-fira-mono",q&&"font-bold"):O==="Fira Sans"?P=Oe("font-fira-sans",q&&"font-bold"):O==="IBM Plex Serif"?P=Oe("font-ibm-plex-serif",q&&"font-bold"):O==="Inter"?P=Oe("font-inter",q&&"font-bold"):O==="JetBrains Mono"?P=Oe("font-jetbrains-mono",q&&"font-bold"):O==="Lora"?P=Oe("font-lora",q&&"font-bold"):O==="Noto Sans"?P=Oe("font-noto-sans",q&&"font-bold"):O==="Noto Serif"?P=Oe("font-noto-serif",q&&"font-bold"):O==="Poppins"?P=Oe("font-poppins",q&&"font-bold"):O==="Space Grotesk"?P=Oe("font-space-grotesk",q&&"font-bold"):O==="Space Mono"&&(P=Oe("font-space-mono",q&&"font-bold")),P},E=Fs.heading.map(O=>{let q=_(O.name,!0);return{label:O.name,value:O.name,creator:O.creator,className:q}});E.unshift({label:Hn,value:Hn,creator:w,className:"font-sans font-normal"});const C=Fs.body.map(O=>{let q=_(O.name,!1);return{label:O.name,value:O.name,creator:O.creator,className:q}});C.unshift({label:Hn,value:Hn,creator:w,className:"font-sans font-normal"});const A=(O,q)=>O===Hn?"":_(O,q),D={label:h.name,value:h.name,creator:h.creator},F={label:x.name,value:x.name,creator:x.creator};return n.jsxs(n.Fragment,{children:[n.jsxs(ut,{className:"mt-6",gap:"sm",margins:"lg",title:"",children:[n.jsx(Kn,{debounceMs:200,direction:"rtl",testId:"accent-color-picker",title:n.jsx("div",{children:"Accent color"}),value:t.accentColor,onChange:O=>a("accent_color",O)}),n.jsxs("div",{className:"flex items-start justify-between",children:[n.jsxs("div",{children:[n.jsx("div",{children:"Publication icon"}),n.jsx(Jn,{className:"mt-0! mr-5 max-w-[160px]",children:"A square, social icon, at least 60x60px"})]}),n.jsx("div",{className:"flex gap-3",children:n.jsx(mr,{deleteButtonClassName:"top-1! right-1!",editButtonClassName:"top-1! right-1!",height:t.icon?"66px":"36px",id:"logo",imageBWCheckedBg:!0,imageURL:t.icon||"",width:t.icon?"66px":"160px",onDelete:()=>a("icon",null),onUpload:async O=>{try{a("icon",hr(await s({file:O})))}catch(q){const P=q;P.response.status===415&&(P.message="Unsupported file type"),f(P)}},children:"Upload icon"})})]}),n.jsxs("div",{className:`flex items-start justify-between ${t.icon&&"mt-2"}`,children:[n.jsxs("div",{children:[n.jsx("div",{children:"Publication logo"}),n.jsx(Jn,{className:"mt-0! mr-5 max-w-[160px]",children:"Appears usually in the main header of your theme"})]}),n.jsx("div",{children:n.jsx(mr,{deleteButtonClassName:"top-1! right-1!",height:"60px",id:"site-logo",imageBWCheckedBg:!0,imageFit:"contain",imageURL:t.logo||"",width:"160px",onDelete:()=>a("logo",null),onUpload:async O=>{try{a("logo",hr(await s({file:O})))}catch(q){const P=q;P.response.status===415&&(P.message="Unsupported file type"),f(P)}},children:"Upload logo"})})]}),n.jsxs("div",{className:"mt-2 flex items-start justify-between","data-testid":"publication-cover",children:[n.jsxs("div",{children:[n.jsx("div",{children:"Publication cover"}),n.jsx(Jn,{className:"mt-0! mr-5 max-w-[160px]",children:"Usually as a large banner image on your index pages"})]}),n.jsx(mr,{deleteButtonClassName:"top-1! right-1!",editButtonClassName:"top-1! right-10!",height:"95px",id:"cover",imageURL:t.coverImage||"",openUnsplash:()=>d(!0),pintura:{isEnabled:m.isEnabled,openEditor:async()=>m.openEditor({image:t.coverImage||"",handleSave:async O=>{try{a("cover_image",hr(await s({file:O})))}catch(q){f(q)}}})},unsplashButtonClassName:"bg-transparent! h-6! top-1.5! w-6! right-1.5! z-50",unsplashEnabled:c,width:"160px",onDelete:()=>a("cover_image",null),onUpload:async O=>{try{a("cover_image",hr(await s({file:O})))}catch(q){const P=q;P.response.status===415&&(P.message="Unsupported file type"),f(P)}},children:"Upload cover"}),u&&l&&c&&n.jsx(f8,{unsplashProviderConfig:l,onClose:()=>{d(!1)},onImageInsert:O=>{O.src&&a("cover_image",O.src),d(!1)}})]})]}),n.jsxs(ut,{className:"-mt-4",gap:"sm",margins:"lg",title:"Typography",children:[n.jsx(Ht,{className:A(D.label,!0),components:{Option:Hh,SingleValue:Ph},controlClasses:{control:"min-h-16! pl-2!",option:"pl-2!"},hint:"",menuShouldScrollIntoView:!0,options:E,selectedOption:D,testId:"heading-font-select",title:"Heading font",onSelect:O=>{O?.value===Hn?(M({name:Hn,creator:w}),a("heading_font","")):(M({name:O?.value||"",creator:Fs.heading.find(q=>q.name===O?.value)?.creator||""}),a("heading_font",O?.value||""))}}),n.jsx(Ht,{className:A(F.label,!1),components:{Option:Hh,SingleValue:Ph},controlClasses:{control:"min-h-16! pl-2!",option:"pl-2!"},hint:"",maxMenuHeight:200,menuPosition:"fixed",menuShouldScrollIntoView:!0,options:C,selectedOption:F,testId:"body-font-select",title:"Body font",onSelect:O=>{O?.value===Hn?(j({name:Hn,creator:w}),a("body_font","")):(j({name:O?.value||"",creator:Fs.body.find(q=>q.name===O?.value)?.creator||""}),a("body_font",O?.value||""))}})]})]})};var _o={exports:{}},To={exports:{}},p8=To.exports,Bh;function m8(){return Bh||(Bh=1,(function(t,a){(function(s,o){t.exports=o()})(p8,(function(){function s(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(v){return typeof v}:s=function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},s(g)}function o(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function c(g,v){for(var y=0;y<v.length;y++){var S=v[y];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(g,S.key,S)}}function u(g,v,y){return v&&c(g.prototype,v),g}function d(g,v){return l(g)||f(g,v)||m(g,v)||b()}function l(g){if(Array.isArray(g))return g}function f(g,v){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(g)))){var y=[],S=!0,H=!1,Z=void 0;try{for(var le=g[Symbol.iterator](),he;!(S=(he=le.next()).done)&&(y.push(he.value),!(v&&y.length===v));S=!0);}catch(Ce){H=!0,Z=Ce}finally{try{!S&&le.return!=null&&le.return()}finally{if(H)throw Z}}return y}}function m(g,v){if(g){if(typeof g=="string")return p(g,v);var y=Object.prototype.toString.call(g).slice(8,-1);if(y==="Object"&&g.constructor&&(y=g.constructor.name),y==="Map"||y==="Set")return Array.from(y);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return p(g,v)}}function p(g,v){(v==null||v>g.length)&&(v=g.length);for(var y=0,S=new Array(v);y<v;y++)S[y]=g[y];return S}function b(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w="null",h="undefined",M="bool",x="boolean",j="number",_="string",E="date",C="regex",A="regexp",D="array",F="object",O="function",q=[w,h,x,j,_,E,A],P="expression",U="group",K="pipeline",$="projection",Q="query",N=function(){};Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(v,y){if(this==null)throw new TypeError('"this" is null or not defined');var S=Object(this),H=S.length>>>0;if(H===0)return!1;var Z=y|0,le=Math.max(Z>=0?Z:H-Math.abs(Z),0);function he(Ce,ke){return Ce===ke||typeof Ce=="number"&&typeof ke=="number"&&isNaN(Ce)&&isNaN(ke)}for(;le<H;){if(he(S[le],v))return!0;le++}return!1}});var W=Array.prototype.push;function ae(g,v){g||te(v)}function ue(g){switch(ie(g)){case D:return g.map(ue);case F:return re(g,ue);default:return g}}function be(g){switch(ie(g)){case D:return Nt([],g);case F:return Object.assign({},g);default:return g}}function de(g){return g===null?"Null":g===void 0?"Undefined":g.constructor.name}function ie(g){return de(g).toLowerCase()}function V(g){return ie(g)===x}function G(g){return ie(g)===_}function me(g){return ie(g)===j}var ee=Array.isArray||function(g){return!!g&&g.constructor===Array};function xe(g){return!!g&&g.constructor===Object}function Fe(g){return g===Object(g)}function qe(g){return ie(g)===E}function Ue(g){return ie(g)===A}function Xe(g){return ie(g)===O}function we(g){return g==null}function Le(g){return g===null}function Ie(g){return g===void 0}function Ee(g,v){return g.includes(v)}function T(g,v){return!Ee(g,v)}function ce(g){return!!g}function oe(g){return we(g)||ee(g)&&g.length===0||xe(g)&&pe(g).length===0||!g}function Y(g){return ee(g)?g:[g]}function z(g,v){return g.hasOwnProperty(v)}function te(g){throw new Error(g)}var pe=Object.keys;function fe(g,v,y){if(v=v.bind(y),ee(g))for(var S=0,H=g.length;S<H&&v(g[S],S,g)!==!1;S++);else for(var Z in g)if(g.hasOwnProperty(Z)&&v(g[Z],Z,g)===!1)break}function re(g,v,y){v=v.bind(y);for(var S={},H=pe(g),Z=0;Z<H.length;Z++){var le=H[Z];S[le]=v(g[le],le)}return S}function Me(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(g===N)return v;if(v===N)return g;var S=[g,v];if(!(S.every(xe)||S.every(ee)))throw Error("mismatched types. must both be array or object");if(y.flatten=y.flatten||!1,ee(g))if(y.flatten){for(var H=0,Z=0;H<g.length&&Z<v.length;)g[H]=Me(g[H++],v[Z++],y);for(;Z<v.length;)g.push(v[Z++])}else W.apply(g,v);else Object.keys(v).forEach(function(le){g.hasOwnProperty(le)?g[le]=Me(g[le],v[le],y):g[le]=v[le]});return g}function Ne(g,v,y){return ee(g)?g.reduce(v,y):(fe(g,function(S,H){return y=v(y,S,H,g)}),y)}function Se(g,v){var y=v.map(Gt);return g.filter(function(S){return Ee(y,Gt(S))})}function ze(g,v){return Nt(Nt([],g),v.filter(T.bind(null,g)))}function gt(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,y=[];function S(H,Z){for(var le=0,he=H.length;le<he;le++)ee(H[le])&&(Z>0||Z<0)?S(H[le],Math.max(-1,Z-1)):y.push(H[le])}return S(g,v),y}function Qe(g,v){if(v<1)return g;for(;v--&&ee(g)&&g.length===1;)g=g[0];return g}function Tt(g,v){for(var y=[g],S=[v];y.length>0;)if(g=y.pop(),v=S.pop(),g!==v){var H=ie(g);if(H!==ie(v)||H===O)return!1;switch(H){case D:if(g.length!==v.length)return!1;Nt(y,g),Nt(S,v);break;case F:var Z=pe(g),le=pe(v);if(Z.length!==le.length)return!1;Z.sort(),le.sort();for(var he=0,Ce=Z.length;he<Ce;he++){var ke=Z[he];if(ke!==le[he])return!1;y.push(g[ke]),S.push(v[ke])}break;default:if($t(g)!==$t(v))return!1}}return y.length===0}function xn(g){var v={},y=[];return fe(g,function(S){var H=Gt(S);z(v,H)||(y.push(S),v[H]=0)}),y}function $t(g){var v=ie(g);switch(v){case x:case j:case A:return g.toString();case _:return JSON.stringify(g);case E:return g.toISOString();case w:case h:return v;case D:return"["+g.map($t)+"]";default:var y=v===F?"":"".concat(de(g)),S=pe(g);return S.sort(),"".concat(y,"{")+S.map(function(H){return"".concat($t(H),":").concat($t(g[H]))})+"}"}}function Gt(g){if(we(g))return null;for(var v=0,y=$t(g),S=y.length;S;)v=(v<<5)-v^y.charCodeAt(--S);return v>>>0}function wt(g,v){return g<v?-1:g>v?1:0}function An(g,v,y){var S=[],H=[],Z={};if(y=y||wt,oe(g))return g;for(var le=0;le<g.length;le++){var he=g[le],Ce=v(he,le);we(Ce)?H.push(he):(Z[Ce]?Z[Ce].push(he):Z[Ce]=[he],S.push(Ce))}S.sort(y);for(var ke=0;ke<S.length;ke++)Nt(H,Z[S[ke]]);return H}function Un(g,v){var y={keys:[],groups:[]},S={};return fe(g,function(H){var Z=v(H),le=Gt(Z),he=-1;S[le]===void 0&&(he=y.keys.length,S[le]=he,y.keys.push(Z),y.groups.push([])),he=S[le],y.groups[he].push(H)}),y}function Nt(g,v){return W.apply(g,v),g}function vr(g,v){for(var y=0,S=g.length-1;y<=S;){var H=Math.round(y+(S-y)/2);if(v<g[H])S=H-1;else if(v>g[H])y=H+1;else return H}return y}function Hr(g){var v=this;return(function(y){return function(){for(var S=arguments.length,H=new Array(S),Z=0;Z<S;Z++)H[Z]=arguments[Z];var le=Gt(H);return z(y,le)||(y[le]=g.apply(v,H)),y[le]}})({})}function Ur(g,v){return Fe(g)?g[v]:void 0}function tn(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=0;y.meta=y.meta||!1;function H(Z,le){for(var he=Z,Ce=0;Ce<le.length;Ce++){var ke=le[Ce],Be=ke.match(/^\d+$/)===null;if(Be&&ee(he)){if(Ce===0&&S>0)break;S+=1,le=le.slice(Ce),he=Ne(he,function($e,ht){var at=H(ht,le);return at!==void 0&&$e.push(at),$e},[]);break}else he=Ur(he,ke);if(he===void 0)break}return he}return g=Ee(q,ie(g))?g:H(g,v.split(".")),y.meta?{result:g,depth:S}:g}function Bn(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.preserveMissingValues=y.preserveMissingValues||!1;var S=v.split("."),H=S[0],Z=S.length===1||S.slice(1).join("."),le=H.match(/^\d+$/)!==null,he=S.length>1,Ce,ke;try{ee(g)?le?(Ce=Ur(g,Number(H)),he&&(Ce=Bn(Ce,Z,y)),Ce=[Ce]):(Ce=[],fe(g,function(Be){ke=Bn(Be,v,y),y.preserveMissingValues?(ke===void 0&&(ke=N),Ce.push(ke)):ke!==void 0&&Ce.push(ke)})):(ke=Ur(g,H),he&&(ke=Bn(ke,Z,y)),ae(ke!==void 0),Ce={},Ce[H]=ke)}catch{Ce=void 0}return Ce}function jn(g){if(ee(g))for(var v=g.length-1;v>=0;v--)g[v]===N?g.splice(v,1):jn(g[v]);else if(xe(g))for(var y in g)g.hasOwnProperty(y)&&jn(g[y]);return g}function Dn(g,v,y){var S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,H=v.split("."),Z=H[0],le=H.length===1||H.slice(1).join(".");H.length===1?y(g,Z):(S===!0&&we(g[Z])&&(g[Z]={}),Dn(g[Z],le,y,S))}function Zs(g,v,y){Dn(g,v,function(S,H){S[H]=y},!0)}function Ks(g,v){Dn(g,v,function(y,S){ee(y)&&/^\d+$/.test(S)?y.splice(parseInt(S),1):xe(y)&&delete y[S]})}function Vs(g){return!!g&&g[0]==="$"}function Qa(g){if(Ee(q,ie(g)))return Ue(g)?{$regex:g}:{$eq:g};if(Fe(g)){var v=pe(g);if(!v.some(Vs))return{$eq:g};if(Ee(v,"$regex")){var y=g.$regex,S=g.$options||"",H="";G(y)&&(H+=y.ignoreCase||S.indexOf("i")>=0?"i":"",H+=y.multiline||S.indexOf("m")>=0?"m":"",H+=y.global||S.indexOf("g")>=0?"g":"",y=new RegExp(y,H)),g.$regex=y,delete g.$options}}return g}function ds(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;return we(y)?v<0?(v=Math.max(0,g.length+v),y=g.length-v+1):(y=v,v=0):(v<0&&(v=Math.max(0,g.length+v)),ae(y>0,"Invalid argument value for $slice operator. Limit must be a positive number"),y+=v),g.slice(v,y)}function Ja(g,v){var y=Ne(g,function(le,he){return le+he},0),S=g.length||1,H=v&&1||0,Z=y/S;return Math.sqrt(Ne(g,function(le,he){return le+Math.pow(he-Z,2)},0)/(S-H))}function qo(){return{assert:ae,clone:be,cloneDeep:ue,each:fe,err:te,hashCode:Gt,getType:de,has:z,includes:Ee.bind(null),isArray:ee,isBoolean:V,isDate:qe,isEmpty:oe,isEqual:Tt,isFunction:Xe,isNil:we,isNull:Le,isNumber:me,isObject:xe,isRegExp:Ue,isString:G,isUndefined:Ie,keys:pe,reduce:Ne,resolve:tn,resolveObj:Bn}}var ei=function(){return Object.assign({computeValue:Te,ops:Qs},qo())},fs={key:"_id"};function Go(g){Object.assign(fs,g||{})}var hs={$$ROOT:function(v,y,S){return S.root},$$CURRENT:function(v,y,S){return v},$$REMOVE:function(v,y,S){}},ti={$$KEEP:function(v){return v},$$PRUNE:function(){},$$DESCEND:function(v,y,S){if(!z(y,"$cond"))return v;var H;return fe(v,function(Z,le){Fe(Z)&&(ee(Z)?(H=[],fe(Z,function(he){xe(he)&&(he=Js(he,y,S)),we(he)||H.push(he)})):H=Js(Z,y,S),we(H)?delete v[le]:v[le]=H)}),v}},ni=pe(hs),ri=pe(ti);function _r(){return fs.key}function Qs(){var g=Array.prototype.slice.call(arguments);return Ne(g,function(v,y){return Nt(v,pe(St[y]))},[])}function Br(g,v,y){if(z(St[U],v))return St[U][v](g,y);if(xe(y)){var S={};return fe(y,function(H,Z){if(S[Z]=Br(g,Z,y[Z]),z(St[U],Z))return S=S[Z],ae(pe(y).length===1,"Invalid $group expression '"+JSON.stringify(y)+"'"),!1}),S}}function Te(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};if(S.root=S.root||g,z(St[P],y))return St[P][y](g,v,S);if(z(St[U],y))return g=Te(g,v,null,S),ae(ee(g),y+" expression must resolve to an array"),St[U][y](g,null,S);if(G(v)&&v.length>0&&v[0]==="$"){if(Ee(ni,v))return hs[v](g,null,S);if(Ee(ri,v))return v;var H=ni.filter(function(le){return v.indexOf(le+".")===0});return H.length===1&&(H=H[0],H==="$$ROOT"&&(g=S.root),v=v.substr(H.length)),tn(g,v.slice(1))}switch(ie(v)){case D:return v.map(function(le){return Te(g,le)});case F:var Z={};return fe(v,function(le,he){if(Z[he]=Te(g,le,he,S),[P,U].some(function(Ce){return z(St[Ce],he)}))return ae(pe(v).length===1,"Invalid aggregation expression '"+JSON.stringify(v)+"'"),Z=Z[he],!1}),Z;default:return v}}function Js(g,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};y.root=y.root||g;var S=Te(g,v,null,y);return Ee(ri,S)?ti[S](g,v,y):S}function si(g,v){var y=Te(g,v);return y==null?null:Math.abs(y)}function Xo(g,v){var y=Te(g,v),S=!1,H=Ne(y,function(Z,le){return qe(le)&&(ae(!S,"'$add' can only have one date value"),S=!0,le=le.getTime()),Z+=le,Z},0);return S?new Date(H):H}function Zo(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)||isNaN(y),"$ceil expression must resolve to a number."),Math.ceil(y))}function Ko(g,v){var y=Te(g,v);return y[0]/y[1]}function Vo(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)||isNaN(y),"$exp expression must resolve to a number."),Math.exp(y))}function Qo(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)||isNaN(y),"$floor expression must resolve to a number."),Math.floor(y))}function Jo(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)||isNaN(y),"$ln expression must resolve to a number."),Math.log(y))}function ps(g,v){var y=Te(g,v),S="$log expression must resolve to array(2) of numbers";return ae(ee(y)&&y.length===2,S),y.some(we)?null:(ae(y.some(isNaN)||y.every(me),S),Math.log10(y[0])/Math.log10(y[1]))}function el(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)||isNaN(y),"$log10 expression must resolve to a number."),Math.log10(y))}function ms(g,v){var y=Te(g,v);return y[0]%y[1]}function tl(g,v){var y=Te(g,v);return Ne(y,function(S,H){return S*H},1)}function nl(g,v){var y=Te(g,v);return ae(ee(y)&&y.length===2&&y.every(me),"$pow expression must resolve to array(2) of numbers"),ae(!(y[0]===0&&y[1]<0),"$pow cannot raise 0 to a negative exponent"),Math.pow(y[0],y[1])}function rl(g,v){var y=Te(g,v),S=y[0],H=y[1];return we(S)||isNaN(S)||Math.abs(S)===1/0?S:(ae(me(S),"$round expression must resolve to a number."),li(S,H,!0))}function ai(g,v){var y=Te(g,v);return we(y)?null:(ae(me(y)&&y>0||isNaN(y),"$sqrt expression must resolve to non-negative number."),Math.sqrt(y))}function ii(g,v){var y=Te(g,v);return y[0]-y[1]}function oi(g,v){var y=Te(g,v),S=y[0],H=y[1];return we(S)||isNaN(S)||Math.abs(S)===1/0?S:(ae(me(S),"$trunc expression must resolve to a number."),ae(we(H)||me(H)&&H>-20&&H<100,"$trunc expression has invalid place"),li(S,H,!1))}function li(g,v,y){v=v||0;var S=Math.abs(g)===g?1:-1;g=Math.abs(g);var H=Math.trunc(g),Z=g-H;if(v===0){var le=Math.trunc(10*Z);y&&(H&1)===1&&le>=5&&H++}else if(v>0){var he=Math.pow(10,v),Ce=Math.trunc(Z*he),ke=Math.trunc(Z*he*10)%10;y&&ke>5&&(Ce+=1),H+=Ce/he}else if(v<0){var Be=Math.pow(10,-1*v),$e=H%Be;if(H=Math.max(0,H-$e),y&&S===-1){for(;$e>10;)$e-=$e%10;H>0&&$e>=5&&(H+=Be)}}return H*S}function sl(g,v){var y=Te(g,v);ae(ee(y)&&y.length===2,"$arrayElemAt expression must resolve to array(2)"),ae(ee(y[0]),"First operand to $arrayElemAt must resolve to an array"),ae(me(y[1]),"Second operand to $arrayElemAt must resolve to an integer");var S=y[1];if(y=y[0],S<0&&Math.abs(S)<=y.length)return y[S+y.length];if(S>=0&&S<y.length)return y[S]}function al(g,v){var y=Te(g,v);return ae(ee(y),"$arrayToObject expression must resolve to an array"),Ne(y,function(S,H){return ee(H)&&H.length==2?S[H[0]]=H[1]:(ae(xe(H)&&z(H,"k")&&z(H,"v"),"$arrayToObject expression is invalid."),S[H.k]=H.v),S},{})}function il(g,v){var y=Te(g,v,null);return ae(ee(y),"$concatArrays must resolve to an array"),y.some(we)?null:y.reduce(function(S,H){return Nt(S,H)},[])}function ci(g,v){var y=Te(g,v.input),S=v.as,H=v.cond;return ae(ee(y),"$filter 'input' expression must resolve to an array"),y.filter(function(Z){var le={};return le["$"+S]=Z,Te(le,H)===!0})}function ui(g,v){var y=Te(g,v[0]),S=Te(g,v[1]);return ae(ee(S),"$in second argument must be an array"),S.some(Tt.bind(null,y))}function di(g,v){var y=Te(g,v);if(we(y))return null;var S=y[0],H=y[1];if(we(S))return null;ae(ee(S),"$indexOfArray expression must resolve to an array.");var Z=y[2]||0,le=y[3];return we(le)&&(le=S.length),Z>le?-1:(ae(Z>=0&&le>=0,"$indexOfArray expression is invalid"),(Z>0||le<S.length)&&(S=S.slice(Z,le)),S.findIndex(Tt.bind(null,H))+Z)}function ea(g,v){return ee(Te(g,v[0]))}function ol(g,v){var y=Te(g,v.input);ae(ee(y),"$map 'input' expression must resolve to an array");var S=v.as,H=v.in,Z="$"+S;return y.map(function(le){return g[Z]=le,Te(g,H)})}function fi(g,v){var y=Te(g,v);ae(xe(y),"$objectToArray expression must resolve to an object");var S=[];return fe(y,function(H,Z){return S.push({k:Z,v:H})}),S}function gs(g,v){for(var y=Te(g,v),S=y[0],H=y[1],Z=y[2]||1,le=[];S<H&&Z>0||S>H&&Z<0;)le.push(S),S+=Z;return le}function hi(g,v){var y=Te(g,v.input),S=Te(g,v.initialValue),H=v.in;return we(y)?null:(ae(ee(y),"$reduce 'input' expression must resolve to an array"),Ne(y,function(Z,le){return Te({$value:Z,$this:le},H)},S))}function ll(g,v){var y=Te(g,v);if(we(y))return null;ae(ee(y),"$reverseArray expression must resolve to an array");var S=[];return Nt(S,y),S.reverse(),S}function pi(g,v){var y=Te(g,v);return ee(y)?y.length:void 0}function mi(g,v){var y=Te(g,v);return ds(y[0],y[1],y[2])}function ta(g,v){var y=Te(g,v.inputs),S=v.useLongestLength||!1;ae(ee(y),"'inputs' expression must resolve to an array"),ae(V(S),"'useLongestLength' must be a boolean"),ee(v.defaults)&&ae(ce(S),"'useLongestLength' must be set to true to use 'defaults'");for(var H=0,Z=0,le=y.length;Z<le;Z++){var he=y[Z];if(we(he))return null;ae(ee(he),"'inputs' expression values must resolve to an array or null"),H=S?Math.max(H,he.length):Math.min(H||he.length,he.length)}for(var Ce=[],ke=v.defaults||[],Be=function(at){var Ct=y.map(function(qt,Kt){return we(qt[at])?ke[Kt]||null:qt[at]});Ce.push(Ct)},$e=0;$e<H;$e++)Be($e);return Ce}function cl(g,v){var y=Te(g,v);return ee(y)?Ne(y,function(S,H){return Object.assign(S,H)},{}):{}}function gi(g,v){var y=Te(g,v);return ce(y)&&y.every(ce)}function na(g,v){var y=Te(g,v);return ce(y)&&y.some(ce)}function ra(g,v){return!Te(g,v[0])}function Yt(g){return g instanceof la?g:new la(g)}Yt.isIterator=sa;function sa(g){return!!g&&s(g)==="object"&&xs(g.next)}function xs(g){return!!g&&typeof g=="function"}function ul(g,v){var y=g.slice(v+1);g.splice(v),Array.prototype.push.apply(g,y)}var bs=new Error,aa=1,ia=2,oa=3,xi=4;function dl(g,v,y){var S=!1,H=-1,Z=0;return function(le){le=le===y;try{e:for(;!S;){var he=g();H++;for(var Ce=-1,ke=v.length,Be=!1;++Ce<ke;){var $e=v[Ce],ht=$e.func,at=$e.type;switch(at){case aa:he=ht(he,H);break;case ia:if(!ht(he,H))continue e;break;case oa:--$e.func,$e.func||(Be=!0);break;case xi:--$e.func,$e.func||ul(v,Ce);continue e;default:break e}}if(S=Be,le)y[Z++]=he;else return{value:he,done:!1}}}catch(Ct){if(Ct!==bs)throw Ct}return S=!0,{done:!0}}}var la=(function(){function g(v){if(o(this,g),this.__iteratees=[],this.__first=!1,this.__done=!1,this.__buf=[],xs(v)&&(v={next:v}),sa(v)){var y=v;v=function(){var he=y.next();if(he.done)throw bs;return he.value}}else if(Array.isArray(v)){var S=v,H=S.length,Z=0;v=function(){if(Z<H)return S[Z++];throw bs}}else if(!xs(v))throw new Error("Source is not iterable. Must be Array, Function or Object{next:Function}");this.next=dl(v,this.__iteratees,this.__buf)}return u(g,[{key:"_validate",value:function(){if(this.__first)throw new Error("Cannot add iteratee/transform after `first()`")}},{key:"_push",value:function(y){return this._validate(),this.__iteratees.push(y),this}},{key:"map",value:function(y){return this._push({type:aa,func:y})}},{key:"filter",value:function(y){return this._push({type:ia,func:y})}},{key:"take",value:function(y){return y>0?this._push({type:oa,func:y}):this}},{key:"drop",value:function(y){return y>0?this._push({type:xi,func:y}):this}},{key:"transform",value:function(y){this._validate();var S=this,H;return Yt(function(){return H||(H=Yt(y(S.value()))),H.next()})}},{key:"first",value:function(){return this.take(1),this.__first=!0,this}},{key:"value",value:function(){return this.__done||(this.__done=this.next(this.__buf).done),this.__first?this.__buf[0]:this.__buf}},{key:"each",value:function(y){for(;;){var S=this.next();if(S.done)break;if(y(S.value)===!1)return!1}return!0}},{key:"reduce",value:function(y,S){var H=this.next(),Z=0;for(S===void 0&&!H.done&&(S=H.value,H=this.next(),Z++);!H.done;)S=y(S,H.value,Z++),H=this.next();return S}},{key:"size",value:function(){return this.reduce(function(y,S){return++y},0)}}]),g})();typeof Symbol=="function"&&(la.prototype[Symbol.iterator]=function(){return this});var Wr=(function(){function g(v,y){o(this,g),this.__operators=v,this.__options=y}return u(g,[{key:"stream",value:function(y,S){var H=this;y=Yt(y);var Z=St[K];return oe(this.__operators)||fe(this.__operators,function(le){var he=pe(le);ae(he.length===1&&Ee(Qs(K),he[0]),"invalid aggregation operator ".concat(he)),he=he[0],S&&S instanceof bn?y=Z[he].call(S,y,le[he],H.__options):y=Z[he](y,le[he],H.__options)}),y}},{key:"run",value:function(y,S){return this.stream(y,S).value()}}]),g})();function bi(g,v,y){return ae(ee(v),"Aggregation pipeline must be an array"),new Wr(v,y).run(g)}var ca=(function(){function g(v,y,S){o(this,g),this.__filterFn=y.test.bind(y),this.__query=y,this.__source=v,this.__projection=S||y.__projection,this.__operators=[],this.__result=null,this.__stack=[],this.__options={}}return u(g,[{key:"_fetch",value:function(){return this.__result?this.__result:(xe(this.__projection)&&this.__operators.push({$project:this.__projection}),this.__result=Yt(this.__source).filter(this.__filterFn),this.__operators.length>0&&(this.__result=new Wr(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(y){return this.__operators.push({$skip:y}),this}},{key:"limit",value:function(y){return this.__operators.push({$limit:y}),this}},{key:"sort",value:function(y){return this.__operators.push({$sort:y}),this}},{key:"collation",value:function(y){return this.__options.collation=y,this}},{key:"next",value:function(){if(this.__stack){if(this.__stack.length>0)return this.__stack.pop();var y=this._fetch().next();if(!y.done)return y.value;this.__stack=null}}},{key:"hasNext",value:function(){if(!this.__stack)return!1;if(this.__stack.length>0)return!0;var y=this._fetch().next();return y.done?this.__stack=null:this.__stack.push(y.value),!!this.__stack}},{key:"map",value:function(y){return this._fetch().map(y).value()}},{key:"forEach",value:function(y){this._fetch().each(y)}}]),g})();typeof Symbol=="function"&&(ca.prototype[Symbol.iterator]=function(){return this._fetch()});var bn=(function(){function g(v,y){o(this,g),this.__criteria=v,this.__projection=y||{},this.__compiled=[],this._compile()}return u(g,[{key:"_compile",value:function(){var y=this;ae(xe(this.__criteria),"query criteria must be an object");var S;fe(this.__criteria,function(H,Z){Z==="$where"?S={field:Z,expr:H}:Z==="$expr"||Ee(["$and","$or","$nor"],Z)?y._processOperator(Z,Z,H):(ae(!Vs(Z),"unknown top level operator: ".concat(Z)),H=Qa(H),fe(H,function(le,he){y._processOperator(Z,he,le)})),xe(S)&&y._processOperator(S.field,S.field,S.expr)})}},{key:"_processOperator",value:function(y,S,H){ae(z(St[Q],S),"invalid query operator ".concat(S," detected")),this.__compiled.push(St[Q][S](y,H))}},{key:"test",value:function(y){for(var S=0,H=this.__compiled.length;S<H;S++)if(!this.__compiled[S](y))return!1;return!0}},{key:"find",value:function(y,S){return new ca(y,this,S)}},{key:"remove",value:function(y){var S=this;return Ne(y,function(H,Z){return S.test(Z)||H.push(Z),H},[])}}]),g})();function fl(g,v,y){return new bn(v).find(g,y)}function ua(g,v){return new bn(v).remove(g)}function da(g,v){if(Tt(g,v)||we(g)&&we(v))return!0;if(ee(g)){var y=Tt.bind(null,v);return g.some(y)||gt(g,1).some(y)}return!1}function wi(g,v){return!da(g,v)}function vi(g,v){return we(g)?v.some(Le):Se(Y(g),v).length>0}function _i(g,v){return!vi(g,v)}function yi(g,v){return Ot(g,v,function(y,S){return y<S})}function kt(g,v){return Ot(g,v,function(y,S){return y<=S})}function vt(g,v){return Ot(g,v,function(y,S){return y>S})}function ki(g,v){return Ot(g,v,function(y,S){return y>=S})}function hl(g,v){return Y(g).some(function(y){return me(y)&&ee(v)&&v.length===2&&y%v[0]===v[1]})}function pl(g,v){g=Y(g);var y=function(H){return G(H)&&!!H.match(v)};return g.some(y)||gt(g,1).some(y)}function ml(g,v){return(v===!1||v===0)&&g===void 0||(v===!0||v===1)&&g!==void 0}function gl(g,v){var y=!1;if(ee(g)&&ee(v))for(var S=0,H=v.length;S<H;S++)if(xe(v[S])&&Ee(pe(v[S]),"$elemMatch"))y=y||fa(g,v[S].$elemMatch);else return Se(v,g).length===H;return y}function xl(g,v){return ee(g)&&me(v)&&g.length===v}function fa(g,v){if(ee(g)&&!oe(g)){var y=function(Ce){return Ce},S=v;pe(v).every(Vs)&&(S={temp:v},y=function(Ce){return{temp:Ce}});for(var H=new bn(S),Z=0,le=g.length;Z<le;Z++)if(H.test(y(g[Z])))return!0}return!1}function bl(g,v){switch(v){case 1:case"double":return me(g)&&(g+"").indexOf(".")!==-1;case 2:case _:return G(g);case 3:case F:return xe(g);case 4:case D:return ee(g);case 6:case h:return we(g);case 8:case M:return V(g);case 9:case E:return qe(g);case 10:case w:return Le(g);case 11:case C:return Ue(g);case 16:case"int":return me(g)&&g<=2147483647&&(g+"").indexOf(".")===-1;case 18:case"long":return me(g)&&g>2147483647&&g<=9223372036854776e3&&(g+"").indexOf(".")===-1;case 19:case"decimal":return me(g);default:return!1}}function Ot(g,v,y){return Y(g).some(function(S){return de(S)===de(v)&&y(S,v)})}function On(g){return function(v,y){var S=Te(v,y);return g(S[0],S[1])}}var tr=On(da),ji=On(wi),ha=On(vt),ln=On(yi),Mi=On(ki),Ei=On(kt),Ti=On(_i);function Ni(g,v){var y=Te(g,v);return y[0]>y[1]?1:y[0]<y[1]?-1:0}function Ci(g,v){var y,S,H,Z="$cond: invalid arguments";ee(v)?(ae(v.length===3,Z),y=v[0],S=v[1],H=v[2]):(ae(xe(v),Z),y=v.if,S=v.then,H=v.else);var le=Te(g,y);return le?Te(g,S):Te(g,H)}function Si(g,v){var y="Invalid arguments for $switch operator";ae(v.branches,y);var S=v.branches.find(function(H){return ae(H.case&&H.then,y),Te(g,H.case)});return S?Te(g,S.then):(ae(v.default,y),Te(g,v.default))}function nn(g,v){ae(ee(v)&&v.length===2,"$ifNull expression must resolve to array(2)");var y=Te(g,v);return we(y[0])?y[1]:y[0]}function Ii(g,v){var y=Te(g,v),S=new Date(y.getFullYear(),0,0),H=y-S,Z=1e3*60*60*24;return Math.round(H/Z)}function Jt(g,v){var y=Te(g,v);return y.getDate()}function Ai(g,v){var y=Te(g,v);return y.getDay()+1}function pa(g,v){var y=Te(g,v);return y.getFullYear()}function Rn(g,v){var y=Te(g,v);return y.getMonth()+1}function Yr(g,v){var y=Te(g,v);y=new Date(+y),y.setHours(0,0,0),y.setDate(y.getDate()+4-(y.getDay()||7));var S=new Date(y.getFullYear(),0,1);return Math.floor(((y-S)/864e5+1)/7)}function ws(g,v){var y=Te(g,v);return y.getUTCHours()}function Mt(g,v){var y=Te(g,v);return y.getMinutes()}function $n(g,v){var y=Te(g,v);return y.getSeconds()}function vs(g,v){var y=Te(g,v);return y.getMilliseconds()}var wl={"%Y":[pa,4],"%m":[Rn,2],"%d":[Jt,2],"%H":[ws,2],"%M":[Mt,2],"%S":[$n,2],"%L":[vs,3],"%j":[Ii,3],"%w":[Ai,1],"%U":[Yr,2],"%%":"%"};function ma(g,v){for(var y=v.format,S=Te(g,v.date),H=y.match(/(%%|%Y|%m|%d|%H|%M|%S|%L|%j|%w|%U)/g),Z=0,le=H.length;Z<le;Z++){var he=wl[H[Z]],Ce=he;if(ee(he)){var ke=he[0],Be=he[1];Ce=vl(ke(g,S),Be)}y=y.replace(H[Z],Ce)}return y}function vl(g,v){return new Array(Math.max(v-String(g).length+1,0)).join("0")+g}function _l(g,v){return v}function yl(g,v){var y=Te(g,v),S=xn(y[0]),H=xn(y[1]);return S.length===H.length&&S.length===Se(S,H).length}function Di(g,v){var y=Te(g,v);return Se(y[0],y[1])}function _s(g,v){var y=Te(g,v);return y[0].filter(T.bind(null,y[1]))}function yr(g,v){var y=Te(g,v);return ze(y[0],y[1])}function kl(g,v){var y=Te(g,v);return Se(y[0],y[1]).length===y[0].length}function Oi(g,v){var y=Te(g,v)[0];return y.some(ce)}function Ri(g,v){var y=Te(g,v)[0];return y.every(ce)}function ga(g,v){var y=Te(g,v);return[null,void 0].some(Ee.bind(null,y))?null:y.join("")}function xa(g,v){var y=Te(g,v),S="$indexOfBytes expression resolves to invalid an argument";if(we(y[0]))return null;ae(G(y[0])&&G(y[1]),S);var H=y[0],Z=y[1],le=y[2],he=y[3],Ce=we(le)||me(le)&&le>=0&&Math.round(le)===le;if(Ce=Ce&&(we(he)||me(he)&&he>=0&&Math.round(he)===he),ae(Ce,S),le=le||0,he=he||H.length,le>he)return-1;var ke=H.substring(le,he).indexOf(Z);return ke>-1?ke+le:ke}function $i(g,v){var y=Te(g,v);return we(y[0])?null:(ae(y.every(G),"$split expression must result to array(2) of strings"),y[0].split(y[1]))}function jl(g,v){return~-encodeURI(Te(g,v)).split(/%..|./).length}function ba(g,v){return Te(g,v).length}function wa(g,v){var y=Te(g,v),S=y[0],H=y[1];return Tt(S,H)||y.every(we)?0:(ae(y.every(G),"$strcasecmp must resolve to array(2) of strings"),S=S.toUpperCase(),H=H.toUpperCase(),S>H&&1||S<H&&-1||0)}function Ml(g,v){var y=Te(g,v),S=y[0],H=y[1],Z=y[2];ae(G(S)&&me(H)&&H>=0&&me(Z)&&Z>=0,"$substrBytes: invalid arguments");for(var le=El(S),he=[],Ce=0,ke=0;ke<le.length;ke++)he.push(Ce),Ce+=le[ke].length;var Be=he.indexOf(H),$e=he.indexOf(H+Z);return ae(Be>-1&&$e>-1,"$substrBytes: invalid range, start or end index is a UTF-8 continuation byte."),S.substring(Be,$e)}function va(g,v){var y=Te(g,v),S=y[0],H=y[1],Z=y[2];return G(S)?H<0?"":Z<0?S.substr(H):S.substr(H,Z):""}function rn(g,v){return va(g,v)}function _a(g,v){var y=Te(g,v);return oe(y)?"":y.toLowerCase()}function qr(g,v){var y=Te(g,v);return oe(y)?"":y.toUpperCase()}var Li=[192,224,240];function Fi(g){if(g<128)return[g];for(var v=g<2048&&1||g<65536&&2||3,y=Li[v-1],S=[(g>>6*v)+y];v>0;)S.push(128|g>>6*--v&63);return S}function El(g){for(var v=[],y=0,S=g.length;y<S;y++)v.push(Fi(g.codePointAt(y)));return v}function Tl(g,v){var y=v.vars,S=v.in,H=pe(y);return fe(H,function(Z){var le=Te(g,y[Z]),he="$"+Z;g[he]=le}),Te(g,S)}var Nl=Object.freeze({__proto__:null,$abs:si,$add:Xo,$ceil:Zo,$divide:Ko,$exp:Vo,$floor:Qo,$ln:Jo,$log:ps,$log10:el,$mod:ms,$multiply:tl,$pow:nl,$round:rl,$sqrt:ai,$subtract:ii,$trunc:oi,$arrayElemAt:sl,$arrayToObject:al,$concatArrays:il,$filter:ci,$in:ui,$indexOfArray:di,$isArray:ea,$map:ol,$objectToArray:fi,$range:gs,$reduce:hi,$reverseArray:ll,$size:pi,$slice:mi,$zip:ta,$mergeObjects:cl,$and:gi,$or:na,$not:ra,$eq:tr,$ne:ji,$gt:ha,$lt:ln,$gte:Mi,$lte:Ei,$nin:Ti,$cmp:Ni,$cond:Ci,$switch:Si,$ifNull:nn,$dayOfYear:Ii,$dayOfMonth:Jt,$dayOfWeek:Ai,$year:pa,$month:Rn,$week:Yr,$hour:ws,$minute:Mt,$second:$n,$millisecond:vs,$dateToString:ma,$literal:_l,$setEquals:yl,$setIntersection:Di,$setDifference:_s,$setUnion:yr,$setIsSubset:kl,$anyElementTrue:Oi,$allElementsTrue:Ri,$concat:ga,$indexOfBytes:xa,$split:$i,$strLenBytes:jl,$strLenCP:ba,$strcasecmp:wa,$substrBytes:Ml,$substr:va,$substrCP:rn,$toLower:_a,$toUpper:qr,$let:Tl});function Wn(g,v){return we(v)?g:g.map(function(y){return Te(y,v)})}function Cl(g,v){return xn(Wn(g,v))}function kr(g,v){var y=Wn(g,v).filter(me),S=Ne(y,function(H,Z){return H+Z},0);return S/(y.length||1)}function Sl(g,v){return g.length>0?Te(g[0],v):void 0}function Il(g,v){return g.length>0?Te(g[g.length-1],v):void 0}function ya(g,v){return Ne(Wn(g,v),function(y,S){return we(y)||S>y?S:y},void 0)}function zi(g,v){return Ne(g,function(y,S){return Object.assign(y,Te(S,v))},{})}function Yn(g,v){return Ne(Wn(g,v),function(y,S){return we(y)||S<y?S:y},void 0)}function ys(g,v){return Ja(Wn(g,v).filter(me),!1)}function Al(g,v){return Ja(Wn(g,v).filter(me),!0)}function Dl(g,v){return ee(g)?me(v)?g.length*v:Ne(Wn(g,v).filter(me),function(y,S){return y+S},0):0}var Ol=Object.freeze({__proto__:null,$addToSet:Cl,$avg:kr,$first:Sl,$last:Il,$max:ya,$mergeObjects:zi,$min:Yn,$push:Wn,$stdDevPop:ys,$stdDevSamp:Al,$sum:Dl});function nr(g,v,y){var S=pe(v);return S.length===0?g:g.map(function(H){var Z=ue(H);return fe(S,function(le){var he=Te(H,v[le]);Zs(Z,le,he)}),Z})}var wn=nr;function Pi(g,v,y){var S=v.boundaries,H=v.default,Z=S[0],le=S[S.length-1],he=v.output||{count:{$sum:1}};ae(S.length>2,"$bucket 'boundaries' expression must have at least 3 elements");for(var Ce=de(Z),ke=0,Be=S.length-1;ke<Be;ke++)ae(Ce===de(S[ke+1]),"$bucket 'boundaries' must all be of the same type"),ae(S[ke]<S[ke+1],"$bucket 'boundaries' must be sorted in ascending order");!we(H)&&de(v.default)===de(Z)&&ae(Z>v.default||le<v.default,"$bucket 'default' expression must be out of boundaries range");var $e={};fe(S,function(at){return $e[at]=[]}),we(H)||($e[H]=[]);var ht=!1;return Yt(function(){return ht||(g.each(function(at){var Ct=Te(at,v.groupBy);if(we(Ct)||Ct<Z||Ct>=le)ae(!we(H),"$bucket require a default for out of range values"),$e[H].push(at);else{ae(Ct>=Z&&Ct<le,"$bucket 'groupBy' expression must resolve to a value in range of boundaries");var qt=vr(S,Ct),Kt=S[Math.max(0,qt-1)];$e[Kt].push(at)}}),S.pop(),we(H)||S.push(H),ht=Yt(S).map(function(at){var Ct=Br($e[at],null,he);return Object.assign(Ct,{_id:at})})),ht.next()})}function Rl(g,v,y){var S=v.output||{count:{$sum:1}},H=v.groupBy,Z=v.buckets;return ae(Z>0,"The $bucketAuto 'buckets' field must be greater than 0, but found: "+Z),g.transform(function(le){for(var he=Math.max(1,Math.round(le.length/Z)),Ce=Hr(Te),ke={},Be=[],$e=An(le,function(tt){var Xr=Ce(tt,H);return we(Xr)?Be.push(tt):(ke[Xr]||(ke[Xr]=[]),ke[Xr].push(tt)),Xr}),ht=_r(),at=[],Ct=0,qt=0,Kt=$e.length;qt<Z&&Ct<Kt;qt++){for(var un={},R=[],sr=0;sr<he&&Ct<Kt;sr++){var Mn=Ce($e[Ct],H);if(we(Mn)&&(Mn=null),Nt(R,we(Mn)?Be:ke[Mn]),Ct+=we(Mn)?Be.length:ke[Mn].length,z(un,"min")||(un.min=Mn),at.length>0){var dn=at[at.length-1];dn[ht].max=un.min}}qt==Z-1&&Nt(R,$e.slice(Ct)),at.push(Object.assign(Br(R,null,S),{_id:un}))}return at.length>0&&(at[at.length-1][ht].max=Ce($e[$e.length-1],H)),at})}function $l(g,v,y){return ae(G(v)&&v.trim()!==""&&v.indexOf(".")===-1&&v.trim()[0]!=="$","Invalid expression value for $count"),Yt(function(){var S={};return S[v]=g.size(),{value:S,done:!1}}).first()}function Ll(g,v,y){return g.transform(function(S){return[re(v,function(H){return bi(S,H)})]})}function Hi(g,v,y){var S=_r(),H=v[S];return g.transform(function(Z){var le=Un(Z,function(ke){return Te(ke,H,H)});v=be(v),delete v[S];var he=-1,Ce=le.keys.length;return function(){if(++he===Ce)return{done:!0};var ke=le.keys[he],Be={};return ke!==void 0&&(Be[S]=ke),fe(v,function($e,ht){Be[ht]=Br(le.groups[he],ht,$e)}),{value:Be,done:!1}}})}function Fl(g,v,y){return g.take(v)}function jr(g,v,y){var S=v.from,H=v.localField,Z=v.foreignField,le=v.as;ae(ee(S)&&G(Z)&&G(H)&&G(le),"$lookup: invalid argument");var he={};return fe(S,function(Ce){var ke=Gt(tn(Ce,Z));he[ke]=he[ke]||[],he[ke].push(Ce)}),g.map(function(Ce){var ke=Gt(tn(Ce,H)),Be=be(Ce);return Be[le]=he[ke]||[],Be})}function ne(g,v,y){var S=new bn(v);return g.filter(function(H){return S.test(H)})}function ve(g,v,y){return ae(ee(v),"$out expression must be an array"),g.map(function(S){return v.push(S),S})}function ge(g,v,y){if(oe(v))return g;var S=pe(v),H=!1,Z=_r();if(Ze(v),Ee(S,Z)){var le=v[Z];(le===0||le===!1)&&(S=S.filter(T.bind(null,[Z])),ae(T(S,Z),"Must not contain collections id key"),H=oe(S))}else S.push(Z);return g.map(function(he){return Re(he,v,S,H)})}function Re(g,v,y,S){var H=_r(),Z={},le=!1,he=!1,Ce=[];return S&&Ce.push(H),y.forEach(function(ke){var Be,$e=v[ke];if(ke!==H&&Ee([0,!1],$e)&&(he=!0),ke===H&&oe($e))Be=g[ke];else if(G($e))Be=Te(g,$e,ke);else if(!Ee([1,!0],$e))if(ee($e))Be=$e.map(function(un){var R=Te(g,un);return we(R)?null:R});else if(xe($e)){var ht=pe($e),at=ht.length>1?!1:ht[0];if(Ee(Qs($),at)){var Ct=St[$];at==="$slice"?Y($e[at]).every(me)?(Be=Ct[at](g,$e[at],ke),le=!0):Be=Te(g,$e,ke):Be=Ct[at](g,$e[at],ke)}else if(z(g,ke)){Ze($e);var qt=g[ke];Be=ee(qt)?qt.map(function(un){return Re(un,$e,ht,!1)}):Re(qt,$e,ht,!1)}else Be=Te(g,$e,ke)}else{Ce.push(ke);return}var Kt=Bn(g,ke,{preserveMissingValues:!0});Kt!==void 0&&Me(Z,Kt,{flatten:!0}),T([0,1,!1,!0],$e)&&(Be===void 0?Ks(Z,ke):Zs(Z,ke,Be))}),jn(Z),(le||he||S)&&(Z=Object.assign({},g,Z),Ce.length>0&&(Z=ue(Z),fe(Ce,function(ke){return Ks(Z,ke)}))),Z}function Ze(g){var v=_r(),y=[!1,!1];fe(g,function(S,H){H!==v&&(S===0||S===!1?y[0]=!0:(S===1||S===!0)&&(y[1]=!0),ae(!(y[0]&&y[1]),"Projection cannot have a mix of inclusion and exclusion."))})}function ft(g,v,y){return g.map(function(S){return Js(ue(S),v)})}function Lt(g,v,y){return g.map(function(S){return S=Te(S,v.newRoot),ae(xe(S),"$replaceRoot expression must return an object"),S})}function _t(g,v,y){var S=v.size;return ae(me(S),"$sample size must be a positive integer"),g.transform(function(H){var Z=H.length,le=-1;return function(){if(++le===S)return{done:!0};var he=Math.floor(Math.random()*Z);return{value:H[he],done:!1}}})}function ka(g,v,y){return g.drop(v)}function Ui(g,v,y){if(oe(v)||!xe(v))return g;y=y||{};var S=wt,H=y.collation;return xe(H)&&G(H.locale)&&(S=ks(H)),g.transform(function(Z){var le=pe(v);return fe(le.reverse(),function(he){var Ce=Un(Z,function($e){return tn($e,he)}),ke={},Be=An(Ce.keys,function($e,ht){return ke[$e]=ht,$e},S);v[he]===-1&&Be.reverse(),Z=[],fe(Be,function($e){return Nt(Z,Ce.groups[ke[$e]])})}),Z})}var cn={1:"base",2:"accent",3:"variant"};function ks(g){var v={sensitivity:cn[g.strength||3],caseFirst:g.caseFirst==="off"?"false":g.caseFirst||"false",numeric:g.numericOrdering||!1,ignorePunctuation:g.alternate==="shifted"};(g.caseLevel||!1)===!0&&(v.sensitivity==="base"&&(v.sensitivity="case"),v.sensitivity==="accent"&&(v.sensitivity="variant"));var y=new Intl.Collator(g.locale,v);return function(S,H){if(!G(S)||!G(H))return wt(S,H);var Z=y.compare(S,H);return Z<0?-1:Z>0?1:0}}function zl(g,v,y){var S={count:{$sum:1}};return S[_r()]=v,Ui(Hi(g,S),{count:-1},y)}function Mr(g,v,y){G(v)&&(v={path:v});var S=v.path.substr(1),H=v.includeArrayIndex||!1,Z=v.preserveNullAndEmptyArrays||!1,le=function(ke,Be){return H!==!1&&(ke[H]=Be),ke},he;return Yt(function(){for(var Ce=function(){if(Yt.isIterator(he)){var $e=he.next();if(!$e.done)return{v:$e}}var ht=g.next();if(ht.done)return{v:ht};if(ht=ht.value,he=tn(ht,S),ee(he))if(he.length===0&&Z===!0){he=null;var at=ue(ht);return Ks(at,S),{v:{value:le(at,null),done:!1}}}else he=Yt(he).map(function(qt,Kt){var un=ue(ht);return Zs(un,S,qt),le(un,Kt)});else if(!oe(he)||Z===!0){var Ct=ue(ht);return{v:{value:le(Ct,null),done:!1}}}};;){var ke=Ce();if(s(ke)==="object")return ke.v}})}var js=Object.freeze({__proto__:null,$addFields:nr,$set:wn,$bucket:Pi,$bucketAuto:Rl,$count:$l,$facet:Ll,$group:Hi,$limit:Fl,$lookup:jr,$match:ne,$out:ve,$project:ge,$redact:ft,$replaceRoot:Lt,$sample:_t,$skip:ka,$sort:Ui,$sortByCount:zl,$unwind:Mr});function Ms(g,v,y){te("$ not implemented")}function mt(g,v,y){var S=tn(g,y),H=new bn(v);ae(ee(S),"$elemMatch: invalid argument");for(var Z=0;Z<S.length;Z++)if(H.test(S[Z]))return[S[Z]]}function Pl(g,v,y){var S=tn(g,y);return ee(S)?ee(v)?ds(S,v[0],v[1]):(ae(me(v),"$slice: invalid arguments for projection"),ds(S,v)):S}var Bi=Object.freeze({__proto__:null,$:Ms,$elemMatch:mt,$slice:Pl});function Ut(g){return function(v,y){return function(S){var H=tn(S,v,{meta:!0});return H=Qe(H.result,H.depth),g(H,y)}}}var Hl=Ut(gl),Ul=Ut(fa),Bl=Ut(da),Es=Ut(ml),qn=Ut(vt),Ts=Ut(ki),Wi=Ut(vi),Ns=Ut(yi),Yi=Ut(kt),qi=Ut(hl),Cs=Ut(wi),Gi=Ut(_i),Gr=Ut(pl),rr=Ut(xl),Ss=Ut(bl);function Wl(g,v){ae(ee(v),"Invalid expression: $and expects value to be an Array");var y=[];return fe(v,function(S){return y.push(new bn(S))}),function(S){for(var H=0;H<y.length;H++)if(!y[H].test(S))return!1;return!0}}function Xi(g,v){ae(ee(v),"Invalid expression. $or expects value to be an Array");var y=[];return fe(v,function(S){return y.push(new bn(S))}),function(S){for(var H=0;H<y.length;H++)if(y[H].test(S))return!0;return!1}}function Yl(g,v){ae(ee(v),"Invalid expression. $nor expects value to be an Array");var y=Xi("$or",v);return function(S){return!y(S)}}function Is(g,v){var y={};y[g]=Qa(v);var S=new bn(y);return function(H){return!S.test(H)}}function As(g,v){return Xe(v)||(v=new Function("return "+v+";")),function(y){return v.call(y)===!0}}function ja(g,v){return function(y){return Te(y,v)}}var ql=Object.freeze({__proto__:null,$all:Hl,$elemMatch:Ul,$eq:Bl,$exists:Es,$gt:qn,$gte:Ts,$in:Wi,$lt:Ns,$lte:Yi,$mod:qi,$ne:Cs,$nin:Gi,$regex:Gr,$size:rr,$type:Ss,$and:Wl,$or:Xi,$nor:Yl,$not:Is,$where:As,$expr:ja}),St={};St[P]={},St[U]={},St[K]={},St[$]={},St[Q]={};var Gl=[[P,Nl],[U,Ol],[K,js],[$,Bi],[Q,ql]];function Xl(){fe(Gl,function(g){var v=d(g,2),y=v[0],S=v[1];Object.assign(St[y],S)})}function Ft(g,v){var y=v(ei());ae(z(St,g),"Invalid operator class ".concat(g));var S=St[g];fe(y,function(Z,le){ae(/^\$[a-zA-Z0-9_]*$/.test(le),"Invalid operator name ".concat(le)),ae(!z(S,le),"".concat(le," already exists for '").concat(g,"' operators"))});var H={};switch(g){case Q:fe(y,function(Z,le){Z=Z.bind(y),H[le]=function(he,Ce){return function(ke){var Be=tn(ke,he),$e=Z(he,Be,Ce);return ae(V($e),"".concat(le," must return a boolean")),$e}}});break;case $:fe(y,function(Z,le){Z=Z.bind(y),H[le]=function(he,Ce,ke){var Be=tn(he,ke);return Z(ke,Be,Ce)}});break;default:fe(y,function(Z,le){H[le]=function(){for(var he=arguments.length,Ce=new Array(he),ke=0;ke<he;ke++)Ce[ke]=arguments[ke];return Z.apply(y,Ce)}})}Object.assign(St[g],H)}var Xt={query:function(v,y){return new bn(v).find(this.toJSON(),y)},aggregate:function(v){return new Wr(v).run(this.toJSON())}};Xl();var Zl="2.5.3",Kl={_internal:ei,Aggregator:Wr,CollectionMixin:Xt,Cursor:ca,Lazy:Yt,OP_EXPRESSION:P,OP_GROUP:U,OP_PIPELINE:K,OP_PROJECTION:$,OP_QUERY:Q,Query:bn,VERSION:Zl,addOperators:Ft,aggregate:bi,find:fl,remove:ua,setup:Go};return Kl}))})(To)),To.exports}var $a={exports:{}};var g8=$a.exports,Wh;function td(){return Wh||(Wh=1,(function(t,a){(function(){var s,o="4.18.1",c=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",l="Invalid `variable` option passed into `_.template`",f="Invalid `imports` option passed into `_.template`",m="__lodash_hash_undefined__",p=500,b="__lodash_placeholder__",w=1,h=2,M=4,x=1,j=2,_=1,E=2,C=4,A=8,D=16,F=32,O=64,q=128,P=256,U=512,K=30,$="...",Q=800,N=16,W=1,ae=2,ue=3,be=1/0,de=9007199254740991,ie=17976931348623157e292,V=NaN,G=4294967295,me=G-1,ee=G>>>1,xe=[["ary",q],["bind",_],["bindKey",E],["curry",A],["curryRight",D],["flip",U],["partial",F],["partialRight",O],["rearg",P]],Fe="[object Arguments]",qe="[object Array]",Ue="[object AsyncFunction]",Xe="[object Boolean]",we="[object Date]",Le="[object DOMException]",Ie="[object Error]",Ee="[object Function]",T="[object GeneratorFunction]",ce="[object Map]",oe="[object Number]",Y="[object Null]",z="[object Object]",te="[object Promise]",pe="[object Proxy]",fe="[object RegExp]",re="[object Set]",Me="[object String]",Ne="[object Symbol]",Se="[object Undefined]",ze="[object WeakMap]",gt="[object WeakSet]",Qe="[object ArrayBuffer]",Tt="[object DataView]",xn="[object Float32Array]",$t="[object Float64Array]",Gt="[object Int8Array]",wt="[object Int16Array]",An="[object Int32Array]",Un="[object Uint8Array]",Nt="[object Uint8ClampedArray]",vr="[object Uint16Array]",Hr="[object Uint32Array]",Ur=/\b__p \+= '';/g,tn=/\b(__p \+=) '' \+/g,Bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,jn=/&(?:amp|lt|gt|quot|#39);/g,Dn=/[&<>"']/g,Zs=RegExp(jn.source),Ks=RegExp(Dn.source),Vs=/<%-([\s\S]+?)%>/g,Qa=/<%([\s\S]+?)%>/g,ds=/<%=([\s\S]+?)%>/g,Ja=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qo=/^\w*$/,ei=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fs=/[\\^$.*+?()[\]{}|]/g,Go=RegExp(fs.source),hs=/^\s+/,ti=/\s/,ni=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ri=/\{\n\/\* \[wrapped with (.+)\] \*/,_r=/,? & /,Qs=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Br=/[()=,{}\[\]\/\s]/,Te=/\\(\\)?/g,Js=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,si=/\w*$/,Xo=/^[-+]0x[0-9a-f]+$/i,Zo=/^0b[01]+$/i,Ko=/^\[object .+?Constructor\]$/,Vo=/^0o[0-7]+$/i,Qo=/^(?:0|[1-9]\d*)$/,Jo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ps=/($^)/,el=/['\n\r\u2028\u2029\\]/g,ms="\\ud800-\\udfff",tl="\\u0300-\\u036f",nl="\\ufe20-\\ufe2f",rl="\\u20d0-\\u20ff",ai=tl+nl+rl,ii="\\u2700-\\u27bf",oi="a-z\\xdf-\\xf6\\xf8-\\xff",li="\\xac\\xb1\\xd7\\xf7",sl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",al="\\u2000-\\u206f",il=" \\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",ci="A-Z\\xc0-\\xd6\\xd8-\\xde",ui="\\ufe0e\\ufe0f",di=li+sl+al+il,ea="['’]",ol="["+ms+"]",fi="["+di+"]",gs="["+ai+"]",hi="\\d+",ll="["+ii+"]",pi="["+oi+"]",mi="[^"+ms+di+hi+ii+oi+ci+"]",ta="\\ud83c[\\udffb-\\udfff]",cl="(?:"+gs+"|"+ta+")",gi="[^"+ms+"]",na="(?:\\ud83c[\\udde6-\\uddff]){2}",ra="[\\ud800-\\udbff][\\udc00-\\udfff]",Yt="["+ci+"]",sa="\\u200d",xs="(?:"+pi+"|"+mi+")",ul="(?:"+Yt+"|"+mi+")",bs="(?:"+ea+"(?:d|ll|m|re|s|t|ve))?",aa="(?:"+ea+"(?:D|LL|M|RE|S|T|VE))?",ia=cl+"?",oa="["+ui+"]?",xi="(?:"+sa+"(?:"+[gi,na,ra].join("|")+")"+oa+ia+")*",dl="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",la="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wr=oa+ia+xi,bi="(?:"+[ll,na,ra].join("|")+")"+Wr,ca="(?:"+[gi+gs+"?",gs,na,ra,ol].join("|")+")",bn=RegExp(ea,"g"),fl=RegExp(gs,"g"),ua=RegExp(ta+"(?="+ta+")|"+ca+Wr,"g"),da=RegExp([Yt+"?"+pi+"+"+bs+"(?="+[fi,Yt,"$"].join("|")+")",ul+"+"+aa+"(?="+[fi,Yt+xs,"$"].join("|")+")",Yt+"?"+xs+"+"+bs,Yt+"+"+aa,la,dl,hi,bi].join("|"),"g"),wi=RegExp("["+sa+ms+ai+ui+"]"),vi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,_i=["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"],yi=-1,kt={};kt[xn]=kt[$t]=kt[Gt]=kt[wt]=kt[An]=kt[Un]=kt[Nt]=kt[vr]=kt[Hr]=!0,kt[Fe]=kt[qe]=kt[Qe]=kt[Xe]=kt[Tt]=kt[we]=kt[Ie]=kt[Ee]=kt[ce]=kt[oe]=kt[z]=kt[fe]=kt[re]=kt[Me]=kt[ze]=!1;var vt={};vt[Fe]=vt[qe]=vt[Qe]=vt[Tt]=vt[Xe]=vt[we]=vt[xn]=vt[$t]=vt[Gt]=vt[wt]=vt[An]=vt[ce]=vt[oe]=vt[z]=vt[fe]=vt[re]=vt[Me]=vt[Ne]=vt[Un]=vt[Nt]=vt[vr]=vt[Hr]=!0,vt[Ie]=vt[Ee]=vt[ze]=!1;var ki={À:"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"},hl={"&":"&","<":"<",">":">",'"':""","'":"'"},pl={"&":"&","<":"<",">":">",""":'"',"'":"'"},ml={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gl=parseFloat,xl=parseInt,fa=typeof Or=="object"&&Or&&Or.Object===Object&&Or,bl=typeof self=="object"&&self&&self.Object===Object&&self,Ot=fa||bl||Function("return this")(),On=a&&!a.nodeType&&a,tr=On&&!0&&t&&!t.nodeType&&t,ji=tr&&tr.exports===On,ha=ji&&fa.process,ln=(function(){try{var ne=tr&&tr.require&&tr.require("util").types;return ne||ha&&ha.binding&&ha.binding("util")}catch{}})(),Mi=ln&&ln.isArrayBuffer,Ei=ln&&ln.isDate,Ti=ln&&ln.isMap,Ni=ln&&ln.isRegExp,Ci=ln&&ln.isSet,Si=ln&&ln.isTypedArray;function nn(ne,ve,ge){switch(ge.length){case 0:return ne.call(ve);case 1:return ne.call(ve,ge[0]);case 2:return ne.call(ve,ge[0],ge[1]);case 3:return ne.call(ve,ge[0],ge[1],ge[2])}return ne.apply(ve,ge)}function Ii(ne,ve,ge,Re){for(var Ze=-1,ft=ne==null?0:ne.length;++Ze<ft;){var Lt=ne[Ze];ve(Re,Lt,ge(Lt),ne)}return Re}function Jt(ne,ve){for(var ge=-1,Re=ne==null?0:ne.length;++ge<Re&&ve(ne[ge],ge,ne)!==!1;);return ne}function Ai(ne,ve){for(var ge=ne==null?0:ne.length;ge--&&ve(ne[ge],ge,ne)!==!1;);return ne}function pa(ne,ve){for(var ge=-1,Re=ne==null?0:ne.length;++ge<Re;)if(!ve(ne[ge],ge,ne))return!1;return!0}function Rn(ne,ve){for(var ge=-1,Re=ne==null?0:ne.length,Ze=0,ft=[];++ge<Re;){var Lt=ne[ge];ve(Lt,ge,ne)&&(ft[Ze++]=Lt)}return ft}function Yr(ne,ve){var ge=ne==null?0:ne.length;return!!ge&&yr(ne,ve,0)>-1}function ws(ne,ve,ge){for(var Re=-1,Ze=ne==null?0:ne.length;++Re<Ze;)if(ge(ve,ne[Re]))return!0;return!1}function Mt(ne,ve){for(var ge=-1,Re=ne==null?0:ne.length,Ze=Array(Re);++ge<Re;)Ze[ge]=ve(ne[ge],ge,ne);return Ze}function $n(ne,ve){for(var ge=-1,Re=ve.length,Ze=ne.length;++ge<Re;)ne[Ze+ge]=ve[ge];return ne}function vs(ne,ve,ge,Re){var Ze=-1,ft=ne==null?0:ne.length;for(Re&&ft&&(ge=ne[++Ze]);++Ze<ft;)ge=ve(ge,ne[Ze],Ze,ne);return ge}function wl(ne,ve,ge,Re){var Ze=ne==null?0:ne.length;for(Re&&Ze&&(ge=ne[--Ze]);Ze--;)ge=ve(ge,ne[Ze],Ze,ne);return ge}function ma(ne,ve){for(var ge=-1,Re=ne==null?0:ne.length;++ge<Re;)if(ve(ne[ge],ge,ne))return!0;return!1}var vl=ga("length");function _l(ne){return ne.split("")}function yl(ne){return ne.match(Qs)||[]}function Di(ne,ve,ge){var Re;return ge(ne,function(Ze,ft,Lt){if(ve(Ze,ft,Lt))return Re=ft,!1}),Re}function _s(ne,ve,ge,Re){for(var Ze=ne.length,ft=ge+(Re?1:-1);Re?ft--:++ft<Ze;)if(ve(ne[ft],ft,ne))return ft;return-1}function yr(ne,ve,ge){return ve===ve?Dl(ne,ve,ge):_s(ne,Oi,ge)}function kl(ne,ve,ge,Re){for(var Ze=ge-1,ft=ne.length;++Ze<ft;)if(Re(ne[Ze],ve))return Ze;return-1}function Oi(ne){return ne!==ne}function Ri(ne,ve){var ge=ne==null?0:ne.length;return ge?ba(ne,ve)/ge:V}function ga(ne){return function(ve){return ve==null?s:ve[ne]}}function xa(ne){return function(ve){return ne==null?s:ne[ve]}}function $i(ne,ve,ge,Re,Ze){return Ze(ne,function(ft,Lt,_t){ge=Re?(Re=!1,ft):ve(ge,ft,Lt,_t)}),ge}function jl(ne,ve){var ge=ne.length;for(ne.sort(ve);ge--;)ne[ge]=ne[ge].value;return ne}function ba(ne,ve){for(var ge,Re=-1,Ze=ne.length;++Re<Ze;){var ft=ve(ne[Re]);ft!==s&&(ge=ge===s?ft:ge+ft)}return ge}function wa(ne,ve){for(var ge=-1,Re=Array(ne);++ge<ne;)Re[ge]=ve(ge);return Re}function Ml(ne,ve){return Mt(ve,function(ge){return[ge,ne[ge]]})}function va(ne){return ne&&ne.slice(0,Pi(ne)+1).replace(hs,"")}function rn(ne){return function(ve){return ne(ve)}}function _a(ne,ve){return Mt(ve,function(ge){return ne[ge]})}function qr(ne,ve){return ne.has(ve)}function Li(ne,ve){for(var ge=-1,Re=ne.length;++ge<Re&&yr(ve,ne[ge],0)>-1;);return ge}function Fi(ne,ve){for(var ge=ne.length;ge--&&yr(ve,ne[ge],0)>-1;);return ge}function El(ne,ve){for(var ge=ne.length,Re=0;ge--;)ne[ge]===ve&&++Re;return Re}var Tl=xa(ki),Nl=xa(hl);function Wn(ne){return"\\"+ml[ne]}function Cl(ne,ve){return ne==null?s:ne[ve]}function kr(ne){return wi.test(ne)}function Sl(ne){return vi.test(ne)}function Il(ne){for(var ve,ge=[];!(ve=ne.next()).done;)ge.push(ve.value);return ge}function ya(ne){var ve=-1,ge=Array(ne.size);return ne.forEach(function(Re,Ze){ge[++ve]=[Ze,Re]}),ge}function zi(ne,ve){return function(ge){return ne(ve(ge))}}function Yn(ne,ve){for(var ge=-1,Re=ne.length,Ze=0,ft=[];++ge<Re;){var Lt=ne[ge];(Lt===ve||Lt===b)&&(ne[ge]=b,ft[Ze++]=ge)}return ft}function ys(ne){var ve=-1,ge=Array(ne.size);return ne.forEach(function(Re){ge[++ve]=Re}),ge}function Al(ne){var ve=-1,ge=Array(ne.size);return ne.forEach(function(Re){ge[++ve]=[Re,Re]}),ge}function Dl(ne,ve,ge){for(var Re=ge-1,Ze=ne.length;++Re<Ze;)if(ne[Re]===ve)return Re;return-1}function Ol(ne,ve,ge){for(var Re=ge+1;Re--;)if(ne[Re]===ve)return Re;return Re}function nr(ne){return kr(ne)?$l(ne):vl(ne)}function wn(ne){return kr(ne)?Ll(ne):_l(ne)}function Pi(ne){for(var ve=ne.length;ve--&&ti.test(ne.charAt(ve)););return ve}var Rl=xa(pl);function $l(ne){for(var ve=ua.lastIndex=0;ua.test(ne);)++ve;return ve}function Ll(ne){return ne.match(ua)||[]}function Hi(ne){return ne.match(da)||[]}var Fl=(function ne(ve){ve=ve==null?Ot:jr.defaults(Ot.Object(),ve,jr.pick(Ot,_i));var ge=ve.Array,Re=ve.Date,Ze=ve.Error,ft=ve.Function,Lt=ve.Math,_t=ve.Object,ka=ve.RegExp,Ui=ve.String,cn=ve.TypeError,ks=ge.prototype,zl=ft.prototype,Mr=_t.prototype,js=ve["__core-js_shared__"],Ms=zl.toString,mt=Mr.hasOwnProperty,Pl=0,Bi=(function(){var e=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})(),Ut=Mr.toString,Hl=Ms.call(_t),Ul=Ot._,Bl=ka("^"+Ms.call(mt).replace(fs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Es=ji?ve.Buffer:s,qn=ve.Symbol,Ts=ve.Uint8Array,Wi=Es?Es.allocUnsafe:s,Ns=zi(_t.getPrototypeOf,_t),Yi=_t.create,qi=Mr.propertyIsEnumerable,Cs=ks.splice,Gi=qn?qn.isConcatSpreadable:s,Gr=qn?qn.iterator:s,rr=qn?qn.toStringTag:s,Ss=(function(){try{var e=Jr(_t,"defineProperty");return e({},"",{}),e}catch{}})(),Wl=ve.clearTimeout!==Ot.clearTimeout&&ve.clearTimeout,Xi=Re&&Re.now!==Ot.Date.now&&Re.now,Yl=ve.setTimeout!==Ot.setTimeout&&ve.setTimeout,Is=Lt.ceil,As=Lt.floor,ja=_t.getOwnPropertySymbols,ql=Es?Es.isBuffer:s,St=ve.isFinite,Gl=ks.join,Xl=zi(_t.keys,_t),Ft=Lt.max,Xt=Lt.min,Zl=Re.now,Kl=ve.parseInt,g=Lt.random,v=ks.reverse,y=Jr(ve,"DataView"),S=Jr(ve,"Map"),H=Jr(ve,"Promise"),Z=Jr(ve,"Set"),le=Jr(ve,"WeakMap"),he=Jr(_t,"create"),Ce=le&&new le,ke={},Be=es(y),$e=es(S),ht=es(H),at=es(Z),Ct=es(le),qt=qn?qn.prototype:s,Kt=qt?qt.valueOf:s,un=qt?qt.toString:s;function R(e){if(Rt(e)&&!Ve(e)&&!(e instanceof tt)){if(e instanceof dn)return e;if(mt.call(e,"__wrapped__"))return af(e)}return new dn(e)}var sr=(function(){function e(){}return function(r){if(!At(r))return{};if(Yi)return Yi(r);e.prototype=r;var i=new e;return e.prototype=s,i}})();function Mn(){}function dn(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=s}R.templateSettings={escape:Vs,evaluate:Qa,interpolate:ds,variable:"",imports:{_:R}},R.prototype=Mn.prototype,R.prototype.constructor=R,dn.prototype=sr(Mn.prototype),dn.prototype.constructor=dn;function tt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=G,this.__views__=[]}function Xr(){var e=new tt(this.__wrapped__);return e.__actions__=fn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=fn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=fn(this.__views__),e}function tg(){if(this.__filtered__){var e=new tt(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function ng(){var e=this.__wrapped__.value(),r=this.__dir__,i=Ve(e),k=r<0,I=i?e.length:0,L=px(0,I,this.__views__),X=L.start,J=L.end,se=J-X,_e=k?J:X-1,ye=this.__iteratees__,je=ye.length,De=0,Pe=Xt(se,this.__takeCount__);if(!i||!k&&I==se&&Pe==se)return Nd(e,this.__actions__);var Ge=[];e:for(;se--&&De<Pe;){_e+=r;for(var nt=-1,We=e[_e];++nt<je;){var it=ye[nt],ct=it.iteratee,yn=it.type,on=ct(We);if(yn==ae)We=on;else if(!on){if(yn==W)continue e;break e}}Ge[De++]=We}return Ge}tt.prototype=sr(Mn.prototype),tt.prototype.constructor=tt;function Zr(e){var r=-1,i=e==null?0:e.length;for(this.clear();++r<i;){var k=e[r];this.set(k[0],k[1])}}function rg(){this.__data__=he?he(null):{},this.size=0}function sg(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}function ag(e){var r=this.__data__;if(he){var i=r[e];return i===m?s:i}return mt.call(r,e)?r[e]:s}function ig(e){var r=this.__data__;return he?r[e]!==s:mt.call(r,e)}function og(e,r){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=he&&r===s?m:r,this}Zr.prototype.clear=rg,Zr.prototype.delete=sg,Zr.prototype.get=ag,Zr.prototype.has=ig,Zr.prototype.set=og;function ar(e){var r=-1,i=e==null?0:e.length;for(this.clear();++r<i;){var k=e[r];this.set(k[0],k[1])}}function lg(){this.__data__=[],this.size=0}function cg(e){var r=this.__data__,i=Zi(r,e);if(i<0)return!1;var k=r.length-1;return i==k?r.pop():Cs.call(r,i,1),--this.size,!0}function ug(e){var r=this.__data__,i=Zi(r,e);return i<0?s:r[i][1]}function dg(e){return Zi(this.__data__,e)>-1}function fg(e,r){var i=this.__data__,k=Zi(i,e);return k<0?(++this.size,i.push([e,r])):i[k][1]=r,this}ar.prototype.clear=lg,ar.prototype.delete=cg,ar.prototype.get=ug,ar.prototype.has=dg,ar.prototype.set=fg;function ir(e){var r=-1,i=e==null?0:e.length;for(this.clear();++r<i;){var k=e[r];this.set(k[0],k[1])}}function hg(){this.size=0,this.__data__={hash:new Zr,map:new(S||ar),string:new Zr}}function pg(e){var r=oo(this,e).delete(e);return this.size-=r?1:0,r}function mg(e){return oo(this,e).get(e)}function gg(e){return oo(this,e).has(e)}function xg(e,r){var i=oo(this,e),k=i.size;return i.set(e,r),this.size+=i.size==k?0:1,this}ir.prototype.clear=hg,ir.prototype.delete=pg,ir.prototype.get=mg,ir.prototype.has=gg,ir.prototype.set=xg;function Kr(e){var r=-1,i=e==null?0:e.length;for(this.__data__=new ir;++r<i;)this.add(e[r])}function bg(e){return this.__data__.set(e,m),this}function wg(e){return this.__data__.has(e)}Kr.prototype.add=Kr.prototype.push=bg,Kr.prototype.has=wg;function Ln(e){var r=this.__data__=new ar(e);this.size=r.size}function vg(){this.__data__=new ar,this.size=0}function _g(e){var r=this.__data__,i=r.delete(e);return this.size=r.size,i}function yg(e){return this.__data__.get(e)}function kg(e){return this.__data__.has(e)}function jg(e,r){var i=this.__data__;if(i instanceof ar){var k=i.__data__;if(!S||k.length<c-1)return k.push([e,r]),this.size=++i.size,this;i=this.__data__=new ir(k)}return i.set(e,r),this.size=i.size,this}Ln.prototype.clear=vg,Ln.prototype.delete=_g,Ln.prototype.get=yg,Ln.prototype.has=kg,Ln.prototype.set=jg;function ad(e,r){var i=Ve(e),k=!i&&ts(e),I=!i&&!k&&Sr(e),L=!i&&!k&&!I&&$s(e),X=i||k||I||L,J=X?wa(e.length,Ui):[],se=J.length;for(var _e in e)(r||mt.call(e,_e))&&!(X&&(_e=="length"||I&&(_e=="offset"||_e=="parent")||L&&(_e=="buffer"||_e=="byteLength"||_e=="byteOffset")||cr(_e,se)))&&J.push(_e);return J}function id(e){var r=e.length;return r?e[oc(0,r-1)]:s}function Mg(e,r){return lo(fn(e),Vr(r,0,e.length))}function Eg(e){return lo(fn(e))}function Vl(e,r,i){(i!==s&&!zn(e[r],i)||i===s&&!(r in e))&&Gn(e,r,i)}function Ma(e,r,i){var k=e[r];(!(mt.call(e,r)&&zn(k,i))||i===s&&!(r in e))&&Gn(e,r,i)}function Zi(e,r){for(var i=e.length;i--;)if(zn(e[i][0],r))return i;return-1}function Tg(e,r,i,k){return Er(e,function(I,L,X){r(k,I,i(I),X)}),k}function od(e,r){return e&&Zn(r,Zt(r),e)}function Ng(e,r){return e&&Zn(r,pn(r),e)}function Gn(e,r,i){r=="__proto__"&&Ss?Ss(e,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):e[r]=i}function Ql(e,r){for(var i=-1,k=r.length,I=ge(k),L=e==null;++i<k;)I[i]=L?s:Dc(e,r[i]);return I}function Vr(e,r,i){return e===e&&(i!==s&&(e=e<=i?e:i),r!==s&&(e=e>=r?e:r)),e}function En(e,r,i,k,I,L){var X,J=r&w,se=r&h,_e=r&M;if(i&&(X=I?i(e,k,I,L):i(e)),X!==s)return X;if(!At(e))return e;var ye=Ve(e);if(ye){if(X=gx(e),!J)return fn(e,X)}else{var je=en(e),De=je==Ee||je==T;if(Sr(e))return Id(e,J);if(je==z||je==Fe||De&&!I){if(X=se||De?{}:Kd(e),!J)return se?ax(e,Ng(X,e)):sx(e,od(X,e))}else{if(!vt[je])return I?e:{};X=xx(e,je,J)}}L||(L=new Ln);var Pe=L.get(e);if(Pe)return Pe;L.set(e,X),Ef(e)?e.forEach(function(We){X.add(En(We,r,i,We,e,L))}):jf(e)&&e.forEach(function(We,it){X.set(it,En(We,r,i,it,e,L))});var Ge=_e?se?bc:xc:se?pn:Zt,nt=ye?s:Ge(e);return Jt(nt||e,function(We,it){nt&&(it=We,We=e[it]),Ma(X,it,En(We,r,i,it,e,L))}),X}function Cg(e){var r=Zt(e);return function(i){return ld(i,e,r)}}function ld(e,r,i){var k=i.length;if(e==null)return!k;for(e=_t(e);k--;){var I=i[k],L=r[I],X=e[I];if(X===s&&!(I in e)||!L(X))return!1}return!0}function cd(e,r,i){if(typeof e!="function")throw new cn(d);return Aa(function(){e.apply(s,i)},r)}function Ea(e,r,i,k){var I=-1,L=Yr,X=!0,J=e.length,se=[],_e=r.length;if(!J)return se;i&&(r=Mt(r,rn(i))),k?(L=ws,X=!1):r.length>=c&&(L=qr,X=!1,r=new Kr(r));e:for(;++I<J;){var ye=e[I],je=i==null?ye:i(ye);if(ye=k||ye!==0?ye:0,X&&je===je){for(var De=_e;De--;)if(r[De]===je)continue e;se.push(ye)}else L(r,je,k)||se.push(ye)}return se}var Er=$d(Xn),ud=$d(ec,!0);function Sg(e,r){var i=!0;return Er(e,function(k,I,L){return i=!!r(k,I,L),i}),i}function Ki(e,r,i){for(var k=-1,I=e.length;++k<I;){var L=e[k],X=r(L);if(X!=null&&(J===s?X===X&&!_n(X):i(X,J)))var J=X,se=L}return se}function Ig(e,r,i,k){var I=e.length;for(i=Je(i),i<0&&(i=-i>I?0:I+i),k=k===s||k>I?I:Je(k),k<0&&(k+=I),k=i>k?0:Nf(k);i<k;)e[i++]=r;return e}function dd(e,r){var i=[];return Er(e,function(k,I,L){r(k,I,L)&&i.push(k)}),i}function Vt(e,r,i,k,I){var L=-1,X=e.length;for(i||(i=wx),I||(I=[]);++L<X;){var J=e[L];r>0&&i(J)?r>1?Vt(J,r-1,i,k,I):$n(I,J):k||(I[I.length]=J)}return I}var Jl=Ld(),fd=Ld(!0);function Xn(e,r){return e&&Jl(e,r,Zt)}function ec(e,r){return e&&fd(e,r,Zt)}function Vi(e,r){return Rn(r,function(i){return ur(e[i])})}function Qr(e,r){r=Nr(r,e);for(var i=0,k=r.length;e!=null&&i<k;)e=e[Fn(r[i++])];return i&&i==k?e:s}function hd(e,r,i){var k=r(e);return Ve(e)?k:$n(k,i(e))}function sn(e){return e==null?e===s?Se:Y:rr&&rr in _t(e)?hx(e):Ex(e)}function tc(e,r){return e>r}function Ag(e,r){return e!=null&&mt.call(e,r)}function Dg(e,r){return e!=null&&r in _t(e)}function Og(e,r,i){return e>=Xt(r,i)&&e<Ft(r,i)}function nc(e,r,i){for(var k=i?ws:Yr,I=e[0].length,L=e.length,X=L,J=ge(L),se=1/0,_e=[];X--;){var ye=e[X];X&&r&&(ye=Mt(ye,rn(r))),se=Xt(ye.length,se),J[X]=!i&&(r||I>=120&&ye.length>=120)?new Kr(X&&ye):s}ye=e[0];var je=-1,De=J[0];e:for(;++je<I&&_e.length<se;){var Pe=ye[je],Ge=r?r(Pe):Pe;if(Pe=i||Pe!==0?Pe:0,!(De?qr(De,Ge):k(_e,Ge,i))){for(X=L;--X;){var nt=J[X];if(!(nt?qr(nt,Ge):k(e[X],Ge,i)))continue e}De&&De.push(Ge),_e.push(Pe)}}return _e}function Rg(e,r,i,k){return Xn(e,function(I,L,X){r(k,i(I),L,X)}),k}function Ta(e,r,i){r=Nr(r,e),e=ef(e,r);var k=e==null?e:e[Fn(Nn(r))];return k==null?s:nn(k,e,i)}function pd(e){return Rt(e)&&sn(e)==Fe}function $g(e){return Rt(e)&&sn(e)==Qe}function Lg(e){return Rt(e)&&sn(e)==we}function Na(e,r,i,k,I){return e===r?!0:e==null||r==null||!Rt(e)&&!Rt(r)?e!==e&&r!==r:Fg(e,r,i,k,Na,I)}function Fg(e,r,i,k,I,L){var X=Ve(e),J=Ve(r),se=X?qe:en(e),_e=J?qe:en(r);se=se==Fe?z:se,_e=_e==Fe?z:_e;var ye=se==z,je=_e==z,De=se==_e;if(De&&Sr(e)){if(!Sr(r))return!1;X=!0,ye=!1}if(De&&!ye)return L||(L=new Ln),X||$s(e)?Gd(e,r,i,k,I,L):dx(e,r,se,i,k,I,L);if(!(i&x)){var Pe=ye&&mt.call(e,"__wrapped__"),Ge=je&&mt.call(r,"__wrapped__");if(Pe||Ge){var nt=Pe?e.value():e,We=Ge?r.value():r;return L||(L=new Ln),I(nt,We,i,k,L)}}return De?(L||(L=new Ln),fx(e,r,i,k,I,L)):!1}function zg(e){return Rt(e)&&en(e)==ce}function rc(e,r,i,k){var I=i.length,L=I,X=!k;if(e==null)return!L;for(e=_t(e);I--;){var J=i[I];if(X&&J[2]?J[1]!==e[J[0]]:!(J[0]in e))return!1}for(;++I<L;){J=i[I];var se=J[0],_e=e[se],ye=J[1];if(X&&J[2]){if(_e===s&&!(se in e))return!1}else{var je=new Ln;if(k)var De=k(_e,ye,se,e,r,je);if(!(De===s?Na(ye,_e,x|j,k,je):De))return!1}}return!0}function md(e){if(!At(e)||_x(e))return!1;var r=ur(e)?Bl:Ko;return r.test(es(e))}function Pg(e){return Rt(e)&&sn(e)==fe}function Hg(e){return Rt(e)&&en(e)==re}function Ug(e){return Rt(e)&&mo(e.length)&&!!kt[sn(e)]}function gd(e){return typeof e=="function"?e:e==null?mn:typeof e=="object"?Ve(e)?wd(e[0],e[1]):bd(e):Pf(e)}function sc(e){if(!Ia(e))return Xl(e);var r=[];for(var i in _t(e))mt.call(e,i)&&i!="constructor"&&r.push(i);return r}function Bg(e){if(!At(e))return Mx(e);var r=Ia(e),i=[];for(var k in e)k=="constructor"&&(r||!mt.call(e,k))||i.push(k);return i}function ac(e,r){return e<r}function xd(e,r){var i=-1,k=hn(e)?ge(e.length):[];return Er(e,function(I,L,X){k[++i]=r(I,L,X)}),k}function bd(e){var r=vc(e);return r.length==1&&r[0][2]?Qd(r[0][0],r[0][1]):function(i){return i===e||rc(i,e,r)}}function wd(e,r){return yc(e)&&Vd(r)?Qd(Fn(e),r):function(i){var k=Dc(i,e);return k===s&&k===r?Oc(i,e):Na(r,k,x|j)}}function Qi(e,r,i,k,I){e!==r&&Jl(r,function(L,X){if(I||(I=new Ln),At(L))Wg(e,r,X,i,Qi,k,I);else{var J=k?k(jc(e,X),L,X+"",e,r,I):s;J===s&&(J=L),Vl(e,X,J)}},pn)}function Wg(e,r,i,k,I,L,X){var J=jc(e,i),se=jc(r,i),_e=X.get(se);if(_e){Vl(e,i,_e);return}var ye=L?L(J,se,i+"",e,r,X):s,je=ye===s;if(je){var De=Ve(se),Pe=!De&&Sr(se),Ge=!De&&!Pe&&$s(se);ye=se,De||Pe||Ge?Ve(J)?ye=J:zt(J)?ye=fn(J):Pe?(je=!1,ye=Id(se,!0)):Ge?(je=!1,ye=Ad(se,!0)):ye=[]:Da(se)||ts(se)?(ye=J,ts(J)?ye=Cf(J):(!At(J)||ur(J))&&(ye=Kd(se))):je=!1}je&&(X.set(se,ye),I(ye,se,k,L,X),X.delete(se)),Vl(e,i,ye)}function vd(e,r){var i=e.length;if(i)return r+=r<0?i:0,cr(r,i)?e[r]:s}function _d(e,r,i){r.length?r=Mt(r,function(L){return Ve(L)?function(X){return Qr(X,L.length===1?L[0]:L)}:L}):r=[mn];var k=-1;r=Mt(r,rn(Ye()));var I=xd(e,function(L,X,J){var se=Mt(r,function(_e){return _e(L)});return{criteria:se,index:++k,value:L}});return jl(I,function(L,X){return rx(L,X,i)})}function Yg(e,r){return yd(e,r,function(i,k){return Oc(e,k)})}function yd(e,r,i){for(var k=-1,I=r.length,L={};++k<I;){var X=r[k],J=Qr(e,X);i(J,X)&&Ca(L,Nr(X,e),J)}return L}function qg(e){return function(r){return Qr(r,e)}}function ic(e,r,i,k){var I=k?kl:yr,L=-1,X=r.length,J=e;for(e===r&&(r=fn(r)),i&&(J=Mt(e,rn(i)));++L<X;)for(var se=0,_e=r[L],ye=i?i(_e):_e;(se=I(J,ye,se,k))>-1;)J!==e&&Cs.call(J,se,1),Cs.call(e,se,1);return e}function kd(e,r){for(var i=e?r.length:0,k=i-1;i--;){var I=r[i];if(i==k||I!==L){var L=I;cr(I)?Cs.call(e,I,1):uc(e,I)}}return e}function oc(e,r){return e+As(g()*(r-e+1))}function Gg(e,r,i,k){for(var I=-1,L=Ft(Is((r-e)/(i||1)),0),X=ge(L);L--;)X[k?L:++I]=e,e+=i;return X}function lc(e,r){var i="";if(!e||r<1||r>de)return i;do r%2&&(i+=e),r=As(r/2),r&&(e+=e);while(r);return i}function st(e,r){return Mc(Jd(e,r,mn),e+"")}function Xg(e){return id(Ls(e))}function Zg(e,r){var i=Ls(e);return lo(i,Vr(r,0,i.length))}function Ca(e,r,i,k){if(!At(e))return e;r=Nr(r,e);for(var I=-1,L=r.length,X=L-1,J=e;J!=null&&++I<L;){var se=Fn(r[I]),_e=i;if(se==="__proto__"||se==="constructor"||se==="prototype")return e;if(I!=X){var ye=J[se];_e=k?k(ye,se,J):s,_e===s&&(_e=At(ye)?ye:cr(r[I+1])?[]:{})}Ma(J,se,_e),J=J[se]}return e}var jd=Ce?function(e,r){return Ce.set(e,r),e}:mn,Kg=Ss?function(e,r){return Ss(e,"toString",{configurable:!0,enumerable:!1,value:$c(r),writable:!0})}:mn;function Vg(e){return lo(Ls(e))}function Tn(e,r,i){var k=-1,I=e.length;r<0&&(r=-r>I?0:I+r),i=i>I?I:i,i<0&&(i+=I),I=r>i?0:i-r>>>0,r>>>=0;for(var L=ge(I);++k<I;)L[k]=e[k+r];return L}function Qg(e,r){var i;return Er(e,function(k,I,L){return i=r(k,I,L),!i}),!!i}function Ji(e,r,i){var k=0,I=e==null?k:e.length;if(typeof r=="number"&&r===r&&I<=ee){for(;k<I;){var L=k+I>>>1,X=e[L];X!==null&&!_n(X)&&(i?X<=r:X<r)?k=L+1:I=L}return I}return cc(e,r,mn,i)}function cc(e,r,i,k){var I=0,L=e==null?0:e.length;if(L===0)return 0;r=i(r);for(var X=r!==r,J=r===null,se=_n(r),_e=r===s;I<L;){var ye=As((I+L)/2),je=i(e[ye]),De=je!==s,Pe=je===null,Ge=je===je,nt=_n(je);if(X)var We=k||Ge;else _e?We=Ge&&(k||De):J?We=Ge&&De&&(k||!Pe):se?We=Ge&&De&&!Pe&&(k||!nt):Pe||nt?We=!1:We=k?je<=r:je<r;We?I=ye+1:L=ye}return Xt(L,me)}function Md(e,r){for(var i=-1,k=e.length,I=0,L=[];++i<k;){var X=e[i],J=r?r(X):X;if(!i||!zn(J,se)){var se=J;L[I++]=X===0?0:X}}return L}function Ed(e){return typeof e=="number"?e:_n(e)?V:+e}function vn(e){if(typeof e=="string")return e;if(Ve(e))return Mt(e,vn)+"";if(_n(e))return un?un.call(e):"";var r=e+"";return r=="0"&&1/e==-be?"-0":r}function Tr(e,r,i){var k=-1,I=Yr,L=e.length,X=!0,J=[],se=J;if(i)X=!1,I=ws;else if(L>=c){var _e=r?null:cx(e);if(_e)return ys(_e);X=!1,I=qr,se=new Kr}else se=r?[]:J;e:for(;++k<L;){var ye=e[k],je=r?r(ye):ye;if(ye=i||ye!==0?ye:0,X&&je===je){for(var De=se.length;De--;)if(se[De]===je)continue e;r&&se.push(je),J.push(ye)}else I(se,je,i)||(se!==J&&se.push(je),J.push(ye))}return J}function uc(e,r){r=Nr(r,e);var i=-1,k=r.length;if(!k)return!0;for(;++i<k;){var I=Fn(r[i]);if(I==="__proto__"&&!mt.call(e,"__proto__")||(I==="constructor"||I==="prototype")&&i<k-1)return!1}var L=ef(e,r);return L==null||delete L[Fn(Nn(r))]}function Td(e,r,i,k){return Ca(e,r,i(Qr(e,r)),k)}function eo(e,r,i,k){for(var I=e.length,L=k?I:-1;(k?L--:++L<I)&&r(e[L],L,e););return i?Tn(e,k?0:L,k?L+1:I):Tn(e,k?L+1:0,k?I:L)}function Nd(e,r){var i=e;return i instanceof tt&&(i=i.value()),vs(r,function(k,I){return I.func.apply(I.thisArg,$n([k],I.args))},i)}function dc(e,r,i){var k=e.length;if(k<2)return k?Tr(e[0]):[];for(var I=-1,L=ge(k);++I<k;)for(var X=e[I],J=-1;++J<k;)J!=I&&(L[I]=Ea(L[I]||X,e[J],r,i));return Tr(Vt(L,1),r,i)}function Cd(e,r,i){for(var k=-1,I=e.length,L=r.length,X={};++k<I;){var J=k<L?r[k]:s;i(X,e[k],J)}return X}function fc(e){return zt(e)?e:[]}function hc(e){return typeof e=="function"?e:mn}function Nr(e,r){return Ve(e)?e:yc(e,r)?[e]:sf(bt(e))}var Jg=st;function Cr(e,r,i){var k=e.length;return i=i===s?k:i,!r&&i>=k?e:Tn(e,r,i)}var Sd=Wl||function(e){return Ot.clearTimeout(e)};function Id(e,r){if(r)return e.slice();var i=e.length,k=Wi?Wi(i):new e.constructor(i);return e.copy(k),k}function pc(e){var r=new e.constructor(e.byteLength);return new Ts(r).set(new Ts(e)),r}function ex(e,r){var i=r?pc(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.byteLength)}function tx(e){var r=new e.constructor(e.source,si.exec(e));return r.lastIndex=e.lastIndex,r}function nx(e){return Kt?_t(Kt.call(e)):{}}function Ad(e,r){var i=r?pc(e.buffer):e.buffer;return new e.constructor(i,e.byteOffset,e.length)}function Dd(e,r){if(e!==r){var i=e!==s,k=e===null,I=e===e,L=_n(e),X=r!==s,J=r===null,se=r===r,_e=_n(r);if(!J&&!_e&&!L&&e>r||L&&X&&se&&!J&&!_e||k&&X&&se||!i&&se||!I)return 1;if(!k&&!L&&!_e&&e<r||_e&&i&&I&&!k&&!L||J&&i&&I||!X&&I||!se)return-1}return 0}function rx(e,r,i){for(var k=-1,I=e.criteria,L=r.criteria,X=I.length,J=i.length;++k<X;){var se=Dd(I[k],L[k]);if(se){if(k>=J)return se;var _e=i[k];return se*(_e=="desc"?-1:1)}}return e.index-r.index}function Od(e,r,i,k){for(var I=-1,L=e.length,X=i.length,J=-1,se=r.length,_e=Ft(L-X,0),ye=ge(se+_e),je=!k;++J<se;)ye[J]=r[J];for(;++I<X;)(je||I<L)&&(ye[i[I]]=e[I]);for(;_e--;)ye[J++]=e[I++];return ye}function Rd(e,r,i,k){for(var I=-1,L=e.length,X=-1,J=i.length,se=-1,_e=r.length,ye=Ft(L-J,0),je=ge(ye+_e),De=!k;++I<ye;)je[I]=e[I];for(var Pe=I;++se<_e;)je[Pe+se]=r[se];for(;++X<J;)(De||I<L)&&(je[Pe+i[X]]=e[I++]);return je}function fn(e,r){var i=-1,k=e.length;for(r||(r=ge(k));++i<k;)r[i]=e[i];return r}function Zn(e,r,i,k){var I=!i;i||(i={});for(var L=-1,X=r.length;++L<X;){var J=r[L],se=k?k(i[J],e[J],J,i,e):s;se===s&&(se=e[J]),I?Gn(i,J,se):Ma(i,J,se)}return i}function sx(e,r){return Zn(e,_c(e),r)}function ax(e,r){return Zn(e,Xd(e),r)}function to(e,r){return function(i,k){var I=Ve(i)?Ii:Tg,L=r?r():{};return I(i,e,Ye(k,2),L)}}function Ds(e){return st(function(r,i){var k=-1,I=i.length,L=I>1?i[I-1]:s,X=I>2?i[2]:s;for(L=e.length>3&&typeof L=="function"?(I--,L):s,X&&an(i[0],i[1],X)&&(L=I<3?s:L,I=1),r=_t(r);++k<I;){var J=i[k];J&&e(r,J,k,L)}return r})}function $d(e,r){return function(i,k){if(i==null)return i;if(!hn(i))return e(i,k);for(var I=i.length,L=r?I:-1,X=_t(i);(r?L--:++L<I)&&k(X[L],L,X)!==!1;);return i}}function Ld(e){return function(r,i,k){for(var I=-1,L=_t(r),X=k(r),J=X.length;J--;){var se=X[e?J:++I];if(i(L[se],se,L)===!1)break}return r}}function ix(e,r,i){var k=r&_,I=Sa(e);function L(){var X=this&&this!==Ot&&this instanceof L?I:e;return X.apply(k?i:this,arguments)}return L}function Fd(e){return function(r){r=bt(r);var i=kr(r)?wn(r):s,k=i?i[0]:r.charAt(0),I=i?Cr(i,1).join(""):r.slice(1);return k[e]()+I}}function Os(e){return function(r){return vs(Ff(Lf(r).replace(bn,"")),e,"")}}function Sa(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var i=sr(e.prototype),k=e.apply(i,r);return At(k)?k:i}}function ox(e,r,i){var k=Sa(e);function I(){for(var L=arguments.length,X=ge(L),J=L,se=Rs(I);J--;)X[J]=arguments[J];var _e=L<3&&X[0]!==se&&X[L-1]!==se?[]:Yn(X,se);if(L-=_e.length,L<i)return Bd(e,r,no,I.placeholder,s,X,_e,s,s,i-L);var ye=this&&this!==Ot&&this instanceof I?k:e;return nn(ye,this,X)}return I}function zd(e){return function(r,i,k){var I=_t(r);if(!hn(r)){var L=Ye(i,3);r=Zt(r),i=function(J){return L(I[J],J,I)}}var X=e(r,i,k);return X>-1?I[L?r[X]:X]:s}}function Pd(e){return lr(function(r){var i=r.length,k=i,I=dn.prototype.thru;for(e&&r.reverse();k--;){var L=r[k];if(typeof L!="function")throw new cn(d);if(I&&!X&&io(L)=="wrapper")var X=new dn([],!0)}for(k=X?k:i;++k<i;){L=r[k];var J=io(L),se=J=="wrapper"?wc(L):s;se&&kc(se[0])&&se[1]==(q|A|F|P)&&!se[4].length&&se[9]==1?X=X[io(se[0])].apply(X,se[3]):X=L.length==1&&kc(L)?X[J]():X.thru(L)}return function(){var _e=arguments,ye=_e[0];if(X&&_e.length==1&&Ve(ye))return X.plant(ye).value();for(var je=0,De=i?r[je].apply(this,_e):ye;++je<i;)De=r[je].call(this,De);return De}})}function no(e,r,i,k,I,L,X,J,se,_e){var ye=r&q,je=r&_,De=r&E,Pe=r&(A|D),Ge=r&U,nt=De?s:Sa(e);function We(){for(var it=arguments.length,ct=ge(it),yn=it;yn--;)ct[yn]=arguments[yn];if(Pe)var on=Rs(We),kn=El(ct,on);if(k&&(ct=Od(ct,k,I,Pe)),L&&(ct=Rd(ct,L,X,Pe)),it-=kn,Pe&&it<_e){var Pt=Yn(ct,on);return Bd(e,r,no,We.placeholder,i,ct,Pt,J,se,_e-it)}var Pn=je?i:this,fr=De?Pn[e]:e;return it=ct.length,J?ct=Tx(ct,J):Ge&&it>1&&ct.reverse(),ye&&se<it&&(ct.length=se),this&&this!==Ot&&this instanceof We&&(fr=nt||Sa(fr)),fr.apply(Pn,ct)}return We}function Hd(e,r){return function(i,k){return Rg(i,e,r(k),{})}}function ro(e,r){return function(i,k){var I;if(i===s&&k===s)return r;if(i!==s&&(I=i),k!==s){if(I===s)return k;typeof i=="string"||typeof k=="string"?(i=vn(i),k=vn(k)):(i=Ed(i),k=Ed(k)),I=e(i,k)}return I}}function mc(e){return lr(function(r){return r=Mt(r,rn(Ye())),st(function(i){var k=this;return e(r,function(I){return nn(I,k,i)})})})}function so(e,r){r=r===s?" ":vn(r);var i=r.length;if(i<2)return i?lc(r,e):r;var k=lc(r,Is(e/nr(r)));return kr(r)?Cr(wn(k),0,e).join(""):k.slice(0,e)}function lx(e,r,i,k){var I=r&_,L=Sa(e);function X(){for(var J=-1,se=arguments.length,_e=-1,ye=k.length,je=ge(ye+se),De=this&&this!==Ot&&this instanceof X?L:e;++_e<ye;)je[_e]=k[_e];for(;se--;)je[_e++]=arguments[++J];return nn(De,I?i:this,je)}return X}function Ud(e){return function(r,i,k){return k&&typeof k!="number"&&an(r,i,k)&&(i=k=s),r=dr(r),i===s?(i=r,r=0):i=dr(i),k=k===s?r<i?1:-1:dr(k),Gg(r,i,k,e)}}function ao(e){return function(r,i){return typeof r=="string"&&typeof i=="string"||(r=Cn(r),i=Cn(i)),e(r,i)}}function Bd(e,r,i,k,I,L,X,J,se,_e){var ye=r&A,je=ye?X:s,De=ye?s:X,Pe=ye?L:s,Ge=ye?s:L;r|=ye?F:O,r&=~(ye?O:F),r&C||(r&=-4);var nt=[e,r,I,Pe,je,Ge,De,J,se,_e],We=i.apply(s,nt);return kc(e)&&tf(We,nt),We.placeholder=k,nf(We,e,r)}function gc(e){var r=Lt[e];return function(i,k){if(i=Cn(i),k=k==null?0:Xt(Je(k),292),k&&St(i)){var I=(bt(i)+"e").split("e"),L=r(I[0]+"e"+(+I[1]+k));return I=(bt(L)+"e").split("e"),+(I[0]+"e"+(+I[1]-k))}return r(i)}}var cx=Z&&1/ys(new Z([,-0]))[1]==be?function(e){return new Z(e)}:zc;function Wd(e){return function(r){var i=en(r);return i==ce?ya(r):i==re?Al(r):Ml(r,e(r))}}function or(e,r,i,k,I,L,X,J){var se=r&E;if(!se&&typeof e!="function")throw new cn(d);var _e=k?k.length:0;if(_e||(r&=-97,k=I=s),X=X===s?X:Ft(Je(X),0),J=J===s?J:Je(J),_e-=I?I.length:0,r&O){var ye=k,je=I;k=I=s}var De=se?s:wc(e),Pe=[e,r,i,k,I,ye,je,L,X,J];if(De&&jx(Pe,De),e=Pe[0],r=Pe[1],i=Pe[2],k=Pe[3],I=Pe[4],J=Pe[9]=Pe[9]===s?se?0:e.length:Ft(Pe[9]-_e,0),!J&&r&(A|D)&&(r&=-25),!r||r==_)var Ge=ix(e,r,i);else r==A||r==D?Ge=ox(e,r,J):(r==F||r==(_|F))&&!I.length?Ge=lx(e,r,i,k):Ge=no.apply(s,Pe);var nt=De?jd:tf;return nf(nt(Ge,Pe),e,r)}function Yd(e,r,i,k){return e===s||zn(e,Mr[i])&&!mt.call(k,i)?r:e}function qd(e,r,i,k,I,L){return At(e)&&At(r)&&(L.set(r,e),Qi(e,r,s,qd,L),L.delete(r)),e}function ux(e){return Da(e)?s:e}function Gd(e,r,i,k,I,L){var X=i&x,J=e.length,se=r.length;if(J!=se&&!(X&&se>J))return!1;var _e=L.get(e),ye=L.get(r);if(_e&&ye)return _e==r&&ye==e;var je=-1,De=!0,Pe=i&j?new Kr:s;for(L.set(e,r),L.set(r,e);++je<J;){var Ge=e[je],nt=r[je];if(k)var We=X?k(nt,Ge,je,r,e,L):k(Ge,nt,je,e,r,L);if(We!==s){if(We)continue;De=!1;break}if(Pe){if(!ma(r,function(it,ct){if(!qr(Pe,ct)&&(Ge===it||I(Ge,it,i,k,L)))return Pe.push(ct)})){De=!1;break}}else if(!(Ge===nt||I(Ge,nt,i,k,L))){De=!1;break}}return L.delete(e),L.delete(r),De}function dx(e,r,i,k,I,L,X){switch(i){case Tt:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case Qe:return!(e.byteLength!=r.byteLength||!L(new Ts(e),new Ts(r)));case Xe:case we:case oe:return zn(+e,+r);case Ie:return e.name==r.name&&e.message==r.message;case fe:case Me:return e==r+"";case ce:var J=ya;case re:var se=k&x;if(J||(J=ys),e.size!=r.size&&!se)return!1;var _e=X.get(e);if(_e)return _e==r;k|=j,X.set(e,r);var ye=Gd(J(e),J(r),k,I,L,X);return X.delete(e),ye;case Ne:if(Kt)return Kt.call(e)==Kt.call(r)}return!1}function fx(e,r,i,k,I,L){var X=i&x,J=xc(e),se=J.length,_e=xc(r),ye=_e.length;if(se!=ye&&!X)return!1;for(var je=se;je--;){var De=J[je];if(!(X?De in r:mt.call(r,De)))return!1}var Pe=L.get(e),Ge=L.get(r);if(Pe&&Ge)return Pe==r&&Ge==e;var nt=!0;L.set(e,r),L.set(r,e);for(var We=X;++je<se;){De=J[je];var it=e[De],ct=r[De];if(k)var yn=X?k(ct,it,De,r,e,L):k(it,ct,De,e,r,L);if(!(yn===s?it===ct||I(it,ct,i,k,L):yn)){nt=!1;break}We||(We=De=="constructor")}if(nt&&!We){var on=e.constructor,kn=r.constructor;on!=kn&&"constructor"in e&&"constructor"in r&&!(typeof on=="function"&&on instanceof on&&typeof kn=="function"&&kn instanceof kn)&&(nt=!1)}return L.delete(e),L.delete(r),nt}function lr(e){return Mc(Jd(e,s,cf),e+"")}function xc(e){return hd(e,Zt,_c)}function bc(e){return hd(e,pn,Xd)}var wc=Ce?function(e){return Ce.get(e)}:zc;function io(e){for(var r=e.name+"",i=ke[r],k=mt.call(ke,r)?i.length:0;k--;){var I=i[k],L=I.func;if(L==null||L==e)return I.name}return r}function Rs(e){var r=mt.call(R,"placeholder")?R:e;return r.placeholder}function Ye(){var e=R.iteratee||Lc;return e=e===Lc?gd:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,r){var i=e.__data__;return vx(r)?i[typeof r=="string"?"string":"hash"]:i.map}function vc(e){for(var r=Zt(e),i=r.length;i--;){var k=r[i],I=e[k];r[i]=[k,I,Vd(I)]}return r}function Jr(e,r){var i=Cl(e,r);return md(i)?i:s}function hx(e){var r=mt.call(e,rr),i=e[rr];try{e[rr]=s;var k=!0}catch{}var I=Ut.call(e);return k&&(r?e[rr]=i:delete e[rr]),I}var _c=ja?function(e){return e==null?[]:(e=_t(e),Rn(ja(e),function(r){return qi.call(e,r)}))}:Pc,Xd=ja?function(e){for(var r=[];e;)$n(r,_c(e)),e=Ns(e);return r}:Pc,en=sn;(y&&en(new y(new ArrayBuffer(1)))!=Tt||S&&en(new S)!=ce||H&&en(H.resolve())!=te||Z&&en(new Z)!=re||le&&en(new le)!=ze)&&(en=function(e){var r=sn(e),i=r==z?e.constructor:s,k=i?es(i):"";if(k)switch(k){case Be:return Tt;case $e:return ce;case ht:return te;case at:return re;case Ct:return ze}return r});function px(e,r,i){for(var k=-1,I=i.length;++k<I;){var L=i[k],X=L.size;switch(L.type){case"drop":e+=X;break;case"dropRight":r-=X;break;case"take":r=Xt(r,e+X);break;case"takeRight":e=Ft(e,r-X);break}}return{start:e,end:r}}function mx(e){var r=e.match(ri);return r?r[1].split(_r):[]}function Zd(e,r,i){r=Nr(r,e);for(var k=-1,I=r.length,L=!1;++k<I;){var X=Fn(r[k]);if(!(L=e!=null&&i(e,X)))break;e=e[X]}return L||++k!=I?L:(I=e==null?0:e.length,!!I&&mo(I)&&cr(X,I)&&(Ve(e)||ts(e)))}function gx(e){var r=e.length,i=new e.constructor(r);return r&&typeof e[0]=="string"&&mt.call(e,"index")&&(i.index=e.index,i.input=e.input),i}function Kd(e){return typeof e.constructor=="function"&&!Ia(e)?sr(Ns(e)):{}}function xx(e,r,i){var k=e.constructor;switch(r){case Qe:return pc(e);case Xe:case we:return new k(+e);case Tt:return ex(e,i);case xn:case $t:case Gt:case wt:case An:case Un:case Nt:case vr:case Hr:return Ad(e,i);case ce:return new k;case oe:case Me:return new k(e);case fe:return tx(e);case re:return new k;case Ne:return nx(e)}}function bx(e,r){var i=r.length;if(!i)return e;var k=i-1;return r[k]=(i>1?"& ":"")+r[k],r=r.join(i>2?", ":" "),e.replace(ni,`{
|
|
@@ -24,7 +24,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
24
24
|
}`;var nt=zf(function(){return ft(L,Pe+"return "+je).apply(s,X)});if(nt.source=je,Sc(nt))throw nt;return nt}function Gw(e){return bt(e).toLowerCase()}function Xw(e){return bt(e).toUpperCase()}function Zw(e,r,i){if(e=bt(e),e&&(i||r===s))return va(e);if(!e||!(r=vn(r)))return e;var k=wn(e),I=wn(r),L=Li(k,I),X=Fi(k,I)+1;return Cr(k,L,X).join("")}function Kw(e,r,i){if(e=bt(e),e&&(i||r===s))return e.slice(0,Pi(e)+1);if(!e||!(r=vn(r)))return e;var k=wn(e),I=Fi(k,wn(r))+1;return Cr(k,0,I).join("")}function Vw(e,r,i){if(e=bt(e),e&&(i||r===s))return e.replace(hs,"");if(!e||!(r=vn(r)))return e;var k=wn(e),I=Li(k,wn(r));return Cr(k,I).join("")}function Qw(e,r){var i=K,k=$;if(At(r)){var I="separator"in r?r.separator:I;i="length"in r?Je(r.length):i,k="omission"in r?vn(r.omission):k}e=bt(e);var L=e.length;if(kr(e)){var X=wn(e);L=X.length}if(i>=L)return e;var J=i-nr(k);if(J<1)return k;var se=X?Cr(X,0,J).join(""):e.slice(0,J);if(I===s)return se+k;if(X&&(J+=se.length-J),Ic(I)){if(e.slice(J).search(I)){var _e,ye=se;for(I.global||(I=ka(I.source,bt(si.exec(I))+"g")),I.lastIndex=0;_e=I.exec(ye);)var je=_e.index;se=se.slice(0,je===s?J:je)}}else if(e.indexOf(vn(I),J)!=J){var De=se.lastIndexOf(I);De>-1&&(se=se.slice(0,De))}return se+k}function Jw(e){return e=bt(e),e&&Zs.test(e)?e.replace(jn,Rl):e}var ev=Os(function(e,r,i){return e+(i?" ":"")+r.toUpperCase()}),Rc=Fd("toUpperCase");function Ff(e,r,i){return e=bt(e),r=i?s:r,r===s?Sl(e)?Hi(e):yl(e):e.match(r)||[]}var zf=st(function(e,r){try{return nn(e,s,r)}catch(i){return Sc(i)?i:new Ze(i)}}),tv=lr(function(e,r){return Jt(r,function(i){i=Fn(i),Gn(e,i,Nc(e[i],e))}),e});function nv(e){var r=e==null?0:e.length,i=Ye();return e=r?Mt(e,function(k){if(typeof k[1]!="function")throw new cn(d);return[i(k[0]),k[1]]}):[],st(function(k){for(var I=-1;++I<r;){var L=e[I];if(nn(L[0],this,k))return nn(L[1],this,k)}})}function rv(e){return Cg(En(e,w))}function $c(e){return function(){return e}}function sv(e,r){return e==null||e!==e?r:e}var av=Pd(),iv=Pd(!0);function mn(e){return e}function Lc(e){return gd(typeof e=="function"?e:En(e,w))}function ov(e){return bd(En(e,w))}function lv(e,r){return wd(e,En(r,w))}var cv=st(function(e,r){return function(i){return Ta(i,e,r)}}),uv=st(function(e,r){return function(i){return Ta(e,i,r)}});function Fc(e,r,i){var k=Zt(r),I=Vi(r,k);i==null&&!(At(r)&&(I.length||!k.length))&&(i=r,r=e,e=this,I=Vi(r,Zt(r)));var L=!(At(i)&&"chain"in i)||!!i.chain,X=ur(e);return Jt(I,function(J){var se=r[J];e[J]=se,X&&(e.prototype[J]=function(){var _e=this.__chain__;if(L||_e){var ye=e(this.__wrapped__),je=ye.__actions__=fn(this.__actions__);return je.push({func:se,args:arguments,thisArg:e}),ye.__chain__=_e,ye}return se.apply(e,$n([this.value()],arguments))})}),e}function dv(){return Ot._===this&&(Ot._=Ul),this}function zc(){}function fv(e){return e=Je(e),st(function(r){return vd(r,e)})}var hv=mc(Mt),pv=mc(pa),mv=mc(ma);function Pf(e){return yc(e)?ga(Fn(e)):qg(e)}function gv(e){return function(r){return e==null?s:Qr(e,r)}}var xv=Ud(),bv=Ud(!0);function Pc(){return[]}function Hc(){return!1}function wv(){return{}}function vv(){return""}function _v(){return!0}function yv(e,r){if(e=Je(e),e<1||e>de)return[];var i=G,k=Xt(e,G);r=Ye(r),e-=G;for(var I=wa(k,r);++i<e;)r(i);return I}function kv(e){return Ve(e)?Mt(e,Fn):_n(e)?[e]:fn(sf(bt(e)))}function jv(e){var r=++Pl;return bt(e)+r}var Mv=ro(function(e,r){return e+r},0),Ev=gc("ceil"),Tv=ro(function(e,r){return e/r},1),Nv=gc("floor");function Cv(e){return e&&e.length?Ki(e,mn,tc):s}function Sv(e,r){return e&&e.length?Ki(e,Ye(r,2),tc):s}function Iv(e){return Ri(e,mn)}function Av(e,r){return Ri(e,Ye(r,2))}function Dv(e){return e&&e.length?Ki(e,mn,ac):s}function Ov(e,r){return e&&e.length?Ki(e,Ye(r,2),ac):s}var Rv=ro(function(e,r){return e*r},1),$v=gc("round"),Lv=ro(function(e,r){return e-r},0);function Fv(e){return e&&e.length?ba(e,mn):0}function zv(e,r){return e&&e.length?ba(e,Ye(r,2)):0}return R.after=lb,R.ary=gf,R.assign=Zb,R.assignIn=Sf,R.assignInWith=If,R.assignWith=Ac,R.at=Kb,R.before=xf,R.bind=Nc,R.bindAll=tv,R.bindKey=bf,R.castArray=vb,R.chain=hf,R.chunk=Cx,R.compact=Sx,R.concat=Ix,R.cond=nv,R.conforms=rv,R.constant=$c,R.countBy=z0,R.create=Vb,R.curry=wf,R.curryRight=vf,R.debounce=_f,R.defaults=Qb,R.defaultsDeep=Jb,R.defer=cb,R.delay=ub,R.difference=Ax,R.differenceBy=Dx,R.differenceWith=Ox,R.drop=Rx,R.dropRight=$x,R.dropRightWhile=Lx,R.dropWhile=Fx,R.fill=zx,R.filter=H0,R.flatMap=W0,R.flatMapDeep=Y0,R.flatMapDepth=q0,R.flatten=cf,R.flattenDeep=Px,R.flattenDepth=Hx,R.flip=db,R.flow=av,R.flowRight=iv,R.fromPairs=Ux,R.functions=iw,R.functionsIn=ow,R.groupBy=G0,R.initial=Wx,R.intersection=Yx,R.intersectionBy=qx,R.intersectionWith=Gx,R.invert=cw,R.invertBy=uw,R.invokeMap=Z0,R.iteratee=Lc,R.keyBy=K0,R.keys=Zt,R.keysIn=pn,R.map=uo,R.mapKeys=fw,R.mapValues=hw,R.matches=ov,R.matchesProperty=lv,R.memoize=ho,R.merge=pw,R.mergeWith=Af,R.method=cv,R.methodOf=uv,R.mixin=Fc,R.negate=po,R.nthArg=fv,R.omit=mw,R.omitBy=gw,R.once=fb,R.orderBy=V0,R.over=hv,R.overArgs=hb,R.overEvery=pv,R.overSome=mv,R.partial=Cc,R.partialRight=yf,R.partition=Q0,R.pick=xw,R.pickBy=Df,R.property=Pf,R.propertyOf=gv,R.pull=Vx,R.pullAll=df,R.pullAllBy=Qx,R.pullAllWith=Jx,R.pullAt=e0,R.range=xv,R.rangeRight=bv,R.rearg=pb,R.reject=tb,R.remove=t0,R.rest=mb,R.reverse=Ec,R.sampleSize=rb,R.set=ww,R.setWith=vw,R.shuffle=sb,R.slice=n0,R.sortBy=ob,R.sortedUniq=c0,R.sortedUniqBy=u0,R.split=Bw,R.spread=gb,R.tail=d0,R.take=f0,R.takeRight=h0,R.takeRightWhile=p0,R.takeWhile=m0,R.tap=S0,R.throttle=xb,R.thru=co,R.toArray=Tf,R.toPairs=Of,R.toPairsIn=Rf,R.toPath=kv,R.toPlainObject=Cf,R.transform=_w,R.unary=bb,R.union=g0,R.unionBy=x0,R.unionWith=b0,R.uniq=w0,R.uniqBy=v0,R.uniqWith=_0,R.unset=yw,R.unzip=Tc,R.unzipWith=ff,R.update=kw,R.updateWith=jw,R.values=Ls,R.valuesIn=Mw,R.without=y0,R.words=Ff,R.wrap=wb,R.xor=k0,R.xorBy=j0,R.xorWith=M0,R.zip=E0,R.zipObject=T0,R.zipObjectDeep=N0,R.zipWith=C0,R.entries=Of,R.entriesIn=Rf,R.extend=Sf,R.extendWith=If,Fc(R,R),R.add=Mv,R.attempt=zf,R.camelCase=Cw,R.capitalize=$f,R.ceil=Ev,R.clamp=Ew,R.clone=_b,R.cloneDeep=kb,R.cloneDeepWith=jb,R.cloneWith=yb,R.conformsTo=Mb,R.deburr=Lf,R.defaultTo=sv,R.divide=Tv,R.endsWith=Sw,R.eq=zn,R.escape=Iw,R.escapeRegExp=Aw,R.every=P0,R.find=U0,R.findIndex=of,R.findKey=ew,R.findLast=B0,R.findLastIndex=lf,R.findLastKey=tw,R.floor=Nv,R.forEach=pf,R.forEachRight=mf,R.forIn=nw,R.forInRight=rw,R.forOwn=sw,R.forOwnRight=aw,R.get=Dc,R.gt=Eb,R.gte=Tb,R.has=lw,R.hasIn=Oc,R.head=uf,R.identity=mn,R.includes=X0,R.indexOf=Bx,R.inRange=Tw,R.invoke=dw,R.isArguments=ts,R.isArray=Ve,R.isArrayBuffer=Nb,R.isArrayLike=hn,R.isArrayLikeObject=zt,R.isBoolean=Cb,R.isBuffer=Sr,R.isDate=Sb,R.isElement=Ib,R.isEmpty=Ab,R.isEqual=Db,R.isEqualWith=Ob,R.isError=Sc,R.isFinite=Rb,R.isFunction=ur,R.isInteger=kf,R.isLength=mo,R.isMap=jf,R.isMatch=$b,R.isMatchWith=Lb,R.isNaN=Fb,R.isNative=zb,R.isNil=Hb,R.isNull=Pb,R.isNumber=Mf,R.isObject=At,R.isObjectLike=Rt,R.isPlainObject=Da,R.isRegExp=Ic,R.isSafeInteger=Ub,R.isSet=Ef,R.isString=go,R.isSymbol=_n,R.isTypedArray=$s,R.isUndefined=Bb,R.isWeakMap=Wb,R.isWeakSet=Yb,R.join=Xx,R.kebabCase=Dw,R.last=Nn,R.lastIndexOf=Zx,R.lowerCase=Ow,R.lowerFirst=Rw,R.lt=qb,R.lte=Gb,R.max=Cv,R.maxBy=Sv,R.mean=Iv,R.meanBy=Av,R.min=Dv,R.minBy=Ov,R.stubArray=Pc,R.stubFalse=Hc,R.stubObject=wv,R.stubString=vv,R.stubTrue=_v,R.multiply=Rv,R.nth=Kx,R.noConflict=dv,R.noop=zc,R.now=fo,R.pad=$w,R.padEnd=Lw,R.padStart=Fw,R.parseInt=zw,R.random=Nw,R.reduce=J0,R.reduceRight=eb,R.repeat=Pw,R.replace=Hw,R.result=bw,R.round=$v,R.runInContext=ne,R.sample=nb,R.size=ab,R.snakeCase=Uw,R.some=ib,R.sortedIndex=r0,R.sortedIndexBy=s0,R.sortedIndexOf=a0,R.sortedLastIndex=i0,R.sortedLastIndexBy=o0,R.sortedLastIndexOf=l0,R.startCase=Ww,R.startsWith=Yw,R.subtract=Lv,R.sum=Fv,R.sumBy=zv,R.template=qw,R.times=yv,R.toFinite=dr,R.toInteger=Je,R.toLength=Nf,R.toLower=Gw,R.toNumber=Cn,R.toSafeInteger=Xb,R.toString=bt,R.toUpper=Xw,R.trim=Zw,R.trimEnd=Kw,R.trimStart=Vw,R.truncate=Qw,R.unescape=Jw,R.uniqueId=jv,R.upperCase=ev,R.upperFirst=Rc,R.each=pf,R.eachRight=mf,R.first=uf,Fc(R,(function(){var e={};return Xn(R,function(r,i){mt.call(R.prototype,i)||(e[i]=r)}),e})(),{chain:!1}),R.VERSION=o,Jt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){R[e].placeholder=R}),Jt(["drop","take"],function(e,r){tt.prototype[e]=function(i){i=i===s?1:Ft(Je(i),0);var k=this.__filtered__&&!r?new tt(this):this.clone();return k.__filtered__?k.__takeCount__=Xt(i,k.__takeCount__):k.__views__.push({size:Xt(i,G),type:e+(k.__dir__<0?"Right":"")}),k},tt.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),Jt(["filter","map","takeWhile"],function(e,r){var i=r+1,k=i==W||i==ue;tt.prototype[e]=function(I){var L=this.clone();return L.__iteratees__.push({iteratee:Ye(I,3),type:i}),L.__filtered__=L.__filtered__||k,L}}),Jt(["head","last"],function(e,r){var i="take"+(r?"Right":"");tt.prototype[e]=function(){return this[i](1).value()[0]}}),Jt(["initial","tail"],function(e,r){var i="drop"+(r?"":"Right");tt.prototype[e]=function(){return this.__filtered__?new tt(this):this[i](1)}}),tt.prototype.compact=function(){return this.filter(mn)},tt.prototype.find=function(e){return this.filter(e).head()},tt.prototype.findLast=function(e){return this.reverse().find(e)},tt.prototype.invokeMap=st(function(e,r){return typeof e=="function"?new tt(this):this.map(function(i){return Ta(i,e,r)})}),tt.prototype.reject=function(e){return this.filter(po(Ye(e)))},tt.prototype.slice=function(e,r){e=Je(e);var i=this;return i.__filtered__&&(e>0||r<0)?new tt(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),r!==s&&(r=Je(r),i=r<0?i.dropRight(-r):i.take(r-e)),i)},tt.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},tt.prototype.toArray=function(){return this.take(G)},Xn(tt.prototype,function(e,r){var i=/^(?:filter|find|map|reject)|While$/.test(r),k=/^(?:head|last)$/.test(r),I=R[k?"take"+(r=="last"?"Right":""):r],L=k||/^find/.test(r);I&&(R.prototype[r]=function(){var X=this.__wrapped__,J=k?[1]:arguments,se=X instanceof tt,_e=J[0],ye=se||Ve(X),je=function(it){var ct=I.apply(R,$n([it],J));return k&&De?ct[0]:ct};ye&&i&&typeof _e=="function"&&_e.length!=1&&(se=ye=!1);var De=this.__chain__,Pe=!!this.__actions__.length,Ge=L&&!De,nt=se&&!Pe;if(!L&&ye){X=nt?X:new tt(this);var We=e.apply(X,J);return We.__actions__.push({func:co,args:[je],thisArg:s}),new dn(We,De)}return Ge&&nt?e.apply(this,J):(We=this.thru(je),Ge?k?We.value()[0]:We.value():We)})}),Jt(["pop","push","shift","sort","splice","unshift"],function(e){var r=ks[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",k=/^(?:pop|shift)$/.test(e);R.prototype[e]=function(){var I=arguments;if(k&&!this.__chain__){var L=this.value();return r.apply(Ve(L)?L:[],I)}return this[i](function(X){return r.apply(Ve(X)?X:[],I)})}}),Xn(tt.prototype,function(e,r){var i=R[r];if(i){var k=i.name+"";mt.call(ke,k)||(ke[k]=[]),ke[k].push({name:r,func:i})}}),ke[no(s,E).name]=[{name:"wrapper",func:s}],tt.prototype.clone=Xr,tt.prototype.reverse=tg,tt.prototype.value=ng,R.prototype.at=I0,R.prototype.chain=A0,R.prototype.commit=D0,R.prototype.next=O0,R.prototype.plant=$0,R.prototype.reverse=L0,R.prototype.toJSON=R.prototype.valueOf=R.prototype.value=F0,R.prototype.first=R.prototype.head,Gr&&(R.prototype[Gr]=R0),R}),jr=Fl();tr?((tr.exports=jr)._=jr,On._=jr):Ot._=jr}).call(g8)})($a,$a.exports)),$a.exports}var yo={exports:{}},tu,Yh;function x8(){if(Yh)return tu;Yh=1;var t=1e3,a=t*60,s=a*60,o=s*24,c=o*7,u=o*365.25;tu=function(p,b){b=b||{};var w=typeof p;if(w==="string"&&p.length>0)return d(p);if(w==="number"&&isFinite(p))return b.long?f(p):l(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function d(p){if(p=String(p),!(p.length>100)){var b=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(b){var w=parseFloat(b[1]),h=(b[2]||"ms").toLowerCase();switch(h){case"years":case"year":case"yrs":case"yr":case"y":return w*u;case"weeks":case"week":case"w":return w*c;case"days":case"day":case"d":return w*o;case"hours":case"hour":case"hrs":case"hr":case"h":return w*s;case"minutes":case"minute":case"mins":case"min":case"m":return w*a;case"seconds":case"second":case"secs":case"sec":case"s":return w*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function l(p){var b=Math.abs(p);return b>=o?Math.round(p/o)+"d":b>=s?Math.round(p/s)+"h":b>=a?Math.round(p/a)+"m":b>=t?Math.round(p/t)+"s":p+"ms"}function f(p){var b=Math.abs(p);return b>=o?m(p,b,o,"day"):b>=s?m(p,b,s,"hour"):b>=a?m(p,b,a,"minute"):b>=t?m(p,b,t,"second"):p+" ms"}function m(p,b,w,h){var M=b>=w*1.5;return Math.round(p/w)+" "+h+(M?"s":"")}return tu}var nu,qh;function b8(){if(qh)return nu;qh=1;function t(a){o.debug=o,o.default=o,o.coerce=m,o.disable=l,o.enable=u,o.enabled=f,o.humanize=x8(),o.destroy=p,Object.keys(a).forEach(b=>{o[b]=a[b]}),o.names=[],o.skips=[],o.formatters={};function s(b){let w=0;for(let h=0;h<b.length;h++)w=(w<<5)-w+b.charCodeAt(h),w|=0;return o.colors[Math.abs(w)%o.colors.length]}o.selectColor=s;function o(b){let w,h=null,M,x;function j(..._){if(!j.enabled)return;const E=j,C=Number(new Date),A=C-(w||C);E.diff=A,E.prev=w,E.curr=C,w=C,_[0]=o.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let D=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(O,q)=>{if(O==="%%")return"%";D++;const P=o.formatters[q];if(typeof P=="function"){const U=_[D];O=P.call(E,U),_.splice(D,1),D--}return O}),o.formatArgs.call(E,_),(E.log||o.log).apply(E,_)}return j.namespace=b,j.useColors=o.useColors(),j.color=o.selectColor(b),j.extend=c,j.destroy=o.destroy,Object.defineProperty(j,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(M!==o.namespaces&&(M=o.namespaces,x=o.enabled(b)),x),set:_=>{h=_}}),typeof o.init=="function"&&o.init(j),j}function c(b,w){const h=o(this.namespace+(typeof w>"u"?":":w)+b);return h.log=this.log,h}function u(b){o.save(b),o.namespaces=b,o.names=[],o.skips=[];const w=(typeof b=="string"?b:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const h of w)h[0]==="-"?o.skips.push(h.slice(1)):o.names.push(h)}function d(b,w){let h=0,M=0,x=-1,j=0;for(;h<b.length;)if(M<w.length&&(w[M]===b[h]||w[M]==="*"))w[M]==="*"?(x=M,j=h,M++):(h++,M++);else if(x!==-1)M=x+1,j++,h=j;else return!1;for(;M<w.length&&w[M]==="*";)M++;return M===w.length}function l(){const b=[...o.names,...o.skips.map(w=>"-"+w)].join(",");return o.enable(""),b}function f(b){for(const w of o.skips)if(d(b,w))return!1;for(const w of o.names)if(d(b,w))return!0;return!1}function m(b){return b instanceof Error?b.stack||b.message:b}function p(){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 o.enable(o.load()),o}return nu=t,nu}var Gh;function Xh(){return Gh||(Gh=1,(function(t,a){a.formatArgs=o,a.save=c,a.load=u,a.useColors=s,a.storage=d(),a.destroy=(()=>{let f=!1;return()=>{f||(f=!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`."))}})(),a.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"];function s(){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 f;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&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;f.splice(1,0,m,"color: inherit");let p=0,b=0;f[0].replace(/%[a-zA-Z%]/g,w=>{w!=="%%"&&(p++,w==="%c"&&(b=p))}),f.splice(b,0,m)}a.log=console.debug||console.log||(()=>{});function c(f){try{f?a.storage.setItem("debug",f):a.storage.removeItem("debug")}catch{}}function u(){let f;try{f=a.storage.getItem("debug")||a.storage.getItem("DEBUG")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=!1),f}function d(){try{return localStorage}catch{}}t.exports=b8()(a);const{formatters:l}=t.exports;l.j=function(f){try{return JSON.stringify(f)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(yo,yo.exports)),yo.exports}var ru,Zh;function w8(){if(Zh)return ru;Zh=1;const t=td(),a=Xh()("mongo-knex:converter"),s=Xh()("mongo-knex:converter-extended"),o=["$and","$or"],c={$eq:"=",$ne:"!=",$gt:">",$gte:">=",$lt:"<",$lte:"<=",$in:"in",$nin:"not in",$regex:"like",$not:"not like"},u="*",d=x=>x.charAt(0)==="$",l=x=>d(x)&&t.includes(o,x),f=x=>d(x)&&t.includes(t.keys(c),x),m=x=>d(x)&&t.includes(["$ne","$nin"],x),p=x=>d(x)&&t.includes(["$gt","$gte","$lt","$lte"],x),b=x=>t.includes([c.$in,c.$nin],x),w=x=>JSON.stringify(x,function(j,_){return _ instanceof RegExp?_.toString():_}),h=({source:x,ignoreCase:j})=>(x=x.replace(/\\([.*+?^${}()|[\]\\/])/g,"$1"),j&&(x=x.toLowerCase()),x=x.replace(new RegExp(t.escapeRegExp(u),"g"),u+u),x=x.replace(/%/g,u+"%"),x=x.replace(/_/g,u+"_"),x.startsWith("^")?x=x.substring(1)+"%":x.endsWith("$")?x="%"+x.substring(0,x.length-1):x="%"+x+"%",{source:x,ignoreCase:j});class M{constructor(j={},_={}){this.tableName=j.tableName,this.cte=_.cte,this.config={},Object.assign(this.config,{relations:{}},_)}processWhereType(j,_,E){return E===null?(j==="$or"?"orWhere":"where")+(_==="$ne"?"NotNull":"Null"):j==="$or"?"orWhere":"andWhere"}processStatement(j,_,E){const[C,A]=j.split(".");if(A){a(C,A);const D=C;let F=this.config.relations[D];return F?{table:C,column:A,operator:_,value:E,config:F,isRelation:!0}:(F=t.find(this.config.relations,O=>O.joinTable===D),F?{joinTable:F.joinTable,table:F.tableName,column:A,operator:_,value:E,config:F,isRelation:!0}:{column:j,operator:_,value:E,isRelation:!1})}return{column:this.cte&&this.cte===!0?`${j}`:`${this.tableName}.${j}`,operator:_,value:E,isRelation:!1}}groupRelationStatements(j,_){const E={},C=_==="$and"?j.filter(A=>!A.joinTable):j;if(t.each(C,(A,D)=>{let F=m(A.operator);!F&&E[A.table]&&(F=t.some(E[A.table].innerWhereStatements,q=>!(q.column!==A.column||p(q.operator)&&p(A.operator))));let O=A.table;if(F&&(O=`${A.table}_${D})}`,E[O]))throw new Error("Key collision detected");E[O]||(E[O]={},E[O].innerWhereStatements=[]),E[O].innerWhereStatements.push(A)}),_==="$and"){const A=j.filter(D=>D.joinTable);t.each(Object.keys(E),D=>{E[D].joinFilterStatements=A})}return E}buildRelationQuery(j,_,E){a("(buildRelationQuery)"),s.enabled&&s(`(buildRelationQuery) ${w(_)}`);const C=this.groupRelationStatements(_,E);s.enabled&&s(`(buildRelationQuery) grouped: ${w(C)}`),t.each(Object.keys(C),A=>{a(`(buildRelationQuery) build relation for ${A}`);const D=C[A].innerWhereStatements,F=D[0];if(F.config.type==="manyToMany")if(t.every(D.map(O=>O.operator),f)){const O=t.every(D.map(U=>U.operator),U=>m(U)),q=O?c.$nin:c.$in,P=["whereNull","whereNotNull"].includes(F.whereType)?"andWhere":["orWhereNull","orWhereNotNull"].includes(F.whereType)?"orWhere":F.whereType;j[P](`${this.tableName}.id`,q,function(){const U=C[A].joinFilterStatements;let K=F.config.tableName,$=`${F.config.tableName}.${F.config.joinToForeign||"id"}`;F.config.tableNameAs&&(K=`${F.config.tableName} as ${F.config.tableNameAs}`,$=`${F.config.tableNameAs}.${F.config.joinToForeign||"id"}`);const Q=F.config.joinType||"innerJoin",N=this.select(`${F.config.joinTable}.${F.config.joinFrom}`).from(`${F.config.joinTable}`)[Q](K,function(){this.on($,"=",`${F.config.joinTable}.${F.config.joinTo}`),t.each(U,W=>{this.andOn(`${W.joinTable}.${W.column}`,c[W.operator],W.value)})});return s.enabled&&a(`(buildRelationQuery) innerQB sql-pre: ${N.toSQL().sql}`),t.each(D,(W,ae)=>{a(`(buildRelationQuery) build relation where statements for ${ae}`);const ue=`${W.joinTable||W.table}.${W.column}`;let be;O?be=c.$in:m(W.operator)?be=c.$nin:be=c[W.operator];let de=W.value;b(be)&&(de=t.isArray(W.value)?W.value:[W.value]),N[W.whereType](ue,be,de)}),s.enabled&&a(`(buildRelationQuery) innerQB sql-post: ${N.toSQL().sql}`),N})}else a(`one of ${A} group statements contains unknown operator`);else if(F.config.type==="oneToOne")if(t.every(D.map(O=>O.operator),f)){const O=t.every(D.map(K=>K.operator),K=>m(K)),q=O?c.$nin:c.$in,P=this.tableName,U=F.whereType==="orWhere"?"orWhere":"where";j[U](`${this.tableName}.id`,q,function(){const K=C[A].joinFilterStatements;let $=F.config.tableName,Q=`${F.config.tableName}.${F.config.joinFrom}`;F.config.tableNameAs&&($=`${F.config.tableName} as ${F.config.tableNameAs}`,Q=`${F.config.tableNameAs}.${F.config.joinFrom}`);const N=this.select(`${P}.id`).from(`${P}`).leftJoin($,function(){this.on(Q,"=",`${P}.id`),t.each(K,W=>{this.andOn(`${W.joinTable}.${W.column}`,c[W.operator],W.value)})});return t.each(D,(W,ae)=>{a(`(buildRelationQuery) build relation where statements for ${ae}`);const ue=`${W.table}.${W.column}`;let be;O?(be=c.$in,W.value===null&&(W.whereType=W.whereType==="whereNotNull"?"whereNull":"whereNotNull")):m(W.operator)?be=c.$nin:be=c[W.operator];let de=W.value;b(be)&&(de=t.isArray(W.value)?W.value:[W.value]),N[W.whereType](ue,be,de)}),s.enabled&&a(`(buildRelationQuery) innerQB sql-pre: ${N.toSQL().sql}`),N})}else a(`one of ${A} group statements contains unknown operator`)})}buildComparison(j,_,E,C,A,D){const F=c[C]||"=",O=this.processStatement(E,C,A);let q=this.processWhereType(_,C,A);if(a(`(buildComparison) mode: ${_}, op: ${C}, isRelation: ${O.isRelation}, group: ${D}`),O.isRelation){if(O.whereType=q,!D){this.buildRelationQuery(j,[O],_);return}Object.prototype.hasOwnProperty.call(j,"relations")||(j.relations=[]),j.relations.push(O);return}const P=O.column;if(C=O.operator,A=O.value,C==="$regex"||C==="$not"){const{source:U,ignoreCase:K}=h(A);if(A=U,K){q+="Raw",a(`(buildComparison) whereType: ${q}, statement: ${E}, op: ${C}, comp: ${F}, value: ${A} (REGEX/i)`),j[q](`lower(??) ${F} ? ESCAPE ?`,[P,A,u]);return}q+="Raw",a(`(buildComparison) whereType: ${q}, statement: ${E}, op: ${C}, comp: ${F}, value: ${A} (REGEX)`),j[q](`?? ${F} ? ESCAPE ?`,[P,A,u]);return}a(`(buildComparison) whereType: ${q}, statement: ${E}, op: ${C}, comp: ${F}, value: ${A}`),j[q](P,F,A)}buildWhereClause(j,_,E,C,A){if(a(`(buildWhereClause) mode: ${_}, statement: ${E}`),s.enabled&&s(`(buildWhereClause) ${w(C)}`),!t.isObject(C))return this.buildComparison(j,_,E,"$eq",C,A);t.forIn(C,(D,F)=>{f(F)?this.buildComparison(j,_,E,F,D,A):a("unknown operator")})}buildWhereGroup(j,_,E,C){const A=this.processWhereType(_);a(`(buildWhereGroup) mode: ${E}, whereType: ${A}`),s.enabled&&s(`(buildWhereGroup) ${w(C)}`),j[A](D=>{t.isArray(C)?C.forEach(F=>this.buildQuery(D,E,F,!0)):t.isObject(C)&&this.buildQuery(D,E,C,!0),Object.prototype.hasOwnProperty.call(D,"relations")&&(this.buildRelationQuery(D,D.relations,E),delete D.relations)})}buildQuery(j,_,E,C){a(`(buildQuery) mode: ${_}`),s.enabled&&s(`(buildQuery) ${w(E)}`),t.forIn(E,(A,D)=>{a(`(buildQuery) key: ${D}`),l(D)?this.buildWhereGroup(j,_,D,A):this.buildWhereClause(j,_,D,A,C)})}processJSON(j,_){a("(processJSON)"),s.enabled&&s(`(processJSON) ${w(_)}`),this.buildQuery(j,"$and",_)}}return ru=function(j,_,E){return new M({tableName:j._single.table},E).processJSON(j,_),j},ru}var su,Kh;function v8(){return Kh||(Kh=1,su=w8()),su}var au,Vh;function _8(){if(Vh)return au;Vh=1;const t=td(),a=["$and","$or"],s=(j,_)=>Array.isArray(j)?j.map(E=>s(E,_)).filter(E=>!t.isEmpty(E)):t.reduce(j,(E,C,A)=>{let D;if(a.includes(A)){const F=s(C,_);D=t.isEmpty(F)?null:{[A]:F}}else A==="yg"?D={[A]:s(C,_)}:D=_(C,A);return t.assign({},E,D)},{}),o=(j,_)=>t.isEmpty(j)?_:t.isEmpty(_)?j:{$and:[j,_]},c=(j,_)=>t.some(j,(E,C,A)=>C==="$and"?c(A.$and,_):C==="$or"?c(A.$or,_):C!==_&&t.isObject(E)?c(E,_):C===_),u=(j,_)=>j&&s(j,function(E,C){if(!_(C))return{[C]:E}}),d=(...j)=>{let _={};return j.filter(E=>!!E).forEach(E=>{E&&Object.keys(E).length>0&&(E=u(E,C=>c(_,C)),E&&(_=Object.keys(_).length>0?o(_,E):E))}),_},l=(j,_)=>{const E=(C,A)=>A.$and?{$and:[C,...A.$and]}:{$and:[C,A]};return s(j,function(C,A){const D=t.find(_,{key:A});if(!D)return{[A]:C};let F={[D.replacement]:C};return D.expansion?E(F,D.expansion):F})};function f(j,_){const E=_.find(({from:C})=>C===j);return E?E.to:j}function m(j,_){return Array.isArray(j)?j.map(_):_(j)}function p(j){return function(E){return s(E,function(C,A){return A!==j.key.from?{[A]:C}:typeof C!="object"?{[j.key.to]:f(C,j.values)}:{[j.key.to]:t.reduce(C,(D,F,O)=>Object.assign(D,{[O]:m(F,q=>f(q,j.values))}),{})}})}}const b=(j,_)=>s(j,function(E,C){return Object.keys(_).includes(C)?_[C]??{}:{[C]:E}});function w(...j){return function(_){for(const E of j)_=E(_);return _}}function h(j){if(!j)return[];const _=[];if(j.$and)for(const E of j.$and)for(const C of h(E))_.includes(C)||_.push(C);else if(j.$or)for(const E of j.$or)for(const C of h(E))_.includes(C)||_.push(C);else j.yg?_.push(...h(j.yg)):_.push(...Object.keys(j));return _}function M(j,_){let E,C;if(typeof j!="object")return[E,C];if(j.$and){for(const A of j.$and){const D=h(A);let F=!1;for(const O of D)if(_.includes(O))F=!0;else if(F)throw new Error(`This filter is not supported because you cannot combine ${_.join(", ")} filters with other filters except at the root level in an AND.`);F?E?E.$and.push(A):E={$and:[A]}:C?C.$and.push(A):C={$and:[A]}}E&&E.$and.length===1&&(E=E.$and[0]),C&&C.$and.length===1&&(C=C.$and[0])}else if(j.$or){let A=!1;for(const D of j.$or){const F=h(D);for(const O of F)if(_.includes(O)){A=!0;continue}else if(A)throw new Error(`This filter is not supported because you cannot combine ${_.join(", ")} filters with other filters in an OR.`)}A?E=j:C=j}else{if(j.yg)return this.splitFilter(j.yg,_);{const A=Object.keys(j);for(const D of A)_.includes(D)?E?E[D]=j[D]:E={[D]:j[D]}:C?C[D]=j[D]:C={[D]:j[D]}}}return[E,C]}function x(j){const _=[];for(const E of Object.keys(j))j[E]&&_.push({key:{from:E,to:j[E]},values:[]});return _.map(E=>p(E))}return au={mapKeyValues:p,combineFilters:o,findStatement:c,rejectStatements:u,mergeFilters:d,expandFilters:l,mapQuery:s,replaceFilters:b,chainTransformers:w,getUsedKeys:h,splitFilter:M,mapKeys:x},au}var iu,Qh;function Iu(){return Qh||(Qh=1,iu=_8()),iu}var ou,Jh;function y8(){if(Jh)return ou;Jh=1;const t=Iu(),a=lm(),s=td(),o=d=>!d||Object.keys(d).length===0?d:d.map(l=>{const f=Object.assign({},l);return f.expansion&&(f.expansion=a.parse(l.expansion)),f}),c=(d,l)=>{const f=o(l);return t.expandFilters(d,f)},u=d=>{if(!d.$and||!t.findStatement(d,"$ne"))return d;const l=d.$and,f=l.filter(b=>t.findStatement(b,"$ne")),m=s.groupBy(f,b=>Object.keys(b)[0]);Object.keys(m).filter(b=>m[b].length>1).forEach(b=>{const w=m[b].map(h=>h[b].$ne).filter(h=>h!==void 0);w.length!==0&&(d[b]={$nin:w},m[b].forEach(h=>{const M=l.indexOf(h);M>-1&&l.splice(M,1)}))}),l.length===0&&delete d.$and;for(const b in d)b==="$and"&&(d[b]=d[b].map(u));return d};return ou={mergeFilters:t.mergeFilters,parseExpansions:o,expandFilters:c,combineNeFilters:u},ou}var ep;function k8(){if(ep)return _o.exports;ep=1;const t=m8(),a=lm(),s=v8(),o=y8();return _o.exports=(c,u={})=>{const d={};return d.lex=()=>a.lex(c),d.parse=function(){!this.filter&&c&&(this.filter=a.parse(c),u.transformer&&(this.filter=u.transformer(this.filter)));let l,f;u.overrides&&(l=a.parse(u.overrides)),u.defaults&&(f=a.parse(u.defaults));let m=o.mergeFilters(l,this.filter,f);return m=o.combineNeFilters(m),u.expansions&&(m=o.expandFilters(m,u.expansions)),m},d.queryJSON=function(l){return this.query=this.query||new t.Query(d.parse()),this.query.test(l)},d.querySQL=l=>s(l,d.parse(),u),d.toString=()=>c,d.toJSON=d.parse,d},_o.exports.utils={mapQuery:Iu().mapQuery,mapKeyValues:Iu().mapKeyValues},_o.exports}var lu,tp;function j8(){return tp||(tp=1,lu=k8()),lu}var M8=j8();const E8=Lu(M8);function Xm(t,a){return t.visibility?E8(t.visibility).queryJSON(a):!0}function T8({description:t,accentColor:a,icon:s,logo:o,coverImage:c,themeSettings:u,bodyFont:d,headingFont:l}){if(!u)return;const f=u.reduce((b,{key:w,value:h})=>({...b,[w]:h}),{}),m=new URLSearchParams;m.append("c",a),m.append("d",t),m.append("icon",s),m.append("logo",o),m.append("cover",c),m.append("bf",d),m.append("hf",l);const p={};return u.forEach(b=>{p[b.key]=Xm(b,f)?b.value:a1}),m.append("custom",JSON.stringify(p)),m.toString()}const N8=({settings:t,url:a})=>{const s=T8({...t}),o=B.useCallback(c=>{!a||!s||fetch(a,{method:"POST",headers:{"Content-Type":"text/html;charset=utf-8","x-ghost-preview":s,Accept:"text/plain"},mode:"cors",credentials:"include"}).then(u=>u.text()).then(u=>{const d="html { pointer-events: none; }",f=new DOMParser().parseFromString(u,"text/html"),m=f.querySelector("style"),p=m?.innerHTML;p?m.innerHTML=`${p}
|
|
25
25
|
|
|
26
26
|
${d}`:f.head.innerHTML+=`<style>${d}</style>`;let w=(f.doctype?new XMLSerializer().serializeToString(f.doctype):"")+f.documentElement.outerHTML;c.contentDocument?.open(),c.contentDocument?.write(w),c.contentDocument?.close()})},[s,a]);return n.jsx(Vu,{addDelay:!1,className:"absolute size-[110%] origin-top-left scale-[.90909] bg-white max-[1600px]:size-[130%] max-[1600px]:scale-[.76923]",generateContent:o,height:"100%",parentClassName:"relative h-full w-full",testId:"theme-preview",width:"100%"})},C8=({setting:t,setSetting:a})=>{const[s,o]=B.useState({});B.useEffect(()=>{const m=t.value===null?"":String(t.value);o(p=>({...p,[t.key]:m}))},[t]);const c=m=>{s[m]!==void 0&&a(s[m])},u=(m,p)=>{o(b=>({...b,[m]:p}))},{mutateAsync:d}=Ys(),l=pt(),f=async m=>{try{const p=hr(await d({file:m}));a(p)}catch(p){l(p)}};switch(t.type){case"text":return n.jsx(He,{hint:t.description,title:Oa(t.key),value:s[t.key]||"",onBlur:()=>c(t.key),onChange:m=>u(t.key,m.target.value)});case"boolean":return n.jsx(ot,{checked:t.value,direction:"rtl",hint:t.description,label:Oa(t.key),onChange:m=>a(m.target.checked)});case"select":return n.jsx(Ht,{hint:t.description,options:t.options.map(m=>({label:m,value:m})),selectedOption:{label:t.value,value:t.value},testId:`setting-select-${t.key}`,title:Oa(t.key),onSelect:m=>a(m?.value||null)});case"color":return n.jsx(Kn,{debounceMs:200,direction:"rtl",hint:t.description,title:Oa(t.key),value:t.value||"",onChange:m=>a(m)});case"image":return n.jsxs(n.Fragment,{children:[n.jsx(Et,{useLabelTag:!0,children:Oa(t.key)}),n.jsx(mr,{height:t.value?"100px":"32px",id:`custom-${t.key}`,imageURL:t.value||"",onDelete:()=>a(null),onUpload:m=>f(m),children:"Upload image"}),t.description&&n.jsx(Jn,{children:t.description})]})}},S8={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"]},I8=({sections:t,updateSetting:a})=>{const{data:s}=$o(),o=s?.themes.find(l=>l.active),c=o?.package.name?.toLowerCase()||"",u=o?.package.author?.name||"",{supportsCustomFonts:d}=Ju();return n.jsx(n.Fragment,{children:t.map(l=>{const f=l.settings.filter(p=>Xm(p,l.settings.reduce((b,{key:w,value:h})=>({...b,[w]:h}),{})));let m;return n.jsx(ut,{className:"first-of-type:mt-6",gap:"xs",margins:"lg",title:l.title,children:f.map(p=>{let b="";p.type==="boolean"&&m!=="boolean"&&m!==void 0&&(b="mt-3"),(p.type==="text"||p.type==="select")&&(m==="text"||m==="select")&&(b="mt-2");const w=S8[c];return w&&w.includes(p.key)&&u==="Ghost Foundation"&&d&&(b+=" hidden"),m=p.type,n.jsx("div",{className:b,children:n.jsx(C8,{setSetting:h=>a({...p,value:h}),setting:p},p.key)},p.key)})},l.id)})})},A8=({globalSettings:t,themeSettingSections:a,updateGlobalSetting:s,updateThemeSetting:o,onTabChange:c})=>{const[u,d]=B.useState("global"),l=[{id:"global",title:"Brand",contents:n.jsx(Uh,{updateSetting:s,values:t})}];a.length>0&&l.push({id:"theme-settings",title:"Theme",contents:n.jsx(I8,{sections:a,updateSetting:o})});const f=m=>{d(m),c(m)};return n.jsx("div",{className:"flex h-full flex-col justify-between",children:n.jsx("div",{className:"grow p-7 pt-0","data-testid":"design-setting-tabs",children:l.length>1?n.jsx(Fr,{selectedTab:u,stickyHeader:!0,tabs:l,onTabChange:f}):n.jsx(Uh,{updateSetting:s,values:t})})})},D8=()=>{const{settings:t,siteData:a}=lt(),{mutateAsync:s}=zr(),{data:{posts:[o]}={posts:[]}}=om({searchParams:{filter:"status:published",order:"published_at DESC",limit:"1",fields:"id,url"}}),{data:c}=i1(),{mutateAsync:u}=o1(),d=pt(),[l,f]=B.useState("homepage"),{updateRoute:m}=rt(),p=Vp().getParam("ref"),{formState:b,saveState:w,handleSave:h,updateForm:M,setFormState:x,okProps:j}=gn({initialState:{settings:t,themeSettings:c?c.custom_theme_settings:void 0},savingDelay:500,onSave:async()=>{if(b.themeSettings?.some(be=>be.dirty)){const be=await u(b.themeSettings);x(de=>({...de,themeSettings:be.custom_theme_settings}))}if(b.settings.some(be=>be.dirty)){const{settings:be}=await s(b.settings.filter(de=>de.dirty));x(de=>({...de,settings:be}))}},onSaveError:d});B.useEffect(()=>{c&&x(be=>({...be,themeSettings:c.custom_theme_settings}))},[x,c]);const _=(be,de)=>{M(ie=>({...ie,settings:ie.settings.map(V=>V.key===be?{...V,value:de,dirty:!0}:V)}))},E=be=>{M(de=>({...de,themeSettings:de.themeSettings?.map(ie=>ie.key===be.key?{...be,dirty:!0}:ie)}))},[C,A,D,F,O,q,P]=jt(b.settings,["description","accent_color","icon","logo","cover_image","heading_font","body_font"]),U=(b.themeSettings||[]).reduce((be,de)=>{const ie=de.group==="homepage"||de.group==="post"?de.group:"site-wide";return{...be,[ie]:(be[ie]||[]).concat(de)}},{}),K=Object.entries(U).map(([be,de])=>({id:be,settings:de||[],title:be==="site-wide"?"Site wide":be==="homepage"?"Homepage":"Post"}));let $=[];o&&($=[{id:"homepage",title:"Homepage"},{id:"post",title:"Post"}]);const Q=be=>{$.length&&f(be)},N=be=>{f(be==="post"&&o?"post":"homepage")};let W=Qn(a);switch(l){case"homepage":W=Qn(a);break;case"post":W=o.url;break}const ae=n.jsx(N8,{settings:{description:C,accentColor:A,icon:D,logo:F,coverImage:O,themeSettings:b.themeSettings,headingFont:q,bodyFont:P},url:W}),ue=n.jsx(A8,{globalSettings:{description:C,accentColor:A,icon:D,logo:F,coverImage:O,headingFont:q,bodyFont:P},handleSave:h,themeSettingSections:K,updateGlobalSetting:_,updateThemeSetting:E,onTabChange:N});return n.jsx(os,{afterClose:()=>{m(p==="setup"?{isExternal:!0,route:"analytics"}:"design")},buttonsDisabled:j.disabled,cancelLabel:"Close",defaultTab:"homepage",dirty:w==="unsaved",okColor:j.color,okLabel:j.label||"Save",preview:ae,previewToolbarTabs:$,selectedURL:l,sidebar:ue,sidebarPadding:!1,siteLink:Qn(a),size:"full",testId:"design-modal",title:"Design",onOk:async()=>{await h({fakeWhenUnchanged:!0})},onSelectURL:Q})},O8=Ae.create(({title:t,prompt:a,cancelLabel:s="Cancel",okLabel:o="OK",okColor:c="black"})=>{const u=Wt(),d=l=>{u.resolve(l),u.remove()};return n.jsx(yt,{backDropClick:!1,cancelLabel:s,okColor:c,okLabel:o,testId:"theme-editor-confirm-modal",title:t,width:540,onCancel:()=>d(!1),onOk:()=>d(!0),children:n.jsx("div",{className:"py-4",children:a})})}),R8=Ae.create(({title:t,prompt:a,fieldTitle:s,initialValue:o,placeholder:c,cancelLabel:u="Cancel",okLabel:d="Continue"})=>{const l=Wt(),[f,m]=B.useState(o),p=b=>{l.resolve(b),l.remove()};return n.jsx(yt,{backDropClick:!1,cancelLabel:u,okDisabled:!f.trim(),okLabel:d,testId:"theme-editor-input-modal",title:t,width:540,onCancel:()=>p(null),onOk:()=>p(f),children:n.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[a,n.jsx(He,{clearBg:!1,placeholder:c,title:s,value:f,autoFocus:!0,onChange:b=>m(b.target.value)})]})})}),$8="inline-flex h-7 w-7 items-center justify-center rounded-full border border-[#2f333b] bg-transparent text-[#c8ccd3] transition-colors hover:bg-[#1f2228] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#4a9eff] disabled:cursor-not-allowed disabled:opacity-50",Zm="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",Au=`${Zm} border-[#2f333b] bg-transparent text-[#e6e7ea] hover:bg-[#1f2228]`,L8=`${Zm} border-transparent bg-green text-black hover:bg-green-400`,F8=({currentThemeName:t,changes:a,isSaving:s,onOpenReview:o,onClose:c,onSave:u})=>n.jsxs("div",{className:"flex items-center gap-3 border-b border-[#23262c] bg-[#1a1d21] px-4 py-3",children:[n.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[n.jsx("h2",{className:"truncate text-[14px] font-semibold text-[#f4f5f7]",children:"Edit theme"}),n.jsx("span",{className:"truncate text-[12px] text-[#8a8f98]",children:t})]}),a.length>0&&n.jsxs("button",{className:"rounded-full border border-transparent bg-[#3b2a16] px-2.5 py-1 text-[11px] leading-none text-[#f5a623] hover:bg-[#49311a]",type:"button",onClick:o,children:[a.length," ",a.length===1?"file modified":"files modified"]}),n.jsx("div",{className:"grow"}),n.jsxs("button",{className:Au,type:"button",onClick:c,children:[n.jsx(Up,{size:14}),"Close"]}),n.jsxs("button",{className:L8,disabled:s,type:"button",onClick:u,children:[n.jsx(c_,{size:14}),s?"Saving…":"Save"]})]}),z8=t=>{const a={type:"dir",name:"",path:"",children:new Map};for(const s of Object.keys(t).sort()){const o=s.split("/");let c=a;for(let u=0;u<o.length;u+=1){const d=o[u];if(u===o.length-1){c.children.set(d,{type:"file",name:d,path:s,editable:t[s].editable});continue}const f=`${o.slice(0,u+1).join("/")}/`,m=c.children.get(d);if(m?.type==="dir"){c=m;continue}const p={type:"dir",name:d,path:f,children:new Map};c.children.set(d,p),c=p}}return a},P8=t=>t.sort((a,s)=>a.type!==s.type?a.type==="dir"?-1:1:a.name.localeCompare(s.name)),cu="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",H8=({currentFiles:t,selectedNode:a,setSelectedNode:s,expandedDirectories:o,setExpandedDirectories:c,changesMap:u,isLoading:d,onCreateFile:l,onRenameSelected:f,onDeleteSelected:m,onOpenFile:p})=>{const b=(w,h=0)=>{if(w.type==="file"){const _=a?.type==="file"&&a.path===w.path,E=u.get(w.path);return n.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 ${_?"bg-[#243043] text-white":"text-[#c8ccd3] hover:bg-[#1f2228]"} ${w.editable?"":"opacity-70"}`,style:{paddingLeft:`${h*14+8}px`},type:"button",onClick:()=>p(w.path),children:[n.jsx("span",{className:"w-3 shrink-0"}),n.jsx(f_,{size:14}),n.jsx("span",{className:"min-w-0 grow truncate",children:w.name}),E&&n.jsx("span",{className:`mr-1 h-1.5 w-1.5 shrink-0 rounded-full ${E==="deleted"?"bg-[#ff6b6b]":E==="added"?"bg-[#14b886]":"bg-[#f5a623]"}`})]},w.path)}const M=o.has(w.path),x=a?.type==="dir"&&a.path===w.path,j=P8(Array.from(w.children?.values()||[]));return n.jsxs("div",{children:[w.path&&n.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 ${x?"bg-[#202630] text-white":"text-[#c8ccd3] hover:bg-[#1f2228]"}`,style:{paddingLeft:`${h*14+8}px`},type:"button",onClick:()=>{s({type:"dir",path:w.path}),c(_=>{const E=new Set(_);return E.has(w.path)?E.delete(w.path):E.add(w.path),E})},children:[M?n.jsx(u1,{className:"shrink-0 text-[#6a6f78]",size:12}):n.jsx(d1,{className:"shrink-0 text-[#6a6f78]",size:12}),M?n.jsx(u_,{className:"shrink-0 text-[#8a8f98]",size:14}):n.jsx(d_,{className:"shrink-0 text-[#8a8f98]",size:14}),n.jsx("span",{className:"truncate",children:w.name})]}),(w.path===""||M)&&n.jsx("div",{children:j.map(_=>b(_,w.path?h+1:h))})]},w.path||"root")};return n.jsxs("aside",{className:"flex w-[280px] shrink-0 flex-col border-r border-[#23262c] bg-[#16181c]",children:[n.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-[#23262c] px-3 py-2",children:[n.jsxs("div",{className:"text-[12px] font-medium text-[#c8ccd3]",children:[Object.keys(t).length," files"]}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("button",{"aria-label":"New file",className:cu,type:"button",onClick:l,children:n.jsx(l1,{size:13})}),n.jsx("button",{"aria-label":"Rename selected item",className:cu,disabled:!a,type:"button",onClick:f,children:n.jsx(x_,{size:13})}),n.jsx("button",{"aria-label":"Delete selected item",className:cu,disabled:!a,type:"button",onClick:m,children:n.jsx(c1,{size:13})})]})]}),n.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:d?n.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 text-center text-[13px] text-[#8a8f98]",children:[n.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[#2f333b] border-t-[#14b886]"}),n.jsx("span",{children:"Loading theme files…"})]}):Object.keys(t).length===0?n.jsx("div",{className:"px-3 py-4 text-[12px] text-[#8a8f98]",children:"This theme archive does not contain any files."}):b(z8(t))})]})},ko="overflow-auto rounded-md border border-[#23262c] bg-[#15171a] p-4 text-[12px] leading-5 text-[#d4d8de]",jo="mb-2 text-[11px] font-semibold tracking-[0.08em] text-[#8a8f98] uppercase",np="flex flex-1 items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]",U8=({baseFiles:t,currentFiles:a,changes:s})=>s.map(o=>{const c=t[o.path],u=a[o.path];return{path:o.path,editable:o.editable,status:o.status,before:c?.editable?c.content??"":null,after:u?.editable?u.content??"":null}}),B8=t=>{const a=t.filter(c=>c.status==="added").length,s=t.filter(c=>c.status==="modified").length,o=t.filter(c=>c.status==="deleted").length;return`${s} modified, ${a} added, ${o} deleted`},W8=({reviewItems:t,onClose:a,onOpenInEditor:s,onRevert:o})=>{const[c,u]=B.useState(null),d=t.find(f=>f.path===c)||t[0]||null;B.useEffect(()=>{if(!d){u(null);return}(!c||!t.some(f=>f.path===c))&&u(d.path)},[t,d,c]);const l=B8(t);return n.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[rgba(8,10,14,0.64)]",onClick:a,children:n.jsxs("div",{className:"flex h-[min(78vh,calc(100%-24px))] w-[min(1240px,calc(100%-24px))] flex-col overflow-hidden rounded-[10px] border border-[#2b3038] bg-[#171a20] p-4 shadow-[0_24px_64px_rgba(0,0,0,0.45)]",onClick:f=>f.stopPropagation(),children:[n.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("h3",{className:"text-[16px] font-semibold text-[#f4f5f7]",children:"All changes"}),n.jsx("p",{className:"mt-1 text-[12px] text-[#9aa0aa]",children:l})]}),n.jsx("button",{"aria-label":"Close review",className:$8,type:"button",onClick:a,children:n.jsx(Up,{size:14})})]}),n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-[320px_1fr] gap-3",children:[n.jsxs("div",{className:"min-h-0 overflow-auto rounded-lg border border-[#2a2d33] bg-[#111319] p-2",children:[t.map(f=>n.jsxs("button",{className:`flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-[13px] ${d?.path===f.path?"border-[#355070] bg-[#243043] text-white":"border-transparent text-[#d4d8de] hover:bg-[#1d2028]"}`,type:"button",onClick:()=>u(f.path),children:[n.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] tracking-[0.04em] uppercase ${f.status==="deleted"?"bg-[#4a2222] text-[#ffbdbd]":f.status==="added"?"bg-[#17342a] text-[#a5e8c8]":"bg-[#3b2a16] text-[#f5a623]"}`,children:f.status}),n.jsx("span",{className:"min-w-0 grow truncate",children:f.path}),!f.editable&&n.jsx(h_,{className:"text-[#6a6f78]",size:12})]},`${f.status}-${f.path}`)),t.length===0&&n.jsx("div",{className:"px-3 py-4 text-[12px] text-[#8a8f98]",children:"No unsaved changes."})]}),n.jsx("div",{className:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-[#2a2d33] bg-[#111319]",children:d?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-[#23262c] px-4 py-3",children:[n.jsxs("div",{className:"min-w-0 grow",children:[n.jsx("div",{className:"truncate text-[13px] font-medium text-[#f4f5f7]",children:d.path}),n.jsx("div",{className:"mt-1 text-[12px] text-[#8a8f98]",children:d.editable?"Text file preview":"Binary file"})]}),d.status!=="deleted"&&n.jsx("button",{className:Au,type:"button",onClick:()=>s(d.path),children:"Open in editor"}),n.jsxs("button",{className:Au,type:"button",onClick:()=>o(d.path),children:[n.jsx(cm,{size:14}),"Revert"]})]}),d.editable?d.status==="added"?n.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[n.jsx("div",{className:jo,children:"After"}),n.jsx("pre",{className:ko,children:d.after??""})]}):d.status==="deleted"?n.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[n.jsx("div",{className:jo,children:"Before"}),n.jsx("pre",{className:ko,children:d.before??""})]}):n.jsxs("div",{className:"grid min-h-0 flex-1 grid-cols-2 gap-4 p-4",children:[n.jsxs("div",{className:"min-h-0 overflow-auto",children:[n.jsx("div",{className:jo,children:"Before"}),n.jsx("pre",{className:`h-full ${ko}`,children:d.before??""})]}),n.jsxs("div",{className:"min-h-0 overflow-auto",children:[n.jsx("div",{className:jo,children:"After"}),n.jsx("pre",{className:`h-full ${ko}`,children:d.after??""})]})]}):n.jsx("div",{className:np,children:"Binary files are kept intact in the archive. Open or revert the change from here, but binary contents are not shown."})]}):n.jsx("div",{className:np,children:"Select a changed file to review it."})})]})]})})};var uu={exports:{}};var rp;function Y8(){return rp||(rp=1,(function(t,a){(function(s){t.exports=s()})(function(){return(function s(o,c,u){function d(m,p){if(!c[m]){if(!o[m]){var b=typeof xo=="function"&&xo;if(!p&&b)return b(m,!0);if(l)return l(m,!0);var w=new Error("Cannot find module '"+m+"'");throw w.code="MODULE_NOT_FOUND",w}var h=c[m]={exports:{}};o[m][0].call(h.exports,function(M){var x=o[m][1][M];return d(x||M)},h,h.exports,s,o,c,u)}return c[m].exports}for(var l=typeof xo=="function"&&xo,f=0;f<u.length;f++)d(u[f]);return d})({1:[function(s,o,c){var u=s("./utils"),d=s("./support"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";c.encode=function(f){for(var m,p,b,w,h,M,x,j=[],_=0,E=f.length,C=E,A=u.getTypeOf(f)!=="string";_<f.length;)C=E-_,b=A?(m=f[_++],p=_<E?f[_++]:0,_<E?f[_++]:0):(m=f.charCodeAt(_++),p=_<E?f.charCodeAt(_++):0,_<E?f.charCodeAt(_++):0),w=m>>2,h=(3&m)<<4|p>>4,M=1<C?(15&p)<<2|b>>6:64,x=2<C?63&b:64,j.push(l.charAt(w)+l.charAt(h)+l.charAt(M)+l.charAt(x));return j.join("")},c.decode=function(f){var m,p,b,w,h,M,x=0,j=0,_="data:";if(f.substr(0,_.length)===_)throw new Error("Invalid base64 input, it looks like a data url.");var E,C=3*(f=f.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(f.charAt(f.length-1)===l.charAt(64)&&C--,f.charAt(f.length-2)===l.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(E=d.uint8array?new Uint8Array(0|C):new Array(0|C);x<f.length;)m=l.indexOf(f.charAt(x++))<<2|(w=l.indexOf(f.charAt(x++)))>>4,p=(15&w)<<4|(h=l.indexOf(f.charAt(x++)))>>2,b=(3&h)<<6|(M=l.indexOf(f.charAt(x++))),E[j++]=m,h!==64&&(E[j++]=p),M!==64&&(E[j++]=b);return E}},{"./support":30,"./utils":32}],2:[function(s,o,c){var u=s("./external"),d=s("./stream/DataWorker"),l=s("./stream/Crc32Probe"),f=s("./stream/DataLengthProbe");function m(p,b,w,h,M){this.compressedSize=p,this.uncompressedSize=b,this.crc32=w,this.compression=h,this.compressedContent=M}m.prototype={getContentWorker:function(){var p=new d(u.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new f("data_length")),b=this;return p.on("end",function(){if(this.streamInfo.data_length!==b.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),p},getCompressedWorker:function(){return new d(u.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},m.createWorkerFrom=function(p,b,w){return p.pipe(new l).pipe(new f("uncompressedSize")).pipe(b.compressWorker(w)).pipe(new f("compressedSize")).withStreamInfo("compression",b)},o.exports=m},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(s,o,c){var u=s("./stream/GenericWorker");c.STORE={magic:"\0\0",compressWorker:function(){return new u("STORE compression")},uncompressWorker:function(){return new u("STORE decompression")}},c.DEFLATE=s("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(s,o,c){var u=s("./utils"),d=(function(){for(var l,f=[],m=0;m<256;m++){l=m;for(var p=0;p<8;p++)l=1&l?3988292384^l>>>1:l>>>1;f[m]=l}return f})();o.exports=function(l,f){return l!==void 0&&l.length?u.getTypeOf(l)!=="string"?(function(m,p,b,w){var h=d,M=w+b;m^=-1;for(var x=w;x<M;x++)m=m>>>8^h[255&(m^p[x])];return-1^m})(0|f,l,l.length,0):(function(m,p,b,w){var h=d,M=w+b;m^=-1;for(var x=w;x<M;x++)m=m>>>8^h[255&(m^p.charCodeAt(x))];return-1^m})(0|f,l,l.length,0):0}},{"./utils":32}],5:[function(s,o,c){c.base64=!1,c.binary=!1,c.dir=!1,c.createFolders=!0,c.date=null,c.compression=null,c.compressionOptions=null,c.comment=null,c.unixPermissions=null,c.dosPermissions=null},{}],6:[function(s,o,c){var u=null;u=typeof Promise<"u"?Promise:s("lie"),o.exports={Promise:u}},{lie:37}],7:[function(s,o,c){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=s("pako"),l=s("./utils"),f=s("./stream/GenericWorker"),m=u?"uint8array":"array";function p(b,w){f.call(this,"FlateWorker/"+b),this._pako=null,this._pakoAction=b,this._pakoOptions=w,this.meta={}}c.magic="\b\0",l.inherits(p,f),p.prototype.processChunk=function(b){this.meta=b.meta,this._pako===null&&this._createPako(),this._pako.push(l.transformTo(m,b.data),!1)},p.prototype.flush=function(){f.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},p.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this._pako=null},p.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var b=this;this._pako.onData=function(w){b.push({data:w,meta:b.meta})}},c.compressWorker=function(b){return new p("Deflate",b)},c.uncompressWorker=function(){return new p("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(s,o,c){function u(h,M){var x,j="";for(x=0;x<M;x++)j+=String.fromCharCode(255&h),h>>>=8;return j}function d(h,M,x,j,_,E){var C,A,D=h.file,F=h.compression,O=E!==m.utf8encode,q=l.transformTo("string",E(D.name)),P=l.transformTo("string",m.utf8encode(D.name)),U=D.comment,K=l.transformTo("string",E(U)),$=l.transformTo("string",m.utf8encode(U)),Q=P.length!==D.name.length,N=$.length!==U.length,W="",ae="",ue="",be=D.dir,de=D.date,ie={crc32:0,compressedSize:0,uncompressedSize:0};M&&!x||(ie.crc32=h.crc32,ie.compressedSize=h.compressedSize,ie.uncompressedSize=h.uncompressedSize);var V=0;M&&(V|=8),O||!Q&&!N||(V|=2048);var G=0,me=0;be&&(G|=16),_==="UNIX"?(me=798,G|=(function(xe,Fe){var qe=xe;return xe||(qe=Fe?16893:33204),(65535&qe)<<16})(D.unixPermissions,be)):(me=20,G|=(function(xe){return 63&(xe||0)})(D.dosPermissions)),C=de.getUTCHours(),C<<=6,C|=de.getUTCMinutes(),C<<=5,C|=de.getUTCSeconds()/2,A=de.getUTCFullYear()-1980,A<<=4,A|=de.getUTCMonth()+1,A<<=5,A|=de.getUTCDate(),Q&&(ae=u(1,1)+u(p(q),4)+P,W+="up"+u(ae.length,2)+ae),N&&(ue=u(1,1)+u(p(K),4)+$,W+="uc"+u(ue.length,2)+ue);var ee="";return ee+=`
|
|
27
|
-
\0`,ee+=u(V,2),ee+=F.magic,ee+=u(C,2),ee+=u(A,2),ee+=u(ie.crc32,4),ee+=u(ie.compressedSize,4),ee+=u(ie.uncompressedSize,4),ee+=u(q.length,2),ee+=u(W.length,2),{fileRecord:b.LOCAL_FILE_HEADER+ee+q+W,dirRecord:b.CENTRAL_FILE_HEADER+u(me,2)+ee+u(K.length,2)+"\0\0\0\0"+u(G,4)+u(j,4)+q+W+K}}var l=s("../utils"),f=s("../stream/GenericWorker"),m=s("../utf8"),p=s("../crc32"),b=s("../signature");function w(h,M,x,j){f.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=M,this.zipPlatform=x,this.encodeFileName=j,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(w,f),w.prototype.push=function(h){var M=h.meta.percent||0,x=this.entriesCount,j=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,f.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:x?(M+100*(x-j-1))/x:100}}))},w.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var M=this.streamFiles&&!h.file.dir;if(M){var x=d(h,M,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:x.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(h){this.accumulate=!1;var M=this.streamFiles&&!h.file.dir,x=d(h,M,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(x.dirRecord),M)this.push({data:(function(j){return b.DATA_DESCRIPTOR+u(j.crc32,4)+u(j.compressedSize,4)+u(j.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:x.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var h=this.bytesWritten,M=0;M<this.dirRecords.length;M++)this.push({data:this.dirRecords[M],meta:{percent:100}});var x=this.bytesWritten-h,j=(function(_,E,C,A,D){var F=l.transformTo("string",D(A));return b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(_,2)+u(_,2)+u(E,4)+u(C,4)+u(F.length,2)+F})(this.dirRecords.length,x,h,this.zipComment,this.encodeFileName);this.push({data:j,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(h){this._sources.push(h);var M=this;return h.on("data",function(x){M.processChunk(x)}),h.on("end",function(){M.closedSource(M.previous.streamInfo),M._sources.length?M.prepareNextSource():M.end()}),h.on("error",function(x){M.error(x)}),this},w.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(h){var M=this._sources;if(!f.prototype.error.call(this,h))return!1;for(var x=0;x<M.length;x++)try{M[x].error(h)}catch{}return!0},w.prototype.lock=function(){f.prototype.lock.call(this);for(var h=this._sources,M=0;M<h.length;M++)h[M].lock()},o.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(s,o,c){var u=s("../compressions"),d=s("./ZipFileWorker");c.generateWorker=function(l,f,m){var p=new d(f.streamFiles,m,f.platform,f.encodeFileName),b=0;try{l.forEach(function(w,h){b++;var M=(function(E,C){var A=E||C,D=u[A];if(!D)throw new Error(A+" is not a valid compression method !");return D})(h.options.compression,f.compression),x=h.options.compressionOptions||f.compressionOptions||{},j=h.dir,_=h.date;h._compressWorker(M,x).withStreamInfo("file",{name:w,dir:j,date:_,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(p)}),p.entriesCount=b}catch(w){p.error(w)}return p}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(s,o,c){function u(){if(!(this instanceof u))return new u;if(arguments.length)throw new 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 d=new u;for(var l in this)typeof this[l]!="function"&&(d[l]=this[l]);return d}}(u.prototype=s("./object")).loadAsync=s("./load"),u.support=s("./support"),u.defaults=s("./defaults"),u.version="3.10.1",u.loadAsync=function(d,l){return new u().loadAsync(d,l)},u.external=s("./external"),o.exports=u},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(s,o,c){var u=s("./utils"),d=s("./external"),l=s("./utf8"),f=s("./zipEntries"),m=s("./stream/Crc32Probe"),p=s("./nodejsUtils");function b(w){return new d.Promise(function(h,M){var x=w.decompressed.getContentWorker().pipe(new m);x.on("error",function(j){M(j)}).on("end",function(){x.streamInfo.crc32!==w.decompressed.crc32?M(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}o.exports=function(w,h){var M=this;return h=u.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:l.utf8decode}),p.isNode&&p.isStream(w)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",w,!0,h.optimizedBinaryString,h.base64).then(function(x){var j=new f(h);return j.load(x),j}).then(function(x){var j=[d.Promise.resolve(x)],_=x.files;if(h.checkCRC32)for(var E=0;E<_.length;E++)j.push(b(_[E]));return d.Promise.all(j)}).then(function(x){for(var j=x.shift(),_=j.files,E=0;E<_.length;E++){var C=_[E],A=C.fileNameStr,D=u.resolve(C.fileNameStr);M.file(D,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:h.createFolders}),C.dir||(M.file(D).unsafeOriginalName=A)}return j.zipComment.length&&(M.comment=j.zipComment),M})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(s,o,c){var u=s("../utils"),d=s("../stream/GenericWorker");function l(f,m){d.call(this,"Nodejs stream input adapter for "+f),this._upstreamEnded=!1,this._bindStream(m)}u.inherits(l,d),l.prototype._bindStream=function(f){var m=this;(this._stream=f).pause(),f.on("data",function(p){m.push({data:p,meta:{percent:0}})}).on("error",function(p){m.isPaused?this.generatedError=p:m.error(p)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},l.prototype.pause=function(){return!!d.prototype.pause.call(this)&&(this._stream.pause(),!0)},l.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},o.exports=l},{"../stream/GenericWorker":28,"../utils":32}],13:[function(s,o,c){var u=s("readable-stream").Readable;function d(l,f,m){u.call(this,f),this._helper=l;var p=this;l.on("data",function(b,w){p.push(b)||p._helper.pause(),m&&m(w)}).on("error",function(b){p.emit("error",b)}).on("end",function(){p.push(null)})}s("../utils").inherits(d,u),d.prototype._read=function(){this._helper.resume()},o.exports=d},{"../utils":32,"readable-stream":16}],14:[function(s,o,c){o.exports={isNode:typeof Buffer<"u",newBufferFrom:function(u,d){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(u,d);if(typeof u=="number")throw new Error('The "data" argument must not be a number');return new Buffer(u,d)},allocBuffer:function(u){if(Buffer.alloc)return Buffer.alloc(u);var d=new Buffer(u);return d.fill(0),d},isBuffer:function(u){return Buffer.isBuffer(u)},isStream:function(u){return u&&typeof u.on=="function"&&typeof u.pause=="function"&&typeof u.resume=="function"}}},{}],15:[function(s,o,c){function u(D,F,O){var q,P=l.getTypeOf(F),U=l.extend(O||{},p);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(D=_(D)),U.createFolders&&(q=j(D))&&E.call(this,q,!0);var K=P==="string"&&U.binary===!1&&U.base64===!1;O&&O.binary!==void 0||(U.binary=!K),(F instanceof b&&F.uncompressedSize===0||U.dir||!F||F.length===0)&&(U.base64=!1,U.binary=!0,F="",U.compression="STORE",P="string");var $=null;$=F instanceof b||F instanceof f?F:M.isNode&&M.isStream(F)?new x(D,F):l.prepareContent(D,F,U.binary,U.optimizedBinaryString,U.base64);var Q=new w(D,$,U);this.files[D]=Q}var d=s("./utf8"),l=s("./utils"),f=s("./stream/GenericWorker"),m=s("./stream/StreamHelper"),p=s("./defaults"),b=s("./compressedObject"),w=s("./zipObject"),h=s("./generate"),M=s("./nodejsUtils"),x=s("./nodejs/NodejsStreamInputAdapter"),j=function(D){D.slice(-1)==="/"&&(D=D.substring(0,D.length-1));var F=D.lastIndexOf("/");return 0<F?D.substring(0,F):""},_=function(D){return D.slice(-1)!=="/"&&(D+="/"),D},E=function(D,F){return F=F!==void 0?F:p.createFolders,D=_(D),this.files[D]||u.call(this,D,null,{dir:!0,createFolders:F}),this.files[D]};function C(D){return Object.prototype.toString.call(D)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(D){var F,O,q;for(F in this.files)q=this.files[F],(O=F.slice(this.root.length,F.length))&&F.slice(0,this.root.length)===this.root&&D(O,q)},filter:function(D){var F=[];return this.forEach(function(O,q){D(O,q)&&F.push(q)}),F},file:function(D,F,O){if(arguments.length!==1)return D=this.root+D,u.call(this,D,F,O),this;if(C(D)){var q=D;return this.filter(function(U,K){return!K.dir&&q.test(U)})}var P=this.files[this.root+D];return P&&!P.dir?P:null},folder:function(D){if(!D)return this;if(C(D))return this.filter(function(P,U){return U.dir&&D.test(P)});var F=this.root+D,O=E.call(this,F),q=this.clone();return q.root=O.name,q},remove:function(D){D=this.root+D;var F=this.files[D];if(F||(D.slice(-1)!=="/"&&(D+="/"),F=this.files[D]),F&&!F.dir)delete this.files[D];else for(var O=this.filter(function(P,U){return U.name.slice(0,D.length)===D}),q=0;q<O.length;q++)delete this.files[O[q].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(D){var F,O={};try{if((O=l.extend(D||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");l.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var q=O.comment||this.comment||"";F=h.generateWorker(this,O,q)}catch(P){(F=new f("error")).error(P)}return new m(F,O.type||"string",O.mimeType)},generateAsync:function(D,F){return this.generateInternalStream(D).accumulate(F)},generateNodeStream:function(D,F){return(D=D||{}).type||(D.type="nodebuffer"),this.generateInternalStream(D).toNodejsStream(F)}};o.exports=A},{"./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(s,o,c){o.exports=s("stream")},{stream:void 0}],17:[function(s,o,c){var u=s("./DataReader");function d(l){u.call(this,l);for(var f=0;f<this.data.length;f++)l[f]=255&l[f]}s("../utils").inherits(d,u),d.prototype.byteAt=function(l){return this.data[this.zero+l]},d.prototype.lastIndexOfSignature=function(l){for(var f=l.charCodeAt(0),m=l.charCodeAt(1),p=l.charCodeAt(2),b=l.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===f&&this.data[w+1]===m&&this.data[w+2]===p&&this.data[w+3]===b)return w-this.zero;return-1},d.prototype.readAndCheckSignature=function(l){var f=l.charCodeAt(0),m=l.charCodeAt(1),p=l.charCodeAt(2),b=l.charCodeAt(3),w=this.readData(4);return f===w[0]&&m===w[1]&&p===w[2]&&b===w[3]},d.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./DataReader":18}],18:[function(s,o,c){var u=s("../utils");function d(l){this.data=l,this.length=l.length,this.index=0,this.zero=0}d.prototype={checkOffset:function(l){this.checkIndex(this.index+l)},checkIndex:function(l){if(this.length<this.zero+l||l<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+l+"). Corrupted zip ?")},setIndex:function(l){this.checkIndex(l),this.index=l},skip:function(l){this.setIndex(this.index+l)},byteAt:function(){},readInt:function(l){var f,m=0;for(this.checkOffset(l),f=this.index+l-1;f>=this.index;f--)m=(m<<8)+this.byteAt(f);return this.index+=l,m},readString:function(l){return u.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},o.exports=d},{"../utils":32}],19:[function(s,o,c){var u=s("./Uint8ArrayReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.readData=function(l){this.checkOffset(l);var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(s,o,c){var u=s("./DataReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},d.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},d.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},d.prototype.readData=function(l){this.checkOffset(l);var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./DataReader":18}],21:[function(s,o,c){var u=s("./ArrayReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var f=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(s,o,c){var u=s("../utils"),d=s("../support"),l=s("./ArrayReader"),f=s("./StringReader"),m=s("./NodeBufferReader"),p=s("./Uint8ArrayReader");o.exports=function(b){var w=u.getTypeOf(b);return u.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new m(b):d.uint8array?new p(u.transformTo("uint8array",b)):new l(u.transformTo("array",b)):new f(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(s,o,c){c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(s,o,c){var u=s("./GenericWorker"),d=s("../utils");function l(f){u.call(this,"ConvertWorker to "+f),this.destType=f}d.inherits(l,u),l.prototype.processChunk=function(f){this.push({data:d.transformTo(this.destType,f.data),meta:f.meta})},o.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(s,o,c){var u=s("./GenericWorker"),d=s("../crc32");function l(){u.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s("../utils").inherits(l,u),l.prototype.processChunk=function(f){this.streamInfo.crc32=d(f.data,this.streamInfo.crc32||0),this.push(f)},o.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(s,o,c){var u=s("../utils"),d=s("./GenericWorker");function l(f){d.call(this,"DataLengthProbe for "+f),this.propName=f,this.withStreamInfo(f,0)}u.inherits(l,d),l.prototype.processChunk=function(f){if(f){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+f.data.length}d.prototype.processChunk.call(this,f)},o.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(s,o,c){var u=s("../utils"),d=s("./GenericWorker");function l(f){d.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,f.then(function(p){m.dataIsReady=!0,m.data=p,m.max=p&&p.length||0,m.type=u.getTypeOf(p),m.isPaused||m._tickAndRepeat()},function(p){m.error(p)})}u.inherits(l,d),l.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,u.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(u.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var f=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":f=this.data.substring(this.index,m);break;case"uint8array":f=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":f=this.data.slice(this.index,m)}return this.index=m,this.push({data:f,meta:{percent:this.max?this.index/this.max*100:0}})},o.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(s,o,c){function u(d){this.name=d||"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}u.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,l){return this._listeners[d].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,l){if(this._listeners[d])for(var f=0;f<this._listeners[d].length;f++)this._listeners[d][f].call(this,l)},pipe:function(d){return d.registerPrevious(this)},registerPrevious:function(d){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=d.streamInfo,this.mergeStreamInfo(),this.previous=d;var l=this;return d.on("data",function(f){l.processChunk(f)}),d.on("end",function(){l.end()}),d.on("error",function(f){l.error(f)}),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 d=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),d=!0),this.previous&&this.previous.resume(),!d},flush:function(){},processChunk:function(d){this.push(d)},withStreamInfo:function(d,l){return this.extraStreamInfo[d]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var d in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,d)&&(this.streamInfo[d]=this.extraStreamInfo[d])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var d="Worker "+this.name;return this.previous?this.previous+" -> "+d:d}},o.exports=u},{}],29:[function(s,o,c){var u=s("../utils"),d=s("./ConvertWorker"),l=s("./GenericWorker"),f=s("../base64"),m=s("../support"),p=s("../external"),b=null;if(m.nodestream)try{b=s("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(M,x){return new p.Promise(function(j,_){var E=[],C=M._internalType,A=M._outputType,D=M._mimeType;M.on("data",function(F,O){E.push(F),x&&x(O)}).on("error",function(F){E=[],_(F)}).on("end",function(){try{var F=(function(O,q,P){switch(O){case"blob":return u.newBlob(u.transformTo("arraybuffer",q),P);case"base64":return f.encode(q);default:return u.transformTo(O,q)}})(A,(function(O,q){var P,U=0,K=null,$=0;for(P=0;P<q.length;P++)$+=q[P].length;switch(O){case"string":return q.join("");case"array":return Array.prototype.concat.apply([],q);case"uint8array":for(K=new Uint8Array($),P=0;P<q.length;P++)K.set(q[P],U),U+=q[P].length;return K;case"nodebuffer":return Buffer.concat(q);default:throw new Error("concat : unsupported type '"+O+"'")}})(C,E),D);j(F)}catch(O){_(O)}E=[]}).resume()})}function h(M,x,j){var _=x;switch(x){case"blob":case"arraybuffer":_="uint8array";break;case"base64":_="string"}try{this._internalType=_,this._outputType=x,this._mimeType=j,u.checkSupport(_),this._worker=M.pipe(new d(_)),M.lock()}catch(E){this._worker=new l("error"),this._worker.error(E)}}h.prototype={accumulate:function(M){return w(this,M)},on:function(M,x){var j=this;return M==="data"?this._worker.on(M,function(_){x.call(j,_.data,_.meta)}):this._worker.on(M,function(){u.delay(x,arguments,j)}),this},resume:function(){return u.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(M){if(u.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new b(this,{objectMode:this._outputType!=="nodebuffer"},M)}},o.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(s,o,c){if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",c.nodebuffer=typeof Buffer<"u",c.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")c.blob=!1;else{var u=new ArrayBuffer(0);try{c.blob=new Blob([u],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(u),c.blob=d.getBlob("application/zip").size===0}catch{c.blob=!1}}}try{c.nodestream=!!s("readable-stream").Readable}catch{c.nodestream=!1}},{"readable-stream":16}],31:[function(s,o,c){for(var u=s("./utils"),d=s("./support"),l=s("./nodejsUtils"),f=s("./stream/GenericWorker"),m=new Array(256),p=0;p<256;p++)m[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;m[254]=m[254]=1;function b(){f.call(this,"utf-8 decode"),this.leftOver=null}function w(){f.call(this,"utf-8 encode")}c.utf8encode=function(h){return d.nodebuffer?l.newBufferFrom(h,"utf-8"):(function(M){var x,j,_,E,C,A=M.length,D=0;for(E=0;E<A;E++)(64512&(j=M.charCodeAt(E)))==55296&&E+1<A&&(64512&(_=M.charCodeAt(E+1)))==56320&&(j=65536+(j-55296<<10)+(_-56320),E++),D+=j<128?1:j<2048?2:j<65536?3:4;for(x=d.uint8array?new Uint8Array(D):new Array(D),E=C=0;C<D;E++)(64512&(j=M.charCodeAt(E)))==55296&&E+1<A&&(64512&(_=M.charCodeAt(E+1)))==56320&&(j=65536+(j-55296<<10)+(_-56320),E++),j<128?x[C++]=j:(j<2048?x[C++]=192|j>>>6:(j<65536?x[C++]=224|j>>>12:(x[C++]=240|j>>>18,x[C++]=128|j>>>12&63),x[C++]=128|j>>>6&63),x[C++]=128|63&j);return x})(h)},c.utf8decode=function(h){return d.nodebuffer?u.transformTo("nodebuffer",h).toString("utf-8"):(function(M){var x,j,_,E,C=M.length,A=new Array(2*C);for(x=j=0;x<C;)if((_=M[x++])<128)A[j++]=_;else if(4<(E=m[_]))A[j++]=65533,x+=E-1;else{for(_&=E===2?31:E===3?15:7;1<E&&x<C;)_=_<<6|63&M[x++],E--;1<E?A[j++]=65533:_<65536?A[j++]=_:(_-=65536,A[j++]=55296|_>>10&1023,A[j++]=56320|1023&_)}return A.length!==j&&(A.subarray?A=A.subarray(0,j):A.length=j),u.applyFromCharCode(A)})(h=u.transformTo(d.uint8array?"uint8array":"array",h))},u.inherits(b,f),b.prototype.processChunk=function(h){var M=u.transformTo(d.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var x=M;(M=new Uint8Array(x.length+this.leftOver.length)).set(this.leftOver,0),M.set(x,this.leftOver.length)}else M=this.leftOver.concat(M);this.leftOver=null}var j=(function(E,C){var A;for((C=C||E.length)>E.length&&(C=E.length),A=C-1;0<=A&&(192&E[A])==128;)A--;return A<0||A===0?C:A+m[E[A]]>C?A:C})(M),_=M;j!==M.length&&(d.uint8array?(_=M.subarray(0,j),this.leftOver=M.subarray(j,M.length)):(_=M.slice(0,j),this.leftOver=M.slice(j,M.length))),this.push({data:c.utf8decode(_),meta:h.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},c.Utf8DecodeWorker=b,u.inherits(w,f),w.prototype.processChunk=function(h){this.push({data:c.utf8encode(h.data),meta:h.meta})},c.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(s,o,c){var u=s("./support"),d=s("./base64"),l=s("./nodejsUtils"),f=s("./external");function m(x){return x}function p(x,j){for(var _=0;_<x.length;++_)j[_]=255&x.charCodeAt(_);return j}s("setimmediate"),c.newBlob=function(x,j){c.checkSupport("blob");try{return new Blob([x],{type:j})}catch{try{var _=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return _.append(x),_.getBlob(j)}catch{throw new Error("Bug : can't construct the Blob.")}}};var b={stringifyByChunk:function(x,j,_){var E=[],C=0,A=x.length;if(A<=_)return String.fromCharCode.apply(null,x);for(;C<A;)j==="array"||j==="nodebuffer"?E.push(String.fromCharCode.apply(null,x.slice(C,Math.min(C+_,A)))):E.push(String.fromCharCode.apply(null,x.subarray(C,Math.min(C+_,A)))),C+=_;return E.join("")},stringifyByChar:function(x){for(var j="",_=0;_<x.length;_++)j+=String.fromCharCode(x[_]);return j},applyCanBeUsed:{uint8array:(function(){try{return u.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return u.nodebuffer&&String.fromCharCode.apply(null,l.allocBuffer(1)).length===1}catch{return!1}})()}};function w(x){var j=65536,_=c.getTypeOf(x),E=!0;if(_==="uint8array"?E=b.applyCanBeUsed.uint8array:_==="nodebuffer"&&(E=b.applyCanBeUsed.nodebuffer),E)for(;1<j;)try{return b.stringifyByChunk(x,_,j)}catch{j=Math.floor(j/2)}return b.stringifyByChar(x)}function h(x,j){for(var _=0;_<x.length;_++)j[_]=x[_];return j}c.applyFromCharCode=w;var M={};M.string={string:m,array:function(x){return p(x,new Array(x.length))},arraybuffer:function(x){return M.string.uint8array(x).buffer},uint8array:function(x){return p(x,new Uint8Array(x.length))},nodebuffer:function(x){return p(x,l.allocBuffer(x.length))}},M.array={string:w,array:m,arraybuffer:function(x){return new Uint8Array(x).buffer},uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return l.newBufferFrom(x)}},M.arraybuffer={string:function(x){return w(new Uint8Array(x))},array:function(x){return h(new Uint8Array(x),new Array(x.byteLength))},arraybuffer:m,uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return l.newBufferFrom(new Uint8Array(x))}},M.uint8array={string:w,array:function(x){return h(x,new Array(x.length))},arraybuffer:function(x){return x.buffer},uint8array:m,nodebuffer:function(x){return l.newBufferFrom(x)}},M.nodebuffer={string:w,array:function(x){return h(x,new Array(x.length))},arraybuffer:function(x){return M.nodebuffer.uint8array(x).buffer},uint8array:function(x){return h(x,new Uint8Array(x.length))},nodebuffer:m},c.transformTo=function(x,j){if(j=j||"",!x)return j;c.checkSupport(x);var _=c.getTypeOf(j);return M[_][x](j)},c.resolve=function(x){for(var j=x.split("/"),_=[],E=0;E<j.length;E++){var C=j[E];C==="."||C===""&&E!==0&&E!==j.length-1||(C===".."?_.pop():_.push(C))}return _.join("/")},c.getTypeOf=function(x){return typeof x=="string"?"string":Object.prototype.toString.call(x)==="[object Array]"?"array":u.nodebuffer&&l.isBuffer(x)?"nodebuffer":u.uint8array&&x instanceof Uint8Array?"uint8array":u.arraybuffer&&x instanceof ArrayBuffer?"arraybuffer":void 0},c.checkSupport=function(x){if(!u[x.toLowerCase()])throw new Error(x+" is not supported by this platform")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(x){var j,_,E="";for(_=0;_<(x||"").length;_++)E+="\\x"+((j=x.charCodeAt(_))<16?"0":"")+j.toString(16).toUpperCase();return E},c.delay=function(x,j,_){setImmediate(function(){x.apply(_||null,j||[])})},c.inherits=function(x,j){function _(){}_.prototype=j.prototype,x.prototype=new _},c.extend=function(){var x,j,_={};for(x=0;x<arguments.length;x++)for(j in arguments[x])Object.prototype.hasOwnProperty.call(arguments[x],j)&&_[j]===void 0&&(_[j]=arguments[x][j]);return _},c.prepareContent=function(x,j,_,E,C){return f.Promise.resolve(j).then(function(A){return u.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1)&&typeof FileReader<"u"?new f.Promise(function(D,F){var O=new FileReader;O.onload=function(q){D(q.target.result)},O.onerror=function(q){F(q.target.error)},O.readAsArrayBuffer(A)}):A}).then(function(A){var D=c.getTypeOf(A);return D?(D==="arraybuffer"?A=c.transformTo("uint8array",A):D==="string"&&(C?A=d.decode(A):_&&E!==!0&&(A=(function(F){return p(F,u.uint8array?new Uint8Array(F.length):new Array(F.length))})(A))),A):f.Promise.reject(new Error("Can't read the data of '"+x+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(s,o,c){var u=s("./reader/readerFor"),d=s("./utils"),l=s("./signature"),f=s("./zipEntry"),m=s("./support");function p(b){this.files=[],this.loadOptions=b}p.prototype={checkSignature:function(b){if(!this.reader.readAndCheckSignature(b)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(w)+", expected "+d.pretty(b)+")")}},isSignature:function(b,w){var h=this.reader.index;this.reader.setIndex(b);var M=this.reader.readString(4)===w;return this.reader.setIndex(h),M},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 b=this.reader.readData(this.zipCommentLength),w=m.uint8array?"uint8array":"array",h=d.transformTo(w,b);this.zipComment=this.loadOptions.decodeFileName(h)},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 b,w,h,M=this.zip64EndOfCentralSize-44;0<M;)b=this.reader.readInt(2),w=this.reader.readInt(4),h=this.reader.readData(w),this.zip64ExtensibleData[b]={id:b,length:w,value:h}},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 new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var b,w;for(b=0;b<this.files.length;b++)w=this.files[b],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(l.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var b;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(l.CENTRAL_FILE_HEADER);)(b=new f({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(b);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var b=this.reader.lastIndexOfSignature(l.CENTRAL_DIRECTORY_END);if(b<0)throw this.isSignature(0,l.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new 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(b);var w=b;if(this.checkSignature(l.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,(b=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(b),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,l.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var M=w-h;if(0<M)this.isSignature(w,l.CENTRAL_FILE_HEADER)||(this.reader.zero=M);else if(M<0)throw new Error("Corrupted zip: missing "+Math.abs(M)+" bytes.")},prepareReader:function(b){this.reader=u(b)},load:function(b){this.prepareReader(b),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},o.exports=p},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(s,o,c){var u=s("./reader/readerFor"),d=s("./utils"),l=s("./compressedObject"),f=s("./crc32"),m=s("./utf8"),p=s("./compressions"),b=s("./support");function w(h,M){this.options=h,this.loadOptions=M}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var M,x;if(h.skip(22),this.fileNameLength=h.readInt(2),x=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(x),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((M=(function(j){for(var _ in p)if(Object.prototype.hasOwnProperty.call(p,_)&&p[_].magic===j)return p[_];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new l(this.compressedSize,this.uncompressedSize,this.crc32,M,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var M=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(M),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=u(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var M,x,j,_=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<_;)M=h.readInt(2),x=h.readInt(2),j=h.readData(x),this.extraFields[M]={id:M,length:x,value:j};h.setIndex(_)},handleUTF8:function(){var h=b.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var M=this.findExtraFieldUnicodePath();if(M!==null)this.fileNameStr=M;else{var x=d.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(x)}var j=this.findExtraFieldUnicodeComment();if(j!==null)this.fileCommentStr=j;else{var _=d.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(_)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var M=u(h.value);return M.readInt(1)!==1||f(this.fileName)!==M.readInt(4)?null:m.utf8decode(M.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var M=u(h.value);return M.readInt(1)!==1||f(this.fileComment)!==M.readInt(4)?null:m.utf8decode(M.readData(h.length-5))}return null}},o.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(s,o,c){function u(M,x,j){this.name=M,this.dir=j.dir,this.date=j.date,this.comment=j.comment,this.unixPermissions=j.unixPermissions,this.dosPermissions=j.dosPermissions,this._data=x,this._dataBinary=j.binary,this.options={compression:j.compression,compressionOptions:j.compressionOptions}}var d=s("./stream/StreamHelper"),l=s("./stream/DataWorker"),f=s("./utf8"),m=s("./compressedObject"),p=s("./stream/GenericWorker");u.prototype={internalStream:function(M){var x=null,j="string";try{if(!M)throw new Error("No output type specified.");var _=(j=M.toLowerCase())==="string"||j==="text";j!=="binarystring"&&j!=="text"||(j="string"),x=this._decompressWorker();var E=!this._dataBinary;E&&!_&&(x=x.pipe(new f.Utf8EncodeWorker)),!E&&_&&(x=x.pipe(new f.Utf8DecodeWorker))}catch(C){(x=new p("error")).error(C)}return new d(x,j,"")},async:function(M,x){return this.internalStream(M).accumulate(x)},nodeStream:function(M,x){return this.internalStream(M||"nodebuffer").toNodejsStream(x)},_compressWorker:function(M,x){if(this._data instanceof m&&this._data.compression.magic===M.magic)return this._data.getCompressedWorker();var j=this._decompressWorker();return this._dataBinary||(j=j.pipe(new f.Utf8EncodeWorker)),m.createWorkerFrom(j,M,x)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWorker():this._data instanceof p?this._data:new l(this._data)}};for(var b=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<b.length;h++)u.prototype[b[h]]=w;o.exports=u},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(s,o,c){(function(u){var d,l,f=u.MutationObserver||u.WebKitMutationObserver;if(f){var m=0,p=new f(M),b=u.document.createTextNode("");p.observe(b,{characterData:!0}),d=function(){b.data=m=++m%2}}else if(u.setImmediate||u.MessageChannel===void 0)d="document"in u&&"onreadystatechange"in u.document.createElement("script")?function(){var x=u.document.createElement("script");x.onreadystatechange=function(){M(),x.onreadystatechange=null,x.parentNode.removeChild(x),x=null},u.document.documentElement.appendChild(x)}:function(){setTimeout(M,0)};else{var w=new u.MessageChannel;w.port1.onmessage=M,d=function(){w.port2.postMessage(0)}}var h=[];function M(){var x,j;l=!0;for(var _=h.length;_;){for(j=h,h=[],x=-1;++x<_;)j[x]();_=h.length}l=!1}o.exports=function(x){h.push(x)!==1||l||d()}}).call(this,typeof Or<"u"?Or:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(s,o,c){var u=s("immediate");function d(){}var l={},f=["REJECTED"],m=["FULFILLED"],p=["PENDING"];function b(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,_!==d&&x(this,_)}function w(_,E,C){this.promise=_,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function h(_,E,C){u(function(){var A;try{A=E(C)}catch(D){return l.reject(_,D)}A===_?l.reject(_,new TypeError("Cannot resolve promise with itself")):l.resolve(_,A)})}function M(_){var E=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof E=="function")return function(){E.apply(_,arguments)}}function x(_,E){var C=!1;function A(O){C||(C=!0,l.reject(_,O))}function D(O){C||(C=!0,l.resolve(_,O))}var F=j(function(){E(D,A)});F.status==="error"&&A(F.value)}function j(_,E){var C={};try{C.value=_(E),C.status="success"}catch(A){C.status="error",C.value=A}return C}(o.exports=b).prototype.finally=function(_){if(typeof _!="function")return this;var E=this.constructor;return this.then(function(C){return E.resolve(_()).then(function(){return C})},function(C){return E.resolve(_()).then(function(){throw C})})},b.prototype.catch=function(_){return this.then(null,_)},b.prototype.then=function(_,E){if(typeof _!="function"&&this.state===m||typeof E!="function"&&this.state===f)return this;var C=new this.constructor(d);return this.state!==p?h(C,this.state===m?_:E,this.outcome):this.queue.push(new w(C,_,E)),C},w.prototype.callFulfilled=function(_){l.resolve(this.promise,_)},w.prototype.otherCallFulfilled=function(_){h(this.promise,this.onFulfilled,_)},w.prototype.callRejected=function(_){l.reject(this.promise,_)},w.prototype.otherCallRejected=function(_){h(this.promise,this.onRejected,_)},l.resolve=function(_,E){var C=j(M,E);if(C.status==="error")return l.reject(_,C.value);var A=C.value;if(A)x(_,A);else{_.state=m,_.outcome=E;for(var D=-1,F=_.queue.length;++D<F;)_.queue[D].callFulfilled(E)}return _},l.reject=function(_,E){_.state=f,_.outcome=E;for(var C=-1,A=_.queue.length;++C<A;)_.queue[C].callRejected(E);return _},b.resolve=function(_){return _ instanceof this?_:l.resolve(new this(d),_)},b.reject=function(_){var E=new this(d);return l.reject(E,_)},b.all=function(_){var E=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=_.length,A=!1;if(!C)return this.resolve([]);for(var D=new Array(C),F=0,O=-1,q=new this(d);++O<C;)P(_[O],O);return q;function P(U,K){E.resolve(U).then(function($){D[K]=$,++F!==C||A||(A=!0,l.resolve(q,D))},function($){A||(A=!0,l.reject(q,$))})}},b.race=function(_){var E=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=_.length,A=!1;if(!C)return this.resolve([]);for(var D=-1,F=new this(d);++D<C;)O=_[D],E.resolve(O).then(function(q){A||(A=!0,l.resolve(F,q))},function(q){A||(A=!0,l.reject(F,q))});var O;return F}},{immediate:36}],38:[function(s,o,c){var u={};(0,s("./lib/utils/common").assign)(u,s("./lib/deflate"),s("./lib/inflate"),s("./lib/zlib/constants")),o.exports=u},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(s,o,c){var u=s("./zlib/deflate"),d=s("./utils/common"),l=s("./utils/strings"),f=s("./zlib/messages"),m=s("./zlib/zstream"),p=Object.prototype.toString,b=0,w=-1,h=0,M=8;function x(_){if(!(this instanceof x))return new x(_);this.options=d.assign({level:w,method:M,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},_||{});var E=this.options;E.raw&&0<E.windowBits?E.windowBits=-E.windowBits:E.gzip&&0<E.windowBits&&E.windowBits<16&&(E.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var C=u.deflateInit2(this.strm,E.level,E.method,E.windowBits,E.memLevel,E.strategy);if(C!==b)throw new Error(f[C]);if(E.header&&u.deflateSetHeader(this.strm,E.header),E.dictionary){var A;if(A=typeof E.dictionary=="string"?l.string2buf(E.dictionary):p.call(E.dictionary)==="[object ArrayBuffer]"?new Uint8Array(E.dictionary):E.dictionary,(C=u.deflateSetDictionary(this.strm,A))!==b)throw new Error(f[C]);this._dict_set=!0}}function j(_,E){var C=new x(E);if(C.push(_,!0),C.err)throw C.msg||f[C.err];return C.result}x.prototype.push=function(_,E){var C,A,D=this.strm,F=this.options.chunkSize;if(this.ended)return!1;A=E===~~E?E:E===!0?4:0,typeof _=="string"?D.input=l.string2buf(_):p.call(_)==="[object ArrayBuffer]"?D.input=new Uint8Array(_):D.input=_,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new d.Buf8(F),D.next_out=0,D.avail_out=F),(C=u.deflate(D,A))!==1&&C!==b)return this.onEnd(C),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||A!==4&&A!==2)||(this.options.to==="string"?this.onData(l.buf2binstring(d.shrinkBuf(D.output,D.next_out))):this.onData(d.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&C!==1);return A===4?(C=u.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===b):A!==2||(this.onEnd(b),!(D.avail_out=0))},x.prototype.onData=function(_){this.chunks.push(_)},x.prototype.onEnd=function(_){_===b&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},c.Deflate=x,c.deflate=j,c.deflateRaw=function(_,E){return(E=E||{}).raw=!0,j(_,E)},c.gzip=function(_,E){return(E=E||{}).gzip=!0,j(_,E)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(s,o,c){var u=s("./zlib/inflate"),d=s("./utils/common"),l=s("./utils/strings"),f=s("./zlib/constants"),m=s("./zlib/messages"),p=s("./zlib/zstream"),b=s("./zlib/gzheader"),w=Object.prototype.toString;function h(x){if(!(this instanceof h))return new h(x);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},x||{});var j=this.options;j.raw&&0<=j.windowBits&&j.windowBits<16&&(j.windowBits=-j.windowBits,j.windowBits===0&&(j.windowBits=-15)),!(0<=j.windowBits&&j.windowBits<16)||x&&x.windowBits||(j.windowBits+=32),15<j.windowBits&&j.windowBits<48&&(15&j.windowBits)==0&&(j.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new p,this.strm.avail_out=0;var _=u.inflateInit2(this.strm,j.windowBits);if(_!==f.Z_OK)throw new Error(m[_]);this.header=new b,u.inflateGetHeader(this.strm,this.header)}function M(x,j){var _=new h(j);if(_.push(x,!0),_.err)throw _.msg||m[_.err];return _.result}h.prototype.push=function(x,j){var _,E,C,A,D,F,O=this.strm,q=this.options.chunkSize,P=this.options.dictionary,U=!1;if(this.ended)return!1;E=j===~~j?j:j===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof x=="string"?O.input=l.binstring2buf(x):w.call(x)==="[object ArrayBuffer]"?O.input=new Uint8Array(x):O.input=x,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new d.Buf8(q),O.next_out=0,O.avail_out=q),(_=u.inflate(O,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&P&&(F=typeof P=="string"?l.string2buf(P):w.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,_=u.inflateSetDictionary(this.strm,F)),_===f.Z_BUF_ERROR&&U===!0&&(_=f.Z_OK,U=!1),_!==f.Z_STREAM_END&&_!==f.Z_OK)return this.onEnd(_),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&_!==f.Z_STREAM_END&&(O.avail_in!==0||E!==f.Z_FINISH&&E!==f.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=l.utf8border(O.output,O.next_out),A=O.next_out-C,D=l.buf2string(O.output,C),O.next_out=A,O.avail_out=q-A,A&&d.arraySet(O.output,O.output,C,A,0),this.onData(D)):this.onData(d.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(U=!0)}while((0<O.avail_in||O.avail_out===0)&&_!==f.Z_STREAM_END);return _===f.Z_STREAM_END&&(E=f.Z_FINISH),E===f.Z_FINISH?(_=u.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===f.Z_OK):E!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),!(O.avail_out=0))},h.prototype.onData=function(x){this.chunks.push(x)},h.prototype.onEnd=function(x){x===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},c.Inflate=h,c.inflate=M,c.inflateRaw=function(x,j){return(j=j||{}).raw=!0,M(x,j)},c.ungzip=M},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(s,o,c){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";c.assign=function(f){for(var m=Array.prototype.slice.call(arguments,1);m.length;){var p=m.shift();if(p){if(typeof p!="object")throw new TypeError(p+"must be non-object");for(var b in p)p.hasOwnProperty(b)&&(f[b]=p[b])}}return f},c.shrinkBuf=function(f,m){return f.length===m?f:f.subarray?f.subarray(0,m):(f.length=m,f)};var d={arraySet:function(f,m,p,b,w){if(m.subarray&&f.subarray)f.set(m.subarray(p,p+b),w);else for(var h=0;h<b;h++)f[w+h]=m[p+h]},flattenChunks:function(f){var m,p,b,w,h,M;for(m=b=0,p=f.length;m<p;m++)b+=f[m].length;for(M=new Uint8Array(b),m=w=0,p=f.length;m<p;m++)h=f[m],M.set(h,w),w+=h.length;return M}},l={arraySet:function(f,m,p,b,w){for(var h=0;h<b;h++)f[w+h]=m[p+h]},flattenChunks:function(f){return[].concat.apply([],f)}};c.setTyped=function(f){f?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,d)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,l))},c.setTyped(u)},{}],42:[function(s,o,c){var u=s("./common"),d=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch{d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{l=!1}for(var f=new u.Buf8(256),m=0;m<256;m++)f[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;function p(b,w){if(w<65537&&(b.subarray&&l||!b.subarray&&d))return String.fromCharCode.apply(null,u.shrinkBuf(b,w));for(var h="",M=0;M<w;M++)h+=String.fromCharCode(b[M]);return h}f[254]=f[254]=1,c.string2buf=function(b){var w,h,M,x,j,_=b.length,E=0;for(x=0;x<_;x++)(64512&(h=b.charCodeAt(x)))==55296&&x+1<_&&(64512&(M=b.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(M-56320),x++),E+=h<128?1:h<2048?2:h<65536?3:4;for(w=new u.Buf8(E),x=j=0;j<E;x++)(64512&(h=b.charCodeAt(x)))==55296&&x+1<_&&(64512&(M=b.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(M-56320),x++),h<128?w[j++]=h:(h<2048?w[j++]=192|h>>>6:(h<65536?w[j++]=224|h>>>12:(w[j++]=240|h>>>18,w[j++]=128|h>>>12&63),w[j++]=128|h>>>6&63),w[j++]=128|63&h);return w},c.buf2binstring=function(b){return p(b,b.length)},c.binstring2buf=function(b){for(var w=new u.Buf8(b.length),h=0,M=w.length;h<M;h++)w[h]=b.charCodeAt(h);return w},c.buf2string=function(b,w){var h,M,x,j,_=w||b.length,E=new Array(2*_);for(h=M=0;h<_;)if((x=b[h++])<128)E[M++]=x;else if(4<(j=f[x]))E[M++]=65533,h+=j-1;else{for(x&=j===2?31:j===3?15:7;1<j&&h<_;)x=x<<6|63&b[h++],j--;1<j?E[M++]=65533:x<65536?E[M++]=x:(x-=65536,E[M++]=55296|x>>10&1023,E[M++]=56320|1023&x)}return p(E,M)},c.utf8border=function(b,w){var h;for((w=w||b.length)>b.length&&(w=b.length),h=w-1;0<=h&&(192&b[h])==128;)h--;return h<0||h===0?w:h+f[b[h]]>w?h:w}},{"./common":41}],43:[function(s,o,c){o.exports=function(u,d,l,f){for(var m=65535&u|0,p=u>>>16&65535|0,b=0;l!==0;){for(l-=b=2e3<l?2e3:l;p=p+(m=m+d[f++]|0)|0,--b;);m%=65521,p%=65521}return m|p<<16|0}},{}],44:[function(s,o,c){o.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(s,o,c){var u=(function(){for(var d,l=[],f=0;f<256;f++){d=f;for(var m=0;m<8;m++)d=1&d?3988292384^d>>>1:d>>>1;l[f]=d}return l})();o.exports=function(d,l,f,m){var p=u,b=m+f;d^=-1;for(var w=m;w<b;w++)d=d>>>8^p[255&(d^l[w])];return-1^d}},{}],46:[function(s,o,c){var u,d=s("../utils/common"),l=s("./trees"),f=s("./adler32"),m=s("./crc32"),p=s("./messages"),b=0,w=4,h=0,M=-2,x=-1,j=4,_=2,E=8,C=9,A=286,D=30,F=19,O=2*A+1,q=15,P=3,U=258,K=U+P+1,$=42,Q=113,N=1,W=2,ae=3,ue=4;function be(T,ce){return T.msg=p[ce],ce}function de(T){return(T<<1)-(4<T?9:0)}function ie(T){for(var ce=T.length;0<=--ce;)T[ce]=0}function V(T){var ce=T.state,oe=ce.pending;oe>T.avail_out&&(oe=T.avail_out),oe!==0&&(d.arraySet(T.output,ce.pending_buf,ce.pending_out,oe,T.next_out),T.next_out+=oe,ce.pending_out+=oe,T.total_out+=oe,T.avail_out-=oe,ce.pending-=oe,ce.pending===0&&(ce.pending_out=0))}function G(T,ce){l._tr_flush_block(T,0<=T.block_start?T.block_start:-1,T.strstart-T.block_start,ce),T.block_start=T.strstart,V(T.strm)}function me(T,ce){T.pending_buf[T.pending++]=ce}function ee(T,ce){T.pending_buf[T.pending++]=ce>>>8&255,T.pending_buf[T.pending++]=255&ce}function xe(T,ce){var oe,Y,z=T.max_chain_length,te=T.strstart,pe=T.prev_length,fe=T.nice_match,re=T.strstart>T.w_size-K?T.strstart-(T.w_size-K):0,Me=T.window,Ne=T.w_mask,Se=T.prev,ze=T.strstart+U,gt=Me[te+pe-1],Qe=Me[te+pe];T.prev_length>=T.good_match&&(z>>=2),fe>T.lookahead&&(fe=T.lookahead);do if(Me[(oe=ce)+pe]===Qe&&Me[oe+pe-1]===gt&&Me[oe]===Me[te]&&Me[++oe]===Me[te+1]){te+=2,oe++;do;while(Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&te<ze);if(Y=U-(ze-te),te=ze-U,pe<Y){if(T.match_start=ce,fe<=(pe=Y))break;gt=Me[te+pe-1],Qe=Me[te+pe]}}while((ce=Se[ce&Ne])>re&&--z!=0);return pe<=T.lookahead?pe:T.lookahead}function Fe(T){var ce,oe,Y,z,te,pe,fe,re,Me,Ne,Se=T.w_size;do{if(z=T.window_size-T.lookahead-T.strstart,T.strstart>=Se+(Se-K)){for(d.arraySet(T.window,T.window,Se,Se,0),T.match_start-=Se,T.strstart-=Se,T.block_start-=Se,ce=oe=T.hash_size;Y=T.head[--ce],T.head[ce]=Se<=Y?Y-Se:0,--oe;);for(ce=oe=Se;Y=T.prev[--ce],T.prev[ce]=Se<=Y?Y-Se:0,--oe;);z+=Se}if(T.strm.avail_in===0)break;if(pe=T.strm,fe=T.window,re=T.strstart+T.lookahead,Me=z,Ne=void 0,Ne=pe.avail_in,Me<Ne&&(Ne=Me),oe=Ne===0?0:(pe.avail_in-=Ne,d.arraySet(fe,pe.input,pe.next_in,Ne,re),pe.state.wrap===1?pe.adler=f(pe.adler,fe,Ne,re):pe.state.wrap===2&&(pe.adler=m(pe.adler,fe,Ne,re)),pe.next_in+=Ne,pe.total_in+=Ne,Ne),T.lookahead+=oe,T.lookahead+T.insert>=P)for(te=T.strstart-T.insert,T.ins_h=T.window[te],T.ins_h=(T.ins_h<<T.hash_shift^T.window[te+1])&T.hash_mask;T.insert&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[te+P-1])&T.hash_mask,T.prev[te&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=te,te++,T.insert--,!(T.lookahead+T.insert<P)););}while(T.lookahead<K&&T.strm.avail_in!==0)}function qe(T,ce){for(var oe,Y;;){if(T.lookahead<K){if(Fe(T),T.lookahead<K&&ce===b)return N;if(T.lookahead===0)break}if(oe=0,T.lookahead>=P&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),oe!==0&&T.strstart-oe<=T.w_size-K&&(T.match_length=xe(T,oe)),T.match_length>=P)if(Y=l._tr_tally(T,T.strstart-T.match_start,T.match_length-P),T.lookahead-=T.match_length,T.match_length<=T.max_lazy_match&&T.lookahead>=P){for(T.match_length--;T.strstart++,T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart,--T.match_length!=0;);T.strstart++}else T.strstart+=T.match_length,T.match_length=0,T.ins_h=T.window[T.strstart],T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+1])&T.hash_mask;else Y=l._tr_tally(T,0,T.window[T.strstart]),T.lookahead--,T.strstart++;if(Y&&(G(T,!1),T.strm.avail_out===0))return N}return T.insert=T.strstart<P-1?T.strstart:P-1,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):T.last_lit&&(G(T,!1),T.strm.avail_out===0)?N:W}function Ue(T,ce){for(var oe,Y,z;;){if(T.lookahead<K){if(Fe(T),T.lookahead<K&&ce===b)return N;if(T.lookahead===0)break}if(oe=0,T.lookahead>=P&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),T.prev_length=T.match_length,T.prev_match=T.match_start,T.match_length=P-1,oe!==0&&T.prev_length<T.max_lazy_match&&T.strstart-oe<=T.w_size-K&&(T.match_length=xe(T,oe),T.match_length<=5&&(T.strategy===1||T.match_length===P&&4096<T.strstart-T.match_start)&&(T.match_length=P-1)),T.prev_length>=P&&T.match_length<=T.prev_length){for(z=T.strstart+T.lookahead-P,Y=l._tr_tally(T,T.strstart-1-T.prev_match,T.prev_length-P),T.lookahead-=T.prev_length-1,T.prev_length-=2;++T.strstart<=z&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),--T.prev_length!=0;);if(T.match_available=0,T.match_length=P-1,T.strstart++,Y&&(G(T,!1),T.strm.avail_out===0))return N}else if(T.match_available){if((Y=l._tr_tally(T,0,T.window[T.strstart-1]))&&G(T,!1),T.strstart++,T.lookahead--,T.strm.avail_out===0)return N}else T.match_available=1,T.strstart++,T.lookahead--}return T.match_available&&(Y=l._tr_tally(T,0,T.window[T.strstart-1]),T.match_available=0),T.insert=T.strstart<P-1?T.strstart:P-1,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):T.last_lit&&(G(T,!1),T.strm.avail_out===0)?N:W}function Xe(T,ce,oe,Y,z){this.good_length=T,this.max_lazy=ce,this.nice_length=oe,this.max_chain=Y,this.func=z}function we(){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=E,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 d.Buf16(2*O),this.dyn_dtree=new d.Buf16(2*(2*D+1)),this.bl_tree=new d.Buf16(2*(2*F+1)),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(q+1),this.heap=new d.Buf16(2*A+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*A+1),ie(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 Le(T){var ce;return T&&T.state?(T.total_in=T.total_out=0,T.data_type=_,(ce=T.state).pending=0,ce.pending_out=0,ce.wrap<0&&(ce.wrap=-ce.wrap),ce.status=ce.wrap?$:Q,T.adler=ce.wrap===2?0:1,ce.last_flush=b,l._tr_init(ce),h):be(T,M)}function Ie(T){var ce=Le(T);return ce===h&&(function(oe){oe.window_size=2*oe.w_size,ie(oe.head),oe.max_lazy_match=u[oe.level].max_lazy,oe.good_match=u[oe.level].good_length,oe.nice_match=u[oe.level].nice_length,oe.max_chain_length=u[oe.level].max_chain,oe.strstart=0,oe.block_start=0,oe.lookahead=0,oe.insert=0,oe.match_length=oe.prev_length=P-1,oe.match_available=0,oe.ins_h=0})(T.state),ce}function Ee(T,ce,oe,Y,z,te){if(!T)return M;var pe=1;if(ce===x&&(ce=6),Y<0?(pe=0,Y=-Y):15<Y&&(pe=2,Y-=16),z<1||C<z||oe!==E||Y<8||15<Y||ce<0||9<ce||te<0||j<te)return be(T,M);Y===8&&(Y=9);var fe=new we;return(T.state=fe).strm=T,fe.wrap=pe,fe.gzhead=null,fe.w_bits=Y,fe.w_size=1<<fe.w_bits,fe.w_mask=fe.w_size-1,fe.hash_bits=z+7,fe.hash_size=1<<fe.hash_bits,fe.hash_mask=fe.hash_size-1,fe.hash_shift=~~((fe.hash_bits+P-1)/P),fe.window=new d.Buf8(2*fe.w_size),fe.head=new d.Buf16(fe.hash_size),fe.prev=new d.Buf16(fe.w_size),fe.lit_bufsize=1<<z+6,fe.pending_buf_size=4*fe.lit_bufsize,fe.pending_buf=new d.Buf8(fe.pending_buf_size),fe.d_buf=1*fe.lit_bufsize,fe.l_buf=3*fe.lit_bufsize,fe.level=ce,fe.strategy=te,fe.method=oe,Ie(T)}u=[new Xe(0,0,0,0,function(T,ce){var oe=65535;for(oe>T.pending_buf_size-5&&(oe=T.pending_buf_size-5);;){if(T.lookahead<=1){if(Fe(T),T.lookahead===0&&ce===b)return N;if(T.lookahead===0)break}T.strstart+=T.lookahead,T.lookahead=0;var Y=T.block_start+oe;if((T.strstart===0||T.strstart>=Y)&&(T.lookahead=T.strstart-Y,T.strstart=Y,G(T,!1),T.strm.avail_out===0)||T.strstart-T.block_start>=T.w_size-K&&(G(T,!1),T.strm.avail_out===0))return N}return T.insert=0,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):(T.strstart>T.block_start&&(G(T,!1),T.strm.avail_out),N)}),new Xe(4,4,8,4,qe),new Xe(4,5,16,8,qe),new Xe(4,6,32,32,qe),new Xe(4,4,16,16,Ue),new Xe(8,16,32,32,Ue),new Xe(8,16,128,128,Ue),new Xe(8,32,128,256,Ue),new Xe(32,128,258,1024,Ue),new Xe(32,258,258,4096,Ue)],c.deflateInit=function(T,ce){return Ee(T,ce,E,15,8,0)},c.deflateInit2=Ee,c.deflateReset=Ie,c.deflateResetKeep=Le,c.deflateSetHeader=function(T,ce){return T&&T.state?T.state.wrap!==2?M:(T.state.gzhead=ce,h):M},c.deflate=function(T,ce){var oe,Y,z,te;if(!T||!T.state||5<ce||ce<0)return T?be(T,M):M;if(Y=T.state,!T.output||!T.input&&T.avail_in!==0||Y.status===666&&ce!==w)return be(T,T.avail_out===0?-5:M);if(Y.strm=T,oe=Y.last_flush,Y.last_flush=ce,Y.status===$)if(Y.wrap===2)T.adler=0,me(Y,31),me(Y,139),me(Y,8),Y.gzhead?(me(Y,(Y.gzhead.text?1:0)+(Y.gzhead.hcrc?2:0)+(Y.gzhead.extra?4:0)+(Y.gzhead.name?8:0)+(Y.gzhead.comment?16:0)),me(Y,255&Y.gzhead.time),me(Y,Y.gzhead.time>>8&255),me(Y,Y.gzhead.time>>16&255),me(Y,Y.gzhead.time>>24&255),me(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),me(Y,255&Y.gzhead.os),Y.gzhead.extra&&Y.gzhead.extra.length&&(me(Y,255&Y.gzhead.extra.length),me(Y,Y.gzhead.extra.length>>8&255)),Y.gzhead.hcrc&&(T.adler=m(T.adler,Y.pending_buf,Y.pending,0)),Y.gzindex=0,Y.status=69):(me(Y,0),me(Y,0),me(Y,0),me(Y,0),me(Y,0),me(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),me(Y,3),Y.status=Q);else{var pe=E+(Y.w_bits-8<<4)<<8;pe|=(2<=Y.strategy||Y.level<2?0:Y.level<6?1:Y.level===6?2:3)<<6,Y.strstart!==0&&(pe|=32),pe+=31-pe%31,Y.status=Q,ee(Y,pe),Y.strstart!==0&&(ee(Y,T.adler>>>16),ee(Y,65535&T.adler)),T.adler=1}if(Y.status===69)if(Y.gzhead.extra){for(z=Y.pending;Y.gzindex<(65535&Y.gzhead.extra.length)&&(Y.pending!==Y.pending_buf_size||(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending!==Y.pending_buf_size));)me(Y,255&Y.gzhead.extra[Y.gzindex]),Y.gzindex++;Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),Y.gzindex===Y.gzhead.extra.length&&(Y.gzindex=0,Y.status=73)}else Y.status=73;if(Y.status===73)if(Y.gzhead.name){z=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending===Y.pending_buf_size)){te=1;break}te=Y.gzindex<Y.gzhead.name.length?255&Y.gzhead.name.charCodeAt(Y.gzindex++):0,me(Y,te)}while(te!==0);Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),te===0&&(Y.gzindex=0,Y.status=91)}else Y.status=91;if(Y.status===91)if(Y.gzhead.comment){z=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending===Y.pending_buf_size)){te=1;break}te=Y.gzindex<Y.gzhead.comment.length?255&Y.gzhead.comment.charCodeAt(Y.gzindex++):0,me(Y,te)}while(te!==0);Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),te===0&&(Y.status=103)}else Y.status=103;if(Y.status===103&&(Y.gzhead.hcrc?(Y.pending+2>Y.pending_buf_size&&V(T),Y.pending+2<=Y.pending_buf_size&&(me(Y,255&T.adler),me(Y,T.adler>>8&255),T.adler=0,Y.status=Q)):Y.status=Q),Y.pending!==0){if(V(T),T.avail_out===0)return Y.last_flush=-1,h}else if(T.avail_in===0&&de(ce)<=de(oe)&&ce!==w)return be(T,-5);if(Y.status===666&&T.avail_in!==0)return be(T,-5);if(T.avail_in!==0||Y.lookahead!==0||ce!==b&&Y.status!==666){var fe=Y.strategy===2?(function(re,Me){for(var Ne;;){if(re.lookahead===0&&(Fe(re),re.lookahead===0)){if(Me===b)return N;break}if(re.match_length=0,Ne=l._tr_tally(re,0,re.window[re.strstart]),re.lookahead--,re.strstart++,Ne&&(G(re,!1),re.strm.avail_out===0))return N}return re.insert=0,Me===w?(G(re,!0),re.strm.avail_out===0?ae:ue):re.last_lit&&(G(re,!1),re.strm.avail_out===0)?N:W})(Y,ce):Y.strategy===3?(function(re,Me){for(var Ne,Se,ze,gt,Qe=re.window;;){if(re.lookahead<=U){if(Fe(re),re.lookahead<=U&&Me===b)return N;if(re.lookahead===0)break}if(re.match_length=0,re.lookahead>=P&&0<re.strstart&&(Se=Qe[ze=re.strstart-1])===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]){gt=re.strstart+U;do;while(Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&ze<gt);re.match_length=U-(gt-ze),re.match_length>re.lookahead&&(re.match_length=re.lookahead)}if(re.match_length>=P?(Ne=l._tr_tally(re,1,re.match_length-P),re.lookahead-=re.match_length,re.strstart+=re.match_length,re.match_length=0):(Ne=l._tr_tally(re,0,re.window[re.strstart]),re.lookahead--,re.strstart++),Ne&&(G(re,!1),re.strm.avail_out===0))return N}return re.insert=0,Me===w?(G(re,!0),re.strm.avail_out===0?ae:ue):re.last_lit&&(G(re,!1),re.strm.avail_out===0)?N:W})(Y,ce):u[Y.level].func(Y,ce);if(fe!==ae&&fe!==ue||(Y.status=666),fe===N||fe===ae)return T.avail_out===0&&(Y.last_flush=-1),h;if(fe===W&&(ce===1?l._tr_align(Y):ce!==5&&(l._tr_stored_block(Y,0,0,!1),ce===3&&(ie(Y.head),Y.lookahead===0&&(Y.strstart=0,Y.block_start=0,Y.insert=0))),V(T),T.avail_out===0))return Y.last_flush=-1,h}return ce!==w?h:Y.wrap<=0?1:(Y.wrap===2?(me(Y,255&T.adler),me(Y,T.adler>>8&255),me(Y,T.adler>>16&255),me(Y,T.adler>>24&255),me(Y,255&T.total_in),me(Y,T.total_in>>8&255),me(Y,T.total_in>>16&255),me(Y,T.total_in>>24&255)):(ee(Y,T.adler>>>16),ee(Y,65535&T.adler)),V(T),0<Y.wrap&&(Y.wrap=-Y.wrap),Y.pending!==0?h:1)},c.deflateEnd=function(T){var ce;return T&&T.state?(ce=T.state.status)!==$&&ce!==69&&ce!==73&&ce!==91&&ce!==103&&ce!==Q&&ce!==666?be(T,M):(T.state=null,ce===Q?be(T,-3):h):M},c.deflateSetDictionary=function(T,ce){var oe,Y,z,te,pe,fe,re,Me,Ne=ce.length;if(!T||!T.state||(te=(oe=T.state).wrap)===2||te===1&&oe.status!==$||oe.lookahead)return M;for(te===1&&(T.adler=f(T.adler,ce,Ne,0)),oe.wrap=0,Ne>=oe.w_size&&(te===0&&(ie(oe.head),oe.strstart=0,oe.block_start=0,oe.insert=0),Me=new d.Buf8(oe.w_size),d.arraySet(Me,ce,Ne-oe.w_size,oe.w_size,0),ce=Me,Ne=oe.w_size),pe=T.avail_in,fe=T.next_in,re=T.input,T.avail_in=Ne,T.next_in=0,T.input=ce,Fe(oe);oe.lookahead>=P;){for(Y=oe.strstart,z=oe.lookahead-(P-1);oe.ins_h=(oe.ins_h<<oe.hash_shift^oe.window[Y+P-1])&oe.hash_mask,oe.prev[Y&oe.w_mask]=oe.head[oe.ins_h],oe.head[oe.ins_h]=Y,Y++,--z;);oe.strstart=Y,oe.lookahead=P-1,Fe(oe)}return oe.strstart+=oe.lookahead,oe.block_start=oe.strstart,oe.insert=oe.lookahead,oe.lookahead=0,oe.match_length=oe.prev_length=P-1,oe.match_available=0,T.next_in=fe,T.input=re,T.avail_in=pe,oe.wrap=te,h},c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(s,o,c){o.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(s,o,c){o.exports=function(u,d){var l,f,m,p,b,w,h,M,x,j,_,E,C,A,D,F,O,q,P,U,K,$,Q,N,W;l=u.state,f=u.next_in,N=u.input,m=f+(u.avail_in-5),p=u.next_out,W=u.output,b=p-(d-u.avail_out),w=p+(u.avail_out-257),h=l.dmax,M=l.wsize,x=l.whave,j=l.wnext,_=l.window,E=l.hold,C=l.bits,A=l.lencode,D=l.distcode,F=(1<<l.lenbits)-1,O=(1<<l.distbits)-1;e:do{C<15&&(E+=N[f++]<<C,C+=8,E+=N[f++]<<C,C+=8),q=A[E&F];t:for(;;){if(E>>>=P=q>>>24,C-=P,(P=q>>>16&255)===0)W[p++]=65535&q;else{if(!(16&P)){if((64&P)==0){q=A[(65535&q)+(E&(1<<P)-1)];continue t}if(32&P){l.mode=12;break e}u.msg="invalid literal/length code",l.mode=30;break e}U=65535&q,(P&=15)&&(C<P&&(E+=N[f++]<<C,C+=8),U+=E&(1<<P)-1,E>>>=P,C-=P),C<15&&(E+=N[f++]<<C,C+=8,E+=N[f++]<<C,C+=8),q=D[E&O];n:for(;;){if(E>>>=P=q>>>24,C-=P,!(16&(P=q>>>16&255))){if((64&P)==0){q=D[(65535&q)+(E&(1<<P)-1)];continue n}u.msg="invalid distance code",l.mode=30;break e}if(K=65535&q,C<(P&=15)&&(E+=N[f++]<<C,(C+=8)<P&&(E+=N[f++]<<C,C+=8)),h<(K+=E&(1<<P)-1)){u.msg="invalid distance too far back",l.mode=30;break e}if(E>>>=P,C-=P,(P=p-b)<K){if(x<(P=K-P)&&l.sane){u.msg="invalid distance too far back",l.mode=30;break e}if(Q=_,($=0)===j){if($+=M-P,P<U){for(U-=P;W[p++]=_[$++],--P;);$=p-K,Q=W}}else if(j<P){if($+=M+j-P,(P-=j)<U){for(U-=P;W[p++]=_[$++],--P;);if($=0,j<U){for(U-=P=j;W[p++]=_[$++],--P;);$=p-K,Q=W}}}else if($+=j-P,P<U){for(U-=P;W[p++]=_[$++],--P;);$=p-K,Q=W}for(;2<U;)W[p++]=Q[$++],W[p++]=Q[$++],W[p++]=Q[$++],U-=3;U&&(W[p++]=Q[$++],1<U&&(W[p++]=Q[$++]))}else{for($=p-K;W[p++]=W[$++],W[p++]=W[$++],W[p++]=W[$++],2<(U-=3););U&&(W[p++]=W[$++],1<U&&(W[p++]=W[$++]))}break}}break}}while(f<m&&p<w);f-=U=C>>3,E&=(1<<(C-=U<<3))-1,u.next_in=f,u.next_out=p,u.avail_in=f<m?m-f+5:5-(f-m),u.avail_out=p<w?w-p+257:257-(p-w),l.hold=E,l.bits=C}},{}],49:[function(s,o,c){var u=s("../utils/common"),d=s("./adler32"),l=s("./crc32"),f=s("./inffast"),m=s("./inftrees"),p=1,b=2,w=0,h=-2,M=1,x=852,j=592;function _($){return($>>>24&255)+($>>>8&65280)+((65280&$)<<8)+((255&$)<<24)}function E(){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 u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C($){var Q;return $&&$.state?(Q=$.state,$.total_in=$.total_out=Q.total=0,$.msg="",Q.wrap&&($.adler=1&Q.wrap),Q.mode=M,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new u.Buf32(x),Q.distcode=Q.distdyn=new u.Buf32(j),Q.sane=1,Q.back=-1,w):h}function A($){var Q;return $&&$.state?((Q=$.state).wsize=0,Q.whave=0,Q.wnext=0,C($)):h}function D($,Q){var N,W;return $&&$.state?(W=$.state,Q<0?(N=0,Q=-Q):(N=1+(Q>>4),Q<48&&(Q&=15)),Q&&(Q<8||15<Q)?h:(W.window!==null&&W.wbits!==Q&&(W.window=null),W.wrap=N,W.wbits=Q,A($))):h}function F($,Q){var N,W;return $?(W=new E,($.state=W).window=null,(N=D($,Q))!==w&&($.state=null),N):h}var O,q,P=!0;function U($){if(P){var Q;for(O=new u.Buf32(512),q=new u.Buf32(32),Q=0;Q<144;)$.lens[Q++]=8;for(;Q<256;)$.lens[Q++]=9;for(;Q<280;)$.lens[Q++]=7;for(;Q<288;)$.lens[Q++]=8;for(m(p,$.lens,0,288,O,0,$.work,{bits:9}),Q=0;Q<32;)$.lens[Q++]=5;m(b,$.lens,0,32,q,0,$.work,{bits:5}),P=!1}$.lencode=O,$.lenbits=9,$.distcode=q,$.distbits=5}function K($,Q,N,W){var ae,ue=$.state;return ue.window===null&&(ue.wsize=1<<ue.wbits,ue.wnext=0,ue.whave=0,ue.window=new u.Buf8(ue.wsize)),W>=ue.wsize?(u.arraySet(ue.window,Q,N-ue.wsize,ue.wsize,0),ue.wnext=0,ue.whave=ue.wsize):(W<(ae=ue.wsize-ue.wnext)&&(ae=W),u.arraySet(ue.window,Q,N-W,ae,ue.wnext),(W-=ae)?(u.arraySet(ue.window,Q,N-W,W,0),ue.wnext=W,ue.whave=ue.wsize):(ue.wnext+=ae,ue.wnext===ue.wsize&&(ue.wnext=0),ue.whave<ue.wsize&&(ue.whave+=ae))),0}c.inflateReset=A,c.inflateReset2=D,c.inflateResetKeep=C,c.inflateInit=function($){return F($,15)},c.inflateInit2=F,c.inflate=function($,Q){var N,W,ae,ue,be,de,ie,V,G,me,ee,xe,Fe,qe,Ue,Xe,we,Le,Ie,Ee,T,ce,oe,Y,z=0,te=new u.Buf8(4),pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!$||!$.state||!$.output||!$.input&&$.avail_in!==0)return h;(N=$.state).mode===12&&(N.mode=13),be=$.next_out,ae=$.output,ie=$.avail_out,ue=$.next_in,W=$.input,de=$.avail_in,V=N.hold,G=N.bits,me=de,ee=ie,ce=w;e:for(;;)switch(N.mode){case M:if(N.wrap===0){N.mode=13;break}for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(2&N.wrap&&V===35615){te[N.check=0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0),G=V=0,N.mode=2;break}if(N.flags=0,N.head&&(N.head.done=!1),!(1&N.wrap)||(((255&V)<<8)+(V>>8))%31){$.msg="incorrect header check",N.mode=30;break}if((15&V)!=8){$.msg="unknown compression method",N.mode=30;break}if(G-=4,T=8+(15&(V>>>=4)),N.wbits===0)N.wbits=T;else if(T>N.wbits){$.msg="invalid window size",N.mode=30;break}N.dmax=1<<T,$.adler=N.check=1,N.mode=512&V?10:12,G=V=0;break;case 2:for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(N.flags=V,(255&N.flags)!=8){$.msg="unknown compression method",N.mode=30;break}if(57344&N.flags){$.msg="unknown header flags set",N.mode=30;break}N.head&&(N.head.text=V>>8&1),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0,N.mode=3;case 3:for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.head&&(N.head.time=V),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,te[2]=V>>>16&255,te[3]=V>>>24&255,N.check=l(N.check,te,4,0)),G=V=0,N.mode=4;case 4:for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.head&&(N.head.xflags=255&V,N.head.os=V>>8),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0,N.mode=5;case 5:if(1024&N.flags){for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.length=V,N.head&&(N.head.extra_len=V),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0}else N.head&&(N.head.extra=null);N.mode=6;case 6:if(1024&N.flags&&(de<(xe=N.length)&&(xe=de),xe&&(N.head&&(T=N.head.extra_len-N.length,N.head.extra||(N.head.extra=new Array(N.head.extra_len)),u.arraySet(N.head.extra,W,ue,xe,T)),512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,N.length-=xe),N.length))break e;N.length=0,N.mode=7;case 7:if(2048&N.flags){if(de===0)break e;for(xe=0;T=W[ue+xe++],N.head&&T&&N.length<65536&&(N.head.name+=String.fromCharCode(T)),T&&xe<de;);if(512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,T)break e}else N.head&&(N.head.name=null);N.length=0,N.mode=8;case 8:if(4096&N.flags){if(de===0)break e;for(xe=0;T=W[ue+xe++],N.head&&T&&N.length<65536&&(N.head.comment+=String.fromCharCode(T)),T&&xe<de;);if(512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,T)break e}else N.head&&(N.head.comment=null);N.mode=9;case 9:if(512&N.flags){for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V!==(65535&N.check)){$.msg="header crc mismatch",N.mode=30;break}G=V=0}N.head&&(N.head.hcrc=N.flags>>9&1,N.head.done=!0),$.adler=N.check=0,N.mode=12;break;case 10:for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}$.adler=N.check=_(V),G=V=0,N.mode=11;case 11:if(N.havedict===0)return $.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,2;$.adler=N.check=1,N.mode=12;case 12:if(Q===5||Q===6)break e;case 13:if(N.last){V>>>=7&G,G-=7&G,N.mode=27;break}for(;G<3;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}switch(N.last=1&V,G-=1,3&(V>>>=1)){case 0:N.mode=14;break;case 1:if(U(N),N.mode=20,Q!==6)break;V>>>=2,G-=2;break e;case 2:N.mode=17;break;case 3:$.msg="invalid block type",N.mode=30}V>>>=2,G-=2;break;case 14:for(V>>>=7&G,G-=7&G;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if((65535&V)!=(V>>>16^65535)){$.msg="invalid stored block lengths",N.mode=30;break}if(N.length=65535&V,G=V=0,N.mode=15,Q===6)break e;case 15:N.mode=16;case 16:if(xe=N.length){if(de<xe&&(xe=de),ie<xe&&(xe=ie),xe===0)break e;u.arraySet(ae,W,ue,xe,be),de-=xe,ue+=xe,ie-=xe,be+=xe,N.length-=xe;break}N.mode=12;break;case 17:for(;G<14;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(N.nlen=257+(31&V),V>>>=5,G-=5,N.ndist=1+(31&V),V>>>=5,G-=5,N.ncode=4+(15&V),V>>>=4,G-=4,286<N.nlen||30<N.ndist){$.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(;G<3;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.lens[pe[N.have++]]=7&V,V>>>=3,G-=3}for(;N.have<19;)N.lens[pe[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,oe={bits:N.lenbits},ce=m(0,N.lens,0,19,N.lencode,0,N.work,oe),N.lenbits=oe.bits,ce){$.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(;Xe=(z=N.lencode[V&(1<<N.lenbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(we<16)V>>>=Ue,G-=Ue,N.lens[N.have++]=we;else{if(we===16){for(Y=Ue+2;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V>>>=Ue,G-=Ue,N.have===0){$.msg="invalid bit length repeat",N.mode=30;break}T=N.lens[N.have-1],xe=3+(3&V),V>>>=2,G-=2}else if(we===17){for(Y=Ue+3;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}G-=Ue,T=0,xe=3+(7&(V>>>=Ue)),V>>>=3,G-=3}else{for(Y=Ue+7;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}G-=Ue,T=0,xe=11+(127&(V>>>=Ue)),V>>>=7,G-=7}if(N.have+xe>N.nlen+N.ndist){$.msg="invalid bit length repeat",N.mode=30;break}for(;xe--;)N.lens[N.have++]=T}}if(N.mode===30)break;if(N.lens[256]===0){$.msg="invalid code -- missing end-of-block",N.mode=30;break}if(N.lenbits=9,oe={bits:N.lenbits},ce=m(p,N.lens,0,N.nlen,N.lencode,0,N.work,oe),N.lenbits=oe.bits,ce){$.msg="invalid literal/lengths set",N.mode=30;break}if(N.distbits=6,N.distcode=N.distdyn,oe={bits:N.distbits},ce=m(b,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,oe),N.distbits=oe.bits,ce){$.msg="invalid distances set",N.mode=30;break}if(N.mode=20,Q===6)break e;case 20:N.mode=21;case 21:if(6<=de&&258<=ie){$.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,f($,ee),be=$.next_out,ae=$.output,ie=$.avail_out,ue=$.next_in,W=$.input,de=$.avail_in,V=N.hold,G=N.bits,N.mode===12&&(N.back=-1);break}for(N.back=0;Xe=(z=N.lencode[V&(1<<N.lenbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(Xe&&(240&Xe)==0){for(Le=Ue,Ie=Xe,Ee=we;Xe=(z=N.lencode[Ee+((V&(1<<Le+Ie)-1)>>Le)])>>>16&255,we=65535&z,!(Le+(Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}V>>>=Le,G-=Le,N.back+=Le}if(V>>>=Ue,G-=Ue,N.back+=Ue,N.length=we,Xe===0){N.mode=26;break}if(32&Xe){N.back=-1,N.mode=12;break}if(64&Xe){$.msg="invalid literal/length code",N.mode=30;break}N.extra=15&Xe,N.mode=22;case 22:if(N.extra){for(Y=N.extra;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.length+=V&(1<<N.extra)-1,V>>>=N.extra,G-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=23;case 23:for(;Xe=(z=N.distcode[V&(1<<N.distbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if((240&Xe)==0){for(Le=Ue,Ie=Xe,Ee=we;Xe=(z=N.distcode[Ee+((V&(1<<Le+Ie)-1)>>Le)])>>>16&255,we=65535&z,!(Le+(Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}V>>>=Le,G-=Le,N.back+=Le}if(V>>>=Ue,G-=Ue,N.back+=Ue,64&Xe){$.msg="invalid distance code",N.mode=30;break}N.offset=we,N.extra=15&Xe,N.mode=24;case 24:if(N.extra){for(Y=N.extra;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.offset+=V&(1<<N.extra)-1,V>>>=N.extra,G-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){$.msg="invalid distance too far back",N.mode=30;break}N.mode=25;case 25:if(ie===0)break e;if(xe=ee-ie,N.offset>xe){if((xe=N.offset-xe)>N.whave&&N.sane){$.msg="invalid distance too far back",N.mode=30;break}Fe=xe>N.wnext?(xe-=N.wnext,N.wsize-xe):N.wnext-xe,xe>N.length&&(xe=N.length),qe=N.window}else qe=ae,Fe=be-N.offset,xe=N.length;for(ie<xe&&(xe=ie),ie-=xe,N.length-=xe;ae[be++]=qe[Fe++],--xe;);N.length===0&&(N.mode=21);break;case 26:if(ie===0)break e;ae[be++]=N.length,ie--,N.mode=21;break;case 27:if(N.wrap){for(;G<32;){if(de===0)break e;de--,V|=W[ue++]<<G,G+=8}if(ee-=ie,$.total_out+=ee,N.total+=ee,ee&&($.adler=N.check=N.flags?l(N.check,ae,ee,be-ee):d(N.check,ae,ee,be-ee)),ee=ie,(N.flags?V:_(V))!==N.check){$.msg="incorrect data check",N.mode=30;break}G=V=0}N.mode=28;case 28:if(N.wrap&&N.flags){for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V!==(4294967295&N.total)){$.msg="incorrect length check",N.mode=30;break}G=V=0}N.mode=29;case 29:ce=1;break e;case 30:ce=-3;break e;case 31:return-4;default:return h}return $.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,(N.wsize||ee!==$.avail_out&&N.mode<30&&(N.mode<27||Q!==4))&&K($,$.output,$.next_out,ee-$.avail_out)?(N.mode=31,-4):(me-=$.avail_in,ee-=$.avail_out,$.total_in+=me,$.total_out+=ee,N.total+=ee,N.wrap&&ee&&($.adler=N.check=N.flags?l(N.check,ae,ee,$.next_out-ee):d(N.check,ae,ee,$.next_out-ee)),$.data_type=N.bits+(N.last?64:0)+(N.mode===12?128:0)+(N.mode===20||N.mode===15?256:0),(me==0&&ee===0||Q===4)&&ce===w&&(ce=-5),ce)},c.inflateEnd=function($){if(!$||!$.state)return h;var Q=$.state;return Q.window&&(Q.window=null),$.state=null,w},c.inflateGetHeader=function($,Q){var N;return $&&$.state?(2&(N=$.state).wrap)==0?h:((N.head=Q).done=!1,w):h},c.inflateSetDictionary=function($,Q){var N,W=Q.length;return $&&$.state?(N=$.state).wrap!==0&&N.mode!==11?h:N.mode===11&&d(1,Q,W,0)!==N.check?-3:K($,Q,W,W)?(N.mode=31,-4):(N.havedict=1,w):h},c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(s,o,c){var u=s("../utils/common"),d=[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],l=[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],f=[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],m=[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];o.exports=function(p,b,w,h,M,x,j,_){var E,C,A,D,F,O,q,P,U,K=_.bits,$=0,Q=0,N=0,W=0,ae=0,ue=0,be=0,de=0,ie=0,V=0,G=null,me=0,ee=new u.Buf16(16),xe=new u.Buf16(16),Fe=null,qe=0;for($=0;$<=15;$++)ee[$]=0;for(Q=0;Q<h;Q++)ee[b[w+Q]]++;for(ae=K,W=15;1<=W&&ee[W]===0;W--);if(W<ae&&(ae=W),W===0)return M[x++]=20971520,M[x++]=20971520,_.bits=1,0;for(N=1;N<W&&ee[N]===0;N++);for(ae<N&&(ae=N),$=de=1;$<=15;$++)if(de<<=1,(de-=ee[$])<0)return-1;if(0<de&&(p===0||W!==1))return-1;for(xe[1]=0,$=1;$<15;$++)xe[$+1]=xe[$]+ee[$];for(Q=0;Q<h;Q++)b[w+Q]!==0&&(j[xe[b[w+Q]]++]=Q);if(O=p===0?(G=Fe=j,19):p===1?(G=d,me-=257,Fe=l,qe-=257,256):(G=f,Fe=m,-1),$=N,F=x,be=Q=V=0,A=-1,D=(ie=1<<(ue=ae))-1,p===1&&852<ie||p===2&&592<ie)return 1;for(;;){for(q=$-be,U=j[Q]<O?(P=0,j[Q]):j[Q]>O?(P=Fe[qe+j[Q]],G[me+j[Q]]):(P=96,0),E=1<<$-be,N=C=1<<ue;M[F+(V>>be)+(C-=E)]=q<<24|P<<16|U|0,C!==0;);for(E=1<<$-1;V&E;)E>>=1;if(E!==0?(V&=E-1,V+=E):V=0,Q++,--ee[$]==0){if($===W)break;$=b[w+j[Q]]}if(ae<$&&(V&D)!==A){for(be===0&&(be=ae),F+=N,de=1<<(ue=$-be);ue+be<W&&!((de-=ee[ue+be])<=0);)ue++,de<<=1;if(ie+=1<<ue,p===1&&852<ie||p===2&&592<ie)return 1;M[A=V&D]=ae<<24|ue<<16|F-x|0}}return V!==0&&(M[F+V]=$-be<<24|64<<16|0),_.bits=ae,0}},{"../utils/common":41}],51:[function(s,o,c){o.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(s,o,c){var u=s("../utils/common"),d=0,l=1;function f(z){for(var te=z.length;0<=--te;)z[te]=0}var m=0,p=29,b=256,w=b+1+p,h=30,M=19,x=2*w+1,j=15,_=16,E=7,C=256,A=16,D=17,F=18,O=[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],q=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=new Array(2*(w+2));f(K);var $=new Array(2*h);f($);var Q=new Array(512);f(Q);var N=new Array(256);f(N);var W=new Array(p);f(W);var ae,ue,be,de=new Array(h);function ie(z,te,pe,fe,re){this.static_tree=z,this.extra_bits=te,this.extra_base=pe,this.elems=fe,this.max_length=re,this.has_stree=z&&z.length}function V(z,te){this.dyn_tree=z,this.max_code=0,this.stat_desc=te}function G(z){return z<256?Q[z]:Q[256+(z>>>7)]}function me(z,te){z.pending_buf[z.pending++]=255&te,z.pending_buf[z.pending++]=te>>>8&255}function ee(z,te,pe){z.bi_valid>_-pe?(z.bi_buf|=te<<z.bi_valid&65535,me(z,z.bi_buf),z.bi_buf=te>>_-z.bi_valid,z.bi_valid+=pe-_):(z.bi_buf|=te<<z.bi_valid&65535,z.bi_valid+=pe)}function xe(z,te,pe){ee(z,pe[2*te],pe[2*te+1])}function Fe(z,te){for(var pe=0;pe|=1&z,z>>>=1,pe<<=1,0<--te;);return pe>>>1}function qe(z,te,pe){var fe,re,Me=new Array(j+1),Ne=0;for(fe=1;fe<=j;fe++)Me[fe]=Ne=Ne+pe[fe-1]<<1;for(re=0;re<=te;re++){var Se=z[2*re+1];Se!==0&&(z[2*re]=Fe(Me[Se]++,Se))}}function Ue(z){var te;for(te=0;te<w;te++)z.dyn_ltree[2*te]=0;for(te=0;te<h;te++)z.dyn_dtree[2*te]=0;for(te=0;te<M;te++)z.bl_tree[2*te]=0;z.dyn_ltree[2*C]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function Xe(z){8<z.bi_valid?me(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function we(z,te,pe,fe){var re=2*te,Me=2*pe;return z[re]<z[Me]||z[re]===z[Me]&&fe[te]<=fe[pe]}function Le(z,te,pe){for(var fe=z.heap[pe],re=pe<<1;re<=z.heap_len&&(re<z.heap_len&&we(te,z.heap[re+1],z.heap[re],z.depth)&&re++,!we(te,fe,z.heap[re],z.depth));)z.heap[pe]=z.heap[re],pe=re,re<<=1;z.heap[pe]=fe}function Ie(z,te,pe){var fe,re,Me,Ne,Se=0;if(z.last_lit!==0)for(;fe=z.pending_buf[z.d_buf+2*Se]<<8|z.pending_buf[z.d_buf+2*Se+1],re=z.pending_buf[z.l_buf+Se],Se++,fe===0?xe(z,re,te):(xe(z,(Me=N[re])+b+1,te),(Ne=O[Me])!==0&&ee(z,re-=W[Me],Ne),xe(z,Me=G(--fe),pe),(Ne=q[Me])!==0&&ee(z,fe-=de[Me],Ne)),Se<z.last_lit;);xe(z,C,te)}function Ee(z,te){var pe,fe,re,Me=te.dyn_tree,Ne=te.stat_desc.static_tree,Se=te.stat_desc.has_stree,ze=te.stat_desc.elems,gt=-1;for(z.heap_len=0,z.heap_max=x,pe=0;pe<ze;pe++)Me[2*pe]!==0?(z.heap[++z.heap_len]=gt=pe,z.depth[pe]=0):Me[2*pe+1]=0;for(;z.heap_len<2;)Me[2*(re=z.heap[++z.heap_len]=gt<2?++gt:0)]=1,z.depth[re]=0,z.opt_len--,Se&&(z.static_len-=Ne[2*re+1]);for(te.max_code=gt,pe=z.heap_len>>1;1<=pe;pe--)Le(z,Me,pe);for(re=ze;pe=z.heap[1],z.heap[1]=z.heap[z.heap_len--],Le(z,Me,1),fe=z.heap[1],z.heap[--z.heap_max]=pe,z.heap[--z.heap_max]=fe,Me[2*re]=Me[2*pe]+Me[2*fe],z.depth[re]=(z.depth[pe]>=z.depth[fe]?z.depth[pe]:z.depth[fe])+1,Me[2*pe+1]=Me[2*fe+1]=re,z.heap[1]=re++,Le(z,Me,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(Qe,Tt){var xn,$t,Gt,wt,An,Un,Nt=Tt.dyn_tree,vr=Tt.max_code,Hr=Tt.stat_desc.static_tree,Ur=Tt.stat_desc.has_stree,tn=Tt.stat_desc.extra_bits,Bn=Tt.stat_desc.extra_base,jn=Tt.stat_desc.max_length,Dn=0;for(wt=0;wt<=j;wt++)Qe.bl_count[wt]=0;for(Nt[2*Qe.heap[Qe.heap_max]+1]=0,xn=Qe.heap_max+1;xn<x;xn++)jn<(wt=Nt[2*Nt[2*($t=Qe.heap[xn])+1]+1]+1)&&(wt=jn,Dn++),Nt[2*$t+1]=wt,vr<$t||(Qe.bl_count[wt]++,An=0,Bn<=$t&&(An=tn[$t-Bn]),Un=Nt[2*$t],Qe.opt_len+=Un*(wt+An),Ur&&(Qe.static_len+=Un*(Hr[2*$t+1]+An)));if(Dn!==0){do{for(wt=jn-1;Qe.bl_count[wt]===0;)wt--;Qe.bl_count[wt]--,Qe.bl_count[wt+1]+=2,Qe.bl_count[jn]--,Dn-=2}while(0<Dn);for(wt=jn;wt!==0;wt--)for($t=Qe.bl_count[wt];$t!==0;)vr<(Gt=Qe.heap[--xn])||(Nt[2*Gt+1]!==wt&&(Qe.opt_len+=(wt-Nt[2*Gt+1])*Nt[2*Gt],Nt[2*Gt+1]=wt),$t--)}})(z,te),qe(Me,gt,z.bl_count)}function T(z,te,pe){var fe,re,Me=-1,Ne=te[1],Se=0,ze=7,gt=4;for(Ne===0&&(ze=138,gt=3),te[2*(pe+1)+1]=65535,fe=0;fe<=pe;fe++)re=Ne,Ne=te[2*(fe+1)+1],++Se<ze&&re===Ne||(Se<gt?z.bl_tree[2*re]+=Se:re!==0?(re!==Me&&z.bl_tree[2*re]++,z.bl_tree[2*A]++):Se<=10?z.bl_tree[2*D]++:z.bl_tree[2*F]++,Me=re,gt=(Se=0)===Ne?(ze=138,3):re===Ne?(ze=6,3):(ze=7,4))}function ce(z,te,pe){var fe,re,Me=-1,Ne=te[1],Se=0,ze=7,gt=4;for(Ne===0&&(ze=138,gt=3),fe=0;fe<=pe;fe++)if(re=Ne,Ne=te[2*(fe+1)+1],!(++Se<ze&&re===Ne)){if(Se<gt)for(;xe(z,re,z.bl_tree),--Se!=0;);else re!==0?(re!==Me&&(xe(z,re,z.bl_tree),Se--),xe(z,A,z.bl_tree),ee(z,Se-3,2)):Se<=10?(xe(z,D,z.bl_tree),ee(z,Se-3,3)):(xe(z,F,z.bl_tree),ee(z,Se-11,7));Me=re,gt=(Se=0)===Ne?(ze=138,3):re===Ne?(ze=6,3):(ze=7,4)}}f(de);var oe=!1;function Y(z,te,pe,fe){ee(z,(m<<1)+(fe?1:0),3),(function(re,Me,Ne,Se){Xe(re),me(re,Ne),me(re,~Ne),u.arraySet(re.pending_buf,re.window,Me,Ne,re.pending),re.pending+=Ne})(z,te,pe)}c._tr_init=function(z){oe||((function(){var te,pe,fe,re,Me,Ne=new Array(j+1);for(re=fe=0;re<p-1;re++)for(W[re]=fe,te=0;te<1<<O[re];te++)N[fe++]=re;for(N[fe-1]=re,re=Me=0;re<16;re++)for(de[re]=Me,te=0;te<1<<q[re];te++)Q[Me++]=re;for(Me>>=7;re<h;re++)for(de[re]=Me<<7,te=0;te<1<<q[re]-7;te++)Q[256+Me++]=re;for(pe=0;pe<=j;pe++)Ne[pe]=0;for(te=0;te<=143;)K[2*te+1]=8,te++,Ne[8]++;for(;te<=255;)K[2*te+1]=9,te++,Ne[9]++;for(;te<=279;)K[2*te+1]=7,te++,Ne[7]++;for(;te<=287;)K[2*te+1]=8,te++,Ne[8]++;for(qe(K,w+1,Ne),te=0;te<h;te++)$[2*te+1]=5,$[2*te]=Fe(te,5);ae=new ie(K,O,b+1,w,j),ue=new ie($,q,0,h,j),be=new ie(new Array(0),P,0,M,E)})(),oe=!0),z.l_desc=new V(z.dyn_ltree,ae),z.d_desc=new V(z.dyn_dtree,ue),z.bl_desc=new V(z.bl_tree,be),z.bi_buf=0,z.bi_valid=0,Ue(z)},c._tr_stored_block=Y,c._tr_flush_block=function(z,te,pe,fe){var re,Me,Ne=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(Se){var ze,gt=4093624447;for(ze=0;ze<=31;ze++,gt>>>=1)if(1>&&Se.dyn_ltree[2*ze]!==0)return d;if(Se.dyn_ltree[18]!==0||Se.dyn_ltree[20]!==0||Se.dyn_ltree[26]!==0)return l;for(ze=32;ze<b;ze++)if(Se.dyn_ltree[2*ze]!==0)return l;return d})(z)),Ee(z,z.l_desc),Ee(z,z.d_desc),Ne=(function(Se){var ze;for(T(Se,Se.dyn_ltree,Se.l_desc.max_code),T(Se,Se.dyn_dtree,Se.d_desc.max_code),Ee(Se,Se.bl_desc),ze=M-1;3<=ze&&Se.bl_tree[2*U[ze]+1]===0;ze--);return Se.opt_len+=3*(ze+1)+5+5+4,ze})(z),re=z.opt_len+3+7>>>3,(Me=z.static_len+3+7>>>3)<=re&&(re=Me)):re=Me=pe+5,pe+4<=re&&te!==-1?Y(z,te,pe,fe):z.strategy===4||Me===re?(ee(z,2+(fe?1:0),3),Ie(z,K,$)):(ee(z,4+(fe?1:0),3),(function(Se,ze,gt,Qe){var Tt;for(ee(Se,ze-257,5),ee(Se,gt-1,5),ee(Se,Qe-4,4),Tt=0;Tt<Qe;Tt++)ee(Se,Se.bl_tree[2*U[Tt]+1],3);ce(Se,Se.dyn_ltree,ze-1),ce(Se,Se.dyn_dtree,gt-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,Ne+1),Ie(z,z.dyn_ltree,z.dyn_dtree)),Ue(z),fe&&Xe(z)},c._tr_tally=function(z,te,pe){return z.pending_buf[z.d_buf+2*z.last_lit]=te>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&te,z.pending_buf[z.l_buf+z.last_lit]=255&pe,z.last_lit++,te===0?z.dyn_ltree[2*pe]++:(z.matches++,te--,z.dyn_ltree[2*(N[pe]+b+1)]++,z.dyn_dtree[2*G(te)]++),z.last_lit===z.lit_bufsize-1},c._tr_align=function(z){ee(z,2,3),xe(z,C,K),(function(te){te.bi_valid===16?(me(te,te.bi_buf),te.bi_buf=0,te.bi_valid=0):8<=te.bi_valid&&(te.pending_buf[te.pending++]=255&te.bi_buf,te.bi_buf>>=8,te.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(s,o,c){o.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(s,o,c){(function(u){(function(d,l){if(!d.setImmediate){var f,m,p,b,w=1,h={},M=!1,x=d.document,j=Object.getPrototypeOf&&Object.getPrototypeOf(d);j=j&&j.setTimeout?j:d,f={}.toString.call(d.process)==="[object process]"?function(A){process.nextTick(function(){E(A)})}:(function(){if(d.postMessage&&!d.importScripts){var A=!0,D=d.onmessage;return d.onmessage=function(){A=!1},d.postMessage("","*"),d.onmessage=D,A}})()?(b="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",C,!1):d.attachEvent("onmessage",C),function(A){d.postMessage(b+A,"*")}):d.MessageChannel?((p=new MessageChannel).port1.onmessage=function(A){E(A.data)},function(A){p.port2.postMessage(A)}):x&&"onreadystatechange"in x.createElement("script")?(m=x.documentElement,function(A){var D=x.createElement("script");D.onreadystatechange=function(){E(A),D.onreadystatechange=null,m.removeChild(D),D=null},m.appendChild(D)}):function(A){setTimeout(E,0,A)},j.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var D=new Array(arguments.length-1),F=0;F<D.length;F++)D[F]=arguments[F+1];var O={callback:A,args:D};return h[w]=O,f(w),w++},j.clearImmediate=_}function _(A){delete h[A]}function E(A){if(M)setTimeout(E,0,A);else{var D=h[A];if(D){M=!0;try{(function(F){var O=F.callback,q=F.args;switch(q.length){case 0:O();break;case 1:O(q[0]);break;case 2:O(q[0],q[1]);break;case 3:O(q[0],q[1],q[2]);break;default:O.apply(l,q)}})(D)}finally{_(A),M=!1}}}}function C(A){A.source===d&&typeof A.data=="string"&&A.data.indexOf(b)===0&&E(+A.data.slice(b.length))}})(typeof self>"u"?u===void 0?this:u:self)}).call(this,typeof Or<"u"?Or:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(uu)),uu.exports}var q8=Y8();const Km=Lu(q8),Do={maxFiles:1e3,maxExtractedBytes:32*1024*1024};class Xs extends Error{reason;constructor(a,s){super(s),this.name="ThemeArchiveExtractionError",this.reason=a}}const G8=new Set(["css","cjs","hbs","handlebars","htm","html","js","json","less","md","markdown","mjs","sass","scss","svg","txt","xml","yaml","yml"]),X8=new Set([".editorconfig",".eslintignore",".eslintrc",".gitattributes",".gitignore",".npmignore",".prettierignore",".prettierrc","CODEOWNERS","LICENSE","LICENCE","NOTICE","Procfile"]),Pa=t=>{if(G8.has(nd(t)))return!0;const s=t.split("/").at(-1)||t;return X8.has(s)},nd=t=>{const a=t.lastIndexOf(".");return a===-1?"":t.slice(a+1).toLowerCase()},Du=t=>{const a=t.trim().replace(/^\/+/,"").replace(/\/+/g,"/");if(!a)return null;const s=a.split("/").filter(Boolean);return s.length===0||s.some(o=>o==="."||o==="..")?null:s.join("/")},sp=t=>["casper","source"].includes(t.toLowerCase()),Z8=t=>{if(t.length===0)return"";const a=t[0].indexOf("/");if(a<=0)return"";const s=t[0].slice(0,a+1);return t.every(o=>o.startsWith(s))?s:""},du=t=>Object.fromEntries(Object.entries(t).map(([a,s])=>[a,{...s,date:new Date(s.date),binary:s.binary?new Uint8Array(s.binary):null}])),Yo="Failed to open the theme archive. Download the theme again and retry.",K8=t=>{const a=t/1048576;return Number.isInteger(a)?`${a} MB`:`${a.toFixed(1)} MB`},V8=t=>{const a=[];return t.forEach((s,o)=>{o.dir||a.push([s,o])}),a},Q8=t=>{if(t.length>Do.maxFiles)throw new Xs("too_many_files",`This theme archive contains too many files for the browser editor (${t.length}/${Do.maxFiles}).`)},J8=async t=>{try{return await Km.loadAsync(t)}catch{throw new Xs("invalid_archive",Yo)}},ej=async t=>{try{return await t.async("uint8array")}catch{throw new Xs("invalid_archive",Yo)}},tj=async t=>{try{return await t.async("string")}catch{throw new Xs("invalid_archive",Yo)}},nj=t=>{const a=Du(t);if(!a||a!==t)throw new Xs("invalid_archive",Yo);return a},ap=(t,a)=>{const s=t+a;if(s>Do.maxExtractedBytes)throw new Xs("too_large",`This theme archive is too large to open in the browser editor. Extracted files must stay under ${K8(Do.maxExtractedBytes)}.`);return s},rj=async t=>{const a=await J8(t),s=V8(a);Q8(s);const o=Z8(s.map(([l])=>l)),c={},u=new TextEncoder;let d=0;for(const[l,f]of s){const m=o?l.slice(o.length):l;if(!m)continue;const p=nj(m);if(Pa(p))try{const h=await tj(f);d=ap(d,u.encode(h).byteLength),c[p]={path:p,editable:!0,content:h,binary:null,date:f.date||new Date,unixPermissions:typeof f.unixPermissions=="number"?f.unixPermissions:null,dosPermissions:typeof f.dosPermissions=="number"?f.dosPermissions:null};continue}catch{}const w=await ej(f);d=ap(d,w.byteLength),c[p]={path:p,editable:!1,content:null,binary:w,date:f.date||new Date,unixPermissions:typeof f.unixPermissions=="number"?f.unixPermissions:null,dosPermissions:typeof f.dosPermissions=="number"?f.dosPermissions:null}}return{files:c,rootPrefix:o}},sj=async({files:t,rootPrefix:a})=>{const s=new Km;for(const[o,c]of Object.entries(t)){const u=`${a}${o}`,d={date:c.date,createFolders:!0,unixPermissions:c.unixPermissions??void 0,dosPermissions:c.dosPermissions??void 0};c.editable?s.file(u,c.content??"",d):s.file(u,c.binary,{...d,binary:!0})}return s.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:6}})},aj=({baseFiles:t,currentFiles:a})=>{const s=new Set([...Object.keys(t),...Object.keys(a)]),o=[];for(const c of Array.from(s).sort()){const u=t[c],d=a[c];if(!u&&d){o.push({path:c,editable:d.editable,status:"added"});continue}if(u&&!d){o.push({path:c,editable:u.editable,status:"deleted"});continue}!u||!d||u.editable&&d.editable&&u.content!==d.content&&o.push({path:c,editable:!0,status:"modified"})}return o},ij=({files:t,oldPrefix:a,newPrefix:s})=>{const o={};for(const[c,u]of Object.entries(t)){if(!c.startsWith(a)){o[c]=u;continue}const d=`${s}${c.slice(a.length)}`;o[d]={...u,path:d}}return o},oj=t=>{switch(nd(t)){case"css":case"scss":case"sass":case"less":return ns(()=>import("./index-Dskrbhv3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.css());case"js":case"cjs":case"mjs":return ns(()=>import("./index-Bf83suMc.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.javascript());case"json":return ns(()=>import("./index-CsaU9dfl.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.json());case"md":case"markdown":return ns(()=>import("./index-takfwHSn.js"),__vite__mapDeps([20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,21,1,0,18]),import.meta.url).then(s=>s.markdown());case"yaml":case"yml":return ns(()=>import("./index-DNZUJQ8v.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.yaml());case"hbs":case"handlebars":case"html":case"htm":case"svg":case"xml":return ns(()=>import("./index-GExKMpy_.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,0,18]),import.meta.url).then(s=>s.html());default:return ns(()=>import("./index-GExKMpy_.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,0,18]),import.meta.url).then(s=>s.html())}},lj=t=>{const a=nd(t);if(!a)return"text";switch(a){case"hbs":return"handlebars";case"htm":return"html";case"yml":return"yaml";default:return a}},ip=t=>{if(t["package.json"]?.editable)return{type:"file",path:"package.json"};const a=Object.keys(t).sort().find(o=>t[o].editable);if(a)return{type:"file",path:a};const s=Object.keys(t).sort()[0];return s?{type:"file",path:s}:null},op=t=>{const a=t.split("/"),s=[""];for(let o=0;o<a.length-1;o+=1)s.push(`${a.slice(0,o+1).join("/")}/`);return s},cj=["theme","design"],uj=t=>cj.some(a=>t===a||t.startsWith(`${a}/`)),lp=()=>{const t=window.location.hash.substring(1),a=`${window.location.protocol}//${window.location.hostname}`;let s;try{s=new URL(t||"/",a)}catch{return null}const o=s.searchParams.get("from");return o===null?null:o===""||uj(o)?o:null},dj=(t,a)=>{const s=`theme/edit/${encodeURIComponent(t)}`;return a===null?s:`${s}?from=${encodeURIComponent(a)}`},fj=(t,a)=>!t.editable&&Pa(a),hj=/^[a-z0-9][\w-]{0,63}$/,cp={COMPRESSED_TOO_LARGE:"Theme too large to upload",ENTRY_TOO_LARGE:"File too large",TOTAL_TOO_LARGE:"Theme contents too large"},pj=t=>{if(!t||t<=0)return"the allowed size";const a=t/(1024*1024);return a>=1?`${a.toFixed(1)} MB`:`${Math.round(t/1024)} KB`},mj=t=>{const{entryName:a,limitBytes:s}=t.errorDetails??{},o=pj(s);switch(t.code){case"COMPRESSED_TOO_LARGE":return`The theme archive is too large to upload (max ${o}).`;case"ENTRY_TOO_LARGE":return a?`The file "${a}" is too large (max ${o} per file).`:`One of the files is too large (max ${o} per file).`;case"TOTAL_TOO_LARGE":return`The theme contents exceed the maximum allowed size of ${o}.`;default:return t.message||"Theme upload failed."}},gj=t=>`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] ${t?"opacity-100":"opacity-60"}`,fu="flex h-full items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]",up=xu.theme({"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#355070"},".cm-content ::selection":{color:"#ffffff"}},{dark:!0}),xj=({themeName:t})=>{const a=Wt(),{updateRoute:s}=rt(),o=f1(),c=pt(),{data:u}=$o(),[d,l]=B.useState(t),[f,m]=B.useState({}),[p,b]=B.useState({}),[w,h]=B.useState(""),[M,x]=B.useState(null),[j,_]=B.useState(new Set([""])),[E,C]=B.useState(!0),[A,D]=B.useState(!1),[F,O]=B.useState(null),[q,P]=B.useState(!1),[U,K]=B.useState(!1),[$,Q]=B.useState([]);B.useEffect(()=>{let Ie=!0;const Ee=()=>{l(t),m({}),b({}),h(""),x(null),_(new Set([""]))};return(async()=>{C(!0),O(null),Ee();try{const{apiRoot:ce}=$r(),oe=await fetch(`${ce}/themes/${encodeURIComponent(t)}/download/`,{credentials:"include",headers:{Accept:"application/zip, application/octet-stream, */*"}});if(!oe.ok)throw new Error(`Failed to load theme "${t}" (${oe.status})`);const Y=await oe.arrayBuffer(),z=await rj(Y),te=du(z.files),pe=ip(te);if(!Ie)return;l(t),m(du(z.files)),b(te),h(z.rootPrefix),x(pe),_(new Set(pe?.type==="file"?op(pe.path):[""]))}catch(ce){if(!Ie)return;O(ce instanceof Error?ce.message:"Failed to load theme")}finally{Ie&&C(!1)}})(),()=>{Ie=!1}},[t]),B.useEffect(()=>{const Ie=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ie}},[]);const N=B.useMemo(()=>aj({baseFiles:f,currentFiles:p}),[f,p]),W=B.useMemo(()=>new Map(N.map(Ie=>[Ie.path,Ie.status])),[N]),ae=B.useMemo(()=>U8({baseFiles:f,currentFiles:p,changes:N}),[f,p,N]),ue=M?.type==="file"?p[M.path]:null;B.useEffect(()=>{let Ie=!0;return ue?.editable?(oj(ue.path).then(Ee=>{Ie&&Q([Vf({top:!0}),Uc,Ee,...U?[xu.lineWrapping]:[],up])}).catch(()=>{Ie&&Q([Vf({top:!0}),Uc,...U?[xu.lineWrapping]:[],up])}),()=>{Ie=!1}):(Q([]),()=>{Ie=!1})},[U,ue]);const be=async({title:Ie,prompt:Ee,cancelLabel:T,okLabel:ce,okColor:oe})=>!!await Ae.show(O8,{title:Ie,prompt:Ee,cancelLabel:T,okLabel:ce,okColor:oe}),de=async({title:Ie,prompt:Ee,fieldTitle:T,initialValue:ce,placeholder:oe,cancelLabel:Y,okLabel:z})=>await Ae.show(R8,{title:Ie,prompt:Ee,fieldTitle:T,initialValue:ce,placeholder:oe,cancelLabel:Y,okLabel:z}),ie=async()=>{N.length>0&&!await be({title:"Discard changes?",prompt:"You have unsaved theme changes. Close the editor and discard them?",okLabel:"Discard changes",okColor:"red"})||(a.remove(),s(lp()??"design/change-theme"))},V=B.useRef(()=>{});B.useEffect(()=>{const Ie=Ee=>{if((Ee.metaKey||Ee.ctrlKey)&&Ee.key.toLowerCase()==="s"){Ee.preventDefault(),V.current();return}Ee.key==="Escape"&&(Ee.preventDefault(),Ee.stopPropagation(),Ee.stopImmediatePropagation())};return window.addEventListener("keydown",Ie,!0),()=>{window.removeEventListener("keydown",Ie,!0)}},[]);const G=Ie=>{_(Ee=>{const T=new Set(Ee);for(const ce of op(Ie))T.add(ce);return T})},me=(Ie,Ee)=>{if(b(Ie),Ee){x(Ee),Ee.type==="file"&&G(Ee.path);return}M?.type==="file"&&Ie[M.path]||x(ip(Ie))},ee=async()=>{const Ie=await de({title:"Create file",fieldTitle:"File path",initialValue:"partials/new-file.hbs",okLabel:"Create file",prompt:"Add a new editable file to this theme."}),Ee=Ie?Du(Ie):null;if(!Ee)return;if(!Pa(Ee)){et({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(p[Ee]){et({type:"error",title:"File already exists"});return}const T={...p,[Ee]:{path:Ee,editable:!0,content:"",binary:null,date:new Date,unixPermissions:null,dosPermissions:null}};me(T,{type:"file",path:Ee})},xe=async()=>{if(!M)return;const Ie=M.type==="dir"?M.path.replace(/\/$/,""):M.path,Ee=M.type==="dir"?"Rename folder to":"Rename file to",T=await de({title:M.type==="dir"?"Rename folder":"Rename file",fieldTitle:"Path",initialValue:Ie,okLabel:"Rename",prompt:Ee}),ce=T?Du(T):null;if(!ce||ce===Ie)return;if(M.type==="file"){const te=p[M.path];if(!Pa(ce)&&te.editable){et({type:"error",title:"Text files must keep a text file extension"});return}if(fj(te,ce)){et({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(p[ce]){et({type:"error",title:"A file with that name already exists"});return}const pe={...p},fe=pe[M.path];delete pe[M.path],pe[ce]={...fe,path:ce,editable:Pa(ce)},me(pe,{type:"file",path:ce});return}const oe=`${ce}/`;if(oe.startsWith(M.path)){et({type:"error",title:"A folder cannot be renamed inside itself"});return}if(Object.keys(p).find(te=>te.startsWith(oe))){et({type:"error",title:"A folder with that path already exists"});return}const z=ij({files:p,oldPrefix:M.path,newPrefix:oe});me(z,{type:"dir",path:oe}),_(te=>{const pe=new Set;for(const fe of te){if(!fe.startsWith(M.path)){pe.add(fe);continue}pe.add(`${oe}${fe.slice(M.path.length)}`)}return pe})},Fe=async()=>{if(!M)return;if(M.type==="file"){if(!await be({title:"Delete file",prompt:n.jsxs(n.Fragment,{children:["Delete ",n.jsx("strong",{children:M.path})," from this theme?"]}),okLabel:"Delete",okColor:"red"}))return;const oe={...p};delete oe[M.path],me(oe);return}const Ie=Object.keys(p).filter(ce=>ce.startsWith(M.path));if(!Ie.length||!await be({title:"Delete folder",prompt:n.jsxs(n.Fragment,{children:["Delete ",Ie.length," file",Ie.length===1?"":"s"," from ",n.jsx("strong",{children:M.path}),"?"]}),okLabel:"Delete",okColor:"red"}))return;const T={...p};for(const ce of Ie)delete T[ce];me(T)},qe=Ie=>{const Ee=f[Ie],T=p[Ie],ce={...p};!Ee&&T?delete ce[Ie]:Ee&&(ce[Ie]={...Ee,binary:Ee.binary?new Uint8Array(Ee.binary):null}),me(ce)},Ue=async()=>{const Ee=(await de({title:"Save as new theme",fieldTitle:"Theme name",initialValue:`${d}-edited`,okLabel:"Continue",prompt:"Default themes cannot be overwritten. Save your edits as a new theme instead."}))?.trim().toLowerCase();return Ee?hj.test(Ee)?sp(Ee)?(et({type:"error",title:"Built-in themes cannot be overwritten"}),null):Ee:(et({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},Xe=async()=>{if(A)return;if(N.length===0){et({type:"info",title:"No changes to save"});return}const Ie=d,Ee=sp(Ie)?await Ue():Ie;if(!Ee)return;const T=Ee!==Ie,ce=u?.themes.some(z=>z.name===Ee)||!1,oe=T?`Save your edits as "${Ee}"?`:`Upload ${N.length} changed file${N.length===1?"":"s"} and replace "${Ie}"?`;if(await be({title:T?"Save theme as new copy":"Update theme",prompt:oe,okLabel:T?"Save theme":"Replace theme"})&&!(T&&ce&&!await be({title:"Overwrite theme",prompt:n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:Ee})," already exists. Do you want to overwrite it?"]}),okLabel:"Overwrite",okColor:"red"}))){D(!0);try{const z=await sj({files:p,rootPrefix:w}),te=new FormData;te.append("file",z,`${Ee}.zip`);const pe=await fetch(`${$r().apiRoot}/themes/upload/`,{method:"POST",credentials:"include",headers:{Accept:"application/json"},body:te}),fe=await pe.json().catch(()=>null);if(!pe.ok){if(pe.status===422&&fe?.errors){Ae.show(Qu,{title:"Invalid Theme",prompt:n.jsx(n.Fragment,{children:"Fix the validation errors below and try saving again."}),fatalErrors:fe.errors});return}const Ne=fe?.errors?.[0];if(Ne?.code&&cp[Ne.code]){et({type:"error",title:cp[Ne.code],message:mj(Ne)});return}throw new Error(Ne?.message||"Theme upload failed.")}const re=fe.themes[0],Me=lp();m(du(p)),T&&(l(Ee),h(w?`${Ee}/`:""),s(dj(Ee,Me))),await o.invalidateQueries(["ThemesResponseType"]),T||re.errors?.length||re.warnings?.length?Ae.show(ed,{title:T?"Theme saved":"Theme updated",prompt:n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:re.name})," saved successfully."]}),installedTheme:re}):et({type:"success",title:"Theme saved",message:n.jsxs("div",{children:[n.jsx("span",{className:"capitalize",children:re.name})," has been updated."]})})}catch(z){c(z)}finally{D(!1)}}};B.useEffect(()=>{V.current=Xe});const we=Ie=>{x({type:"file",path:Ie}),G(Ie)},Le=ue?W.get(ue.path):null;return n.jsx("div",{"aria-label":`Edit theme ${t}`,"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:Ie=>{Ie.target===Ie.currentTarget&&ie()},children:n.jsxs("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-[#15171a]",children:[n.jsx(F8,{changes:N,currentThemeName:d,isSaving:A,onClose:ie,onOpenReview:()=>P(!0),onSave:()=>{Xe()}}),F&&n.jsx("div",{className:"border-b border-[#512828] bg-[#3a1d1d] px-4 py-2 text-[12px] text-[#ffbdbd]",children:F}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx(H8,{changesMap:W,currentFiles:p,expandedDirectories:j,isLoading:E,selectedNode:M,setExpandedDirectories:_,setSelectedNode:x,onCreateFile:ee,onDeleteSelected:Fe,onOpenFile:we,onRenameSelected:xe}),n.jsxs("section",{className:"flex min-w-0 flex-1 flex-col bg-[#16181c]",children:[n.jsx("div",{className:"flex items-center gap-2 border-b border-[#23262c] bg-[#17191d] px-4 py-2 text-[12px] text-[#8a8f98]",children:ue?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"min-w-0 truncate font-medium text-[#e6e7ea]",children:ue.path}),n.jsx("span",{className:"rounded bg-[#2a2d33] px-2 py-0.5 text-[10px] tracking-[0.04em] text-[#c8ccd3] uppercase",children:lj(ue.path)}),Le&&n.jsxs("button",{className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] tracking-[0.04em] uppercase ${Le==="deleted"?"bg-[#4a2222] text-[#ffbdbd]":Le==="added"?"bg-[#17342a] text-[#a5e8c8]":"bg-[#3b2a16] text-[#f5a623]"}`,type:"button",onClick:()=>qe(ue.path),children:[n.jsx(cm,{size:11}),"Revert"]}),n.jsx("div",{className:"grow"}),ue.editable&&n.jsx("button",{"aria-label":U?"Disable text wrap":"Enable text wrap","aria-pressed":U,className:gj(U),title:U?"Disable text wrap":"Enable text wrap",type:"button",onClick:()=>K(Ie=>!Ie),children:n.jsx(p_,{className:"shrink-0",size:14,strokeWidth:2})})]}):n.jsx("span",{children:"No file selected"})}),n.jsxs("div",{className:"min-h-0 flex-1",children:[!M&&!E&&n.jsx("div",{className:fu,children:"Select a file from the tree to start editing."}),M?.type==="dir"&&n.jsx("div",{className:fu,children:"Folder selected. Choose a file to edit, or rename or delete the folder from the file pane."}),ue&&!ue.editable&&n.jsx("div",{className:fu,children:"This file cannot be edited in the browser."}),ue?.editable&&n.jsx(G1,{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]:h-4 [&_.cm-search_label_input]:w-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:$,height:"full",theme:Uc,value:ue.content||"",autoFocus:!0,onChange:Ie=>{b(Ee=>({...Ee,[ue.path]:{...Ee[ue.path],content:Ie}}))}},`${ue.path}:${$.length}`)]})]})]}),q&&n.jsx(W8,{reviewItems:ae,onClose:()=>P(!1),onOpenInEditor:Ie=>{we(Ie),P(!1)},onRevert:qe})]})})},bj=t=>{if(!t.startsWith("theme/edit/"))return{themeName:null,isInvalid:!1};const a=t.slice(11).split("?")[0];if(!a||a.includes("/"))return{themeName:null,isInvalid:!0};try{const s=decodeURIComponent(a);return!s||s.includes("/")?{themeName:null,isInvalid:!0}:{themeName:s,isInvalid:!1}}catch{return{themeName:null,isInvalid:!0}}},wj=({pathName:t})=>{const a=Wt(),{route:s,updateRoute:o}=rt(),c=s||t,[u,d]=B.useState(null),[l,f]=B.useState(!1),[m,p]=B.useState(!1),[b,w]=B.useState(null),[h,M]=B.useState(!1),{checkThemeLimitError:x,isThemeLimitCheckReady:j,noThemeChangesAllowed:_,isThemeLimited:E}=Po(),[C,A]=B.useState(null),[D,F]=B.useState(!1),{themeName:O,isInvalid:q}=bj(c),P=B.useCallback(U=>{Ae.show(gr,{prompt:U,onOk:()=>o({route:"/pro",isExternal:!0})})},[o]);if(B.useEffect(()=>{c==="design/change-theme"&&j?(async()=>{if(!_){f(!1),d(null);return}f(!0);const K=await x();d(K),f(!1),K&&(P(K),a.remove())})():(d(null),f(!1))},[x,c,j,a,_,P]),B.useEffect(()=>{c!=="theme/install"&&(F(!1),A(null),p(!1))},[c]),B.useEffect(()=>{q&&(a.remove(),o("theme"))},[q,a,o]),B.useEffect(()=>{let U=!1;return(async()=>{if(!O){w(null),M(!1);return}if(!j){M(!0);return}if(!E){w(null),M(!1);return}M(!0);const $=await x(O.toLowerCase());U||(w($),M(!1),$&&(P($),a.remove(),o("theme")))})(),()=>{U=!0}},[x,O,j,E,a,P,o]),B.useEffect(()=>{const U=()=>{const W=window.location.href.split("#")[1]?.split("?")[1];return W?new URLSearchParams(W).get("ref"):null},K=Q=>{A(!1),_?(P(Q),window.history.replaceState({},"",window.location.pathname+window.location.hash.split("?")[0]),a.remove(),o("theme")):(P(Q),a.remove(),o("theme"))};(async()=>{if(c!=="theme/install"){p(!1);return}if(F(!0),!j){p(!0);return}if(!E){A(!0),p(!1);return}p(!0);const Q=U();if(!Q){A(!1),p(!1);return}const N=Q.split("/")[1]?.toLowerCase(),W=await x(N);if(c!=="theme/install"){p(!1);return}if(W){A(!1),p(!1),K(W);return}A(!0),p(!1)})()},[x,c,j,_,E,a,P,o]),c==="design/edit")return n.jsx(D8,{});if(c==="design/change-theme")return l||u?null:n.jsx(zh,{});if(c==="theme/install"){if(!D||!j||m||C===null||!C)return null;const $=window.location.href.split("#")[1]?.split("?")[1];let Q=null,N=null;if($){const W=new URLSearchParams($);Q=W.get("ref"),N=W.get("source")}return n.jsx(zh,{source:N,themeRef:Q})}else return c.startsWith("theme/edit/")?q||!O||h||b?null:n.jsx(xj,{themeName:O}):(a.remove(),null)},vj=Ae.create(wj),_j=({html:t,style:a})=>{const s=o=>{const c=o.contentDocument||o.contentWindow?.document;if(!c)return;const u=`
|
|
27
|
+
\0`,ee+=u(V,2),ee+=F.magic,ee+=u(C,2),ee+=u(A,2),ee+=u(ie.crc32,4),ee+=u(ie.compressedSize,4),ee+=u(ie.uncompressedSize,4),ee+=u(q.length,2),ee+=u(W.length,2),{fileRecord:b.LOCAL_FILE_HEADER+ee+q+W,dirRecord:b.CENTRAL_FILE_HEADER+u(me,2)+ee+u(K.length,2)+"\0\0\0\0"+u(G,4)+u(j,4)+q+W+K}}var l=s("../utils"),f=s("../stream/GenericWorker"),m=s("../utf8"),p=s("../crc32"),b=s("../signature");function w(h,M,x,j){f.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=M,this.zipPlatform=x,this.encodeFileName=j,this.streamFiles=h,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}l.inherits(w,f),w.prototype.push=function(h){var M=h.meta.percent||0,x=this.entriesCount,j=this._sources.length;this.accumulate?this.contentBuffer.push(h):(this.bytesWritten+=h.data.length,f.prototype.push.call(this,{data:h.data,meta:{currentFile:this.currentFile,percent:x?(M+100*(x-j-1))/x:100}}))},w.prototype.openedSource=function(h){this.currentSourceOffset=this.bytesWritten,this.currentFile=h.file.name;var M=this.streamFiles&&!h.file.dir;if(M){var x=d(h,M,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:x.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(h){this.accumulate=!1;var M=this.streamFiles&&!h.file.dir,x=d(h,M,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(x.dirRecord),M)this.push({data:(function(j){return b.DATA_DESCRIPTOR+u(j.crc32,4)+u(j.compressedSize,4)+u(j.uncompressedSize,4)})(h),meta:{percent:100}});else for(this.push({data:x.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var h=this.bytesWritten,M=0;M<this.dirRecords.length;M++)this.push({data:this.dirRecords[M],meta:{percent:100}});var x=this.bytesWritten-h,j=(function(_,E,C,A,D){var F=l.transformTo("string",D(A));return b.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(_,2)+u(_,2)+u(E,4)+u(C,4)+u(F.length,2)+F})(this.dirRecords.length,x,h,this.zipComment,this.encodeFileName);this.push({data:j,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(h){this._sources.push(h);var M=this;return h.on("data",function(x){M.processChunk(x)}),h.on("end",function(){M.closedSource(M.previous.streamInfo),M._sources.length?M.prepareNextSource():M.end()}),h.on("error",function(x){M.error(x)}),this},w.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(h){var M=this._sources;if(!f.prototype.error.call(this,h))return!1;for(var x=0;x<M.length;x++)try{M[x].error(h)}catch{}return!0},w.prototype.lock=function(){f.prototype.lock.call(this);for(var h=this._sources,M=0;M<h.length;M++)h[M].lock()},o.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(s,o,c){var u=s("../compressions"),d=s("./ZipFileWorker");c.generateWorker=function(l,f,m){var p=new d(f.streamFiles,m,f.platform,f.encodeFileName),b=0;try{l.forEach(function(w,h){b++;var M=(function(E,C){var A=E||C,D=u[A];if(!D)throw new Error(A+" is not a valid compression method !");return D})(h.options.compression,f.compression),x=h.options.compressionOptions||f.compressionOptions||{},j=h.dir,_=h.date;h._compressWorker(M,x).withStreamInfo("file",{name:w,dir:j,date:_,comment:h.comment||"",unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions}).pipe(p)}),p.entriesCount=b}catch(w){p.error(w)}return p}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(s,o,c){function u(){if(!(this instanceof u))return new u;if(arguments.length)throw new 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 d=new u;for(var l in this)typeof this[l]!="function"&&(d[l]=this[l]);return d}}(u.prototype=s("./object")).loadAsync=s("./load"),u.support=s("./support"),u.defaults=s("./defaults"),u.version="3.10.1",u.loadAsync=function(d,l){return new u().loadAsync(d,l)},u.external=s("./external"),o.exports=u},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(s,o,c){var u=s("./utils"),d=s("./external"),l=s("./utf8"),f=s("./zipEntries"),m=s("./stream/Crc32Probe"),p=s("./nodejsUtils");function b(w){return new d.Promise(function(h,M){var x=w.decompressed.getContentWorker().pipe(new m);x.on("error",function(j){M(j)}).on("end",function(){x.streamInfo.crc32!==w.decompressed.crc32?M(new Error("Corrupted zip : CRC32 mismatch")):h()}).resume()})}o.exports=function(w,h){var M=this;return h=u.extend(h||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:l.utf8decode}),p.isNode&&p.isStream(w)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):u.prepareContent("the loaded zip file",w,!0,h.optimizedBinaryString,h.base64).then(function(x){var j=new f(h);return j.load(x),j}).then(function(x){var j=[d.Promise.resolve(x)],_=x.files;if(h.checkCRC32)for(var E=0;E<_.length;E++)j.push(b(_[E]));return d.Promise.all(j)}).then(function(x){for(var j=x.shift(),_=j.files,E=0;E<_.length;E++){var C=_[E],A=C.fileNameStr,D=u.resolve(C.fileNameStr);M.file(D,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:h.createFolders}),C.dir||(M.file(D).unsafeOriginalName=A)}return j.zipComment.length&&(M.comment=j.zipComment),M})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(s,o,c){var u=s("../utils"),d=s("../stream/GenericWorker");function l(f,m){d.call(this,"Nodejs stream input adapter for "+f),this._upstreamEnded=!1,this._bindStream(m)}u.inherits(l,d),l.prototype._bindStream=function(f){var m=this;(this._stream=f).pause(),f.on("data",function(p){m.push({data:p,meta:{percent:0}})}).on("error",function(p){m.isPaused?this.generatedError=p:m.error(p)}).on("end",function(){m.isPaused?m._upstreamEnded=!0:m.end()})},l.prototype.pause=function(){return!!d.prototype.pause.call(this)&&(this._stream.pause(),!0)},l.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},o.exports=l},{"../stream/GenericWorker":28,"../utils":32}],13:[function(s,o,c){var u=s("readable-stream").Readable;function d(l,f,m){u.call(this,f),this._helper=l;var p=this;l.on("data",function(b,w){p.push(b)||p._helper.pause(),m&&m(w)}).on("error",function(b){p.emit("error",b)}).on("end",function(){p.push(null)})}s("../utils").inherits(d,u),d.prototype._read=function(){this._helper.resume()},o.exports=d},{"../utils":32,"readable-stream":16}],14:[function(s,o,c){o.exports={isNode:typeof Buffer<"u",newBufferFrom:function(u,d){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(u,d);if(typeof u=="number")throw new Error('The "data" argument must not be a number');return new Buffer(u,d)},allocBuffer:function(u){if(Buffer.alloc)return Buffer.alloc(u);var d=new Buffer(u);return d.fill(0),d},isBuffer:function(u){return Buffer.isBuffer(u)},isStream:function(u){return u&&typeof u.on=="function"&&typeof u.pause=="function"&&typeof u.resume=="function"}}},{}],15:[function(s,o,c){function u(D,F,O){var q,P=l.getTypeOf(F),U=l.extend(O||{},p);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(D=_(D)),U.createFolders&&(q=j(D))&&E.call(this,q,!0);var K=P==="string"&&U.binary===!1&&U.base64===!1;O&&O.binary!==void 0||(U.binary=!K),(F instanceof b&&F.uncompressedSize===0||U.dir||!F||F.length===0)&&(U.base64=!1,U.binary=!0,F="",U.compression="STORE",P="string");var $=null;$=F instanceof b||F instanceof f?F:M.isNode&&M.isStream(F)?new x(D,F):l.prepareContent(D,F,U.binary,U.optimizedBinaryString,U.base64);var Q=new w(D,$,U);this.files[D]=Q}var d=s("./utf8"),l=s("./utils"),f=s("./stream/GenericWorker"),m=s("./stream/StreamHelper"),p=s("./defaults"),b=s("./compressedObject"),w=s("./zipObject"),h=s("./generate"),M=s("./nodejsUtils"),x=s("./nodejs/NodejsStreamInputAdapter"),j=function(D){D.slice(-1)==="/"&&(D=D.substring(0,D.length-1));var F=D.lastIndexOf("/");return 0<F?D.substring(0,F):""},_=function(D){return D.slice(-1)!=="/"&&(D+="/"),D},E=function(D,F){return F=F!==void 0?F:p.createFolders,D=_(D),this.files[D]||u.call(this,D,null,{dir:!0,createFolders:F}),this.files[D]};function C(D){return Object.prototype.toString.call(D)==="[object RegExp]"}var A={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(D){var F,O,q;for(F in this.files)q=this.files[F],(O=F.slice(this.root.length,F.length))&&F.slice(0,this.root.length)===this.root&&D(O,q)},filter:function(D){var F=[];return this.forEach(function(O,q){D(O,q)&&F.push(q)}),F},file:function(D,F,O){if(arguments.length!==1)return D=this.root+D,u.call(this,D,F,O),this;if(C(D)){var q=D;return this.filter(function(U,K){return!K.dir&&q.test(U)})}var P=this.files[this.root+D];return P&&!P.dir?P:null},folder:function(D){if(!D)return this;if(C(D))return this.filter(function(P,U){return U.dir&&D.test(P)});var F=this.root+D,O=E.call(this,F),q=this.clone();return q.root=O.name,q},remove:function(D){D=this.root+D;var F=this.files[D];if(F||(D.slice(-1)!=="/"&&(D+="/"),F=this.files[D]),F&&!F.dir)delete this.files[D];else for(var O=this.filter(function(P,U){return U.name.slice(0,D.length)===D}),q=0;q<O.length;q++)delete this.files[O[q].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(D){var F,O={};try{if((O=l.extend(D||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=O.type.toLowerCase(),O.compression=O.compression.toUpperCase(),O.type==="binarystring"&&(O.type="string"),!O.type)throw new Error("No output type specified.");l.checkSupport(O.type),O.platform!=="darwin"&&O.platform!=="freebsd"&&O.platform!=="linux"&&O.platform!=="sunos"||(O.platform="UNIX"),O.platform==="win32"&&(O.platform="DOS");var q=O.comment||this.comment||"";F=h.generateWorker(this,O,q)}catch(P){(F=new f("error")).error(P)}return new m(F,O.type||"string",O.mimeType)},generateAsync:function(D,F){return this.generateInternalStream(D).accumulate(F)},generateNodeStream:function(D,F){return(D=D||{}).type||(D.type="nodebuffer"),this.generateInternalStream(D).toNodejsStream(F)}};o.exports=A},{"./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(s,o,c){o.exports=s("stream")},{stream:void 0}],17:[function(s,o,c){var u=s("./DataReader");function d(l){u.call(this,l);for(var f=0;f<this.data.length;f++)l[f]=255&l[f]}s("../utils").inherits(d,u),d.prototype.byteAt=function(l){return this.data[this.zero+l]},d.prototype.lastIndexOfSignature=function(l){for(var f=l.charCodeAt(0),m=l.charCodeAt(1),p=l.charCodeAt(2),b=l.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===f&&this.data[w+1]===m&&this.data[w+2]===p&&this.data[w+3]===b)return w-this.zero;return-1},d.prototype.readAndCheckSignature=function(l){var f=l.charCodeAt(0),m=l.charCodeAt(1),p=l.charCodeAt(2),b=l.charCodeAt(3),w=this.readData(4);return f===w[0]&&m===w[1]&&p===w[2]&&b===w[3]},d.prototype.readData=function(l){if(this.checkOffset(l),l===0)return[];var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./DataReader":18}],18:[function(s,o,c){var u=s("../utils");function d(l){this.data=l,this.length=l.length,this.index=0,this.zero=0}d.prototype={checkOffset:function(l){this.checkIndex(this.index+l)},checkIndex:function(l){if(this.length<this.zero+l||l<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+l+"). Corrupted zip ?")},setIndex:function(l){this.checkIndex(l),this.index=l},skip:function(l){this.setIndex(this.index+l)},byteAt:function(){},readInt:function(l){var f,m=0;for(this.checkOffset(l),f=this.index+l-1;f>=this.index;f--)m=(m<<8)+this.byteAt(f);return this.index+=l,m},readString:function(l){return u.transformTo("string",this.readData(l))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var l=this.readInt(4);return new Date(Date.UTC(1980+(l>>25&127),(l>>21&15)-1,l>>16&31,l>>11&31,l>>5&63,(31&l)<<1))}},o.exports=d},{"../utils":32}],19:[function(s,o,c){var u=s("./Uint8ArrayReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.readData=function(l){this.checkOffset(l);var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(s,o,c){var u=s("./DataReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.byteAt=function(l){return this.data.charCodeAt(this.zero+l)},d.prototype.lastIndexOfSignature=function(l){return this.data.lastIndexOf(l)-this.zero},d.prototype.readAndCheckSignature=function(l){return l===this.readData(4)},d.prototype.readData=function(l){this.checkOffset(l);var f=this.data.slice(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./DataReader":18}],21:[function(s,o,c){var u=s("./ArrayReader");function d(l){u.call(this,l)}s("../utils").inherits(d,u),d.prototype.readData=function(l){if(this.checkOffset(l),l===0)return new Uint8Array(0);var f=this.data.subarray(this.zero+this.index,this.zero+this.index+l);return this.index+=l,f},o.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(s,o,c){var u=s("../utils"),d=s("../support"),l=s("./ArrayReader"),f=s("./StringReader"),m=s("./NodeBufferReader"),p=s("./Uint8ArrayReader");o.exports=function(b){var w=u.getTypeOf(b);return u.checkSupport(w),w!=="string"||d.uint8array?w==="nodebuffer"?new m(b):d.uint8array?new p(u.transformTo("uint8array",b)):new l(u.transformTo("array",b)):new f(b)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(s,o,c){c.LOCAL_FILE_HEADER="PK",c.CENTRAL_FILE_HEADER="PK",c.CENTRAL_DIRECTORY_END="PK",c.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",c.ZIP64_CENTRAL_DIRECTORY_END="PK",c.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(s,o,c){var u=s("./GenericWorker"),d=s("../utils");function l(f){u.call(this,"ConvertWorker to "+f),this.destType=f}d.inherits(l,u),l.prototype.processChunk=function(f){this.push({data:d.transformTo(this.destType,f.data),meta:f.meta})},o.exports=l},{"../utils":32,"./GenericWorker":28}],25:[function(s,o,c){var u=s("./GenericWorker"),d=s("../crc32");function l(){u.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}s("../utils").inherits(l,u),l.prototype.processChunk=function(f){this.streamInfo.crc32=d(f.data,this.streamInfo.crc32||0),this.push(f)},o.exports=l},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(s,o,c){var u=s("../utils"),d=s("./GenericWorker");function l(f){d.call(this,"DataLengthProbe for "+f),this.propName=f,this.withStreamInfo(f,0)}u.inherits(l,d),l.prototype.processChunk=function(f){if(f){var m=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=m+f.data.length}d.prototype.processChunk.call(this,f)},o.exports=l},{"../utils":32,"./GenericWorker":28}],27:[function(s,o,c){var u=s("../utils"),d=s("./GenericWorker");function l(f){d.call(this,"DataWorker");var m=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,f.then(function(p){m.dataIsReady=!0,m.data=p,m.max=p&&p.length||0,m.type=u.getTypeOf(p),m.isPaused||m._tickAndRepeat()},function(p){m.error(p)})}u.inherits(l,d),l.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},l.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,u.delay(this._tickAndRepeat,[],this)),!0)},l.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(u.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},l.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var f=null,m=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":f=this.data.substring(this.index,m);break;case"uint8array":f=this.data.subarray(this.index,m);break;case"array":case"nodebuffer":f=this.data.slice(this.index,m)}return this.index=m,this.push({data:f,meta:{percent:this.max?this.index/this.max*100:0}})},o.exports=l},{"../utils":32,"./GenericWorker":28}],28:[function(s,o,c){function u(d){this.name=d||"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}u.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,l){return this._listeners[d].push(l),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,l){if(this._listeners[d])for(var f=0;f<this._listeners[d].length;f++)this._listeners[d][f].call(this,l)},pipe:function(d){return d.registerPrevious(this)},registerPrevious:function(d){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=d.streamInfo,this.mergeStreamInfo(),this.previous=d;var l=this;return d.on("data",function(f){l.processChunk(f)}),d.on("end",function(){l.end()}),d.on("error",function(f){l.error(f)}),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 d=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),d=!0),this.previous&&this.previous.resume(),!d},flush:function(){},processChunk:function(d){this.push(d)},withStreamInfo:function(d,l){return this.extraStreamInfo[d]=l,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var d in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,d)&&(this.streamInfo[d]=this.extraStreamInfo[d])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var d="Worker "+this.name;return this.previous?this.previous+" -> "+d:d}},o.exports=u},{}],29:[function(s,o,c){var u=s("../utils"),d=s("./ConvertWorker"),l=s("./GenericWorker"),f=s("../base64"),m=s("../support"),p=s("../external"),b=null;if(m.nodestream)try{b=s("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(M,x){return new p.Promise(function(j,_){var E=[],C=M._internalType,A=M._outputType,D=M._mimeType;M.on("data",function(F,O){E.push(F),x&&x(O)}).on("error",function(F){E=[],_(F)}).on("end",function(){try{var F=(function(O,q,P){switch(O){case"blob":return u.newBlob(u.transformTo("arraybuffer",q),P);case"base64":return f.encode(q);default:return u.transformTo(O,q)}})(A,(function(O,q){var P,U=0,K=null,$=0;for(P=0;P<q.length;P++)$+=q[P].length;switch(O){case"string":return q.join("");case"array":return Array.prototype.concat.apply([],q);case"uint8array":for(K=new Uint8Array($),P=0;P<q.length;P++)K.set(q[P],U),U+=q[P].length;return K;case"nodebuffer":return Buffer.concat(q);default:throw new Error("concat : unsupported type '"+O+"'")}})(C,E),D);j(F)}catch(O){_(O)}E=[]}).resume()})}function h(M,x,j){var _=x;switch(x){case"blob":case"arraybuffer":_="uint8array";break;case"base64":_="string"}try{this._internalType=_,this._outputType=x,this._mimeType=j,u.checkSupport(_),this._worker=M.pipe(new d(_)),M.lock()}catch(E){this._worker=new l("error"),this._worker.error(E)}}h.prototype={accumulate:function(M){return w(this,M)},on:function(M,x){var j=this;return M==="data"?this._worker.on(M,function(_){x.call(j,_.data,_.meta)}):this._worker.on(M,function(){u.delay(x,arguments,j)}),this},resume:function(){return u.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(M){if(u.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new b(this,{objectMode:this._outputType!=="nodebuffer"},M)}},o.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(s,o,c){if(c.base64=!0,c.array=!0,c.string=!0,c.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",c.nodebuffer=typeof Buffer<"u",c.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")c.blob=!1;else{var u=new ArrayBuffer(0);try{c.blob=new Blob([u],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(u),c.blob=d.getBlob("application/zip").size===0}catch{c.blob=!1}}}try{c.nodestream=!!s("readable-stream").Readable}catch{c.nodestream=!1}},{"readable-stream":16}],31:[function(s,o,c){for(var u=s("./utils"),d=s("./support"),l=s("./nodejsUtils"),f=s("./stream/GenericWorker"),m=new Array(256),p=0;p<256;p++)m[p]=252<=p?6:248<=p?5:240<=p?4:224<=p?3:192<=p?2:1;m[254]=m[254]=1;function b(){f.call(this,"utf-8 decode"),this.leftOver=null}function w(){f.call(this,"utf-8 encode")}c.utf8encode=function(h){return d.nodebuffer?l.newBufferFrom(h,"utf-8"):(function(M){var x,j,_,E,C,A=M.length,D=0;for(E=0;E<A;E++)(64512&(j=M.charCodeAt(E)))==55296&&E+1<A&&(64512&(_=M.charCodeAt(E+1)))==56320&&(j=65536+(j-55296<<10)+(_-56320),E++),D+=j<128?1:j<2048?2:j<65536?3:4;for(x=d.uint8array?new Uint8Array(D):new Array(D),E=C=0;C<D;E++)(64512&(j=M.charCodeAt(E)))==55296&&E+1<A&&(64512&(_=M.charCodeAt(E+1)))==56320&&(j=65536+(j-55296<<10)+(_-56320),E++),j<128?x[C++]=j:(j<2048?x[C++]=192|j>>>6:(j<65536?x[C++]=224|j>>>12:(x[C++]=240|j>>>18,x[C++]=128|j>>>12&63),x[C++]=128|j>>>6&63),x[C++]=128|63&j);return x})(h)},c.utf8decode=function(h){return d.nodebuffer?u.transformTo("nodebuffer",h).toString("utf-8"):(function(M){var x,j,_,E,C=M.length,A=new Array(2*C);for(x=j=0;x<C;)if((_=M[x++])<128)A[j++]=_;else if(4<(E=m[_]))A[j++]=65533,x+=E-1;else{for(_&=E===2?31:E===3?15:7;1<E&&x<C;)_=_<<6|63&M[x++],E--;1<E?A[j++]=65533:_<65536?A[j++]=_:(_-=65536,A[j++]=55296|_>>10&1023,A[j++]=56320|1023&_)}return A.length!==j&&(A.subarray?A=A.subarray(0,j):A.length=j),u.applyFromCharCode(A)})(h=u.transformTo(d.uint8array?"uint8array":"array",h))},u.inherits(b,f),b.prototype.processChunk=function(h){var M=u.transformTo(d.uint8array?"uint8array":"array",h.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var x=M;(M=new Uint8Array(x.length+this.leftOver.length)).set(this.leftOver,0),M.set(x,this.leftOver.length)}else M=this.leftOver.concat(M);this.leftOver=null}var j=(function(E,C){var A;for((C=C||E.length)>E.length&&(C=E.length),A=C-1;0<=A&&(192&E[A])==128;)A--;return A<0||A===0?C:A+m[E[A]]>C?A:C})(M),_=M;j!==M.length&&(d.uint8array?(_=M.subarray(0,j),this.leftOver=M.subarray(j,M.length)):(_=M.slice(0,j),this.leftOver=M.slice(j,M.length))),this.push({data:c.utf8decode(_),meta:h.meta})},b.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:c.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},c.Utf8DecodeWorker=b,u.inherits(w,f),w.prototype.processChunk=function(h){this.push({data:c.utf8encode(h.data),meta:h.meta})},c.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(s,o,c){var u=s("./support"),d=s("./base64"),l=s("./nodejsUtils"),f=s("./external");function m(x){return x}function p(x,j){for(var _=0;_<x.length;++_)j[_]=255&x.charCodeAt(_);return j}s("setimmediate"),c.newBlob=function(x,j){c.checkSupport("blob");try{return new Blob([x],{type:j})}catch{try{var _=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return _.append(x),_.getBlob(j)}catch{throw new Error("Bug : can't construct the Blob.")}}};var b={stringifyByChunk:function(x,j,_){var E=[],C=0,A=x.length;if(A<=_)return String.fromCharCode.apply(null,x);for(;C<A;)j==="array"||j==="nodebuffer"?E.push(String.fromCharCode.apply(null,x.slice(C,Math.min(C+_,A)))):E.push(String.fromCharCode.apply(null,x.subarray(C,Math.min(C+_,A)))),C+=_;return E.join("")},stringifyByChar:function(x){for(var j="",_=0;_<x.length;_++)j+=String.fromCharCode(x[_]);return j},applyCanBeUsed:{uint8array:(function(){try{return u.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return u.nodebuffer&&String.fromCharCode.apply(null,l.allocBuffer(1)).length===1}catch{return!1}})()}};function w(x){var j=65536,_=c.getTypeOf(x),E=!0;if(_==="uint8array"?E=b.applyCanBeUsed.uint8array:_==="nodebuffer"&&(E=b.applyCanBeUsed.nodebuffer),E)for(;1<j;)try{return b.stringifyByChunk(x,_,j)}catch{j=Math.floor(j/2)}return b.stringifyByChar(x)}function h(x,j){for(var _=0;_<x.length;_++)j[_]=x[_];return j}c.applyFromCharCode=w;var M={};M.string={string:m,array:function(x){return p(x,new Array(x.length))},arraybuffer:function(x){return M.string.uint8array(x).buffer},uint8array:function(x){return p(x,new Uint8Array(x.length))},nodebuffer:function(x){return p(x,l.allocBuffer(x.length))}},M.array={string:w,array:m,arraybuffer:function(x){return new Uint8Array(x).buffer},uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return l.newBufferFrom(x)}},M.arraybuffer={string:function(x){return w(new Uint8Array(x))},array:function(x){return h(new Uint8Array(x),new Array(x.byteLength))},arraybuffer:m,uint8array:function(x){return new Uint8Array(x)},nodebuffer:function(x){return l.newBufferFrom(new Uint8Array(x))}},M.uint8array={string:w,array:function(x){return h(x,new Array(x.length))},arraybuffer:function(x){return x.buffer},uint8array:m,nodebuffer:function(x){return l.newBufferFrom(x)}},M.nodebuffer={string:w,array:function(x){return h(x,new Array(x.length))},arraybuffer:function(x){return M.nodebuffer.uint8array(x).buffer},uint8array:function(x){return h(x,new Uint8Array(x.length))},nodebuffer:m},c.transformTo=function(x,j){if(j=j||"",!x)return j;c.checkSupport(x);var _=c.getTypeOf(j);return M[_][x](j)},c.resolve=function(x){for(var j=x.split("/"),_=[],E=0;E<j.length;E++){var C=j[E];C==="."||C===""&&E!==0&&E!==j.length-1||(C===".."?_.pop():_.push(C))}return _.join("/")},c.getTypeOf=function(x){return typeof x=="string"?"string":Object.prototype.toString.call(x)==="[object Array]"?"array":u.nodebuffer&&l.isBuffer(x)?"nodebuffer":u.uint8array&&x instanceof Uint8Array?"uint8array":u.arraybuffer&&x instanceof ArrayBuffer?"arraybuffer":void 0},c.checkSupport=function(x){if(!u[x.toLowerCase()])throw new Error(x+" is not supported by this platform")},c.MAX_VALUE_16BITS=65535,c.MAX_VALUE_32BITS=-1,c.pretty=function(x){var j,_,E="";for(_=0;_<(x||"").length;_++)E+="\\x"+((j=x.charCodeAt(_))<16?"0":"")+j.toString(16).toUpperCase();return E},c.delay=function(x,j,_){setImmediate(function(){x.apply(_||null,j||[])})},c.inherits=function(x,j){function _(){}_.prototype=j.prototype,x.prototype=new _},c.extend=function(){var x,j,_={};for(x=0;x<arguments.length;x++)for(j in arguments[x])Object.prototype.hasOwnProperty.call(arguments[x],j)&&_[j]===void 0&&(_[j]=arguments[x][j]);return _},c.prepareContent=function(x,j,_,E,C){return f.Promise.resolve(j).then(function(A){return u.blob&&(A instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(A))!==-1)&&typeof FileReader<"u"?new f.Promise(function(D,F){var O=new FileReader;O.onload=function(q){D(q.target.result)},O.onerror=function(q){F(q.target.error)},O.readAsArrayBuffer(A)}):A}).then(function(A){var D=c.getTypeOf(A);return D?(D==="arraybuffer"?A=c.transformTo("uint8array",A):D==="string"&&(C?A=d.decode(A):_&&E!==!0&&(A=(function(F){return p(F,u.uint8array?new Uint8Array(F.length):new Array(F.length))})(A))),A):f.Promise.reject(new Error("Can't read the data of '"+x+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(s,o,c){var u=s("./reader/readerFor"),d=s("./utils"),l=s("./signature"),f=s("./zipEntry"),m=s("./support");function p(b){this.files=[],this.loadOptions=b}p.prototype={checkSignature:function(b){if(!this.reader.readAndCheckSignature(b)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(w)+", expected "+d.pretty(b)+")")}},isSignature:function(b,w){var h=this.reader.index;this.reader.setIndex(b);var M=this.reader.readString(4)===w;return this.reader.setIndex(h),M},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 b=this.reader.readData(this.zipCommentLength),w=m.uint8array?"uint8array":"array",h=d.transformTo(w,b);this.zipComment=this.loadOptions.decodeFileName(h)},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 b,w,h,M=this.zip64EndOfCentralSize-44;0<M;)b=this.reader.readInt(2),w=this.reader.readInt(4),h=this.reader.readData(w),this.zip64ExtensibleData[b]={id:b,length:w,value:h}},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 new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var b,w;for(b=0;b<this.files.length;b++)w=this.files[b],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(l.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var b;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(l.CENTRAL_FILE_HEADER);)(b=new f({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(b);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var b=this.reader.lastIndexOfSignature(l.CENTRAL_DIRECTORY_END);if(b<0)throw this.isSignature(0,l.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new 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(b);var w=b;if(this.checkSignature(l.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,(b=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(b),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,l.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(l.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var h=this.centralDirOffset+this.centralDirSize;this.zip64&&(h+=20,h+=12+this.zip64EndOfCentralSize);var M=w-h;if(0<M)this.isSignature(w,l.CENTRAL_FILE_HEADER)||(this.reader.zero=M);else if(M<0)throw new Error("Corrupted zip: missing "+Math.abs(M)+" bytes.")},prepareReader:function(b){this.reader=u(b)},load:function(b){this.prepareReader(b),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},o.exports=p},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(s,o,c){var u=s("./reader/readerFor"),d=s("./utils"),l=s("./compressedObject"),f=s("./crc32"),m=s("./utf8"),p=s("./compressions"),b=s("./support");function w(h,M){this.options=h,this.loadOptions=M}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(h){var M,x;if(h.skip(22),this.fileNameLength=h.readInt(2),x=h.readInt(2),this.fileName=h.readData(this.fileNameLength),h.skip(x),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((M=(function(j){for(var _ in p)if(Object.prototype.hasOwnProperty.call(p,_)&&p[_].magic===j)return p[_];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new l(this.compressedSize,this.uncompressedSize,this.crc32,M,h.readData(this.compressedSize))},readCentralPart:function(h){this.versionMadeBy=h.readInt(2),h.skip(2),this.bitFlag=h.readInt(2),this.compressionMethod=h.readString(2),this.date=h.readDate(),this.crc32=h.readInt(4),this.compressedSize=h.readInt(4),this.uncompressedSize=h.readInt(4);var M=h.readInt(2);if(this.extraFieldsLength=h.readInt(2),this.fileCommentLength=h.readInt(2),this.diskNumberStart=h.readInt(2),this.internalFileAttributes=h.readInt(2),this.externalFileAttributes=h.readInt(4),this.localHeaderOffset=h.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");h.skip(M),this.readExtraFields(h),this.parseZIP64ExtraField(h),this.fileComment=h.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var h=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),h==0&&(this.dosPermissions=63&this.externalFileAttributes),h==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var h=u(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=h.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=h.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=h.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=h.readInt(4))}},readExtraFields:function(h){var M,x,j,_=h.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});h.index+4<_;)M=h.readInt(2),x=h.readInt(2),j=h.readData(x),this.extraFields[M]={id:M,length:x,value:j};h.setIndex(_)},handleUTF8:function(){var h=b.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=m.utf8decode(this.fileName),this.fileCommentStr=m.utf8decode(this.fileComment);else{var M=this.findExtraFieldUnicodePath();if(M!==null)this.fileNameStr=M;else{var x=d.transformTo(h,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(x)}var j=this.findExtraFieldUnicodeComment();if(j!==null)this.fileCommentStr=j;else{var _=d.transformTo(h,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(_)}}},findExtraFieldUnicodePath:function(){var h=this.extraFields[28789];if(h){var M=u(h.value);return M.readInt(1)!==1||f(this.fileName)!==M.readInt(4)?null:m.utf8decode(M.readData(h.length-5))}return null},findExtraFieldUnicodeComment:function(){var h=this.extraFields[25461];if(h){var M=u(h.value);return M.readInt(1)!==1||f(this.fileComment)!==M.readInt(4)?null:m.utf8decode(M.readData(h.length-5))}return null}},o.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(s,o,c){function u(M,x,j){this.name=M,this.dir=j.dir,this.date=j.date,this.comment=j.comment,this.unixPermissions=j.unixPermissions,this.dosPermissions=j.dosPermissions,this._data=x,this._dataBinary=j.binary,this.options={compression:j.compression,compressionOptions:j.compressionOptions}}var d=s("./stream/StreamHelper"),l=s("./stream/DataWorker"),f=s("./utf8"),m=s("./compressedObject"),p=s("./stream/GenericWorker");u.prototype={internalStream:function(M){var x=null,j="string";try{if(!M)throw new Error("No output type specified.");var _=(j=M.toLowerCase())==="string"||j==="text";j!=="binarystring"&&j!=="text"||(j="string"),x=this._decompressWorker();var E=!this._dataBinary;E&&!_&&(x=x.pipe(new f.Utf8EncodeWorker)),!E&&_&&(x=x.pipe(new f.Utf8DecodeWorker))}catch(C){(x=new p("error")).error(C)}return new d(x,j,"")},async:function(M,x){return this.internalStream(M).accumulate(x)},nodeStream:function(M,x){return this.internalStream(M||"nodebuffer").toNodejsStream(x)},_compressWorker:function(M,x){if(this._data instanceof m&&this._data.compression.magic===M.magic)return this._data.getCompressedWorker();var j=this._decompressWorker();return this._dataBinary||(j=j.pipe(new f.Utf8EncodeWorker)),m.createWorkerFrom(j,M,x)},_decompressWorker:function(){return this._data instanceof m?this._data.getContentWorker():this._data instanceof p?this._data:new l(this._data)}};for(var b=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<b.length;h++)u.prototype[b[h]]=w;o.exports=u},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(s,o,c){(function(u){var d,l,f=u.MutationObserver||u.WebKitMutationObserver;if(f){var m=0,p=new f(M),b=u.document.createTextNode("");p.observe(b,{characterData:!0}),d=function(){b.data=m=++m%2}}else if(u.setImmediate||u.MessageChannel===void 0)d="document"in u&&"onreadystatechange"in u.document.createElement("script")?function(){var x=u.document.createElement("script");x.onreadystatechange=function(){M(),x.onreadystatechange=null,x.parentNode.removeChild(x),x=null},u.document.documentElement.appendChild(x)}:function(){setTimeout(M,0)};else{var w=new u.MessageChannel;w.port1.onmessage=M,d=function(){w.port2.postMessage(0)}}var h=[];function M(){var x,j;l=!0;for(var _=h.length;_;){for(j=h,h=[],x=-1;++x<_;)j[x]();_=h.length}l=!1}o.exports=function(x){h.push(x)!==1||l||d()}}).call(this,typeof Or<"u"?Or:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(s,o,c){var u=s("immediate");function d(){}var l={},f=["REJECTED"],m=["FULFILLED"],p=["PENDING"];function b(_){if(typeof _!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,_!==d&&x(this,_)}function w(_,E,C){this.promise=_,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function h(_,E,C){u(function(){var A;try{A=E(C)}catch(D){return l.reject(_,D)}A===_?l.reject(_,new TypeError("Cannot resolve promise with itself")):l.resolve(_,A)})}function M(_){var E=_&&_.then;if(_&&(typeof _=="object"||typeof _=="function")&&typeof E=="function")return function(){E.apply(_,arguments)}}function x(_,E){var C=!1;function A(O){C||(C=!0,l.reject(_,O))}function D(O){C||(C=!0,l.resolve(_,O))}var F=j(function(){E(D,A)});F.status==="error"&&A(F.value)}function j(_,E){var C={};try{C.value=_(E),C.status="success"}catch(A){C.status="error",C.value=A}return C}(o.exports=b).prototype.finally=function(_){if(typeof _!="function")return this;var E=this.constructor;return this.then(function(C){return E.resolve(_()).then(function(){return C})},function(C){return E.resolve(_()).then(function(){throw C})})},b.prototype.catch=function(_){return this.then(null,_)},b.prototype.then=function(_,E){if(typeof _!="function"&&this.state===m||typeof E!="function"&&this.state===f)return this;var C=new this.constructor(d);return this.state!==p?h(C,this.state===m?_:E,this.outcome):this.queue.push(new w(C,_,E)),C},w.prototype.callFulfilled=function(_){l.resolve(this.promise,_)},w.prototype.otherCallFulfilled=function(_){h(this.promise,this.onFulfilled,_)},w.prototype.callRejected=function(_){l.reject(this.promise,_)},w.prototype.otherCallRejected=function(_){h(this.promise,this.onRejected,_)},l.resolve=function(_,E){var C=j(M,E);if(C.status==="error")return l.reject(_,C.value);var A=C.value;if(A)x(_,A);else{_.state=m,_.outcome=E;for(var D=-1,F=_.queue.length;++D<F;)_.queue[D].callFulfilled(E)}return _},l.reject=function(_,E){_.state=f,_.outcome=E;for(var C=-1,A=_.queue.length;++C<A;)_.queue[C].callRejected(E);return _},b.resolve=function(_){return _ instanceof this?_:l.resolve(new this(d),_)},b.reject=function(_){var E=new this(d);return l.reject(E,_)},b.all=function(_){var E=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=_.length,A=!1;if(!C)return this.resolve([]);for(var D=new Array(C),F=0,O=-1,q=new this(d);++O<C;)P(_[O],O);return q;function P(U,K){E.resolve(U).then(function($){D[K]=$,++F!==C||A||(A=!0,l.resolve(q,D))},function($){A||(A=!0,l.reject(q,$))})}},b.race=function(_){var E=this;if(Object.prototype.toString.call(_)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=_.length,A=!1;if(!C)return this.resolve([]);for(var D=-1,F=new this(d);++D<C;)O=_[D],E.resolve(O).then(function(q){A||(A=!0,l.resolve(F,q))},function(q){A||(A=!0,l.reject(F,q))});var O;return F}},{immediate:36}],38:[function(s,o,c){var u={};(0,s("./lib/utils/common").assign)(u,s("./lib/deflate"),s("./lib/inflate"),s("./lib/zlib/constants")),o.exports=u},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(s,o,c){var u=s("./zlib/deflate"),d=s("./utils/common"),l=s("./utils/strings"),f=s("./zlib/messages"),m=s("./zlib/zstream"),p=Object.prototype.toString,b=0,w=-1,h=0,M=8;function x(_){if(!(this instanceof x))return new x(_);this.options=d.assign({level:w,method:M,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},_||{});var E=this.options;E.raw&&0<E.windowBits?E.windowBits=-E.windowBits:E.gzip&&0<E.windowBits&&E.windowBits<16&&(E.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m,this.strm.avail_out=0;var C=u.deflateInit2(this.strm,E.level,E.method,E.windowBits,E.memLevel,E.strategy);if(C!==b)throw new Error(f[C]);if(E.header&&u.deflateSetHeader(this.strm,E.header),E.dictionary){var A;if(A=typeof E.dictionary=="string"?l.string2buf(E.dictionary):p.call(E.dictionary)==="[object ArrayBuffer]"?new Uint8Array(E.dictionary):E.dictionary,(C=u.deflateSetDictionary(this.strm,A))!==b)throw new Error(f[C]);this._dict_set=!0}}function j(_,E){var C=new x(E);if(C.push(_,!0),C.err)throw C.msg||f[C.err];return C.result}x.prototype.push=function(_,E){var C,A,D=this.strm,F=this.options.chunkSize;if(this.ended)return!1;A=E===~~E?E:E===!0?4:0,typeof _=="string"?D.input=l.string2buf(_):p.call(_)==="[object ArrayBuffer]"?D.input=new Uint8Array(_):D.input=_,D.next_in=0,D.avail_in=D.input.length;do{if(D.avail_out===0&&(D.output=new d.Buf8(F),D.next_out=0,D.avail_out=F),(C=u.deflate(D,A))!==1&&C!==b)return this.onEnd(C),!(this.ended=!0);D.avail_out!==0&&(D.avail_in!==0||A!==4&&A!==2)||(this.options.to==="string"?this.onData(l.buf2binstring(d.shrinkBuf(D.output,D.next_out))):this.onData(d.shrinkBuf(D.output,D.next_out)))}while((0<D.avail_in||D.avail_out===0)&&C!==1);return A===4?(C=u.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===b):A!==2||(this.onEnd(b),!(D.avail_out=0))},x.prototype.onData=function(_){this.chunks.push(_)},x.prototype.onEnd=function(_){_===b&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},c.Deflate=x,c.deflate=j,c.deflateRaw=function(_,E){return(E=E||{}).raw=!0,j(_,E)},c.gzip=function(_,E){return(E=E||{}).gzip=!0,j(_,E)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(s,o,c){var u=s("./zlib/inflate"),d=s("./utils/common"),l=s("./utils/strings"),f=s("./zlib/constants"),m=s("./zlib/messages"),p=s("./zlib/zstream"),b=s("./zlib/gzheader"),w=Object.prototype.toString;function h(x){if(!(this instanceof h))return new h(x);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},x||{});var j=this.options;j.raw&&0<=j.windowBits&&j.windowBits<16&&(j.windowBits=-j.windowBits,j.windowBits===0&&(j.windowBits=-15)),!(0<=j.windowBits&&j.windowBits<16)||x&&x.windowBits||(j.windowBits+=32),15<j.windowBits&&j.windowBits<48&&(15&j.windowBits)==0&&(j.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new p,this.strm.avail_out=0;var _=u.inflateInit2(this.strm,j.windowBits);if(_!==f.Z_OK)throw new Error(m[_]);this.header=new b,u.inflateGetHeader(this.strm,this.header)}function M(x,j){var _=new h(j);if(_.push(x,!0),_.err)throw _.msg||m[_.err];return _.result}h.prototype.push=function(x,j){var _,E,C,A,D,F,O=this.strm,q=this.options.chunkSize,P=this.options.dictionary,U=!1;if(this.ended)return!1;E=j===~~j?j:j===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof x=="string"?O.input=l.binstring2buf(x):w.call(x)==="[object ArrayBuffer]"?O.input=new Uint8Array(x):O.input=x,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new d.Buf8(q),O.next_out=0,O.avail_out=q),(_=u.inflate(O,f.Z_NO_FLUSH))===f.Z_NEED_DICT&&P&&(F=typeof P=="string"?l.string2buf(P):w.call(P)==="[object ArrayBuffer]"?new Uint8Array(P):P,_=u.inflateSetDictionary(this.strm,F)),_===f.Z_BUF_ERROR&&U===!0&&(_=f.Z_OK,U=!1),_!==f.Z_STREAM_END&&_!==f.Z_OK)return this.onEnd(_),!(this.ended=!0);O.next_out&&(O.avail_out!==0&&_!==f.Z_STREAM_END&&(O.avail_in!==0||E!==f.Z_FINISH&&E!==f.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=l.utf8border(O.output,O.next_out),A=O.next_out-C,D=l.buf2string(O.output,C),O.next_out=A,O.avail_out=q-A,A&&d.arraySet(O.output,O.output,C,A,0),this.onData(D)):this.onData(d.shrinkBuf(O.output,O.next_out)))),O.avail_in===0&&O.avail_out===0&&(U=!0)}while((0<O.avail_in||O.avail_out===0)&&_!==f.Z_STREAM_END);return _===f.Z_STREAM_END&&(E=f.Z_FINISH),E===f.Z_FINISH?(_=u.inflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===f.Z_OK):E!==f.Z_SYNC_FLUSH||(this.onEnd(f.Z_OK),!(O.avail_out=0))},h.prototype.onData=function(x){this.chunks.push(x)},h.prototype.onEnd=function(x){x===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},c.Inflate=h,c.inflate=M,c.inflateRaw=function(x,j){return(j=j||{}).raw=!0,M(x,j)},c.ungzip=M},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(s,o,c){var u=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";c.assign=function(f){for(var m=Array.prototype.slice.call(arguments,1);m.length;){var p=m.shift();if(p){if(typeof p!="object")throw new TypeError(p+"must be non-object");for(var b in p)p.hasOwnProperty(b)&&(f[b]=p[b])}}return f},c.shrinkBuf=function(f,m){return f.length===m?f:f.subarray?f.subarray(0,m):(f.length=m,f)};var d={arraySet:function(f,m,p,b,w){if(m.subarray&&f.subarray)f.set(m.subarray(p,p+b),w);else for(var h=0;h<b;h++)f[w+h]=m[p+h]},flattenChunks:function(f){var m,p,b,w,h,M;for(m=b=0,p=f.length;m<p;m++)b+=f[m].length;for(M=new Uint8Array(b),m=w=0,p=f.length;m<p;m++)h=f[m],M.set(h,w),w+=h.length;return M}},l={arraySet:function(f,m,p,b,w){for(var h=0;h<b;h++)f[w+h]=m[p+h]},flattenChunks:function(f){return[].concat.apply([],f)}};c.setTyped=function(f){f?(c.Buf8=Uint8Array,c.Buf16=Uint16Array,c.Buf32=Int32Array,c.assign(c,d)):(c.Buf8=Array,c.Buf16=Array,c.Buf32=Array,c.assign(c,l))},c.setTyped(u)},{}],42:[function(s,o,c){var u=s("./common"),d=!0,l=!0;try{String.fromCharCode.apply(null,[0])}catch{d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{l=!1}for(var f=new u.Buf8(256),m=0;m<256;m++)f[m]=252<=m?6:248<=m?5:240<=m?4:224<=m?3:192<=m?2:1;function p(b,w){if(w<65537&&(b.subarray&&l||!b.subarray&&d))return String.fromCharCode.apply(null,u.shrinkBuf(b,w));for(var h="",M=0;M<w;M++)h+=String.fromCharCode(b[M]);return h}f[254]=f[254]=1,c.string2buf=function(b){var w,h,M,x,j,_=b.length,E=0;for(x=0;x<_;x++)(64512&(h=b.charCodeAt(x)))==55296&&x+1<_&&(64512&(M=b.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(M-56320),x++),E+=h<128?1:h<2048?2:h<65536?3:4;for(w=new u.Buf8(E),x=j=0;j<E;x++)(64512&(h=b.charCodeAt(x)))==55296&&x+1<_&&(64512&(M=b.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(M-56320),x++),h<128?w[j++]=h:(h<2048?w[j++]=192|h>>>6:(h<65536?w[j++]=224|h>>>12:(w[j++]=240|h>>>18,w[j++]=128|h>>>12&63),w[j++]=128|h>>>6&63),w[j++]=128|63&h);return w},c.buf2binstring=function(b){return p(b,b.length)},c.binstring2buf=function(b){for(var w=new u.Buf8(b.length),h=0,M=w.length;h<M;h++)w[h]=b.charCodeAt(h);return w},c.buf2string=function(b,w){var h,M,x,j,_=w||b.length,E=new Array(2*_);for(h=M=0;h<_;)if((x=b[h++])<128)E[M++]=x;else if(4<(j=f[x]))E[M++]=65533,h+=j-1;else{for(x&=j===2?31:j===3?15:7;1<j&&h<_;)x=x<<6|63&b[h++],j--;1<j?E[M++]=65533:x<65536?E[M++]=x:(x-=65536,E[M++]=55296|x>>10&1023,E[M++]=56320|1023&x)}return p(E,M)},c.utf8border=function(b,w){var h;for((w=w||b.length)>b.length&&(w=b.length),h=w-1;0<=h&&(192&b[h])==128;)h--;return h<0||h===0?w:h+f[b[h]]>w?h:w}},{"./common":41}],43:[function(s,o,c){o.exports=function(u,d,l,f){for(var m=65535&u|0,p=u>>>16&65535|0,b=0;l!==0;){for(l-=b=2e3<l?2e3:l;p=p+(m=m+d[f++]|0)|0,--b;);m%=65521,p%=65521}return m|p<<16|0}},{}],44:[function(s,o,c){o.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(s,o,c){var u=(function(){for(var d,l=[],f=0;f<256;f++){d=f;for(var m=0;m<8;m++)d=1&d?3988292384^d>>>1:d>>>1;l[f]=d}return l})();o.exports=function(d,l,f,m){var p=u,b=m+f;d^=-1;for(var w=m;w<b;w++)d=d>>>8^p[255&(d^l[w])];return-1^d}},{}],46:[function(s,o,c){var u,d=s("../utils/common"),l=s("./trees"),f=s("./adler32"),m=s("./crc32"),p=s("./messages"),b=0,w=4,h=0,M=-2,x=-1,j=4,_=2,E=8,C=9,A=286,D=30,F=19,O=2*A+1,q=15,P=3,U=258,K=U+P+1,$=42,Q=113,N=1,W=2,ae=3,ue=4;function be(T,ce){return T.msg=p[ce],ce}function de(T){return(T<<1)-(4<T?9:0)}function ie(T){for(var ce=T.length;0<=--ce;)T[ce]=0}function V(T){var ce=T.state,oe=ce.pending;oe>T.avail_out&&(oe=T.avail_out),oe!==0&&(d.arraySet(T.output,ce.pending_buf,ce.pending_out,oe,T.next_out),T.next_out+=oe,ce.pending_out+=oe,T.total_out+=oe,T.avail_out-=oe,ce.pending-=oe,ce.pending===0&&(ce.pending_out=0))}function G(T,ce){l._tr_flush_block(T,0<=T.block_start?T.block_start:-1,T.strstart-T.block_start,ce),T.block_start=T.strstart,V(T.strm)}function me(T,ce){T.pending_buf[T.pending++]=ce}function ee(T,ce){T.pending_buf[T.pending++]=ce>>>8&255,T.pending_buf[T.pending++]=255&ce}function xe(T,ce){var oe,Y,z=T.max_chain_length,te=T.strstart,pe=T.prev_length,fe=T.nice_match,re=T.strstart>T.w_size-K?T.strstart-(T.w_size-K):0,Me=T.window,Ne=T.w_mask,Se=T.prev,ze=T.strstart+U,gt=Me[te+pe-1],Qe=Me[te+pe];T.prev_length>=T.good_match&&(z>>=2),fe>T.lookahead&&(fe=T.lookahead);do if(Me[(oe=ce)+pe]===Qe&&Me[oe+pe-1]===gt&&Me[oe]===Me[te]&&Me[++oe]===Me[te+1]){te+=2,oe++;do;while(Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&Me[++te]===Me[++oe]&&te<ze);if(Y=U-(ze-te),te=ze-U,pe<Y){if(T.match_start=ce,fe<=(pe=Y))break;gt=Me[te+pe-1],Qe=Me[te+pe]}}while((ce=Se[ce&Ne])>re&&--z!=0);return pe<=T.lookahead?pe:T.lookahead}function Fe(T){var ce,oe,Y,z,te,pe,fe,re,Me,Ne,Se=T.w_size;do{if(z=T.window_size-T.lookahead-T.strstart,T.strstart>=Se+(Se-K)){for(d.arraySet(T.window,T.window,Se,Se,0),T.match_start-=Se,T.strstart-=Se,T.block_start-=Se,ce=oe=T.hash_size;Y=T.head[--ce],T.head[ce]=Se<=Y?Y-Se:0,--oe;);for(ce=oe=Se;Y=T.prev[--ce],T.prev[ce]=Se<=Y?Y-Se:0,--oe;);z+=Se}if(T.strm.avail_in===0)break;if(pe=T.strm,fe=T.window,re=T.strstart+T.lookahead,Me=z,Ne=void 0,Ne=pe.avail_in,Me<Ne&&(Ne=Me),oe=Ne===0?0:(pe.avail_in-=Ne,d.arraySet(fe,pe.input,pe.next_in,Ne,re),pe.state.wrap===1?pe.adler=f(pe.adler,fe,Ne,re):pe.state.wrap===2&&(pe.adler=m(pe.adler,fe,Ne,re)),pe.next_in+=Ne,pe.total_in+=Ne,Ne),T.lookahead+=oe,T.lookahead+T.insert>=P)for(te=T.strstart-T.insert,T.ins_h=T.window[te],T.ins_h=(T.ins_h<<T.hash_shift^T.window[te+1])&T.hash_mask;T.insert&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[te+P-1])&T.hash_mask,T.prev[te&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=te,te++,T.insert--,!(T.lookahead+T.insert<P)););}while(T.lookahead<K&&T.strm.avail_in!==0)}function qe(T,ce){for(var oe,Y;;){if(T.lookahead<K){if(Fe(T),T.lookahead<K&&ce===b)return N;if(T.lookahead===0)break}if(oe=0,T.lookahead>=P&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),oe!==0&&T.strstart-oe<=T.w_size-K&&(T.match_length=xe(T,oe)),T.match_length>=P)if(Y=l._tr_tally(T,T.strstart-T.match_start,T.match_length-P),T.lookahead-=T.match_length,T.match_length<=T.max_lazy_match&&T.lookahead>=P){for(T.match_length--;T.strstart++,T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart,--T.match_length!=0;);T.strstart++}else T.strstart+=T.match_length,T.match_length=0,T.ins_h=T.window[T.strstart],T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+1])&T.hash_mask;else Y=l._tr_tally(T,0,T.window[T.strstart]),T.lookahead--,T.strstart++;if(Y&&(G(T,!1),T.strm.avail_out===0))return N}return T.insert=T.strstart<P-1?T.strstart:P-1,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):T.last_lit&&(G(T,!1),T.strm.avail_out===0)?N:W}function Ue(T,ce){for(var oe,Y,z;;){if(T.lookahead<K){if(Fe(T),T.lookahead<K&&ce===b)return N;if(T.lookahead===0)break}if(oe=0,T.lookahead>=P&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),T.prev_length=T.match_length,T.prev_match=T.match_start,T.match_length=P-1,oe!==0&&T.prev_length<T.max_lazy_match&&T.strstart-oe<=T.w_size-K&&(T.match_length=xe(T,oe),T.match_length<=5&&(T.strategy===1||T.match_length===P&&4096<T.strstart-T.match_start)&&(T.match_length=P-1)),T.prev_length>=P&&T.match_length<=T.prev_length){for(z=T.strstart+T.lookahead-P,Y=l._tr_tally(T,T.strstart-1-T.prev_match,T.prev_length-P),T.lookahead-=T.prev_length-1,T.prev_length-=2;++T.strstart<=z&&(T.ins_h=(T.ins_h<<T.hash_shift^T.window[T.strstart+P-1])&T.hash_mask,oe=T.prev[T.strstart&T.w_mask]=T.head[T.ins_h],T.head[T.ins_h]=T.strstart),--T.prev_length!=0;);if(T.match_available=0,T.match_length=P-1,T.strstart++,Y&&(G(T,!1),T.strm.avail_out===0))return N}else if(T.match_available){if((Y=l._tr_tally(T,0,T.window[T.strstart-1]))&&G(T,!1),T.strstart++,T.lookahead--,T.strm.avail_out===0)return N}else T.match_available=1,T.strstart++,T.lookahead--}return T.match_available&&(Y=l._tr_tally(T,0,T.window[T.strstart-1]),T.match_available=0),T.insert=T.strstart<P-1?T.strstart:P-1,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):T.last_lit&&(G(T,!1),T.strm.avail_out===0)?N:W}function Xe(T,ce,oe,Y,z){this.good_length=T,this.max_lazy=ce,this.nice_length=oe,this.max_chain=Y,this.func=z}function we(){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=E,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 d.Buf16(2*O),this.dyn_dtree=new d.Buf16(2*(2*D+1)),this.bl_tree=new d.Buf16(2*(2*F+1)),ie(this.dyn_ltree),ie(this.dyn_dtree),ie(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(q+1),this.heap=new d.Buf16(2*A+1),ie(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*A+1),ie(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 Le(T){var ce;return T&&T.state?(T.total_in=T.total_out=0,T.data_type=_,(ce=T.state).pending=0,ce.pending_out=0,ce.wrap<0&&(ce.wrap=-ce.wrap),ce.status=ce.wrap?$:Q,T.adler=ce.wrap===2?0:1,ce.last_flush=b,l._tr_init(ce),h):be(T,M)}function Ie(T){var ce=Le(T);return ce===h&&(function(oe){oe.window_size=2*oe.w_size,ie(oe.head),oe.max_lazy_match=u[oe.level].max_lazy,oe.good_match=u[oe.level].good_length,oe.nice_match=u[oe.level].nice_length,oe.max_chain_length=u[oe.level].max_chain,oe.strstart=0,oe.block_start=0,oe.lookahead=0,oe.insert=0,oe.match_length=oe.prev_length=P-1,oe.match_available=0,oe.ins_h=0})(T.state),ce}function Ee(T,ce,oe,Y,z,te){if(!T)return M;var pe=1;if(ce===x&&(ce=6),Y<0?(pe=0,Y=-Y):15<Y&&(pe=2,Y-=16),z<1||C<z||oe!==E||Y<8||15<Y||ce<0||9<ce||te<0||j<te)return be(T,M);Y===8&&(Y=9);var fe=new we;return(T.state=fe).strm=T,fe.wrap=pe,fe.gzhead=null,fe.w_bits=Y,fe.w_size=1<<fe.w_bits,fe.w_mask=fe.w_size-1,fe.hash_bits=z+7,fe.hash_size=1<<fe.hash_bits,fe.hash_mask=fe.hash_size-1,fe.hash_shift=~~((fe.hash_bits+P-1)/P),fe.window=new d.Buf8(2*fe.w_size),fe.head=new d.Buf16(fe.hash_size),fe.prev=new d.Buf16(fe.w_size),fe.lit_bufsize=1<<z+6,fe.pending_buf_size=4*fe.lit_bufsize,fe.pending_buf=new d.Buf8(fe.pending_buf_size),fe.d_buf=1*fe.lit_bufsize,fe.l_buf=3*fe.lit_bufsize,fe.level=ce,fe.strategy=te,fe.method=oe,Ie(T)}u=[new Xe(0,0,0,0,function(T,ce){var oe=65535;for(oe>T.pending_buf_size-5&&(oe=T.pending_buf_size-5);;){if(T.lookahead<=1){if(Fe(T),T.lookahead===0&&ce===b)return N;if(T.lookahead===0)break}T.strstart+=T.lookahead,T.lookahead=0;var Y=T.block_start+oe;if((T.strstart===0||T.strstart>=Y)&&(T.lookahead=T.strstart-Y,T.strstart=Y,G(T,!1),T.strm.avail_out===0)||T.strstart-T.block_start>=T.w_size-K&&(G(T,!1),T.strm.avail_out===0))return N}return T.insert=0,ce===w?(G(T,!0),T.strm.avail_out===0?ae:ue):(T.strstart>T.block_start&&(G(T,!1),T.strm.avail_out),N)}),new Xe(4,4,8,4,qe),new Xe(4,5,16,8,qe),new Xe(4,6,32,32,qe),new Xe(4,4,16,16,Ue),new Xe(8,16,32,32,Ue),new Xe(8,16,128,128,Ue),new Xe(8,32,128,256,Ue),new Xe(32,128,258,1024,Ue),new Xe(32,258,258,4096,Ue)],c.deflateInit=function(T,ce){return Ee(T,ce,E,15,8,0)},c.deflateInit2=Ee,c.deflateReset=Ie,c.deflateResetKeep=Le,c.deflateSetHeader=function(T,ce){return T&&T.state?T.state.wrap!==2?M:(T.state.gzhead=ce,h):M},c.deflate=function(T,ce){var oe,Y,z,te;if(!T||!T.state||5<ce||ce<0)return T?be(T,M):M;if(Y=T.state,!T.output||!T.input&&T.avail_in!==0||Y.status===666&&ce!==w)return be(T,T.avail_out===0?-5:M);if(Y.strm=T,oe=Y.last_flush,Y.last_flush=ce,Y.status===$)if(Y.wrap===2)T.adler=0,me(Y,31),me(Y,139),me(Y,8),Y.gzhead?(me(Y,(Y.gzhead.text?1:0)+(Y.gzhead.hcrc?2:0)+(Y.gzhead.extra?4:0)+(Y.gzhead.name?8:0)+(Y.gzhead.comment?16:0)),me(Y,255&Y.gzhead.time),me(Y,Y.gzhead.time>>8&255),me(Y,Y.gzhead.time>>16&255),me(Y,Y.gzhead.time>>24&255),me(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),me(Y,255&Y.gzhead.os),Y.gzhead.extra&&Y.gzhead.extra.length&&(me(Y,255&Y.gzhead.extra.length),me(Y,Y.gzhead.extra.length>>8&255)),Y.gzhead.hcrc&&(T.adler=m(T.adler,Y.pending_buf,Y.pending,0)),Y.gzindex=0,Y.status=69):(me(Y,0),me(Y,0),me(Y,0),me(Y,0),me(Y,0),me(Y,Y.level===9?2:2<=Y.strategy||Y.level<2?4:0),me(Y,3),Y.status=Q);else{var pe=E+(Y.w_bits-8<<4)<<8;pe|=(2<=Y.strategy||Y.level<2?0:Y.level<6?1:Y.level===6?2:3)<<6,Y.strstart!==0&&(pe|=32),pe+=31-pe%31,Y.status=Q,ee(Y,pe),Y.strstart!==0&&(ee(Y,T.adler>>>16),ee(Y,65535&T.adler)),T.adler=1}if(Y.status===69)if(Y.gzhead.extra){for(z=Y.pending;Y.gzindex<(65535&Y.gzhead.extra.length)&&(Y.pending!==Y.pending_buf_size||(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending!==Y.pending_buf_size));)me(Y,255&Y.gzhead.extra[Y.gzindex]),Y.gzindex++;Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),Y.gzindex===Y.gzhead.extra.length&&(Y.gzindex=0,Y.status=73)}else Y.status=73;if(Y.status===73)if(Y.gzhead.name){z=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending===Y.pending_buf_size)){te=1;break}te=Y.gzindex<Y.gzhead.name.length?255&Y.gzhead.name.charCodeAt(Y.gzindex++):0,me(Y,te)}while(te!==0);Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),te===0&&(Y.gzindex=0,Y.status=91)}else Y.status=91;if(Y.status===91)if(Y.gzhead.comment){z=Y.pending;do{if(Y.pending===Y.pending_buf_size&&(Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),V(T),z=Y.pending,Y.pending===Y.pending_buf_size)){te=1;break}te=Y.gzindex<Y.gzhead.comment.length?255&Y.gzhead.comment.charCodeAt(Y.gzindex++):0,me(Y,te)}while(te!==0);Y.gzhead.hcrc&&Y.pending>z&&(T.adler=m(T.adler,Y.pending_buf,Y.pending-z,z)),te===0&&(Y.status=103)}else Y.status=103;if(Y.status===103&&(Y.gzhead.hcrc?(Y.pending+2>Y.pending_buf_size&&V(T),Y.pending+2<=Y.pending_buf_size&&(me(Y,255&T.adler),me(Y,T.adler>>8&255),T.adler=0,Y.status=Q)):Y.status=Q),Y.pending!==0){if(V(T),T.avail_out===0)return Y.last_flush=-1,h}else if(T.avail_in===0&&de(ce)<=de(oe)&&ce!==w)return be(T,-5);if(Y.status===666&&T.avail_in!==0)return be(T,-5);if(T.avail_in!==0||Y.lookahead!==0||ce!==b&&Y.status!==666){var fe=Y.strategy===2?(function(re,Me){for(var Ne;;){if(re.lookahead===0&&(Fe(re),re.lookahead===0)){if(Me===b)return N;break}if(re.match_length=0,Ne=l._tr_tally(re,0,re.window[re.strstart]),re.lookahead--,re.strstart++,Ne&&(G(re,!1),re.strm.avail_out===0))return N}return re.insert=0,Me===w?(G(re,!0),re.strm.avail_out===0?ae:ue):re.last_lit&&(G(re,!1),re.strm.avail_out===0)?N:W})(Y,ce):Y.strategy===3?(function(re,Me){for(var Ne,Se,ze,gt,Qe=re.window;;){if(re.lookahead<=U){if(Fe(re),re.lookahead<=U&&Me===b)return N;if(re.lookahead===0)break}if(re.match_length=0,re.lookahead>=P&&0<re.strstart&&(Se=Qe[ze=re.strstart-1])===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]){gt=re.strstart+U;do;while(Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&Se===Qe[++ze]&&ze<gt);re.match_length=U-(gt-ze),re.match_length>re.lookahead&&(re.match_length=re.lookahead)}if(re.match_length>=P?(Ne=l._tr_tally(re,1,re.match_length-P),re.lookahead-=re.match_length,re.strstart+=re.match_length,re.match_length=0):(Ne=l._tr_tally(re,0,re.window[re.strstart]),re.lookahead--,re.strstart++),Ne&&(G(re,!1),re.strm.avail_out===0))return N}return re.insert=0,Me===w?(G(re,!0),re.strm.avail_out===0?ae:ue):re.last_lit&&(G(re,!1),re.strm.avail_out===0)?N:W})(Y,ce):u[Y.level].func(Y,ce);if(fe!==ae&&fe!==ue||(Y.status=666),fe===N||fe===ae)return T.avail_out===0&&(Y.last_flush=-1),h;if(fe===W&&(ce===1?l._tr_align(Y):ce!==5&&(l._tr_stored_block(Y,0,0,!1),ce===3&&(ie(Y.head),Y.lookahead===0&&(Y.strstart=0,Y.block_start=0,Y.insert=0))),V(T),T.avail_out===0))return Y.last_flush=-1,h}return ce!==w?h:Y.wrap<=0?1:(Y.wrap===2?(me(Y,255&T.adler),me(Y,T.adler>>8&255),me(Y,T.adler>>16&255),me(Y,T.adler>>24&255),me(Y,255&T.total_in),me(Y,T.total_in>>8&255),me(Y,T.total_in>>16&255),me(Y,T.total_in>>24&255)):(ee(Y,T.adler>>>16),ee(Y,65535&T.adler)),V(T),0<Y.wrap&&(Y.wrap=-Y.wrap),Y.pending!==0?h:1)},c.deflateEnd=function(T){var ce;return T&&T.state?(ce=T.state.status)!==$&&ce!==69&&ce!==73&&ce!==91&&ce!==103&&ce!==Q&&ce!==666?be(T,M):(T.state=null,ce===Q?be(T,-3):h):M},c.deflateSetDictionary=function(T,ce){var oe,Y,z,te,pe,fe,re,Me,Ne=ce.length;if(!T||!T.state||(te=(oe=T.state).wrap)===2||te===1&&oe.status!==$||oe.lookahead)return M;for(te===1&&(T.adler=f(T.adler,ce,Ne,0)),oe.wrap=0,Ne>=oe.w_size&&(te===0&&(ie(oe.head),oe.strstart=0,oe.block_start=0,oe.insert=0),Me=new d.Buf8(oe.w_size),d.arraySet(Me,ce,Ne-oe.w_size,oe.w_size,0),ce=Me,Ne=oe.w_size),pe=T.avail_in,fe=T.next_in,re=T.input,T.avail_in=Ne,T.next_in=0,T.input=ce,Fe(oe);oe.lookahead>=P;){for(Y=oe.strstart,z=oe.lookahead-(P-1);oe.ins_h=(oe.ins_h<<oe.hash_shift^oe.window[Y+P-1])&oe.hash_mask,oe.prev[Y&oe.w_mask]=oe.head[oe.ins_h],oe.head[oe.ins_h]=Y,Y++,--z;);oe.strstart=Y,oe.lookahead=P-1,Fe(oe)}return oe.strstart+=oe.lookahead,oe.block_start=oe.strstart,oe.insert=oe.lookahead,oe.lookahead=0,oe.match_length=oe.prev_length=P-1,oe.match_available=0,T.next_in=fe,T.input=re,T.avail_in=pe,oe.wrap=te,h},c.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(s,o,c){o.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(s,o,c){o.exports=function(u,d){var l,f,m,p,b,w,h,M,x,j,_,E,C,A,D,F,O,q,P,U,K,$,Q,N,W;l=u.state,f=u.next_in,N=u.input,m=f+(u.avail_in-5),p=u.next_out,W=u.output,b=p-(d-u.avail_out),w=p+(u.avail_out-257),h=l.dmax,M=l.wsize,x=l.whave,j=l.wnext,_=l.window,E=l.hold,C=l.bits,A=l.lencode,D=l.distcode,F=(1<<l.lenbits)-1,O=(1<<l.distbits)-1;e:do{C<15&&(E+=N[f++]<<C,C+=8,E+=N[f++]<<C,C+=8),q=A[E&F];t:for(;;){if(E>>>=P=q>>>24,C-=P,(P=q>>>16&255)===0)W[p++]=65535&q;else{if(!(16&P)){if((64&P)==0){q=A[(65535&q)+(E&(1<<P)-1)];continue t}if(32&P){l.mode=12;break e}u.msg="invalid literal/length code",l.mode=30;break e}U=65535&q,(P&=15)&&(C<P&&(E+=N[f++]<<C,C+=8),U+=E&(1<<P)-1,E>>>=P,C-=P),C<15&&(E+=N[f++]<<C,C+=8,E+=N[f++]<<C,C+=8),q=D[E&O];n:for(;;){if(E>>>=P=q>>>24,C-=P,!(16&(P=q>>>16&255))){if((64&P)==0){q=D[(65535&q)+(E&(1<<P)-1)];continue n}u.msg="invalid distance code",l.mode=30;break e}if(K=65535&q,C<(P&=15)&&(E+=N[f++]<<C,(C+=8)<P&&(E+=N[f++]<<C,C+=8)),h<(K+=E&(1<<P)-1)){u.msg="invalid distance too far back",l.mode=30;break e}if(E>>>=P,C-=P,(P=p-b)<K){if(x<(P=K-P)&&l.sane){u.msg="invalid distance too far back",l.mode=30;break e}if(Q=_,($=0)===j){if($+=M-P,P<U){for(U-=P;W[p++]=_[$++],--P;);$=p-K,Q=W}}else if(j<P){if($+=M+j-P,(P-=j)<U){for(U-=P;W[p++]=_[$++],--P;);if($=0,j<U){for(U-=P=j;W[p++]=_[$++],--P;);$=p-K,Q=W}}}else if($+=j-P,P<U){for(U-=P;W[p++]=_[$++],--P;);$=p-K,Q=W}for(;2<U;)W[p++]=Q[$++],W[p++]=Q[$++],W[p++]=Q[$++],U-=3;U&&(W[p++]=Q[$++],1<U&&(W[p++]=Q[$++]))}else{for($=p-K;W[p++]=W[$++],W[p++]=W[$++],W[p++]=W[$++],2<(U-=3););U&&(W[p++]=W[$++],1<U&&(W[p++]=W[$++]))}break}}break}}while(f<m&&p<w);f-=U=C>>3,E&=(1<<(C-=U<<3))-1,u.next_in=f,u.next_out=p,u.avail_in=f<m?m-f+5:5-(f-m),u.avail_out=p<w?w-p+257:257-(p-w),l.hold=E,l.bits=C}},{}],49:[function(s,o,c){var u=s("../utils/common"),d=s("./adler32"),l=s("./crc32"),f=s("./inffast"),m=s("./inftrees"),p=1,b=2,w=0,h=-2,M=1,x=852,j=592;function _($){return($>>>24&255)+($>>>8&65280)+((65280&$)<<8)+((255&$)<<24)}function E(){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 u.Buf16(320),this.work=new u.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C($){var Q;return $&&$.state?(Q=$.state,$.total_in=$.total_out=Q.total=0,$.msg="",Q.wrap&&($.adler=1&Q.wrap),Q.mode=M,Q.last=0,Q.havedict=0,Q.dmax=32768,Q.head=null,Q.hold=0,Q.bits=0,Q.lencode=Q.lendyn=new u.Buf32(x),Q.distcode=Q.distdyn=new u.Buf32(j),Q.sane=1,Q.back=-1,w):h}function A($){var Q;return $&&$.state?((Q=$.state).wsize=0,Q.whave=0,Q.wnext=0,C($)):h}function D($,Q){var N,W;return $&&$.state?(W=$.state,Q<0?(N=0,Q=-Q):(N=1+(Q>>4),Q<48&&(Q&=15)),Q&&(Q<8||15<Q)?h:(W.window!==null&&W.wbits!==Q&&(W.window=null),W.wrap=N,W.wbits=Q,A($))):h}function F($,Q){var N,W;return $?(W=new E,($.state=W).window=null,(N=D($,Q))!==w&&($.state=null),N):h}var O,q,P=!0;function U($){if(P){var Q;for(O=new u.Buf32(512),q=new u.Buf32(32),Q=0;Q<144;)$.lens[Q++]=8;for(;Q<256;)$.lens[Q++]=9;for(;Q<280;)$.lens[Q++]=7;for(;Q<288;)$.lens[Q++]=8;for(m(p,$.lens,0,288,O,0,$.work,{bits:9}),Q=0;Q<32;)$.lens[Q++]=5;m(b,$.lens,0,32,q,0,$.work,{bits:5}),P=!1}$.lencode=O,$.lenbits=9,$.distcode=q,$.distbits=5}function K($,Q,N,W){var ae,ue=$.state;return ue.window===null&&(ue.wsize=1<<ue.wbits,ue.wnext=0,ue.whave=0,ue.window=new u.Buf8(ue.wsize)),W>=ue.wsize?(u.arraySet(ue.window,Q,N-ue.wsize,ue.wsize,0),ue.wnext=0,ue.whave=ue.wsize):(W<(ae=ue.wsize-ue.wnext)&&(ae=W),u.arraySet(ue.window,Q,N-W,ae,ue.wnext),(W-=ae)?(u.arraySet(ue.window,Q,N-W,W,0),ue.wnext=W,ue.whave=ue.wsize):(ue.wnext+=ae,ue.wnext===ue.wsize&&(ue.wnext=0),ue.whave<ue.wsize&&(ue.whave+=ae))),0}c.inflateReset=A,c.inflateReset2=D,c.inflateResetKeep=C,c.inflateInit=function($){return F($,15)},c.inflateInit2=F,c.inflate=function($,Q){var N,W,ae,ue,be,de,ie,V,G,me,ee,xe,Fe,qe,Ue,Xe,we,Le,Ie,Ee,T,ce,oe,Y,z=0,te=new u.Buf8(4),pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!$||!$.state||!$.output||!$.input&&$.avail_in!==0)return h;(N=$.state).mode===12&&(N.mode=13),be=$.next_out,ae=$.output,ie=$.avail_out,ue=$.next_in,W=$.input,de=$.avail_in,V=N.hold,G=N.bits,me=de,ee=ie,ce=w;e:for(;;)switch(N.mode){case M:if(N.wrap===0){N.mode=13;break}for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(2&N.wrap&&V===35615){te[N.check=0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0),G=V=0,N.mode=2;break}if(N.flags=0,N.head&&(N.head.done=!1),!(1&N.wrap)||(((255&V)<<8)+(V>>8))%31){$.msg="incorrect header check",N.mode=30;break}if((15&V)!=8){$.msg="unknown compression method",N.mode=30;break}if(G-=4,T=8+(15&(V>>>=4)),N.wbits===0)N.wbits=T;else if(T>N.wbits){$.msg="invalid window size",N.mode=30;break}N.dmax=1<<T,$.adler=N.check=1,N.mode=512&V?10:12,G=V=0;break;case 2:for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(N.flags=V,(255&N.flags)!=8){$.msg="unknown compression method",N.mode=30;break}if(57344&N.flags){$.msg="unknown header flags set",N.mode=30;break}N.head&&(N.head.text=V>>8&1),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0,N.mode=3;case 3:for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.head&&(N.head.time=V),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,te[2]=V>>>16&255,te[3]=V>>>24&255,N.check=l(N.check,te,4,0)),G=V=0,N.mode=4;case 4:for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.head&&(N.head.xflags=255&V,N.head.os=V>>8),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0,N.mode=5;case 5:if(1024&N.flags){for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.length=V,N.head&&(N.head.extra_len=V),512&N.flags&&(te[0]=255&V,te[1]=V>>>8&255,N.check=l(N.check,te,2,0)),G=V=0}else N.head&&(N.head.extra=null);N.mode=6;case 6:if(1024&N.flags&&(de<(xe=N.length)&&(xe=de),xe&&(N.head&&(T=N.head.extra_len-N.length,N.head.extra||(N.head.extra=new Array(N.head.extra_len)),u.arraySet(N.head.extra,W,ue,xe,T)),512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,N.length-=xe),N.length))break e;N.length=0,N.mode=7;case 7:if(2048&N.flags){if(de===0)break e;for(xe=0;T=W[ue+xe++],N.head&&T&&N.length<65536&&(N.head.name+=String.fromCharCode(T)),T&&xe<de;);if(512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,T)break e}else N.head&&(N.head.name=null);N.length=0,N.mode=8;case 8:if(4096&N.flags){if(de===0)break e;for(xe=0;T=W[ue+xe++],N.head&&T&&N.length<65536&&(N.head.comment+=String.fromCharCode(T)),T&&xe<de;);if(512&N.flags&&(N.check=l(N.check,W,xe,ue)),de-=xe,ue+=xe,T)break e}else N.head&&(N.head.comment=null);N.mode=9;case 9:if(512&N.flags){for(;G<16;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V!==(65535&N.check)){$.msg="header crc mismatch",N.mode=30;break}G=V=0}N.head&&(N.head.hcrc=N.flags>>9&1,N.head.done=!0),$.adler=N.check=0,N.mode=12;break;case 10:for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}$.adler=N.check=_(V),G=V=0,N.mode=11;case 11:if(N.havedict===0)return $.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,2;$.adler=N.check=1,N.mode=12;case 12:if(Q===5||Q===6)break e;case 13:if(N.last){V>>>=7&G,G-=7&G,N.mode=27;break}for(;G<3;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}switch(N.last=1&V,G-=1,3&(V>>>=1)){case 0:N.mode=14;break;case 1:if(U(N),N.mode=20,Q!==6)break;V>>>=2,G-=2;break e;case 2:N.mode=17;break;case 3:$.msg="invalid block type",N.mode=30}V>>>=2,G-=2;break;case 14:for(V>>>=7&G,G-=7&G;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if((65535&V)!=(V>>>16^65535)){$.msg="invalid stored block lengths",N.mode=30;break}if(N.length=65535&V,G=V=0,N.mode=15,Q===6)break e;case 15:N.mode=16;case 16:if(xe=N.length){if(de<xe&&(xe=de),ie<xe&&(xe=ie),xe===0)break e;u.arraySet(ae,W,ue,xe,be),de-=xe,ue+=xe,ie-=xe,be+=xe,N.length-=xe;break}N.mode=12;break;case 17:for(;G<14;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(N.nlen=257+(31&V),V>>>=5,G-=5,N.ndist=1+(31&V),V>>>=5,G-=5,N.ncode=4+(15&V),V>>>=4,G-=4,286<N.nlen||30<N.ndist){$.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(;G<3;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.lens[pe[N.have++]]=7&V,V>>>=3,G-=3}for(;N.have<19;)N.lens[pe[N.have++]]=0;if(N.lencode=N.lendyn,N.lenbits=7,oe={bits:N.lenbits},ce=m(0,N.lens,0,19,N.lencode,0,N.work,oe),N.lenbits=oe.bits,ce){$.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(;Xe=(z=N.lencode[V&(1<<N.lenbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(we<16)V>>>=Ue,G-=Ue,N.lens[N.have++]=we;else{if(we===16){for(Y=Ue+2;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V>>>=Ue,G-=Ue,N.have===0){$.msg="invalid bit length repeat",N.mode=30;break}T=N.lens[N.have-1],xe=3+(3&V),V>>>=2,G-=2}else if(we===17){for(Y=Ue+3;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}G-=Ue,T=0,xe=3+(7&(V>>>=Ue)),V>>>=3,G-=3}else{for(Y=Ue+7;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}G-=Ue,T=0,xe=11+(127&(V>>>=Ue)),V>>>=7,G-=7}if(N.have+xe>N.nlen+N.ndist){$.msg="invalid bit length repeat",N.mode=30;break}for(;xe--;)N.lens[N.have++]=T}}if(N.mode===30)break;if(N.lens[256]===0){$.msg="invalid code -- missing end-of-block",N.mode=30;break}if(N.lenbits=9,oe={bits:N.lenbits},ce=m(p,N.lens,0,N.nlen,N.lencode,0,N.work,oe),N.lenbits=oe.bits,ce){$.msg="invalid literal/lengths set",N.mode=30;break}if(N.distbits=6,N.distcode=N.distdyn,oe={bits:N.distbits},ce=m(b,N.lens,N.nlen,N.ndist,N.distcode,0,N.work,oe),N.distbits=oe.bits,ce){$.msg="invalid distances set",N.mode=30;break}if(N.mode=20,Q===6)break e;case 20:N.mode=21;case 21:if(6<=de&&258<=ie){$.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,f($,ee),be=$.next_out,ae=$.output,ie=$.avail_out,ue=$.next_in,W=$.input,de=$.avail_in,V=N.hold,G=N.bits,N.mode===12&&(N.back=-1);break}for(N.back=0;Xe=(z=N.lencode[V&(1<<N.lenbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(Xe&&(240&Xe)==0){for(Le=Ue,Ie=Xe,Ee=we;Xe=(z=N.lencode[Ee+((V&(1<<Le+Ie)-1)>>Le)])>>>16&255,we=65535&z,!(Le+(Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}V>>>=Le,G-=Le,N.back+=Le}if(V>>>=Ue,G-=Ue,N.back+=Ue,N.length=we,Xe===0){N.mode=26;break}if(32&Xe){N.back=-1,N.mode=12;break}if(64&Xe){$.msg="invalid literal/length code",N.mode=30;break}N.extra=15&Xe,N.mode=22;case 22:if(N.extra){for(Y=N.extra;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.length+=V&(1<<N.extra)-1,V>>>=N.extra,G-=N.extra,N.back+=N.extra}N.was=N.length,N.mode=23;case 23:for(;Xe=(z=N.distcode[V&(1<<N.distbits)-1])>>>16&255,we=65535&z,!((Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if((240&Xe)==0){for(Le=Ue,Ie=Xe,Ee=we;Xe=(z=N.distcode[Ee+((V&(1<<Le+Ie)-1)>>Le)])>>>16&255,we=65535&z,!(Le+(Ue=z>>>24)<=G);){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}V>>>=Le,G-=Le,N.back+=Le}if(V>>>=Ue,G-=Ue,N.back+=Ue,64&Xe){$.msg="invalid distance code",N.mode=30;break}N.offset=we,N.extra=15&Xe,N.mode=24;case 24:if(N.extra){for(Y=N.extra;G<Y;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}N.offset+=V&(1<<N.extra)-1,V>>>=N.extra,G-=N.extra,N.back+=N.extra}if(N.offset>N.dmax){$.msg="invalid distance too far back",N.mode=30;break}N.mode=25;case 25:if(ie===0)break e;if(xe=ee-ie,N.offset>xe){if((xe=N.offset-xe)>N.whave&&N.sane){$.msg="invalid distance too far back",N.mode=30;break}Fe=xe>N.wnext?(xe-=N.wnext,N.wsize-xe):N.wnext-xe,xe>N.length&&(xe=N.length),qe=N.window}else qe=ae,Fe=be-N.offset,xe=N.length;for(ie<xe&&(xe=ie),ie-=xe,N.length-=xe;ae[be++]=qe[Fe++],--xe;);N.length===0&&(N.mode=21);break;case 26:if(ie===0)break e;ae[be++]=N.length,ie--,N.mode=21;break;case 27:if(N.wrap){for(;G<32;){if(de===0)break e;de--,V|=W[ue++]<<G,G+=8}if(ee-=ie,$.total_out+=ee,N.total+=ee,ee&&($.adler=N.check=N.flags?l(N.check,ae,ee,be-ee):d(N.check,ae,ee,be-ee)),ee=ie,(N.flags?V:_(V))!==N.check){$.msg="incorrect data check",N.mode=30;break}G=V=0}N.mode=28;case 28:if(N.wrap&&N.flags){for(;G<32;){if(de===0)break e;de--,V+=W[ue++]<<G,G+=8}if(V!==(4294967295&N.total)){$.msg="incorrect length check",N.mode=30;break}G=V=0}N.mode=29;case 29:ce=1;break e;case 30:ce=-3;break e;case 31:return-4;default:return h}return $.next_out=be,$.avail_out=ie,$.next_in=ue,$.avail_in=de,N.hold=V,N.bits=G,(N.wsize||ee!==$.avail_out&&N.mode<30&&(N.mode<27||Q!==4))&&K($,$.output,$.next_out,ee-$.avail_out)?(N.mode=31,-4):(me-=$.avail_in,ee-=$.avail_out,$.total_in+=me,$.total_out+=ee,N.total+=ee,N.wrap&&ee&&($.adler=N.check=N.flags?l(N.check,ae,ee,$.next_out-ee):d(N.check,ae,ee,$.next_out-ee)),$.data_type=N.bits+(N.last?64:0)+(N.mode===12?128:0)+(N.mode===20||N.mode===15?256:0),(me==0&&ee===0||Q===4)&&ce===w&&(ce=-5),ce)},c.inflateEnd=function($){if(!$||!$.state)return h;var Q=$.state;return Q.window&&(Q.window=null),$.state=null,w},c.inflateGetHeader=function($,Q){var N;return $&&$.state?(2&(N=$.state).wrap)==0?h:((N.head=Q).done=!1,w):h},c.inflateSetDictionary=function($,Q){var N,W=Q.length;return $&&$.state?(N=$.state).wrap!==0&&N.mode!==11?h:N.mode===11&&d(1,Q,W,0)!==N.check?-3:K($,Q,W,W)?(N.mode=31,-4):(N.havedict=1,w):h},c.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(s,o,c){var u=s("../utils/common"),d=[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],l=[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],f=[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],m=[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];o.exports=function(p,b,w,h,M,x,j,_){var E,C,A,D,F,O,q,P,U,K=_.bits,$=0,Q=0,N=0,W=0,ae=0,ue=0,be=0,de=0,ie=0,V=0,G=null,me=0,ee=new u.Buf16(16),xe=new u.Buf16(16),Fe=null,qe=0;for($=0;$<=15;$++)ee[$]=0;for(Q=0;Q<h;Q++)ee[b[w+Q]]++;for(ae=K,W=15;1<=W&&ee[W]===0;W--);if(W<ae&&(ae=W),W===0)return M[x++]=20971520,M[x++]=20971520,_.bits=1,0;for(N=1;N<W&&ee[N]===0;N++);for(ae<N&&(ae=N),$=de=1;$<=15;$++)if(de<<=1,(de-=ee[$])<0)return-1;if(0<de&&(p===0||W!==1))return-1;for(xe[1]=0,$=1;$<15;$++)xe[$+1]=xe[$]+ee[$];for(Q=0;Q<h;Q++)b[w+Q]!==0&&(j[xe[b[w+Q]]++]=Q);if(O=p===0?(G=Fe=j,19):p===1?(G=d,me-=257,Fe=l,qe-=257,256):(G=f,Fe=m,-1),$=N,F=x,be=Q=V=0,A=-1,D=(ie=1<<(ue=ae))-1,p===1&&852<ie||p===2&&592<ie)return 1;for(;;){for(q=$-be,U=j[Q]<O?(P=0,j[Q]):j[Q]>O?(P=Fe[qe+j[Q]],G[me+j[Q]]):(P=96,0),E=1<<$-be,N=C=1<<ue;M[F+(V>>be)+(C-=E)]=q<<24|P<<16|U|0,C!==0;);for(E=1<<$-1;V&E;)E>>=1;if(E!==0?(V&=E-1,V+=E):V=0,Q++,--ee[$]==0){if($===W)break;$=b[w+j[Q]]}if(ae<$&&(V&D)!==A){for(be===0&&(be=ae),F+=N,de=1<<(ue=$-be);ue+be<W&&!((de-=ee[ue+be])<=0);)ue++,de<<=1;if(ie+=1<<ue,p===1&&852<ie||p===2&&592<ie)return 1;M[A=V&D]=ae<<24|ue<<16|F-x|0}}return V!==0&&(M[F+V]=$-be<<24|64<<16|0),_.bits=ae,0}},{"../utils/common":41}],51:[function(s,o,c){o.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(s,o,c){var u=s("../utils/common"),d=0,l=1;function f(z){for(var te=z.length;0<=--te;)z[te]=0}var m=0,p=29,b=256,w=b+1+p,h=30,M=19,x=2*w+1,j=15,_=16,E=7,C=256,A=16,D=17,F=18,O=[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],q=[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],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=new Array(2*(w+2));f(K);var $=new Array(2*h);f($);var Q=new Array(512);f(Q);var N=new Array(256);f(N);var W=new Array(p);f(W);var ae,ue,be,de=new Array(h);function ie(z,te,pe,fe,re){this.static_tree=z,this.extra_bits=te,this.extra_base=pe,this.elems=fe,this.max_length=re,this.has_stree=z&&z.length}function V(z,te){this.dyn_tree=z,this.max_code=0,this.stat_desc=te}function G(z){return z<256?Q[z]:Q[256+(z>>>7)]}function me(z,te){z.pending_buf[z.pending++]=255&te,z.pending_buf[z.pending++]=te>>>8&255}function ee(z,te,pe){z.bi_valid>_-pe?(z.bi_buf|=te<<z.bi_valid&65535,me(z,z.bi_buf),z.bi_buf=te>>_-z.bi_valid,z.bi_valid+=pe-_):(z.bi_buf|=te<<z.bi_valid&65535,z.bi_valid+=pe)}function xe(z,te,pe){ee(z,pe[2*te],pe[2*te+1])}function Fe(z,te){for(var pe=0;pe|=1&z,z>>>=1,pe<<=1,0<--te;);return pe>>>1}function qe(z,te,pe){var fe,re,Me=new Array(j+1),Ne=0;for(fe=1;fe<=j;fe++)Me[fe]=Ne=Ne+pe[fe-1]<<1;for(re=0;re<=te;re++){var Se=z[2*re+1];Se!==0&&(z[2*re]=Fe(Me[Se]++,Se))}}function Ue(z){var te;for(te=0;te<w;te++)z.dyn_ltree[2*te]=0;for(te=0;te<h;te++)z.dyn_dtree[2*te]=0;for(te=0;te<M;te++)z.bl_tree[2*te]=0;z.dyn_ltree[2*C]=1,z.opt_len=z.static_len=0,z.last_lit=z.matches=0}function Xe(z){8<z.bi_valid?me(z,z.bi_buf):0<z.bi_valid&&(z.pending_buf[z.pending++]=z.bi_buf),z.bi_buf=0,z.bi_valid=0}function we(z,te,pe,fe){var re=2*te,Me=2*pe;return z[re]<z[Me]||z[re]===z[Me]&&fe[te]<=fe[pe]}function Le(z,te,pe){for(var fe=z.heap[pe],re=pe<<1;re<=z.heap_len&&(re<z.heap_len&&we(te,z.heap[re+1],z.heap[re],z.depth)&&re++,!we(te,fe,z.heap[re],z.depth));)z.heap[pe]=z.heap[re],pe=re,re<<=1;z.heap[pe]=fe}function Ie(z,te,pe){var fe,re,Me,Ne,Se=0;if(z.last_lit!==0)for(;fe=z.pending_buf[z.d_buf+2*Se]<<8|z.pending_buf[z.d_buf+2*Se+1],re=z.pending_buf[z.l_buf+Se],Se++,fe===0?xe(z,re,te):(xe(z,(Me=N[re])+b+1,te),(Ne=O[Me])!==0&&ee(z,re-=W[Me],Ne),xe(z,Me=G(--fe),pe),(Ne=q[Me])!==0&&ee(z,fe-=de[Me],Ne)),Se<z.last_lit;);xe(z,C,te)}function Ee(z,te){var pe,fe,re,Me=te.dyn_tree,Ne=te.stat_desc.static_tree,Se=te.stat_desc.has_stree,ze=te.stat_desc.elems,gt=-1;for(z.heap_len=0,z.heap_max=x,pe=0;pe<ze;pe++)Me[2*pe]!==0?(z.heap[++z.heap_len]=gt=pe,z.depth[pe]=0):Me[2*pe+1]=0;for(;z.heap_len<2;)Me[2*(re=z.heap[++z.heap_len]=gt<2?++gt:0)]=1,z.depth[re]=0,z.opt_len--,Se&&(z.static_len-=Ne[2*re+1]);for(te.max_code=gt,pe=z.heap_len>>1;1<=pe;pe--)Le(z,Me,pe);for(re=ze;pe=z.heap[1],z.heap[1]=z.heap[z.heap_len--],Le(z,Me,1),fe=z.heap[1],z.heap[--z.heap_max]=pe,z.heap[--z.heap_max]=fe,Me[2*re]=Me[2*pe]+Me[2*fe],z.depth[re]=(z.depth[pe]>=z.depth[fe]?z.depth[pe]:z.depth[fe])+1,Me[2*pe+1]=Me[2*fe+1]=re,z.heap[1]=re++,Le(z,Me,1),2<=z.heap_len;);z.heap[--z.heap_max]=z.heap[1],(function(Qe,Tt){var xn,$t,Gt,wt,An,Un,Nt=Tt.dyn_tree,vr=Tt.max_code,Hr=Tt.stat_desc.static_tree,Ur=Tt.stat_desc.has_stree,tn=Tt.stat_desc.extra_bits,Bn=Tt.stat_desc.extra_base,jn=Tt.stat_desc.max_length,Dn=0;for(wt=0;wt<=j;wt++)Qe.bl_count[wt]=0;for(Nt[2*Qe.heap[Qe.heap_max]+1]=0,xn=Qe.heap_max+1;xn<x;xn++)jn<(wt=Nt[2*Nt[2*($t=Qe.heap[xn])+1]+1]+1)&&(wt=jn,Dn++),Nt[2*$t+1]=wt,vr<$t||(Qe.bl_count[wt]++,An=0,Bn<=$t&&(An=tn[$t-Bn]),Un=Nt[2*$t],Qe.opt_len+=Un*(wt+An),Ur&&(Qe.static_len+=Un*(Hr[2*$t+1]+An)));if(Dn!==0){do{for(wt=jn-1;Qe.bl_count[wt]===0;)wt--;Qe.bl_count[wt]--,Qe.bl_count[wt+1]+=2,Qe.bl_count[jn]--,Dn-=2}while(0<Dn);for(wt=jn;wt!==0;wt--)for($t=Qe.bl_count[wt];$t!==0;)vr<(Gt=Qe.heap[--xn])||(Nt[2*Gt+1]!==wt&&(Qe.opt_len+=(wt-Nt[2*Gt+1])*Nt[2*Gt],Nt[2*Gt+1]=wt),$t--)}})(z,te),qe(Me,gt,z.bl_count)}function T(z,te,pe){var fe,re,Me=-1,Ne=te[1],Se=0,ze=7,gt=4;for(Ne===0&&(ze=138,gt=3),te[2*(pe+1)+1]=65535,fe=0;fe<=pe;fe++)re=Ne,Ne=te[2*(fe+1)+1],++Se<ze&&re===Ne||(Se<gt?z.bl_tree[2*re]+=Se:re!==0?(re!==Me&&z.bl_tree[2*re]++,z.bl_tree[2*A]++):Se<=10?z.bl_tree[2*D]++:z.bl_tree[2*F]++,Me=re,gt=(Se=0)===Ne?(ze=138,3):re===Ne?(ze=6,3):(ze=7,4))}function ce(z,te,pe){var fe,re,Me=-1,Ne=te[1],Se=0,ze=7,gt=4;for(Ne===0&&(ze=138,gt=3),fe=0;fe<=pe;fe++)if(re=Ne,Ne=te[2*(fe+1)+1],!(++Se<ze&&re===Ne)){if(Se<gt)for(;xe(z,re,z.bl_tree),--Se!=0;);else re!==0?(re!==Me&&(xe(z,re,z.bl_tree),Se--),xe(z,A,z.bl_tree),ee(z,Se-3,2)):Se<=10?(xe(z,D,z.bl_tree),ee(z,Se-3,3)):(xe(z,F,z.bl_tree),ee(z,Se-11,7));Me=re,gt=(Se=0)===Ne?(ze=138,3):re===Ne?(ze=6,3):(ze=7,4)}}f(de);var oe=!1;function Y(z,te,pe,fe){ee(z,(m<<1)+(fe?1:0),3),(function(re,Me,Ne,Se){Xe(re),me(re,Ne),me(re,~Ne),u.arraySet(re.pending_buf,re.window,Me,Ne,re.pending),re.pending+=Ne})(z,te,pe)}c._tr_init=function(z){oe||((function(){var te,pe,fe,re,Me,Ne=new Array(j+1);for(re=fe=0;re<p-1;re++)for(W[re]=fe,te=0;te<1<<O[re];te++)N[fe++]=re;for(N[fe-1]=re,re=Me=0;re<16;re++)for(de[re]=Me,te=0;te<1<<q[re];te++)Q[Me++]=re;for(Me>>=7;re<h;re++)for(de[re]=Me<<7,te=0;te<1<<q[re]-7;te++)Q[256+Me++]=re;for(pe=0;pe<=j;pe++)Ne[pe]=0;for(te=0;te<=143;)K[2*te+1]=8,te++,Ne[8]++;for(;te<=255;)K[2*te+1]=9,te++,Ne[9]++;for(;te<=279;)K[2*te+1]=7,te++,Ne[7]++;for(;te<=287;)K[2*te+1]=8,te++,Ne[8]++;for(qe(K,w+1,Ne),te=0;te<h;te++)$[2*te+1]=5,$[2*te]=Fe(te,5);ae=new ie(K,O,b+1,w,j),ue=new ie($,q,0,h,j),be=new ie(new Array(0),P,0,M,E)})(),oe=!0),z.l_desc=new V(z.dyn_ltree,ae),z.d_desc=new V(z.dyn_dtree,ue),z.bl_desc=new V(z.bl_tree,be),z.bi_buf=0,z.bi_valid=0,Ue(z)},c._tr_stored_block=Y,c._tr_flush_block=function(z,te,pe,fe){var re,Me,Ne=0;0<z.level?(z.strm.data_type===2&&(z.strm.data_type=(function(Se){var ze,gt=4093624447;for(ze=0;ze<=31;ze++,gt>>>=1)if(1>&&Se.dyn_ltree[2*ze]!==0)return d;if(Se.dyn_ltree[18]!==0||Se.dyn_ltree[20]!==0||Se.dyn_ltree[26]!==0)return l;for(ze=32;ze<b;ze++)if(Se.dyn_ltree[2*ze]!==0)return l;return d})(z)),Ee(z,z.l_desc),Ee(z,z.d_desc),Ne=(function(Se){var ze;for(T(Se,Se.dyn_ltree,Se.l_desc.max_code),T(Se,Se.dyn_dtree,Se.d_desc.max_code),Ee(Se,Se.bl_desc),ze=M-1;3<=ze&&Se.bl_tree[2*U[ze]+1]===0;ze--);return Se.opt_len+=3*(ze+1)+5+5+4,ze})(z),re=z.opt_len+3+7>>>3,(Me=z.static_len+3+7>>>3)<=re&&(re=Me)):re=Me=pe+5,pe+4<=re&&te!==-1?Y(z,te,pe,fe):z.strategy===4||Me===re?(ee(z,2+(fe?1:0),3),Ie(z,K,$)):(ee(z,4+(fe?1:0),3),(function(Se,ze,gt,Qe){var Tt;for(ee(Se,ze-257,5),ee(Se,gt-1,5),ee(Se,Qe-4,4),Tt=0;Tt<Qe;Tt++)ee(Se,Se.bl_tree[2*U[Tt]+1],3);ce(Se,Se.dyn_ltree,ze-1),ce(Se,Se.dyn_dtree,gt-1)})(z,z.l_desc.max_code+1,z.d_desc.max_code+1,Ne+1),Ie(z,z.dyn_ltree,z.dyn_dtree)),Ue(z),fe&&Xe(z)},c._tr_tally=function(z,te,pe){return z.pending_buf[z.d_buf+2*z.last_lit]=te>>>8&255,z.pending_buf[z.d_buf+2*z.last_lit+1]=255&te,z.pending_buf[z.l_buf+z.last_lit]=255&pe,z.last_lit++,te===0?z.dyn_ltree[2*pe]++:(z.matches++,te--,z.dyn_ltree[2*(N[pe]+b+1)]++,z.dyn_dtree[2*G(te)]++),z.last_lit===z.lit_bufsize-1},c._tr_align=function(z){ee(z,2,3),xe(z,C,K),(function(te){te.bi_valid===16?(me(te,te.bi_buf),te.bi_buf=0,te.bi_valid=0):8<=te.bi_valid&&(te.pending_buf[te.pending++]=255&te.bi_buf,te.bi_buf>>=8,te.bi_valid-=8)})(z)}},{"../utils/common":41}],53:[function(s,o,c){o.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(s,o,c){(function(u){(function(d,l){if(!d.setImmediate){var f,m,p,b,w=1,h={},M=!1,x=d.document,j=Object.getPrototypeOf&&Object.getPrototypeOf(d);j=j&&j.setTimeout?j:d,f={}.toString.call(d.process)==="[object process]"?function(A){process.nextTick(function(){E(A)})}:(function(){if(d.postMessage&&!d.importScripts){var A=!0,D=d.onmessage;return d.onmessage=function(){A=!1},d.postMessage("","*"),d.onmessage=D,A}})()?(b="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",C,!1):d.attachEvent("onmessage",C),function(A){d.postMessage(b+A,"*")}):d.MessageChannel?((p=new MessageChannel).port1.onmessage=function(A){E(A.data)},function(A){p.port2.postMessage(A)}):x&&"onreadystatechange"in x.createElement("script")?(m=x.documentElement,function(A){var D=x.createElement("script");D.onreadystatechange=function(){E(A),D.onreadystatechange=null,m.removeChild(D),D=null},m.appendChild(D)}):function(A){setTimeout(E,0,A)},j.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var D=new Array(arguments.length-1),F=0;F<D.length;F++)D[F]=arguments[F+1];var O={callback:A,args:D};return h[w]=O,f(w),w++},j.clearImmediate=_}function _(A){delete h[A]}function E(A){if(M)setTimeout(E,0,A);else{var D=h[A];if(D){M=!0;try{(function(F){var O=F.callback,q=F.args;switch(q.length){case 0:O();break;case 1:O(q[0]);break;case 2:O(q[0],q[1]);break;case 3:O(q[0],q[1],q[2]);break;default:O.apply(l,q)}})(D)}finally{_(A),M=!1}}}}function C(A){A.source===d&&typeof A.data=="string"&&A.data.indexOf(b)===0&&E(+A.data.slice(b.length))}})(typeof self>"u"?u===void 0?this:u:self)}).call(this,typeof Or<"u"?Or:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(uu)),uu.exports}var q8=Y8();const Km=Lu(q8),Do={maxFiles:1e3,maxExtractedBytes:32*1024*1024};class Xs extends Error{reason;constructor(a,s){super(s),this.name="ThemeArchiveExtractionError",this.reason=a}}const G8=new Set(["css","cjs","hbs","handlebars","htm","html","js","json","less","md","markdown","mjs","sass","scss","svg","txt","xml","yaml","yml"]),X8=new Set([".editorconfig",".eslintignore",".eslintrc",".gitattributes",".gitignore",".npmignore",".prettierignore",".prettierrc","CODEOWNERS","LICENSE","LICENCE","NOTICE","Procfile"]),Pa=t=>{if(G8.has(nd(t)))return!0;const s=t.split("/").at(-1)||t;return X8.has(s)},nd=t=>{const a=t.lastIndexOf(".");return a===-1?"":t.slice(a+1).toLowerCase()},Du=t=>{const a=t.trim().replace(/^\/+/,"").replace(/\/+/g,"/");if(!a)return null;const s=a.split("/").filter(Boolean);return s.length===0||s.some(o=>o==="."||o==="..")?null:s.join("/")},sp=t=>["casper","source"].includes(t.toLowerCase()),Z8=t=>{if(t.length===0)return"";const a=t[0].indexOf("/");if(a<=0)return"";const s=t[0].slice(0,a+1);return t.every(o=>o.startsWith(s))?s:""},du=t=>Object.fromEntries(Object.entries(t).map(([a,s])=>[a,{...s,date:new Date(s.date),binary:s.binary?new Uint8Array(s.binary):null}])),Yo="Failed to open the theme archive. Download the theme again and retry.",K8=t=>{const a=t/1048576;return Number.isInteger(a)?`${a} MB`:`${a.toFixed(1)} MB`},V8=t=>{const a=[];return t.forEach((s,o)=>{o.dir||a.push([s,o])}),a},Q8=t=>{if(t.length>Do.maxFiles)throw new Xs("too_many_files",`This theme archive contains too many files for the browser editor (${t.length}/${Do.maxFiles}).`)},J8=async t=>{try{return await Km.loadAsync(t)}catch{throw new Xs("invalid_archive",Yo)}},ej=async t=>{try{return await t.async("uint8array")}catch{throw new Xs("invalid_archive",Yo)}},tj=async t=>{try{return await t.async("string")}catch{throw new Xs("invalid_archive",Yo)}},nj=t=>{const a=Du(t);if(!a||a!==t)throw new Xs("invalid_archive",Yo);return a},ap=(t,a)=>{const s=t+a;if(s>Do.maxExtractedBytes)throw new Xs("too_large",`This theme archive is too large to open in the browser editor. Extracted files must stay under ${K8(Do.maxExtractedBytes)}.`);return s},rj=async t=>{const a=await J8(t),s=V8(a);Q8(s);const o=Z8(s.map(([l])=>l)),c={},u=new TextEncoder;let d=0;for(const[l,f]of s){const m=o?l.slice(o.length):l;if(!m)continue;const p=nj(m);if(Pa(p))try{const h=await tj(f);d=ap(d,u.encode(h).byteLength),c[p]={path:p,editable:!0,content:h,binary:null,date:f.date||new Date,unixPermissions:typeof f.unixPermissions=="number"?f.unixPermissions:null,dosPermissions:typeof f.dosPermissions=="number"?f.dosPermissions:null};continue}catch{}const w=await ej(f);d=ap(d,w.byteLength),c[p]={path:p,editable:!1,content:null,binary:w,date:f.date||new Date,unixPermissions:typeof f.unixPermissions=="number"?f.unixPermissions:null,dosPermissions:typeof f.dosPermissions=="number"?f.dosPermissions:null}}return{files:c,rootPrefix:o}},sj=async({files:t,rootPrefix:a})=>{const s=new Km;for(const[o,c]of Object.entries(t)){const u=`${a}${o}`,d={date:c.date,createFolders:!0,unixPermissions:c.unixPermissions??void 0,dosPermissions:c.dosPermissions??void 0};c.editable?s.file(u,c.content??"",d):s.file(u,c.binary,{...d,binary:!0})}return s.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:6}})},aj=({baseFiles:t,currentFiles:a})=>{const s=new Set([...Object.keys(t),...Object.keys(a)]),o=[];for(const c of Array.from(s).sort()){const u=t[c],d=a[c];if(!u&&d){o.push({path:c,editable:d.editable,status:"added"});continue}if(u&&!d){o.push({path:c,editable:u.editable,status:"deleted"});continue}!u||!d||u.editable&&d.editable&&u.content!==d.content&&o.push({path:c,editable:!0,status:"modified"})}return o},ij=({files:t,oldPrefix:a,newPrefix:s})=>{const o={};for(const[c,u]of Object.entries(t)){if(!c.startsWith(a)){o[c]=u;continue}const d=`${s}${c.slice(a.length)}`;o[d]={...u,path:d}}return o},oj=t=>{switch(nd(t)){case"css":case"scss":case"sass":case"less":return ns(()=>import("./index-DIyK69JM.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.css());case"js":case"cjs":case"mjs":return ns(()=>import("./index-D3A8RTi0.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.javascript());case"json":return ns(()=>import("./index-CuH5raTz.js"),__vite__mapDeps([19,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.json());case"md":case"markdown":return ns(()=>import("./index-UMWVIyz7.js"),__vite__mapDeps([20,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,21,1,0,18]),import.meta.url).then(s=>s.markdown());case"yaml":case"yml":return ns(()=>import("./index-DssW7xhk.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17]),import.meta.url).then(s=>s.yaml());case"hbs":case"handlebars":case"html":case"htm":case"svg":case"xml":return ns(()=>import("./index-DLFVpwt3.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,0,18]),import.meta.url).then(s=>s.html());default:return ns(()=>import("./index-DLFVpwt3.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,0,18]),import.meta.url).then(s=>s.html())}},lj=t=>{const a=nd(t);if(!a)return"text";switch(a){case"hbs":return"handlebars";case"htm":return"html";case"yml":return"yaml";default:return a}},ip=t=>{if(t["package.json"]?.editable)return{type:"file",path:"package.json"};const a=Object.keys(t).sort().find(o=>t[o].editable);if(a)return{type:"file",path:a};const s=Object.keys(t).sort()[0];return s?{type:"file",path:s}:null},op=t=>{const a=t.split("/"),s=[""];for(let o=0;o<a.length-1;o+=1)s.push(`${a.slice(0,o+1).join("/")}/`);return s},cj=["theme","design"],uj=t=>cj.some(a=>t===a||t.startsWith(`${a}/`)),lp=()=>{const t=window.location.hash.substring(1),a=`${window.location.protocol}//${window.location.hostname}`;let s;try{s=new URL(t||"/",a)}catch{return null}const o=s.searchParams.get("from");return o===null?null:o===""||uj(o)?o:null},dj=(t,a)=>{const s=`theme/edit/${encodeURIComponent(t)}`;return a===null?s:`${s}?from=${encodeURIComponent(a)}`},fj=(t,a)=>!t.editable&&Pa(a),hj=/^[a-z0-9][\w-]{0,63}$/,cp={COMPRESSED_TOO_LARGE:"Theme too large to upload",ENTRY_TOO_LARGE:"File too large",TOTAL_TOO_LARGE:"Theme contents too large"},pj=t=>{if(!t||t<=0)return"the allowed size";const a=t/(1024*1024);return a>=1?`${a.toFixed(1)} MB`:`${Math.round(t/1024)} KB`},mj=t=>{const{entryName:a,limitBytes:s}=t.errorDetails??{},o=pj(s);switch(t.code){case"COMPRESSED_TOO_LARGE":return`The theme archive is too large to upload (max ${o}).`;case"ENTRY_TOO_LARGE":return a?`The file "${a}" is too large (max ${o} per file).`:`One of the files is too large (max ${o} per file).`;case"TOTAL_TOO_LARGE":return`The theme contents exceed the maximum allowed size of ${o}.`;default:return t.message||"Theme upload failed."}},gj=t=>`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] ${t?"opacity-100":"opacity-60"}`,fu="flex h-full items-center justify-center p-8 text-center text-[13px] text-[#6a6f78]",up=xu.theme({"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#355070"},".cm-content ::selection":{color:"#ffffff"}},{dark:!0}),xj=({themeName:t})=>{const a=Wt(),{updateRoute:s}=rt(),o=f1(),c=pt(),{data:u}=$o(),[d,l]=B.useState(t),[f,m]=B.useState({}),[p,b]=B.useState({}),[w,h]=B.useState(""),[M,x]=B.useState(null),[j,_]=B.useState(new Set([""])),[E,C]=B.useState(!0),[A,D]=B.useState(!1),[F,O]=B.useState(null),[q,P]=B.useState(!1),[U,K]=B.useState(!1),[$,Q]=B.useState([]);B.useEffect(()=>{let Ie=!0;const Ee=()=>{l(t),m({}),b({}),h(""),x(null),_(new Set([""]))};return(async()=>{C(!0),O(null),Ee();try{const{apiRoot:ce}=$r(),oe=await fetch(`${ce}/themes/${encodeURIComponent(t)}/download/`,{credentials:"include",headers:{Accept:"application/zip, application/octet-stream, */*"}});if(!oe.ok)throw new Error(`Failed to load theme "${t}" (${oe.status})`);const Y=await oe.arrayBuffer(),z=await rj(Y),te=du(z.files),pe=ip(te);if(!Ie)return;l(t),m(du(z.files)),b(te),h(z.rootPrefix),x(pe),_(new Set(pe?.type==="file"?op(pe.path):[""]))}catch(ce){if(!Ie)return;O(ce instanceof Error?ce.message:"Failed to load theme")}finally{Ie&&C(!1)}})(),()=>{Ie=!1}},[t]),B.useEffect(()=>{const Ie=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=Ie}},[]);const N=B.useMemo(()=>aj({baseFiles:f,currentFiles:p}),[f,p]),W=B.useMemo(()=>new Map(N.map(Ie=>[Ie.path,Ie.status])),[N]),ae=B.useMemo(()=>U8({baseFiles:f,currentFiles:p,changes:N}),[f,p,N]),ue=M?.type==="file"?p[M.path]:null;B.useEffect(()=>{let Ie=!0;return ue?.editable?(oj(ue.path).then(Ee=>{Ie&&Q([Vf({top:!0}),Uc,Ee,...U?[xu.lineWrapping]:[],up])}).catch(()=>{Ie&&Q([Vf({top:!0}),Uc,...U?[xu.lineWrapping]:[],up])}),()=>{Ie=!1}):(Q([]),()=>{Ie=!1})},[U,ue]);const be=async({title:Ie,prompt:Ee,cancelLabel:T,okLabel:ce,okColor:oe})=>!!await Ae.show(O8,{title:Ie,prompt:Ee,cancelLabel:T,okLabel:ce,okColor:oe}),de=async({title:Ie,prompt:Ee,fieldTitle:T,initialValue:ce,placeholder:oe,cancelLabel:Y,okLabel:z})=>await Ae.show(R8,{title:Ie,prompt:Ee,fieldTitle:T,initialValue:ce,placeholder:oe,cancelLabel:Y,okLabel:z}),ie=async()=>{N.length>0&&!await be({title:"Discard changes?",prompt:"You have unsaved theme changes. Close the editor and discard them?",okLabel:"Discard changes",okColor:"red"})||(a.remove(),s(lp()??"design/change-theme"))},V=B.useRef(()=>{});B.useEffect(()=>{const Ie=Ee=>{if((Ee.metaKey||Ee.ctrlKey)&&Ee.key.toLowerCase()==="s"){Ee.preventDefault(),V.current();return}Ee.key==="Escape"&&(Ee.preventDefault(),Ee.stopPropagation(),Ee.stopImmediatePropagation())};return window.addEventListener("keydown",Ie,!0),()=>{window.removeEventListener("keydown",Ie,!0)}},[]);const G=Ie=>{_(Ee=>{const T=new Set(Ee);for(const ce of op(Ie))T.add(ce);return T})},me=(Ie,Ee)=>{if(b(Ie),Ee){x(Ee),Ee.type==="file"&&G(Ee.path);return}M?.type==="file"&&Ie[M.path]||x(ip(Ie))},ee=async()=>{const Ie=await de({title:"Create file",fieldTitle:"File path",initialValue:"partials/new-file.hbs",okLabel:"Create file",prompt:"Add a new editable file to this theme."}),Ee=Ie?Du(Ie):null;if(!Ee)return;if(!Pa(Ee)){et({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(p[Ee]){et({type:"error",title:"File already exists"});return}const T={...p,[Ee]:{path:Ee,editable:!0,content:"",binary:null,date:new Date,unixPermissions:null,dosPermissions:null}};me(T,{type:"file",path:Ee})},xe=async()=>{if(!M)return;const Ie=M.type==="dir"?M.path.replace(/\/$/,""):M.path,Ee=M.type==="dir"?"Rename folder to":"Rename file to",T=await de({title:M.type==="dir"?"Rename folder":"Rename file",fieldTitle:"Path",initialValue:Ie,okLabel:"Rename",prompt:Ee}),ce=T?Du(T):null;if(!ce||ce===Ie)return;if(M.type==="file"){const te=p[M.path];if(!Pa(ce)&&te.editable){et({type:"error",title:"Text files must keep a text file extension"});return}if(fj(te,ce)){et({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(p[ce]){et({type:"error",title:"A file with that name already exists"});return}const pe={...p},fe=pe[M.path];delete pe[M.path],pe[ce]={...fe,path:ce,editable:Pa(ce)},me(pe,{type:"file",path:ce});return}const oe=`${ce}/`;if(oe.startsWith(M.path)){et({type:"error",title:"A folder cannot be renamed inside itself"});return}if(Object.keys(p).find(te=>te.startsWith(oe))){et({type:"error",title:"A folder with that path already exists"});return}const z=ij({files:p,oldPrefix:M.path,newPrefix:oe});me(z,{type:"dir",path:oe}),_(te=>{const pe=new Set;for(const fe of te){if(!fe.startsWith(M.path)){pe.add(fe);continue}pe.add(`${oe}${fe.slice(M.path.length)}`)}return pe})},Fe=async()=>{if(!M)return;if(M.type==="file"){if(!await be({title:"Delete file",prompt:n.jsxs(n.Fragment,{children:["Delete ",n.jsx("strong",{children:M.path})," from this theme?"]}),okLabel:"Delete",okColor:"red"}))return;const oe={...p};delete oe[M.path],me(oe);return}const Ie=Object.keys(p).filter(ce=>ce.startsWith(M.path));if(!Ie.length||!await be({title:"Delete folder",prompt:n.jsxs(n.Fragment,{children:["Delete ",Ie.length," file",Ie.length===1?"":"s"," from ",n.jsx("strong",{children:M.path}),"?"]}),okLabel:"Delete",okColor:"red"}))return;const T={...p};for(const ce of Ie)delete T[ce];me(T)},qe=Ie=>{const Ee=f[Ie],T=p[Ie],ce={...p};!Ee&&T?delete ce[Ie]:Ee&&(ce[Ie]={...Ee,binary:Ee.binary?new Uint8Array(Ee.binary):null}),me(ce)},Ue=async()=>{const Ee=(await de({title:"Save as new theme",fieldTitle:"Theme name",initialValue:`${d}-edited`,okLabel:"Continue",prompt:"Default themes cannot be overwritten. Save your edits as a new theme instead."}))?.trim().toLowerCase();return Ee?hj.test(Ee)?sp(Ee)?(et({type:"error",title:"Built-in themes cannot be overwritten"}),null):Ee:(et({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},Xe=async()=>{if(A)return;if(N.length===0){et({type:"info",title:"No changes to save"});return}const Ie=d,Ee=sp(Ie)?await Ue():Ie;if(!Ee)return;const T=Ee!==Ie,ce=u?.themes.some(z=>z.name===Ee)||!1,oe=T?`Save your edits as "${Ee}"?`:`Upload ${N.length} changed file${N.length===1?"":"s"} and replace "${Ie}"?`;if(await be({title:T?"Save theme as new copy":"Update theme",prompt:oe,okLabel:T?"Save theme":"Replace theme"})&&!(T&&ce&&!await be({title:"Overwrite theme",prompt:n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:Ee})," already exists. Do you want to overwrite it?"]}),okLabel:"Overwrite",okColor:"red"}))){D(!0);try{const z=await sj({files:p,rootPrefix:w}),te=new FormData;te.append("file",z,`${Ee}.zip`);const pe=await fetch(`${$r().apiRoot}/themes/upload/`,{method:"POST",credentials:"include",headers:{Accept:"application/json"},body:te}),fe=await pe.json().catch(()=>null);if(!pe.ok){if(pe.status===422&&fe?.errors){Ae.show(Qu,{title:"Invalid Theme",prompt:n.jsx(n.Fragment,{children:"Fix the validation errors below and try saving again."}),fatalErrors:fe.errors});return}const Ne=fe?.errors?.[0];if(Ne?.code&&cp[Ne.code]){et({type:"error",title:cp[Ne.code],message:mj(Ne)});return}throw new Error(Ne?.message||"Theme upload failed.")}const re=fe.themes[0],Me=lp();m(du(p)),T&&(l(Ee),h(w?`${Ee}/`:""),s(dj(Ee,Me))),await o.invalidateQueries(["ThemesResponseType"]),T||re.errors?.length||re.warnings?.length?Ae.show(ed,{title:T?"Theme saved":"Theme updated",prompt:n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:re.name})," saved successfully."]}),installedTheme:re}):et({type:"success",title:"Theme saved",message:n.jsxs("div",{children:[n.jsx("span",{className:"capitalize",children:re.name})," has been updated."]})})}catch(z){c(z)}finally{D(!1)}}};B.useEffect(()=>{V.current=Xe});const we=Ie=>{x({type:"file",path:Ie}),G(Ie)},Le=ue?W.get(ue.path):null;return n.jsx("div",{"aria-label":`Edit theme ${t}`,"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:Ie=>{Ie.target===Ie.currentTarget&&ie()},children:n.jsxs("div",{className:"relative flex h-full w-full flex-col overflow-hidden bg-[#15171a]",children:[n.jsx(F8,{changes:N,currentThemeName:d,isSaving:A,onClose:ie,onOpenReview:()=>P(!0),onSave:()=>{Xe()}}),F&&n.jsx("div",{className:"border-b border-[#512828] bg-[#3a1d1d] px-4 py-2 text-[12px] text-[#ffbdbd]",children:F}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[n.jsx(H8,{changesMap:W,currentFiles:p,expandedDirectories:j,isLoading:E,selectedNode:M,setExpandedDirectories:_,setSelectedNode:x,onCreateFile:ee,onDeleteSelected:Fe,onOpenFile:we,onRenameSelected:xe}),n.jsxs("section",{className:"flex min-w-0 flex-1 flex-col bg-[#16181c]",children:[n.jsx("div",{className:"flex items-center gap-2 border-b border-[#23262c] bg-[#17191d] px-4 py-2 text-[12px] text-[#8a8f98]",children:ue?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"min-w-0 truncate font-medium text-[#e6e7ea]",children:ue.path}),n.jsx("span",{className:"rounded bg-[#2a2d33] px-2 py-0.5 text-[10px] tracking-[0.04em] text-[#c8ccd3] uppercase",children:lj(ue.path)}),Le&&n.jsxs("button",{className:`inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] tracking-[0.04em] uppercase ${Le==="deleted"?"bg-[#4a2222] text-[#ffbdbd]":Le==="added"?"bg-[#17342a] text-[#a5e8c8]":"bg-[#3b2a16] text-[#f5a623]"}`,type:"button",onClick:()=>qe(ue.path),children:[n.jsx(cm,{size:11}),"Revert"]}),n.jsx("div",{className:"grow"}),ue.editable&&n.jsx("button",{"aria-label":U?"Disable text wrap":"Enable text wrap","aria-pressed":U,className:gj(U),title:U?"Disable text wrap":"Enable text wrap",type:"button",onClick:()=>K(Ie=>!Ie),children:n.jsx(p_,{className:"shrink-0",size:14,strokeWidth:2})})]}):n.jsx("span",{children:"No file selected"})}),n.jsxs("div",{className:"min-h-0 flex-1",children:[!M&&!E&&n.jsx("div",{className:fu,children:"Select a file from the tree to start editing."}),M?.type==="dir"&&n.jsx("div",{className:fu,children:"Folder selected. Choose a file to edit, or rename or delete the folder from the file pane."}),ue&&!ue.editable&&n.jsx("div",{className:fu,children:"This file cannot be edited in the browser."}),ue?.editable&&n.jsx(G1,{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]:h-4 [&_.cm-search_label_input]:w-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:$,height:"full",theme:Uc,value:ue.content||"",autoFocus:!0,onChange:Ie=>{b(Ee=>({...Ee,[ue.path]:{...Ee[ue.path],content:Ie}}))}},`${ue.path}:${$.length}`)]})]})]}),q&&n.jsx(W8,{reviewItems:ae,onClose:()=>P(!1),onOpenInEditor:Ie=>{we(Ie),P(!1)},onRevert:qe})]})})},bj=t=>{if(!t.startsWith("theme/edit/"))return{themeName:null,isInvalid:!1};const a=t.slice(11).split("?")[0];if(!a||a.includes("/"))return{themeName:null,isInvalid:!0};try{const s=decodeURIComponent(a);return!s||s.includes("/")?{themeName:null,isInvalid:!0}:{themeName:s,isInvalid:!1}}catch{return{themeName:null,isInvalid:!0}}},wj=({pathName:t})=>{const a=Wt(),{route:s,updateRoute:o}=rt(),c=s||t,[u,d]=B.useState(null),[l,f]=B.useState(!1),[m,p]=B.useState(!1),[b,w]=B.useState(null),[h,M]=B.useState(!1),{checkThemeLimitError:x,isThemeLimitCheckReady:j,noThemeChangesAllowed:_,isThemeLimited:E}=Po(),[C,A]=B.useState(null),[D,F]=B.useState(!1),{themeName:O,isInvalid:q}=bj(c),P=B.useCallback(U=>{Ae.show(gr,{prompt:U,onOk:()=>o({route:"/pro",isExternal:!0})})},[o]);if(B.useEffect(()=>{c==="design/change-theme"&&j?(async()=>{if(!_){f(!1),d(null);return}f(!0);const K=await x();d(K),f(!1),K&&(P(K),a.remove())})():(d(null),f(!1))},[x,c,j,a,_,P]),B.useEffect(()=>{c!=="theme/install"&&(F(!1),A(null),p(!1))},[c]),B.useEffect(()=>{q&&(a.remove(),o("theme"))},[q,a,o]),B.useEffect(()=>{let U=!1;return(async()=>{if(!O){w(null),M(!1);return}if(!j){M(!0);return}if(!E){w(null),M(!1);return}M(!0);const $=await x(O.toLowerCase());U||(w($),M(!1),$&&(P($),a.remove(),o("theme")))})(),()=>{U=!0}},[x,O,j,E,a,P,o]),B.useEffect(()=>{const U=()=>{const W=window.location.href.split("#")[1]?.split("?")[1];return W?new URLSearchParams(W).get("ref"):null},K=Q=>{A(!1),_?(P(Q),window.history.replaceState({},"",window.location.pathname+window.location.hash.split("?")[0]),a.remove(),o("theme")):(P(Q),a.remove(),o("theme"))};(async()=>{if(c!=="theme/install"){p(!1);return}if(F(!0),!j){p(!0);return}if(!E){A(!0),p(!1);return}p(!0);const Q=U();if(!Q){A(!1),p(!1);return}const N=Q.split("/")[1]?.toLowerCase(),W=await x(N);if(c!=="theme/install"){p(!1);return}if(W){A(!1),p(!1),K(W);return}A(!0),p(!1)})()},[x,c,j,_,E,a,P,o]),c==="design/edit")return n.jsx(D8,{});if(c==="design/change-theme")return l||u?null:n.jsx(zh,{});if(c==="theme/install"){if(!D||!j||m||C===null||!C)return null;const $=window.location.href.split("#")[1]?.split("?")[1];let Q=null,N=null;if($){const W=new URLSearchParams($);Q=W.get("ref"),N=W.get("source")}return n.jsx(zh,{source:N,themeRef:Q})}else return c.startsWith("theme/edit/")?q||!O||h||b?null:n.jsx(xj,{themeName:O}):(a.remove(),null)},vj=Ae.create(wj),_j=({html:t,style:a})=>{const s=o=>{const c=o.contentDocument||o.contentWindow?.document;if(!c)return;const u=`
|
|
28
28
|
<html>
|
|
29
29
|
<head>
|
|
30
30
|
<style>body, html {padding: 0; margin: 0; overflow: hidden;}</style>
|