PageSourceSearch

https://pro.subscan.io/static/js/995.d3316e8f.chunk.js

js subscan.io collected 2026-10-02 07:20:10 UTC 28,512 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksubscan_api_platform=self.webpackChunksubscan_api_platform||[]).push([[995],{35563:(e,t,a)=>{a.d(t,{A:()=>s});a(65043);const s=a.p+"static/media/icon_switch_disabled.67bd8d83628c0bc94f14f4ff9f936c34.svg"},34486:(e,t,a)=>{a.d(t,{A:()=>s});a(65043);const s=a.p+"static/media/icon_switch_enabled.439088baccf7f23354695d9ad548de70.svg"},2654:(e,t,a)=>{a.d(t,{Y:()=>d});var s=a(65043),r=a(97950),n=a(43360),l=a(30275),i=a(96722),o=a(64924),c=a(70579);const d=e=>{let{open:t,payload:a,onClose:d}=e;const m=(0,s.useRef)(null),u=(0,s.useRef)(document.createElement("div"));return u.current.className="fixed top-0 left-0 w-screen h-screen flex items-center justify-center",u.current.style.background="rgba(48,43,60,0.4)",(0,r.createPortal)((0,c.jsx)(l.A,{in:t,timeout:300,classNames:"fade",nodeRef:m,unmountOnExit:!0,onEnter:()=>{document.body.contains(u.current)||(document.body.style.overflow="hidden",document.body.appendChild(u.current))},onExited:()=>{document.body.contains(u.current)&&(document.body.removeChild(u.current),document.body.style.overflow="auto")},children:(0,c.jsxs)("div",{ref:m,className:"rounded bg-white p-5 relative min-w-[20rem]",style:{border:"1px solid #F2F4FA",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)"},children:[(0,c.jsx)("div",{className:"absolute top-2 right-2 w-7 h-7 p-1 rounded-full hover:cursor-pointer hover:bg-gray-800/10 transition duration-300 hover:rotate-180",onClick:d,children:(0,c.jsx)("img",{alt:"...",src:o.A})}),(0,c.jsxs)("div",{className:"flex flex-col gap-5 w-full",children:[(0,c.jsx)("h5",{className:"text-semibold text-lg",children:"Preview"}),(0,c.jsx)("div",{className:"h-[1px] bg-b4"}),(0,c.jsx)(n.ur,{autoHeight:!0,autoHeightMax:"80vh",style:{maxWidth:"80vw"},children:(0,c.jsx)("div",{className:"mr-3",children:(0,c.jsx)(i.Preview,{options:JSON.parse(a)})})})]})]})}),u.current)}},9995:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Z});var s=a(65043),r=a(97964),n=a(49665),l=a(95896);const i=a.p+"static/media/widget_empty.30abd6c7deefeb6d0f720ec34b138e1b.svg";var o=a(70579);const c=e=>{let{email:t,publishKey:a,permission:s=!1}=e;return(0,o.jsxs)("div",{className:"flex flex-col items-center gap-[1.875rem]",children:[(0,o.jsx)("img",{alt:"...",src:i}),s?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex flex-col gap-4 max-w-[22.5rem]",children:[(0,o.jsx)("p",{className:"text-normal text-sm text-center",children:`This account ${null!==t&&void 0!==t?t:a?(0,l._9)((0,n.j)(a)):""} doesn't have management permission.`}),(0,o.jsxs)("p",{className:"text-normal text-sm text-center",children:["If you are the developer of Dotsama ecosystem, please contact"," ",(0,o.jsx)("a",{href:"mailto:[email protected]",className:"text-link",children:"[email protected]"})," ","to get permission."]})]}),(0,o.jsx)(r.S,{variant:"contained",className:"flex items-center rounded px-5 h-10",textClassName:"text-semibold text-sm",onClick:()=>{window.open("mailto:[email protected]")},children:"Get Permission"})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"text-normal text-sm text-center max-w-[22.5rem]",children:"Your team hasn't created Low-code customized widget. Click the button below to create your first one."}),(0,o.jsx)(r.S,{variant:"contained",className:"flex items-center rounded px-5 h-10",textClassName:"text-semibold text-sm",children:"Create"})]})]})};var d=a(15383),m=a(2654),u=a(18124);const x=a.p+"static/media/icon_widget_copy.91fb1cfeb4c2b56cf1dbdca418bae0e5.svg";const p=a.p+"static/media/icon_download.f59feecd2d999a56955190b89aad3c98.svg";var f=a(67119);const h=a.p+"static/media/icon_share.accc963e7fe3da8b61f2e3959917c828.svg";var v=a(75666),b=a(57999),g=a(30393),j=a(43818),y=a(58262),N=a(52938),w=a(24559),C=a(59905),k=a(61476),S=a.n(k),_=a(34486),O=a(35563),P=a(97249);const E=e=>{let{title:t,isOpen:a,widgetId:n,visitorId:l,onClose:i=()=>{}}=e;const[c,d]=(0,s.useState)(l?{id:l}:null),[m,u]=(0,s.useState)(!1),x=(0,s.useCallback)((async e=>{u(!0);try{const s=await(e?(0,w.Iq)({id:n}):(0,w.Rd)({id:n}));var t,a;if(200===s.status&&0===s.data.code)null!==(t=s.data)&&void 0!==t&&null!==(a=t.data)&&void 0!==a&&a.id?d({id:s.data.data.id}):d(null)}catch(s){console.error(s)}u(!1)}),[n]);(0,s.useEffect)((()=>{d(l?{id:l}:null)}),[l]);const p=`${window.location.origin}/widget/${(null===c||void 0===c?void 0:c.id)||"f2759a37e38a4ee1b7bf1b22ebe1f084"}`;
1return(0,o.jsx)(g.V,{open:a,width:408,title:t,footer:!1,onClose:i,children:(0,o.jsxs)("div",{className:"flex flex-col gap-5 relative p-small",children:[m&&(0,o.jsx)("div",{className:"absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center bg-black-800/5 rounded",children:(0,o.jsx)(P.t,{})}),(0,o.jsxs)("div",{className:"flex items-center gap-middle",children:[(0,o.jsx)("span",{className:"text-sm text-normal",children:"Get share link"}),c?(0,o.jsx)("img",{alt:"...",src:_.A,className:"hover:cursor-pointer transition-transform hover:scale-105 active:scale-95",onClick:()=>x(!1)}):(0,o.jsx)("img",{alt:"...",src:O.A,className:"hover:cursor-pointer transition-transform hover:scale-105 active:scale-95",onClick:()=>x(!0)})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-5",style:{visibility:c?"visible":"hidden"},children:[(0,o.jsxs)("div",{className:"flex flex-col items-start justify-start text-sm text-normal",children:[(0,o.jsx)("span",{children:"Anyone with the link can view:"}),(0,o.jsx)("a",{className:"text-link hover:underline transition break-words w-full",href:p,target:"_blank",rel:"noopener noreferrer",children:p})]}),(0,o.jsx)("div",{className:"h-[1px] bg-b4"}),(0,o.jsx)(S(),{text:p,onCopy:(e,t)=>{t&&C.E.success({description:"Copied successfully"})},children:(0,o.jsx)(r.S,{className:"h-9 rounded px-5 w-fit",textClassName:"text-normal text-sm",children:"Copy Link"})})]})]})})};var z=a(28872),A=a(30275),D=a(43361),F=a(30621);const R=e=>{let{options:t,value:a,defaultValue:r,disabled:n,className:l,popupHeightMax:i=200,onInputChange:c=()=>{},onSelect:d=()=>{}}=e;
1const m=(0,s.useRef)(null),[u,x]=(0,s.useState)(r||""),[p,f]=(0,s.useState)(!1),[h,v]=(0,s.useState)(!1),[b,g]=(0,s.useState)(!1),[j,y]=(0,s.useState)(t.find((e=>e.value===r))),[N,w]=(0,s.useState)(null),[C,k]=(0,s.useState)(null),{styles:S,attributes:_}=(0,z.E)(C,N,{modifiers:[D.h,{name:"offset",options:{offset:[0,5]}}]});return(0,s.useEffect)((()=>{a&&y(t.find((e=>e.value===a)))}),[t,a]),(0,s.useEffect)((()=>{!a&&r&&(d(r),x(r),c(r))}),[a,r,d,c]),(0,s.useEffect)((()=>{const e=e=>{e.target&&C&&!C.contains(e.target)&&f(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}}),[C]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("button",{disabled:n,ref:k,style:!h&&!b||n?{border:"1px solid transparent",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)",background:"linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #D8D8D8, #D8D8D8) border-box"}:{background:"linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #3A30DD, #FE3876) border-box",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)",border:"1px solid transparent"},className:`border border-b3 rounded px-[0.625rem] h-9 flex items-center justify-between transition-all hover:opacity-80 active:opacity-60 cursor-default flex ${n?"cursor-not-allowed":""} ${l}`,onBlur:()=>v(!1),onFocus:()=>v(!0),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[(0,o.jsx)("input",{value:u,className:"flex-1 h-full focus-visible:outline-none",onChange:e=>{x(e.target.value),c(e.target.value)}}),(0,o.jsx)("img",{alt:"...",src:F.A,className:"transition-transform duration-300 p-2 cursor-pointer",style:{transform:""+(p?"rotateX(180deg)":"rotateX(0)")},onClick:()=>f((e=>!e))})]}),(0,o.jsx)(A.A,{in:p,timeout:300,unmountOnExit:!0,nodeRef:m,classNames:"fade-dropdown",children:(0,o.jsx)("div",{ref:w,style:S.popper,..._.popper,className:"z-10",children:(0,o.jsx)("div",{ref:m,className:"border border-b3 rounded bg-white flex flex-col h-auto overflow-y-auto",style:{boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)",maxHeight:i},children:t.map(((e,t)=>(0,o.jsx)(s.Fragment,{children:"string"===typeof e.label||"number"===typeof e.label?(0,o.jsx)("div",{className:"border border-transparent border-t-b3 first:border-t-transparent px-[0.625rem] py-1 hover:bg-gray-800/10 hover:cursor-pointer transition-colors",onClick:()=>{f(!1),d(e.value),x(e.value),c(e.value)},children:(0,o.jsx)("span",{className:"text-normal text-sm",children:e.label})}):(0,o.jsx)("div",{className:"px-[0.625rem] hover:cursor-pointer hover:bg-gray-800/10 transition-colors",onClick:()=>{f(!1),d(e.value),x(e.value),c(e.value)},children:e.label},t)},t)))})})})]})};var $=a(53536),I=a.n($);const M=e=>{let{data:t,networks:a,onCreate:n,onRefresh:i=()=>{}}=e;const{userInfo:c}=(0,y.nm)(),[C,k]=(0,s.useState)(!1),[S,_]=(0,s.useState)(!1),[O,P]=(0,s.useState)((null===t||void 0===t?void 0:t.name)||""),[z,A]=(0,s.useState)((null===t||void 0===t?void 0:t.remark)||""),[D,F]=(0,s.use
1State)(!1),[$,M]=(0,s.useState)(!1),[T,B]=(0,s.useState)(!1),[H,V]=(0,s.useState)(!1),W=(0,s.useCallback)((async()=>{if(t)try{const e=await(0,w.v)({name:t.name,payload:t.payload,remark:t.remark});200===e.status&&0===e.data.code&&i()}catch(e){console.error(e)}}),[t,i]),Y=(0,s.useCallback)((async()=>{if(t)try{const e=document.createElement("a");e.download=`${t.name}.json`,e.href=`data:text/json;chatset=utf-8,${encodeURIComponent(t.payload)}`,e.click()}catch(e){console.error(e)}}),[t]),L=(0,s.useCallback)((async()=>{if(t&&O)try{k(!0);const e=await(0,w.YA)({id:t.id,name:O,remark:z,payload:t.payload});200===e.status&&0===e.data.code&&i()}catch(e){console.error(e)}finally{k(!1),F(!1)}F(!1)}),[t,O,z,i]),U=(0,s.useCallback)((async()=>{if(t)try{_(!0);const e=await(0,w.Dj)({ids:[t.id]});_(!1),200===e.status&&0===e.data.code&&(M(!1),i())}catch(e){console.error(e)}}),[t,i]),J=(0,s.useCallback)((e=>{P(e.target.value)}),[]);return(0,s.useEffect)((()=>{null!==t&&void 0!==t&&t.name&&null!==t&&void 0!==t&&t.remark&&(P(t.name),A(t.remark))}),[null===t||void 0===t?void 0:t.name,null===t||void 0===t?void 0:t.remark]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"rounded w-[14.75rem] min-h-[14rem] p-5 flex items-center justify-center bg-white transition-transform hover:scale-105",style:{border:"1px solid #F2F4FA",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)"},children:t?(0,o.jsxs)("div",{className:"flex flex-col items-start gap-[0.625rem] w-full",children:[(0,o.jsx)("span",{className:"text-semibold text-sm truncate max-w-full",children:t.name}),(0,o.jsx)("div",{className:"flex items-center gap-[0.3125rem]",children:(0,o.jsx)("span",{className:"text-normal text-sm capitalize",children:t.network.name})}),(0,o.jsx)("div",{className:"bg-b4 h-[1px] w-full"}),(0,o.jsx)("div",{className:"flex items-center gap-small",children:t.appliedCount?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"h-2 w-2 rounded-full",style:{background:"linear-gradient(341deg, #FF99B9 8.41%, #D030DD 91.59%)"}}),(0,o.jsx)("span",{className:"text-normal text-xs",children:`Applied (${t.appliedCount})`})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"w-2 h-2 bg-b2 rounded-full"}),(0,o.jsx)("span",{className:"text-normal text-xs",children:"Not Applied"})]})}),(0,o.jsx)("span",{className:"text-normal text-sm truncate max-w-full",children:t.createBy.email?`${(0,d.A)(1e3*t.updatedAt,Date.now())} ago By ${t.createBy.email.split("@")[0]}`:`${(0,d.A)(1e3*t.updatedAt,Date.now())} ago`}),(0,o.jsxs)("div",{className:"flex items-center gap-middle",children:[(0,o.jsx)("img",{className:"hover:cursor-pointer transition-transform duration-300 hover:scale-110 active:scale-95",alt:"...",src:x,onClick:W}),(0,o.jsx)("img",{className:"hover:cursor-pointer transition-transform duration-300 hover:scale-110 active:scale-95",alt:"...",src:p,onClick:Y}),t.createBy.id===(null===c||void 0===c?void 0:c.id)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("img",{className:"hover:cursor-pointer transition-transform duration-300 hover:scale-110 active:scale-95",alt:"...",src:f.A,onClick:()=>F(!0)}),(0,o.jsx)("img",{className:"hover:cursor-pointer transition-transform duration-300 hover:scale-110 active:scale-95",alt:"...",src:h,onClick:()=>V(!0)}),(0,o.jsx)("img",{className:"hover:cursor-pointer transition-transform duration-300 hover:scale-110 active:scale-95",alt:"...",src:v.A,onClick:()=>M(!0)})]})]}),(0,o.jsx)("div",{className:"bg-b4 h-[1px] w-full"}),(0,o.jsxs)("div",{className:"flex items-center justify-between w-full",children:[t.createBy.id===(null===c||void 0===c?void 0:c.id)?(0,o.jsx)(r.S,{className:"h-[1.875rem] w-[5.75rem] flex items-center justify-center rounded-[0.3125rem]",textClassName:"text-normal text-sm",onClick:()=>{window.open(`${b.Ay.editorUrl}/${t.id}`,"_blank","noopener,noreferrer")},children:"Editor"}):null,(0,o.jsx)(r.S,{className:"h-[1.875rem] flex items-center justify-center rounded-[0.3125rem] "+(t.createBy.id===(null===c||void 0===c?void 0:c.id)?"w-[5.75rem]":"w-full"),textClassName:"text-normal text-sm",onClick:()=>B(!0),children:"Preview"})]})]}):(0,o.jsxs)("div",{className:"flex flex-col items-center gap-[1.875rem]",children:[(0,o.jsx)("img",{alt:"...",src:u.A,className:"w-16 h-16"}),(0,o.jsx)(r.S,{className:"h-[1.875rem] px-[0.9375rem] flex items-center rounded",textClassName:"capitalize text-sm",onClick:n,children:"create widget"})]})}),(0,o.jsx)(g.V,{open:D,title:"Update Widget",okText:"Submit",cancelText:"Cancel",busy:C,onOk:L,onClose:()=>F(!1),onCancel:()=>F(!1),children:(0,o.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-[0.3125rem]",children:[(0,o.jsx)("span",{className:"text-normal text-sm",children:"Widget Name"}),(0,o.jsx)(j.g,{placeholder:O,onChange:J})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-[0.3125rem]",children:[(0,o.jsx)("span",{className:"text-normal text-sm",children:"Remark"}),(0,o.jsx)(R,{options:(I().sortBy(a,["name"])||[]).map((e=>({value:(0,l.kR)(e.name.replace(/-/g," ")),label:(0,o.jsxs)("div",{className:"flex items-center gap-small py-middle",children:[(0,o.jsx)("img",{alt:"...",src:(0,N.o)(e.id),className:"w-5 h-5"}),(0,o.jsx)("span",{className:"capitalize text-normal text-sm",children:e.name.replace(/-/g," ")})]})}))),defaultValue:z,value:z,onInputChange:A,popupHeightMax:300})]})]})}),!!t&&(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(E,{title:`Share "${t.name}" publicly`,isOpen:H,widgetId:t.id,visitorId:t.visitorId,onClose:()=>{V(!1),i()}})}),(0,o.jsx)(g.V,{open:$,width:420,footer:!1,title:"Notice",onClose:()=>M(!1),children:(0,o.jsxs)("div",{className:"flex flex-col gap-large",children:[(0,o.jsxs)("span",{className:"text-normal text-sm",children:["You are going to delete widget ",(0,o.jsx)("span",{className:"text-semibold",children:null===t||void 0===t?void 0:t.name}),", this operation can not be reverted, are you sure?"]}),(0,o.jsxs)("div",{className:"flex items-center gap-middle",children:[(0,o.jsx)(r.S,{className:"rounded px-middle h-8 flex items-center",textClassName:"text-normal text-sm",onClick:U,variant:"contained",loading:S,children:"Confirm"}),(0,o.jsx)(r.S,{className:"rounded px-middle h-8 flex items-center",textClassName:"text-normal text-sm",onClick:()=>M(!1),children:"Cancel"})]})]})}),(null===t||void 0===t?void 0:t.payload)&&(0,o.jsx)(m.Y,{payload:t.payload,open:T,onClose:()=>B(!1)})]})};var T=a(99197),B=a(78869),H=a(59504),V=a(73216);const W={kind:"Application",spec:{components:[]},version:"custom/v1",metadata:{name:"appName"}},Y=()=>
1{const e=(0,V.Zp)(),{userInfo:t,anchorRescroll:a}=(0,y.nm)(),[r,n]=(0,s.useState)(!1),[i,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),[u,x]=(0,s.useState)(""),[p,f]=(0,s.useState)([]),[h,v]=(0,s.useState)([]),[b,k]=((0,s.useMemo)((()=>{var e;return((null===(e=((null===t||void 0===t?void 0:t.organizations)||[])[0])||void 0===e?void 0:e.networks)||[]).sort(((e,t)=>e.name>t.name?1:e.name<t.name?-1:0))}),[null===t||void 0===t?void 0:t.organizations]),(0,s.useState)("")),S=(0,s.useCallback)((()=>null!==t&&void 0!==t&&t.id?(c(!0),(0,B.H)((0,w.iJ)({payload:!0})).subscribe({next:e=>{let{status:s,data:r}=e;if(200===s&&0===r.code&&r.data){const e=r.data;f(e.sort(((e,a)=>e.created_by.id===t.id&&a.created_by.id!==t.id?-1:e.created_by.id!==t.id&&a.created_by.id===t.id?1:a.updated_at-e.updated_at))),a()}c(!1)},error:e=>{c(!1),console.error(e)}})):H.w.subscribe()),[null===t||void 0===t?void 0:t.id,a]);(0,s.useEffect)((()=>{const e=S();return()=>e.unsubscribe()}),[S]);const _=(0,s.useCallback)((()=>(0,B.H)((0,w.Cz)({})).subscribe({next:e=>{let{status:t,data:a}=e;if(200===t&&0===a.code&&a.data){const e=a.data;v(e)}},error:e=>{console.error(e)}})),[]);(0,s.useEffect)((()=>{const e=_();return()=>e.unsubscribe()}),[_]);const O=(0,s.useCallback)((async()=>{var e;if(b&&u&&null!==t&&void 0!==t&&null!==(e=t.organizations)&&void 0!==e&&e.length)try{n(!0);const e=await(0,w.v)({name:u,remark:b,payload:JSON.stringify(W)});200===e.status&&0===e.data.code&&S()}catch(a){console.error(a)}finally{n(!1),m(!1)}}),[b,u,null===t||void 0===t?void 0:t.organizations,S]),P=(0,s.useCallback)((e=>{x(e.target.value)}),[]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"mb-5",children:(0,o.jsx)("h5",{className:"text-semibold text-sm",children:"Widgets"})}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-5 p-5 bg-white rounded relative",style:{border:"1px solid #F2F4FA",boxShadow:"0px 2px 10px rgba(0, 0, 0, 0.05)"},children:[i&&(0,o.jsx)("div",{className:"absolute top-0 bottom-0 left-0 right-0 m-auto flex items-center justify-center z-10 bg-black-800/10 rounded",children:(0,o.jsx)(T.g,{})}),(0,o.jsx)(M,{data:null,networks:h,onCreate:()=>{null!==t&&void 0!==t&&t.email?m(!0):(C.E.warn({description:"You need to setup an email"}),e("/setting"))}}),p.map(((e,t)=>{var a;return(0,o.jsx)(M,{networks:h,data:{id:e.id,name:e.name,updatedAt:e.updated_at,appliedCount:e.applied_count,network:{id:"",name:e.remark},remark:e.remark,createBy:{id:e.created_by.id,email:e.created_by.email},payload:e.payload,organization:e.organization,visitorId:null===(a=e.visitor)||void 0===a?void 0:a.id},onRefresh:S},t)}))]})]}),(0,o.jsx)(g.V,{open:d,title:"Create Widget",okText:"Submit",cancelText:"Cancel",busy:r,onOk:O,onClose:()=>m(!1),onCancel:()=>m(!1),children:(0,o.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-[0.3125rem]",children:[(0,o.jsx)("span",{className:"text-normal text-sm",children:"Widget Name"}),(0,o.jsx)(j.g,{placeholder:"EVM Transactions",onChange:P})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-[0.3125rem]",children:[(0,o.jsx)("span",{className:"text-normal text-sm",children:"Remark"}),(0,o.jsx)(R,{options:(I().sortBy(h,["name"])||[]).map((e=>({value:(0,l.kR)(e.name.replace(/-/g," ")),label:(0,o.jsxs)("div",{className:"flex items-center gap-small py-middle",children:[(0,o.jsx)("img",{alt:"...",src:(0,N.o)(e.id),className:"w-5 h-5"}),(0,o.jsx)("span",{className:"capitalize text-normal text-sm",children:e.name.replace(/-/g," ")})]})}))),defaultValue:b,value:b,onInputChange:k,popupHeightMax:300})]})]})})]})};var L=a(54868);const U=()=>{const{anchorRescroll:e}
1=(0,y.nm)(),[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(0),[i,c]=(0,s.useState)(1),[d,m]=(0,s.useState)([]),u=(0,s.useMemo)((()=>d.sort(((e,t)=>e.is_last_applied===t.is_last_applied?0:e.is_last_applied?-1:t.is_last_applied?1:0))),[d]),x=(0,s.useCallback)((()=>(a(!0),(0,B.H)((0,w.Dk)({page:i-1,row:10,payload:!0})).subscribe({next:t=>{let{status:s,data:r}=t;200===s&&0===r.code&&r.data?(m(r.data),n((e=>e||Math.ceil(r.total/10)))):(n(0),m([])),e(),a(!1)},error:e=>{a(!1),console.error(e)}}))),[i,e]);(0,s.useEffect)((()=>{const e=x();return()=>{e.unsubscribe()}}),[x]);const p=[{title:"Publish ID",dataKey:"id",render:e=>(0,o.jsxs)("span",{className:"text-normal text-sm uppercase",children:[e.id,e.is_last_applied?` (${e.network.name} - Prod)`:""]})},{title:"Time",render:e=>(0,o.jsx)("span",{className:"text-normal text-sm",children:(0,l.fU)(1e3*e.created_at)})},{title:"Type",render:e=>(0,o.jsx)("span",{className:"text-normal text-sm capitalize",children:e.type.replace(/_/g," ")})},{title:"Status",render:e=>(0,o.jsx)("span",{className:"text-normal text-sm capitalize",children:e.status.replace(/_/g," ")})},{title:"Operation",render:e=>(0,o.jsx)(J,{data:e,onRefresh:x})}];return u.length?(0,o.jsxs)("div",{className:"",id:"publish_history",children:[(0,o.jsx)("div",{className:"mb-5",children:(0,o.jsx)("h5",{className:"text-semibold text-sm",children:"History"})}),(0,o.jsx)(L._,{loading:t,columns:p,dataSource:u,currentPage:i,totalPages:r,onPageChange:c})]}):null},J=e=>{let{data:t,onRefresh:a=()=>{}}=e;const n=(0,V.Zp)(),{pathname:l}=(0,V.zy)(),[i,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),{updatePublishEditData:u}=(0,y.QD)(),{userInfo:x}=(0,y.nm)(),p=(0,s.useMemo)((()=>{var e;return null!==x&&void 0!==x&&null!==(e=x.organizations)&&void 0!==e&&e.length?x.organizations[0]:null}),[null===x||void 0===x?void 0:x.organizations]),f=(0,s.useCallback)((async()=>{try{c(!0);const e=await(0,w.zJ)({id:t.id});c(!1),200===e.status&&0===e.data.code&&a()}catch(e){c(!1),console.error(e)}}),[t.id,a]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"flex items-center gap-[0.625rem]",children:[(0,o.jsx)(r.S,{className:"capitalize rounded h-[1.5625rem] px-[0.625rem]",textClassName:"text-normal text-sm",onClick:()=>{n(`${l}/history`,{state:{data:t}})},children:"detail"}),"admin"===(null===p||void 0===p?void 0:p.role)&&(0,o.jsx)(r.S,{className:"capitalize rounded h-[1.5625rem] px-[0.625rem]",textClassName:"text-normal text-sm",onClick:()=>{u([{network:t.network,pages:t.pages.map((e=>({...e,widgets:e.widgets.map((e=>({id:e.id,name:e.name,isActive:!0,isFixed:e.is_fixed})))})))}]),"draft"===t.status||"unapproved"===t.status?n(`${l}/publish`,{state:{publishId:t.id}}):n(`${l}/publish`)},children:"edit"}),"draft"===t.status||"under_review"===t.status?(0,o.jsx)(r.S,{className:"capitalize rounded h-[1.5625rem] px-[0.625rem]",textClassName:"text-normal text-sm",loading:i,onClick:()=>m(!0),children:"delete"}):null]}),(0,o.jsx)(g.V,{open:d,width:420,footer:!1,title:"Notice",onClose:()=>m(!1),children:(0,o.jsxs)("div",{className:"flex flex-col gap-large",children:[(0,o.jsxs)("span",{className:"text-normal text-sm",children:["You are going to delete ",(0,o.jsxs)("span",{className:"text-semibold",children:["#",null===t||void 0===t?void 0:t.id]})," Publish, this operation can not be reverted, are you sure?"]}),(0,o.jsxs)("div",{className:"flex items-center gap-middle",children:[(0,o.jsx)(r.S,{className:"rounded px-middle h-8 flex items-center",textClassName:"text-normal text-sm",onClick:()=>{m(!1),f()},variant:"contained",children:"Confirm"}),(0,o.jsx)(r.S,{className:"rounded px-middle h-8 flex items-center",textClassName:"text-normal text-sm",onClick:()=>m(!1),children:"Cancel"})]})]})})]})};var K=a(34388);const Z=()=>{const e=(0,V.Zp)(),{pathname:t}=(0,V.zy)(),{userInfo:a}=(0,y.nm)(),{updatePublishEditData:n}=(0,y.QD)(),{isMobile:l}=(0,K.A)(),i=(0,s.useMemo)((()=>{var e;return null!==a&&void 0!==a&&null!==(e=a.authority)&&void 0!==e&&e.length?a.authority:[]}),[null===a||void 0===a?void 0:a.authority]),d=(0,s.useMemo)((()=>{var e;return null!==a&&void 0!==a&&null!==(e=a.organizations)&&void 0!==e&&e.length?a.organizations[0]:null}),[null===a||void 0===a?void 0:a.organizations]);return l?(0,o.jsx)("div",{className:"md:hidden p-large",children:(0,o.jsx)("span",{className:"text-semibold text-lg",children:"For a better experience, please visit via PC."})}):i.some((e=>"widgets"===e))&&d?(0,o.jsxs)("div",{className:"flex flex-col gap-5 w-full",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-normal text-sm",children:`${d.limit.used_applied_widget_count}/${d.limit.max_applied_widget_limit} Customized Widgets Applied`}),"admin"===d.role&&(0,o.jsxs)("div",{className:"flex items-center gap-[0.625rem]",children:[(0,o.jsx)(r.S,{variant:"contained",className:"h-9 rounded px-[0.625rem] flex items-center",textClassName:"text-normal text-sm capitalize",onClick:()=>{n([]),e("/widgets/publish")},children:"Publish Page"}),(0,o.jsx)(r.S,{variant:"contained",className:"h-9 rounded px-[0.625rem] flex items-center",textClassName:"text-normal text-sm capitalize",onClick:()=>{e(`${t}/update_widget_changes`)},children:"Update Widget Changes"})]})]}),(0,o.jsx)(Y,{}),(0,o.jsx)(U,{})]}):a?(0,o.jsx)("div",{className:"w-full h-full flex justify-center items-center",children:(0,o.jsx)(c,{email:a.email,publishKey:a.public_key,permission:!0})}):null}},2099:(e,t,a)=>{function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}
1Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var r=i(a(65043)),n=i(a(75270)),l=["text","onCopy","options","children"];function i(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,s)}return a}function c(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?o(Object(a),!0).forEach((function(t){h(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):o(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function d(e,t){if(null==e)return{};var a,s,r=function(e,t){if(null==e)return{};var a,s,r={},n=Object.keys(e);for(s=0;s<n.length;s++)a=n[s],t.indexOf(a)>=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;s<n.length;s++)a=n[s],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function m(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function x(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=f(e);if(t){var n=f(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return function(e,t){if(t&&("object"===s(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}(this,a)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function h(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var v=function(e){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(o,e);var t,a,s,i=x(o);function o(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);for(var t=arguments.length,a=new Array(t),s=0;s<t;s++)a[s]=arguments[s];return h(p(e=i.call.apply(i,[this].concat(a))),"onClick",(function(t){var a=e.props,s=a.text,l=a.onCopy,i=a.children,o=a.options,c=r.default.Children.only(i),d=(0,n.default)(s,o);l&&l(s,d),c&&c.props&&"function"===typeof c.props.onClick&&c.props.onClick(t)})),e}return t=o,(a=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),a=d(e,l),s=r.default.Children.only(t);return r.default.cloneElement(s,c(c({},a),{},{onClick:this.onClick}))}}])&&m(t.prototype,a),s&&m(t,s),Object.defineProperty(t,"prototype",{writable:!1}),o}(r.default.PureComponent);t.CopyToClipboard=v,h(v,"defaultProps",{onCopy:void 0,options:void 0})},61476:(e,t,a)=>{var s=a(2099).CopyToClipboard;s.CopyToClipboard=s,e.exports=s}}]);
2//# sourceMappingURL=995.d3316e8f.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.