@blocklet/pages-kit-inner-components 0.4.116 → 0.4.118

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.
Files changed (41) hide show
  1. package/lib/cjs/add-component.js +8 -8
  2. package/lib/cjs/chunks/array-CeBRUkLo.js +441 -0
  3. package/lib/cjs/chunks/{config-color-C8L0QSPJ.js → config-color-C8kj-s2C.js} +1 -1
  4. package/lib/cjs/chunks/{draft-data-DPTVTTlh.js → draft-data-CRdesc3Z.js} +1 -1
  5. package/lib/cjs/chunks/home-DpGYsQ1r.js +38 -0
  6. package/lib/cjs/chunks/publish-button-DXSPVfAC.js +1 -0
  7. package/lib/cjs/chunks/site-state-BMf96RZL.js +57 -0
  8. package/lib/cjs/chunks/state-oc52fQ0j.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/locales.js +1 -1
  12. package/lib/cjs/project-html.js +1 -1
  13. package/lib/cjs/resources.js +1 -1
  14. package/lib/cjs/setting.js +1 -1
  15. package/lib/cjs/site-state.js +1 -1
  16. package/lib/es/add-component.js +125 -120
  17. package/lib/es/chunks/array-k2vnX696.js +1966 -0
  18. package/lib/es/chunks/{config-color-JrBPRsTv.js → config-color-CXt_ZsC_.js} +1 -1
  19. package/lib/es/chunks/{draft-data-BFlmvWXx.js → draft-data-BwyMBf8Y.js} +1 -1
  20. package/lib/es/chunks/home-DAvVGR8Z.js +505 -0
  21. package/lib/es/chunks/publish-button-CxrZAPBF.js +295 -0
  22. package/lib/es/chunks/site-state-kjir-UCL.js +1718 -0
  23. package/lib/es/chunks/state-Dz3GnGWC.js +437 -0
  24. package/lib/es/components.js +1 -1
  25. package/lib/es/home.js +10 -8
  26. package/lib/es/locales.js +81 -17
  27. package/lib/es/project-html.js +1 -1
  28. package/lib/es/resources.js +1 -1
  29. package/lib/es/setting.js +2 -2
  30. package/lib/es/site-state.js +13 -12
  31. package/package.json +9 -9
  32. package/lib/cjs/chunks/array-BwGaBJVb.js +0 -513
  33. package/lib/cjs/chunks/home-CXupaCeO.js +0 -38
  34. package/lib/cjs/chunks/publish-button-TrJpN62K.js +0 -1
  35. package/lib/cjs/chunks/site-state-D15mduKB.js +0 -57
  36. package/lib/cjs/chunks/state-DDwYX2mu.js +0 -1
  37. package/lib/es/chunks/array-Chju-apt.js +0 -2142
  38. package/lib/es/chunks/home-47HCvpbj.js +0 -475
  39. package/lib/es/chunks/publish-button-DhT2I-bw.js +0 -282
  40. package/lib/es/chunks/site-state-DJ_KkVbi.js +0 -1548
  41. package/lib/es/chunks/state-BgKqNapt.js +0 -425
