@dcl/builder-site 7.9.2-16202422627.commit-2162b6e → 7.10.1-16527307771.commit-bda752c
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/assets/{Back-D4W_O81e.js → Back-CQPVZ_Yw.js} +1 -1
- package/assets/{CollectionProvider.container-CJ2iDKGX.js → CollectionProvider.container-BlgzLY7w.js} +1 -1
- package/assets/{CollectionStatus.container-IWl9eE40.js → CollectionStatus.container-B5kSw8QZ.js} +1 -1
- package/assets/{ConfirmDelete-CGDLMrJr.js → ConfirmDelete-Bu5cpBOG.js} +1 -1
- package/assets/{FileSaver.min-DLSz4GG6.js → FileSaver.min-BQCLuufv.js} +1 -1
- package/assets/{ItemProvider.container-BbqNgUEL.js → ItemProvider.container-siyKsJBH.js} +1 -1
- package/assets/{JumpIn.container-D2EpA82b.js → JumpIn.container-hYmuYYl_.js} +1 -1
- package/assets/{LandAction-Bya5iY9t.js → LandAction-Dz0xpczy.js} +1 -1
- package/assets/{LandProviderPage-DMG9x9Uh.js → LandProviderPage-q8b0q3xS.js} +1 -1
- package/assets/{LoggedInDetailPage.container-BO7Rsigx.js → LoggedInDetailPage.container-DDpb0HDW.js} +1 -1
- package/assets/{Navigation-PyqSlJpo.css → Navigation-BTJLJ6b6.css} +1 -1
- package/assets/{Navigation.container-CsesGRoh.js → Navigation.container-CuwEnxUg.js} +1 -1
- package/assets/{NotFound-PGQXtpug.js → NotFound-Drp5upn-.js} +1 -1
- package/assets/{OptionsDropdown-A7bqXuQQ.js → OptionsDropdown-psFuZbbt.js} +1 -1
- package/assets/{RentalPeriod-BraXFDZS.js → RentalPeriod-Ch6U4OGQ.js} +1 -1
- package/assets/{SDKTag-DJMRg0px.js → SDKTag-cXIioIqG.js} +1 -1
- package/assets/{SceneStats.container-Wj4QXrQM.js → SceneStats.container-Cz3IRVTv.js} +1 -1
- package/assets/{SignInRequired-D6dYEPdh.js → SignInRequired-C_a3RZQm.js} +1 -1
- package/assets/{ThirdPartyKindBadge-CFiwrfph.js → ThirdPartyKindBadge-CZ3_p5DQ.js} +1 -1
- package/assets/{dataReader-CYT0dmyo.js → dataReader-COAvyQVC.js} +1 -1
- package/assets/{date-BqKdO_5V.js → date-DVtTbuy-.js} +1 -1
- package/assets/{fortmatic-nVWFrs39.js → fortmatic-2xS99WFY.js} +1 -1
- package/assets/{index-k99NNR6U.js → index-0PNnjTS1.js} +1 -1
- package/assets/{index-CGtTZh5E.js → index-39ZC1jwF.js} +1 -1
- package/assets/{index-i2ccmdc3.js → index-4mP-idOj.js} +1 -1
- package/assets/{index-BTV1BibB.js → index-85UYDG2S.js} +1 -1
- package/assets/{index-DGfJMRq1.css → index-B1j5QfDE.css} +7 -7
- package/assets/{index-gXzzgwlS.js → index-B2j0TCh_.js} +1 -1
- package/assets/{index-C1WvKOvC.js → index-BAudlX7b.js} +1 -1
- package/assets/{index-Sf_Exf2t.js → index-BG3D5vCW.js} +1 -1
- package/assets/{index-BcIVXak6.js → index-BIFLEIQd.js} +1 -1
- package/assets/index-BVlj6viB.js +1 -0
- package/assets/{index-BI-MYVXj.js → index-BZEUgF2A.js} +1 -1
- package/assets/{index-CLR7PH5p.js → index-Bg9uzOz7.js} +1 -1
- package/assets/{index-EznQ1aU3.js → index-BiyvJAFa.js} +1 -1
- package/assets/{index-CD26aSF-.js → index-Bp1T5VCO.js} +1 -1
- package/assets/{index-C5StGWKF.js → index-BsdyWJlv.js} +1 -1
- package/assets/{index-QhQimFh2.css → index-BtoDUXGw.css} +1 -1
- package/assets/{index-Cbtee_5J.js → index-BuReGvwz.js} +1 -1
- package/assets/index-C7335b66.js +1 -0
- package/assets/{index-CxNV7bdb.js → index-C9zs0R_5.js} +1 -1
- package/assets/index-CAOz1vZz.css +1 -0
- package/assets/{index-BxTFNW_J.js → index-CHKZr3P0.js} +1 -1
- package/assets/index-CNBMM92C.css +1 -0
- package/assets/index-CO7tm4XI.css +1 -0
- package/assets/{index-BT1Ly74q.js → index-COKFEHLF.js} +1 -1
- package/assets/{index-DhNeyJ74.js → index-CYC8HL9e.js} +1 -1
- package/assets/{index-BTNRbe6-.js → index-Cay_ldL_.js} +1 -1
- package/assets/{index-DShmef8G.js → index-CbIqreGu.js} +1 -1
- package/assets/{index-BLL_kcFx.js → index-CeemkspK.js} +1 -1
- package/assets/{index-DSYN9Vlq.js → index-Cieh_dbt.js} +1 -1
- package/assets/{index-BskZ5mzb.js → index-CkloEuvz.js} +1 -1
- package/assets/{index-BwMnXutj.js → index-CmjqU8F9.js} +1 -1
- package/assets/index-D-xKmxnV.js +1 -0
- package/assets/{index-BSgMtMFr.js → index-D1STVhL2.js} +1 -1
- package/assets/{index-COkEjczd.js → index-DFxnePgX.js} +1 -1
- package/assets/{index-Dh82delg.js → index-DIVpiEK-.js} +1 -1
- package/assets/{index-B-CgHsLs.js → index-DMQoZRVb.js} +1 -1
- package/assets/{index-vie0nMOv.js → index-DeJrmTwL.js} +1 -1
- package/assets/{index-CTqGCIas.js → index-DkmrqgVa.js} +1 -1
- package/assets/{index-DEx5ewtI.js → index-Dm0_b6AP.js} +1 -1
- package/assets/{index-CVV3dZXB.js → index-DnkKH5vl.js} +1 -1
- package/assets/{index-B-U4GUpe.js → index-DpAoV5eD.js} +1 -1
- package/assets/index-G4Vl4R9o.js +2 -0
- package/assets/{index-zqRa_a6z.js → index-KerIryJH.js} +1 -1
- package/assets/{index-x4ikeg4v.js → index-OXfxf5cu.js} +1 -1
- package/assets/index-UErW8C6J.css +1 -0
- package/assets/{index-BBNCItH9.js → index-bv5FtVcH.js} +1 -1
- package/assets/{index-ZuMScRBF.js → index-j66rXTci.js} +28 -28
- package/assets/{index-BfqSzaty.js → index-jzxrFGy_.js} +1 -1
- package/assets/{index-BXI0TOxc.css → index-khq7nwBI.css} +1 -1
- package/assets/{index.es-D6ZROQ2S.js → index.es-DeYGqe8K.js} +4 -4
- package/assets/{selectors-CVDyed6b.js → selectors-DlaHedkY.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-B443cfLz.js +0 -1
- package/assets/index-BCTU6gRE.js +0 -1
- package/assets/index-Bf7y2ke5.css +0 -1
- package/assets/index-ChSw1JF8.js +0 -2
- package/assets/index-D5GgTucn.css +0 -1
- package/assets/index-DI-Q_3C2.css +0 -1
- package/assets/index-DLqYYi0x.css +0 -1
- package/assets/index-DmT-osKc.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var ue=Object.defineProperty;var he=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>he(n,typeof t!="symbol"?t+"":t,e);import{bO as x,bP as b,ca as j,hE as ge,gs as T,gE as fe,Z as me,D as A,hF as K,K as ve,H as o,G as c,M as l,dB as pe,eP as J,bC as V,N as re,aH as we,es as Ce,X as Te,eu as xe,af as _e,ev as O,bm as be,hG as ye,ex as Ee,eA as De,e8 as Oe,bt as Se,hH as Pe,a6 as je,bw as q,hI as Me,eC as Ne,gt as Le,eF as Ue,eJ as ke,hJ as Re,eL as Ye,hK as Ae}from"./index-ZuMScRBF.js";import{d as Ie,e as We,c as Fe}from"./selectors-CVDyed6b.js";import{N as Be}from"./NotFound-PGQXtpug.js";import{L as He}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{N as $e}from"./Navigation.container-CsesGRoh.js";import{C as qe}from"./CollectionStatus.container-IWl9eE40.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-CFiwrfph.js";import{s as I,a as Ve}from"./date-BqKdO_5V.js";import{g as X,e as Xe,l as Ke}from"./index-BskZ5mzb.js";import"./SignInRequired-D6dYEPdh.js";function Je(n,t){x(2,arguments);var e=b(n).getTime(),a=j(t);return new Date(e+a)}function Ze(n){return x(1,arguments),n instanceof Date||ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ze(n){if(x(1,arguments),!Ze(n)&&typeof n!="number")return!1;var t=b(n);return!isNaN(Number(t))}function et(n,t){x(2,arguments);var e=j(t);return Je(n,-e)}var tt=864e5;function at(n){x(1,arguments);var t=b(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),r=e-a;return Math.floor(r/tt)+1}function W(n){x(1,arguments);var t=1,e=b(n),a=e.getUTCDay(),r=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function ne(n){x(1,arguments);var t=b(n),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var r=W(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=W(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function rt(n){x(1,arguments);var t=ne(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=W(e);return a}var nt=6048e5;function it(n){x(1,arguments);var t=b(n),e=W(t).getTime()-rt(t).getTime();return Math.round(e/nt)+1}function ie(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=b(n),w=p.getUTCFullYear(),g=X(),m=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:g.firstWeekContainsDate)!==null&&a!==void 0?a:(f=g.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _=new Date(0);_.setUTCFullYear(w+1,0,m),_.setUTCHours(0,0,0,0);var M=I(_,t),D=new Date(0);D.setUTCFullYear(w,0,m),D.setUTCHours(0,0,0,0);var B=I(D,t);return p.getTime()>=M.getTime()?w+1:p.getTime()>=B.getTime()?w:w-1}function ot(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=X(),w=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:p.firstWeekContainsDate)!==null&&a!==void 0?a:(f=p.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1),g=ie(n,t),m=new Date(0);m.setUTCFullYear(g,0,w),m.setUTCHours(0,0,0,0);var _=I(m,t);return _}var st=6048e5;function lt(n,t){x(1,arguments);var e=b(n),a=I(e,t).getTime()-ot(e,t).getTime();return Math.round(a/st)+1}function d(n,t){for(var e=n<0?"-":"",a=Math.abs(n).toString();a.length<t;)a="0"+a;return e+a}var E={y:function(t,e){var a=t.getUTCFullYear(),r=a>0?a:1-a;return d(e==="yy"?r%100:r,e.length)},M:function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):d(a+1,2)},d:function(t,e){return d(t.getUTCDate(),e.length)},a:function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(t,e){return d(t.getUTCHours()%12||12,e.length)},H:function(t,e){return d(t.getUTCHours(),e.length)},m:function(t,e){return d(t.getUTCMinutes(),e.length)},s:function(t,e){return d(t.getUTCSeconds(),e.length)},S:function(t,e){var a=e.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,a-3));return d(i,e.length)}},P={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ct={G:function(t,e,a){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})}},y:function(t,e,a){if(e==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return a.ordinalNumber(i,{unit:"year"})}return E.y(t,e)},Y:function(t,e,a,r){var i=ie(t,r),s=i>0?i:1-i;if(e==="YY"){var u=s%100;return d(u,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):d(s,e.length)},R:function(t,e){var a=ne(t);return d(a,e.length)},u:function(t,e){var a=t.getUTCFullYear();return d(a,e.length)},Q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return d(r,2);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return d(r,2);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,a){var r=t.getUTCMonth();switch(e){case"M":case"MM":return E.M(t,e);case"Mo":return a.ordinalNumber(r+1,{unit:"month"});case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,a){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return d(r+1,2);case"Lo":return a.ordinalNumber(r+1,{unit:"month"});case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,a,r){var i=lt(t,r);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):d(i,e.length)},I:function(t,e,a){var r=it(t);return e==="Io"?a.ordinalNumber(r,{unit:"week"}):d(r,e.length)},d:function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):E.d(t,e)},D:function(t,e,a){var r=at(t);return e==="Do"?a.ordinalNumber(r,{unit:"dayOfYear"}):d(r,e.length)},E:function(t,e,a){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return d(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return d(s,e.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,a){var r=t.getUTCDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return d(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(r,{width:"short",context:"formatting"});case"iiii":default:return a.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,a){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,a){var r=t.getUTCHours(),i;switch(r===12?i=P.noon:r===0?i=P.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,a){var r=t.getUTCHours(),i;switch(r>=17?i=P.evening:r>=12?i=P.afternoon:r>=4?i=P.morning:i=P.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,a){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),a.ordinalNumber(r,{unit:"hour"})}return E.h(t,e)},H:function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):E.H(t,e)},K:function(t,e,a){var r=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},k:function(t,e,a){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},m:function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E.m(t,e)},s:function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E.s(t,e)},S:function(t,e){return E.S(t,e)},X:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return z(s);case"XXXX":case"XX":return S(s);case"XXXXX":case"XXX":default:return S(s,":")}},x:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return z(s);case"xxxx":case"xx":return S(s);case"xxxxx":case"xxx":default:return S(s,":")}},O:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Z(s,":");case"OOOO":default:return"GMT"+S(s,":")}},z:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Z(s,":");case"zzzz":default:return"GMT"+S(s,":")}},t:function(t,e,a,r){var i=r._originalDate||t,s=Math.floor(i.getTime()/1e3);return d(s,e.length)},T:function(t,e,a,r){var i=r._originalDate||t,s=i.getTime();return d(s,e.length)}};function Z(n,t){var e=n>0?"-":"+",a=Math.abs(n),r=Math.floor(a/60),i=a%60;if(i===0)return e+String(r);var s=t;return e+String(r)+s+d(i,2)}function z(n,t){if(n%60===0){var e=n>0?"-":"+";return e+d(Math.abs(n)/60,2)}return S(n,t)}function S(n,t){var e=t||"",a=n>0?"-":"+",r=Math.abs(n),i=d(Math.floor(r/60),2),s=d(r%60,2);return a+i+e+s}var ee=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oe=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},dt=function(t,e){var a=t.match(/(P+)(p+)?/)||[],r=a[1],i=a[2];if(!i)return ee(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ee(r,e)).replace("{{time}}",oe(i,e))},ut={p:oe,P:dt},ht=["D","DD"],gt=["YY","YYYY"];function ft(n){return ht.indexOf(n)!==-1}function mt(n){return gt.indexOf(n)!==-1}function te(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,Ct=/''/g,Tt=/[a-zA-Z]/;function xt(n,t,e){var a,r,i,s,u,f,h,p,w,g,m,_,M,D;x(2,arguments);var B=String(t),N=X(),L=(a=(r=void 0)!==null&&r!==void 0?r:N.locale)!==null&&a!==void 0?a:Ke,H=j((i=(s=(u=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&u!==void 0?u:N.firstWeekContainsDate)!==null&&s!==void 0?s:(h=N.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(H>=1&&H<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=j((w=(g=(m=(_=void 0)!==null&&_!==void 0?_:void 0)!==null&&m!==void 0?m:N.weekStartsOn)!==null&&g!==void 0?g:(M=N.locale)===null||M===void 0||(D=M.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&w!==void 0?w:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!L.localize)throw new RangeError("locale must contain localize property");if(!L.formatLong)throw new RangeError("locale must contain formatLong property");var R=b(n);if(!ze(R))throw new RangeError("Invalid time value");var se=Xe(R),le=et(R,se),ce={firstWeekContainsDate:H,weekStartsOn:$,locale:L,_originalDate:R},de=B.match(pt).map(function(C){var y=C[0];if(y==="p"||y==="P"){var Y=ut[y];return Y(C,L.formatLong)}return C}).join("").match(vt).map(function(C){if(C==="''")return"'";var y=C[0];if(y==="'")return _t(C);var Y=ct[y];if(Y)return mt(C)&&te(C,t,String(n)),ft(C)&&te(C,t,String(n)),Y(le,C,L.localize,ce);if(y.match(Tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return C}).join("");return de}function _t(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const bt=(n,t)=>{if(n.isApproved){if(!t||t.status==="approved")return T.APPROVED;if(t.status==="rejected")return T.REJECTED}else{if(!t&&fe(n))return T.DISABLED;if(t&&t.status==="rejected")return T.REJECTED}return t&&t.status==="pending"&&t.assignee?T.UNDER_REVIEW:T.TO_REVIEW};function yt(n){const{collection:t,curation:e,address:a,itemCount:r,onOpenModal:i}=n,s=me(),u=A.useCallback(g=>{window.open(t.forumLink,"_blank"),g.preventDefault(),g.stopPropagation()},[t]),f=A.useCallback((g,m=K.SELF_ASSIGN)=>{i("EditCurationAssigneeModal",{collectionId:t.id,type:m}),g.preventDefault(),g.stopPropagation()},[i,t]),h=A.useCallback(()=>{s.push(ve.itemEditor({collectionId:t.id,isReviewing:"true"}))},[s,t]),p=A.useCallback(()=>{switch(bt(t,e)){case T.APPROVED:return o.jsxs("div",{className:"approved action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.approved")})," ",o.jsx(l.Icon,{name:"check"})]});case T.REJECTED:return o.jsxs("div",{className:"rejected action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.rejected")})," ",o.jsx(l.Icon,{name:"close"})]});case T.DISABLED:return o.jsxs("div",{className:"disabled action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.disabled")})," ",o.jsx(l.Icon,{name:"close"})]});case T.UNDER_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.under_review")]});case T.TO_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]});default:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]})}},[t,e]),w=new Date((e==null?void 0:e.createdAt)||t.createdAt);return o.jsxs(l.Table.Row,{className:"CollectionRow",onClick:h,children:[o.jsx(l.Table.Cell,{width:5,children:o.jsxs("div",{className:"image-column",children:[o.jsx(pe,{collectionId:t.id}),o.jsxs("div",{className:"info",children:[o.jsxs("div",{className:"title",children:[o.jsx(qe,{collection:t}),t.name]}),o.jsx("div",{className:"subtitle name",children:c("collection_row.items",{count:r})})]})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Ge,{isThirdParty:J(t)})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Qe,{isProgrammatic:t.isProgrammatic})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{children:J(t)?"-":o.jsx(V,{textOnly:!0,address:t.owner})})}),o.jsx(l.Table.Cell,{width:3,children:o.jsxs("div",{title:xt(w,"d MMMM yyyy HH:mm"),children:[o.jsx("span",{children:c(e?"collection_row.review_request":"collection_row.published")})," ",Ve(w,{addSuffix:!0})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"actions text-centered",children:p()})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"edit-container",children:e!=null&&e.assignee?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"curator-name",children:[o.jsx(V,{textOnly:!0,address:e.assignee}),a===e.assignee?o.jsxs(o.Fragment,{children:[" (",c("collection_row.you"),")"]}):null," "]}),e.status!==T.APPROVED||!t.isApproved?o.jsx(l.Icon,{name:"pencil",onClick:g=>f(g,K.REASSIGN)}):null]}):o.jsxs("div",{className:"assignee-container",children:[c("collection_row.unassigned"),o.jsx("span",{className:"link",onClick:f,children:c("collection_row.assign_to_me")})]})})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"text-centered",children:t.forumLink?o.jsx("span",{className:"link",onClick:u,children:c("collection_row.link")}):c("collection_row.no_forum_post")})})]},t.id)}const Et=(n,t)=>({address:we(n),itemCount:Ce(n,t.collection.id)}),Dt=n=>({onOpenModal:(t,e)=>n(Te(t,e))}),Ot=re(Et,Dt)(yt);var F=(n=>(n.ALL_STATUS="ALL_STATUS",n))(F||{}),k=(n=>(n.ALL_TYPES="ALL_TYPES",n))(k||{});const U={...T,...F},ae={...xe,...k},G=12,Q="all";let St=class extends _e.PureComponent{constructor(){super(...arguments);v(this,"state",{sortBy:O.CREATED_AT_DESC,filterByStatus:F.ALL_STATUS,filterByTags:[],filterByType:k.ALL_TYPES,assignee:Q,searchText:"",page:1});v(this,"getFetchParams",e=>{const{assignee:a,filterByStatus:r,filterByType:i,page:s,searchText:u,sortBy:f,filterByTags:h}=this.state;return{page:s,limit:G,assignee:a!==Q?a:void 0,status:r!==F.ALL_STATUS?r:void 0,type:i!==k.ALL_TYPES?i:void 0,q:u||void 0,sort:f,tag:h.length>0?h:void 0,isPublished:!0,...e}});v(this,"fetchCollections",()=>{const{onFetchCollections:e}=this.props;e(this.getFetchParams())});v(this,"updateParam",e=>{this.setState(e,this.fetchCollections)});v(this,"handleSortChange",(e,{value:a})=>{this.updateParam({sortBy:a,page:1})});v(this,"handleStatusChange",(e,{value:a})=>{this.updateParam({filterByStatus:`${a}`,page:1})});v(this,"handleTypeChange",(e,{value:a})=>{this.updateParam({filterByType:`${a}`,page:1})});v(this,"handleAssigneeChange",(e,{value:a})=>{this.updateParam({assignee:`${a}`,page:1})});v(this,"handleSearchChange",e=>{const{searchText:a}=this.state;e!==a&&this.updateParam({searchText:e,page:1})});v(this,"handlePageChange",(e,a)=>{this.updateParam({page:+a.activePage})});v(this,"handleOnCampaignToggleChange",(e,a)=>{const{campaignTag:r}=this.props,{checked:i}=a;r&&(i?this.updateParam({filterByTags:[...this.state.filterByTags,r]}):this.updateParam({filterByTags:[...this.state.filterByTags.filter(s=>s!==r)]}))});v(this,"renderSortDropdown",()=>{const{sortBy:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:O.MOST_RELEVANT,text:c("curation_page.order.most_relevant")},{value:O.CREATED_AT_DESC,text:c("global.order.newest")},{value:O.NAME_ASC,text:c("global.order.name_asc")},{value:O.NAME_DESC,text:c("global.order.name_desc")}],onChange:this.handleSortChange})});v(this,"renderTypesFilterDropdown",()=>{const{filterByType:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:k.ALL_TYPES,text:c("curation_page.filter.all_types")},{value:ae.STANDARD,text:c("curation_page.filter.standard")},{value:ae.THIRD_PARTY,text:c("curation_page.filter.third_party")}],onChange:this.handleTypeChange})});v(this,"renderStatusFilterDropdown",()=>{const{filterByStatus:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:U.ALL_STATUS,text:c("curation_page.filter.all_status")},{value:U.UNDER_REVIEW,text:c("curation_page.filter.under_review")},{value:U.TO_REVIEW,text:c("curation_page.filter.to_review")},{value:U.APPROVED,text:c("curation_page.filter.approved")},{value:U.REJECTED,text:c("curation_page.filter.rejected")}],onChange:this.handleStatusChange})});v(this,"renderAssigneeFilterDropdown",()=>{const{committeeMembers:e,wallet:a}=this.props,{assignee:r}=this.state;return o.jsx(l.Dropdown,{className:"assignees",direction:"left",value:r,options:[{value:Q,text:c("curation_page.filter.all_assignees")},...e.reduce((i,s)=>(s===a.address?i.unshift(s):i.push(s),i),[]).map(i=>({value:i,text:o.jsx(V,{textOnly:!0,address:i})}))],onChange:this.handleAssigneeChange})});v(this,"renderCampaignFilterToggle",()=>{const{isCampaignEnabled:e,campaignName:a,campaignTag:r}=this.props,{filterByTags:i}=this.state;return e&&a&&r?o.jsx(l.Radio,{toggle:!0,className:"filterByCampaignTag",checked:i.includes(r),onChange:this.handleOnCampaignToggleChange,label:a}):null})}componentDidMount(){const{onFetchCollections:e,wallet:a,isLoadingCommittee:r,isCommitteeMember:i}=this.props;a&&!r&&i&&e({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}componentDidUpdate(e){const{onFetchCollections:a,wallet:r,isLoadingCommittee:i,isCommitteeMember:s}=this.props;r&&!i&&s&&e.isCommitteeMember!==s&&a({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}renderPage(){const{isLoadingCollectionsData:e,isLoadingCommittee:a,collections:r,curationsByCollectionId:i,paginationData:s}=this.props,{page:u,searchText:f}=this.state,h=s==null?void 0:s.total,p=s==null?void 0:s.totalPages,w=r,g=e||a||!s;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"filters",children:o.jsxs(l.Container,{children:[s?o.jsx(l.Row,{className:"text-filter-row",children:o.jsx(l.TextFilter,{placeholder:c("curation_page.search_placeholder"),value:f,onChange:this.handleSearchChange})}):null,o.jsxs(l.Row,{children:[o.jsx(l.Column,{grow:!1,shrink:!1,children:o.jsx(l.Row,{children:!e&&!!h&&h>0&&o.jsx(l.Header,{sub:!0,children:c("collections_page.results",{count:h})})})}),o.jsx(l.Column,{align:"right",shrink:!1,children:o.jsxs(l.Row,{children:[this.renderCampaignFilterToggle(),this.renderAssigneeFilterDropdown(),this.renderTypesFilterDropdown(),this.renderStatusFilterDropdown(),this.renderSortDropdown()]})})]})]})}),g?o.jsx(l.Loader,{active:!0,size:"large"}):o.jsxs(l.Container,{children:[o.jsxs(l.Section,{children:[o.jsx(l.Table,{basic:"very",children:r.length>0?o.jsxs(o.Fragment,{children:[o.jsx(l.Table.Header,{children:o.jsxs(l.Table.Row,{children:[o.jsx(l.Table.HeaderCell,{children:c("collection_row.collection")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.type")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.kind")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.owner")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.date")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.status")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.assignee")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.discussion")})]})}),o.jsx(l.Table.Body,{children:w.map(m=>o.jsx(Ot,{collection:m,curation:i[m.id]||null},m.id))})]}):null}),r.length===0?o.jsx(l.Empty,{height:200,children:o.jsx("div",{children:o.jsx(be,{id:"curation_page.empty_collections"})})}):null]}),!!p&&p>1&&o.jsx(l.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:p,activePage:u,onPageChange:this.handlePageChange})]})]})}render(){const{isCommitteeMember:e,isConnecting:a,isLoadingCommittee:r}=this.props,i=a||r;return o.jsx(He,{className:"CurationPage",activeTab:$e.CURATION,isLoading:i,children:e?this.renderPage():o.jsx(Be,{})})}};const Pt=n=>{var r;const t=ye(n),e=Ee(n),a=De(n);return{wallet:Oe(n),collections:e,paginationData:a,curationsByCollectionId:t,isCommitteeMember:Se(n),committeeMembers:Pe(n),isConnecting:je(n),isLoadingCommittee:q(Me(n),Re),isLoadingCollectionsData:q(Ne(n),Ye)||q(Le(n),Ae),isCampaignEnabled:Ue(n),campaignTag:Ie(n),campaignName:(r=We(n))==null?void 0:r[Fe(n)]}},jt=n=>({onFetchCollections:t=>n(ke(void 0,t))}),Ht=re(Pt,jt)(St);export{Ht as default};
|
|
1
|
+
var ue=Object.defineProperty;var he=(n,t,e)=>t in n?ue(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>he(n,typeof t!="symbol"?t+"":t,e);import{bO as x,bP as b,ca as j,hE as ge,gs as T,gE as fe,Z as me,D as A,hF as K,K as ve,H as o,G as c,M as l,dB as pe,eP as J,bC as V,N as re,aH as we,es as Ce,X as Te,eu as xe,af as _e,ev as O,bm as be,hG as ye,ex as Ee,eA as De,e8 as Oe,bt as Se,hH as Pe,a6 as je,bw as q,hI as Me,eC as Ne,gt as Le,eF as Ue,eJ as ke,hJ as Re,eL as Ye,hK as Ae}from"./index-j66rXTci.js";import{d as Ie,e as We,c as Fe}from"./selectors-DlaHedkY.js";import{N as Be}from"./NotFound-Drp5upn-.js";import{L as He}from"./LoggedInDetailPage.container-DDpb0HDW.js";import{N as $e}from"./Navigation.container-CuwEnxUg.js";import{C as qe}from"./CollectionStatus.container-B5kSw8QZ.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-CZ3_p5DQ.js";import{s as I,a as Ve}from"./date-DVtTbuy-.js";import{g as X,e as Xe,l as Ke}from"./index-CkloEuvz.js";import"./SignInRequired-C_a3RZQm.js";function Je(n,t){x(2,arguments);var e=b(n).getTime(),a=j(t);return new Date(e+a)}function Ze(n){return x(1,arguments),n instanceof Date||ge(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ze(n){if(x(1,arguments),!Ze(n)&&typeof n!="number")return!1;var t=b(n);return!isNaN(Number(t))}function et(n,t){x(2,arguments);var e=j(t);return Je(n,-e)}var tt=864e5;function at(n){x(1,arguments);var t=b(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var a=t.getTime(),r=e-a;return Math.floor(r/tt)+1}function W(n){x(1,arguments);var t=1,e=b(n),a=e.getUTCDay(),r=(a<t?7:0)+a-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function ne(n){x(1,arguments);var t=b(n),e=t.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(e+1,0,4),a.setUTCHours(0,0,0,0);var r=W(a),i=new Date(0);i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0);var s=W(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function rt(n){x(1,arguments);var t=ne(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var a=W(e);return a}var nt=6048e5;function it(n){x(1,arguments);var t=b(n),e=W(t).getTime()-rt(t).getTime();return Math.round(e/nt)+1}function ie(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=b(n),w=p.getUTCFullYear(),g=X(),m=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:g.firstWeekContainsDate)!==null&&a!==void 0?a:(f=g.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(m>=1&&m<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _=new Date(0);_.setUTCFullYear(w+1,0,m),_.setUTCHours(0,0,0,0);var M=I(_,t),D=new Date(0);D.setUTCFullYear(w,0,m),D.setUTCHours(0,0,0,0);var B=I(D,t);return p.getTime()>=M.getTime()?w+1:p.getTime()>=B.getTime()?w:w-1}function ot(n,t){var e,a,r,i,s,u,f,h;x(1,arguments);var p=X(),w=j((e=(a=(r=(i=t==null?void 0:t.firstWeekContainsDate)!==null&&i!==void 0?i:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:p.firstWeekContainsDate)!==null&&a!==void 0?a:(f=p.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&e!==void 0?e:1),g=ie(n,t),m=new Date(0);m.setUTCFullYear(g,0,w),m.setUTCHours(0,0,0,0);var _=I(m,t);return _}var st=6048e5;function lt(n,t){x(1,arguments);var e=b(n),a=I(e,t).getTime()-ot(e,t).getTime();return Math.round(a/st)+1}function d(n,t){for(var e=n<0?"-":"",a=Math.abs(n).toString();a.length<t;)a="0"+a;return e+a}var E={y:function(t,e){var a=t.getUTCFullYear(),r=a>0?a:1-a;return d(e==="yy"?r%100:r,e.length)},M:function(t,e){var a=t.getUTCMonth();return e==="M"?String(a+1):d(a+1,2)},d:function(t,e){return d(t.getUTCDate(),e.length)},a:function(t,e){var a=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.toUpperCase();case"aaa":return a;case"aaaaa":return a[0];case"aaaa":default:return a==="am"?"a.m.":"p.m."}},h:function(t,e){return d(t.getUTCHours()%12||12,e.length)},H:function(t,e){return d(t.getUTCHours(),e.length)},m:function(t,e){return d(t.getUTCMinutes(),e.length)},s:function(t,e){return d(t.getUTCSeconds(),e.length)},S:function(t,e){var a=e.length,r=t.getUTCMilliseconds(),i=Math.floor(r*Math.pow(10,a-3));return d(i,e.length)}},P={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ct={G:function(t,e,a){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return a.era(r,{width:"abbreviated"});case"GGGGG":return a.era(r,{width:"narrow"});case"GGGG":default:return a.era(r,{width:"wide"})}},y:function(t,e,a){if(e==="yo"){var r=t.getUTCFullYear(),i=r>0?r:1-r;return a.ordinalNumber(i,{unit:"year"})}return E.y(t,e)},Y:function(t,e,a,r){var i=ie(t,r),s=i>0?i:1-i;if(e==="YY"){var u=s%100;return d(u,2)}return e==="Yo"?a.ordinalNumber(s,{unit:"year"}):d(s,e.length)},R:function(t,e){var a=ne(t);return d(a,e.length)},u:function(t,e){var a=t.getUTCFullYear();return d(a,e.length)},Q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return d(r,2);case"Qo":return a.ordinalNumber(r,{unit:"quarter"});case"QQQ":return a.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return a.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,a){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return d(r,2);case"qo":return a.ordinalNumber(r,{unit:"quarter"});case"qqq":return a.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return a.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,a){var r=t.getUTCMonth();switch(e){case"M":case"MM":return E.M(t,e);case"Mo":return a.ordinalNumber(r+1,{unit:"month"});case"MMM":return a.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return a.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,a){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return d(r+1,2);case"Lo":return a.ordinalNumber(r+1,{unit:"month"});case"LLL":return a.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return a.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,a,r){var i=lt(t,r);return e==="wo"?a.ordinalNumber(i,{unit:"week"}):d(i,e.length)},I:function(t,e,a){var r=it(t);return e==="Io"?a.ordinalNumber(r,{unit:"week"}):d(r,e.length)},d:function(t,e,a){return e==="do"?a.ordinalNumber(t.getUTCDate(),{unit:"date"}):E.d(t,e)},D:function(t,e,a){var r=at(t);return e==="Do"?a.ordinalNumber(r,{unit:"dayOfYear"}):d(r,e.length)},E:function(t,e,a){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return a.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return a.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(r,{width:"short",context:"formatting"});case"EEEE":default:return a.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return d(s,2);case"eo":return a.ordinalNumber(s,{unit:"day"});case"eee":return a.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,a,r){var i=t.getUTCDay(),s=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return d(s,e.length);case"co":return a.ordinalNumber(s,{unit:"day"});case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,a){var r=t.getUTCDay(),i=r===0?7:r;switch(e){case"i":return String(i);case"ii":return d(i,e.length);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return a.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return a.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return a.day(r,{width:"short",context:"formatting"});case"iiii":default:return a.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,a){var r=t.getUTCHours(),i=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(t,e,a){var r=t.getUTCHours(),i;switch(r===12?i=P.noon:r===0?i=P.midnight:i=r/12>=1?"pm":"am",e){case"b":case"bb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(t,e,a){var r=t.getUTCHours(),i;switch(r>=17?i=P.evening:r>=12?i=P.afternoon:r>=4?i=P.morning:i=P.night,e){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(t,e,a){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),a.ordinalNumber(r,{unit:"hour"})}return E.h(t,e)},H:function(t,e,a){return e==="Ho"?a.ordinalNumber(t.getUTCHours(),{unit:"hour"}):E.H(t,e)},K:function(t,e,a){var r=t.getUTCHours()%12;return e==="Ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},k:function(t,e,a){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?a.ordinalNumber(r,{unit:"hour"}):d(r,e.length)},m:function(t,e,a){return e==="mo"?a.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E.m(t,e)},s:function(t,e,a){return e==="so"?a.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):E.s(t,e)},S:function(t,e){return E.S(t,e)},X:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return z(s);case"XXXX":case"XX":return S(s);case"XXXXX":case"XXX":default:return S(s,":")}},x:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"x":return z(s);case"xxxx":case"xx":return S(s);case"xxxxx":case"xxx":default:return S(s,":")}},O:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Z(s,":");case"OOOO":default:return"GMT"+S(s,":")}},z:function(t,e,a,r){var i=r._originalDate||t,s=i.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Z(s,":");case"zzzz":default:return"GMT"+S(s,":")}},t:function(t,e,a,r){var i=r._originalDate||t,s=Math.floor(i.getTime()/1e3);return d(s,e.length)},T:function(t,e,a,r){var i=r._originalDate||t,s=i.getTime();return d(s,e.length)}};function Z(n,t){var e=n>0?"-":"+",a=Math.abs(n),r=Math.floor(a/60),i=a%60;if(i===0)return e+String(r);var s=t;return e+String(r)+s+d(i,2)}function z(n,t){if(n%60===0){var e=n>0?"-":"+";return e+d(Math.abs(n)/60,2)}return S(n,t)}function S(n,t){var e=t||"",a=n>0?"-":"+",r=Math.abs(n),i=d(Math.floor(r/60),2),s=d(r%60,2);return a+i+e+s}var ee=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oe=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},dt=function(t,e){var a=t.match(/(P+)(p+)?/)||[],r=a[1],i=a[2];if(!i)return ee(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ee(r,e)).replace("{{time}}",oe(i,e))},ut={p:oe,P:dt},ht=["D","DD"],gt=["YY","YYYY"];function ft(n){return ht.indexOf(n)!==-1}function mt(n){return gt.indexOf(n)!==-1}function te(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var vt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wt=/^'([^]*?)'?$/,Ct=/''/g,Tt=/[a-zA-Z]/;function xt(n,t,e){var a,r,i,s,u,f,h,p,w,g,m,_,M,D;x(2,arguments);var B=String(t),N=X(),L=(a=(r=void 0)!==null&&r!==void 0?r:N.locale)!==null&&a!==void 0?a:Ke,H=j((i=(s=(u=(f=void 0)!==null&&f!==void 0?f:void 0)!==null&&u!==void 0?u:N.firstWeekContainsDate)!==null&&s!==void 0?s:(h=N.locale)===null||h===void 0||(p=h.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(H>=1&&H<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var $=j((w=(g=(m=(_=void 0)!==null&&_!==void 0?_:void 0)!==null&&m!==void 0?m:N.weekStartsOn)!==null&&g!==void 0?g:(M=N.locale)===null||M===void 0||(D=M.options)===null||D===void 0?void 0:D.weekStartsOn)!==null&&w!==void 0?w:0);if(!($>=0&&$<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!L.localize)throw new RangeError("locale must contain localize property");if(!L.formatLong)throw new RangeError("locale must contain formatLong property");var R=b(n);if(!ze(R))throw new RangeError("Invalid time value");var se=Xe(R),le=et(R,se),ce={firstWeekContainsDate:H,weekStartsOn:$,locale:L,_originalDate:R},de=B.match(pt).map(function(C){var y=C[0];if(y==="p"||y==="P"){var Y=ut[y];return Y(C,L.formatLong)}return C}).join("").match(vt).map(function(C){if(C==="''")return"'";var y=C[0];if(y==="'")return _t(C);var Y=ct[y];if(Y)return mt(C)&&te(C,t,String(n)),ft(C)&&te(C,t,String(n)),Y(le,C,L.localize,ce);if(y.match(Tt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return C}).join("");return de}function _t(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const bt=(n,t)=>{if(n.isApproved){if(!t||t.status==="approved")return T.APPROVED;if(t.status==="rejected")return T.REJECTED}else{if(!t&&fe(n))return T.DISABLED;if(t&&t.status==="rejected")return T.REJECTED}return t&&t.status==="pending"&&t.assignee?T.UNDER_REVIEW:T.TO_REVIEW};function yt(n){const{collection:t,curation:e,address:a,itemCount:r,onOpenModal:i}=n,s=me(),u=A.useCallback(g=>{window.open(t.forumLink,"_blank"),g.preventDefault(),g.stopPropagation()},[t]),f=A.useCallback((g,m=K.SELF_ASSIGN)=>{i("EditCurationAssigneeModal",{collectionId:t.id,type:m}),g.preventDefault(),g.stopPropagation()},[i,t]),h=A.useCallback(()=>{s.push(ve.itemEditor({collectionId:t.id,isReviewing:"true"}))},[s,t]),p=A.useCallback(()=>{switch(bt(t,e)){case T.APPROVED:return o.jsxs("div",{className:"approved action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.approved")})," ",o.jsx(l.Icon,{name:"check"})]});case T.REJECTED:return o.jsxs("div",{className:"rejected action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.rejected")})," ",o.jsx(l.Icon,{name:"close"})]});case T.DISABLED:return o.jsxs("div",{className:"disabled action",children:[o.jsx("span",{className:"action-text",children:c("collection_row.disabled")})," ",o.jsx(l.Icon,{name:"close"})]});case T.UNDER_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.under_review")]});case T.TO_REVIEW:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]});default:return o.jsxs("span",{children:[" ",c("collection_row.to_review")]})}},[t,e]),w=new Date((e==null?void 0:e.createdAt)||t.createdAt);return o.jsxs(l.Table.Row,{className:"CollectionRow",onClick:h,children:[o.jsx(l.Table.Cell,{width:5,children:o.jsxs("div",{className:"image-column",children:[o.jsx(pe,{collectionId:t.id}),o.jsxs("div",{className:"info",children:[o.jsxs("div",{className:"title",children:[o.jsx(qe,{collection:t}),t.name]}),o.jsx("div",{className:"subtitle name",children:c("collection_row.items",{count:r})})]})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Ge,{isThirdParty:J(t)})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx(Qe,{isProgrammatic:t.isProgrammatic})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{children:J(t)?"-":o.jsx(V,{textOnly:!0,address:t.owner})})}),o.jsx(l.Table.Cell,{width:3,children:o.jsxs("div",{title:xt(w,"d MMMM yyyy HH:mm"),children:[o.jsx("span",{children:c(e?"collection_row.review_request":"collection_row.published")})," ",Ve(w,{addSuffix:!0})]})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"actions text-centered",children:p()})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"edit-container",children:e!=null&&e.assignee?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"curator-name",children:[o.jsx(V,{textOnly:!0,address:e.assignee}),a===e.assignee?o.jsxs(o.Fragment,{children:[" (",c("collection_row.you"),")"]}):null," "]}),e.status!==T.APPROVED||!t.isApproved?o.jsx(l.Icon,{name:"pencil",onClick:g=>f(g,K.REASSIGN)}):null]}):o.jsxs("div",{className:"assignee-container",children:[c("collection_row.unassigned"),o.jsx("span",{className:"link",onClick:f,children:c("collection_row.assign_to_me")})]})})}),o.jsx(l.Table.Cell,{width:2,children:o.jsx("div",{className:"text-centered",children:t.forumLink?o.jsx("span",{className:"link",onClick:u,children:c("collection_row.link")}):c("collection_row.no_forum_post")})})]},t.id)}const Et=(n,t)=>({address:we(n),itemCount:Ce(n,t.collection.id)}),Dt=n=>({onOpenModal:(t,e)=>n(Te(t,e))}),Ot=re(Et,Dt)(yt);var F=(n=>(n.ALL_STATUS="ALL_STATUS",n))(F||{}),k=(n=>(n.ALL_TYPES="ALL_TYPES",n))(k||{});const U={...T,...F},ae={...xe,...k},G=12,Q="all";let St=class extends _e.PureComponent{constructor(){super(...arguments);v(this,"state",{sortBy:O.CREATED_AT_DESC,filterByStatus:F.ALL_STATUS,filterByTags:[],filterByType:k.ALL_TYPES,assignee:Q,searchText:"",page:1});v(this,"getFetchParams",e=>{const{assignee:a,filterByStatus:r,filterByType:i,page:s,searchText:u,sortBy:f,filterByTags:h}=this.state;return{page:s,limit:G,assignee:a!==Q?a:void 0,status:r!==F.ALL_STATUS?r:void 0,type:i!==k.ALL_TYPES?i:void 0,q:u||void 0,sort:f,tag:h.length>0?h:void 0,isPublished:!0,...e}});v(this,"fetchCollections",()=>{const{onFetchCollections:e}=this.props;e(this.getFetchParams())});v(this,"updateParam",e=>{this.setState(e,this.fetchCollections)});v(this,"handleSortChange",(e,{value:a})=>{this.updateParam({sortBy:a,page:1})});v(this,"handleStatusChange",(e,{value:a})=>{this.updateParam({filterByStatus:`${a}`,page:1})});v(this,"handleTypeChange",(e,{value:a})=>{this.updateParam({filterByType:`${a}`,page:1})});v(this,"handleAssigneeChange",(e,{value:a})=>{this.updateParam({assignee:`${a}`,page:1})});v(this,"handleSearchChange",e=>{const{searchText:a}=this.state;e!==a&&this.updateParam({searchText:e,page:1})});v(this,"handlePageChange",(e,a)=>{this.updateParam({page:+a.activePage})});v(this,"handleOnCampaignToggleChange",(e,a)=>{const{campaignTag:r}=this.props,{checked:i}=a;r&&(i?this.updateParam({filterByTags:[...this.state.filterByTags,r]}):this.updateParam({filterByTags:[...this.state.filterByTags.filter(s=>s!==r)]}))});v(this,"renderSortDropdown",()=>{const{sortBy:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:O.MOST_RELEVANT,text:c("curation_page.order.most_relevant")},{value:O.CREATED_AT_DESC,text:c("global.order.newest")},{value:O.NAME_ASC,text:c("global.order.name_asc")},{value:O.NAME_DESC,text:c("global.order.name_desc")}],onChange:this.handleSortChange})});v(this,"renderTypesFilterDropdown",()=>{const{filterByType:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:k.ALL_TYPES,text:c("curation_page.filter.all_types")},{value:ae.STANDARD,text:c("curation_page.filter.standard")},{value:ae.THIRD_PARTY,text:c("curation_page.filter.third_party")}],onChange:this.handleTypeChange})});v(this,"renderStatusFilterDropdown",()=>{const{filterByStatus:e}=this.state;return o.jsx(l.Dropdown,{direction:"left",value:e,options:[{value:U.ALL_STATUS,text:c("curation_page.filter.all_status")},{value:U.UNDER_REVIEW,text:c("curation_page.filter.under_review")},{value:U.TO_REVIEW,text:c("curation_page.filter.to_review")},{value:U.APPROVED,text:c("curation_page.filter.approved")},{value:U.REJECTED,text:c("curation_page.filter.rejected")}],onChange:this.handleStatusChange})});v(this,"renderAssigneeFilterDropdown",()=>{const{committeeMembers:e,wallet:a}=this.props,{assignee:r}=this.state;return o.jsx(l.Dropdown,{className:"assignees",direction:"left",value:r,options:[{value:Q,text:c("curation_page.filter.all_assignees")},...e.reduce((i,s)=>(s===a.address?i.unshift(s):i.push(s),i),[]).map(i=>({value:i,text:o.jsx(V,{textOnly:!0,address:i})}))],onChange:this.handleAssigneeChange})});v(this,"renderCampaignFilterToggle",()=>{const{isCampaignEnabled:e,campaignName:a,campaignTag:r}=this.props,{filterByTags:i}=this.state;return e&&a&&r?o.jsx(l.Radio,{toggle:!0,className:"filterByCampaignTag",checked:i.includes(r),onChange:this.handleOnCampaignToggleChange,label:a}):null})}componentDidMount(){const{onFetchCollections:e,wallet:a,isLoadingCommittee:r,isCommitteeMember:i}=this.props;a&&!r&&i&&e({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}componentDidUpdate(e){const{onFetchCollections:a,wallet:r,isLoadingCommittee:i,isCommitteeMember:s}=this.props;r&&!i&&s&&e.isCommitteeMember!==s&&a({page:1,limit:G,isPublished:!0,sort:O.MOST_RELEVANT})}renderPage(){const{isLoadingCollectionsData:e,isLoadingCommittee:a,collections:r,curationsByCollectionId:i,paginationData:s}=this.props,{page:u,searchText:f}=this.state,h=s==null?void 0:s.total,p=s==null?void 0:s.totalPages,w=r,g=e||a||!s;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"filters",children:o.jsxs(l.Container,{children:[s?o.jsx(l.Row,{className:"text-filter-row",children:o.jsx(l.TextFilter,{placeholder:c("curation_page.search_placeholder"),value:f,onChange:this.handleSearchChange})}):null,o.jsxs(l.Row,{children:[o.jsx(l.Column,{grow:!1,shrink:!1,children:o.jsx(l.Row,{children:!e&&!!h&&h>0&&o.jsx(l.Header,{sub:!0,children:c("collections_page.results",{count:h})})})}),o.jsx(l.Column,{align:"right",shrink:!1,children:o.jsxs(l.Row,{children:[this.renderCampaignFilterToggle(),this.renderAssigneeFilterDropdown(),this.renderTypesFilterDropdown(),this.renderStatusFilterDropdown(),this.renderSortDropdown()]})})]})]})}),g?o.jsx(l.Loader,{active:!0,size:"large"}):o.jsxs(l.Container,{children:[o.jsxs(l.Section,{children:[o.jsx(l.Table,{basic:"very",children:r.length>0?o.jsxs(o.Fragment,{children:[o.jsx(l.Table.Header,{children:o.jsxs(l.Table.Row,{children:[o.jsx(l.Table.HeaderCell,{children:c("collection_row.collection")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.type")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.kind")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.owner")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.date")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.status")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.assignee")}),o.jsx(l.Table.HeaderCell,{children:c("collection_row.discussion")})]})}),o.jsx(l.Table.Body,{children:w.map(m=>o.jsx(Ot,{collection:m,curation:i[m.id]||null},m.id))})]}):null}),r.length===0?o.jsx(l.Empty,{height:200,children:o.jsx("div",{children:o.jsx(be,{id:"curation_page.empty_collections"})})}):null]}),!!p&&p>1&&o.jsx(l.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:p,activePage:u,onPageChange:this.handlePageChange})]})]})}render(){const{isCommitteeMember:e,isConnecting:a,isLoadingCommittee:r}=this.props,i=a||r;return o.jsx(He,{className:"CurationPage",activeTab:$e.CURATION,isLoading:i,children:e?this.renderPage():o.jsx(Be,{})})}};const Pt=n=>{var r;const t=ye(n),e=Ee(n),a=De(n);return{wallet:Oe(n),collections:e,paginationData:a,curationsByCollectionId:t,isCommitteeMember:Se(n),committeeMembers:Pe(n),isConnecting:je(n),isLoadingCommittee:q(Me(n),Re),isLoadingCollectionsData:q(Ne(n),Ye)||q(Le(n),Ae),isCampaignEnabled:Ue(n),campaignTag:Ie(n),campaignName:(r=We(n))==null?void 0:r[Fe(n)]}},jt=n=>({onFetchCollections:t=>n(ke(void 0,t))}),Ht=re(Pt,jt)(St);export{Ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as be,Z as F,D as n,af as je,H as e,G as s,L as de,K as E,dC as me,M as a,N as U,eo as Ie,X as he,ep as Se,eq as Z,a1 as fe,dB as Ce,er as Ne,es as ue,et as ve,eu as oe,J as Re,ev as N,aZ as ce,ew as w,aH as we,ex as Le,ey as De,ez as Ee,eA as Ae,eB as Oe,bw as G,eC as ye,eD as ie,eE as Pe,eF as ke,eG as Me,eH as He,eI as $e,eJ as Be,eK as Fe,eL as Ue,eM as Ve,eN as ze}from"./index-ZuMScRBF.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-CsesGRoh.js";import{L as Ze}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{O as ge}from"./OptionsDropdown-A7bqXuQQ.js";import{a as B}from"./date-BqKdO_5V.js";import{C as _e}from"./CollectionStatus.container-IWl9eE40.js";import"./selectors-CVDyed6b.js";import"./SignInRequired-D6dYEPdh.js";import"./index-BskZ5mzb.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:o}=be(),d=F(),r=d.push.bind(d),c=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(t);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[t]),u=n.useMemo(()=>new URLSearchParams(t).get("sortBy"),[t])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(t),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??c),I=(_-1)*p;return[_,p,I]},[c,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${o}?${i.toString()}`)},[t,g,r,o]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${o}?${_.toString()}`)},[t,r,o]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${o}?${_.toString()}`)},[o,r,t]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:t);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${o}?${I.toString()}`)},[o,r,t,u]),v=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,f=v?g<v:void 0;return{page:g,pages:v,hasMorePages:f,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:t,onDeleteItem:o,onOpenModal:d}=l,[r,c]=n.useState(!1),x=n.useCallback(()=>c(!1),[c]),u=n.useCallback(()=>c(!0),[c]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{c(!1),o()},[c,o]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(t.id),children:[e.jsx(me,{item:t}),e.jsxs(a.Card.Content,{children:[e.jsx("div",{className:"text",title:t.name,children:t.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${t.type}`)})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:t.name}),content:s("item_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},et=je.memo(Xe),tt=(l,t)=>({onDeleteItem:()=>l(Ie(t.item)),onOpenModal:o=>l(he(o,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ot="_title_xmdia_29",ct="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ot,imageColumn:ct,published:it};function rt(l){const{item:t}=l,o=F(),d=n.useCallback(()=>{o.push(E.itemDetail(t.id))},[o]);return e.jsxs(a.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(a.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:t}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:t}),e.jsx("div",{className:D.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})})]})}const dt=l=>{const{collection:t,onDeleteCollection:o,itemCount:d}=l,[r,c]=n.useState(!1),x=n.useCallback(()=>c(!1),[c]),u=n.useCallback(()=>c(!0),[c]),g=n.useCallback(()=>{c(!1),o()},[c,o]),b=Z(t);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!t.isPublished&&e.jsx(ge,{className:fe({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(t.id,b),children:[e.jsx(Ce,{collectionId:t.id}),e.jsxs(a.Card.Content,{children:[e.jsxs("div",{className:"text",title:t.name,children:[e.jsx(_e,{collection:t})," ",t.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!t.isMappingComplete&&Ne(t.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(a.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:t.name}),content:s("collection_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},mt=n.memo(dt),ht=(l,t)=>({itemCount:ue(l,t.collection.id)}),Ct=(l,t)=>({onDeleteCollection:()=>l(ve(t.collection))}),ut=U(ht,Ct)(mt),gt="_CollectionRow_k7d4q_1",_t="_image_k7d4q_7",xt="_name_k7d4q_16",pt="_title_k7d4q_24",Tt="_imageColumn_k7d4q_25",bt="_published_k7d4q_30",L={CollectionRow:gt,image:_t,name:xt,title:pt,imageColumn:Tt,published:bt};function jt(l){const{collection:t,itemCount:o}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),c=Z(t);return e.jsxs(a.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(a.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:t.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:t}),e.jsx("div",{className:L.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:s(`collection.type.${c}`)}),e.jsx(a.Table.Cell,{width:2,children:o}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:t.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(a.Icon,{name:"check"})]}):null})]})}const It=(l,t)=>({itemCount:ue(l,t.collection.id)}),St=U(It)(jt);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function ft(l){const{address:t,items:o,collections:d,view:r,collectionsPaginationData:c,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:v,onOpenModal:f,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:y,changeFilter:P,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:c==null?void 0:c.total}),h=y.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(y.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&t&&V(t)},[t,u]),n.useEffect(()=>{t&&(h===m.ITEMS?v(t,{page:p,limit:Y}):O(t,{page:p,limit:Y,q:y.search??void 0,type:h===m.STANDARD_COLLECTIONS?oe.STANDARD:oe.THIRD_PARTY,sort:k}))},[t,p,h,y.search,k,v,O]);const pe=n.useCallback(()=>{f("CreateThirdPartyCollectionModal")},[f]),$=n.useCallback(()=>{f(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[f,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{P("search",T.value)},500)},[P]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&P("section",C)},[t,h,P]),te=n.useCallback(()=>e.jsx(a.Card.Group,{children:M?d.map((C,T)=>e.jsx(ut,{collection:C},T)):g?e.jsx(a.Loader,{size:"large",active:!0}):o.map((C,T)=>e.jsx(at,{item:C},T))}),[o,d,g,M,h]),ae=n.useCallback(()=>M?e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:d.map(C=>e.jsx(St,{collection:C},C.id))})]})}):e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("global.item")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(a.Table.Body,{children:o.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[o,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(a.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(a.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(a.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(a.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(a.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(Re,{name:"cube"}),s("item_editor.open")]}),e.jsxs(a.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(a.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(a.Column,{align:"right",children:e.jsxs(a.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(a.Dropdown,{direction:"left",value:k,options:[{value:N.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:N.CREATED_AT_DESC,text:s("global.order.newest")},{value:N.CREATED_AT_ASC,text:s("global.order.oldest")},{value:N.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:N.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:N.NAME_DESC,text:s("global.order.name_desc")},{value:N.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(ce,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(ce,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=c==null?void 0:c.total,T=x==null?void 0:x.total,R=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(a.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(a.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsx(a.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(a.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(a.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(a.Row,{height:30,children:[e.jsx(a.Column,{children:e.jsx(a.Row,{children:!g&&!b&&!!R&&R>0&&e.jsx(a.Header,{sub:!0,children:s("collections_page.results",{count:R})})})}),ne()]})]})}),g||b||R===void 0?e.jsx(a.Loader,{active:!0,size:"large"}):R>0?e.jsxs(e.Fragment,{children:[r===w.GRID?te():r===w.LIST?ae():null,!!q&&q>1&&e.jsx(a.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(a.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,c,x,r,u,g,b,A,j,S,le,$,te,ae,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const Nt=l=>{const t=we(l),o=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,c=Ae(l);return{items:d,address:t,collections:o,collectionsPaginationData:c,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(ye(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:Pe(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},vt=l=>({onSetView:t=>l(He(t)),onOpenModal:(t,o)=>l(he(t,o)),onFetchOrphanItems:(t,o)=>l($e(t,o)),onFetchCollections:(t,o)=>l(Be(t,o)),onFetchOrphanItem:t=>l(Fe(t))}),kt=U(Nt,vt)(ft);export{kt as default};
|
|
1
|
+
import{bv as be,Z as F,D as n,af as je,H as e,G as s,L as de,K as E,dC as me,M as a,N as U,eo as Ie,X as he,ep as Se,eq as Z,a1 as fe,dB as Ce,er as Ne,es as ue,et as ve,eu as oe,J as Re,ev as N,aZ as ce,ew as w,aH as we,ex as Le,ey as De,ez as Ee,eA as Ae,eB as Oe,bw as G,eC as ye,eD as ie,eE as Pe,eF as ke,eG as Me,eH as He,eI as $e,eJ as Be,eK as Fe,eL as Ue,eM as Ve,eN as ze}from"./index-j66rXTci.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-CuwEnxUg.js";import{L as Ze}from"./LoggedInDetailPage.container-DDpb0HDW.js";import{O as ge}from"./OptionsDropdown-psFuZbbt.js";import{a as B}from"./date-DVtTbuy-.js";import{C as _e}from"./CollectionStatus.container-B5kSw8QZ.js";import"./selectors-DlaHedkY.js";import"./SignInRequired-C_a3RZQm.js";import"./index-CkloEuvz.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:o}=be(),d=F(),r=d.push.bind(d),c=n.useMemo(()=>{var i;return((i=l==null?void 0:l.pageSize)==null?void 0:i.toString())??re.toString()},[l==null?void 0:l.pageSize]),x=n.useMemo(()=>{const i=new URLSearchParams(t);return i.delete("page"),i.delete("first"),i.delete("offset"),i.delete("sortBy"),Object.fromEntries(i.entries())},[t]),u=n.useMemo(()=>new URLSearchParams(t).get("sortBy"),[t])??void 0,[g,b,A]=n.useMemo(()=>{const i=new URLSearchParams(t),_=parseInt(i.get("page")??"1"),p=parseInt(i.get("first")??c),I=(_-1)*p;return[_,p,I]},[c,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${o}?${i.toString()}`)},[t,g,r,o]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${o}?${_.toString()}`)},[t,r,o]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${o}?${_.toString()}`)},[o,r,t]),V=n.useCallback((i,_,p={clearOldFilters:!1})=>{const I=new URLSearchParams(p.clearOldFilters?{}:t);I.set("page","1"),p.clearOldFilters&&u&&I.set("sortBy",u),I.set(i,_),r(`${o}?${I.toString()}`)},[o,r,t,u]),v=l!=null&&l.count?Math.ceil((l==null?void 0:l.count)/((l==null?void 0:l.pageSize)??re)):void 0,f=v?g<v:void 0;return{page:g,pages:v,hasMorePages:f,first:b,offset:A,sortBy:u,filters:x,goToNextPage:j,goToPage:S,changeSorting:O,changeFilter:V}}const Ke="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18%2018H28V28H18V18Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%204H14V14H4V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M18%204H28V14H18V4Z'%20fill='%23A09BA8'/%3e%3cpath%20d='M4%2018H14V28H4V18Z'%20fill='%23A09BA8'/%3e%3c/svg%3e",Xe=l=>{const{item:t,onDeleteItem:o,onOpenModal:d}=l,[r,c]=n.useState(!1),x=n.useCallback(()=>c(!1),[c]),u=n.useCallback(()=>c(!0),[c]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{c(!1),o()},[c,o]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"ItemCard is-card",children:[e.jsx(ge,{className:"options-dropdown",options:[{text:s("item_card.move_to_collection"),handler:g},{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.itemDetail(t.id),children:[e.jsx(me,{item:t}),e.jsxs(a.Card.Content,{children:[e.jsx("div",{className:"text",title:t.name,children:t.name}),e.jsx("div",{className:"subtitle",children:s(`item.type.${t.type}`)})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("item_card.confirm_delete_header",{name:t.name}),content:s("item_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:b})]})},et=je.memo(Xe),tt=(l,t)=>({onDeleteItem:()=>l(Ie(t.item)),onOpenModal:o=>l(he(o,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ot="_title_xmdia_29",ct="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ot,imageColumn:ct,published:it};function rt(l){const{item:t}=l,o=F(),d=n.useCallback(()=>{o.push(E.itemDetail(t.id))},[o]);return e.jsxs(a.Table.Row,{className:D.ItemRow,onClick:d,children:[e.jsx(a.Table.Cell,{width:4,children:e.jsxs("div",{className:D.imageColumn,children:[e.jsx(me,{className:D.image,item:t}),e.jsxs("div",{className:D.title,children:[e.jsx(Se,{item:t}),e.jsx("div",{className:D.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})})]})}const dt=l=>{const{collection:t,onDeleteCollection:o,itemCount:d}=l,[r,c]=n.useState(!1),x=n.useCallback(()=>c(!1),[c]),u=n.useCallback(()=>c(!0),[c]),g=n.useCallback(()=>{c(!1),o()},[c,o]),b=Z(t);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"CollectionCard is-card",children:[!t.isPublished&&e.jsx(ge,{className:fe({"empty-collection-options":d===0},"options-dropdown"),options:[{text:s("global.delete"),handler:u}]}),e.jsxs(de,{to:E.collectionDetail(t.id,b),children:[e.jsx(Ce,{collectionId:t.id}),e.jsxs(a.Card.Content,{children:[e.jsxs("div",{className:"text",title:t.name,children:[e.jsx(_e,{collection:t})," ",t.name]}),e.jsxs("div",{className:"subtitle",children:[s(`collection.type.${b}`)," · ",s("collection_card.item_count",{count:d})]}),!t.isMappingComplete&&Ne(t.urn)&&e.jsxs("div",{className:"pending-migration",children:[e.jsx(a.Icon,{name:"warning circle"})," ",s("item_status.pending_migration")]})]})]})]}),e.jsx(a.Confirm,{size:"tiny",open:r,header:s("collection_card.confirm_delete_header",{name:t.name}),content:s("collection_card.confirm_delete_content",{name:t.name}),confirmButton:e.jsx(a.Button,{primary:!0,children:s("global.confirm")}),cancelButton:e.jsx(a.Button,{secondary:!0,children:s("global.cancel")}),onCancel:x,onConfirm:g,className:"delete-collection-confirm"})]})},mt=n.memo(dt),ht=(l,t)=>({itemCount:ue(l,t.collection.id)}),Ct=(l,t)=>({onDeleteCollection:()=>l(ve(t.collection))}),ut=U(ht,Ct)(mt),gt="_CollectionRow_k7d4q_1",_t="_image_k7d4q_7",xt="_name_k7d4q_16",pt="_title_k7d4q_24",Tt="_imageColumn_k7d4q_25",bt="_published_k7d4q_30",L={CollectionRow:gt,image:_t,name:xt,title:pt,imageColumn:Tt,published:bt};function jt(l){const{collection:t,itemCount:o}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),c=Z(t);return e.jsxs(a.Table.Row,{className:L.CollectionRow,onClick:r,children:[e.jsx(a.Table.Cell,{width:3,children:e.jsxs("div",{className:L.imageColumn,children:[e.jsx(Ce,{className:L.image,collectionId:t.id}),e.jsxs("div",{className:L.title,children:[e.jsx(_e,{collection:t}),e.jsx("div",{className:L.name,children:t.name})]})]})}),e.jsx(a.Table.Cell,{width:3,children:s(`collection.type.${c}`)}),e.jsx(a.Table.Cell,{width:2,children:o}),e.jsx(a.Table.Cell,{width:3,children:B(t.createdAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:B(t.updatedAt,{addSuffix:!0})}),e.jsx(a.Table.Cell,{width:3,children:t.isPublished?e.jsxs("div",{className:L.published,children:[s("global.published")," ",e.jsx(a.Icon,{name:"check"})]}):null})]})}const It=(l,t)=>({itemCount:ue(l,t.collection.id)}),St=U(It)(jt);var m=(l=>(l.STANDARD_COLLECTIONS="standard_collections",l.THIRD_PARTY_COLLECTIONS="third_party_collections",l.ITEMS="orphan_items",l))(m||{});const Y=20;function ft(l){const{address:t,items:o,collections:d,view:r,collectionsPaginationData:c,itemsPaginationData:x,hasUserOrphanItems:u,isLoadingItems:g,isLoadingCollections:b,isLoadingOrphanItem:A,isLinkedWearablesPaymentsEnabled:j,isThirdPartyManager:S,onFetchCollections:O,onFetchOrphanItem:V,onFetchOrphanItems:v,onOpenModal:f,onSetView:i}=l,_=F(),{page:p,pages:I,goToPage:Q,filters:y,changeFilter:P,sortBy:k,changeSorting:W}=Je({pageSize:Y,count:c==null?void 0:c.total}),h=y.section??m.STANDARD_COLLECTIONS,M=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS,[J,xe]=n.useState(y.search??""),H=n.useRef(null);n.useEffect(()=>{u===void 0&&t&&V(t)},[t,u]),n.useEffect(()=>{t&&(h===m.ITEMS?v(t,{page:p,limit:Y}):O(t,{page:p,limit:Y,q:y.search??void 0,type:h===m.STANDARD_COLLECTIONS?oe.STANDARD:oe.THIRD_PARTY,sort:k}))},[t,p,h,y.search,k,v,O]);const pe=n.useCallback(()=>{f("CreateThirdPartyCollectionModal")},[f]),$=n.useCallback(()=>{f(j?"CreateCollectionSelectorModal":"CreateCollectionModal")},[f,j]),K=n.useCallback((C,T)=>{xe(T.value),H.current&&(clearTimeout(H.current),H.current=null),H.current=setTimeout(()=>{P("search",T.value)},500)},[P]),X=n.useCallback(()=>{_.push(E.itemEditor())},[_]),ee=n.useCallback((C,{value:T})=>{W(T)},[W]),z=n.useCallback(C=>{h!==C&&P("section",C)},[t,h,P]),te=n.useCallback(()=>e.jsx(a.Card.Group,{children:M?d.map((C,T)=>e.jsx(ut,{collection:C},T)):g?e.jsx(a.Loader,{size:"large",active:!0}):o.map((C,T)=>e.jsx(at,{item:C},T))}),[o,d,g,M,h]),ae=n.useCallback(()=>M?e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("collections_page.collection")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.type")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.items")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")}),e.jsx(a.Table.HeaderCell,{})]})}),e.jsx(a.Table.Body,{children:d.map(C=>e.jsx(St,{collection:C},C.id))})]})}):e.jsx(a.Section,{children:e.jsxs(a.Table,{basic:"very",children:[e.jsx(a.Table.Header,{children:e.jsxs(a.Table.Row,{children:[e.jsx(a.Table.HeaderCell,{children:s("global.item")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.created_at")}),e.jsx(a.Table.HeaderCell,{children:s("collections_page.last_modified")})]})}),e.jsx(a.Table.Body,{children:o.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[o,d,M]),le=n.useCallback((C,T)=>{p!==T.activePage&&Q(Number(T.activePage))},[p,Q]),se=n.useCallback(()=>e.jsxs("div",{className:"collections-main-actions",children:[h!==m.ITEMS&&e.jsx(a.Field,{placeholder:s("itemdrawer.search_items"),className:"collections-search-field",input:{icon:"search"},onChange:K,icon:e.jsx(a.Icon,{name:"search",className:"searchIcon"}),iconPosition:"left",value:J,isClearable:!0}),e.jsxs(a.Row,{className:"actions",grow:!1,children:[S&&!j&&e.jsx(a.Button,{className:"action-button",size:"small",basic:!0,onClick:pe,children:s("collections_page.new_third_party_collection")}),e.jsxs(a.Button,{className:"action-button open-editor",size:"small",basic:!0,onClick:X,children:[e.jsx(Re,{name:"cube"}),s("item_editor.open")]}),e.jsxs(a.Button,{className:"action-button",size:"small",primary:!0,onClick:$,children:[e.jsx(a.Icon,{name:"plus square"})," ",s("collections_page.new_collection")]})]})]}),[J,S,j,K,X,$]),ne=n.useCallback(()=>e.jsx(a.Column,{align:"right",children:e.jsxs(a.Row,{className:"actions",children:[h===m.STANDARD_COLLECTIONS||m.THIRD_PARTY_COLLECTIONS&&e.jsx(a.Dropdown,{direction:"left",value:k,options:[{value:N.MOST_RELEVANT,text:s("curation_page.order.most_relevant")},{value:N.CREATED_AT_DESC,text:s("global.order.newest")},{value:N.CREATED_AT_ASC,text:s("global.order.oldest")},{value:N.UPDATED_AT_DESC,text:s("global.order.updated_at_desc")},{value:N.UPDATED_AT_ASC,text:s("global.order.updated_at_asc")},{value:N.NAME_DESC,text:s("global.order.name_desc")},{value:N.NAME_ASC,text:s("global.order.name_asc")}],onChange:ee}),e.jsx(ce,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(ce,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=c==null?void 0:c.total,T=x==null?void 0:x.total,R=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?C:T,q=h===m.STANDARD_COLLECTIONS||h===m.THIRD_PARTY_COLLECTIONS?I:x==null?void 0:x.totalPages;return A?e.jsx(a.Loader,{active:!0,size:"large"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"banner-container",children:e.jsx(qe,{id:Ge})}),e.jsx("div",{className:"filters",children:e.jsxs(a.Container,{children:[(u||S||j)&&e.jsxs("div",{className:"action-tabs-container",children:[e.jsx("img",{src:Ke,className:"collections-icon"}),e.jsxs(a.Tabs,{isFullscreen:!0,children:[e.jsx(a.Tabs.Tab,{active:h===m.STANDARD_COLLECTIONS,onClick:()=>z(m.STANDARD_COLLECTIONS),children:s("collections_page.collections")}),(S||j)&&e.jsx(a.Tabs.Tab,{active:h===m.THIRD_PARTY_COLLECTIONS,onClick:()=>z(m.THIRD_PARTY_COLLECTIONS),children:s("collections_page.third_party_collections")}),u&&e.jsx(a.Tabs.Tab,{active:h===m.ITEMS,onClick:()=>z(m.ITEMS),children:s("collections_page.single_items")})]})]}),se(),e.jsxs(a.Row,{height:30,children:[e.jsx(a.Column,{children:e.jsx(a.Row,{children:!g&&!b&&!!R&&R>0&&e.jsx(a.Header,{sub:!0,children:s("collections_page.results",{count:R})})})}),ne()]})]})}),g||b||R===void 0?e.jsx(a.Loader,{active:!0,size:"large"}):R>0?e.jsxs(e.Fragment,{children:[r===w.GRID?te():r===w.LIST?ae():null,!!q&&q>1&&e.jsx(a.Pagination,{className:"pagination",firstItem:null,lastItem:null,totalPages:q,activePage:p,onPageChange:le})]}):e.jsxs("div",{className:"empty",children:[e.jsx(a.Header,{className:"title",size:"large",children:s("collections_page.no_items")}),e.jsx("div",{className:"empty-description",children:s("collections_page.empty_description")}),e.jsx("div",{className:"create-new-wrapper",children:e.jsx("div",{className:"create-new create-new-collection",onClick:$,children:e.jsx("div",{className:"text",children:s("collections_page.new_collection")})})})]})]})},[p,I,c,x,r,u,g,b,A,j,S,le,$,te,ae,ne,se]);return e.jsx(Ze,{className:"CollectionsPage",activeTab:Ye.COLLECTIONS,children:Te()})}const Nt=l=>{const t=we(l),o=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,c=Ae(l);return{items:d,address:t,collections:o,collectionsPaginationData:c,itemsPaginationData:r,view:We(l),isThirdPartyManager:Oe(l),isLoadingCollections:G(ye(l),Ue),isLoadingItems:G(ie(l),Ve),isLoadingOrphanItem:G(ie(l),ze),isLinkedWearablesPaymentsEnabled:Pe(l),isCampaignEnabled:ke(l),hasUserOrphanItems:Me(l)}},vt=l=>({onSetView:t=>l(He(t)),onOpenModal:(t,o)=>l(he(t,o)),onFetchOrphanItems:(t,o)=>l($e(t,o)),onFetchCollections:(t,o)=>l(Be(t,o)),onFetchOrphanItem:t=>l(Fe(t))}),kt=U(Nt,vt)(ft);export{kt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Z as k,D as d,aB as C,K as f,H as a,G as l,M as i,J as h,a1 as x,cz as A,cA as L,cy as T,L as P,cB as S,N as M,cL as R,cM as w,bw as O,cH as V,cC as D,cG as $,cN as H,cO as U,X as G,cP as K}from"./index-
|
|
1
|
+
import{Z as k,D as d,aB as C,K as f,H as a,G as l,M as i,J as h,a1 as x,cz as A,cA as L,cy as T,L as P,cB as S,N as M,cL as R,cM as w,bw as O,cH as V,cC as D,cG as $,cN as H,cO as U,X as G,cP as K}from"./index-j66rXTci.js";import{L as q}from"./LoggedInDetailPage.container-DDpb0HDW.js";import{N as z}from"./Navigation.container-CuwEnxUg.js";import"./SignInRequired-C_a3RZQm.js";import"./selectors-DlaHedkY.js";const J="_main_7p9v2_1",Q="_fields_7p9v2_9",W="_ensImage_7p9v2_16",X="_field_7p9v2_9",Z="_fieldContainer_7p9v2_29",Y="_fieldTitle_7p9v2_41",ee="_subdomain_7p9v2_50",ae="_actionBtn_7p9v2_64",se="_editableFieldValue_7p9v2_84",le="_avatar_7p9v2_90",ie="_avatarImg_7p9v2_97",ne="_avatarName_7p9v2_104",te="_ensBtn_7p9v2_109",de="_address_7p9v2_116",ce="_returnLink_7p9v2_122",re="_editableField_7p9v2_84",oe="_emptyFieldPlaceholder_7p9v2_138",me="_pin_7p9v2_144",_e="_externalLink_7p9v2_154",pe="_unclaimedBadge_7p9v2_159",ue="_disabled_7p9v2_170",s={main:J,fields:Q,ensImage:W,field:X,fieldContainer:Z,fieldTitle:Y,subdomain:ee,actionBtn:ae,editableFieldValue:se,avatar:le,avatarImg:ie,avatarName:ne,ensBtn:te,address:de,returnLink:ce,editableField:re,emptyFieldPlaceholder:oe,pin:me,externalLink:_e,unclaimedBadge:pe,disabled:ue};function he(t){const{ens:e,isLoading:_,alias:N,avatar:o,name:p,wallet:g,onOpenModal:r,onFetchENS:j}=t,v=k(),F=d.useMemo(()=>e?`${C.get("MARKETPLACE_API")}/ens/generate?ens=${e.name}&width=330&height=330`:"",[e]),c=(e==null?void 0:e.ensOwnerAddress)!==(e==null?void 0:e.nftOwnerAddress);d.useEffect(()=>{p&&g&&j(p)},[p,g,j]);const u=d.useCallback(()=>{r("EnsMapAddressModal",{ens:e})},[r,e]),b=d.useCallback(()=>{r("UseAsAliasModal",{newName:e==null?void 0:e.name})},[r,e==null?void 0:e.name]),m=d.useCallback(()=>{v.push(f.ensSelectLand(e==null?void 0:e.subdomain))},[v,e==null?void 0:e.subdomain]),B=d.useCallback(()=>{r("ReclaimNameModal",{ens:e})},[r]),I=d.useMemo(()=>{let n;return N!==(e==null?void 0:e.name)?n=a.jsxs("div",{className:s.editableField,children:[a.jsx("span",{className:s.emptyFieldPlaceholder,children:l("ens_detail_page.unassign")}),a.jsx(i.Button,{compact:!0,primary:!0,onClick:b,className:s.actionBtn,"aria-label":l("ens_detail_page.set_as_primary"),children:a.jsx(i.Icon,{name:"user plus"})})]}):n=a.jsx("div",{className:s.editableField,children:a.jsxs("span",{className:s.avatar,"data-testid":"alias-avatar",children:[o?a.jsx("img",{className:s.avatarImg,src:o.avatar.snapshots.face256,alt:o.realName}):a.jsx(h,{name:"profile"}),a.jsx("span",{className:s.avatarName,children:e.name}),l("ens_list_page.table.you")]})}),a.jsxs("div",{className:s.field,children:[a.jsxs("span",{className:s.fieldTitle,children:[l("ens_detail_page.alias"),a.jsx(i.InfoTooltip,{on:"click",content:l("ens_detail_page.tooltips.alias")})]}),n]})},[e==null?void 0:e.name,c,o,N,b]),y=d.useMemo(()=>{let n=null;return c?n=a.jsxs("div",{className:x(s.editableField,s.disabled),children:[a.jsx("span",{className:s.emptyFieldPlaceholder,children:l("ens_detail_page.reclaim_for_address")}),a.jsx(i.Button,{compact:!0,secondary:!0,disabled:!0,className:s.actionBtn,"aria-label":l("ens_detail_page.reclaim_for_address"),children:a.jsx(i.Icon,{name:"pencil alternate"})})]}):e!=null&&e.ensAddressRecord?n=a.jsxs("span",{className:s.editableField,children:[a.jsxs("span",{className:s.editableFieldValue,children:[a.jsx("img",{src:A,alt:"Ethereum"}),L(e.ensAddressRecord)]}),a.jsx(i.Button,{compact:!0,secondary:!0,inverted:!0,onClick:u,className:s.actionBtn,"aria-label":l("ens_detail_page.edit_address"),children:a.jsx(i.Icon,{name:"pencil alternate"})})]}):n=a.jsxs("div",{className:s.editableField,children:[a.jsx("span",{className:s.emptyFieldPlaceholder,children:l("ens_detail_page.assign_address")}),a.jsx(i.Button,{compact:!0,secondary:!0,onClick:u,className:s.actionBtn,"aria-label":l("ens_detail_page.assign_address"),children:a.jsx(i.Icon,{name:"pencil alternate"})})]}),a.jsxs("div",{className:x(s.field,{[s.disabled]:c}),children:[a.jsxs("span",{className:s.fieldTitle,children:[l("ens_detail_page.address"),a.jsx(i.InfoTooltip,{on:"click",content:l("ens_detail_page.tooltips.address")})]}),n]})},[e==null?void 0:e.ensAddressRecord,c,u]),E=d.useMemo(()=>{let n=null;return c?n=a.jsxs("div",{className:s.editableField,children:[a.jsx("span",{className:s.emptyFieldPlaceholder,children:l("ens_detail_page.reclaim_for_location")}),a.jsx(i.Button,{compact:!0,disabled:!0,className:s.actionBtn,"aria-label":l("ens_detail_page.reclaim_for_location"),children:a.jsx(i.Icon,{name:"crosshairs"})})]}):e!=null&&e.landId?T(e.landId)?n=a.jsxs("div",{className:s.editableField,"data-testid":"land-field",children:[a.jsxs("span",{className:s.editableFieldValue,children:[a.jsx("div",{className:s.pin,children:a.jsx(h,{name:"pin"})}),e==null?void 0:e.landId]}),a.jsx(i.Button,{compact:!0,onClick:m,className:s.actionBtn,"aria-label":l("ens_list_page.button.assign_to_land"),children:a.jsx(i.Icon,{name:"pencil alternate"})})]}):n=a.jsxs("div",{className:s.editableField,"data-testid":"estate-field",children:[a.jsxs("span",{className:s.editableFieldValue,children:[a.jsx("div",{className:s.pin,children:a.jsx(h,{name:"pin"})}),`Estate (${e.landId})`]}),a.jsx(i.Button,{compact:!0,className:s.actionBtn,onClick:m,"aria-label":l("ens_list_page.button.assign_to_land"),children:a.jsx(i.Icon,{name:"pencil alternate"})})]}):n=a.jsxs("div",{className:s.editableField,children:[a.jsx("span",{className:s.emptyFieldPlaceholder,children:l("ens_detail_page.point_location")}),a.jsx(i.Button,{compact:!0,className:s.actionBtn,onClick:m,"aria-label":l("ens_list_page.button.assign_to_land"),children:a.jsx(i.Icon,{name:"crosshairs"})})]}),a.jsxs("div",{className:x(s.field,{[s.disabled]:c}),children:[a.jsxs("span",{className:s.fieldTitle,children:[l("ens_detail_page.land"),a.jsx(i.InfoTooltip,{on:"click",content:l("ens_detail_page.tooltips.land")})]}),n]})},[e==null?void 0:e.landId,c,m]);return a.jsxs(q,{activeTab:z.NAMES,isPageFullscreen:!0,isLoading:_||!e,children:[a.jsx(P,{to:f.ens(),children:a.jsxs(i.Button,{basic:!0,className:s.returnLink,children:[a.jsx(i.Icon,{name:"chevron left"}),"Return"]})}),a.jsxs("div",{className:s.main,children:[a.jsx("img",{alt:e==null?void 0:e.subdomain,src:F,className:s.ensImage}),a.jsxs("div",{className:s.fields,children:[a.jsxs("div",{className:s.fieldContainer,children:[a.jsxs("div",{children:[a.jsx("span",{className:s.fieldTitle,children:l("ens_detail_page.name")}),a.jsxs("span",{className:s.subdomain,children:[a.jsxs("span",{children:[a.jsx("span",{children:e==null?void 0:e.name}),".dcl.eth"]}),a.jsx(S,{role:"button",text:(e==null?void 0:e.subdomain)||"",showPopup:!0,className:"copy-to-clipboard",children:a.jsx(i.Icon,{"aria-label":"copy name","aria-hidden":"false",name:"clone outline"})}),(e==null?void 0:e.ensOwnerAddress)!==(e==null?void 0:e.nftOwnerAddress)?a.jsx("span",{className:s.unclaimedBadge,children:l("ens_detail_page.unclaimed")}):null]})]}),a.jsx(i.Button,{primary:!0,onClick:B,children:l("ens_detail_page.reclaim_name")})]}),a.jsxs("div",{className:s.fieldContainer,children:[I,y,E]})]})]})]})}const xe=t=>{const e=R(t);return{name:e,ens:e?w(t,`${e}.dcl.eth`):null,isLoading:O(V(t),K),alias:D(t),avatar:$(t),wallet:H(t)}},Ne=t=>({onFetchENS:e=>t(U(e)),onOpenModal:(e,_)=>t(G(e,_))}),Fe=M(xe,Ne)(he);export{Fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _=Object.defineProperty;var E=(n,t,a)=>t in n?_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var j=(n,t,a)=>E(n,typeof t!="symbol"?t+"":t,a);import{D as v,H as e,bm as R,G as r,bz as T,M as s,K as k,bA as y,bB as D,bC as I,bD as f,bE as C,N as O,a_ as F,bF as H,bG as $,bH as h,bI as g,aZ as S,bJ as G,bK as B,bL as V}from"./index-
|
|
1
|
+
var _=Object.defineProperty;var E=(n,t,a)=>t in n?_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var j=(n,t,a)=>E(n,typeof t!="symbol"?t+"":t,a);import{D as v,H as e,bm as R,G as r,bz as T,M as s,K as k,bA as y,bB as D,bC as I,bD as f,bE as C,N as O,a_ as F,bF as H,bG as $,bH as h,bI as g,aZ as S,bJ as G,bK as B,bL as V}from"./index-j66rXTci.js";import{N as W}from"./Navigation.container-CuwEnxUg.js";import{L as z}from"./LoggedInDetailPage.container-DDpb0HDW.js";import{R as K}from"./RentalPeriod-Ch6U4OGQ.js";import"./selectors-DlaHedkY.js";import"./SignInRequired-C_a3RZQm.js";import"./index-CkloEuvz.js";const M=n=>n.ui.land,Z=n=>M(n).view;class A extends v.PureComponent{render(){const{list:t}=this.props;switch(t.length){case 0:return r("global.none");case 1:return t[0];case 2:return e.jsx(R,{id:"list.two",values:{first:t[0],second:t[1]}});default:return e.jsx(R,{id:"list.two",values:{first:t[0],second:r("list.more",{count:t.length-1})}})}}}const q=(n,t)=>f(n,C)?1:f(t,C)?-1:n>t?1:-1;let J=class extends v.PureComponent{render(){const{land:t,deployments:a,rental:l,history:o}=this.props,{x:d,y:p}=T(t);return e.jsxs(s.Table.Row,{className:"TableRow",onClick:()=>o.push(k.landDetail(t.id)),children:[e.jsx(s.Table.Cell,{children:e.jsxs(s.Row,{children:[e.jsx(s.Column,{width:67,grow:!1,shrink:!1,children:e.jsx(y,{landId:t.id,width:45,height:45,isDraggable:!1,size:9})}),e.jsx(s.Column,{className:"name",children:e.jsxs("div",{children:[t.name," ",e.jsx("span",{className:"secondary-text",children:D(d,p)})]})})]})}),e.jsx(s.Table.Cell,{children:e.jsxs("div",{children:[r(`roles.${t.role}`)," ",l?e.jsx(K,{land:t,rental:l}):null]})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:t.operators.sort(q).map(c=>e.jsx(I,{address:c}))})}),e.jsx(s.Table.Cell,{children:e.jsx(A,{list:a.map(c=>c.name)})})]})}};const X=(n,t)=>{const{land:a}=t,o=H(n)[a.id]||[],d=$(n,a);return{deployments:o,rental:d}},Y=O(X)(F(J)),b=20;let Q=class extends v.PureComponent{constructor(){super(...arguments);j(this,"state",{showOwner:!0,showOperator:!0,showLessor:!0,showTenant:!0,page:1,selectedLand:0});j(this,"handleNext",()=>{const{selectedLand:a}=this.state,l=this.getFilteredLands();a===l.length-1?this.setState({selectedLand:0}):this.setState({selectedLand:a+1})});j(this,"handlePrev",()=>{const{selectedLand:a}=this.state;if(a===0){const l=this.getFilteredLands();this.setState({selectedLand:l.length-1})}else this.setState({selectedLand:a-1})})}componentWillReceiveProps(a){a.lands!==this.props.lands&&this.setState({page:1})}renderLand(){const{view:a,onSetView:l}=this.props,{page:o,showOwner:d,showOperator:p,showTenant:c,showLessor:u,selectedLand:N}=this.state,i=this.getFilteredLands(),P=Math.ceil(i.length/b);let w,L;if(i.length>1&&N<i.length){const{x:m,y:x}=T(i[N]);w=m,L=x}else if(i.length===1){const{x:m,y:x}=T(i[0]);w=m,L=x}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(s.Container,{children:e.jsxs(s.Row,{height:30,children:[e.jsx(s.Column,{children:e.jsxs(s.Row,{children:[e.jsx(s.Header,{sub:!0,children:r("land_page.results",{count:i.length.toLocaleString()})}),a===h.ATLAS&&i.length>1?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"arrow prev",onClick:this.handlePrev}),e.jsx("div",{className:"arrow next",onClick:this.handleNext})]}):null]})}),e.jsx(s.Column,{align:"right",children:e.jsxs(s.Row,{children:[e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{value:"owner",checked:d,onClick:()=>this.setState({showOwner:!d}),label:r(`roles.${g.OWNER}`)}),content:r("land_page.owner_explanation")}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"operator-checkbox",value:"operator",checked:p,onClick:()=>this.setState({showOperator:!p}),label:r(`roles.${g.OPERATOR}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.operator_explanation")})}),e.jsx(s.Popup,{trigger:e.jsx(s.Radio,{className:"tenant-checkbox",value:"tentant",checked:c,onClick:()=>this.setState({showTenant:!c}),label:r(`roles.${g.TENANT}`)}),className:"radio-popup",content:e.jsx("div",{children:r("land_page.tenant_explanation")})}),e.jsx(S,{className:"grid",icon:"table",isActive:a===h.GRID,onClick:()=>l(h.GRID)}),e.jsx(S,{className:"atlas",icon:"pin",isActive:a===h.ATLAS,onClick:()=>l(h.ATLAS)})]})})]})})}),a===h.GRID?e.jsxs(s.Container,{children:[e.jsx(s.Section,{className:"table-section",children:i.length>0?e.jsxs(s.Table,{basic:"very",children:[e.jsx(s.Table.Header,{children:e.jsxs(s.Table.Row,{children:[e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.name")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("global.role")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.operated_by")}),e.jsx(s.Table.HeaderCell,{width:"4",children:r("land_page.online_scenes")})]})}),e.jsx(s.Table.Body,{children:i.slice((o-1)*b,o*b).map((m,x)=>e.jsx(Y,{land:m},x))})]}):null}),P>1?e.jsx(s.Section,{className:"pagination-section",children:e.jsx(s.Pagination,{firstItem:null,lastItem:null,activePage:o,onPageChange:(m,x)=>this.setState({page:+x.activePage}),totalPages:P})}):null]}):e.jsx("div",{className:"atlas-wrapper",children:e.jsx(y,{className:"main",x:w,y:L,showOperator:p,showOwner:d,showTenant:c,showLessor:u,hasPopup:!0})})]})}getFilteredLands(){const{lands:a}=this.props,{showOwner:l,showOperator:o,showLessor:d,showTenant:p}=this.state;return a.filter(u=>!!(l&&u.roles.includes(g.OWNER)||o&&u.roles.includes(g.OPERATOR)||p&&u.roles.includes(g.TENANT)||d&&u.roles.includes(g.LESSOR)))}render(){const{isLoading:a,view:l}=this.props;return e.jsx(z,{className:`LandPage ${l}-view`,activeTab:W.LAND,isLoading:a,isPageFullscreen:!0,isFooterFullscreen:l===h.ATLAS,isNavigationFullscreen:l===h.ATLAS,children:this.renderLand()})}};const U=n=>({lands:G(n),view:Z(n),isLoading:B(n)}),ee=n=>({onSetView:t=>n(V(t))}),he=O(U,ee)(Q);export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bO as h,bP as s}from"./index-ZuMScRBF.js";var C={};function N(){return C}function D(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function A(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth();return i*12+o}function X(e,a){return h(2,arguments),s(e).getTime()-s(a).getTime()}var T={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},_="trunc";function I(e){return e?T[e]:T[_]}function R(e){h(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function Y(e){h(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function E(e){h(1,arguments);var a=s(e);return R(a).getTime()===Y(a).getTime()}function j(e,a){h(2,arguments);var t=s(e),n=s(a),i=M(t,n),o=Math.abs(A(t,n)),r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*o);var l=M(t,n)===-i;E(s(e))&&o===1&&M(e,n)===1&&(l=!1),r=i*(o-Number(l))}return r===0?0:r}function q(e,a,t){h(2,arguments);var n=X(e,a)/1e3;return I(void 0)(n)}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},z=function(a,t,n){var i,o=V[a];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function w(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var H={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},J={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},L={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U={date:w({formats:H,defaultWidth:"full"}),time:w({formats:J,defaultWidth:"full"}),dateTime:w({formats:L,defaultWidth:"full"})},Q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$=function(a,t,n,i){return Q[a]};function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):o;i=e.formattingValues[r]||e.formattingValues[o]}else{var l=e.defaultWidth,u=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[u]||e.values[l]}var m=e.argumentCallback?e.argumentCallback(a):a;return i[m]}}var B={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},K={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},G={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},te={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ae=function(a,t){var n=Number(a),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ne={ordinalNumber:ae,era:g({values:B,defaultWidth:"wide"}),quarter:g({values:K,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:g({values:G,defaultWidth:"wide"}),day:g({values:Z,defaultWidth:"wide"}),dayPeriod:g({values:ee,defaultWidth:"wide",formattingValues:te,defaultFormattingWidth:"wide"})};function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=a.match(i);if(!o)return null;var r=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?ie(l,function(f){return f.test(r)}):re(l,function(f){return f.test(r)}),m;m=e.valueCallback?e.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var c=a.slice(r.length);return{value:m,rest:c}}}function re(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function ie(e,a){for(var t=0;t<e.length;t++)if(a(e[t]))return t}function oe(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],o=a.match(e.parsePattern);if(!o)return null;var r=e.valueCallback?e.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var ue=/^(\d+)(th|st|nd|rd)?/i,se=/\d+/i,le={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},de={any:[/^b/i,/^(a|c)/i]},me={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fe={any:[/1/i,/2/i,/3/i,/4/i]},he={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ce={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},be={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Me={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ye={ordinalNumber:oe({matchPattern:ue,parsePattern:se,valueCallback:function(a){return parseInt(a,10)}}),era:b({matchPatterns:le,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),quarter:b({matchPatterns:me,defaultMatchWidth:"wide",parsePatterns:fe,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),day:b({matchPatterns:ve,defaultMatchWidth:"wide",parsePatterns:ge,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:be,defaultMatchWidth:"any",parsePatterns:Me,defaultParseWidth:"any"})},we={code:"en-US",formatDistance:z,formatLong:U,formatRelative:$,localize:ne,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function Pe(e){return W({},e)}var S=1440,pe=2520,P=43200,De=86400;function Se(e,a,t){var n,i;h(2,arguments);var o=N(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:o.locale)!==null&&n!==void 0?n:we;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var u=W(Pe(t),{addSuffix:!!(t!=null&&t.addSuffix),comparison:l}),m,c;l>0?(m=s(a),c=s(e)):(m=s(e),c=s(a));var f=q(c,m),k=(D(c)-D(m))/1e3,d=Math.round((f-k)/60),v;if(d<2)return t!=null&&t.includeSeconds?f<5?r.formatDistance("lessThanXSeconds",5,u):f<10?r.formatDistance("lessThanXSeconds",10,u):f<20?r.formatDistance("lessThanXSeconds",20,u):f<40?r.formatDistance("halfAMinute",0,u):f<60?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",1,u):d===0?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",d,u);if(d<45)return r.formatDistance("xMinutes",d,u);if(d<90)return r.formatDistance("aboutXHours",1,u);if(d<S){var F=Math.round(d/60);return r.formatDistance("aboutXHours",F,u)}else{if(d<pe)return r.formatDistance("xDays",1,u);if(d<P){var O=Math.round(d/S);return r.formatDistance("xDays",O,u)}else if(d<De)return v=Math.round(d/P),r.formatDistance("aboutXMonths",v,u)}if(v=j(c,m),v<12){var x=Math.round(d/P);return r.formatDistance("xMonths",x,u)}else{var p=v%12,y=Math.floor(v/12);return p<3?r.formatDistance("aboutXYears",y,u):p<9?r.formatDistance("overXYears",y,u):r.formatDistance("almostXYears",y+1,u)}}export{g as a,w as b,oe as c,b as d,D as e,Se as f,N as g,we as l};
|
|
1
|
+
import{bO as h,bP as s}from"./index-j66rXTci.js";var C={};function N(){return C}function D(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function A(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),o=t.getMonth()-n.getMonth();return i*12+o}function X(e,a){return h(2,arguments),s(e).getTime()-s(a).getTime()}var T={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(a){return a<0?Math.ceil(a):Math.floor(a)}},_="trunc";function I(e){return e?T[e]:T[_]}function R(e){h(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function Y(e){h(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function E(e){h(1,arguments);var a=s(e);return R(a).getTime()===Y(a).getTime()}function j(e,a){h(2,arguments);var t=s(e),n=s(a),i=M(t,n),o=Math.abs(A(t,n)),r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*o);var l=M(t,n)===-i;E(s(e))&&o===1&&M(e,n)===1&&(l=!1),r=i*(o-Number(l))}return r===0?0:r}function q(e,a,t){h(2,arguments);var n=X(e,a)/1e3;return I(void 0)(n)}var V={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},z=function(a,t,n){var i,o=V[a];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function w(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var H={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},J={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},L={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U={date:w({formats:H,defaultWidth:"full"}),time:w({formats:J,defaultWidth:"full"}),dateTime:w({formats:L,defaultWidth:"full"})},Q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$=function(a,t,n,i){return Q[a]};function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):o;i=e.formattingValues[r]||e.formattingValues[o]}else{var l=e.defaultWidth,u=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[u]||e.values[l]}var m=e.argumentCallback?e.argumentCallback(a):a;return i[m]}}var B={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},K={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},G={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Z={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ee={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},te={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ae=function(a,t){var n=Number(a),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ne={ordinalNumber:ae,era:g({values:B,defaultWidth:"wide"}),quarter:g({values:K,defaultWidth:"wide",argumentCallback:function(a){return a-1}}),month:g({values:G,defaultWidth:"wide"}),day:g({values:Z,defaultWidth:"wide"}),dayPeriod:g({values:ee,defaultWidth:"wide",formattingValues:te,defaultFormattingWidth:"wide"})};function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=a.match(i);if(!o)return null;var r=o[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?ie(l,function(f){return f.test(r)}):re(l,function(f){return f.test(r)}),m;m=e.valueCallback?e.valueCallback(u):u,m=t.valueCallback?t.valueCallback(m):m;var c=a.slice(r.length);return{value:m,rest:c}}}function re(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function ie(e,a){for(var t=0;t<e.length;t++)if(a(e[t]))return t}function oe(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],o=a.match(e.parsePattern);if(!o)return null;var r=e.valueCallback?e.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var ue=/^(\d+)(th|st|nd|rd)?/i,se=/\d+/i,le={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},de={any:[/^b/i,/^(a|c)/i]},me={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fe={any:[/1/i,/2/i,/3/i,/4/i]},he={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ce={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ve={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ge={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},be={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Me={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ye={ordinalNumber:oe({matchPattern:ue,parsePattern:se,valueCallback:function(a){return parseInt(a,10)}}),era:b({matchPatterns:le,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any"}),quarter:b({matchPatterns:me,defaultMatchWidth:"wide",parsePatterns:fe,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),day:b({matchPatterns:ve,defaultMatchWidth:"wide",parsePatterns:ge,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:be,defaultMatchWidth:"any",parsePatterns:Me,defaultParseWidth:"any"})},we={code:"en-US",formatDistance:z,formatLong:U,formatRelative:$,localize:ne,match:ye,options:{weekStartsOn:0,firstWeekContainsDate:1}};function W(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function Pe(e){return W({},e)}var S=1440,pe=2520,P=43200,De=86400;function Se(e,a,t){var n,i;h(2,arguments);var o=N(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:o.locale)!==null&&n!==void 0?n:we;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var u=W(Pe(t),{addSuffix:!!(t!=null&&t.addSuffix),comparison:l}),m,c;l>0?(m=s(a),c=s(e)):(m=s(e),c=s(a));var f=q(c,m),k=(D(c)-D(m))/1e3,d=Math.round((f-k)/60),v;if(d<2)return t!=null&&t.includeSeconds?f<5?r.formatDistance("lessThanXSeconds",5,u):f<10?r.formatDistance("lessThanXSeconds",10,u):f<20?r.formatDistance("lessThanXSeconds",20,u):f<40?r.formatDistance("halfAMinute",0,u):f<60?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",1,u):d===0?r.formatDistance("lessThanXMinutes",1,u):r.formatDistance("xMinutes",d,u);if(d<45)return r.formatDistance("xMinutes",d,u);if(d<90)return r.formatDistance("aboutXHours",1,u);if(d<S){var F=Math.round(d/60);return r.formatDistance("aboutXHours",F,u)}else{if(d<pe)return r.formatDistance("xDays",1,u);if(d<P){var O=Math.round(d/S);return r.formatDistance("xDays",O,u)}else if(d<De)return v=Math.round(d/P),r.formatDistance("aboutXMonths",v,u)}if(v=j(c,m),v<12){var x=Math.round(d/P);return r.formatDistance("xMonths",x,u)}else{var p=v%12,y=Math.floor(v/12);return p<3?r.formatDistance("aboutXYears",y,u):p<9?r.formatDistance("overXYears",y,u):r.formatDistance("almostXYears",y+1,u)}}export{g as a,w as b,oe as c,b as d,D as e,Se as f,N as g,we as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bv as Re,af as X,Z,H as e,cQ as U,G as l,N as J,cR as _e,a1 as ee,cS as H,M as n,cT as $,cU as ke,cV as L,cB as De,D as o,K as N,aB as se,bC as ye,cW as Pe,cX as he,a4 as me,cY as Ae,bw as E,cZ as Oe,cH as V,c_ as q,c$ as pe,d0 as ge,d1 as oe,d2 as ce,d3 as M,d4 as I,J as de,$ as ue,cD as We,d5 as Be,d6 as Ue,cE as Me,d7 as Ie,c0 as He,d8 as $e,a5 as Fe,ae as ze,d9 as Ke,da as Qe,cI as Ye,X as Q,db as Ge,cJ as Ve,cK as qe,c1 as Xe,dc as Ze}from"./index-ZuMScRBF.js";import{L as Je}from"./LoggedInDetailPage.container-BO7Rsigx.js";import{N as es}from"./Navigation.container-CsesGRoh.js";import"./SignInRequired-D6dYEPdh.js";import"./selectors-CVDyed6b.js";var T=(s=>(s.DESC="DESC",s.ASC="ASC",s))(T||{});const xe="tab";var c=(s=>(s.DCL="dcl",s.ENS="ens",s.CONTRIBUTOR="contributor",s))(c||{});const Ce=()=>{const s=Re(),a=new URLSearchParams(s.search),r=a.get(xe),m={urlSearchParams:a,pathname:s.pathname};switch(r){case"dcl":m.tab="dcl";break;case"ens":m.tab="ens";break;case"contributor":m.tab="contributor";break}return m},ss=({isWorldContributorEnabled:s})=>{const{tab:a,pathname:r,urlSearchParams:m}=Ce(),u=Z(),p=d=>{const b=new URLSearchParams(m);b.set(xe,d),u.push(`${r}?${b.toString()}`)};return!a||a===c.CONTRIBUTOR&&!s?(p(c.DCL),null):e.jsxs(U,{children:[e.jsx(U.Tab,{active:a===c.DCL,onClick:()=>p(c.DCL),children:l("worlds_list_page.name_tabs.dcl_names")}),e.jsx(U.Tab,{active:a===c.ENS,onClick:()=>p(c.ENS),children:l("worlds_list_page.name_tabs.ens_names")}),s&&e.jsx(U.Tab,{active:a===c.CONTRIBUTOR,onClick:()=>p(c.CONTRIBUTOR),children:l("worlds_list_page.name_tabs.contributor_names")})]})},ns=X.memo(ss),as=s=>({isWorldContributorEnabled:_e(s)}),ls=J(as)(ns),ts="_container_12bci_1",rs="_used_12bci_7",is="_description_12bci_13",os="_link_12bci_20",cs="_space_12bci_27",ds="_current_12bci_33",us="_bar_12bci_38",w={container:ts,used:rs,description:is,link:os,space:cs,current:ds,bar:us},bs="worlds-storage-current-mbs",_s="worlds-storage-bar-front",hs="worlds-storage",ms=({maxBytes:s,currentBytes:a,className:r,onViewDetails:m})=>{const u=$(s),p=$(a),d=p*100/u;return e.jsxs("div",{"data-testid":hs,className:ee(w.container,r),children:[e.jsx("span",{className:w.used,children:l("worlds_list_page.worlds_storage.used")}),e.jsxs("div",{className:w.description,children:[e.jsx("span",{children:l("worlds_list_page.worlds_storage.description")})," ",e.jsx("span",{className:w.link,onClick:m,children:l("worlds_list_page.worlds_storage.link")})]}),e.jsxs("div",{className:w.space,children:[e.jsxs("div",{"data-testid":bs,children:[e.jsx("span",{className:w.current,children:H(p)})," / ",H(u)," Mb"]}),e.jsx(n.Progress,{"data-testid":_s,percent:Math.trunc(d),className:w.bar,size:"small"})]})]})},ps=X.memo(ms),gs="_worldUrl_1sb6i_1",xs="_rightContainer_1sb6i_7",Cs="_copyUrn_1sb6i_13",Y={worldUrl:gs,rightContainer:xs,copyUrn:Cs};function je({ens:s,deploymentsByWorlds:a}){const r=ke(s.subdomain);return L(a,s)?e.jsxs("div",{className:Y.worldUrl,children:[e.jsx("span",{children:r}),e.jsxs("div",{className:Y.rightContainer,children:[e.jsx(De,{role:"button",text:r,showPopup:!0,children:e.jsx(n.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:ee("copy",Y.copyUrn),name:"copy outline"})}),e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:e.jsx(n.Icon,{name:"external alternate"})})]})]}):e.jsx("span",{className:"empty-url",children:l("worlds_list_page.table.empty_url")})}function we({deploymentsByWorlds:s,ens:a,projects:r,onEditScene:m,onUnpublishScene:u,onPublishScene:p}){const d=s[a.subdomain];return L(s,a)?e.jsxs("div",{className:"publish-scene",children:[e.jsx(n.Popup,{content:d==null?void 0:d.name,on:"hover",trigger:e.jsx("span",{children:d==null?void 0:d.name})}),r.find(b=>b.id===(d==null?void 0:d.projectId))?m&&e.jsx(n.Button,{inverted:!0,size:"small",onClick:()=>m(a),children:l("worlds_list_page.table.edit_scene")}):u&&e.jsx(n.Popup,{content:l("worlds_list_page.table.scene_published_outside_builder"),on:"hover",position:"top center",trigger:e.jsx(n.Button,{inverted:!0,size:"small",onClick:()=>u(a),children:l("worlds_list_page.table.unpublish_scene")})})]}):e.jsxs("div",{className:"publish-scene",children:[e.jsx("span",{children:"-"}),p&&e.jsx(n.Button,{primary:!0,size:"small",onClick:p,children:l("worlds_list_page.table.publish_scene")})]})}function js({items:s,deploymentsByWorlds:a,projects:r,loading:m,error:u,onUnpublishWorld:p}){const d=Z(),b=o.useCallback(()=>{d.push(N.scenes())},[d]),f=o.useCallback(h=>{const{projectId:x}=a[h.subdomain];d.push(N.sceneDetail(x))},[a,N,d]),S=o.useCallback(h=>{var C;const x=(C=a[h.subdomain])==null?void 0:C.id;x&&p(x)},[a,p]);return u?e.jsx(n.Message,{error:!0,size:"tiny",visible:!0,content:u.message,header:l("worlds_list_page.error_title")}):m?e.jsx(n.Loader,{active:!0,size:"big"}):s.length?e.jsxs(n.Table,{basic:"very",children:[e.jsx(n.Table.Header,{children:e.jsxs(n.Table.Row,{children:[e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.name")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.owner")}),e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.url")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.published_scene")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.size")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.permissions")})]})}),e.jsx(n.Table.Body,{children:s.map((h,x)=>{var R,k;const C=(R=h.userPermissions)==null?void 0:R.includes("deployment"),v=(k=h.userPermissions)==null?void 0:k.map(D=>l(`worlds_list_page.table.user_permissions.${D}`)).join("/");return e.jsxs(n.Table.Row,{className:"TableRow",children:[e.jsx(n.Table.Cell,{width:1,children:h.name}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(ye,{address:h.nftOwnerAddress||""})}),e.jsx(n.Table.Cell,{width:2,children:e.jsx(je,{deploymentsByWorlds:a,ens:h})}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(we,{deploymentsByWorlds:a,ens:h,projects:r,onEditScene:C?f:void 0,onPublishScene:C?b:void 0,onUnpublishScene:C?S:void 0})}),e.jsx(n.Table.Cell,{width:1,children:H($(Number(h.size)||0))}),e.jsx(n.Table.Cell,{width:1,children:v})]},x)})})]}):e.jsxs(n.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:"empty-icon dcl-icon"}),e.jsx("div",{className:"empty-title",children:l("worlds_list_page.empty_contributor_list.title")}),e.jsx("div",{className:"empty-description",children:l("worlds_list_page.empty_contributor_list.description",{b:h=>e.jsx("b",{children:h})})}),e.jsx(n.Button,{as:"a",href:`${se.get("MARKETPLACE_WEB_URL")}/names/claim`,target:"_blank",className:"empty-action",primary:!0,children:l("worlds_list_page.empty_list.cta")})]})}const ws=s=>({items:Pe(s),deploymentsByWorlds:he(s),projects:me(s),error:Ae(s),loading:E(V(s),Oe)||E(pe(s),q)}),Es=s=>({onUnpublishWorld:a=>s(ge(a))}),Ns=J(ws,Es)(js),be="Worlds List Page Action",Ss=se.get("ENS_DOMAINS_URL",""),Ts=se.get("MARKETPLACE_WEB_URL"),G=12,Ls=s=>{const{ensList:a,externalNames:r,error:m,deploymentsByWorlds:u,isLoading:p,projects:d,worldsWalletStats:b,isConnected:f,isWorldContributorEnabled:S,ensTotal:h,onOpenYourStorageModal:x,onOpenWorldsForENSOwnersAnnouncementModal:C,onUnpublishWorld:v,onOpenPermissionsModal:R,onFetchContributableNames:k,onFetchENSList:D}=s,[ne,y]=o.useState(T.DESC),[F,z]=o.useState(1),{tab:_}=Ce(),P=Z();o.useEffect(()=>{f&&S&&k()},[f,S]),o.useEffect(()=>{_===c.DCL&&D(G,(F-1)*G)},[D,F]);const A=o.useCallback(()=>{_===c.DCL?(oe(be,{action:"Click Claim NAME"}),window.open(`${Ts}/names/claim`,"_blank","noopener,noreferrer")):(oe(be,{action:"Click Claim ENS Domain"}),window.open(Ss,"_blank","noopener,noreferrer"))},[_]),Ee=o.useCallback(()=>{P.push(N.scenes())},[N,P]),Ne=o.useCallback(i=>{const{projectId:t}=u[i.subdomain];P.push(N.sceneDetail(t))},[u,N,P]),Se=o.useCallback(i=>{var g;const t=(g=u[i.subdomain])==null?void 0:g.id;t&&v(t)},[u,v]),ae=o.useCallback((i,t)=>{z(+t.activePage)},[]),le=o.useCallback(()=>e.jsx(n.Dropdown,{direction:"left",value:ne,options:[{value:T.ASC,text:l("global.order.name_asc")},{value:T.DESC,text:l("global.order.name_desc")}],onChange:(i,{value:t})=>y(t)}),[ne,y]),te=o.useCallback(i=>{let t=L(u,i)?"active":"inactive";if(t==="active"&&b&&!ce(i.subdomain))switch(M(b).status){case I.BLOCKED:{t="blocked";break}case I.TO_BE_BLOCKED:t="warning"}return e.jsx("span",{className:`world-status ${t}`,children:l(`worlds_list_page.table.status_${t}`)})},[M,ce,L]),re=o.useCallback((i,t)=>{var B;const g=_===c.DCL?t==null?void 0:t.dclNames:t==null?void 0:t.ensNames;if(!L(u,i)||!g)return"-";const j=(B=g.find(ve=>ve.name===i.subdomain))==null?void 0:B.size,K=_===c.ENS?" / 25":"";return H($(Number(j)))+K},[_]),Te=o.useCallback((i,t)=>{R(t)},[]),O=o.useCallback(()=>{const i=_===c.DCL?h:r.length,t=Math.ceil(i/G),g=_===c.DCL?a:r;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(n.Container,{children:e.jsxs(n.Row,{children:[e.jsx(n.Column,{children:e.jsx(n.Row,{children:e.jsx(n.Header,{sub:!0,className:"items-count",children:l("ens_list_page.items",{count:s.ensTotal.toLocaleString()})})})}),e.jsx(n.Column,{align:"right",children:e.jsx(n.Row,{children:le()})}),e.jsx(n.Column,{align:"right",grow:!1,shrink:!0,children:e.jsx(n.Row,{children:e.jsx("div",{className:"actions",children:e.jsx(n.Button,{basic:!0,onClick:A,children:e.jsx(de,{name:"add-active"})})})})})]})})}),e.jsx(n.Container,{children:e.jsxs(n.Section,{className:"table-section",children:[e.jsxs(n.Table,{basic:"very",children:[e.jsx(n.Table.Header,{children:e.jsxs(n.Table.Row,{children:[e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.name")}),e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.url")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.published_scene")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center",children:l("worlds_list_page.table.size")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center",children:l("worlds_list_page.table.status")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center"})]})}),e.jsx(n.Table.Body,{children:g.map((j,K)=>e.jsxs(n.Table.Row,{className:"TableRow",children:[e.jsx(n.Table.Cell,{width:2,children:j.name}),e.jsx(n.Table.Cell,{width:2,children:e.jsx(je,{deploymentsByWorlds:u,ens:j})}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(we,{deploymentsByWorlds:u,ens:j,projects:d,onEditScene:Ne,onPublishScene:Ee,onUnpublishScene:Se})}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:re(j,b)}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:te(j)}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:e.jsx(n.Button,{basic:!0,onClick:B=>Te(B,j.subdomain),children:"Permissions"})})]},K))})]}),t>1&&e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:t,activePage:F,onPageChange:ae})]})})]})},[_,a,r,A,le,re,te,ae,h]),W=o.useCallback(()=>e.jsxs(n.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:ee("empty-icon",_===c.DCL?"dcl-icon":"ens-icon")}),e.jsx("div",{className:"empty-title",children:_===c.DCL?l("worlds_list_page.empty_list.title"):l("worlds_list_page.empty_list.title_ens")}),e.jsx("div",{className:"empty-description",children:_===c.DCL?l("worlds_list_page.empty_list.description",{b:i=>e.jsx("b",{children:i})}):l("worlds_list_page.empty_list.description_ens",{b:i=>e.jsx("b",{children:i})})}),e.jsx(n.Button,{className:"empty-action",primary:!0,onClick:A,children:_===c.DCL?l("worlds_list_page.empty_list.cta"):l("worlds_list_page.empty_list.cta_ens")})]}),[_,A]),ie=o.useCallback(()=>{if(!b)return null;const i=M(b);if(i.status===I.OK)return null;let t;return i.status===I.TO_BE_BLOCKED?t=l("worlds_list_page.worlds_warning_message.to_be_blocked",{toBeBlockedAt:i.toBeBlockedAt.toLocaleDateString(),b:g=>e.jsx("b",{children:g})}):t=l("worlds_list_page.worlds_warning_message.blocked",{blockedAt:i.blockedAt.toLocaleDateString(),b:g=>e.jsx("b",{children:g})}),e.jsxs("div",{className:"insufficient-storage-message",children:[e.jsx("div",{children:e.jsx(de,{name:"alert-warning"})}),e.jsx("div",{children:t})]})},[b,M]),Le=o.useCallback(()=>a.length?e.jsxs("div",{children:[b?e.jsx(ps,{maxBytes:Number(b.maxAllowedSpace),currentBytes:Number(b.usedSpace),className:"worlds-storage",onViewDetails:()=>{x({stats:b})}}):null,ie(),O()]}):e.jsx("div",{children:W()}),[a,b,O,W,ie,x]),fe=o.useCallback(()=>e.jsx("div",{children:r.length>0?O():W()}),[r,W,O]);return o.useEffect(()=>{y(T.ASC),z(1)},[_,z,y]),o.useEffect(()=>{ue()&&C()},[ue,C]),e.jsx(Je,{className:"WorldListPage view",error:m,activeTab:es.WORLDS,isLoading:p,isPageFullscreen:!0,children:e.jsxs(n.Container,{children:[e.jsx("h1",{children:l("worlds_list_page.title")}),e.jsx(ls,{}),_===c.DCL&&Le(),_===c.ENS&&fe(),_===c.CONTRIBUTOR&&S&&e.jsx(Ns,{})]})})},fs=X.memo(Ls),vs=s=>{var a;return{ensList:We(s),externalNames:Be(s),deploymentsByWorlds:he(s),projects:me(s),worldsPermissions:Ue(s),error:((a=Me(s))==null?void 0:a.message)??Ie(s)??void 0,isLoading:E(V(s),qe)||E(pe(s),q)||E(He(s),Xe)||E($e(s),q)||E(V(s),Ze)||Fe(s),isLoggedIn:ze(s),worldsWalletStats:Ke(s),isConnected:Qe(s),isWorldContributorEnabled:_e(s),ensTotal:Ye(s)}},Rs=s=>({onOpenYourStorageModal:a=>s(Q("WorldsYourStorageModal",a)),onOpenPermissionsModal:(a,r)=>s(Q("WorldPermissionsModal",{worldName:a,isCollaboratorsTabShown:r})),onOpenWorldsForENSOwnersAnnouncementModal:()=>s(Q("WorldsForENSOwnersAnnouncementModal")),onUnpublishWorld:a=>s(ge(a)),onFetchContributableNames:()=>s(Ge()),onFetchENSList:(a,r)=>s(Ve(a,r))}),Os=J(vs,Rs)(fs);export{Os as default};
|
|
1
|
+
import{bv as Re,af as X,Z,H as e,cQ as U,G as l,N as J,cR as _e,a1 as ee,cS as H,M as n,cT as $,cU as ke,cV as L,cB as De,D as o,K as N,aB as se,bC as ye,cW as Pe,cX as he,a4 as me,cY as Ae,bw as E,cZ as Oe,cH as V,c_ as q,c$ as pe,d0 as ge,d1 as oe,d2 as ce,d3 as M,d4 as I,J as de,$ as ue,cD as We,d5 as Be,d6 as Ue,cE as Me,d7 as Ie,c0 as He,d8 as $e,a5 as Fe,ae as ze,d9 as Ke,da as Qe,cI as Ye,X as Q,db as Ge,cJ as Ve,cK as qe,c1 as Xe,dc as Ze}from"./index-j66rXTci.js";import{L as Je}from"./LoggedInDetailPage.container-DDpb0HDW.js";import{N as es}from"./Navigation.container-CuwEnxUg.js";import"./SignInRequired-C_a3RZQm.js";import"./selectors-DlaHedkY.js";var T=(s=>(s.DESC="DESC",s.ASC="ASC",s))(T||{});const xe="tab";var c=(s=>(s.DCL="dcl",s.ENS="ens",s.CONTRIBUTOR="contributor",s))(c||{});const Ce=()=>{const s=Re(),a=new URLSearchParams(s.search),r=a.get(xe),m={urlSearchParams:a,pathname:s.pathname};switch(r){case"dcl":m.tab="dcl";break;case"ens":m.tab="ens";break;case"contributor":m.tab="contributor";break}return m},ss=({isWorldContributorEnabled:s})=>{const{tab:a,pathname:r,urlSearchParams:m}=Ce(),u=Z(),p=d=>{const b=new URLSearchParams(m);b.set(xe,d),u.push(`${r}?${b.toString()}`)};return!a||a===c.CONTRIBUTOR&&!s?(p(c.DCL),null):e.jsxs(U,{children:[e.jsx(U.Tab,{active:a===c.DCL,onClick:()=>p(c.DCL),children:l("worlds_list_page.name_tabs.dcl_names")}),e.jsx(U.Tab,{active:a===c.ENS,onClick:()=>p(c.ENS),children:l("worlds_list_page.name_tabs.ens_names")}),s&&e.jsx(U.Tab,{active:a===c.CONTRIBUTOR,onClick:()=>p(c.CONTRIBUTOR),children:l("worlds_list_page.name_tabs.contributor_names")})]})},ns=X.memo(ss),as=s=>({isWorldContributorEnabled:_e(s)}),ls=J(as)(ns),ts="_container_12bci_1",rs="_used_12bci_7",is="_description_12bci_13",os="_link_12bci_20",cs="_space_12bci_27",ds="_current_12bci_33",us="_bar_12bci_38",w={container:ts,used:rs,description:is,link:os,space:cs,current:ds,bar:us},bs="worlds-storage-current-mbs",_s="worlds-storage-bar-front",hs="worlds-storage",ms=({maxBytes:s,currentBytes:a,className:r,onViewDetails:m})=>{const u=$(s),p=$(a),d=p*100/u;return e.jsxs("div",{"data-testid":hs,className:ee(w.container,r),children:[e.jsx("span",{className:w.used,children:l("worlds_list_page.worlds_storage.used")}),e.jsxs("div",{className:w.description,children:[e.jsx("span",{children:l("worlds_list_page.worlds_storage.description")})," ",e.jsx("span",{className:w.link,onClick:m,children:l("worlds_list_page.worlds_storage.link")})]}),e.jsxs("div",{className:w.space,children:[e.jsxs("div",{"data-testid":bs,children:[e.jsx("span",{className:w.current,children:H(p)})," / ",H(u)," Mb"]}),e.jsx(n.Progress,{"data-testid":_s,percent:Math.trunc(d),className:w.bar,size:"small"})]})]})},ps=X.memo(ms),gs="_worldUrl_1sb6i_1",xs="_rightContainer_1sb6i_7",Cs="_copyUrn_1sb6i_13",Y={worldUrl:gs,rightContainer:xs,copyUrn:Cs};function je({ens:s,deploymentsByWorlds:a}){const r=ke(s.subdomain);return L(a,s)?e.jsxs("div",{className:Y.worldUrl,children:[e.jsx("span",{children:r}),e.jsxs("div",{className:Y.rightContainer,children:[e.jsx(De,{role:"button",text:r,showPopup:!0,children:e.jsx(n.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:ee("copy",Y.copyUrn),name:"copy outline"})}),e.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:e.jsx(n.Icon,{name:"external alternate"})})]})]}):e.jsx("span",{className:"empty-url",children:l("worlds_list_page.table.empty_url")})}function we({deploymentsByWorlds:s,ens:a,projects:r,onEditScene:m,onUnpublishScene:u,onPublishScene:p}){const d=s[a.subdomain];return L(s,a)?e.jsxs("div",{className:"publish-scene",children:[e.jsx(n.Popup,{content:d==null?void 0:d.name,on:"hover",trigger:e.jsx("span",{children:d==null?void 0:d.name})}),r.find(b=>b.id===(d==null?void 0:d.projectId))?m&&e.jsx(n.Button,{inverted:!0,size:"small",onClick:()=>m(a),children:l("worlds_list_page.table.edit_scene")}):u&&e.jsx(n.Popup,{content:l("worlds_list_page.table.scene_published_outside_builder"),on:"hover",position:"top center",trigger:e.jsx(n.Button,{inverted:!0,size:"small",onClick:()=>u(a),children:l("worlds_list_page.table.unpublish_scene")})})]}):e.jsxs("div",{className:"publish-scene",children:[e.jsx("span",{children:"-"}),p&&e.jsx(n.Button,{primary:!0,size:"small",onClick:p,children:l("worlds_list_page.table.publish_scene")})]})}function js({items:s,deploymentsByWorlds:a,projects:r,loading:m,error:u,onUnpublishWorld:p}){const d=Z(),b=o.useCallback(()=>{d.push(N.scenes())},[d]),f=o.useCallback(h=>{const{projectId:x}=a[h.subdomain];d.push(N.sceneDetail(x))},[a,N,d]),S=o.useCallback(h=>{var C;const x=(C=a[h.subdomain])==null?void 0:C.id;x&&p(x)},[a,p]);return u?e.jsx(n.Message,{error:!0,size:"tiny",visible:!0,content:u.message,header:l("worlds_list_page.error_title")}):m?e.jsx(n.Loader,{active:!0,size:"big"}):s.length?e.jsxs(n.Table,{basic:"very",children:[e.jsx(n.Table.Header,{children:e.jsxs(n.Table.Row,{children:[e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.name")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.owner")}),e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.url")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.published_scene")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.size")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.permissions")})]})}),e.jsx(n.Table.Body,{children:s.map((h,x)=>{var R,k;const C=(R=h.userPermissions)==null?void 0:R.includes("deployment"),v=(k=h.userPermissions)==null?void 0:k.map(D=>l(`worlds_list_page.table.user_permissions.${D}`)).join("/");return e.jsxs(n.Table.Row,{className:"TableRow",children:[e.jsx(n.Table.Cell,{width:1,children:h.name}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(ye,{address:h.nftOwnerAddress||""})}),e.jsx(n.Table.Cell,{width:2,children:e.jsx(je,{deploymentsByWorlds:a,ens:h})}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(we,{deploymentsByWorlds:a,ens:h,projects:r,onEditScene:C?f:void 0,onPublishScene:C?b:void 0,onUnpublishScene:C?S:void 0})}),e.jsx(n.Table.Cell,{width:1,children:H($(Number(h.size)||0))}),e.jsx(n.Table.Cell,{width:1,children:v})]},x)})})]}):e.jsxs(n.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:"empty-icon dcl-icon"}),e.jsx("div",{className:"empty-title",children:l("worlds_list_page.empty_contributor_list.title")}),e.jsx("div",{className:"empty-description",children:l("worlds_list_page.empty_contributor_list.description",{b:h=>e.jsx("b",{children:h})})}),e.jsx(n.Button,{as:"a",href:`${se.get("MARKETPLACE_WEB_URL")}/names/claim`,target:"_blank",className:"empty-action",primary:!0,children:l("worlds_list_page.empty_list.cta")})]})}const ws=s=>({items:Pe(s),deploymentsByWorlds:he(s),projects:me(s),error:Ae(s),loading:E(V(s),Oe)||E(pe(s),q)}),Es=s=>({onUnpublishWorld:a=>s(ge(a))}),Ns=J(ws,Es)(js),be="Worlds List Page Action",Ss=se.get("ENS_DOMAINS_URL",""),Ts=se.get("MARKETPLACE_WEB_URL"),G=12,Ls=s=>{const{ensList:a,externalNames:r,error:m,deploymentsByWorlds:u,isLoading:p,projects:d,worldsWalletStats:b,isConnected:f,isWorldContributorEnabled:S,ensTotal:h,onOpenYourStorageModal:x,onOpenWorldsForENSOwnersAnnouncementModal:C,onUnpublishWorld:v,onOpenPermissionsModal:R,onFetchContributableNames:k,onFetchENSList:D}=s,[ne,y]=o.useState(T.DESC),[F,z]=o.useState(1),{tab:_}=Ce(),P=Z();o.useEffect(()=>{f&&S&&k()},[f,S]),o.useEffect(()=>{_===c.DCL&&D(G,(F-1)*G)},[D,F]);const A=o.useCallback(()=>{_===c.DCL?(oe(be,{action:"Click Claim NAME"}),window.open(`${Ts}/names/claim`,"_blank","noopener,noreferrer")):(oe(be,{action:"Click Claim ENS Domain"}),window.open(Ss,"_blank","noopener,noreferrer"))},[_]),Ee=o.useCallback(()=>{P.push(N.scenes())},[N,P]),Ne=o.useCallback(i=>{const{projectId:t}=u[i.subdomain];P.push(N.sceneDetail(t))},[u,N,P]),Se=o.useCallback(i=>{var g;const t=(g=u[i.subdomain])==null?void 0:g.id;t&&v(t)},[u,v]),ae=o.useCallback((i,t)=>{z(+t.activePage)},[]),le=o.useCallback(()=>e.jsx(n.Dropdown,{direction:"left",value:ne,options:[{value:T.ASC,text:l("global.order.name_asc")},{value:T.DESC,text:l("global.order.name_desc")}],onChange:(i,{value:t})=>y(t)}),[ne,y]),te=o.useCallback(i=>{let t=L(u,i)?"active":"inactive";if(t==="active"&&b&&!ce(i.subdomain))switch(M(b).status){case I.BLOCKED:{t="blocked";break}case I.TO_BE_BLOCKED:t="warning"}return e.jsx("span",{className:`world-status ${t}`,children:l(`worlds_list_page.table.status_${t}`)})},[M,ce,L]),re=o.useCallback((i,t)=>{var B;const g=_===c.DCL?t==null?void 0:t.dclNames:t==null?void 0:t.ensNames;if(!L(u,i)||!g)return"-";const j=(B=g.find(ve=>ve.name===i.subdomain))==null?void 0:B.size,K=_===c.ENS?" / 25":"";return H($(Number(j)))+K},[_]),Te=o.useCallback((i,t)=>{R(t)},[]),O=o.useCallback(()=>{const i=_===c.DCL?h:r.length,t=Math.ceil(i/G),g=_===c.DCL?a:r;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"filters",children:e.jsx(n.Container,{children:e.jsxs(n.Row,{children:[e.jsx(n.Column,{children:e.jsx(n.Row,{children:e.jsx(n.Header,{sub:!0,className:"items-count",children:l("ens_list_page.items",{count:s.ensTotal.toLocaleString()})})})}),e.jsx(n.Column,{align:"right",children:e.jsx(n.Row,{children:le()})}),e.jsx(n.Column,{align:"right",grow:!1,shrink:!0,children:e.jsx(n.Row,{children:e.jsx("div",{className:"actions",children:e.jsx(n.Button,{basic:!0,onClick:A,children:e.jsx(de,{name:"add-active"})})})})})]})})}),e.jsx(n.Container,{children:e.jsxs(n.Section,{className:"table-section",children:[e.jsxs(n.Table,{basic:"very",children:[e.jsx(n.Table.Header,{children:e.jsxs(n.Table.Row,{children:[e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.name")}),e.jsx(n.Table.HeaderCell,{width:"2",children:l("worlds_list_page.table.url")}),e.jsx(n.Table.HeaderCell,{width:"1",children:l("worlds_list_page.table.published_scene")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center",children:l("worlds_list_page.table.size")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center",children:l("worlds_list_page.table.status")}),e.jsx(n.Table.HeaderCell,{width:"1",textAlign:"center"})]})}),e.jsx(n.Table.Body,{children:g.map((j,K)=>e.jsxs(n.Table.Row,{className:"TableRow",children:[e.jsx(n.Table.Cell,{width:2,children:j.name}),e.jsx(n.Table.Cell,{width:2,children:e.jsx(je,{deploymentsByWorlds:u,ens:j})}),e.jsx(n.Table.Cell,{width:1,children:e.jsx(we,{deploymentsByWorlds:u,ens:j,projects:d,onEditScene:Ne,onPublishScene:Ee,onUnpublishScene:Se})}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:re(j,b)}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:te(j)}),e.jsx(n.Table.Cell,{width:1,textAlign:"center",children:e.jsx(n.Button,{basic:!0,onClick:B=>Te(B,j.subdomain),children:"Permissions"})})]},K))})]}),t>1&&e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:t,activePage:F,onPageChange:ae})]})})]})},[_,a,r,A,le,re,te,ae,h]),W=o.useCallback(()=>e.jsxs(n.Empty,{className:"empty-names-container",height:500,children:[e.jsx("div",{className:ee("empty-icon",_===c.DCL?"dcl-icon":"ens-icon")}),e.jsx("div",{className:"empty-title",children:_===c.DCL?l("worlds_list_page.empty_list.title"):l("worlds_list_page.empty_list.title_ens")}),e.jsx("div",{className:"empty-description",children:_===c.DCL?l("worlds_list_page.empty_list.description",{b:i=>e.jsx("b",{children:i})}):l("worlds_list_page.empty_list.description_ens",{b:i=>e.jsx("b",{children:i})})}),e.jsx(n.Button,{className:"empty-action",primary:!0,onClick:A,children:_===c.DCL?l("worlds_list_page.empty_list.cta"):l("worlds_list_page.empty_list.cta_ens")})]}),[_,A]),ie=o.useCallback(()=>{if(!b)return null;const i=M(b);if(i.status===I.OK)return null;let t;return i.status===I.TO_BE_BLOCKED?t=l("worlds_list_page.worlds_warning_message.to_be_blocked",{toBeBlockedAt:i.toBeBlockedAt.toLocaleDateString(),b:g=>e.jsx("b",{children:g})}):t=l("worlds_list_page.worlds_warning_message.blocked",{blockedAt:i.blockedAt.toLocaleDateString(),b:g=>e.jsx("b",{children:g})}),e.jsxs("div",{className:"insufficient-storage-message",children:[e.jsx("div",{children:e.jsx(de,{name:"alert-warning"})}),e.jsx("div",{children:t})]})},[b,M]),Le=o.useCallback(()=>a.length?e.jsxs("div",{children:[b?e.jsx(ps,{maxBytes:Number(b.maxAllowedSpace),currentBytes:Number(b.usedSpace),className:"worlds-storage",onViewDetails:()=>{x({stats:b})}}):null,ie(),O()]}):e.jsx("div",{children:W()}),[a,b,O,W,ie,x]),fe=o.useCallback(()=>e.jsx("div",{children:r.length>0?O():W()}),[r,W,O]);return o.useEffect(()=>{y(T.ASC),z(1)},[_,z,y]),o.useEffect(()=>{ue()&&C()},[ue,C]),e.jsx(Je,{className:"WorldListPage view",error:m,activeTab:es.WORLDS,isLoading:p,isPageFullscreen:!0,children:e.jsxs(n.Container,{children:[e.jsx("h1",{children:l("worlds_list_page.title")}),e.jsx(ls,{}),_===c.DCL&&Le(),_===c.ENS&&fe(),_===c.CONTRIBUTOR&&S&&e.jsx(Ns,{})]})})},fs=X.memo(Ls),vs=s=>{var a;return{ensList:We(s),externalNames:Be(s),deploymentsByWorlds:he(s),projects:me(s),worldsPermissions:Ue(s),error:((a=Me(s))==null?void 0:a.message)??Ie(s)??void 0,isLoading:E(V(s),qe)||E(pe(s),q)||E(He(s),Xe)||E($e(s),q)||E(V(s),Ze)||Fe(s),isLoggedIn:ze(s),worldsWalletStats:Ke(s),isConnected:Qe(s),isWorldContributorEnabled:_e(s),ensTotal:Ye(s)}},Rs=s=>({onOpenYourStorageModal:a=>s(Q("WorldsYourStorageModal",a)),onOpenPermissionsModal:(a,r)=>s(Q("WorldPermissionsModal",{worldName:a,isCollaboratorsTabShown:r})),onOpenWorldsForENSOwnersAnnouncementModal:()=>s(Q("WorldsForENSOwnersAnnouncementModal")),onUnpublishWorld:a=>s(ge(a)),onFetchContributableNames:()=>s(Ge()),onFetchENSList:(a,r)=>s(Ve(a,r))}),Os=J(vs,Rs)(fs);export{Os as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var V=Object.defineProperty;var q=(t,s,a)=>s in t?V(t,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[s]=a;var T=(t,s,a)=>q(t,typeof s!="symbol"?s+"":s,a);import{aB as z,D as r,eb as X,H as e,bA as J,bS as Z,bT as ee,ec as te,ed as se,G as l,ee as ne,a1 as B,K as I,cB as ae,M as n,aA as oe,bB as le,N as P,a_ as ie,bZ as re,X as K,ef as ce,eg as de,bw as S,eh as me,ei as ue,T as ge,ej as pe,b3 as G,ek as he,af as _e,ah as xe,aj as je,I as be,el as Se,b_ as Ee,S as De,O as ye,cH as Ce,c$ as A,c0 as Ne,aW as Te,V as Ie,W as fe,Y as ke,em as Re,cK as Me,en as we,c_ as Le,c1 as ve}from"./index-j66rXTci.js";import{B as Oe}from"./Back-CQPVZ_Yw.js";import{N as Pe}from"./NotFound-Drp5upn-.js";import{S as $e}from"./SDKTag-cXIioIqG.js";import{a as F,S as Be}from"./SceneStats.container-Cz3IRVTv.js";import"./date-DVtTbuy-.js";import"./index-CkloEuvz.js";const U=z.get("EXPLORER_URL",""),Ae=z.get("WORLDS_CONTENT_SERVER","");let Fe=class extends r.PureComponent{constructor(){super(...arguments);T(this,"getHighlightLayer",(a,o)=>(c,u)=>{const{deployment:d,landTiles:g}=this.props,i=le(c,u),h=g[i];return h&&d.parcels.some(_=>_===i)?{color:a[h.land.role],scale:o}:null});T(this,"renderThumbnail",()=>{const{deployment:a,landTiles:o,project:c}=this.props,[u,d]=X(a.base);return(a.base in o?o[a.base].land.id:null)?e.jsx("div",{className:"atlas-wrapper",children:e.jsx(J,{x:u,y:d,isDraggable:!1,zoom:.75,layers:[this.getHighlightLayer(Z,1.4),this.getHighlightLayer(ee,1.2)]})}):e.jsx("div",{className:"thumbnail-wrapper",children:e.jsx("img",{className:"thumbnail",src:c.thumbnail,alt:c.description})})});T(this,"getExplorerUrl",a=>te?`${U}/?realm=${Ae}/world/${a}&NETWORK=sepolia`:`${U}/world/${a}`)}render(){const{project:a,deployment:o,landTiles:c,history:u,onOpenModal:d}=this.props,g=o.base in c?c[o.base].land.id:null,i=o.world?o.world:o.base,h=se(a,o);let _=l("scene_detail_page.published");return h===ne.NEEDS_SYNC&&(_=l("scene_detail_page.unsynced")),e.jsxs("div",{className:B("DeploymentDetail",{clickable:g}),onClick:()=>g&&u.push(I.landDetail(g)),children:[this.renderThumbnail(),e.jsx(F,{label:l("scene_detail_page.status"),children:_}),e.jsx(F,{label:l("scene_detail_page.location"),children:e.jsxs("div",{className:B({"world-url":o.world}),children:[i,o.world?e.jsxs(e.Fragment,{children:[e.jsx(ae,{role:"button",text:this.getExplorerUrl(o.world),showPopup:!0,children:e.jsx(n.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})}),e.jsx("a",{href:this.getExplorerUrl(o.world),target:"_blank",rel:"noopener noreferrer",children:e.jsx(n.Icon,{name:"external alternate"})})]}):null]})}),e.jsx(Be,{deployment:o}),e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsx(n.Dropdown.Menu,{children:e.jsx(n.Dropdown.Item,{text:l("scene_detail_page.actions.unpublish"),onClick:()=>d("DeployModal",{view:oe.CLEAR_DEPLOYMENT,deploymentId:o.id})})})})]})}};const Ue=t=>({landTiles:re(t)}),He=t=>({onOpenModal:(s,a)=>t(K(s,a))}),ze=P(Ue,He)(ie(Fe)),Ke="https://cdn.decentraland.org/@dcl/builder-site/7.10.1-16527307771.commit-bda752c/assets/automatic_migrate-DQYv7lI_.webp",Ge="https://cdn.decentraland.org/@dcl/builder-site/7.10.1-16527307771.commit-bda752c/assets/migrate_smart_items-D2zNoKEa.webp";var m=(t=>(t.INFO="info",t.MIGRATE="migrate",t))(m||{});function H(t){return t&&t.sdk6?Object.values(t.sdk6.components).filter(a=>a.type===ce.Script).length:0}const Qe="_modalContainer_5geih_1",We="_subtitle_5geih_20",Ye="_content_5geih_27",Ve="_actions_5geih_35",qe="_loadingMessage_5geih_53",Xe="_loader_5geih_57",b={modalContainer:Qe,subtitle:We,content:Ye,actions:Ve,loadingMessage:qe,loader:Xe};function Je({project:t,scene:s,isLoading:a,isSavingSDK6Copy:o,isSavingScene:c,onNavigate:u,onClose:d,onMigrateScene:g}){const[i,h]=r.useState(m.INFO),[_,x]=r.useState(!1),j=r.useMemo(()=>H(s)>0,[s]),D=r.useCallback(()=>{h(m.INFO)},[]),y=r.useCallback(()=>{a||d()},[a,d]),f=r.useCallback(()=>{switch(i){case m.INFO:return de;case m.MIGRATE:return t!=null&&t.thumbnail?t.thumbnail:j?Ge:Ke}},[i,j,t]),k=r.useCallback(()=>{switch(i){case m.INFO:h(m.MIGRATE);break;case m.MIGRATE:t&&g(t,_);break}},[i,_,t,g]),R=()=>i===m.MIGRATE&&j?{smartItemsCount:H(s)}:{},M=()=>!a||i!==m.MIGRATE?e.jsx(n.Button,{disabled:a,primary:!0,onClick:k,children:l(`migrate_to_sdk7_modal.${E}.action`)}):o?e.jsxs("span",{className:b.loadingMessage,children:[e.jsx(n.Loader,{size:"tiny",inline:!0,className:b.loader}),l("migrate_to_sdk7_modal.saving_copy")]}):c?e.jsxs("span",{className:b.loadingMessage,children:[e.jsx(n.Loader,{size:"tiny"}),l("migrate_to_sdk7_modal.migrating_scene")]}):null,E=j?`${i}_smart_items`:i,w=!a&&(i!==m.MIGRATE||j);return e.jsxs(n.Modal,{open:!0,className:b.modalContainer,onClose:y,children:[e.jsx(n.ModalNavigation,{title:l(`migrate_to_sdk7_modal.${E}.title`),onBack:i!==m.INFO?D:void 0,onClose:y}),e.jsxs(n.ModalContent,{className:b.content,children:[e.jsx("p",{className:b.subtitle,children:l(`migrate_to_sdk7_modal.${E}.subtitle`,{b:C=>e.jsx("b",{children:C}),br:()=>e.jsx("br",{}),...R()})}),e.jsx("div",{style:{width:"648px",height:"324px",backgroundPosition:"center",backgroundSize:"cover",backgroundImage:`url(${f()}`}}),i===m.MIGRATE&&e.jsx(n.Checkbox,{disabled:a,checked:_,label:l("migrate_to_sdk7_modal.save_a_copy"),onChange:(C,{checked:L})=>{x(!!L)}})]}),e.jsxs(n.ModalActions,{className:b.actions,children:[M(),w&&e.jsx(n.Button,{disabled:a,secondary:!0,onClick:()=>u(I.sceneEditor(t==null?void 0:t.id)),children:l("migrate_to_sdk7_modal.use_legacy_builder")})]})]})}const Ze=(t,s)=>{var a,o;return{isLoading:S(ue(t),me),isSavingScene:!!((a=s.project)!=null&&a.id)&&ge(t).has((o=s.project)==null?void 0:o.id),isSavingSDK6Copy:S(G(t),pe)}},et=t=>({onMigrateScene:(s,a)=>t(he(s,a))}),tt=P(Ze,et)(Je),st=t=>{const{project:s,scene:a,isLoading:o,deployments:c,onOpenModal:u,onDelete:d,onDuplicate:g,onNavigate:i,onLoadProjectScene:h}=t,[_,x]=r.useState(!1),[j,D]=r.useState(!1);r.useEffect(()=>{s&&!a&&h(s)},[s,a,h]);const y=()=>e.jsx(n.Center,{children:e.jsx(n.Loader,{active:!0,size:"large"})}),f=()=>e.jsx(Pe,{}),k=r.useCallback(()=>{u("EditProjectModal")},[u]),R=r.useCallback(()=>{x(!0)},[x]),M=r.useCallback(()=>{g(s)},[s,g]),E=r.useCallback(()=>{d(s),x(!1)},[s,d,x]),w=r.useCallback(()=>{x(!1)},[x]),C=r.useCallback(()=>{a!=null&&a.sdk6?D(!0):i(I.inspector(s==null?void 0:s.id))},[s,a,i]),L=()=>{const{project:p,isLoading:N,isLoadingDeployments:v}=t;return N||v||!p?null:e.jsx(be,{projectId:p.id,className:"deployment-status"})},Q=(p,N)=>{const{isLoadingDeployments:v,onNavigate:W,onOpenModal:Y,scene:O}=t;return e.jsxs(e.Fragment,{children:[e.jsxs(n.Section,{size:"large",children:[e.jsxs(n.Row,{children:[e.jsx(n.Column,{children:e.jsxs(n.Row,{children:[e.jsx(Oe,{absolute:!0,onClick:()=>W(I.scenes())}),e.jsxs(n.Header,{className:"name",children:[p.title,e.jsx(n.Icon,{name:"edit outline",onClick:k})]})]})}),e.jsx(n.Column,{className:"actions",align:"right",children:e.jsxs(n.Row,{children:[e.jsxs(n.Button,{inverted:!0,className:"download-button",onClick:()=>Y("ExportModal",{project:p}),children:[e.jsx(n.Icon,{name:"download"}),l("scene_detail_page.download_scene")]}),e.jsxs(n.Button,{primary:!0,className:"edit-button",disabled:!O,loading:!O,onClick:C,children:[e.jsx(n.Icon,{name:"edit outline"}),l("scene_detail_page.edit_scene")]}),e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:l("scene_detail_page.actions.duplicate"),onClick:M}),e.jsx(n.Dropdown.Item,{text:l("scene_detail_page.actions.delete"),onClick:R})]})})]})})]}),e.jsxs(n.Row,{className:"status-container",children:[L(),e.jsx($e,{scene:O})]})]}),e.jsx(n.Section,{children:e.jsx("div",{className:"header-image",style:{backgroundImage:p.thumbnail?`url(${p.thumbnail})`:""}})}),e.jsxs(n.Section,{className:p.description?"":"no-margin-bottom",children:[e.jsx(n.Header,{sub:!0,children:l("scene_detail_page.published_in")}),v?e.jsx(n.Loader,{active:!0,size:"small"}):N.length===0?e.jsxs(n.Empty,{className:"empty-deployments-container",children:[e.jsx("div",{className:"empty-deployments-thumbnail"}),l("scene_detail_page.no_deployments")]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"deployments",children:N.map($=>e.jsx(ze,{project:p,deployment:$},$.id))}),e.jsx("div",{className:"notice",children:l("analytics.notice")})]})]}),p.description?e.jsxs(n.Section,{className:"description no-margin-bottom",children:[e.jsx(n.Header,{sub:!0,children:l("scene_detail_page.description")}),e.jsx("p",{className:"description-content",children:p.description})]}):null]})};return e.jsxs(e.Fragment,{children:[e.jsx(xe,{}),e.jsxs(n.Page,{className:"SceneDetailPage",isFullscreen:!0,children:[o&&!s?y():null,!o&&!s?f():null,s?e.jsxs(e.Fragment,{children:[Q(s,c),e.jsx(n.Confirm,{size:"tiny",open:_,header:l("project_card.confirm_delete_header",{title:s.title}),content:l("project_card.confirm_delete_content",{title:s.title}),confirmButton:e.jsx(n.Button,{primary:!0,children:l("global.confirm")}),cancelButton:e.jsx(n.Button,{secondary:!0,children:l("global.cancel")}),onCancel:w,onConfirm:E})]}):null,j&&e.jsx(tt,{project:s,scene:a,onNavigate:i,onClose:()=>D(!1)})]}),e.jsx(je,{})]})},nt=_e.memo(st),at=t=>{const s=Se(t),a=Ee(t),o=s&&s in a?a[s]:null,c=De(t),u=s&&s in c?c[s]:[],d=o&&ye(t)[o.sceneId];return{project:o,deployments:u,scene:d,isLoading:S(G(t),Re),isLoadingDeployments:S(Ce(t),Me)||S(A(t),we)||S(A(t),Le)||S(Ne(t),ve)}},ot=t=>({onNavigate:s=>t(Te(s)),onOpenModal:(s,a)=>t(K(s,a)),onDelete:s=>t(Ie(s)),onDuplicate:s=>t(fe(s)),onLoadProjectScene:(s,a)=>t(ke(s,a))}),ht=P(at,ot)(nt);export{ht as default};
|