@dcl/builder-site 7.3.0 → 7.3.1-13437280096.commit-c1eb6c6
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-CmrASlX3.js → Back-B4xhIUim.js} +1 -1
- package/assets/{CollectionProvider.container-DOhRKeRu.js → CollectionProvider.container-D7DPS0oA.js} +1 -1
- package/assets/{CollectionStatus.container-NEqFbtYE.js → CollectionStatus.container-C_ZJC78l.js} +1 -1
- package/assets/{ConfirmDelete-DN98x9nl.js → ConfirmDelete-CipatP-H.js} +1 -1
- package/assets/{FileSaver.min-iJfSJV1w.js → FileSaver.min-Cp5PFmZ0.js} +1 -1
- package/assets/{ItemProvider.container-BRpScX9b.js → ItemProvider.container-DIBENhEu.js} +1 -1
- package/assets/{JumpIn.container-BvDOoqTn.js → JumpIn.container-BzBfj8ta.js} +1 -1
- package/assets/{LandAction-C6Ncoc71.js → LandAction-arnVbbou.js} +1 -1
- package/assets/{LandProviderPage-BmBQ8e2k.js → LandProviderPage-CWmjbSua.js} +1 -1
- package/assets/{LoggedInDetailPage.container-iODRZ5_l.js → LoggedInDetailPage.container-Bk9bBqUg.js} +1 -1
- package/assets/{Navigation-De175sH6.css → Navigation-D9vLTNef.css} +1 -1
- package/assets/{Navigation.container-BZFqWR65.js → Navigation.container-CI9CVojA.js} +1 -1
- package/assets/{NotFound-DAstcQ7G.js → NotFound-j8VjZqQq.js} +1 -1
- package/assets/{OptionsDropdown-wWmxnpgA.js → OptionsDropdown-CRC0BRD_.js} +1 -1
- package/assets/{RentalPeriod-CdjbV9WM.js → RentalPeriod-DFJsDBgx.js} +1 -1
- package/assets/{SDKTag-GVA6nW7P.js → SDKTag-BTPzk_4G.js} +1 -1
- package/assets/{SceneStats.container-CAMK4paj.js → SceneStats.container-BIue1sHH.js} +1 -1
- package/assets/{SignInRequired-B3HAtRFv.js → SignInRequired-B9ddDCc3.js} +1 -1
- package/assets/{ThirdPartyKindBadge-B8owNMMy.js → ThirdPartyKindBadge-DQKOGuki.js} +1 -1
- package/assets/{dataReader-DfKSTeuK.js → dataReader--guV4Zci.js} +1 -1
- package/assets/{date-DHhUNLFy.js → date-COlRhyCR.js} +1 -1
- package/assets/{fortmatic-Bej0PemP.js → fortmatic-BgTB6nKi.js} +1 -1
- package/assets/{index-Cr8Y-7z7.js → index-41CJaQA6.js} +1 -1
- package/assets/index-7WWNkA8M.js +2 -0
- package/assets/{index-CwJczhBw.js → index-A-FiTxVb.js} +1 -1
- package/assets/{index-Cbyzlv4X.js → index-B-l1QS3v.js} +1 -1
- package/assets/{index-D88Kj2Su.js → index-B0viOqC8.js} +1 -1
- package/assets/index-B9lQv8ac.js +1 -0
- package/assets/{index-B4ZW2Z_u.js → index-BEuT3Ke9.js} +1 -1
- package/assets/index-BGzNXtP-.css +1 -0
- package/assets/{index-DHr-nc9d.js → index-BV7j_A5Q.js} +1 -1
- package/assets/index-BY2wd1QA.css +1 -0
- package/assets/{index-DGOXxMEX.js → index-BZZir5JH.js} +1 -1
- package/assets/{index-DlmcFMIc.js → index-BlM0tKBF.js} +1 -1
- package/assets/{index-DkxIf62a.js → index-C-VOFeTr.js} +1 -1
- package/assets/{index-BDePC9hB.js → index-C96R0Mn7.js} +1 -1
- package/assets/{index-CtlR5vLP.js → index-C9mPf6Ri.js} +274 -274
- package/assets/{index-D8jdVU90.js → index-CJxvSgOM.js} +1 -1
- package/assets/{index-DhfxQISc.js → index-CMjdq5sV.js} +1 -1
- package/assets/index-CVQqWPbB.js +1 -0
- package/assets/{index-DTDcruxk.js → index-CVgIk7yM.js} +1 -1
- package/assets/index-CWDfVy_j.css +1 -0
- package/assets/{index-DWa23QKq.js → index-CXFd-dMZ.js} +1 -1
- package/assets/{index-C2F43J8F.js → index-CXHL6Pad.js} +1 -1
- package/assets/{index-DL2T9rVI.js → index-CXpxv-9x.js} +1 -1
- package/assets/{index-CZiCSiQu.js → index-CZsdW4gr.js} +1 -1
- package/assets/index-CpxtiABh.js +1 -0
- package/assets/{index-Dp84zHnv.js → index-CscoW-mh.js} +1 -1
- package/assets/{index-P5tHAbfe.js → index-DBfp7uL6.js} +1 -1
- package/assets/{index-DDVswcxH.css → index-DH4VAIeo.css} +1 -1
- package/assets/{index-OCzT0a-k.js → index-DVk7GT2R.js} +1 -1
- package/assets/{index-BmwjHEx4.js → index-DZDRVPCl.js} +1 -1
- package/assets/{index-B5pd48tO.js → index-DZspd-iQ.js} +1 -1
- package/assets/{index-Cj-lVnrZ.css → index-Dc07q6jf.css} +7 -7
- package/assets/index-DiUPf8va.js +1 -0
- package/assets/{index-B4yi1NlK.js → index-DrMhckTL.js} +1 -1
- package/assets/index-DxpaoXWS.css +1 -0
- package/assets/{index-h5x8oMDN.js → index-LzwDbm4W.js} +1 -1
- package/assets/{index-BuNvkYN8.js → index-PSyBiLf8.js} +2 -2
- package/assets/{index-kNjlVuOw.js → index-SdB3ZS3d.js} +1 -1
- package/assets/{index-CWDRzwFa.js → index-UY99Oa-c.js} +1 -1
- package/assets/{index-BFuH4F1r.css → index-XkfCpQl0.css} +1 -1
- package/assets/{index-CO2Jsdt3.js → index-c04Alall.js} +1 -1
- package/assets/{index-BXWgEra7.js → index-cg1jehBH.js} +1 -1
- package/assets/{index-DyLoqE9D.js → index-f9HAMZT3.js} +1 -1
- package/assets/{index-QeHYGpFS.js → index-kFl4h424.js} +1 -1
- package/assets/{index-Bu91bpAP.js → index-n3DLoLeD.js} +1 -1
- package/assets/{index-8CHEe-ss.js → index-vZjEIb0-.js} +1 -1
- package/assets/{index-DuWRVwpy.js → index-waWx7bcv.js} +1 -1
- package/assets/index-xrV7mjtN.js +1 -0
- package/assets/{index-BhYCONdT.js → index-y5I0wIiE.js} +1 -1
- package/assets/{index.es-oJ7IgpG8.js → index.es-pgNjNssq.js} +4 -4
- package/assets/{selectors-DB1jYqTE.js → selectors-KjglbPet.js} +1 -1
- package/index.html +3 -3
- package/package.json +3 -3
- package/assets/index-B6qX4-6j.js +0 -1
- package/assets/index-BnwFajcc.css +0 -1
- package/assets/index-Bo-YlyS1.css +0 -1
- package/assets/index-CEHfYCKG.js +0 -1
- package/assets/index-Cq21LvcY.js +0 -1
- package/assets/index-CxRhC40I.css +0 -1
- package/assets/index-D3BmLld5.css +0 -1
- package/assets/index-DkQLxn7s.js +0 -2
- package/assets/index-GTriaZJc.js +0 -1
- package/assets/index-d09gJZXe.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{H as e,g1 as Ae,g2 as Ge,a1 as V,dC as Re,M as n,N as B,fc as je,Z,e_ as We,G as i,fL as Ue,eS as ee,g3 as He,cD as Oe,X as D,eu as Fe,g4 as ze,fX as qe,bw as Ie,fZ as Ve,eF as Ne,g5 as Ze,f$ as Ye,D as r,K as M,g6 as Qe,g7 as Ke,eP as T,dD as fe,eq as Xe,g8 as Je,bu as ke,L as ye,fd as be,ep as ve,es as _e,g9 as es,ga as ue,gb as ss,gc as ts,gd as ns,ge as as,gf as is,fg as os,gg as ls,gh as we,ev as rs,gi as cs,gj as ds,gk as ge,J as ms,cB as _s,cC as us,fP as gs,eQ as he,eA as pe,fr as hs,aN as ps,e9 as Cs,gl as xs,gm as js,gn as Is,eD as Ns,go as fs,gp as ks,gq as ys,gr as bs,gs as vs,fT as ws}from"./index-CtlR5vLP.js";import{g as Ss}from"./selector-CtnQnmhq.js";import{L as Ps}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{C as Ds}from"./CollectionProvider.container-DOhRKeRu.js";import{N as Es}from"./NotFound-DAstcQ7G.js";import{B as Ts}from"./Back-CmrASlX3.js";import{C as Ms,T as $s}from"./ThirdPartyKindBadge-B8owNMMy.js";import{C as se}from"./ConfirmDelete-DN98x9nl.js";import"./Navigation.container-BZFqWR65.js";import"./selectors-DB1jYqTE.js";import"./SignInRequired-B3HAtRFv.js";const Ls=s=>e.jsx("img",{"data-testid":Ae,src:Ge[s.network],alt:s.network,className:s.className}),Bs="_image_142g7_1",As="_main_142g7_2",Gs="_network_142g7_13",F={image:Bs,main:As,network:Gs},Rs=s=>{const{collection:t,collectionId:o,className:l,shape:c}=s;return e.jsxs("div",{className:V(F.main,l),children:[t!=null&&t.itemCount?e.jsx(Re,{collectionId:o,className:F.image}):e.jsx(n.Blockie,{className:F.image,seed:o,size:8,scale:8,shape:c??"circle"}),t!=null&&t.linkedContractNetwork?e.jsx(Ls,{network:t==null?void 0:t.linkedContractNetwork,className:F.network}):null]})},Ws=(s,t)=>({collection:je(s,t.collectionId)}),Us=B(Ws)(Rs),Hs="_ellipsis_4huv2_1",Ce={ellipsis:Hs},Os=s=>{const{collection:t}=s,o=Z(),l=()=>{t.isPublished&&t.forumLink&&v(t.forumLink,"_blank")},c=()=>{const{items:m,onOpenModal:d}=s;d("SeeInWorldModal",{itemIds:m.map(k=>k.id)})},a=()=>{const{collection:m,items:d}=s;o.push(Ue(m,d),{fromParam:ee.TP_COLLECTIONS})},x=()=>{const{collection:m,onDelete:d}=s;d(m)},p=()=>{const{collection:m,onOpenModal:d}=s;m.isPublished||d("EditCollectionURNModal",{collection:m})},N=()=>{const{collection:m,onOpenModal:d}=s;d("CreateAndEditMultipleItemsModal",{collectionId:m.id,type:He.EDIT})},v=(m,d="")=>{const k=window.open(m,d);k&&k.focus()},f=!We(t)&&!t.isPublished;return e.jsx(n.Dropdown,{className:Ce.dropdown,trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{className:Ce.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:c}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:a}),e.jsx(n.Popup,{content:i("collection_context_menu.delete_published_collection"),position:"right center",disabled:f,trigger:f?e.jsx(se,{name:t.name,onDelete:x,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})}):e.jsx(n.Dropdown.Item,{text:i("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Popup,{content:i("collection_context_menu.change_published_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_urn"),onClick:p,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_in_bulk"),onClick:N}),e.jsx(n.Popup,{content:i("collection_context_menu.unpublished"),position:"right center",disabled:t.isPublished||!!t.forumLink,trigger:e.jsx(n.Dropdown.Item,{disabled:!t.isPublished||!t.forumLink,text:i("collection_context_menu.forum_post"),onClick:l}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},Fs=Os,zs=s=>({name:Oe(s)||""}),qs=s=>({onOpenModal:(t,o)=>s(D(t,o)),onDelete:t=>s(Fe(t))}),Vs=B(zs,qs)(Fs),Zs=(s,t)=>{const{collection:o,items:l}=t;return{itemCurations:qe(s,o.id),isLoadingItemCurations:Ie(Ve(s),Ye),isLinkedWearablesPaymentsEnabled:Ne(s),itemsStatus:Ze(s,l.map(c=>c.id))}},Ys=s=>({onNewClick:(t,o,l)=>s(D("PublishWizardCollectionModal",{collectionId:t,itemsWithChanges:o,itemsToPublish:l})),onPushChangesClick:(t,o)=>s(D("PushChangesModal",{collectionId:t,itemsWithChanges:o})),onClick:(t,o,l)=>s(D("PublishThirdPartyCollectionModal",{collectionId:t,itemIds:o,action:l}))}),Qs=B(Zs,Ys)(ze),Ks="_itemImage_1y9df_1",Xs="_itemStatus_1y9df_10",Js="_grid_1y9df_14",et="_row_1y9df_25",st="_column_1y9df_30",tt="_statusColumn_1y9df_34",nt="_synced_1y9df_39",at="_unsynced_1y9df_43",it="_avatarColumn_1y9df_47",ot="_nameWrapper_1y9df_52",lt="_name_1y9df_52",rt="_itemActions_1y9df_65",ct="_action_1y9df_72",C={itemImage:Ks,itemStatus:Xs,grid:Js,row:et,column:st,statusColumn:tt,synced:nt,unsynced:at,avatarColumn:it,nameWrapper:ot,name:lt,itemActions:rt,action:ct};function dt({item:s,status:t,selected:o,onSelect:l,onOpenModal:c,onDelete:a}){const x=Z(),p=r.useCallback((h,P)=>{l(s,P.checked)},[s,l]),N=r.useCallback(()=>{c("SeeInWorldModal",{itemIds:[s.id]})},[s,c]),v=r.useCallback(()=>{s.isPublished||c("EditItemURNModal",{item:s})},[s,c]),f=r.useCallback(()=>{x.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,x]),m=r.useCallback(()=>{a(s)},[a,s]),d=r.useMemo(()=>{if(!s.urn)return"";try{const h=Qe(s.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[s]),k=r.useMemo(()=>{switch(t){case T.UNDER_REVIEW:return e.jsx(n.Icon,{name:"clock outline"});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle outline"});case T.UNSYNCED:return e.jsx(n.Icon,{name:"exclamation circle"});default:return null}},[t]),y=s.data;return e.jsx(n.Grid,{className:`CollectionItem ${C.grid}`,columns:"equal",children:e.jsxs(n.Grid.Row,{className:C.row,children:[e.jsxs(n.Grid.Column,{className:`${C.column} ${C.avatarColumn}`,width:5,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished,onClick:p}),e.jsx(fe,{className:C.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:C.nameWrapper,children:e.jsxs("div",{className:C.name,title:s.name,children:[e.jsx(Xe,{className:C.itemStatus,item:s}),s.name]})})]}),e.jsx(n.Grid.Column,{className:C.column,children:y.category?e.jsx("div",{children:i(`wearable.category.${y.category}`)}):null}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:i(`body_shapes.${Je(s)}`)})}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:d})}),e.jsxs(n.Grid.Column,{width:3,className:`${C.column} ${C.statusColumn} ${C[t]}`,children:[k,e.jsx("div",{children:i(`third_party_collection_detail_page.synced_statuses.${t}`)})]}),e.jsx(n.Grid.Column,{width:1,className:C.column,children:e.jsx("div",{className:C.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:C.action,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:N}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:f}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:v,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:m,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})})}const mt=(s,t)=>({status:be(s)[t.item.id]}),_t=s=>({onDelete:t=>s(ve(t)),onOpenModal:(t,o)=>s(D(t,o))}),ut=B(mt,_t)(dt),gt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",pt="_status_rgxu1_1",Ct="_pending_migration_rgxu1_14",xt="_synced_rgxu1_19",jt="_unpublished_rgxu1_24",It="_unsynced_rgxu1_25",Nt="_pending_mapping_rgxu1_30",ft="_under_review_rgxu1_31",kt="_icon_rgxu1_10",z={status:pt,pending_migration:Ct,synced:xt,unpublished:jt,unsynced:It,pending_mapping:Nt,under_review:ft,icon:kt},yt=s=>{const{status:t,item:o}=s,l=!o.mappings&&_e(o.urn),c=!o.isMappingComplete&&_e(o.urn),a=r.useMemo(()=>{if(l)return e.jsx("img",{src:gt,className:z.icon});if(c)return e.jsx(n.Icon,{name:"warning circle"});switch(t){case T.UNDER_REVIEW:return e.jsx("img",{src:ht,className:z.icon});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle"});case T.UNSYNCED:case T.UNPUBLISHED:return e.jsx(n.Icon,{name:"cloud upload"})}},[t,l,c]),x=r.useMemo(()=>l?i("item_status.pending_mapping"):c?i("item_status.pending_migration"):i(`item_status.${t}`),[t,l,c]),p=r.useMemo(()=>l?"pending_mapping":c?"pending_migration":t,[t,l,c]);return e.jsxs("div",{className:V(z[p],z.status),children:[a," ",x]})},bt="_itemImage_1rili_1",vt="_itemStatus_1rili_10",wt="_grid_1rili_14",St="_loading_1rili_21",Pt="_row_1rili_26",Dt="_column_1rili_31",Et="_avatarColumn_1rili_35",Tt="_nameWrapper_1rili_40",Mt="_name_1rili_40",$t="_itemActions_1rili_53",Lt="_action_1rili_60",Bt="_overlay_1rili_65",I={itemImage:bt,itemStatus:vt,grid:wt,loading:St,row:Pt,column:Dt,avatarColumn:Et,nameWrapper:Tt,name:Mt,itemActions:$t,action:Lt,overlay:Bt};function At({item:s,status:t,selected:o,loading:l,collection:c,onSaveItem:a,onSelect:x,onOpenModal:p,onDelete:N}){const v=Z(),f=r.useMemo(()=>es(s),[s]),m=r.useMemo(()=>c.linkedContractAddress&&c.linkedContractNetwork?{address:c.linkedContractAddress,network:c.linkedContractNetwork}:null,[c]),[d,k]=r.useState(f),y=r.useMemo(()=>{if(d&&m){const S=ue(d,m);return ss(S)?void 0:"Invalid mapping"}},[d,m]);r.useEffect(()=>{!m||y||(!f&&d||f&&d&&!ts(f,d))&&h(d,m)},[f,y,d,m]);const h=r.useCallback(ns((S,E)=>{const $=ue(S,E);a({...s,mappings:$})},1e3),[a]),P=r.useCallback((S,E)=>{l||x(s,E.checked)},[s,l,x]),w=r.useCallback(()=>{p("SeeInWorldModal",{itemIds:[s.id]})},[s,p]),H=r.useCallback(()=>{s.isPublished||p("EditItemURNModal",{item:s})},[s,p]),Y=r.useCallback(()=>{v.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,v]),A=r.useCallback(()=>{N(s)},[N,s]);return e.jsxs(n.Grid,{className:V(I.grid,l&&I.loading),columns:"equal",children:[l&&e.jsx("div",{className:I.overlay,children:e.jsx(n.Loader,{size:"large",active:!0})}),e.jsxs(n.Grid.Row,{className:I.row,children:[e.jsxs(n.Grid.Column,{className:`${I.column} ${I.avatarColumn}`,width:4,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished||l,onClick:P}),e.jsx(fe,{className:I.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:I.nameWrapper,children:e.jsx("div",{className:I.name,title:s.name,children:s.name})})]}),e.jsx(n.Grid.Column,{children:m&&e.jsx(as,{disabled:l,mapping:d,error:y,onChange:k,isCompact:!0})}),e.jsx(n.Grid.Column,{width:3,className:V(I.column,I.statusColumn),children:e.jsx(yt,{status:t,item:s})}),e.jsx(n.Grid.Column,{width:1,className:I.column,children:e.jsx("div",{className:I.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:I.action,disabled:l,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:w}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:Y}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:H,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:A,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})]})}const Gt=(s,t)=>{const o=be(s);return{loading:!!is(s)[t.item.id],status:o[t.item.id]}},Rt=s=>({onDelete:t=>s(ve(t)),onSaveItem:t=>s(os(t,{},{onlySaveItem:!0})),onOpenModal:(t,o)=>s(D(t,o))}),Wt=B(Gt,Rt)(At),L=50,Ut="_itemCheckbox_2k9qa_1",Ht="_gridHeader_2k9qa_5",Ot="_itemColumn_2k9qa_15",J={itemCheckbox:Ut,gridHeader:Ht,itemColumn:Ot},Ft=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:J.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:5,className:J.itemColumn,children:[e.jsx(n.Checkbox,{className:J.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsx(n.Grid.Column,{children:i("global.category")}),e.jsx(n.Grid.Column,{children:i("global.body_shape")}),e.jsx(n.Grid.Column,{children:"URN ID"}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),zt="_gridHeader_4acv6_1",qt="_itemColumn_4acv6_11",Vt="_itemCheckbox_4acv6_16",Zt="_linkedToColumn_4acv6_20",q={gridHeader:zt,itemColumn:qt,itemCheckbox:Vt,linkedToColumn:Zt},Yt=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:q.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:4,className:q.itemColumn,children:[e.jsx(n.Checkbox,{className:q.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsxs(n.Grid.Column,{className:q.linkedToColumn,children:[e.jsx("span",{children:i("third_party_collection_detail_page.linked_to")}),e.jsx(ls,{})]}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),Qt="_main_16i8r_3",Kt="_slots_16i8r_11",Xt="_empty_16i8r_28",Jt="_searchContainer_16i8r_32",en="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",tn="_selectionInfo_16i8r_53",nn="_header_16i8r_63",an="_content_16i8r_74",on="_title_16i8r_83",ln="_editCollectionName_16i8r_96",rn="_name_16i8r_101",cn="_nameAndType_16i8r_105",dn="_nameWrapper_16i8r_115",mn="_size_16i8r_139",_n="_actions_16i8r_143",un="_body_16i8r_151",gn="_info_16i8r_162",hn="_infoHeader_16i8r_170",pn="_infoContent_16i8r_178",Cn="_slotsIcon_16i8r_195",xn="_copyButton_16i8r_207",jn="_sparkles_16i8r_232",In="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",kn="_linkedWearableBadge_16i8r_283",yn="_typeBadge_16i8r_288",bn="_programmaticBadge_16i8r_292",vn="_standardBadge_16i8r_296",wn="_loader_16i8r_302",_={main:Qt,slots:Kt,empty:Xt,searchContainer:Jt,searchInfo:en,syncedStatusList:sn,selectionInfo:tn,header:nn,content:an,title:on,editCollectionName:ln,name:rn,nameAndType:cn,nameWrapper:dn,size:mn,actions:_n,body:un,info:gn,infoHeader:hn,infoContent:pn,slotsIcon:Cn,copyButton:xn,sparkles:jn,start:In,migrationBanner:Nn,type:fn,linkedWearableBadge:kn,typeBadge:yn,programmaticBadge:bn,standardBadge:vn,loader:wn},xe=({children:s,title:t,info:o})=>e.jsxs("div",{className:_.info,children:[e.jsxs("div",{className:_.infoHeader,children:[t," ",o&&e.jsx(n.InfoTooltip,{content:o})]}),e.jsx("div",{className:_.infoContent,children:s})]});function Sn({currentPage:s,lastLocation:t,wallet:o,thirdParty:l,items:c,collection:a,totalItems:x,isLoading:p,isThirdPartyV2Enabled:N,isLinkedWearablesPaymentsEnabled:v,onFetchAvailableSlots:f,onFetchThirdParty:m,onNewItem:d,onEditName:k,isLoadingAvailableSlots:y}){const[h,P]=r.useState({}),[w,H]=r.useState(s),[Y,A]=r.useState(!1),[S,E]=r.useState(!1),[$,te]=r.useState("ALL"),G=Z(),ne=t===M.collections();r.useEffect(()=>{l&&l.availableSlots===void 0&&!y&&f(l.id)},[l,y,f]),r.useEffect(()=>{!p&&!l&&(a!=null&&a.urn)&&m(we(a.urn))},[a==null?void 0:a.urn,p,l]),r.useEffect(()=>{if(s!==w&&H(s),S){const u=c.reduce((g,j)=>(g[j.id]=!0,g),{});P(u),A(!1)}},[w,S,c,l,s]);const Se=r.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),Pe=r.useCallback(()=>{a&&k(a)},[a,k]),De=r.useCallback(()=>{ne?G.goBack():G.push(M.collections(rs.THIRD_PARTY))},[G,ne]),Ee=r.useCallback((u,g)=>{H(+g.activePage),G.push(M.thirdPartyCollectionDetail(a.id,{page:+g.activePage}))},[a,G]),Q=r.useCallback((u,g)=>{P({...h,[u.id]:g}),E(!1),A(!1)},[h]),R=r.useCallback(u=>u.every(g=>h[g.id]),[h]),ae=r.useCallback((u,g)=>{const j={...h},W=!R(u);for(const U of u)j[U.id]=W;P(j),A(!0),E(S&&!!g.checked)},[h,S,R]),ie=r.useCallback(()=>{P({})},[]),oe=r.useMemo(()=>a&&l&&o&&cs(o.address,l),[a,l,o]),Te=r.useCallback(u=>{if(E(!0),a){const g=Math.ceil(x/L);u(a.id,{page:ds(g),limit:L,overridePaginationData:!1})}},[x]),le=r.useCallback((u,{value:g})=>{te(g)},[te]),Me=[{value:"ALL",text:i("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:i("item_status.synced")},{value:"UNSYNCED",text:i("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:i("item_status.pending_migration")},{value:"MAPPING_PENDING",text:i("item_status.pending_mapping")}]],$e=r.useMemo(()=>{switch($){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:ge.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:ge.MISSING_MAPPING};default:return{}}},[$]),Le=r.useCallback((u,g,j,W,U)=>{const re=g.filter(b=>h[b.id]),ce=re.length,de=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),O=x,K=Math.ceil(O/L),me=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.header,children:[e.jsx(Ts,{absolute:!0,onClick:De}),e.jsxs("div",{className:_.content,children:[e.jsxs("div",{className:_.title,children:[e.jsx(Us,{collectionId:a.id}),e.jsxs("div",{className:_.nameAndType,children:[e.jsxs("div",{className:_.nameWrapper,children:[e.jsx(n.Header,{size:"large",className:_.name,onClick:Pe,children:a.name}),!a.isPublished&&e.jsx(ms,{name:"edit",className:_.editCollectionName})]}),e.jsxs("div",{className:_.type,children:[e.jsx(Ms,{isThirdParty:!0}),e.jsx($s,{isProgrammatic:u.isProgrammatic})]})]})]}),e.jsxs("div",{className:_.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(xe,{title:i("third_party_collection_detail_page.smart_contract_address_short"),info:i("third_party_collection_detail_page.smart_contract_address_long"),children:[_s(a.linkedContractAddress)," ",e.jsx(us,{className:_.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(n.Icon,{name:"copy outline"})})]}),!v&&e.jsxs(xe,{title:i("third_party_collection_detail_page.slots_short"),info:i("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:_.slotsIcon}),y?e.jsx(n.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[u.availableSlots??0," / ",u.maxItems]})]}),e.jsxs(n.Button,{inverted:!0,onClick:Se,children:[e.jsx(n.Icon,{name:"plus"}),i("third_party_collection_detail_page.new_items")]}),u.availableSlots!==void 0?e.jsx(Qs,{collection:a,items:re,slots:u.availableSlots}):null,e.jsx(Vs,{collection:a,items:j})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:_.migrationBanner,children:[e.jsx(n.Icon,{name:"sync"})," ",i("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:_.body,children:W?e.jsx("div",{className:_.loader,children:e.jsx(n.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:_.searchContainer,children:[j.length>0&&e.jsx("div",{className:_.searchInfo,children:i("third_party_collection_detail_page.search_info",{page:(w-1)*L+1,pageTotal:Math.min(O,w*L),total:O})}),e.jsx(n.Dropdown,{className:_.syncedStatusList,direction:"left",value:$,options:Me,onChange:le})]}),j.length?e.jsxs(e.Fragment,{children:[ce>0?e.jsxs("div",{className:_.selectionInfo,children:[i("third_party_collection_detail_page.selection",{count:ce})," ",e.jsx("span",{className:"link",onClick:ie,children:i("third_party_collection_detail_page.clear_selection")}),". ",Y&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(U),children:i("third_party_collection_detail_page.select_all",{total:O})}):null," "]}):null,e.jsxs("div",{children:[N&&de?e.jsx(Yt,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}):e.jsx(Ft,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}),j.map(b=>N&&de?e.jsx(Wt,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id):e.jsx(ut,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id)),K>1?e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:w,onPageChange:Ee}):null]})]}):e.jsxs("div",{className:_.empty,children:[e.jsx("div",{className:me?_.start:_.sparkles}),me?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:i("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:i("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,v,N,x,w,Q,R,le,ie,$]),Be=oe&&a;return e.jsx(Ds,{id:a==null?void 0:a.id,itemsPage:w,itemsPageSize:L,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:u,isLoadingCollectionItems:g,items:j,paginatedItems:W,onFetchCollectionItemsPages:U})=>e.jsx(Ps,{className:_.main,hasNavigation:!oe&&!p&&!u,isLoading:p||u,children:Be&&l?Le(l,j,W,g,U):e.jsx(Es,{})})})}const Pn=s=>{var N;const t=gs(s)||"",o=je(s,t),l=o?he(o):!1,c=((N=pe(s,t))==null?void 0:N.total)||null,a=o?hs(s,o.id):[],x=o&&pe(s,o.id)||null,p=Number(ps(s).query.page??1);return{items:a,totalItems:c,currentPage:p,paginatedData:x,wallet:Cs(s),collection:o,isThirdPartyV2Enabled:xs(s),isLinkedWearablesPaymentsEnabled:Ne(s),thirdParty:o&&he(o)?js(s,o):null,authorizations:Is(s),isLoading:Ie(Ns(s),ws)||fs(s)||!!(l&&o&&ks(s,we(o.urn))),isLoadingAvailableSlots:ys(s),lastLocation:Ss(s)}},Dn=s=>({onNewItem:t=>s(D("CreateItemsModal",{collectionId:t})),onEditName:t=>s(D("EditCollectionNameModal",{collection:t})),onFetchAvailableSlots:t=>s(bs(t)),onFetchThirdParty:t=>s(vs(t))}),Hn=B(Pn,Dn)(Sn);export{Hn as default};
|
|
1
|
+
import{H as e,g1 as Ae,g2 as Ge,a1 as V,dC as Re,M as n,N as B,fc as je,Z,e_ as We,G as i,fL as Ue,eS as ee,g3 as He,cD as Oe,X as D,eu as Fe,g4 as ze,fX as qe,bw as Ie,fZ as Ve,eF as Ne,g5 as Ze,f$ as Ye,D as r,K as M,g6 as Qe,g7 as Ke,eP as T,dD as fe,eq as Xe,g8 as Je,bu as ke,L as ye,fd as be,ep as ve,es as _e,g9 as es,ga as ue,gb as ss,gc as ts,gd as ns,ge as as,gf as is,fg as os,gg as ls,gh as we,ev as rs,gi as cs,gj as ds,gk as ge,J as ms,cB as _s,cC as us,fP as gs,eQ as he,eA as pe,fr as hs,aN as ps,e9 as Cs,gl as xs,gm as js,gn as Is,eD as Ns,go as fs,gp as ks,gq as ys,gr as bs,gs as vs,fT as ws}from"./index-C9mPf6Ri.js";import{g as Ss}from"./selector-CtnQnmhq.js";import{L as Ps}from"./LoggedInDetailPage.container-Bk9bBqUg.js";import{C as Ds}from"./CollectionProvider.container-D7DPS0oA.js";import{N as Es}from"./NotFound-j8VjZqQq.js";import{B as Ts}from"./Back-B4xhIUim.js";import{C as Ms,T as $s}from"./ThirdPartyKindBadge-DQKOGuki.js";import{C as se}from"./ConfirmDelete-CipatP-H.js";import"./Navigation.container-CI9CVojA.js";import"./selectors-KjglbPet.js";import"./SignInRequired-B9ddDCc3.js";const Ls=s=>e.jsx("img",{"data-testid":Ae,src:Ge[s.network],alt:s.network,className:s.className}),Bs="_image_142g7_1",As="_main_142g7_2",Gs="_network_142g7_13",F={image:Bs,main:As,network:Gs},Rs=s=>{const{collection:t,collectionId:o,className:l,shape:c}=s;return e.jsxs("div",{className:V(F.main,l),children:[t!=null&&t.itemCount?e.jsx(Re,{collectionId:o,className:F.image}):e.jsx(n.Blockie,{className:F.image,seed:o,size:8,scale:8,shape:c??"circle"}),t!=null&&t.linkedContractNetwork?e.jsx(Ls,{network:t==null?void 0:t.linkedContractNetwork,className:F.network}):null]})},Ws=(s,t)=>({collection:je(s,t.collectionId)}),Us=B(Ws)(Rs),Hs="_ellipsis_4huv2_1",Ce={ellipsis:Hs},Os=s=>{const{collection:t}=s,o=Z(),l=()=>{t.isPublished&&t.forumLink&&v(t.forumLink,"_blank")},c=()=>{const{items:m,onOpenModal:d}=s;d("SeeInWorldModal",{itemIds:m.map(k=>k.id)})},a=()=>{const{collection:m,items:d}=s;o.push(Ue(m,d),{fromParam:ee.TP_COLLECTIONS})},x=()=>{const{collection:m,onDelete:d}=s;d(m)},p=()=>{const{collection:m,onOpenModal:d}=s;m.isPublished||d("EditCollectionURNModal",{collection:m})},N=()=>{const{collection:m,onOpenModal:d}=s;d("CreateAndEditMultipleItemsModal",{collectionId:m.id,type:He.EDIT})},v=(m,d="")=>{const k=window.open(m,d);k&&k.focus()},f=!We(t)&&!t.isPublished;return e.jsx(n.Dropdown,{className:Ce.dropdown,trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{className:Ce.ellipsis,size:"large",name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:c}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:a}),e.jsx(n.Popup,{content:i("collection_context_menu.delete_published_collection"),position:"right center",disabled:f,trigger:f?e.jsx(se,{name:t.name,onDelete:x,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})}):e.jsx(n.Dropdown.Item,{text:i("global.delete"),disabled:!0}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Popup,{content:i("collection_context_menu.change_published_urn"),position:"right center",disabled:!t.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_urn"),onClick:p,disabled:t.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.edit_in_bulk"),onClick:N}),e.jsx(n.Popup,{content:i("collection_context_menu.unpublished"),position:"right center",disabled:t.isPublished||!!t.forumLink,trigger:e.jsx(n.Dropdown.Item,{disabled:!t.isPublished||!t.forumLink,text:i("collection_context_menu.forum_post"),onClick:l}),hideOnScroll:!0,on:"hover",inverted:!0})]})})},Fs=Os,zs=s=>({name:Oe(s)||""}),qs=s=>({onOpenModal:(t,o)=>s(D(t,o)),onDelete:t=>s(Fe(t))}),Vs=B(zs,qs)(Fs),Zs=(s,t)=>{const{collection:o,items:l}=t;return{itemCurations:qe(s,o.id),isLoadingItemCurations:Ie(Ve(s),Ye),isLinkedWearablesPaymentsEnabled:Ne(s),itemsStatus:Ze(s,l.map(c=>c.id))}},Ys=s=>({onNewClick:(t,o,l)=>s(D("PublishWizardCollectionModal",{collectionId:t,itemsWithChanges:o,itemsToPublish:l})),onPushChangesClick:(t,o)=>s(D("PushChangesModal",{collectionId:t,itemsWithChanges:o})),onClick:(t,o,l)=>s(D("PublishThirdPartyCollectionModal",{collectionId:t,itemIds:o,action:l}))}),Qs=B(Zs,Ys)(ze),Ks="_itemImage_1y9df_1",Xs="_itemStatus_1y9df_10",Js="_grid_1y9df_14",et="_row_1y9df_25",st="_column_1y9df_30",tt="_statusColumn_1y9df_34",nt="_synced_1y9df_39",at="_unsynced_1y9df_43",it="_avatarColumn_1y9df_47",ot="_nameWrapper_1y9df_52",lt="_name_1y9df_52",rt="_itemActions_1y9df_65",ct="_action_1y9df_72",C={itemImage:Ks,itemStatus:Xs,grid:Js,row:et,column:st,statusColumn:tt,synced:nt,unsynced:at,avatarColumn:it,nameWrapper:ot,name:lt,itemActions:rt,action:ct};function dt({item:s,status:t,selected:o,onSelect:l,onOpenModal:c,onDelete:a}){const x=Z(),p=r.useCallback((h,P)=>{l(s,P.checked)},[s,l]),N=r.useCallback(()=>{c("SeeInWorldModal",{itemIds:[s.id]})},[s,c]),v=r.useCallback(()=>{s.isPublished||c("EditItemURNModal",{item:s})},[s,c]),f=r.useCallback(()=>{x.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,x]),m=r.useCallback(()=>{a(s)},[a,s]),d=r.useMemo(()=>{if(!s.urn)return"";try{const h=Qe(s.urn);return Ke(h)?h.thirdPartyTokenId??"":""}catch{return""}},[s]),k=r.useMemo(()=>{switch(t){case T.UNDER_REVIEW:return e.jsx(n.Icon,{name:"clock outline"});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle outline"});case T.UNSYNCED:return e.jsx(n.Icon,{name:"exclamation circle"});default:return null}},[t]),y=s.data;return e.jsx(n.Grid,{className:`CollectionItem ${C.grid}`,columns:"equal",children:e.jsxs(n.Grid.Row,{className:C.row,children:[e.jsxs(n.Grid.Column,{className:`${C.column} ${C.avatarColumn}`,width:5,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished,onClick:p}),e.jsx(fe,{className:C.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:C.nameWrapper,children:e.jsxs("div",{className:C.name,title:s.name,children:[e.jsx(Xe,{className:C.itemStatus,item:s}),s.name]})})]}),e.jsx(n.Grid.Column,{className:C.column,children:y.category?e.jsx("div",{children:i(`wearable.category.${y.category}`)}):null}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:i(`body_shapes.${Je(s)}`)})}),e.jsx(n.Grid.Column,{className:C.column,children:e.jsx("div",{children:d})}),e.jsxs(n.Grid.Column,{width:3,className:`${C.column} ${C.statusColumn} ${C[t]}`,children:[k,e.jsx("div",{children:i(`third_party_collection_detail_page.synced_statuses.${t}`)})]}),e.jsx(n.Grid.Column,{width:1,className:C.column,children:e.jsx("div",{className:C.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:C.action,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:N}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:f}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:v,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:m,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})})}const mt=(s,t)=>({status:be(s)[t.item.id]}),_t=s=>({onDelete:t=>s(ve(t)),onOpenModal:(t,o)=>s(D(t,o))}),ut=B(mt,_t)(dt),gt="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_8524_427)'%3e%3cpath%20d='M20.5%203L20.34%203.03L15%205.1L9%203L3.36%204.9C3.15%204.97%203%205.15%203%205.38V20.5C3%2020.78%203.22%2021%203.5%2021L3.66%2020.97L9%2018.9L15%2021L20.64%2019.1C20.85%2019.03%2021%2018.85%2021%2018.62V3.5C21%203.22%2020.78%203%2020.5%203ZM15%2019L9%2016.89V5L15%207.11V19Z'%20fill='%23A09BA8'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_8524_427'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",ht="data:image/svg+xml,%3csvg%20width='12'%20height='12'%20viewBox='0%200%2012%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.669%200H1.33362C0.593463%200%200%200.600131%200%201.33362V10.669C0%2011.4025%200.593463%2012.0026%201.33362%2012.0026H10.669C11.4025%2012.0026%2012.0026%2011.4025%2012.0026%2010.669V1.33362C12.0026%200.600131%2011.4092%200%2010.669%200ZM10.669%2010.669H1.33362V2.66725H10.669V10.669ZM7.00152%206.66812C7.00152%207.22157%206.55476%207.66834%206.00131%207.66834C5.44785%207.66834%205.00109%207.22157%205.00109%206.66812C5.00109%206.11466%205.44785%205.6679%206.00131%205.6679C6.55476%205.6679%207.00152%206.11466%207.00152%206.66812ZM6.00131%204.00087C4.18091%204.00087%202.62724%205.10778%202.00044%206.66812C2.62724%208.22846%204.18091%209.33537%206.00131%209.33537C7.8217%209.33537%209.37537%208.22846%2010.0022%206.66812C9.37537%205.10778%207.8217%204.00087%206.00131%204.00087ZM6.00131%208.33515C5.08111%208.33515%204.33428%207.58832%204.33428%206.66812C4.33428%205.74792%205.08111%205.00109%206.00131%205.00109C6.92151%205.00109%207.66834%205.74792%207.66834%206.66812C7.66834%207.58832%206.92151%208.33515%206.00131%208.33515Z'%20fill='%23ECEBED'/%3e%3c/svg%3e",pt="_status_rgxu1_1",Ct="_pending_migration_rgxu1_14",xt="_synced_rgxu1_19",jt="_unpublished_rgxu1_24",It="_unsynced_rgxu1_25",Nt="_pending_mapping_rgxu1_30",ft="_under_review_rgxu1_31",kt="_icon_rgxu1_10",z={status:pt,pending_migration:Ct,synced:xt,unpublished:jt,unsynced:It,pending_mapping:Nt,under_review:ft,icon:kt},yt=s=>{const{status:t,item:o}=s,l=!o.mappings&&_e(o.urn),c=!o.isMappingComplete&&_e(o.urn),a=r.useMemo(()=>{if(l)return e.jsx("img",{src:gt,className:z.icon});if(c)return e.jsx(n.Icon,{name:"warning circle"});switch(t){case T.UNDER_REVIEW:return e.jsx("img",{src:ht,className:z.icon});case T.SYNCED:return e.jsx(n.Icon,{name:"check circle"});case T.UNSYNCED:case T.UNPUBLISHED:return e.jsx(n.Icon,{name:"cloud upload"})}},[t,l,c]),x=r.useMemo(()=>l?i("item_status.pending_mapping"):c?i("item_status.pending_migration"):i(`item_status.${t}`),[t,l,c]),p=r.useMemo(()=>l?"pending_mapping":c?"pending_migration":t,[t,l,c]);return e.jsxs("div",{className:V(z[p],z.status),children:[a," ",x]})},bt="_itemImage_1rili_1",vt="_itemStatus_1rili_10",wt="_grid_1rili_14",St="_loading_1rili_21",Pt="_row_1rili_26",Dt="_column_1rili_31",Et="_avatarColumn_1rili_35",Tt="_nameWrapper_1rili_40",Mt="_name_1rili_40",$t="_itemActions_1rili_53",Lt="_action_1rili_60",Bt="_overlay_1rili_65",I={itemImage:bt,itemStatus:vt,grid:wt,loading:St,row:Pt,column:Dt,avatarColumn:Et,nameWrapper:Tt,name:Mt,itemActions:$t,action:Lt,overlay:Bt};function At({item:s,status:t,selected:o,loading:l,collection:c,onSaveItem:a,onSelect:x,onOpenModal:p,onDelete:N}){const v=Z(),f=r.useMemo(()=>es(s),[s]),m=r.useMemo(()=>c.linkedContractAddress&&c.linkedContractNetwork?{address:c.linkedContractAddress,network:c.linkedContractNetwork}:null,[c]),[d,k]=r.useState(f),y=r.useMemo(()=>{if(d&&m){const S=ue(d,m);return ss(S)?void 0:"Invalid mapping"}},[d,m]);r.useEffect(()=>{!m||y||(!f&&d||f&&d&&!ts(f,d))&&h(d,m)},[f,y,d,m]);const h=r.useCallback(ns((S,E)=>{const $=ue(S,E);a({...s,mappings:$})},1e3),[a]),P=r.useCallback((S,E)=>{l||x(s,E.checked)},[s,l,x]),w=r.useCallback(()=>{p("SeeInWorldModal",{itemIds:[s.id]})},[s,p]),H=r.useCallback(()=>{s.isPublished||p("EditItemURNModal",{item:s})},[s,p]),Y=r.useCallback(()=>{v.push(M.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:ee.TP_COLLECTIONS})},[s,v]),A=r.useCallback(()=>{N(s)},[N,s]);return e.jsxs(n.Grid,{className:V(I.grid,l&&I.loading),columns:"equal",children:[l&&e.jsx("div",{className:I.overlay,children:e.jsx(n.Loader,{size:"large",active:!0})}),e.jsxs(n.Grid.Row,{className:I.row,children:[e.jsxs(n.Grid.Column,{className:`${I.column} ${I.avatarColumn}`,width:4,children:[e.jsx(n.Checkbox,{checked:o,disabled:s.isPublished||l,onClick:P}),e.jsx(fe,{className:I.itemImage,item:s,hasBadge:!0,badgeSize:"small"}),e.jsx("div",{className:I.nameWrapper,children:e.jsx("div",{className:I.name,title:s.name,children:s.name})})]}),e.jsx(n.Grid.Column,{children:m&&e.jsx(as,{disabled:l,mapping:d,error:y,onChange:k,isCompact:!0})}),e.jsx(n.Grid.Column,{width:3,className:V(I.column,I.statusColumn),children:e.jsx(yt,{status:t,item:s})}),e.jsx(n.Grid.Column,{width:1,className:I.column,children:e.jsx("div",{className:I.itemActions,children:e.jsx(n.Dropdown,{trigger:e.jsx(n.Button,{basic:!0,children:e.jsx(n.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",className:I.action,disabled:l,onClick:ke(),children:e.jsxs(n.Dropdown.Menu,{children:[e.jsx(n.Dropdown.Item,{text:i("collection_item.see_details"),as:ye,to:M.itemDetail(s.id)}),e.jsx(n.Dropdown.Item,{text:i("collection_context_menu.see_in_decentraland"),onClick:w}),e.jsx(n.Dropdown.Item,{text:i("global.open_in_editor"),onClick:Y}),e.jsx(n.Popup,{content:i("collection_item.cannot_edit_urn"),position:"right center",disabled:!s.isPublished,trigger:e.jsx(n.Dropdown.Item,{text:i("collection_item.edit_urn"),onClick:H,disabled:s.isPublished}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}),!s.isPublished&&e.jsx(se,{name:s.name,onDelete:A,trigger:e.jsx(n.Dropdown.Item,{text:i("global.delete")})})]})})})})]})]})}const Gt=(s,t)=>{const o=be(s);return{loading:!!is(s)[t.item.id],status:o[t.item.id]}},Rt=s=>({onDelete:t=>s(ve(t)),onSaveItem:t=>s(os(t,{},{onlySaveItem:!0})),onOpenModal:(t,o)=>s(D(t,o))}),Wt=B(Gt,Rt)(At),L=50,Ut="_itemCheckbox_2k9qa_1",Ht="_gridHeader_2k9qa_5",Ot="_itemColumn_2k9qa_15",J={itemCheckbox:Ut,gridHeader:Ht,itemColumn:Ot},Ft=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:J.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:5,className:J.itemColumn,children:[e.jsx(n.Checkbox,{className:J.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsx(n.Grid.Column,{children:i("global.category")}),e.jsx(n.Grid.Column,{children:i("global.body_shape")}),e.jsx(n.Grid.Column,{children:"URN ID"}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),zt="_gridHeader_4acv6_1",qt="_itemColumn_4acv6_11",Vt="_itemCheckbox_4acv6_16",Zt="_linkedToColumn_4acv6_20",q={gridHeader:zt,itemColumn:qt,itemCheckbox:Vt,linkedToColumn:Zt},Yt=({areAllSelected:s,onSelectedAllClick:t})=>e.jsx(n.Grid,{columns:"equal",className:q.gridHeader,children:e.jsxs(n.Grid.Row,{children:[e.jsxs(n.Grid.Column,{width:4,className:q.itemColumn,children:[e.jsx(n.Checkbox,{className:q.itemCheckbox,checked:s,onClick:t})," ",i("global.item")]}),e.jsxs(n.Grid.Column,{className:q.linkedToColumn,children:[e.jsx("span",{children:i("third_party_collection_detail_page.linked_to")}),e.jsx(ls,{})]}),e.jsxs(n.Grid.Column,{width:3,children:[" ",i("collection_row.status")," "]}),e.jsx(n.Grid.Column,{width:1})]})}),Qt="_main_16i8r_3",Kt="_slots_16i8r_11",Xt="_empty_16i8r_28",Jt="_searchContainer_16i8r_32",en="_searchInfo_16i8r_42",sn="_syncedStatusList_16i8r_46",tn="_selectionInfo_16i8r_53",nn="_header_16i8r_63",an="_content_16i8r_74",on="_title_16i8r_83",ln="_editCollectionName_16i8r_96",rn="_name_16i8r_101",cn="_nameAndType_16i8r_105",dn="_nameWrapper_16i8r_115",mn="_size_16i8r_139",_n="_actions_16i8r_143",un="_body_16i8r_151",gn="_info_16i8r_162",hn="_infoHeader_16i8r_170",pn="_infoContent_16i8r_178",Cn="_slotsIcon_16i8r_195",xn="_copyButton_16i8r_207",jn="_sparkles_16i8r_232",In="_start_16i8r_241",Nn="_migrationBanner_16i8r_254",fn="_type_16i8r_277",kn="_linkedWearableBadge_16i8r_283",yn="_typeBadge_16i8r_288",bn="_programmaticBadge_16i8r_292",vn="_standardBadge_16i8r_296",wn="_loader_16i8r_302",_={main:Qt,slots:Kt,empty:Xt,searchContainer:Jt,searchInfo:en,syncedStatusList:sn,selectionInfo:tn,header:nn,content:an,title:on,editCollectionName:ln,name:rn,nameAndType:cn,nameWrapper:dn,size:mn,actions:_n,body:un,info:gn,infoHeader:hn,infoContent:pn,slotsIcon:Cn,copyButton:xn,sparkles:jn,start:In,migrationBanner:Nn,type:fn,linkedWearableBadge:kn,typeBadge:yn,programmaticBadge:bn,standardBadge:vn,loader:wn},xe=({children:s,title:t,info:o})=>e.jsxs("div",{className:_.info,children:[e.jsxs("div",{className:_.infoHeader,children:[t," ",o&&e.jsx(n.InfoTooltip,{content:o})]}),e.jsx("div",{className:_.infoContent,children:s})]});function Sn({currentPage:s,lastLocation:t,wallet:o,thirdParty:l,items:c,collection:a,totalItems:x,isLoading:p,isThirdPartyV2Enabled:N,isLinkedWearablesPaymentsEnabled:v,onFetchAvailableSlots:f,onFetchThirdParty:m,onNewItem:d,onEditName:k,isLoadingAvailableSlots:y}){const[h,P]=r.useState({}),[w,H]=r.useState(s),[Y,A]=r.useState(!1),[S,E]=r.useState(!1),[$,te]=r.useState("ALL"),G=Z(),ne=t===M.collections();r.useEffect(()=>{l&&l.availableSlots===void 0&&!y&&f(l.id)},[l,y,f]),r.useEffect(()=>{!p&&!l&&(a!=null&&a.urn)&&m(we(a.urn))},[a==null?void 0:a.urn,p,l]),r.useEffect(()=>{if(s!==w&&H(s),S){const u=c.reduce((g,j)=>(g[j.id]=!0,g),{});P(u),A(!1)}},[w,S,c,l,s]);const Se=r.useCallback(()=>{a!=null&&a.id&&d(a.id)},[a==null?void 0:a.id,d]),Pe=r.useCallback(()=>{a&&k(a)},[a,k]),De=r.useCallback(()=>{ne?G.goBack():G.push(M.collections(rs.THIRD_PARTY))},[G,ne]),Ee=r.useCallback((u,g)=>{H(+g.activePage),G.push(M.thirdPartyCollectionDetail(a.id,{page:+g.activePage}))},[a,G]),Q=r.useCallback((u,g)=>{P({...h,[u.id]:g}),E(!1),A(!1)},[h]),R=r.useCallback(u=>u.every(g=>h[g.id]),[h]),ae=r.useCallback((u,g)=>{const j={...h},W=!R(u);for(const U of u)j[U.id]=W;P(j),A(!0),E(S&&!!g.checked)},[h,S,R]),ie=r.useCallback(()=>{P({})},[]),oe=r.useMemo(()=>a&&l&&o&&cs(o.address,l),[a,l,o]),Te=r.useCallback(u=>{if(E(!0),a){const g=Math.ceil(x/L);u(a.id,{page:ds(g),limit:L,overridePaginationData:!1})}},[x]),le=r.useCallback((u,{value:g})=>{te(g)},[te]),Me=[{value:"ALL",text:i("third_party_collection_detail_page.synced_filter.all")},{value:"SYNCED",text:i("item_status.synced")},{value:"UNSYNCED",text:i("item_status.unsynced")},...a!=null&&a.isMappingComplete?[]:[{value:"MIGRATION_REQUIRED",text:i("item_status.pending_migration")},{value:"MAPPING_PENDING",text:i("item_status.pending_mapping")}]],$e=r.useMemo(()=>{switch($){case"SYNCED":return{synced:!0};case"UNSYNCED":return{synced:!1};case"MIGRATION_REQUIRED":return{mappingStatus:ge.UNPUBLISHED_MAPPING};case"MAPPING_PENDING":return{mappingStatus:ge.MISSING_MAPPING};default:return{}}},[$]),Le=r.useCallback((u,g,j,W,U)=>{const re=g.filter(b=>h[b.id]),ce=re.length,de=!!(a!=null&&a.linkedContractAddress&&(a!=null&&a.linkedContractNetwork)),O=x,K=Math.ceil(O/L),me=(a==null?void 0:a.itemCount)===0;return a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:_.header,children:[e.jsx(Ts,{absolute:!0,onClick:De}),e.jsxs("div",{className:_.content,children:[e.jsxs("div",{className:_.title,children:[e.jsx(Us,{collectionId:a.id}),e.jsxs("div",{className:_.nameAndType,children:[e.jsxs("div",{className:_.nameWrapper,children:[e.jsx(n.Header,{size:"large",className:_.name,onClick:Pe,children:a.name}),!a.isPublished&&e.jsx(ms,{name:"edit",className:_.editCollectionName})]}),e.jsxs("div",{className:_.type,children:[e.jsx(Ms,{isThirdParty:!0}),e.jsx($s,{isProgrammatic:u.isProgrammatic})]})]})]}),e.jsxs("div",{className:_.actions,children:[a.linkedContractAddress&&a.linkedContractNetwork&&e.jsxs(xe,{title:i("third_party_collection_detail_page.smart_contract_address_short"),info:i("third_party_collection_detail_page.smart_contract_address_long"),children:[_s(a.linkedContractAddress)," ",e.jsx(us,{className:_.copyButton,showPopup:!0,text:a.linkedContractAddress,role:"button",children:e.jsx(n.Icon,{name:"copy outline"})})]}),!v&&e.jsxs(xe,{title:i("third_party_collection_detail_page.slots_short"),info:i("third_party_collection_detail_page.slots_long"),children:[e.jsx("div",{className:_.slotsIcon}),y?e.jsx(n.Loader,{active:!0,inline:!0,size:"tiny"}):e.jsxs("span",{children:[u.availableSlots??0," / ",u.maxItems]})]}),e.jsxs(n.Button,{inverted:!0,onClick:Se,children:[e.jsx(n.Icon,{name:"plus"}),i("third_party_collection_detail_page.new_items")]}),u.availableSlots!==void 0?e.jsx(Qs,{collection:a,items:re,slots:u.availableSlots}):null,e.jsx(Vs,{collection:a,items:j})]})]})]}),!a.isMappingComplete&&e.jsxs("div",{className:_.migrationBanner,children:[e.jsx(n.Icon,{name:"sync"})," ",i("third_party_collection_detail_page.migration_banner")]}),e.jsx("div",{className:_.body,children:W?e.jsx("div",{className:_.loader,children:e.jsx(n.Loader,{size:"massive",inline:!0,active:!0})}):e.jsxs(e.Fragment,{children:[(a.itemCount??0)>0&&e.jsxs("div",{className:_.searchContainer,children:[j.length>0&&e.jsx("div",{className:_.searchInfo,children:i("third_party_collection_detail_page.search_info",{page:(w-1)*L+1,pageTotal:Math.min(O,w*L),total:O})}),e.jsx(n.Dropdown,{className:_.syncedStatusList,direction:"left",value:$,options:Me,onChange:le})]}),j.length?e.jsxs(e.Fragment,{children:[ce>0?e.jsxs("div",{className:_.selectionInfo,children:[i("third_party_collection_detail_page.selection",{count:ce})," ",e.jsx("span",{className:"link",onClick:ie,children:i("third_party_collection_detail_page.clear_selection")}),". ",Y&&K>1?e.jsx("span",{className:"link",onClick:()=>Te(U),children:i("third_party_collection_detail_page.select_all",{total:O})}):null," "]}):null,e.jsxs("div",{children:[N&&de?e.jsx(Yt,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}):e.jsx(Ft,{areAllSelected:R(j),onSelectedAllClick:(b,X)=>ae(j,X)}),j.map(b=>N&&de?e.jsx(Wt,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id):e.jsx(ut,{collection:a,item:b,selected:!!h[b.id],onSelect:Q},b.id)),K>1?e.jsx(n.Pagination,{firstItem:null,lastItem:null,totalPages:K,activePage:w,onPageChange:Ee}):null]})]}):e.jsxs("div",{className:_.empty,children:[e.jsx("div",{className:me?_.start:_.sparkles}),me?e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.start_adding_items")}),e.jsx("p",{children:i("third_party_collection_detail_page.cant_remove")})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{children:i("third_party_collection_detail_page.not_found")}),e.jsx("p",{children:i("third_party_collection_detail_page.try_again")})]})]})]})})]}):(console.error("No collection defined"),null)},[a,h,y,v,N,x,w,Q,R,le,ie,$]),Be=oe&&a;return e.jsx(Ds,{id:a==null?void 0:a.id,itemsPage:w,itemsPageSize:L,fetchCollectionItemsOptions:$e,children:({isLoadingCollection:u,isLoadingCollectionItems:g,items:j,paginatedItems:W,onFetchCollectionItemsPages:U})=>e.jsx(Ps,{className:_.main,hasNavigation:!oe&&!p&&!u,isLoading:p||u,children:Be&&l?Le(l,j,W,g,U):e.jsx(Es,{})})})}const Pn=s=>{var N;const t=gs(s)||"",o=je(s,t),l=o?he(o):!1,c=((N=pe(s,t))==null?void 0:N.total)||null,a=o?hs(s,o.id):[],x=o&&pe(s,o.id)||null,p=Number(ps(s).query.page??1);return{items:a,totalItems:c,currentPage:p,paginatedData:x,wallet:Cs(s),collection:o,isThirdPartyV2Enabled:xs(s),isLinkedWearablesPaymentsEnabled:Ne(s),thirdParty:o&&he(o)?js(s,o):null,authorizations:Is(s),isLoading:Ie(Ns(s),ws)||fs(s)||!!(l&&o&&ks(s,we(o.urn))),isLoadingAvailableSlots:ys(s),lastLocation:Ss(s)}},Dn=s=>({onNewItem:t=>s(D("CreateItemsModal",{collectionId:t})),onEditName:t=>s(D("EditCollectionNameModal",{collection:t})),onFetchAvailableSlots:t=>s(bs(t)),onFetchThirdParty:t=>s(vs(t))}),Hn=B(Pn,Dn)(Sn);export{Hn as default};
|
|
@@ -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{bP as x,bQ as _,cb as j,hD as ge,gt as T,gF as fe,Z as me,D as A,hE as K,K as ve,H as o,G as c,M as l,dC as pe,eQ as J,bD as V,N as re,aH as we,et as Ce,X as Te,ev as xe,af as be,ew as O,bm as _e,hF as ye,ey as Ee,eB as De,e9 as Oe,bt as Se,hG as Pe,a6 as je,bw as q,hH as Me,eD as Ne,gu as Le,eG as Ue,eK as ke,hI as Re,eM as Ye,hJ as Ae}from"./index-CtlR5vLP.js";import{d as Ie,e as We,c as Fe}from"./selectors-DB1jYqTE.js";import{N as Be}from"./NotFound-DAstcQ7G.js";import{L as He}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{N as $e}from"./Navigation.container-BZFqWR65.js";import{C as qe}from"./CollectionStatus.container-NEqFbtYE.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-B8owNMMy.js";import{s as I,a as Ve}from"./date-DHhUNLFy.js";import{g as X,e as Xe,l as Ke}from"./index-Dp84zHnv.js";import"./SignInRequired-B3HAtRFv.js";function Je(n,t){x(2,arguments);var e=_(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=_(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=_(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=_(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=_(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=_(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=_(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 b=new Date(0);b.setUTCFullYear(w+1,0,m),b.setUTCHours(0,0,0,0);var M=I(b,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 b=I(m,t);return b}var st=6048e5;function lt(n,t){x(1,arguments);var e=_(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,b,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=(b=void 0)!==null&&b!==void 0?b: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=_(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 bt(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 bt(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const _t=(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(_t(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 be.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(_e,{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{bP as x,bQ as _,cb as j,hD as ge,gt as T,gF as fe,Z as me,D as A,hE as K,K as ve,H as o,G as c,M as l,dC as pe,eQ as J,bD as V,N as re,aH as we,et as Ce,X as Te,ev as xe,af as be,ew as O,bm as _e,hF as ye,ey as Ee,eB as De,e9 as Oe,bt as Se,hG as Pe,a6 as je,bw as q,hH as Me,eD as Ne,gu as Le,eG as Ue,eK as ke,hI as Re,eM as Ye,hJ as Ae}from"./index-C9mPf6Ri.js";import{d as Ie,e as We,c as Fe}from"./selectors-KjglbPet.js";import{N as Be}from"./NotFound-j8VjZqQq.js";import{L as He}from"./LoggedInDetailPage.container-Bk9bBqUg.js";import{N as $e}from"./Navigation.container-CI9CVojA.js";import{C as qe}from"./CollectionStatus.container-C_ZJC78l.js";import{C as Ge,T as Qe}from"./ThirdPartyKindBadge-DQKOGuki.js";import{s as I,a as Ve}from"./date-COlRhyCR.js";import{g as X,e as Xe,l as Ke}from"./index-CscoW-mh.js";import"./SignInRequired-B9ddDCc3.js";function Je(n,t){x(2,arguments);var e=_(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=_(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=_(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=_(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=_(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=_(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=_(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 b=new Date(0);b.setUTCFullYear(w+1,0,m),b.setUTCHours(0,0,0,0);var M=I(b,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 b=I(m,t);return b}var st=6048e5;function lt(n,t){x(1,arguments);var e=_(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,b,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=(b=void 0)!==null&&b!==void 0?b: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=_(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 bt(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 bt(n){var t=n.match(wt);return t?t[1].replace(Ct,"'"):n}const _t=(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(_t(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 be.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(_e,{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
|
-
var A=Object.defineProperty;var D=(n,a,e)=>a in n?A(n,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[a]=e;var h=(n,a,e)=>D(n,typeof a!="symbol"?a+"":a,e);import{D as w,K as y,dg as O,dh as P,di as U,de as q,dj as C,H as s,M as r,G as t,cf as v,b8 as T,bm as H,L as I,N as Q,a_ as G,df as M,dk as V,cF as z,bw as E,cI as p,dl as K,dm as $,dn as J,dp as X,dq as Y,dr as Z,ds as ss,dt as L,du as k,cQ as es,cL as ns}from"./index-
|
|
1
|
+
var A=Object.defineProperty;var D=(n,a,e)=>a in n?A(n,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[a]=e;var h=(n,a,e)=>D(n,typeof a!="symbol"?a+"":a,e);import{D as w,K as y,dg as O,dh as P,di as U,de as q,dj as C,H as s,M as r,G as t,cf as v,b8 as T,bm as H,L as I,N as Q,a_ as G,df as M,dk as V,cF as z,bw as E,cI as p,dl as K,dm as $,dn as J,dp as X,dq as Y,dr as Z,ds as ss,dt as L,du as k,cQ as es,cL as ns}from"./index-C9mPf6Ri.js";import{L as as}from"./LandProviderPage-CWmjbSua.js";import{L as ts}from"./LandAction-arnVbbou.js";import"./NotFound-j8VjZqQq.js";import"./Back-B4xhIUim.js";class os extends w.PureComponent{constructor(){super(...arguments);h(this,"handleFinish",()=>{const{onNavigate:e}=this.props;e(y.ens())});h(this,"handleSetResolver",()=>{const{onSetENSResolver:e,ens:o}=this.props;e(o)});h(this,"handleReclaim",()=>{const{onReclaimName:e,ens:o}=this.props;e(o)});h(this,"handleSetContent",()=>{const{onSetENSContent:e,ens:o,land:d}=this.props;e(o,d)});h(this,"handleBack",()=>{this.props.onBack()})}render(){const{ens:e,land:o,isLoading:d,isWaitingTxSetContent:i,isWaitingTxSetResolver:l,isWaitingTxReclaim:R,error:x}=this.props,_=e.ensOwnerAddress!==e.nftOwnerAddress,c=!O(e)&&e.resolver.toLowerCase()===P.toLowerCase(),g=!U(e)&&q(e,o),m=c||g,S=x&&x.code===4001,N=S&&x.origin===C.RESOLVER,b=S&&x.origin===C.CONTENT,B=S,W=c&&!l&&!N?"grey-button":"",f=g&&!i&&!b?"grey-button":"",u=N||m||_||l||R,j=b||N||B||!c||_||g||l||i||R;return s.jsxs(r.Form,{className:"LandAssignENSForm",children:[s.jsx(r.Row,{children:s.jsx("p",{className:"message",children:t("land_assign_ens_page.set_name_message",{strong:F=>s.jsx("strong",{children:F})})})}),s.jsx(r.Row,{children:s.jsxs("div",{className:u?"box box-disabled":"box",children:[s.jsx("h3",{children:t("land_assign_ens_page.set_resolver")}),s.jsxs("div",{className:"message-box",children:[s.jsx("p",{children:t("land_assign_ens_page.set_resolver_explanation")}),s.jsx(v,{type:"submit",disabled:u,onClick:this.handleSetResolver,className:W,loading:l,primary:!0,network:T.Network.ETHEREUM,children:N?t("global.retry_tx"):c?s.jsxs(s.Fragment,{children:[t("global.approved_tx"),l?null:s.jsx(r.Icon,{name:"check"})]}):t("global.submit")})]})]})}),s.jsx(r.Row,{children:s.jsxs("div",{className:j?"box box-disabled":"box",children:[s.jsx("h3",{children:t("land_assign_ens_page.set_content")}),s.jsxs("div",{className:"message-box",children:[s.jsx("p",{children:t("land_assign_ens_page.set_content_explanation")}),s.jsx(v,{type:"submit",disabled:j,onClick:this.handleSetContent,className:f,loading:i,primary:!0,network:T.Network.ETHEREUM,children:b?t("global.retry_tx"):g?s.jsxs(s.Fragment,{children:[t("global.approved_tx"),i?null:s.jsx(r.Icon,{name:"check"})]}):t("global.submit")})]})]})}),s.jsxs(r.Row,{className:"confirmation-buttons",children:[s.jsx(r.Button,{onClick:this.handleBack,disabled:m,children:t("global.back")}),s.jsx(r.Button,{disabled:!c||!g||d||i||l,onClick:this.handleFinish,primary:!0,children:t("global.finish")})]})]})}}let is=class extends w.PureComponent{constructor(){super(...arguments);h(this,"handleGoBack",()=>{this.props.history.goBack()})}render(){const{ens:e,isLoading:o,error:d,isWaitingTxSetContent:i,isWaitingTxReclaim:l,isWaitingTxSetResolver:R,history:x,onSetENSResolver:_,onSetENSContent:c,onReclaimName:g}=this.props;return s.jsx(as,{children:m=>e?s.jsx(ts,{land:m,title:t("land_assign_ens_page.title",{name:e.subdomain}),subtitle:s.jsx(H,{id:"land_assign_ens_page.subtitle",values:{land:s.jsx(I,{to:y.landDetail(m.id),children:m.name})}}),children:s.jsx(os,{land:m,ens:e,error:d,isLoading:o,isWaitingTxSetResolver:R,isWaitingTxSetContent:i,isWaitingTxReclaim:l,onSetENSContent:c,onSetENSResolver:_,onReclaimName:g,onBack:this.handleGoBack,onNavigate:S=>x.push(S)})}):s.jsx(r.Loader,{active:!0,size:"large"})})}};const rs=(n,a)=>{const{landId:e,subdomain:o}=a.match.params,d=M(n),i=V(d,o);return{ens:i,error:z(n),isWaitingTxSetResolver:E(p(n),L)||K(n),isWaitingTxSetContent:E(p(n),k)||$(n,e),isWaitingTxReclaim:i?J(n,i.subdomain)||X(n):!1,isLoading:E(p(n),L)||E(p(n),k)||E(p(n),es)||E(p(n),ns)}},ls=n=>({onSetENSResolver:a=>n(Y(a)),onSetENSContent:(a,e)=>n(Z(a,e)),onReclaimName:a=>n(ss(a))}),ps=Q(rs,ls)(G(is));export{ps as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as l,Z as E,dv as w,K as I,bC as h,H as e,M as d,G as r,bB as y,N as B,df as H,dk as T,a6 as R,bw as O,cI as P,bL as A,b_ as D,cL as F}from"./index-
|
|
1
|
+
import{D as l,Z as E,dv as w,K as I,bC as h,H as e,M as d,G as r,bB as y,N as B,df as H,dk as T,a6 as R,bw as O,cI as P,bL as A,b_ as D,cL as F}from"./index-C9mPf6Ri.js";import{L as z}from"./LoggedInDetailPage.container-Bk9bBqUg.js";import{B as G}from"./Back-B4xhIUim.js";import{N as M}from"./NotFound-j8VjZqQq.js";import"./Navigation.container-CI9CVojA.js";import"./selectors-KjglbPet.js";import"./SignInRequired-B9ddDCc3.js";function K(i){const[s,u]=l.useState(void 0),[g,L]=l.useState(void 0),{isLoading:b,ens:o,landTiles:c}=i,m=E(),x=l.useMemo(()=>{const a=Object.values(c||{});if(a.length===1)return a[0].land;let n;for(const t of a)if(t.land.id!==o.landId){n=t.land;break}return n},[c]);l.useEffect(()=>{!s&&!b&&o&&u(x)},[x]);const j=l.useCallback((a,n)=>{const t=h(a,n);return c&&t in c?c[t].land:void 0},[c]),N=l.useCallback((a,n)=>{const t=j(a,n);t&&u(t)},[]),v=l.useCallback(()=>{const a=w(c,s.id);u(a)},[s,c]),S=l.useCallback(()=>{s&&m.push(I.landAssignENS(s.id,o.subdomain))},[o,m,s]),C=l.useCallback((a,n)=>{const t=h(a,n);return(!s||s.id!==t)&&g===t},[]),_=l.useCallback((a,n)=>C(a,n)&&j(a,n)?{color:"#fcc6d1",scale:1.4}:null,[]),k=l.useCallback((a,n)=>{L(h(a,n))},[]),p=l.useCallback(()=>{m.goBack()},[m]),f=s&&o&&s.id===o.landId;return e.jsx(z,{className:"ENSSelectLandPage",hasNavigation:!1,children:b?e.jsx(d.Loader,{active:!0,size:"massive"}):o?e.jsxs(e.Fragment,{children:[e.jsx(G,{absolute:!0,onClick:p}),e.jsxs(d.Narrow,{children:[e.jsx(d.Row,{children:e.jsx(d.Column,{children:e.jsxs(d.Section,{children:[e.jsx(d.Header,{className:"title",size:"large",children:r("ens_select_land_page.title",{name:o?o.subdomain:r("global.name")})}),e.jsx("span",{className:"subtitle",children:r("ens_select_land_page.subtitle")})]})})}),e.jsx("div",{className:"atlas-wrapper",children:e.jsx(y,{showControls:!0,showOwner:!0,isDraggable:!0,landId:s?s.id:void 0,onClick:N,onHover:k,onLocateLand:v,layers:[_]})}),e.jsxs(d.Row,{className:"atlas-footer",children:[e.jsx(d.Column,{grow:!0,children:s?e.jsxs("div",{className:"selected-land",children:[e.jsx("div",{className:"label",children:r("ens_select_land_page.land_selected")}),e.jsxs("div",{className:"land",children:[s.name," (",s.id,")"]})]}):null}),e.jsx(d.Column,{grow:!1,children:e.jsxs("div",{className:"actions",children:[e.jsx(d.Button,{secondary:!0,onClick:p,children:r("global.cancel")}),e.jsx(d.Button,{primary:!0,disabled:!s||f,onClick:S,children:f?r("ens_select_land_page.already_assigned"):r("global.continue")})]})})]})]})]}):e.jsx(M,{})})}const Q=(i,s)=>{const{subdomain:u}=s.match.params,g=H(i);return{ens:T(g,u),isLoading:R(i)||O(P(i),F)||A(i),landTiles:D(i)}},X=B(Q)(K);export{X 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,dD as me,M as a,N as U,ep as Ie,X as he,eq as Se,er as Z,a1 as fe,dC as Ce,es as Ne,et as ue,eu as ve,ev as ce,J as Re,ew as N,aZ as oe,ex as w,aH as we,ey as Le,ez as De,eA as Ee,eB as Ae,eC as Oe,bw as G,eD as ye,eE as ie,eF as Pe,eG as ke,eH as Me,eI as He,eJ as $e,eK as Be,eL as Fe,eM as Ue,eN as Ve,eO as ze}from"./index-CtlR5vLP.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-BZFqWR65.js";import{L as Ze}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{O as ge}from"./OptionsDropdown-wWmxnpgA.js";import{a as B}from"./date-DHhUNLFy.js";import{C as _e}from"./CollectionStatus.container-NEqFbtYE.js";import"./selectors-DB1jYqTE.js";import"./SignInRequired-B3HAtRFv.js";import"./index-Dp84zHnv.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:c}=be(),d=F(),r=d.push.bind(d),o=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")??o),I=(_-1)*p;return[_,p,I]},[o,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[t,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[t,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,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(`${c}?${I.toString()}`)},[c,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:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);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:c=>l(he(c,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ct="_title_xmdia_29",ot="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ct,imageColumn:ot,published:it};function rt(l){const{item:t}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(t.id))},[c]);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:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),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:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),o=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.${o}`)}),e.jsx(a.Table.Cell,{width:2,children:c}),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:c,collections:d,view:r,collectionsPaginationData:o,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:o==null?void 0:o.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?ce.STANDARD:ce.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}):c.map((C,T)=>e.jsx(at,{item:C},T))}),[c,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:c.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[c,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(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.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,o,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),c=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,o=Ae(l);return{items:d,address:t,collections:c,collectionsPaginationData:o,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,c)=>l(he(t,c)),onFetchOrphanItems:(t,c)=>l($e(t,c)),onFetchCollections:(t,c)=>l(Be(t,c)),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,dD as me,M as a,N as U,ep as Ie,X as he,eq as Se,er as Z,a1 as fe,dC as Ce,es as Ne,et as ue,eu as ve,ev as ce,J as Re,ew as N,aZ as oe,ex as w,aH as we,ey as Le,ez as De,eA as Ee,eB as Ae,eC as Oe,bw as G,eD as ye,eE as ie,eF as Pe,eG as ke,eH as Me,eI as He,eJ as $e,eK as Be,eL as Fe,eM as Ue,eN as Ve,eO as ze}from"./index-C9mPf6Ri.js";import{B as qe,b as Ge,N as Ye}from"./Navigation.container-CI9CVojA.js";import{L as Ze}from"./LoggedInDetailPage.container-Bk9bBqUg.js";import{O as ge}from"./OptionsDropdown-CRC0BRD_.js";import{a as B}from"./date-COlRhyCR.js";import{C as _e}from"./CollectionStatus.container-C_ZJC78l.js";import"./selectors-KjglbPet.js";import"./SignInRequired-B9ddDCc3.js";import"./index-CscoW-mh.js";const Qe=l=>l.ui.collection,We=l=>Qe(l).view,re=20;function Je(l){const{search:t,pathname:c}=be(),d=F(),r=d.push.bind(d),o=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")??o),I=(_-1)*p;return[_,p,I]},[o,t]),j=n.useCallback(()=>{const i=new URLSearchParams(t);i.set("page",(g+1).toString()),r(`${c}?${i.toString()}`)},[t,g,r,c]),S=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page",i.toString()),r(`${c}?${_.toString()}`)},[t,r,c]),O=n.useCallback(i=>{const _=new URLSearchParams(t);_.set("page","1"),_.set("sortBy",i),r(`${c}?${_.toString()}`)},[c,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(`${c}?${I.toString()}`)},[c,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:c,onOpenModal:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>d("MoveItemToCollectionModal"),[d]),b=n.useCallback(()=>{o(!1),c()},[o,c]);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:c=>l(he(c,{item:t.item}))}),at=U(void 0,tt)(et),lt="_ItemRow_xmdia_1",st="_image_xmdia_7",nt="_name_xmdia_21",ct="_title_xmdia_29",ot="_imageColumn_xmdia_30",it="_published_xmdia_35",D={ItemRow:lt,image:st,name:nt,title:ct,imageColumn:ot,published:it};function rt(l){const{item:t}=l,c=F(),d=n.useCallback(()=>{c.push(E.itemDetail(t.id))},[c]);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:c,itemCount:d}=l,[r,o]=n.useState(!1),x=n.useCallback(()=>o(!1),[o]),u=n.useCallback(()=>o(!0),[o]),g=n.useCallback(()=>{o(!1),c()},[o,c]),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:c}=l,d=F(),r=n.useCallback(()=>{d.push(E.collectionDetail(t.id,Z(t)))},[d]),o=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.${o}`)}),e.jsx(a.Table.Cell,{width:2,children:c}),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:c,collections:d,view:r,collectionsPaginationData:o,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:o==null?void 0:o.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?ce.STANDARD:ce.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}):c.map((C,T)=>e.jsx(at,{item:C},T))}),[c,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:c.map(C=>e.jsx(rt,{item:C},C.id))})]})}),[c,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(oe,{className:"grid",icon:"grid",isActive:r===w.GRID,onClick:()=>i(w.GRID)}),e.jsx(oe,{className:"list",icon:"table",isActive:r===w.LIST,onClick:()=>i(w.LIST)})]})}),[r,i,k,ee]),Te=n.useCallback(()=>{const C=o==null?void 0:o.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,o,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),c=Le(l),d=t?De(l,t):[],r=t?Ee(l,t):null,o=Ae(l);return{items:d,address:t,collections:c,collectionsPaginationData:o,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,c)=>l(he(t,c)),onFetchOrphanItems:(t,c)=>l($e(t,c)),onFetchCollections:(t,c)=>l(Be(t,c)),onFetchOrphanItem:t=>l(Fe(t))}),kt=U(Nt,vt)(ft);export{kt 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 H,D as r,ec as X,H as e,bB as J,bT as Z,bU as ee,ed as te,ee as se,G as l,ef as ne,a1 as B,K as I,cC as ae,M as n,aA as oe,bC as le,N as P,a_ as ie,b_ as re,X as G,eg as ce,eh as de,bw as S,ei as me,ej as ue,T as ge,ek as pe,b3 as K,el as he,af as _e,ah as xe,aj as je,I as be,em as Se,b$ as Ce,S as Ee,O as De,cI as ye,d0 as A,c1 as Ne,aW as Te,V as Ie,W as fe,Y as ke,en as Re,cL as Me,eo as Le,c$ as we,c2 as ve}from"./index-C9mPf6Ri.js";import{B as Oe}from"./Back-B4xhIUim.js";import{N as Pe}from"./NotFound-j8VjZqQq.js";import{S as $e}from"./SDKTag-BTPzk_4G.js";import{a as F,S as Be}from"./SceneStats.container-BIue1sHH.js";import"./date-COlRhyCR.js";import"./index-CscoW-mh.js";const U=H.get("EXPLORER_URL",""),Ae=H.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)}),ze=t=>({onOpenModal:(s,a)=>t(G(s,a))}),He=P(Ue,ze)(ie(Fe)),Ge="https://cdn.decentraland.org/@dcl/builder-site/7.3.1-13437280096.commit-c1eb6c6/assets/automatic_migrate-DQYv7lI_.webp",Ke="https://cdn.decentraland.org/@dcl/builder-site/7.3.1-13437280096.commit-c1eb6c6/assets/migrate_smart_items-D2zNoKEa.webp";var m=(t=>(t.INFO="info",t.MIGRATE="migrate",t))(m||{});function z(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(()=>z(s)>0,[s]),E=r.useCallback(()=>{h(m.INFO)},[]),D=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?Ke:Ge}},[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:z(s)}:{},M=()=>!a||i!==m.MIGRATE?e.jsx(n.Button,{disabled:a,primary:!0,onClick:k,children:l(`migrate_to_sdk7_modal.${C}.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,C=j?`${i}_smart_items`:i,L=!a&&(i!==m.MIGRATE||j);return e.jsxs(n.Modal,{open:!0,className:b.modalContainer,onClose:D,children:[e.jsx(n.ModalNavigation,{title:l(`migrate_to_sdk7_modal.${C}.title`),onBack:i!==m.INFO?E:void 0,onClose:D}),e.jsxs(n.ModalContent,{className:b.content,children:[e.jsx("p",{className:b.subtitle,children:l(`migrate_to_sdk7_modal.${C}.subtitle`,{b:y=>e.jsx("b",{children:y}),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:(y,{checked:w})=>{x(!!w)}})]}),e.jsxs(n.ModalActions,{className:b.actions,children:[M(),L&&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(K(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,E]=r.useState(!1);r.useEffect(()=>{s&&!a&&h(s)},[s,a,h]);const D=()=>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]),C=r.useCallback(()=>{d(s),x(!1)},[s,d,x]),L=r.useCallback(()=>{x(!1)},[x]),y=r.useCallback(()=>{a!=null&&a.sdk6?E(!0):i(I.inspector(s==null?void 0:s.id))},[s,a,i]),w=()=>{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:y,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:[w(),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(He,{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?D():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:L,onConfirm:C})]}):null,j&&e.jsx(tt,{project:s,scene:a,onNavigate:i,onClose:()=>E(!1)})]}),e.jsx(je,{})]})},nt=_e.memo(st),at=t=>{const s=Se(t),a=Ce(t),o=s&&s in a?a[s]:null,c=Ee(t),u=s&&s in c?c[s]:[],d=o&&De(t)[o.sceneId];return{project:o,deployments:u,scene:d,isLoading:S(K(t),Re),isLoadingDeployments:S(ye(t),Me)||S(A(t),Le)||S(A(t),we)||S(Ne(t),ve)}},ot=t=>({onNavigate:s=>t(Te(s)),onOpenModal:(s,a)=>t(G(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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var G=Object.defineProperty;var X=(n,s,l)=>s in n?G(n,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[s]=l;var E=(n,s,l)=>X(n,typeof s!="symbol"?s+"":s,l);import{D as d,H as e,J as Y,Z,K as k,es as F,eS as H,eT as S,eU as j,eP as q,eV as z,eW as J,eX as _,eY as ee,eZ as se,e_ as ae,M as t,G as i,dD as ie,e$ as le,f0 as C,f1 as te,f2 as ne,f3 as ce,L as de,er as oe,cC as re,f4 as ue,b8 as me,f5 as he,cB as xe,f6 as pe,f7 as je,f8 as ge,f9 as ve,N as Ne,fa as be,fb as Ie,e9 as fe,fc as _e,fd as Ce,fe as ye,bw as T,eE as P,ff as Ee,fg as ke,ep as Se,X as Te,eN as Pe,fh as De,fi as we}from"./index-CtlR5vLP.js";import{I as Me}from"./ItemProvider.container-BRpScX9b.js";import{C as Le}from"./ConfirmDelete-DN98x9nl.js";import{L as Be}from"./LoggedInDetailPage.container-iODRZ5_l.js";import{N as Re}from"./NotFound-DAstcQ7G.js";import{B as Ue}from"./Back-CmrASlX3.js";import"./Navigation.container-BZFqWR65.js";import"./selectors-DB1jYqTE.js";import"./SignInRequired-B3HAtRFv.js";class Oe extends d.PureComponent{constructor(l){super(l);E(this,"state",{isNoticeClosed:!1});E(this,"handleCloseNotice",()=>{const{storageKey:l}=this.props;this.setState({isNoticeClosed:!0}),localStorage.setItem(l,"1")});const{storageKey:r}=l;this.state={isNoticeClosed:localStorage.getItem(r)!==null}}render(){const{children:l}=this.props,{isNoticeClosed:r}=this.state;return r?null:e.jsxs("div",{className:"Notice",children:[e.jsx("div",{className:"text",children:l}),e.jsx(Y,{name:"close",onClick:this.handleCloseNotice})]})}}const Ve="dcl-item-notice";function Ae(n){const{item:s,itemId:l,isLoading:r,status:h,collection:g,hasAccess:v,isWearableUtilityEnabled:D,onDelete:w,onSaveItem:x,onOpenModal:o}=n,p=d.useRef(null),N=Z(),y=d.useCallback(()=>{s&&N.push(k.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:F(s.urn)?H.TP_COLLECTIONS:H.COLLECTIONS})},[N,s]),M=d.useCallback(async a=>{const c=await S({[j]:a}),u={...s,contents:{...s==null?void 0:s.contents,[j]:c[j]}};h&&[q.UNPUBLISHED,q.UNDER_REVIEW].includes(h)&&(u.video=c[j]),x(u,{[j]:a})},[x,s,h]),b=d.useCallback(()=>{o("EditVideoModal",{item:s,onSaveVideo:M})},[s,o,M]),L=d.useCallback(()=>{w(s)},[s,w]),I=d.useCallback(()=>{s&&z(s)?o("CreateSingleItemModal",{item:s,addRepresentation:!0}):o("CreateSingleItemModal",{item:s,changeItemFile:!0})},[o,s]),B=d.useCallback(()=>{o("EditItemURNModal",{item:s})},[s,o]),R=d.useCallback(async a=>{const c=J(a);x({...s,contents:{...s==null?void 0:s.contents,...await S({[_]:c})}},{[_]:c})},[x,s]),U=d.useCallback(()=>{(s==null?void 0:s.type)===ee.EMOTE?o("EditThumbnailModal",{onSaveThumbnail:R,item:s,collection:g}):p.current&&p.current.click()},[p.current,g,s,o,R]),O=d.useCallback(async a=>{const{files:c}=a.target;if(c&&c.length>0){const u=c[0],f=await se(u,1024,1024);f&&s&&(s.contents={...s.contents,...await S({[_]:f})},x(s,{[_]:f}))}},[x,s]),V=d.useCallback(()=>{o("MoveItemToCollectionModal",{item:s})},[s,o]),W=d.useCallback((a,c)=>{var A;const u=a.data,$=!(c&&ae(c));return e.jsxs(e.Fragment,{children:[e.jsx(t.Section,{children:e.jsx(t.Row,{children:e.jsx(Ue,{onClick:()=>N.push(k.collectionDetail(a.collectionId))})})}),e.jsxs(t.Narrow,{children:[!c&&!a.collectionId?e.jsx(Oe,{storageKey:Ve,children:i("item_detail_page.notice")}):null,e.jsxs("div",{className:"item-data",children:[e.jsxs("div",{className:"item-data-left-panel",children:[e.jsx(ie,{item:a,hasBadge:!0,hasRarityBadge:!0,hasUtilityBadge:!0}),e.jsx("div",{children:e.jsxs(t.Button,{primary:!0,onClick:U,children:[e.jsx("input",{type:"file",ref:p,onChange:O,accept:"image/png"}),e.jsx(t.Icon,{name:"camera"}),i("item_detail_page.edit_thumbnail")]})}),e.jsxs("div",{className:"metrics",children:[e.jsx("span",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(le,{item:a})]}),C(a)?e.jsx(te,{item:a,onClick:b,children:(m,K,Q,qe)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overlay",children:e.jsx(t.Icon,{name:"play",className:"play-video-button",onClick:b})}),e.jsxs(t.Button,{primary:!0,onClick:b,children:[e.jsx(t.Icon,{name:"video"}),i("item_detail_page.edit_video")]}),e.jsxs("div",{className:"metrics",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(ne,{duration:K,size:Q,showIcons:!1})]})]})}):null,e.jsxs("div",{className:"details",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details")}),a.isPublished&&e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details_info.id")}),e.jsxs("div",{className:"value",children:["#",a.tokenId]})]}),u.category?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.category")}),e.jsx("div",{className:"value",children:i(`${a.type}.category.${u.category}`)})]}):null,a.isPublished&&a.rarity?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.supply")}),e.jsxs("div",{className:"value",children:[a.totalSupply,"/",ce(a)]})]}):null,c?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.collection")}),e.jsx(de,{className:"collection-link",to:k.collectionDetail(c.id,oe(c)),children:c.name})]}):null,a.urn?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("global.urn")}),e.jsxs("div",{className:"value urn",children:[e.jsxs("span",{children:[a.urn,e.jsx(re,{role:"button",text:a.urn,children:e.jsx(t.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})})]}),e.jsx("div",{className:"urn-actions",children:F(a.urn)?e.jsx(t.Popup,{content:i("collection_item.cannot_edit_urn"),disabled:!a.isPublished,position:"top center",trigger:e.jsx("div",{children:e.jsx("button",{disabled:a.isPublished,className:"link",onClick:B,children:i("item.edit_urn")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):null})]})]}):null]})]}),e.jsxs("div",{className:"cards-container",children:[e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:a.name}),e.jsxs("div",{className:"actions",children:[C(a)&&e.jsx(t.Button,{className:"edit",inverted:!0,size:"small",onClick:I,children:i("global.edit")}),e.jsx(t.Button,{inverted:!0,size:"small",onClick:y,children:i("collection_detail_page.preview")}),$?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,className:"more-actions-button",children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[e.jsx(Le,{name:a.name,onDelete:L,trigger:a.isPublished?e.jsx(t.Popup,{content:i("item_detail_page.delete_published_item"),position:"right center",trigger:e.jsx(t.Dropdown.Item,{disabled:!0,text:i("global.delete")}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx(t.Dropdown.Item,{text:i("global.delete")})}),!a.collectionId&&e.jsx(t.Dropdown.Item,{text:i("collection_item.move_to_another_collection"),onClick:V})]})}):null]})]}),e.jsxs("div",{className:"attribute-row",children:[a.description&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.description")}),e.jsx("div",{className:"data",children:a.description})]}),a.utility&&D&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.utility")}),e.jsx("div",{className:"data",children:a.utility})]})]}),a.data.tags.length?e.jsx("div",{className:"attribute-row",children:e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.tags.title")}),e.jsx("div",{className:"data tags-container",children:a.data.tags.map(m=>e.jsx("span",{className:"tag",children:m},m))})]})}):null]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"title",children:i("item_detail_page.selling.title")}),e.jsxs("div",{className:"data",children:[ue(a)?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),e.jsx("div",{className:"value",children:i("global.free")})]}):a.price?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),a.price?e.jsx(t.Mana,{showTooltip:!0,network:me.Network.MATIC,children:he(a.price)}):"-"]}):null,e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.beneficiary")}),a.beneficiary?e.jsx("div",{className:"value",children:xe(a.beneficiary)}):"-"]})]})]}),pe(a)&&!C(a)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.representations.title")}),e.jsx(t.Button,{className:"edit-button",inverted:!0,size:"small",onClick:I,children:z(a)?i("global.add"):i("global.edit")})]}),e.jsx("div",{className:"data",children:e.jsx("div",{className:"representations-container",children:a.data.representations.map(m=>e.jsxs("div",{className:"representation",children:[e.jsx("img",{className:"item-image",src:je(a),alt:a.name}),m.mainFile,e.jsx(ge,{item:a,bodyShape:m.bodyShapes[0]})]},m.mainFile))})})]}):null,C(a)&&((A=a.data.requiredPermissions)!=null&&A.length)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.required_permissions")}),e.jsx(t.Button,{inverted:!0,className:"learn-more-permissions",size:"small",href:"https://docs.decentraland.org/creator/development-guide/sdk7/scene-metadata/#required-permissions",rel:"noopener noreferrer",target:"_blank",content:i("global.learn_more")})]}),e.jsx("div",{className:"data",children:e.jsx(ve,{requiredPermissions:a.data.requiredPermissions,basic:!0})})]}):null]})]})]})]})},[D,N,p,U,O,b,B,I,I,V,y,L,y]);return e.jsx(Me,{id:l,children:(a,c,u)=>e.jsx(Be,{className:"ItemDetailPage",hasNavigation:!v&&!r,isLoading:r||u,children:v&&a?W(a,c):e.jsx(Re,{})})})}const Fe=n=>{const s=be(n),l=s?Ie(n,s):null,r=fe(n),h=l&&l.collectionId?_e(n,l.collectionId):null,g=Ce(n),v=l?g[l.id]:null;return{itemId:s,wallet:r,item:l,collection:h,status:v,isWearableUtilityEnabled:ye(n),isLoading:T(P(n),Pe)||T(P(n),De)||T(P(n),we),hasAccess:l!==null&&Ee(n,r.address,h,l)}},He=n=>({onSaveItem:(s,l)=>n(ke(s,l)),onDelete:s=>n(Se(s)),onOpenModal:(s,l)=>n(Te(s,l))}),es=Ne(Fe,He)(Ae);export{es as default};
|
|
1
|
+
var G=Object.defineProperty;var X=(n,s,l)=>s in n?G(n,s,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[s]=l;var E=(n,s,l)=>X(n,typeof s!="symbol"?s+"":s,l);import{D as d,H as e,J as Y,Z,K as k,es as F,eS as H,eT as S,eU as j,eP as q,eV as z,eW as J,eX as _,eY as ee,eZ as se,e_ as ae,M as t,G as i,dD as ie,e$ as le,f0 as C,f1 as te,f2 as ne,f3 as ce,L as de,er as oe,cC as re,f4 as ue,b8 as me,f5 as he,cB as xe,f6 as pe,f7 as je,f8 as ge,f9 as ve,N as Ne,fa as be,fb as Ie,e9 as fe,fc as _e,fd as Ce,fe as ye,bw as T,eE as P,ff as Ee,fg as ke,ep as Se,X as Te,eN as Pe,fh as De,fi as we}from"./index-C9mPf6Ri.js";import{I as Me}from"./ItemProvider.container-DIBENhEu.js";import{C as Le}from"./ConfirmDelete-CipatP-H.js";import{L as Be}from"./LoggedInDetailPage.container-Bk9bBqUg.js";import{N as Re}from"./NotFound-j8VjZqQq.js";import{B as Ue}from"./Back-B4xhIUim.js";import"./Navigation.container-CI9CVojA.js";import"./selectors-KjglbPet.js";import"./SignInRequired-B9ddDCc3.js";class Oe extends d.PureComponent{constructor(l){super(l);E(this,"state",{isNoticeClosed:!1});E(this,"handleCloseNotice",()=>{const{storageKey:l}=this.props;this.setState({isNoticeClosed:!0}),localStorage.setItem(l,"1")});const{storageKey:r}=l;this.state={isNoticeClosed:localStorage.getItem(r)!==null}}render(){const{children:l}=this.props,{isNoticeClosed:r}=this.state;return r?null:e.jsxs("div",{className:"Notice",children:[e.jsx("div",{className:"text",children:l}),e.jsx(Y,{name:"close",onClick:this.handleCloseNotice})]})}}const Ve="dcl-item-notice";function Ae(n){const{item:s,itemId:l,isLoading:r,status:h,collection:g,hasAccess:v,isWearableUtilityEnabled:D,onDelete:w,onSaveItem:x,onOpenModal:o}=n,p=d.useRef(null),N=Z(),y=d.useCallback(()=>{s&&N.push(k.itemEditor({itemId:s.id,collectionId:s.collectionId}),{fromParam:F(s.urn)?H.TP_COLLECTIONS:H.COLLECTIONS})},[N,s]),M=d.useCallback(async a=>{const c=await S({[j]:a}),u={...s,contents:{...s==null?void 0:s.contents,[j]:c[j]}};h&&[q.UNPUBLISHED,q.UNDER_REVIEW].includes(h)&&(u.video=c[j]),x(u,{[j]:a})},[x,s,h]),b=d.useCallback(()=>{o("EditVideoModal",{item:s,onSaveVideo:M})},[s,o,M]),L=d.useCallback(()=>{w(s)},[s,w]),I=d.useCallback(()=>{s&&z(s)?o("CreateSingleItemModal",{item:s,addRepresentation:!0}):o("CreateSingleItemModal",{item:s,changeItemFile:!0})},[o,s]),B=d.useCallback(()=>{o("EditItemURNModal",{item:s})},[s,o]),R=d.useCallback(async a=>{const c=J(a);x({...s,contents:{...s==null?void 0:s.contents,...await S({[_]:c})}},{[_]:c})},[x,s]),U=d.useCallback(()=>{(s==null?void 0:s.type)===ee.EMOTE?o("EditThumbnailModal",{onSaveThumbnail:R,item:s,collection:g}):p.current&&p.current.click()},[p.current,g,s,o,R]),O=d.useCallback(async a=>{const{files:c}=a.target;if(c&&c.length>0){const u=c[0],f=await se(u,1024,1024);f&&s&&(s.contents={...s.contents,...await S({[_]:f})},x(s,{[_]:f}))}},[x,s]),V=d.useCallback(()=>{o("MoveItemToCollectionModal",{item:s})},[s,o]),W=d.useCallback((a,c)=>{var A;const u=a.data,$=!(c&&ae(c));return e.jsxs(e.Fragment,{children:[e.jsx(t.Section,{children:e.jsx(t.Row,{children:e.jsx(Ue,{onClick:()=>N.push(k.collectionDetail(a.collectionId))})})}),e.jsxs(t.Narrow,{children:[!c&&!a.collectionId?e.jsx(Oe,{storageKey:Ve,children:i("item_detail_page.notice")}):null,e.jsxs("div",{className:"item-data",children:[e.jsxs("div",{className:"item-data-left-panel",children:[e.jsx(ie,{item:a,hasBadge:!0,hasRarityBadge:!0,hasUtilityBadge:!0}),e.jsx("div",{children:e.jsxs(t.Button,{primary:!0,onClick:U,children:[e.jsx("input",{type:"file",ref:p,onChange:O,accept:"image/png"}),e.jsx(t.Icon,{name:"camera"}),i("item_detail_page.edit_thumbnail")]})}),e.jsxs("div",{className:"metrics",children:[e.jsx("span",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(le,{item:a})]}),C(a)?e.jsx(te,{item:a,onClick:b,children:(m,K,Q,qe)=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overlay",children:e.jsx(t.Icon,{name:"play",className:"play-video-button",onClick:b})}),e.jsxs(t.Button,{primary:!0,onClick:b,children:[e.jsx(t.Icon,{name:"video"}),i("item_detail_page.edit_video")]}),e.jsxs("div",{className:"metrics",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.properties")}),e.jsx(ne,{duration:K,size:Q,showIcons:!1})]})]})}):null,e.jsxs("div",{className:"details",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details")}),a.isPublished&&e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.details_info.id")}),e.jsxs("div",{className:"value",children:["#",a.tokenId]})]}),u.category?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.category")}),e.jsx("div",{className:"value",children:i(`${a.type}.category.${u.category}`)})]}):null,a.isPublished&&a.rarity?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.supply")}),e.jsxs("div",{className:"value",children:[a.totalSupply,"/",ce(a)]})]}):null,c?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("item.collection")}),e.jsx(de,{className:"collection-link",to:k.collectionDetail(c.id,oe(c)),children:c.name})]}):null,a.urn?e.jsxs("div",{children:[e.jsx("div",{className:"subtitle",children:i("global.urn")}),e.jsxs("div",{className:"value urn",children:[e.jsxs("span",{children:[a.urn,e.jsx(re,{role:"button",text:a.urn,children:e.jsx(t.Icon,{"aria-label":"Copy urn","aria-hidden":"false",className:"link copy",name:"copy outline"})})]}),e.jsx("div",{className:"urn-actions",children:F(a.urn)?e.jsx(t.Popup,{content:i("collection_item.cannot_edit_urn"),disabled:!a.isPublished,position:"top center",trigger:e.jsx("div",{children:e.jsx("button",{disabled:a.isPublished,className:"link",onClick:B,children:i("item.edit_urn")})}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):null})]})]}):null]})]}),e.jsxs("div",{className:"cards-container",children:[e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:a.name}),e.jsxs("div",{className:"actions",children:[C(a)&&e.jsx(t.Button,{className:"edit",inverted:!0,size:"small",onClick:I,children:i("global.edit")}),e.jsx(t.Button,{inverted:!0,size:"small",onClick:y,children:i("collection_detail_page.preview")}),$?e.jsx(t.Dropdown,{trigger:e.jsx(t.Button,{basic:!0,className:"more-actions-button",children:e.jsx(t.Icon,{name:"ellipsis horizontal"})}),inline:!0,direction:"left",children:e.jsxs(t.Dropdown.Menu,{children:[e.jsx(Le,{name:a.name,onDelete:L,trigger:a.isPublished?e.jsx(t.Popup,{content:i("item_detail_page.delete_published_item"),position:"right center",trigger:e.jsx(t.Dropdown.Item,{disabled:!0,text:i("global.delete")}),hideOnScroll:!0,on:"hover",inverted:!0,flowing:!0}):e.jsx(t.Dropdown.Item,{text:i("global.delete")})}),!a.collectionId&&e.jsx(t.Dropdown.Item,{text:i("collection_item.move_to_another_collection"),onClick:V})]})}):null]})]}),e.jsxs("div",{className:"attribute-row",children:[a.description&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.description")}),e.jsx("div",{className:"data",children:a.description})]}),a.utility&&D&&e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("global.utility")}),e.jsx("div",{className:"data",children:a.utility})]})]}),a.data.tags.length?e.jsx("div",{className:"attribute-row",children:e.jsxs("div",{className:"attribute-column",children:[e.jsx("div",{className:"subtitle",children:i("item_detail_page.tags.title")}),e.jsx("div",{className:"data tags-container",children:a.data.tags.map(m=>e.jsx("span",{className:"tag",children:m},m))})]})}):null]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"title",children:i("item_detail_page.selling.title")}),e.jsxs("div",{className:"data",children:[ue(a)?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),e.jsx("div",{className:"value",children:i("global.free")})]}):a.price?e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.price")}),a.price?e.jsx(t.Mana,{showTooltip:!0,network:me.Network.MATIC,children:he(a.price)}):"-"]}):null,e.jsxs(t.Section,{children:[e.jsx("div",{className:"subtitle",children:i("item.beneficiary")}),a.beneficiary?e.jsx("div",{className:"value",children:xe(a.beneficiary)}):"-"]})]})]}),pe(a)&&!C(a)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.representations.title")}),e.jsx(t.Button,{className:"edit-button",inverted:!0,size:"small",onClick:I,children:z(a)?i("global.add"):i("global.edit")})]}),e.jsx("div",{className:"data",children:e.jsx("div",{className:"representations-container",children:a.data.representations.map(m=>e.jsxs("div",{className:"representation",children:[e.jsx("img",{className:"item-image",src:je(a),alt:a.name}),m.mainFile,e.jsx(ge,{item:a,bodyShape:m.bodyShapes[0]})]},m.mainFile))})})]}):null,C(a)&&((A=a.data.requiredPermissions)!=null&&A.length)?e.jsxs("div",{className:"card",children:[e.jsxs("div",{className:"title-card-container",children:[e.jsx("div",{className:"title",children:i("item_detail_page.required_permissions")}),e.jsx(t.Button,{inverted:!0,className:"learn-more-permissions",size:"small",href:"https://docs.decentraland.org/creator/development-guide/sdk7/scene-metadata/#required-permissions",rel:"noopener noreferrer",target:"_blank",content:i("global.learn_more")})]}),e.jsx("div",{className:"data",children:e.jsx(ve,{requiredPermissions:a.data.requiredPermissions,basic:!0})})]}):null]})]})]})]})},[D,N,p,U,O,b,B,I,I,V,y,L,y]);return e.jsx(Me,{id:l,children:(a,c,u)=>e.jsx(Be,{className:"ItemDetailPage",hasNavigation:!v&&!r,isLoading:r||u,children:v&&a?W(a,c):e.jsx(Re,{})})})}const Fe=n=>{const s=be(n),l=s?Ie(n,s):null,r=fe(n),h=l&&l.collectionId?_e(n,l.collectionId):null,g=Ce(n),v=l?g[l.id]:null;return{itemId:s,wallet:r,item:l,collection:h,status:v,isWearableUtilityEnabled:ye(n),isLoading:T(P(n),Pe)||T(P(n),De)||T(P(n),we),hasAccess:l!==null&&Ee(n,r.address,h,l)}},He=n=>({onSaveItem:(s,l)=>n(ke(s,l)),onDelete:s=>n(Se(s)),onOpenModal:(s,l)=>n(Te(s,l))}),es=Ne(Fe,He)(Ae);export{es as default};
|