@@ -1,513 +0,0 @@
1
- "use strict";var Bt=Object.create;var nt=Object.defineProperty;var Ct=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var It=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty;var Rt=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Nt(e))!Pt.call(t,r)&&r!==n&&nt(t,r,{get:()=>e[r],enumerable:!(i=Ct(e,r))||i.enumerable});return t};var rt=(t,e,n)=>(n=t!=null?Bt(It(t)):{},Rt(e||!t||!t.__esModule?nt(n,"default",{value:t,enumerable:!0}):n,t));const o=require("react/jsx-runtime");require("@mui/icons-material");const m=require("@mui/material"),f=require("react"),Tt=require("lodash/keyBy"),j=require("./state-DDwYX2mu.js"),U=require("@blocklet/ai-runtime/components"),Wt=require("@mui/utils"),zt=require("lodash/pick"),qt=require("react-error-boundary"),xt=require("@blocklet/pages-kit/contexts/color"),b=require("@emotion/css"),V=require("@iconify/react"),Et=require("react-markdown"),Lt=require("remark-gfm"),At=require("@mui/lab"),_=require("@arcblock/ux/lib/Theme"),Ot=require("@arcblock/react-hooks/lib/useBrowser"),Ut=require("@arcblock/ux/lib/Colors"),G=require("@blocklet/pages-kit/components"),it=require("@blocklet/pages-kit/utils/style"),Ft=require("@mui/material/useMediaQuery"),Mt=require("lodash/omit"),ht=require("@iconify-icon/react"),Dt=require("@arcblock/ux/lib/Screenshot"),K=require("react-router-dom"),Vt=require("@arcblock/ux/lib/Button"),Ht=require("is-uri"),F=require("pathe"),T=require("ufo"),Yt=require("@blocklet/embed/message"),Jt=require("ahooks"),Gt=require("lodash/isEqual"),Kt=require("@blocklet/embed/react"),Xt=require("react-twitter-embed"),st=require("react-use"),$=t=>t&&t.__esModule?t:{default:t},ft=$(f),D=$(Tt),X=$(zt),Qt=$(Et),Zt=$(Lt),te=$(Ot),at=$(Ut),gt=$(Ft),C=$(Mt),ee=$(Dt),oe=$(Vt),H=$(Ht),ne=$(Gt),yt="{{CUSTOM_VALUE}}",re=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{py:{xs:7.5,md:10,lg:12.5,xl:15}}}],ie=[{title:"None",value:"none",sx:{py:0}},{title:"Small",value:"small",sx:{py:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{py:{xs:5,md:7,lg:7,xl:9}}},{title:"Large",value:"large",sx:{py:{xs:6,md:9,lg:9,xl:11}}}],se=[{title:"None",value:"none",sx:{px:0}},{title:"Small",value:"small",sx:{px:{xs:2.5,md:4,lg:4,xl:6}}},{title:"Normal",value:"normal",sx:{px:{xs:5,md:7.5,lg:10,xl:12.5}}},{title:"Large",value:"large",sx:{px:{xs:7.5,md:10,lg:12.5,xl:15}}}],M=(t,e,n)=>{const i=t.breakpoints.values[n];return`${e}${i?` (${i}px)`:""}`},ae=[{title:"100%",value:"full",sx:{maxWidth:"100%"}},{title:t=>M(t,"Small","sm"),value:"sm",sx:{maxWidth:t=>t.breakpoints.values.sm,width:"100%",mx:"auto"}},{title:t=>M(t,"Normal","md"),value:"md",sx:{maxWidth:t=>t.breakpoints.values.md,width:"100%",mx:"auto"}},{title:t=>M(t,"Large","lg"),value:"lg",sx:{maxWidth:t=>t.breakpoints.values.lg,width:"100%",mx:"auto"}},{title:t=>M(t,"Extra Large","xl"),value:"xl",sx:{maxWidth:t=>t.breakpoints.values.xl,width:"100%",mx:"auto"}},{title:"Custom",value:"custom",sx:{maxWidth:yt,width:"100%",mx:"auto"}}],le=D.default(re,"value"),ce=D.default(ie,"value"),de=D.default(se,"value"),ue=D.default(ae,"value"),me=new Map([["baseSectionPaddingY",le],["maxWidth",ue],["paddingY",ce],["paddingX",de]]);function bt(t){var l;const{type:e,value:n,format:i="sx",defaultValue:r=null}=t,s=me.get(e);if(!s)return r;const c=n.startsWith("custom:"),a=c?"custom":n;if(s!=null&&s[a]&&((l=s==null?void 0:s[a])!=null&&l[i])){const d=s[a][i];if(c){const u=n.replace("custom:","");try{return JSON.parse(JSON.stringify(d||{}).replaceAll(yt,u))}catch{}}return d}return r}const wt=f.createContext({page:null,getPageMeta:()=>({}),getPageMetaStyle:()=>({})});function pe(){return f.useContext(wt)}function xe({page:t,children:e,defaultLocale:n="en",currentLocale:i}){const r=f.useMemo(()=>t?JSON.parse(JSON.stringify(t)):null,[JSON.stringify(t)]),s=f.useCallback(()=>{var d;if(!r)return{};const l=i||n;return((d=r.locales)==null?void 0:d[l])??{}},[r,n,i]),c=f.useCallback((l="sx")=>{const d=s();return!d||!d.style?{}:Object.entries(d.style||{}).reduce((p,[h,x])=>{if(!x)return p;const y=`${h}Custom`;d.style[y];const w=bt({type:h,value:x,format:l});return w?{...p,...w}:p},{})},[s]),a=f.useMemo(()=>({page:r,getPageMeta:s,getPageMetaStyle:c}),[r,s,c]);return o.jsx(wt.Provider,{value:a,children:e})}const he=f.forwardRef(({onClick:t,...e},n)=>{const[i,r]=f.useState(!1),s=f.useCallback(async c=>{try{r(!0),await(t==null?void 0:t(c))}finally{r(!1)}},[t]);return o.jsx(At.LoadingButton,{ref:n,...e,loading:e.loading||i,onClick:s})});function fe({tip:t,tipSucceed:e,title:n,titleSucceed:i,icon:r,iconSucceed:s,autoReset:c,placement:a="top",...l}){const[d,u]=f.useState(!1),[p,h]=f.useState(),x=f.useRef(),y=()=>{h(void 0),c&&(x.current=window.setTimeout(()=>{u(!1)},3e3))},w=()=>{clearTimeout(x.current)},g=d?s:r,k=p?o.jsx(m.Box,{color:"error",children:p.message}):d&&e||t,v=d?i:n;return o.jsx(m.Tooltip,{title:k,disableInteractive:!0,placement:a,onClose:y,onOpen:w,children:o.jsx("span",{children:o.jsx(he,{startIcon:g&&(typeof g=="string"?o.jsx(V.Icon,{icon:g}):g),loadingPosition:g?"start":void 0,...l,onClick:async B=>{if(l.onClick)try{await l.onClick(B),u(!0)}catch(N){h(N)}},children:v})})})}const ge=ft.default.lazy(()=>import("react-syntax-highlighter").then(t=>({default:t.Prism}))),ye=m.styled(t=>o.jsx(Qt.default,{...t,remarkPlugins:[Zt.default],components:{pre:be,code:({node:e,inline:n,className:i,children:r,...s})=>{if(!r)return null;const c=/language-(\w+)/.exec(i||"");return n?o.jsx(m.Box,{component:"code",className:i,...s,children:r}):o.jsx(m.Box,{component:ge,language:c==null?void 0:c[1],...s,sx:{borderRadius:1},children:String(r).replace(/\n$/,"")})},table:({className:e,children:n})=>o.jsx(m.Box,{sx:{overflow:"auto",my:1},children:o.jsx("table",{className:e,children:n})})}}))`
2
- width: 100%;
3
- overflow: hidden;
4
- word-break: break-word;
5
-
6
- > * {
7
- &:first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
8
- margin-top: 0;
9
- }
10
- &:last-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
11
- margin-bottom: 0;
12
- }
13
- }
14
-
15
- pre {
16
- overflow: auto;
17
- }
18
-
19
- li {
20
- margin: 0;
21
- padding: 0;
22
- }
23
-
24
- li p {
25
- display: inline-block;
26
- vertical-align: top;
27
- margin: 0;
28
- padding: 0;
29
- }
30
-
31
- table {
32
- border-collapse: collapse;
33
- white-space: nowrap;
34
-
35
- th,
36
- td {
37
- border: 1px solid grey;
38
- padding: 4px 8px;
39
- }
40
- }
41
-
42
- a {
43
- color: ${({theme:t})=>t.palette.primary.main};
44
-
45
- :hover {
46
- text-decoration: underline;
47
- }
48
- }
49
-
50
- &.writing > *:last-child {
51
- &:after {
52
- content: '';
53
- display: inline-block;
54
- vertical-align: middle;
55
- height: 1.2em;
56
- margin-top: -0.2em;
57
- margin-left: 0.1em;
58
- border-right: 0.2em solid orange;
59
- border-radius: 10px;
60
- animation: blink-caret 0.75s step-end infinite;
61
-
62
- @keyframes blink-caret {
63
- from,
64
- to {
65
- border-color: transparent;
66
- }
67
- 50% {
68
- border-color: ${({theme:t})=>t.palette.secondary.main};
69
- }
70
- }
71
- }
72
- }
73
- `;function be({children:t}){const e=t==null?void 0:t.props;if(!(e!=null&&e.children))return null;const n=/language-(\w+)/.exec(e.className||""),i=n==null?void 0:n[1];return o.jsxs(m.Box,{component:"div",sx:{fontSize:14,borderRadius:1,bgcolor:"rgb(245, 242, 240)","> pre":{mt:"0 !important"}},children:[o.jsxs(m.Stack,{direction:"row",alignItems:"center",p:.5,pl:1.5,borderBottom:1,borderColor:"grey.200",children:[o.jsx(m.Box,{children:i}),o.jsx(m.Box,{flex:1}),o.jsx(fe,{autoReset:!0,title:o.jsx(V.Icon,{icon:"tabler:copy"}),titleSucceed:o.jsx(V.Icon,{icon:"tabler:copy-check"}),sx:{minWidth:32,minHeight:32,p:0,fontSize:18},onClick:()=>{window.navigator.clipboard.writeText(e.children)}})]}),t]})}function R({actions:t,center:e,className:n,align:i}){return t&&(t!=null&&t.length)?o.jsx(m.Box,{className:b.cx("flex gap-4 flex-wrap","lg:flex-row lg:gap-8",(e||i==="center")&&"justify-center",!e&&i==="right"&&"justify-end",!e&&i==="left"&&"justify-start",n),sx:{alignItems:"center"},children:t}):null}const we="section",je=m.styled(m.Box)`
74
- overflow: hidden;
75
-
76
- .section__title {
77
- margin-top: 0;
78
- font-weight: 700;
79
- }
80
- .section__title_non_big {
81
- font-size: 32px;
82
- @media (max-width: 600px) {
83
- font-size: 24px;
84
- }
85
- }
86
- &.base-info .section__tag {
87
- margin-top: 0;
88
- margin-bottom: 2vw;
89
- background-color: ${({theme:t})=>t.palette.primary.main};
90
- white-space: nowrap;
91
- max-width: 100%;
92
- display: inline-block;
93
- padding: 0 10px;
94
- justify-content: flex-start;
95
- overflow: hidden;
96
- text-overflow: ellipsis;
97
- font-size: 12px;
98
- color: #fff;
99
- border-radius: 4px;
100
- line-height: 20px;
101
- }
102
- .section__title {
103
- color: ${({theme:t})=>t.palette.text.primary};
104
- a {
105
- color: ${({theme:t})=>t.palette.primary.main};
106
- }
107
- p {
108
- margin-top: 0;
109
- margin-bottom: 0;
110
- }
111
- }
112
- .section__description {
113
- color: ${({theme:t})=>t.palette.text.primary};
114
- margin-bottom: 4vw;
115
- margin-top: 0;
116
- a {
117
- color: ${({theme:t})=>t.palette.primary.main};
118
- }
119
- p {
120
- margin-top: 0;
121
- margin-bottom: 0.5rem;
122
- }
123
- }
124
- @media (min-width: ${({theme:t})=>t.breakpoints.values[we]}px) {
125
- .section__tag {
126
- margin-bottom: 32px;
127
- }
128
- .section__title {
129
- margin-bottom: 32px;
130
- }
131
- .section__description {
132
- margin-bottom: 40px;
133
- }
134
- }
135
- `;function z({title:t,description:e,descriptionMarkdown:n,actions:i,className:r="",classes:s={},prepend:c,append:a,level:l=2,tag:d,badge:u,center:p,logo:h,titleAppearance:x,descriptionAppearance:y,...w}){const g=xt.useColorConvert();if(!t&&!e&&!i&&!u&&!d&&!c&&!a&&!h)return null;const k=Math.max(Math.min(5,l+1),1),v={1:"xl:!text-3xl lg:!text-2xl md:!text-xl",2:"xl:!text-2xl lg:!text-xl md:!text-lg",3:"xl:!text-2xl lg:!text-xl md:!text-lg",4:"xl:!text-xl lg:!text-lg md:!text-md",5:"xl:!text-lg md:!text-md sm:!text-sm",6:"!text-sm"},B=l===0?"big":`h${k}`,N=l===0;return o.jsxs(je,{className:b.cx("base-info","lg:text-left",p&&"!text-center",r),...w,children:[c&&o.jsx("div",{children:c}),(d||u)&&o.jsx("div",{className:b.cx("section__tag",(s==null?void 0:s.tag)||(s==null?void 0:s.badge)),children:d||u}),h&&o.jsx("img",{className:"w-[120px] m-auto mb-8",src:h,alt:"info",loading:"lazy"}),t&&o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",mb:e?"2vw":0,...(x==null?void 0:x.color)&&{color:`${g(x.color)} !important`}},className:b.cx("section__title","text-gray-800","dark:text-gray-50",s.title,"page-kit-section__title",N?"":"section__title_non_big"),component:`h${Math.max(l,1)}`,variant:B,children:t}),e&&(n?o.jsx(m.Box,{sx:{...(y==null?void 0:y.color)&&{color:`${g(y.color)} !important`}},component:ye,className:b.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),children:e}):o.jsx(m.Typography,{sx:{whiteSpace:"pre-wrap",...(y==null?void 0:y.color)&&{color:`${g(y.color)} !important`}},className:b.cx("section__description","text-gray-800","dark:text-gray-100",v[k],s.description,"page-kit-section__description"),component:"div",variant:"body1",gutterBottom:!0,children:e})),o.jsx(R,{actions:i,center:p,className:"mt-8"}),a&&o.jsx("div",{children:a})]})}const q=["actions","append","badge","tag","center","description","descriptionMarkdown","level","logo","prepend","title","titleAppearance","descriptionAppearance"];function jt(t){if(t.type===f.Fragment){const n=(t.props.children||[]).filter(i=>f.isValidElement(i));return n.length===1?jt(n[0]):n.length>1}return Array.isArray(t)}const I="&>*";function Q({children:t,col:e,gap:n,className:i,align:r,sx:s,type:c,...a}={children:null,className:"",col:3,gap:void 0,sx:{},align:"center",type:"default"}){const l=_.useTheme(),d=Number(Math.floor(100/e*100)/100),u={center:"justify-center items-center",left:"justify-start items-center",right:"justify-end items-center",top:"justify-center items-start",bottom:"justify-center items-end","top-left":"justify-start items-start","top-right":"justify-end items-start","bottom-left":"justify-start items-end","bottom-right":"justify-end items-end"},p=u[r]||u.center;let x=n??({2:6,3:4,4:4,5:3,6:3}[e]||0);jt(t)||(x=0);const w=(e-1)*x/e;let g={...s,gap:`${x}rem`};const k={[I]:{width:"100%"}},v={},B={},N={};switch(k.gap="1rem",v.gap=`${x/2}rem`,e){case 3:case 4:v[I]={width:`calc(50% - ${x/2}rem)`};break;case 5:case 6:k[I]={width:`calc(50% - ${x/2/2}rem)`},v[I]={width:`calc(50% - ${x/2/2}rem)`},B[I]={width:`calc(33.33% - ${x*2/3}rem)`};break}return g[I]={width:`calc(${d}% - ${w}rem)`},g[`@media (max-width: ${l.breakpoints.values.xl}px)`]=N,g[`@media (max-width: ${l.breakpoints.values.lg}px)`]=B,g[`@media (max-width: ${l.breakpoints.values.md}px)`]=v,g[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k,c==="wall"&&(g={...s,gap:`${x}rem`},g[I]={width:`calc(${d}% - ${w}rem)`},k[I]={width:`calc(45% - ${x/2/2}rem)`},g[`@media (max-width: ${l.breakpoints.values.sm}px)`]=k),o.jsx(m.Box,{className:b.cx("flex flex-wrap flex-row h-full",p,i),sx:g,...a,children:t})}function ve(){const t=navigator.userAgent.toLowerCase();return t.includes("safari")&&!t.includes("chrome")}function ke(t=""){if(t.startsWith("data:image/svg+xml,"))return!0;const e=/^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/,n=/^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;return e.test(t)||n.test(t)}function Y(t){return(t==null?void 0:t.endsWith(".mp4"))||(t==null?void 0:t.endsWith(".m4v"))||(t==null?void 0:t.endsWith(".webm"))}function _e(t){return t!=null&&t.endsWith(".mp4")||t!=null&&t.endsWith(".m4v")?"video/mp4":t!=null&&t.endsWith(".webm")?"video/webm":void 0}function $e(t){let e={};return typeof t=="string"?it.isGradient(t)?e.image=t:(e.image=j.getImageAbsoluteUrl(t),it.isColorString(t)&&(e.color=t,e.image="")):e=t,e}function Se(){const[t,e]=f.useState(Date.now());return f.useEffect(()=>{const n=()=>{e(Date.now())};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[]),t}function lt(t,e,n,i,r){let s=null;const{color:c="",image:a}=$e(e);return a&&ke(a)?(delete n.backgroundColor,!(t.mobile.apple.device||ve())&&Y(a)?s=o.jsx(m.Box,{component:"video",className:"section-bg",width:"100%",autoPlay:!0,loop:!0,muted:!0,controls:!1,playsInline:!0,poster:j.autoResizeImage(j.getImageAbsoluteUrl(i),1200,"quality"),src:Y(a)?a:j.autoResizeImage(a,1200,"quality"),sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},a):s=o.jsx(G.ResponsiveImage,{src:a,sizesAttr:{sm:600,md:900,lg:1200},className:"section-bg",alt:"",width:"100%",loading:"lazy",sx:{position:"absolute",zIndex:-9999,right:0,left:0,top:0,width:"100%",height:"100%",objectFit:"cover"}},r||a)):a?n.backgroundImage=`${a} !important`:c&&(n.backgroundColor=`${c} !important`),s}function Be({autoWidth:t,children:e,...n}){return t?o.jsx(m.Box,{display:"flex",...n,children:e}):o.jsx(m.Container,{...n,children:e})}function E({dark:t=!1,children:e,className:n,sx:i={},boxed:r={show:!1},padding:s="normal",boxProps:c,type:a,...l}){const d={...i},u=gt.default(x=>x.breakpoints.down("md"));t&&(d.color=at.default.common.white,d.backgroundColor=`${at.default.grey[900]} !important`),r.show&&(d.display="flex");const p=f.useMemo(()=>!Number(l.boxMaxWidth)||u?{width:"100%"}:a==="wall"&&l.boxMaxWidth?{maxWidth:`${l.boxMaxWidth}px !important`,width:"100%"}:{width:"100%"},[l.boxMaxWidth,u,a]),h=bt({type:"baseSectionPaddingY",value:s||"normal",defaultValue:""});return o.jsx(Ce,{component:"section",styles:{...d,...h},className:b.cx("base-section","px-2 md:px-5 lg:px-5 xl:px-10",n,{dark:t}),...C.default(l,"hoverStyle","boxMaxWidth","embedUrl","autoWidth","paddingXY","iframeHeight","titleAppearance","descriptionAppearance"),children:o.jsx(Be,{autoWidth:l==null?void 0:l.autoWidth,className:b.cx("section-content h-full"),sx:p,children:r.show?o.jsx(vt,{...c,boxed:r,children:e}):e})})}function vt({background:t="",backgroundVideoPoster:e,children:n,sx:i={},boxed:r={show:!1},className:s="",styles:c={},...a}){const l={...c,...i},d=xt.useColorConvert();let u=null;const p=gt.default(y=>y.breakpoints.up("sm")),h=te.default(),x=Se();return t&&(u=lt(h,typeof t=="string"?d(t):t,l,e,x)),r.show&&(l.borderRadius="10px",l.padding===void 0&&(l.padding=p?"50px":"20px"),r!=null&&r.border&&(l.border="1px solid #c0c0c0"),r!=null&&r.background&&(u=lt(h,typeof(r==null?void 0:r.background)=="string"?d(r==null?void 0:r.background):r==null?void 0:r.background,l,r==null?void 0:r.backgroundVideoPoster,x))),o.jsxs(m.Box,{...a,sx:{...l,...u?{position:"relative",overflow:"hidden",zIndex:0}:{}},className:b.cx(s,(r==null?void 0:r.boxShadow)&&"shadow-xl"),children:[u,n]})}const Ce=_.styled(vt)`
136
- &:nth-of-type(even) {
137
- background: #f8f8f8;
138
- }
139
-
140
- @media (max-width: 600px) {
141
- .section__title {
142
- font-size: 24px;
143
- }
144
-
145
- .base-info {
146
- > *:last-child {
147
- margin-bottom: 0;
148
- }
149
- }
150
- }
151
- `;function Z({icon:t,...e}){return o.jsx(ht.Icon,{icon:t,...e,ref:null})}function S(t,e){const n=X.default(t,e),i=C.default(t,e);return[n,i]}const kt=["title","description","actions","badge","tag","prepend","append","logo"];function Ne({image:t,imageBorder:e,imageShadow:n,className:i,reverse:r=!1,fullSizeImage:s,...c}){const[a,l]=S(c,q),d=Object.keys(a).length>0&&Object.values(X.default(a,kt)).filter(Boolean).length>0&&o.jsx(z,{...a}),u=f.isValidElement(t)?t:o.jsx(m.Box,{component:"img",src:t,alt:"",className:"block"}),p=["phone","macbook"].includes(e),h=t&&o.jsx(m.Box,{className:b.cx("section__image","m-auto, leading-[1] text-center",n&&"shadow-xl",a!=null&&a.center?"flex justify-center items-center":""),sx:{border:e===!0?"1px solid #c0c0c0":void 0,borderRadius:2,overflow:"hidden","> div":p?{width:"100%",video:{borderRadius:"0 !important"}}:void 0},children:p?o.jsx(ee.default,{type:e,sx:{width:"100%"},children:u}):u});return o.jsx(E,{className:b.cx("section--block",i,s&&!r&&b.css`
152
- .section-bg {
153
- height: 80%;
154
- }
155
- `),...l,boxProps:s?{sx:{padding:0,overflow:"hidden"}}:void 0,children:o.jsx(Q,{col:t?2:1,className:s?b.css`
156
- display: flex;
157
- flex-direction: column;
158
-
159
- > .base-info,
160
- > .section__image {
161
- width: 100%;
162
-
163
- > img,
164
- > video {
165
- width: 100%;
166
- }
167
- }
168
- `:void 0,children:r?o.jsxs(o.Fragment,{children:[h,d]}):o.jsxs(o.Fragment,{children:[d,h]})})})}const L=["editing","height","locale","dev","sx"];function Ie(t){const{className:e,...n}=t;return o.jsx(Pe,{...n,className:b.cx("BlockBase-root",e)})}const Pe=_.styled(m.Box)`
169
- position: relative;
170
- color: ${({theme:t})=>t.palette.text.primary};
171
- `;function Re({widget:t,reverse:e,projectId:n,assistantId:i,working:r,submitTitle:s,submitIcon:c,submitColor:a,placeholder:l,loadingIndicator:d,section:u,...p}){const[{editing:h},x]=S(p,L),[y,w]=S(x,q),g=n&&i?{projectId:n,gitRef:"main",assistantId:i,working:!0}:void 0,k={children:s,endIcon:c?o.jsx(Z,{icon:c}):void 0,sx:{background:a||void 0,":hover":{background:a||void 0,opacity:.8}}},v=[],B=l&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:l}),N=d&&o.jsx(m.Typography,{variant:"caption",color:"text.disabled",children:d});Object.keys(y).length>0&&Object.values(X.default(y,kt)).filter(Boolean).length>0&&v.push(o.jsx(z,{...y},"base-info")),g&&(t==="form"?v.push(o.jsx(U.AIForm,{identifier:g,SubmitProps:k},"form")):t==="result"?v.push(o.jsx(U.AIFormResult,{identifier:g,placeholder:B,loadingIndicator:N},"result")):v.push(o.jsxs(m.Stack,{width:"100%",gap:2,direction:"row",children:[o.jsx(U.AIForm,{identifier:g,BoxProps:{flex:1},SubmitProps:k}),o.jsx(U.AIFormResult,{identifier:g,BoxProps:{flex:1},placeholder:B,loadingIndicator:N})]},"form-result"))),e&&v.reverse();const ot=m.useTheme(),St=f.useMemo(()=>m.createTheme(Wt.deepmerge(ot,{palette:{primary:a?{main:a}:void 0}})),[a,ot]);return o.jsx(qt.ErrorBoundary,{fallbackRender:j.ErrorView,children:o.jsx(m.ThemeProvider,{theme:St,children:o.jsx(E,{...w,sx:h?{pointerEvents:"none"}:{},children:o.jsx(Q,{col:v.length,children:v})})})})}const _t=f.createContext({pages:[],project:void 0}),{Provider:Te,Consumer:Po}=_t;function $t(){return f.useContext(_t)}function We({icon:t,className:e="",size:n="1rem",...i}){return o.jsx(ze,{component:Z,className:b.cx("css-icon",e),size:n,...i,icon:t})}const ze=_.styled(m.Box)`
172
- &.css-icon {
173
- display: inline-block;
174
- width: ${({size:t})=>t};
175
- height: ${({size:t})=>t};
176
- }
177
- `;function qe({icon:t,className:e="",size:n="1rem",imageMeta:i,...r}){const s=j.autoResizeImage(j.getImageAbsoluteUrl(t),540),[c,a]=f.useState(!1),l=_.useTheme();return c?o.jsx(We,{icon:"i-mdi:image",color:l.palette.grey[500],size:n,className:e,...r}):o.jsx(Ee,{className:b.cx("image-icon",e),size:n,...r,children:o.jsx("img",{className:"image-icon__image",src:s,onError:()=>a(!0),width:i==null?void 0:i.naturalWidth,height:i==null?void 0:i.naturalHeight,alt:(i==null?void 0:i.filename)||"card-icon",loading:"lazy"})})}const Ee=_.styled(m.Box)`
178
- display: inline-block;
179
- width: ${({size:t})=>t};
180
- height: ${({size:t})=>t};
181
- .image-icon__image {
182
- object-fit: contain;
183
- height: 100%;
184
- width: 100%;
185
- }
186
- `,tt=t=>typeof t=="string"&&/^[\w-_]+:[\w-_]+$/.test(t);function J({icon:t,size:e="1rem",imageMeta:n,...i}){const r=window.isNaN(e)?e:`${e}px`;return tt(t)?o.jsx(ht.Icon,{icon:t}):o.jsx(Le,{component:qe,imageMeta:n,className:"base-icon",icon:t,size:r,...i})}const Le=_.styled(m.Box)`
187
- flex-shrink: 0;
188
- `;function W({text:t,children:e,icon:n="",endIcon:i,color:r="primary",link:s="",href:c="",...a}){const l=n?o.jsx(J,{icon:n}):null,d=i?o.jsx(J,{icon:i}):null,u=s||c,p={...a};return u&&(p.href=u,H.default(u)&&(p.target=p.target||"_blank")),o.jsx(oe.default,{startIcon:l,endIcon:d,color:r,...p,children:t||e})}function et({editing:t,text:e,...n}){const{pages:i=[]}=$t(),r=i.find(s=>s.id===(n.link||n.linkId));if(t)return o.jsx(W,{...C.default(n,["link","linkId"]),children:e});if(r){const s=r.path||"/";return o.jsx(K.Link,{to:s,children:o.jsx(W,{...C.default(n,["link","linkId"]),children:e})})}return o.jsx(W,{...C.default(n,"linkId"),children:e})}function P({type:t="",icon:e="",size:n="3rem",className:i="",...r}){return o.jsx(J,{icon:e||t,size:n,className:b.cx("content-icon",i),...r})}P.propTypes={};P.defaultProps={type:"",icon:"",size:"3rem",color:"inherit",className:""};function Ae({to:t,base:e,children:n,className:i,activeClassName:r="active",target:s="auto",autoExternalMark:c=!1,useRouterLink:a,...l}){const{pages:d=[],locale:u=""}={},p=e?F.join("/",e):e||"";let h=s==="auto"?"_self":s,x=F.join(p,t);const y=c?H.default(x):!1;if(e)return x=F.join(p,u,t),o.jsx("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(x),rel:"noreferrer noopener",target:h,...l,children:n});if(H.default(t))s==="auto"&&(h="_blank"),x=t;else{T.isRelative(x)&&(x=F.join(window.location.pathname,x));const w=T.parseURL(`${window.location.origin}${x}`),g=d.some(k=>k.pathname===w.pathname);if(a||g)return o.jsx(K.NavLink,{end:!0,to:T.withoutTrailingSlash(x),className:({isActive:k})=>b.cx(i,k?r:""),...l,children:n})}return o.jsxs("a",{className:`no-underline ${i}`,href:T.withoutTrailingSlash(x),rel:"noreferrer noopener",target:h,...l,children:[n,y&&o.jsx(P,{icon:"i-mdi:arrow-top-right",size:"0.9em",className:"smart-link__mark",style:{marginLeft:5}})]})}function A({prepend:t,append:e,children:n,className:i="",dark:r=!1,border:s=!0,...c}){let a={};const{pages:l=[]}=$t(),d=l.find(h=>h.id===c.link),u=!n||ft.default.Children.toArray(n).every(h=>h===null);c.link&&(a={component:Ae,to:(d==null?void 0:d.path)||c.link,useRouterLink:!0});const p=r&&s;return o.jsxs(Oe,{className:b.cx("base-card card",{"border-gray-200":s},{"dark:border-gray-500":p},{dark:r,"border-transparent":!s},i),...a,...C.default(c,["listType","dark","iconColor","link","hoverStyle","imageSize"]),children:[t,!u&&o.jsx("div",{className:"card__body",children:n}),e]})}const Oe=_.styled(m.Box)`
189
- &.base-card {
190
- text-align: left;
191
- border-width: 1px;
192
- border-style: solid;
193
- border-radius: 12px;
194
- overflow: hidden;
195
- &,
196
- &:hover {
197
- text-decoration: none;
198
- }
199
- }
200
- .card__body {
201
- padding: 15px 15px;
202
- }
203
- `;function O({align:t="left",title:e,titleProps:n={},description:i,descriptionProps:r={}}){return o.jsxs(o.Fragment,{children:[e&&o.jsx(m.Typography,{className:b.cx("card__title text-gray-800","dark:text-gray-50"),component:"h5",variant:"h5",gutterBottom:!0,align:t,...n,children:e}),i&&o.jsx(m.Typography,{className:b.cx("card__description","text-gray-500","dark:text-gray-400"),component:"div",variant:"body1",gutterBottom:!0,align:t,...r,children:i})]})}function Ue({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...u}){const p=tt(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(Fe,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:p&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx("img",{className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"cover",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(O,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Fe=_.styled(A)`
204
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
205
- &:hover {
206
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
207
- }`:""}
208
-
209
- .card__image__wrap {
210
- padding-top: 61.8%;
211
- width: 100%;
212
- position: relative;
213
- }
214
- .card__image {
215
- position: absolute;
216
- top: 0;
217
- left: 0;
218
- bottom: 0;
219
- right: 0;
220
- width: 100%;
221
- height: 100%;
222
- object-position: top center;
223
- }
224
- `,ct="section";function dt({title:t,image:e,imageMeta:n,description:i,actions:r,align:s,listType:c="",className:a="",...l}){return o.jsxs(Me,{className:b.cx("card",`list-type-${c}`,a),align:s,...l,children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:c==="icon-title"?"1.2rem":"3rem",imageMeta:n}),t||i?o.jsx(O,{align:s,title:t,description:i}):null,r!=null&&r.length?o.jsx(R,{align:s,actions:r,className:"mt-4"}):null]})}const Me=_.styled(A)`
225
- padding: 5vw 4vw;
226
- box-sizing: border-box;
227
- /* min-height: 320px; */
228
- color: inherit !important;
229
- border-radius: 0.5rem;
230
- /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
231
- @media (max-width: ${({theme:t})=>t.breakpoints.values[ct]}px) {
232
- padding: 1.5rem 2rem;
233
- }
234
- @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
235
- height: auto;
236
- min-height: unset;
237
- }
238
-
239
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
240
- &:hover {
241
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
242
- }`:""}
243
-
244
- .card__title {
245
- font-weight: 700;
246
- margin-top: 24px;
247
- margin-bottom: 12px;
248
- color: ${({theme:t})=>t.palette.text.primary};
249
- a {
250
- color: ${({theme:t})=>t.palette.primary.main};
251
- }
252
- }
253
- .card__description {
254
- color: ${({theme:t})=>t.palette.text.primary};
255
- a {
256
- color: ${({theme:t})=>t.palette.primary.main};
257
- }
258
- }
259
- .card__body {
260
- color: ${({theme:t})=>t.palette.text.primary};
261
- padding: 0;
262
- ${({align:t})=>`text-align:${t||"left"};`}
263
- }
264
-
265
- &.list-type-icon-title {
266
- padding: 1.2rem;
267
- .title-line {
268
- display: flex;
269
- }
270
- .card__title {
271
- margin: 0;
272
- font-size: 1em;
273
- }
274
- .css-icon {
275
- margin-right: 0.5rem;
276
- }
277
- }
278
-
279
- @media (min-width: ${({theme:t})=>t.breakpoints.values[ct]}px) {
280
- padding: 2rem 2rem;
281
- text-align: left;
282
- box-sizing: border-box;
283
- }
284
- `;function De({image:t,title:e,description:n,imageProps:i={},imageMeta:r,imageSize:s,titleProps:c={},descriptionProps:a={},actions:l,align:d,...u}){const p=tt(t),h=j.autoResizeImage(j.getImageAbsoluteUrl(t),540);return o.jsxs(Ve,{className:"card-article",...u,prepend:o.jsx("div",{className:"card__image__wrap",children:p&&t?o.jsx(m.Box,{sx:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},children:o.jsx(P,{icon:t,color:"primary.main"})}):h&&o.jsx(m.Box,{component:"img",className:"card__image",src:h,...i,alt:i.alt||(r==null?void 0:r.filename)||"card-image",width:r==null?void 0:r.naturalWidth,height:r==null?void 0:r.naturalHeight,style:{width:"100%",height:"100%",objectFit:s||"contain",objectPosition:"center"},loading:"lazy"})}),children:[e||n?o.jsx(O,{align:d,title:e,titleProps:c,description:n,descriptionProps:a}):null,l!=null&&l.length?o.jsx(R,{align:d,actions:l,className:"mt-4"}):null]})}const Ve=_.styled(A)`
285
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
286
- &:hover {
287
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
288
- }`:""}
289
-
290
- border-radius: 0 !important;
291
-
292
- .card__body {
293
- ${({align:t})=>`text-align:${t||"left"};`}
294
- }
295
-
296
- .card__image__wrap {
297
- width: 100%;
298
- height: 100%;
299
- position: relative;
300
- display: flex;
301
- justify-content: center;
302
- align-items: center;
303
- }
304
-
305
- .card__image {
306
- max-height: 60px;
307
- }
308
- `,ut="section";function He({title:t,image:e,imageMeta:n,iconSize:i=100,description:r,actions:s,align:c,className:a="",...l}){return o.jsx(Ye,{className:b.cx("card",a),...l,children:o.jsxs(m.Box,{className:"flex items-center",children:[e&&o.jsx(P,{icon:e,color:"primary.main",size:i,imageMeta:n}),o.jsxs(m.Box,{className:"flex-1 ml-4",children:[o.jsx(O,{align:c,title:t,description:r}),o.jsx(R,{align:c,actions:s,className:"mt-4"})]})]})})}const Ye=_.styled(A)`
309
- padding: 5vw 4vw;
310
- text-align: left;
311
- box-sizing: border-box;
312
- /* min-height: 320px; */
313
- color: inherit !important;
314
- border-radius: 0.5rem;
315
- /* ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`} */
316
- @media (max-width: ${({theme:t})=>t.breakpoints.values[ut]}px) {
317
- padding: 1.5rem 2rem;
318
- }
319
- @media (max-width: ${({theme:t})=>t.breakpoints.values.sm}px) {
320
- height: auto;
321
- min-height: unset;
322
- }
323
-
324
- ${t=>t.hoverStyle==="none"?"":t.link?`transition: box-shadow ease .3s;
325
- &:hover {
326
- box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
327
- }`:""}
328
-
329
- .card__title {
330
- font-weight: 700;
331
- margin-bottom: 12px;
332
- a {
333
- color: ${({theme:t})=>t.palette.primary.main};
334
- }
335
- }
336
- .card__description {
337
- a {
338
- color: ${({theme:t})=>t.palette.primary.main};
339
- }
340
- }
341
- .card__body {
342
- padding: 0;
343
- }
344
-
345
- &.list-type-icon-title {
346
- padding: 1.2rem;
347
- .title-line {
348
- display: flex;
349
- }
350
- .card__title {
351
- margin: 0;
352
- font-size: 1em;
353
- }
354
- .css-icon {
355
- margin-right: 0.5rem;
356
- }
357
- }
358
-
359
- @media (min-width: ${({theme:t})=>t.breakpoints.values[ut]}px) {
360
- padding: 2rem 2rem;
361
- text-align: left;
362
- box-sizing: border-box;
363
- }
364
- `;function Je({title:t,titleProps:e={},description:n,descriptionProps:i={},image:r,imageMeta:s,className:c="",align:a,hoverStyle:l,...d}){return o.jsxs(Ge,{className:b.cx("card-simple",c,`hover-style__${l}`),align:a,...d,children:[r&&o.jsx(P,{icon:r,color:"primary.main",imageMeta:s}),t||n?o.jsx(O,{align:a,title:t,titleProps:e,description:n,descriptionProps:i}):null]})}const Ge=_.styled(A)`
365
- ${({dark:t,theme:e})=>`background-color:${t?e.palette.grey[900]:e.palette.common.white};`}
366
-
367
- &.hover-style__default {
368
- &.card-simple {
369
- &:hover {
370
- border-top-right-radius: 36px;
371
- }
372
- }
373
- .card__body {
374
- &:hover {
375
- &::before {
376
- width: 42px;
377
- height: 42px;
378
- transform: translate(50%, -50%) rotate(45deg);
379
- }
380
- &::after {
381
- transform: none;
382
- }
383
- }
384
- }
385
- }
386
-
387
- &.card-simple {
388
- border-radius: 8px;
389
- border-top-right-radius: 26px;
390
-
391
- .card__body {
392
- ${({align:t})=>`text-align:${t||"left"};`}
393
- }
394
-
395
- ${t=>t.link?`
396
- cursor: pointer;
397
- `:""}
398
- /* cursor: pointer; */
399
- /* &:hover {
400
- border-top-right-radius: 36px;
401
- } */
402
- transition: all 180ms ease 0s;
403
- overflow: visible;
404
- .card__title {
405
- margin: 12px 0;
406
- }
407
- .card__body {
408
- position: relative;
409
- padding: 20px 16px 18px;
410
- overflow: hidden;
411
- transition: all 180ms ease 0s;
412
- /* &:hover {
413
- &::before {
414
- width: 42px;
415
- height: 42px;
416
- transform: translate(50%, -50%) rotate(45deg);
417
- }
418
- &::after {
419
- transform: none;
420
- }
421
- } */
422
- &::before,
423
- &::after {
424
- content: ${({border:t})=>t?'""':""};
425
- transition: inherit;
426
- position: absolute;
427
- top: 0px;
428
- right: 0px;
429
- }
430
- &::before {
431
- z-index: 3;
432
- background: #fff;
433
- width: 30px;
434
- height: 30px;
435
- transform: translate(50%, -50%) rotate(45deg);
436
- box-shadow: 0 1px 0 0 #e9eaec;
437
- }
438
- &::after {
439
- z-index: 2;
440
- width: 28px;
441
- height: 28px;
442
- border-bottom-left-radius: 6px;
443
- background: #fcfcfd;
444
- box-shadow: -1px 1px 0 0 #e9eaec;
445
- transform: translate(8px, -8px);
446
- }
447
- }
448
- }
449
- `;function Ke({type:t="default",...e}){const i={article:Ue,simple:Je,news:He,default:dt,wall:De}[t]||dt;return o.jsx(i,{...t==="news"?e:C.default(e,"iconSize")})}function Xe({list:t=[],align:e="top",cards:n,listBorder:i=!0,listType:r="",col:s=3,gap:c,iconColor:a,className:l="",type:d="default",dark:u=!1,textAlign:p="left",hoverStyle:h,...x}){return o.jsx(Q,{type:d,className:b.cx("card-list py-1",l,"items-stretch"),col:s,gap:c,align:e,...x,children:n||t.map(y=>o.jsx(Ke,{borderColor:i,iconColor:a,type:d,listType:r,dark:u,...y,align:p,sx:{bgcolor:d==="wall"?void 0:u?"grey.900":"common.white"},style:c===0&&t.length>1?{borderRadius:0,marginRight:"-1px",marginBottom:"-1px"}:{}},y.id))})}const Qe=["align","cards","list","listBorder","listType","col","gap","iconColor","type","textAlign"],Ze=_.styled(E)`
450
- a .card {
451
- color: #404040;
452
- cursor: pointer;
453
- }
454
- a:not(.MuiButton-root) {
455
- color: ${({theme:t})=>t.palette.primary.main};
456
- &:hover,
457
- &:active {
458
- color: ${({theme:t})=>t.palette.primary.main};
459
- }
460
- }
461
- a:hover .card {
462
- color: #404040;
463
- }
464
- `;function to({className:t,...e}){const[n,i]=S(e,q),[r,s]=S(i,Qe);return o.jsxs(Ze,{className:b.cx("section--card-list",t),type:e.type,...s,children:[Object.keys(n).length>0&&o.jsx(z,{center:!0,...n,className:"mb-[2.5vw]"}),o.jsx(Xe,{...r,dark:!!e.dark})]})}const eo=_.styled(to)`
465
- .card__description {
466
- white-space: pre-wrap;
467
- }
468
- .section__description {
469
- }
470
- .card {
471
- /* background: inherit !important; */
472
- }
473
- &.dark .card-simple .card__body::before {
474
- background: #212121 !important;
475
- }
476
- .card-simple .card__body::after {
477
- background: inherit !important;
478
- }
479
- `;function oo({section:t,...e}){const[{editing:n},i]=S(e,L),r=f.useMemo(()=>{var s;return{...C.default(i,["listBorder","list","iconSize","imageSize"]),list:(s=i.list)==null?void 0:s.map(c=>{var a,l;return{...C.default(c,"icon","iconColor"),image:["news","simple","default"].includes(i.type)&&c.icon?c.icon:c.image,actions:(l=(a=c.actions)==null?void 0:a.map)==null?void 0:l.call(a,d=>o.jsx(et,{...d,editing:n},d.id)),border:i.listBorder,iconSize:i.iconSize,imageSize:i.imageSize,hoverStyle:i.hoverStyle}})}},[i]);return o.jsx(eo,{style:n?{pointerEvents:"none"}:{},...r})}function no({properties:t,section:e,locale:n,dev:i}){var r;return(r=e==null?void 0:e.config)!=null&&r.componentId?o.jsx(G.CustomComponentRenderer,{instanceId:e.id,componentId:e.config.componentId,blockletId:e.config.blockletId,blockletTitle:e.config.blockletTitle,componentName:e.config.componentName,locale:n,properties:t,dev:i}):o.jsx(m.Box,{textAlign:"center",py:2,children:o.jsx(m.Typography,{variant:"caption",color:"text.secondary",children:"Please select component to render"})})}function ro({src:t,dataId:e,isEdit:n=!1,height:i="100%",onLoad:r=()=>{}}){return o.jsx(Kt.EmbedIframe,{isEdit:n,embedId:e,src:t,height:i,onLoad:()=>{r()}})}function io({dataId:t,src:e,actions:n,center:i,onLoad:r,...s}){const[c,a]=S(s,q);return o.jsxs(E,{...a,children:[Object.keys(c).length>0&&o.jsx(z,{center:i,...c}),o.jsx(ro,{dataId:t,src:e,onLoad:r,height:s.iframeHeight?`${s.iframeHeight}px`:"100%"}),o.jsx(R,{actions:n,center:i})]})}const so={src:"",embedUrl:"",title:"",description:"",dark:!1,background:"",center:!0,config:{},id:""};function ao({section:t,id:e,src:n,...i}){const r=`${e}-${i.locale}`,[{editing:s},c]=S(i,L),a=f.useRef({}),l=JSON.parse(JSON.stringify(c)),{message:d}=Yt.useMessage(r,"server"),u=Jt.useLatest(JSON.parse(JSON.stringify(c.config)||"{}"));return f.useEffect(()=>{d&&d.onInit(()=>u.current)},[d]),f.useEffect(()=>{const p=JSON.parse(JSON.stringify(c.config)||"{}");ne.default(a.current,p)||(a.current=p,d==null||d.send("config-set",p))},[d,c.config]),n?o.jsx(io,{...l,dataId:r,src:n,style:s?{pointerEvents:"none"}:{}}):o.jsx(lo,{children:'Please set the "src" attribute for this block'})}const lo=_.styled("div")`
480
- user-select: none;
481
- color: #999;
482
- padding: 8px;
483
- height: 200px;
484
- `,co=[/youtu\.be\/([^#&?]{11})/,/\?v=([^#&?]{11})/,/&v=([^#&?]{11})/,/embed\/([^#&?]{11})/,/\/v\/([^#&?]{11})/];function uo(t){var e;if(/youtu\.?be/.test(t))for(const n of co){const i=(e=n.exec(t))==null?void 0:e[1];if(i)return i}}function mo(t){const e=uo(t);if(e)return`https://youtube.com/embed/${e}`}function po({src:t}){return f.useEffect(()=>{import("@lottiefiles/lottie-player")},[]),o.jsx("lottie-player",{autoplay:!0,loop:!0,mode:"normal",src:t})}function xo(t){return o.jsx(m.Box,{maxHeight:400,overflow:"hidden auto",children:o.jsx(Xt.TwitterTimelineEmbed,{...t})})}function ho({url:t}){const e=f.useRef(null),n=495,[i,r]=f.useState(e.current?e.current.offsetWidth*.5625:n),s=f.useCallback(()=>{const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c))},[]);return f.useEffect(()=>{window.addEventListener("resize",s);const c=window.innerWidth>990?1:window.innerWidth>522?1.2:window.innerWidth>400?1.45:1.85,a=e.current?e.current.offsetWidth*.5625:n;return r(Math.floor(a*c)),function(){window.removeEventListener("resize",s)}},[i,s]),o.jsx(m.Box,{component:"iframe",ref:e,title:"youtube",width:"100%",height:`${i}px`,src:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,sx:{display:"block"}})}const fo={image:"https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",badge:"Develop · Deploy · Run",title:"The Future is Here: Blockchain and Decentralized Application Development",description:"ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",reverse:!1,dark:!1,background:"",actions:void 0,hasImage:!0,center:!1},go=_.styled(Ne)`
485
- .section__description {
486
- }
487
- `;function yo({hasImage:t,fullSizeImage:e,boxed:n,videoPoster:i,imageMeta:r,imageOptimization:s,imageSize:c,section:a,...l}){var x,y;const[{editing:d},u]=S({...l,boxed:e?void 0:n},L);let p=bo(u.image,i,e,r,s,c);t||(p=null);let h=null;return u.actions&&(h=(y=(x=u.actions)==null?void 0:x.map)==null?void 0:y.call(x,(w,g)=>o.jsx(et,{...w,editing:d},g))),o.jsx(go,{...u,style:d?{pointerEvents:"none"}:{},image:p,fullSizeImage:t&&e,actions:h})}function bo(t,e,n,i,r,s){if(t){if(t.endsWith(".json"))return o.jsx(po,{src:t});if(t.indexOf("twitter.com")!==-1)return o.jsx(xo,{sourceType:"url",url:t});const c=mo(t);if(c)return o.jsx(ho,{url:c});const{naturalWidth:a,naturalHeight:l,filename:d}=i||{};if(Y(t))return o.jsx("video",{width:a&&`${a}px`,height:l&&`${l}px`,controls:!0,autoPlay:!0,muted:!0,style:{display:"block",objectFit:s||"contain",borderRadius:"8px",width:"100%",height:"100%"},poster:j.autoResizeImage(j.getImageAbsoluteUrl(e),n?1200:540,r),children:o.jsx("source",{src:j.getImageAbsoluteUrl(t),type:_e(t)})},t);const u=r==="quality"?1:.6;return o.jsx(G.ResponsiveImage,{src:j.getImageAbsoluteUrl(t),sizesAttr:{sm:600*u,md:450*u,lg:540*u,...n&&{md:900*u,lg:1200*u}},width:a&&`${a}px`,height:l&&`${l}px`,alt:d??t,style:{objectFit:s||"contain",display:"block",width:"100%",height:"100%"},loading:"lazy"})}return null}const wo=["production","draft"];function jo({mode:t,version:e}={}){const n=e&&typeof e=="number"?{mode:t,version:e}:{mode:t};return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages`,{params:n}).then(i=>i.data)}function vo({mode:t,pages:e}){return j.api.post(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/publish`,{mode:t,pages:e}).then(n=>n.data)}function ko({locale:t,sort:e,page:n,limit:i,mode:r}={}){return j.api.get(`/api/${j.getProjectIdFromPathnameOrWindow()}/pages/toc`,{params:{locale:t,sort:e,page:n,limit:i,mode:r}}).then(s=>s.data)}const _o={style:"list",sort:"-updatedAt"},mt=20;function $o({style:t,sort:e,section:n,...i}){const[{editing:r,locale:s},c]=S(i,L),[a,l]=S(c,q),[d,u]=f.useState(),p=f.useRef(!1),h=st.useUpdate(),x=K.useNavigate(),y=f.useCallback(async()=>{if(!p.current){p.current=!0,h();try{const w=d?Math.floor(d.list.length/mt)+1:1,{list:g,total:k}=await ko({locale:s,sort:e,page:w,limit:mt});u(v=>({list:((v==null?void 0:v.list)??[]).concat(g),total:k}))}finally{p.current=!1,h()}}},[d,s,e,h]);return st.useMount(()=>{y()}),o.jsxs(E,{...l,sx:r?{pointerEvents:"none"}:{},children:[Object.keys(a).length>0&&o.jsx(z,{...a}),d?o.jsxs(o.Fragment,{children:[o.jsx(m.Grid,{container:!0,spacing:2,justifyContent:"center",children:d==null?void 0:d.list.map(w=>o.jsx(m.Grid,{item:!0,xs:12,sm:t==="card"?6:12,md:t==="card"?3:12,children:o.jsxs(So,{elevation:0,className:b.cx(t==="card"&&"style-card"),onClick:r?void 0:()=>x(w.slug),children:[!!w.image&&o.jsx(m.CardMedia,{component:"img",alt:"",image:j.autoResizeImage(j.getImageAbsoluteUrl(w.image),540),loading:"lazy"}),o.jsxs(m.CardContent,{children:[o.jsx(m.Typography,{variant:"h6",component:"div",className:pt,children:w.title||w.id}),o.jsx(m.Typography,{variant:"body2",className:pt,children:w.description})]})]})},w.id))}),o.jsx(m.Box,{textAlign:"center",mt:2,children:d.total>d.list.length?o.jsx(W,{variant:"outlined",color:"secondary",onClick:y,loading:p.current,children:"More"}):o.jsx(W,{variant:"outlined",color:"secondary",disabled:!0,children:"No More"})})]}):o.jsx(m.Box,{p:2,textAlign:"center",children:o.jsx(m.CircularProgress,{size:24})})]})}const pt=b.css`
488
- display: -webkit-box;
489
- -webkit-box-orient: vertical;
490
- -webkit-line-clamp: 2;
491
- overflow: hidden;
492
- text-overflow: ellipsis;
493
- `,So=_.styled(m.Card)`
494
- border: 1px solid #e0e0e0;
495
- background-color: transparent;
496
- cursor: pointer;
497
- display: flex;
498
- color: inherit;
499
-
500
- > .MuiCardMedia-root {
501
- width: 30vw;
502
- max-height: 50vw;
503
- }
504
-
505
- &.style-card {
506
- display: block;
507
-
508
- > .MuiCardMedia-root {
509
- width: 100%;
510
- max-height: 50vw;
511
- }
512
- }
513
- `,Bo={iframe:ao,section:yo,"section-card-list":oo,toc:$o,"ai-runtime":Re,"custom-component":no};function Co({id:t,type:e,mode:n,config:i,section:r,...s}){const c=Bo[e],{getPageMetaStyle:a}=pe(),l=f.useMemo(()=>{const{height:p,...h}=i;return h},[i]),d=f.useMemo(()=>{const p={};return e!=="custom-component"&&(p.height=i.height),p.sx=a("sx"),p},[i.height,e,a]),u=c&&o.jsx(c,{mode:n,...l,id:t,section:r});return o.jsx(Ie,{...s,...d,children:u})}function No(t){return t!=null}exports.Action=et;exports.BlockRenderer=Co;exports.IFrameBlockDefaultProps=so;exports.Icon=Z;exports.PageProvider=xe;exports.Provider=Te;exports.STATE_MODES=wo;exports.SectionBlockDefaultProps=fo;exports.TocDefaultProps=_o;exports.getPages=jo;exports.nonNullable=No;exports.publishPages=vo;
@@ -1,38 +0,0 @@
1
- "use strict";const t=require("react/jsx-runtime"),k=require("./state-DDwYX2mu.js"),C=require("lodash"),Q=require("@arcblock/ux/lib/Locale/context"),re=require("@arcblock/ux/lib/Result"),ie=require("@blocklet/pages-kit/builtin/page/header"),ce=require("@blocklet/pages-kit/contexts/color"),le=require("@blocklet/ui-react/lib/Header"),X=require("@emotion/css"),T=require("@emotion/react"),ae=require("@emotion/styled"),y=require("@mui/material"),ue=require("ahooks"),de=require("isomorphic-dompurify"),fe=require("lodash/cloneDeep"),me=require("lodash/isEmpty"),ge=require("lodash/isEqual"),x=require("react"),pe=require("react-helmet"),w=require("react-router-dom"),H=require("react-use"),E=require("ufo"),P=require("./array-BwGaBJVb.js"),N=require("@arcblock/ux/lib/Theme"),he=require("@blocklet/ui-react/lib/Footer"),xe=require("webfontloader"),je=require("@arcblock/did-connect/lib/Session"),v=e=>e&&e.__esModule?e:{default:e},Y=v(re),be=v(le),Z=v(ae),ye=v(de),J=v(fe),ve=v(me),we=v(ge),Se=v(he),ke=v(xe);function Pe(e,s,o,r){e.locales||(e.locales={}),e.locales[o]=C.cloneDeep(e.locales[o]||{}),e.locales[o].title=r.title??e.locales[o].title,e.locales[o].image=r.image??e.locales[o].image,e.locales[o].description=r.description??e.locales[o].description,Object.entries(r.sectionsData).forEach(([c,n])=>{var l,m,j,d;const i=Object.values(e.sections).find(a=>a.id===c||a.name===c);if(i&&i.isTemplateSection)if(i.locales=C.cloneDeep(i.locales||{}),i.locales[o]=C.cloneDeep(i.locales[o]||{}),i.component==="custom-component"){const a=(l=i.config)==null?void 0:l.componentId;if(!a)return;const g=((m=s.components[a])==null?void 0:m.data)||((d=(j=s.resources.components)==null?void 0:j[a])==null?void 0:d.component);if(!g)return;i.locales[o].properties=C.cloneDeep(i.locales[o].properties||{}),Object.entries(n||{}).forEach(([p,u])=>{var h,_;const f=((h=g==null?void 0:g.properties)==null?void 0:h[p])||Object.values((g==null?void 0:g.properties)||{}).find(M=>{var q;return((q=M.data)==null?void 0:q.key)===p});f&&(i.locales[o].properties[(_=f.data)==null?void 0:_.id]={value:u})})}else i.locales[o]={...C.cloneDeep(i.locales[o]),...n||{}}})}const _e=N.styled(Se.default,{shouldForwardProp:e=>!!e})`
2
- & > div > .MuiContainer-root {
3
- max-width: unset;
4
- }
5
- `;function qe({meta:e,...s}){const o=N.useTheme();return t.jsx(_e,{...s,meta:e,theme:o||{}})}function K(e){return t.jsx(y.Box,{display:"flex",flex:1,height:"100%",alignItems:"center",justifyContent:"center",...e,children:t.jsx(y.CircularProgress,{size:30})})}function Re(e){return t.jsx(Ce,{...e})}const Ce=N.styled(y.Box)`
6
- position: fixed;
7
- left: 0;
8
- top: 0;
9
- z-index: 999999999999;
10
- width: 80px;
11
- font-size: 12px;
12
- text-align: center;
13
- opacity: 0.7;
14
- transform: translateX(-23%) translateY(70%) rotate(-45deg);
15
- pointer-events: none;
16
- `,Me=e=>new Promise((s,o)=>{(e==null?void 0:e.length)>0?ke.default.load({google:{families:e},fontactive:()=>{s("success")},fontinactive:()=>{o(new Error("load font fail"))}}):s("success")}),O=`Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
17
- sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'`,F={};function Ee({titleFontFamily:e,descriptionFontFamily:s}){var n;const o=y.useTheme(),r=(n=o==null?void 0:o.typography)==null?void 0:n.fontFamily,c=async i=>{if(i&&!document.querySelectorAll(`link[href*="${i}" i]`).length)try{F[i]||(await Me([i]),F[i]=!0)}catch(l){console.error(l)}};return x.useEffect(()=>{e&&c(e),s&&c(s)},[e,s]),t.jsx(T.Global,{styles:T.css`
18
- #app {
19
- font-family: ${JSON.stringify(r)}, ${O};
20
-
21
- .page-kit-section__title {
22
- font-family: ${JSON.stringify(e??r)}, ${O};
23
- }
24
-
25
- .page-kit-section__description {
26
- font-family: ${JSON.stringify(s??r)}, ${O};
27
- }
28
- }
29
- `})}const{SessionProvider:De,SessionContext:Ie,SessionConsumer:$e,withSession:Ve}=je.createAuthServiceSessionContext();function A(){return x.useContext(Ie)}function Te(...e){var o;const{session:s}=A();return e.includes((o=s.user)==null?void 0:o.role)}function Be(...e){var r;const{session:s}=A(),o=Te(...e);return((r=window.blocklet)==null?void 0:r.tenantMode)==="multiple"?!!s.user:o}function Oe(){const[e]=w.useSearchParams(),{session:s}=A(),o=Be("owner","admin","pagesEditor","member"),r=x.useMemo(()=>{const n=e.get("mode");return P.STATE_MODES.includes(n)?n:"production"},[e]),c=r==="production"?r:s.user?o?r:"production":null;return c?t.jsx(ee,{mode:c}):null}function ee({mode:e}){if(e!=="draft"){const s=window.__PAGE_STATE__;return s?t.jsx(I,{mode:e,state:s}):t.jsx(Ne,{mode:e,children:({state:o})=>t.jsx(I,{mode:e,state:o})})}return t.jsx(He,{children:({state:s})=>t.jsx(I,{mode:e,state:s})})}const He=x.lazy(()=>Promise.resolve().then(()=>require("./draft-data-DPTVTTlh.js")));function Ne({mode:e,children:s}){const o=document.querySelector('meta[property="pages:version"]'),r=o==null?void 0:o.content,c=k.useProjectId(),n=x.useMemo(()=>{if(r==="{{pagesPublishedAt}}"){const m=localStorage.getItem(k.getProjectPageVersionKey(c??""));return Number(m)?Number(m):new Date().getTime()}return Number(r)},[r]),{loading:i,value:l}=H.useAsync(()=>P.getPages({mode:e,version:n}),[e,n]);return i?t.jsx(K,{}):l?s({state:l}):null}function I({mode:e,state:s}){const{t:o,locale:r}=Q.useLocaleContext(),{pageIds:c,pages:n,supportedLocales:i,config:{defaultLocale:l},resources:m}=s,j=k.getAllComponents(s),d=x.useMemo(()=>i!=null&&i.some(u=>u.locale===r)?r:void 0,[r,i]),a=Object.values(n).find(u=>(u==null?void 0:u.slug)==="/")?void 0:Object.values(n)[0],g=x.useMemo(()=>c.map(u=>{const f=n[u];return f&&{id:f.id,path:E.joinURL("/",d||"",f.slug,e!=="production"?`?mode=${e}`:"")}}).filter(P.nonNullable),[c,n,d,e]),p=([...u])=>(e!=="production"&&u.unshift(t.jsx(x.Suspense,{fallback:t.jsx("div",{}),children:t.jsx(Le,{mode:"production",state:s})})),u);return t.jsxs(P.Provider,{value:{pages:g},children:[t.jsxs(w.Routes,{children:[a&&t.jsx(w.Route,{index:!0,element:t.jsx(w.Navigate,{to:E.joinURL("/",d||"",a.slug)})}),c.map(u=>{const f=n[u];return f?t.jsx(w.Route,{path:E.joinURL(":projectIdOrSlug?",f.slug),element:t.jsx(B,{mode:e,components:j,page:f,locale:d,defaultLocale:l,headerAddons:p})},f.id):null}),m.pages&&Object.values(m.pages).map(({blockletId:u,page:f})=>t.jsx(w.Route,{path:E.joinURL("/",`@${u}`,f.slug),element:t.jsx(B,{mode:e,components:j,page:f,locale:d,defaultLocale:l,headerAddons:p})},f.id)),t.jsx(w.Route,{path:"*",element:t.jsx(y.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:t.jsx(Y.default,{status:404,extra:t.jsx(ne,{href:"/",children:o("common.back")})})})})]}),e!=="production"&&t.jsx(Re,{sx:{bgcolor:"info.light"},children:e}),t.jsx(Ee,{})]})}function Ae({mode:e,state:s,path:o,pageData:r}){const{t:c,locale:n}=Q.useLocaleContext(),{pages:i,supportedLocales:l,config:{defaultLocale:m},resources:j}=s,d=Object.values(i).find(h=>(h==null?void 0:h.slug)===o),a=Object.values(j.pages||{}).find(h=>h.page.slug===o),g=x.useMemo(()=>l!=null&&l.some(h=>h.locale===n)?n:void 0,[n,l]),p=ue.useReactive({page:null});x.useEffect(()=>{const h=d||(a==null?void 0:a.page)||null;h?p.page=J.default(h):p.page=null},[d,a]);const u=x.useRef();if(x.useEffect(()=>{we.default(r,u.current)||r&&p.page&&(Pe(p.page,s,g,r),u.current=J.default(r))},[{}]),!d&&!(a!=null&&a.page))return t.jsx(y.Box,{width:"100vw",height:"100vh",display:"flex",justifyContent:"center",alignItems:"center",children:t.jsx(Y.default,{style:{background:"inherit"},status:404,extra:t.jsx(ne,{href:"/",children:c("common.back")})})});const f=k.getAllComponents(s);return p.page?t.jsx(B,{mode:e,components:f,page:p.page,locale:g,defaultLocale:m}):null}function B({mode:e,components:s,page:o,locale:r,defaultLocale:c,headerAddons:n}){var _,M,q,L,U,D,$,V,z;const i=ce.useColorConvert(),l=((_=o.locales)==null?void 0:_[r])??((M=o.locales)==null?void 0:M[c])??{},m=l.title||((q=window.blocklet)==null?void 0:q.appName),j=l.description||((L=window.blocklet)==null?void 0:L.appDescription),d=k.autoResizeImage(k.getImageAbsoluteUrl(l.image),540),{logo:a,brand:g,description:p,...u}=ie.useHeaderState(),f=x.useMemo(()=>S=>{var R;let b=(n==null?void 0:n(S))??S;return b=((R=u.addons)==null?void 0:R.call(u,b))??b,b},[u.addons,n]),h=(U=l.header)!=null&&U.translucent?oe:te;return t.jsxs(P.PageProvider,{page:o,defaultLocale:c,currentLocale:r,children:[!!l.backgroundColor&&t.jsx(T.Global,{styles:T.css`
30
- body {
31
- background-color: ${i(l.backgroundColor)} !important;
32
- }
33
- `}),t.jsx(h,{hideNavMenu:!!((D=l.header)!=null&&D.hideNavMenus),translucentTextColor:($=l.header)==null?void 0:$.translucentTextColor,...a?{logo:a}:{},...g?{brand:g}:{},...p?{description:p}:{},className:X.cx(((V=l.header)==null?void 0:V.sticky)&&"sticky","page-header"),maxWidth:!1,addons:f}),t.jsx(w.ScrollRestoration,{}),t.jsxs(pe.Helmet,{children:[t.jsx("title",{children:m}),t.jsx("meta",{name:"og:title",content:m}),t.jsx("meta",{name:"og:description",content:j}),t.jsx("meta",{name:"og:image",content:d}),t.jsx("meta",{name:"twitter:image:src",content:d}),t.jsx("meta",{name:"twitter:image",content:d}),t.jsx("meta",{property:"twitter:description",content:j}),t.jsx("meta",{property:"twitter:title",content:m}),t.jsx("meta",{name:"description",content:j})]}),t.jsx(y.Stack,{flexGrow:1,className:"PageView-root",sx:{"& .BlockBase-root:first-child":{pt:"0 !important"}},children:o.sectionIds.map(S=>{var G,W;const b=o.sections[S];if(!b||b.visibility==="hidden")return null;const R=(G=b.locales)==null?void 0:G[r],se=((W=b.locales)==null?void 0:W[c])??{};return t.jsx(P.BlockRenderer,{id:S,type:b.component,mode:e,section:b,config:{...ve.default(R)?se:R,locale:r,dev:e==="draft"?{mode:e,components:s,defaultLocale:c}:{mode:e}}},S)})}),!((z=l.footer)!=null&&z.hidden)&&t.jsx(qe,{})]})}const Le=x.lazy(()=>Promise.resolve().then(()=>require("./publish-button-TrJpN62K.js"))),te=Z.default(be.default)`
34
- &.sticky {
35
- position: sticky;
36
- top: 0;
37
- }
38
- `;function Ue({logo:e}){const[s,o]=x.useState(),r=y.useMediaQuery(n=>n.breakpoints.down("sm")),{value:c}=H.useAsync(()=>{var l,m;const n=new URL(r?((l=window==null?void 0:window.blocklet)==null?void 0:l.appLogo)||"/.well-known/service/blocklet/logo":((m=window==null?void 0:window.blocklet)==null?void 0:m.appLogoRect)||"/.well-known/service/blocklet/logo-rect",window.location.origin);n.searchParams.delete("imageFilter"),n.searchParams.delete("f");const i=n.toString();return new Promise(j=>{fetch(i).then(d=>{const a=d.headers.get("content-type");a!=null&&a.includes("svg")&&d.text().then(g=>{o(g),j(null)}),j(d.url)})})},[r]);if(e)return e;if(s)return t.jsx(y.Box,{sx:{filter:"initial !important"},dangerouslySetInnerHTML:{__html:ye.default.sanitize(s)}});if(c){const n=new URL(c);n.searchParams.set("imageFilter","convert"),n.searchParams.set("f","png"),n.searchParams.set("h","80");const i=n.toString();return t.jsx("img",{src:i,alt:"logo"})}return null}function oe({logo:e,translucentTextColor:s,...o}){const{y:r}=H.useWindowScroll();let c=Math.min(r/800,1),n="";if(c>.1){c=Math.max(c,.6);const i=Math.round(255*Math.min(1-c,.2));n=`rgb(${i}, ${i}, ${i})`}else n=s||"#EEEEEE";return t.jsx(te,{logo:t.jsx(Ue,{logo:e}),...o,className:X.cx(c<=.7&&"reverse-color"),style:{backgroundColor:`rgba(255,255,255,${c})`,"--logo-invert":c<=.7?1-c/6:1-c},sx:{backdropFilter:c>=.6?"blur(10px)":"blur(0px)",transition:"all 0.3s ease",position:"fixed !important",left:0,top:0,right:0,bgcolor:"transparent","&.reverse-color":{".navmenu-root>.navmenu-sub>span,\n .navmenu-root>.navmenu-item,\n .header-addons>button,\n .header-addons>a,\n .header-addons>div>button":{color:`${n} !important`}},".header-logo > div":{filter:"invert(var(--logo-invert))"},".header-logo":{color:n}}})}const ne=Z.default(y.Button)``;exports.Home=Oe;exports.HomeView=ee;exports.Loading=K;exports.PageRoutes=I;exports.PageView=B;exports.PageViewByPath=Ae;exports.TranslucentHeader=oe;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("./state-DDwYX2mu.js"),D=require("@arcblock/ux/lib/Locale/context"),O=require("@arcblock/ux/lib/Toast"),S=require("@mui/icons-material"),q=require("@mui/lab"),s=require("@mui/material"),W=require("immer"),z=require("lodash/difference"),c=require("react"),_=require("react-use"),N=require("./home-CXupaCeO.js"),E=require("./array-BwGaBJVb.js"),M=t=>t&&t.__esModule?t:{default:t},A=M(O),C=M(z);function R(t){const[d,b]=c.useState(!1);return e.jsx(q.LoadingButton,{...t,loading:t.loading||d,onClick:i=>{var h;const m=(h=t.onClick)==null?void 0:h.call(t,i);m instanceof Promise&&(b(!0),m.finally(()=>{b(!1)}))}})}const F=s.createSvgIcon(e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M7.75732 16.2426L16.2426 7.75736",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M16.2426 16.2426L7.75732 7.75735",stroke:"#4B5563",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Close");function H(){const[t,d]=c.useState(),b=c.useMemo(()=>t?e.jsx(s.Dialog,{...t}):null,[t]),i=c.useCallback(()=>{d(void 0)},[]),m=c.useCallback(({title:h,content:g,cancelText:T="Cancel",okText:p="Ok",onOk:f,onClose:k,okIcon:L,okColor:n="primary",cancelColor:y="primary",DialogContentProps:u,form:x,...I})=>{d({...I,open:!0,children:e.jsxs("form",{onSubmit:P=>P.preventDefault(),children:[h&&e.jsxs(s.DialogTitle,{className:"between",zIndex:"appBar",bgcolor:"background.paper",sx:{borderBottom:"1px solid #E5E7EB"},children:[e.jsx(s.Box,{children:h}),e.jsx(s.IconButton,{size:"small",onClick:async()=>{i(),k==null||k()},children:e.jsx(F,{})})]}),g&&e.jsx(s.DialogContent,{...u,sx:{mt:-3,...u==null?void 0:u.sx},children:e.jsx(s.Box,{pt:3,children:g})}),e.jsxs(s.DialogActions,{children:[e.jsx(s.Button,{variant:"outlined",color:y||"primary",onClick:k??i,children:T}),e.jsx(R,{variant:"contained",color:n||"primary",startIcon:L,loadingPosition:L?"start":"center",onClick:async()=>{await(f==null?void 0:f()),i()},type:"submit",children:p})]})]}),onClose:k??i})},[i]);return{dialog:b,showDialog:m,closeDialog:i}}const J=c.forwardRef(({mode:t,state:d},b)=>{const{t:i}=D.useLocaleContext(),[m,h]=c.useState(!1),{dialog:g,showDialog:T}=H(),p=v.useProjectId(),f=c.useCallback(L=>{let n=[];T({title:i("maker.publishToProduction"),content:e.jsxs(s.Box,{sx:{minWidth:300},children:[e.jsx(s.Alert,{color:"warning",icon:e.jsx(S.Warning,{}),children:i("maker.publishToProductionTip")}),e.jsx(s.Box,{maxHeight:"50vh",overflow:"auto",mt:2,children:e.jsx(V,{state:d,toMode:t,onChange:y=>n=y,defaultPageIds:L})})]}),okText:i("maker.publish"),cancelText:i("common.cancel"),onOk:async()=>{var y,u;if((n==null?void 0:n.length)===0){const x=i("maker.publishSelectPagesMessage");throw A.default.error(x),new Error(x)}for(const x of n??d.pageIds){const I=d.pages[x];if(I){const P=(u=(y=v.checkPage(i,I,d))==null?void 0:y[0])==null?void 0:u.message;if(P)throw A.default.error(P),new Error(P)}}localStorage.setItem(v.getProjectPageVersionKey(p??""),String(new Date().getTime())),h(!0);try{await E.publishPages({mode:t,pages:n}),A.default.success(i("maker.publishSuccessMessage"))}catch(x){throw A.default.error(x.message),x}finally{h(!1)}}})},[t,d,i,p,T]);c.useImperativeHandle(b,()=>({openPublishDialog:f}));const k=c.useCallback(()=>{f()},[f]);return e.jsxs(e.Fragment,{children:[e.jsx(q.LoadingButton,{color:"primary",variant:"contained",size:"small",sx:{mr:1},onClick:k,loading:m,disabled:m,children:i("maker.publishToProduction")}),g]})});function V({state:t,toMode:d,onChange:b,defaultPageIds:i}){const{t:m,locale:h}=D.useLocaleContext(),[g,T]=c.useState(!1),[p,f]=c.useState(()=>i?Object.fromEntries(i.map(r=>[r,!0])):{}),{loading:k,error:L,value:n}=_.useAsync(()=>E.getPages({mode:d}),[d]);if(L)throw L;const y=c.useMemo(()=>JSON.parse(JSON.stringify(t.pageIds)).sort((a,j)=>{const o=t.pages[a],l=t.pages[j];return o!=null&&o.publishedAt&&new Date(o.publishedAt).getTime()<new Date(o.updatedAt).getTime()?-1:l!=null&&l.publishedAt&&new Date(l.publishedAt).getTime()<new Date(l.updatedAt).getTime()?1:new Date((o==null?void 0:o.updatedAt)??"").getTime()-new Date((l==null?void 0:l.updatedAt)??"").getTime()}),[t]),u=c.useMemo(()=>n?C.default(n.pageIds,t.pageIds):[],[t,n]),x=c.useMemo(()=>[...t.pageIds].concat(u),[t,u]),I=c.useCallback(r=>{f(a=>{const j=W.produce(a,o=>{g?(Object.assign(o,Object.fromEntries(x.map(l=>[l,!0]))),delete o[r]):o[r]?(delete o[r],u.includes(r)&&t.pageIds.filter(l=>{var w,B;return((w=t.pages[l])==null?void 0:w.slug)===((B=n==null?void 0:n.pages[r])==null?void 0:B.slug)}).forEach(l=>{delete o[l]})):(o[r]=!0,t.pageIds.includes(r)&&u.filter(l=>{var w,B;return((w=n==null?void 0:n.pages[l])==null?void 0:w.slug)===((B=t.pages[r])==null?void 0:B.slug)}).forEach(l=>{o[l]=!0}))});return T(C.default(x,Object.keys(j)).length===0),j})},[g,x,u,t,n]),P=c.useCallback(()=>{T(r=>(r&&f({}),!r))},[p]);return c.useEffect(()=>{b(g?null:Object.keys(p))},[g,p,b]),k?e.jsx(N.Loading,{sx:{my:4}}):e.jsxs(s.List,{disablePadding:!0,sx:{maxWidth:500},children:[e.jsx(s.ListItem,{sx:{position:"sticky",top:0,bgcolor:"background.paper",zIndex:1},disablePadding:!0,children:e.jsxs(s.ListItemButton,{onClick:P,dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g,tabIndex:-1})}),e.jsx(s.ListItemText,{primary:m("common.all")})]})}),y.map(r=>{var l,w;const a=t.pages[r];if(!a)return null;const j=v.checkPage(m,a,t),o=!a.publishedAt||a.updatedAt&&new Date(a.updatedAt).getTime()>new Date(a.publishedAt).getTime();return e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsxs(e.Fragment,{children:[o&&e.jsx(s.Tooltip,{title:m("maker.pages.needPublish"),children:e.jsx(S.Sync,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),!a.isPublic&&e.jsx(s.Tooltip,{title:m("maker.pages.notPublic"),children:e.jsx(S.VisibilityOff,{fontSize:"small",sx:{color:"warning.main",fontSize:16,mr:.35}})}),j&&e.jsx(v.PageErrorTip,{errors:j,children:e.jsx(S.Warning,{sx:{color:"error.dark",mr:.35}})})]}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(w=(l=a.locales)==null?void 0:l[h])==null?void 0:w.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r)}),u.map(r=>{var j,o;const a=n==null?void 0:n.pages[r];return a?e.jsx(s.ListItem,{disablePadding:!0,secondaryAction:e.jsx(s.Chip,{color:"warning",label:"deleted",size:"small"}),children:e.jsxs(s.ListItemButton,{onClick:()=>I(r),dense:!0,children:[e.jsx(s.ListItemIcon,{children:e.jsx(s.Checkbox,{edge:"start",checked:g||!!p[r],tabIndex:-1})}),e.jsx(s.ListItemText,{primary:a.slug,secondary:(o=(j=a.locales)==null?void 0:j[h])==null?void 0:o.title,primaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"},secondaryTypographyProps:{noWrap:!0,textOverflow:"ellipsis"}})]})},r):null})]})}exports.default=J;