@blocklet/pages-kit-inner-components 0.4.157 → 0.4.158

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),R=require("./chunks/state-D4MG-uJB.js"),De=require("@arcblock/ux/lib/Empty"),_=require("@arcblock/ux/lib/Locale/context"),ie=require("@blocklet/code-editor"),Ee=require("@mui/icons-material/AddRounded"),Ve=require("@mui/icons-material/ArrowDownward"),ze=require("@mui/icons-material/ArrowUpward"),Ae=require("@mui/icons-material/DeleteOutline"),r=require("@mui/material"),Ne=require("lodash/sortBy"),C=require("react"),ke=require("react-use"),ye=require("@blocklet/pages-kit/builtin/color-picker"),qe=require("./chunks/config-string-DnwpUGUo.js"),Fe=require("lodash/isEmpty"),Ue=require("lodash/set"),Me=require("yaml"),F=require("@blocklet/pages-kit/builtin/uploader"),We=require("lodash/cloneDeep"),Ke=require("@arcblock/ux/lib/Toast"),Q=require("@blocklet/pages-kit/components"),Le=require("@blocklet/pages-kit/utils/property"),Se=require("@mui/base"),D=require("@mui/icons-material"),Y=require("@syncedstore/core"),Pe=require("ahooks"),Je=require("lodash/assign"),He=require("lodash/get"),Ye=require("lodash/has"),$e=require("lodash/isEqual"),Ge=require("lodash/isNil"),Qe=require("lodash/isObject"),Xe=require("lodash/keyBy"),Ze=require("lodash/omit"),et=require("lodash/pick"),tt=require("lodash/reduce"),z=require("material-ui-popup-state/hooks"),rt=require("react-error-boundary"),st=require("@emotion/css"),te=require("react-dnd"),T=e=>e&&e.__esModule?e:{default:e};function lt(e){if(e&&e.__esModule)return e;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(s,l,o.get?o:{enumerable:!0,get:()=>e[l]})}}return s.default=e,Object.freeze(s)}const Z=T(De),ot=T(Ee),it=T(Ve),nt=T(ze),ct=T(Ae),E=T(Ne),ne=T(Fe),we=T(Ue),re=lt(Me),at=T(We),se=T(Ke),ut=T(Je),dt=T(He),pt=T(Ye),mt=T($e),X=T(Ge),xt=T(Qe),ft=T(Xe),jt=T(Ze),bt=T(et),ht=T(tt);function yt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"warning",variant:"outlined",disabled:s,onClick:e,...o,children:t.jsx(ct.default,{fontSize:"small"})})}function gt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...o,children:t.jsx(nt.default,{fontSize:"small"})})}function vt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...o,children:t.jsx(it.default,{fontSize:"small"})})}function kt({label:e,value:s,onChange:l,disabled:o=!1,itemLabel:p="",emptyHeight:h=40,property:d,renderItem:g,...v}){const{t:b,locale:P}=_.useLocaleContext(),y=ke.useUpdate(),i=C.useCallback(m=>{l(R.transformValue(m,d.type))},[l,d.type]),n=C.useMemo(()=>Array.isArray(s)?s:[],[s]),c=C.useCallback(()=>{const m=[...n,""];i(m),y()},[n,i,y]),u=C.useCallback(()=>{if(!d||!d.subProperties)return c();const m={};E.default(Object.values(d.subProperties),"index").forEach(({data:B})=>{var A,N;if(!B.key)return;const V=((N=(A=B.locales)==null?void 0:A[P])==null?void 0:N.defaultValue)??"";m[B.key]=V});const O=[...n,m];i(O),y()},[n,i,y,d,P,c]),x=C.useCallback(m=>{try{const w=JSON.parse(m);Array.isArray(w)?i(w):console.error("JSON解析结果不是数组")}catch(w){console.error("JSON解析错误:",w)}},[i]),S=C.useCallback(m=>{const w=n.filter((O,B)=>B!==m);i(w),y()},[n,i,y]),a=C.useCallback(m=>{if(m<=0)return;const w=[...n],O=w[m];w[m]=w[m-1],w[m-1]=O,i(w),y()},[n,i,y]),j=C.useCallback(m=>{if(m>=n.length-1)return;const w=[...n],O=w[m];w[m]=w[m+1],w[m+1]=O,i(w),y()},[n,i,y]),f=C.useCallback((m,w)=>{const O=[...n];O[m]=w,i(O)},[n,i]),k=d&&d.subProperties&&Object.keys(d.subProperties).length>0,I=C.useMemo(()=>[{field:"index",headerName:"#",width:40,align:"center",renderCell:({index:m})=>t.jsx(r.Typography,{variant:"body1",sx:{bgcolor:"action.hover",borderRadius:"50%",width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:m+1})},{field:"content",headerName:"",renderCell:({row:m,index:w})=>g&&k?g({item:m,index:w,property:d,onChange:O=>f(w,O)}):t.jsx(r.TextField,{fullWidth:!0,size:"small",disabled:o,value:m,placeholder:p||`${b("item")} ${w+1}`,onChange:O=>f(w,O.target.value),...v})},{field:"actions",headerName:"",width:30,align:"center",renderCell:({index:m})=>t.jsxs(r.Stack,{direction:"column",spacing:.25,children:[t.jsx(gt,{disabled:o||m===0,onClick:()=>a(m)}),t.jsx(vt,{disabled:o||m===n.length-1,onClick:()=>j(m)}),t.jsx(yt,{disabled:o,onClick:()=>S(m)})]})}],[g,k,d,f,p,b,o,v,S,a,j,n.length]);return k?t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),n.length>0?t.jsx(r.TableContainer,{component:r.Paper,variant:"outlined",sx:{borderRadius:1,mb:1},children:t.jsxs(r.Table,{size:"small",sx:{"& .MuiTableCell-root":{py:.25,px:1,whiteSpace:"nowrap"},"& .MuiTableCell-head":{backgroundColor:"action.hover",py:.25,px:1},borderCollapse:"collapse"},children:[t.jsx(r.TableHead,{sx:{display:"none"},children:t.jsx(r.TableRow,{children:I.map(m=>t.jsx(r.TableCell,{width:m.width,align:m.align||"left",sx:{fontWeight:"bold"},children:m.renderHeader?m.renderHeader():m.headerName},m.field))})}),t.jsx(r.TableBody,{children:n.map((m,w,O)=>t.jsx(r.TableRow,{sx:{borderBottom:w<O.length-1?"1px solid":"none",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:I.map(B=>t.jsx(r.TableCell,{width:B.width,align:B.align||"left",sx:{borderBottom:"none"},children:B.renderCell({row:m,index:w,onChange:V=>f(w,V)})},`${w}-${B.field}`))},w))})]})}):t.jsx(Z.default,{style:{fontSize:12,height:h},children:b("maker.properties.arrayEmpty")}),t.jsx(r.Button,{fullWidth:!0,size:"small",variant:"outlined",disabled:o,startIcon:t.jsx(ot.default,{}),onClick:u,children:b("maker.properties.addArrayItem")})]}):t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,minHeight:150},children:t.jsx(ie.CodeEditor,{keyId:d.id,locale:P,language:"json",value:JSON.stringify(n,null,2),onChange:m=>x(m||""),fullScreenOptions:{enableEscExit:!0,targetContainer:()=>document.getElementById("parameters-config-dialog")||null}},d.id)})]})}function St({value:e,onChange:s,...l}){const o=C.useRef(null);return t.jsxs(t.Fragment,{children:[t.jsx(qe.ConfigString,{...l,value:e,onChange:s,InputProps:{endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(ye.ColorItem,{color:e??"",style:{width:"1.5rem",height:"1.5rem",padding:0},onClick:()=>{var p;(p=o.current)==null||p.open({value:e??""})}})})}}),t.jsx(ye.ConfigColorDialog,{ref:o,onSave:({value:p},h)=>{s(p),h()}})]})}function Pt({label:e,value:s,onChange:l,property:o,component:p,defaultLocale:h,allComponents:d,PropertyValueField:g,onUpload:v}){const{locale:b}=_.useLocaleContext(),P=C.useRef(null);if(!ne.default(o.subProperties)){const i=E.default(Object.values(o.subProperties||{}),"index").filter(n=>n.data.visible!==!1&&n.data.key);return t.jsxs(r.Stack,{width:"100%",children:[t.jsx(r.FormLabel,{sx:{px:.25,py:.5},children:e}),t.jsx(r.Box,{children:t.jsx(r.Box,{sx:{position:"relative"},children:i.map((n,c)=>{const{data:u}=n,x=u.key??u.id,S=c===i.length-1;let a=null;try{s&&typeof s=="object"?a=s[x]:typeof s=="string"&&(a=(o.type==="yaml"?re.parse(s||""):JSON.parse(s||"{}"))[x])}catch{}a==null&&(u.locales&&b&&u.locales[b]?a=u.locales[b].defaultValue:u.locales&&h&&u.locales[h]&&(a=u.locales[h].defaultValue));const j=k=>{try{let I={};if(typeof s=="string")try{I=o.type==="yaml"?re.parse(s||""):JSON.parse(s||"{}")}catch{}else typeof s=="object"&&s!==null&&(I={...s});we.default(I,x,k);const m=R.transformValue(I,o.type);l==null||l(m)}catch(I){console.error("Error updating property:",I)}},f=8;return t.jsxs(r.Box,{sx:{mb:S?0:1,display:"flex",flexDirection:"row"},children:[t.jsxs(r.Box,{sx:{position:"relative",width:24,flexShrink:0},children:[t.jsx(r.Box,{sx:{position:"absolute",left:f,top:0,height:16,width:0,borderLeft:"1px dashed",borderColor:"divider"}}),t.jsx(r.Box,{sx:{position:"absolute",left:f,top:16,width:12,height:0,borderTop:"1px dashed",borderColor:"divider"}}),!S&&t.jsx(r.Box,{sx:{position:"absolute",left:f,top:16,bottom:-8,width:0,borderLeft:"1px dashed",borderColor:"divider"}})]}),t.jsx(r.Box,{sx:{flexGrow:1},children:t.jsx(g,{component:p,property:u,value:a,onChange:j,size:"small",fullWidth:!0,defaultLocale:h,allComponents:d})})]},u.id)})})})]})}return t.jsx(r.Stack,{width:"100%",gap:2,children:t.jsxs(r.Stack,{sx:{width:"100%",position:"relative",pt:1,pb:"6px",px:"1px",minHeight:50,".monaco-editor,.overflow-guard":{borderRadius:1}},children:[t.jsx(r.FormLabel,{sx:{position:"absolute",left:0,top:0,transform:"translate(0px, -7px) scale(0.75)"},children:e}),t.jsx(ie.CodeEditor,{keyId:o.id,locale:b,language:o.type==="yaml"?"yaml":"json",value:typeof s=="string"?s:"",onChange:i=>{l==null||l(i)},onUpload:i=>{P.current=i,v&&v(i)},fullScreenOptions:{enableEscExit:!0,targetContainer:()=>document.getElementById("parameters-config-dialog")||null}},o.id),t.jsx(r.Box,{component:"fieldset",sx:{pointerEvents:"none",position:"absolute",left:0,top:-5,width:"100%",height:"100%",border:1,borderColor:"rgba(0, 0, 0, 0.23)",borderRadius:1,px:1,py:0},children:t.jsx(r.Box,{component:"legend",sx:{fontSize:"0.75em"},children:t.jsx(r.Box,{component:"span",sx:{opacity:0},children:e})})})]})})}const wt=["string","multiline","json","yaml","url","component","custom"];function ge(e){return e.type?!wt.includes(e.type):!1}function Ie({disabled:e,list:s,renderItem:l,...o}){const p=C.useRef(null),h=C.useId(),d=Pe.useUpdate(),g=E.default(Object.entries(s),n=>n[1].index).map(n=>n[0]),v=C.useRef(g),b=C.useCallback(n=>{v.current=n,d()},[d]),P=C.useCallback(({index:n},{index:c})=>{const u=[...v.current];u.splice(c,0,...u.splice(n,1)),b(u)},[b]);C.useEffect(()=>{b(g)},[g.join("-")]);const[{isOver:y},i]=te.useDrop({accept:h,collect:n=>({isOver:n.isOver()}),canDrop:()=>!e,drop:()=>{var u;const n=()=>{v.current.forEach((x,S)=>{const a=s[x];a&&(a.index=S)})},c=(u=Y.getYjsValue(s))==null?void 0:u.doc;c?c.transact(()=>{n()}):n()}});return C.useEffect(()=>{y||b(g)},[y]),i(p),t.jsx(r.Box,{...o,ref:p,className:st.cx(y&&"isDragging"),children:v.current.map((n,c)=>t.jsx(It,{type:h,disabled:e,id:n,index:c,itemIndex:u=>v.current.indexOf(u),move:P,children:u=>{const x=s[n];return x?l(x.data,c,u):null}},n))})}function It({disabled:e,id:s,index:l,type:o,children:p,itemIndex:h,move:d}){const g=C.useRef(),[{isDragging:v},b,P]=te.useDrag({type:o,item:()=>({id:s}),canDrag:()=>!e,collect:i=>({isDragging:i.isDragging()})}),[,y]=te.useDrop({accept:o,canDrop:()=>!e,hover(i,n){var f;if(!g.current)return;const c=h(i.id),u=l;if(c===u)return;const x=(f=g.current)==null?void 0:f.getBoundingClientRect(),S=(x.bottom-x.top)/2,j=n.getClientOffset().y-x.top;c<u&&j<S||c>u&&j>S||d({id:i.id,index:c},{id:s,index:l})}});return typeof p=="function"?p({isDragging:v,drag:b,drop:i=>(g.current=i,y(i)),preview:P}):(b(y(P(g))),t.jsx(r.Box,{ref:g,children:p}))}function Ct({drop:e,preview:s,drag:l,disabled:o,isDragging:p,children:h,onDelete:d,onVisibilityChange:g,visible:v=!0,actions:b,alwaysShowActions:P=!1}){const{t:y}=_.useLocaleContext();return t.jsx(r.Box,{ref:e,sx:{":hover .hover-visible":{maxWidth:"100%"},opacity:v?1:.5},children:t.jsxs(r.Box,{sx:{position:"relative"},children:[t.jsx(r.Box,{ref:s,sx:{flex:1,borderRadius:.5,bgcolor:p?"action.hover":"background.paper",opacity:.9999},children:h}),!o&&t.jsx(r.Box,{className:P?"":"hover-visible",sx:{maxWidth:P?"100%":0,overflow:"hidden",position:"absolute",right:2,top:2,transition:"max-width 0.3s ease-in-out"},children:t.jsxs(r.Stack,{direction:"row",sx:{bgcolor:i=>r.alpha(i.palette.grey[200],.9),borderRadius:1,p:.5,[`.${r.buttonClasses.root}`]:{minWidth:24,width:24,height:24,p:0}},children:[b,g&&t.jsx(r.Tooltip,{title:y(v?"hideParameter":"showParameter"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:()=>g(!v),children:v?t.jsx(D.VisibilityOffRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}}):t.jsx(D.VisibilityRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),d&&t.jsx(r.Tooltip,{title:y("delete"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:d,children:t.jsx(D.DeleteOutlineRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),t.jsx(r.Tooltip,{title:y("dragSort"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{ref:l,children:t.jsx(D.DragIndicatorRounded,{sx:{color:"grey.500"}})})})]})})]})})}function Ot({label:e,value:s,onChange:l}){const[o,p]=C.useState(!1);return t.jsxs(r.Stack,{gap:1,children:[t.jsx(r.TextField,{label:e,size:"small",value:s,onChange:h=>l==null?void 0:l(h.target.value),InputProps:{endAdornment:t.jsx(F.UploaderButton,{onChange:({response:h})=>{var g;const d=(g=h==null?void 0:h.data)==null?void 0:g.filename;d&&(l==null||l(d))}})}}),s&&t.jsx(r.Box,{component:"img",sx:{objectFit:"contain",borderRadius:1,cursor:"pointer"},src:R.getImageAbsoluteUrl(s),alt:e,maxWidth:100,maxHeight:100,width:"100%",onClick:()=>p(!0)}),t.jsx(r.Dialog,{open:o,onClose:()=>p(!1),children:t.jsx(r.Box,{component:"img",sx:{objectFit:"contain"},src:R.getImageAbsoluteUrl(s),alt:e})})]})}function le(e,s=""){return ht.default(e,(l,o,p)=>{const h=s?`${s}.${p}`:p;return xt.default(o)?ut.default(l,le(o,h)):l[h]=o,l},{})}const Tt=[{value:"string",label:"Text"},{value:"multiline",label:"Text (Multiline)"},{value:"number",label:"Number"},{value:"decimal",label:"Decimal"},{value:"boolean",label:"Boolean"},{value:"color",label:"Color"},{value:"url",label:"URL (Upload)"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"array",label:"Array"},{value:"component",label:"Component"},{value:"custom",label:"Custom (Render by a Component)"}];function G(e,s,l){return!e||!l?!1:Object.values(e).some(({data:o})=>o.id!==s&&o.key===l)}function oe(e,s){var l;return!e||!s?!1:((l=e[s])==null?void 0:l.data.visible)??!0}function Bt({componentId:e}){const{state:{components:s}}=R.useStore(),l=s[e],o=l==null?void 0:l.data;return o?t.jsx(r.Stack,{maxHeight:"100%",overflow:"auto",children:t.jsx(r.Box,{p:2,children:t.jsx(rt.ErrorBoundary,{FallbackComponent:R.ErrorView,resetKeys:[e],children:t.jsx(Rt,{value:o})})})}):null}function Rt({value:e}){var b,P,y;const{t:s}=_.useLocaleContext(),{localState:{currentLocale:l,customComponentPreviewerProperties:o},state:{config:{defaultLocale:p}},localActions:{setCustomComponentPreviewerProperties:h}}=R.useStore(),d=Y.getYjsValue(e).doc,g=R.useAllComponents(),v=Pe.useReactive({propertiesValue:{...h}});return C.useEffect(()=>{const i=Object.fromEntries(Object.values(e.properties??{}).map(({data:n})=>{var c,u,x,S,a;return[n.id,{value:((c=v.propertiesValue[n.id])==null?void 0:c.value)??Le.parsePropertyValue(n,((x=(u=n.locales)==null?void 0:u[l])==null?void 0:x.defaultValue)??((a=(S=n.locales)==null?void 0:S[p])==null?void 0:a.defaultValue),{locale:l,defaultLocale:p})}]}));h(i)},[JSON.stringify(v.propertiesValue)]),t.jsx(r.Stack,{height:"100%",children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(Ce,{config:e}),t.jsx(Te,{config:e,currentLocale:l,defaultLocale:p,allComponents:g,onUpdateConfig:i=>{d.transact(()=>{i(e)})}}),t.jsxs(r.Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("renderer")}),t.jsxs(r.TextField,{hiddenLabel:!0,size:"small",select:!0,SelectProps:{autoWidth:!0},value:((b=e.renderer)==null?void 0:b.type)||"react-component",onChange:i=>{d.transact(()=>{const n=i.target.value;e.renderer??(e.renderer={type:n}),e.renderer.type=n})},children:[t.jsx(r.MenuItem,{value:"react-component",children:"React Component"}),t.jsx(r.MenuItem,{value:"component",children:"Custom Component"})]})]}),((P=e.renderer)==null?void 0:P.type)==="component"&&t.jsx(Nt,{value:e}),((y=e.renderer)==null?void 0:y.type)==="react-component"&&t.jsx(At,{value:e}),t.jsx(ce,{config:e,currentLocale:l,defaultLocale:p,allComponents:g,propertiesValue:o,onChange:({value:i,id:n,path:c})=>{const u=[...c,"data"];if(!dt.default(e,u)){se.default.warning(s("cannotFindPropertyKey",{key:u.join(".")}));return}v.propertiesValue[n]={value:i.value}}})]})})}function Ce({config:e}){const{t:s}=_.useLocaleContext();return t.jsx(F.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("basicInfo")}),t.jsx(r.TextField,{label:s("name"),size:"small",value:e.name||"",onChange:l=>e.name=l.target.value}),t.jsx(r.TextField,{label:s("description"),size:"small",multiline:!0,minRows:2,maxRows:10,inputProps:{maxLength:200},value:e.description||"",onChange:l=>e.description=l.target.value}),t.jsx(r.Autocomplete,{size:"small",options:[],multiple:!0,freeSolo:!0,value:e.tags??[],onChange:(l,o)=>e.tags=o,renderInput:l=>t.jsx(r.TextField,{label:s("tags"),...l})}),t.jsx(Ot,{label:s("previewImage"),value:e.previewImage||"",onChange:l=>e.previewImage=l})]})})}function Oe({data:e,params:s,visible:l,config:o,currentLocale:p,defaultLocale:h,allComponents:d,onUpdateConfig:g}){var P,y,i,n,c,u;const{t:v}=_.useLocaleContext(),b=C.useMemo(()=>e.type==="json"||e.type==="yaml"||e.type==="array"?Vt:U,[e.type]);return t.jsx(Ct,{preview:s.preview,drop:s.drop,drag:s.drag,isDragging:s.isDragging,onDelete:()=>{g(x=>{if(x.properties){const a=Object.entries(x.properties).sort(([,f],[,k])=>f.index-k.index);delete x.properties[e.id],a.filter(([f])=>f!==e.id).forEach(([,f],k)=>{f.index=k})}})},visible:l,onVisibilityChange:x=>{g(S=>{const a=S.properties[e.id].data;a.visible=x})},alwaysShowActions:!0,children:t.jsxs(r.Stack,{direction:"column",gap:2,children:[t.jsx(r.TextField,{label:v("key"),size:"small",required:!0,sx:{width:"calc(100% - 80px - 8px)",flex:1,"& .MuiOutlinedInput-root":{borderColor:e.key?G(o.properties,e.id,e.key)?"warning.main":void 0:"error.main"},"& .MuiFormLabel-root":{color:e.key?G(o.properties,e.id,e.key)?"warning.main":"text.secondary":"error.main"},"& .MuiFormLabel-root.Mui-focused":{color:e.key?G(o.properties,e.id,e.key)?"warning.main":"primary.main":"error.main"}},value:e.key||"",onChange:x=>{g(S=>{const a=S.properties[e.id].data;a.key=x.target.value.trim()})},InputProps:{endAdornment:!e.key||e.key&&G(o.properties,e.id,e.key)?t.jsx(r.InputAdornment,{position:"end",sx:{width:16,ml:0},children:t.jsx(r.Tooltip,{title:e.key?v("duplicateKey"):v("requiredKey"),children:t.jsx(D.InfoRounded,{sx:{color:e.key?"warning.main":"error.main",fontSize:16}})})}):null}}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(r.TextField,{label:v("label"),size:"small",sx:{flex:1},value:(((y=(P=e.locales)==null?void 0:P[p])==null?void 0:y.name)??((n=(i=e.locales)==null?void 0:i[h])==null?void 0:n.name))||"",onChange:x=>{g(S=>{var j;const a=S.properties[e.id].data;a.locales??(a.locales={}),(j=a.locales)[p]??(j[p]={}),a.locales[p].name=x.target.value})}}),t.jsx(r.TextField,{label:v("type"),size:"small",select:!0,sx:{flex:1},value:e.type==="string"&&e.multiline?"multiline":e.type||"string",onChange:x=>{g(S=>{const a=S.properties[e.id].data;if(a.locales)for(const f of Object.keys(a.locales))a.locales[f].defaultValue=void 0;const j=x.target.value;j==="multiline"?(a.type="string",a.multiline=!0):(typeof a.multiline<"u"&&delete a.multiline,a.type=j)})},children:Tt.map(x=>t.jsx(r.MenuItem,{value:x.value,children:x.label},x.value))})]}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(b,{allComponents:d,defaultLocale:h,component:o,property:e,label:v("defaultValue"),size:"small",fullWidth:!0,value:(u=(c=e.locales)==null?void 0:c[p])==null?void 0:u.defaultValue,onChange:(x,S)=>{g(a=>{var f;const j=a.properties[e.id].data;if(S!=null&&S.forceUpdateProperty){const k=le(j),I=le(x);Object.keys(I).forEach(m=>{k[m]||we.default(j,m,I[m])})}else j.locales??(j.locales={}),(f=j.locales)[p]??(f[p]={}),j.locales[p].defaultValue=x})}}),e.type==="custom"?t.jsx(r.Box,{children:t.jsx(Dt,{property:e,allComponents:d})}):null]})]})})}function _t(e,s){const[l,o]=C.useState(0);return C.useEffect(()=>{const h=setTimeout(()=>{if(e.current){let d=e.current.parentElement,g=0;for(;d;)d.classList.contains("property-container")&&g++,d=d.parentElement;o(g)}},100);return()=>clearTimeout(h)},[e,s]),l}function Te({config:e,currentLocale:s,defaultLocale:l,allComponents:o,onUpdateConfig:p,useI18nEditor:h=!0}){const{t:d}=_.useLocaleContext(),g=z.usePopupState({variant:"dialog"}),v=e.properties&&E.default(Object.values(e.properties),"index");return t.jsx(F.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsxs(r.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:"space-between",children:[t.jsx(r.Typography,{variant:"subtitle1",children:d("properties")}),t.jsx(r.Box,{flex:1}),h&&t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...z.bindTrigger(g),children:t.jsx(D.TranslateRounded,{fontSize:"small"})})]}),e.properties&&Object.keys(e.properties).length>0?t.jsx(Ie,{component:r.Stack,gap:2,list:e.properties,renderItem:(b,P,y)=>{const i=oe(e.properties,b.id);return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed",borderColor:"divider"},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Oe,{data:b,params:y,visible:i,config:e,currentLocale:s,defaultLocale:l,allComponents:o,onUpdateConfig:p})})},b.id)}}):t.jsx(Z.default,{style:{fontSize:12},children:d("maker.properties.noProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",onClick:()=>{p(b=>{var y;const P=R.nextId();b.properties??(b.properties={}),(y=b.properties)[P]??(y[P]={index:(v==null?void 0:v.length)||0,data:{id:P}})})},startIcon:t.jsx(D.AddRounded,{}),children:d("addObject",{object:d("property")})}),h&&t.jsx(Be,{...z.bindDialog(g),component:e})]})})}function Dt({property:e,allComponents:s}){const l=z.usePopupState({variant:"popper"});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{sx:{minWidth:0},...z.bindTrigger(l),children:t.jsx(D.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Popper,{...z.bindPopper(l),children:t.jsx(Se.ClickAwayListener,{onClickAway:l.close,children:t.jsx(r.Paper,{children:t.jsx(r.Box,{width:500,p:2,children:t.jsx(ee,{value:e.componentId,onChange:(o,p)=>e.componentId=p,allComponents:s})})})})})]})}function Et({value:e,valueImmutable:s,onChange:l,defaultLocale:o,allComponents:p}){var P;const[h,d]=C.useState(!1),{t:g,locale:v}=_.useLocaleContext(),b=typeof(e==null?void 0:e.componentId)=="string"?(P=p[e.componentId])==null?void 0:P.data:void 0;return b?t.jsxs(r.Box,{sx:{width:"100%",position:"relative"},children:[t.jsx(r.IconButton,{sx:{minWidth:0},disabled:!b,size:"small",onClick:()=>d(!h),color:h?"primary":"default",children:t.jsx(D.SettingsRounded,{fontSize:"small"})}),h&&t.jsx(r.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,sx:{width:"100%",zIndex:10},children:t.jsxs(r.Paper,{elevation:1,sx:{mt:1,p:2,borderRadius:1,border:"1px solid",borderColor:"divider",width:"100%"},children:[t.jsx(r.Box,{width:"100%",mb:2,children:t.jsx(ce,{config:b,currentLocale:v,defaultLocale:o,allComponents:p,propertiesValue:e==null?void 0:e.properties,onChange:({id:y,value:i})=>{const n=at.default(i.value),c=JSON.parse(JSON.stringify(e));c!=null&&c.componentId&&(s?l==null||l({...c,properties:{...c.properties,[y]:{value:n}}}):(c.properties=c.properties??{},c.properties[y]={value:n},l==null||l(c)))}})}),t.jsx(r.Button,{size:"small",onClick:()=>d(!1),sx:{mt:1},children:g("close")})]})})]}):null}function Be({type:e="properties",component:s,...l}){var y,i,n;const{t:o}=_.useLocaleContext(),{state:{components:p,supportedLocales:h,config:{defaultLocale:d}}}=R.useStore(),g=R.useAllComponents(),v=Y.getYjsValue(s).doc,b=e==="properties"?s.properties:e==="parameters"&&((y=s.renderer)==null?void 0:y.type)==="component"?(i=p[s.renderer.componentId])==null?void 0:i.data.properties:void 0,P=((n=s.renderer)==null?void 0:n.type)==="component"?s:void 0;return t.jsxs(r.Dialog,{...l,fullWidth:!0,maxWidth:"lg",children:[t.jsx(r.DialogTitle,{children:o("i18nEditorTitle")}),t.jsx(r.DialogContent,{children:b&&t.jsx(r.Stack,{children:t.jsxs(r.Table,{stickyHeader:!0,sx:{td:{verticalAlign:"top"}},children:[t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:h.map(({locale:c,name:u})=>t.jsxs(r.TableCell,{children:[u,d===c&&t.jsx(D.StarRounded,{sx:{fontSize:12,color:"text.secondary"}})]},c))})}),t.jsx(r.TableBody,{children:E.default(Object.values(b),"index").map(({data:c})=>t.jsx(r.TableRow,{children:h.map(({locale:u})=>{var x,S,a,j,f,k,I,m,w,O,B,V,A,N,$,W,K,L,J,H,ae,ue,de,pe,me,xe;return t.jsx(r.TableCell,{children:t.jsx(r.Stack,{gap:1,children:e==="properties"?t.jsxs(t.Fragment,{children:[t.jsx(r.TextField,{size:"small",label:"Key",value:c.key||"",onChange:M=>{v.transact(()=>{c.key=M.target.value.trim()})}}),t.jsx(r.TextField,{size:"small",label:o("label"),value:(((S=(x=c.locales)==null?void 0:x[u])==null?void 0:S.name)??((j=(a=c.locales)==null?void 0:a[d])==null?void 0:j.name))||"",onChange:M=>{v.transact(()=>{var q;c.locales??(c.locales={}),(q=c.locales)[u]??(q[u]={}),c.locales[u].name=M.target.value})}}),t.jsx(r.Box,{children:t.jsx(U,{allComponents:g,defaultLocale:d,component:s,property:c,size:"small",fullWidth:!0,label:"Default Value",valueImmutable:X.default((k=(f=c.locales)==null?void 0:f[u])==null?void 0:k.defaultValue),value:((m=(I=c.locales)==null?void 0:I[u])==null?void 0:m.defaultValue)??((O=(w=c.locales)==null?void 0:w[d])==null?void 0:O.defaultValue),onChange:M=>{v.transact(()=>{var q;c.locales??(c.locales={}),(q=c.locales)[u]??(q[u]={}),c.locales[u].defaultValue=M})}})})]}):e==="parameters"&&P?t.jsx(r.Box,{children:t.jsx(U,{allComponents:g,defaultLocale:d,component:s,property:c,size:"small",fullWidth:!0,valueImmutable:X.default((N=(A=(V=(B=P.renderer.properties)==null?void 0:B[c.id])==null?void 0:V.locales)==null?void 0:A[u])==null?void 0:N.value),value:((L=(K=(W=($=P.renderer.properties)==null?void 0:$[c.id])==null?void 0:W.locales)==null?void 0:K[u])==null?void 0:L.value)??((ue=(ae=(H=(J=P.renderer.properties)==null?void 0:J[c.id])==null?void 0:H.locales)==null?void 0:ae[d])==null?void 0:ue.value)??((pe=(de=c.locales)==null?void 0:de[u])==null?void 0:pe.defaultValue)??((xe=(me=c.locales)==null?void 0:me[d])==null?void 0:xe.defaultValue),onChange:M=>{v.transact(()=>{var q,fe,je,be,he;(q=P.renderer).properties??(q.properties={}),(fe=P.renderer.properties)[je=c.id]??(fe[je]={}),(be=P.renderer.properties[c.id]).locales??(be.locales={}),(he=P.renderer.properties[c.id].locales)[u]??(he[u]={}),P.renderer.properties[c.id].locales[u].value=M})}})}):null},c.id)},u)})},c.id))})]})})}),t.jsx(r.DialogActions,{children:t.jsx(r.Button,{onClick:c=>{var u;return(u=l.onClose)==null?void 0:u.call(l,c,"escapeKeyDown")},children:o("close")})})]})}const ve=(e,s)=>l=>{const o=[l.palette.info.main,l.palette.primary.main,l.palette.secondary.main,l.palette.success.main,l.palette.warning.main],p=Math.min(o.length-1,e),h=o[p],d=r.alpha(h,.5),g=r.alpha(h,1);return{borderColor:`${d} !important`,borderLeft:"3px solid !important",borderLeftColor:d,color:g,...s}};function Vt({property:e,onChange:s,defaultLocale:l,allComponents:o}){const{t:p,locale:h}=_.useLocaleContext(),d=C.useRef(null),g=_t(d,e),v=C.useCallback(()=>{if(!(e.type!=="json"&&e.type!=="yaml"&&e.type!=="array")&&e.subProperties)try{let b={};E.default(Object.values(e.subProperties),"index").filter(i=>i.data.visible!==!1&&i.data.key).forEach(({data:i})=>{var c,u,x,S;if(!i.key)return;let n=((u=(c=i.locales)==null?void 0:c[h])==null?void 0:u.defaultValue)??((S=(x=i.locales)==null?void 0:x[l])==null?void 0:S.defaultValue);if(i.type==="number")n=Number(n);else if(i.type==="boolean")n=n===!0||n==="true";else if((i.type==="json"||i.type==="yaml")&&typeof n=="string")try{i.type==="json"?n=JSON.parse(n):n=re.parse(n)}catch(a){console.error("Error parsing nested value",n,a),n={}}b[i.key]=n}),e.type==="array"&&!Array.isArray(b)&&(b=ne.default(b)?[]:[b]);const y=R.transformValue(b,e.type);s==null||s(y)}catch(b){console.error("Error converting structure to text:",b)}},[e,h,l,s]);return e.type!=="json"&&e.type!=="yaml"&&e.type!=="array"?null:t.jsxs(r.Stack,{direction:"column",gap:1.5,sx:{width:"100%"},ref:d,children:[t.jsx(r.Divider,{sx:{mt:-1},children:t.jsx(r.Typography,{variant:"caption",color:"text.secondary",children:p("maker.properties.subProperties")})}),e.subProperties&&Object.keys(e.subProperties).length>0?t.jsx(Ie,{component:r.Stack,gap:2,list:e.subProperties,renderItem:(b,P,y)=>{const i=b.visible!==!1;return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed","&":ve(g)},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Oe,{data:b,params:y,visible:i,config:{properties:e.subProperties},currentLocale:h,defaultLocale:l,allComponents:o,onUpdateConfig:n=>{try{const c={properties:e.subProperties||{}};n(c);const u={...e,subProperties:c.properties};s==null||s(u,{forceUpdateProperty:!0}),v()}catch(c){console.error("Error updating property:",c)}}})})},b.id)}}):t.jsx(Z.default,{style:{fontSize:12,height:100},children:p("maker.properties.noSubProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",size:"small",startIcon:t.jsx(D.AddRounded,{}),onClick:()=>{try{const b=e.subProperties||{},P=R.nextId(),i={index:Object.values(b).length,data:{id:P,key:"",type:"string",visible:!0,locales:{[h]:{name:"",defaultValue:""}},subProperties:{}}},n={...e,subProperties:{...b,[P]:i}};s==null||s(n,{forceUpdateProperty:!0}),v()}catch(b){console.error("Error adding property:",b)}},sx:{"&":ve(g,{})},children:p("maker.properties.addSubProperty")})]})}function U({component:e,property:s,value:l,onChange:o,valueImmutable:p,defaultLocale:h,allComponents:d,...g}){var n,c,u,x,S;const{locale:v}=_.useLocaleContext(),b=F.useUploader(),P=C.useRef(null),y=()=>{var j;const a=(j=b==null?void 0:b.current)==null?void 0:j.getUploader();a==null||a.open(),P.current&&a.onceUploadSuccess(({response:f})=>{var I,m;let k=((I=f==null?void 0:f.data)==null?void 0:I.filename)||"";k&&(k=`mediakit://${k}`,l&&!l.includes("mediakit://")&&(k+=" # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")),(m=P.current)==null||m.call(P,k)})},i=g.label??(((c=(n=s.locales)==null?void 0:n[v])==null?void 0:c.name)||((x=(u=s.locales)==null?void 0:u[h])==null?void 0:x.name)||s.key||s.id);if(s.type==="number")return t.jsx(zt,{...g,label:i,NumberProps:{value:["number","string"].includes(typeof l)?l:null,onChange:(a,j)=>o==null?void 0:o(j)}});if(s.type==="decimal")return t.jsx(r.TextField,{...g,label:i,type:"text",value:l??"",onChange:a=>{const j=a.target.value;if(j===""||j==="-"){o==null||o(j);return}if(/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(j)){let k=j;/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(k)&&(k=Number(k)),o==null||o(k)}}});if(s.type==="boolean")return t.jsx(r.FormControlLabel,{label:i,labelPlacement:"start",control:t.jsx(r.Switch,{checked:l===!0,onChange:(a,j)=>o==null?void 0:o(j)})});if(s.type==="color")return t.jsx(St,{label:i,value:l,onChange:a=>{o==null||o(a)}});if(s.type==="json"||s.type==="yaml")return t.jsx(Pt,{label:i,value:l,onChange:a=>{o==null||o(a)},property:s,component:e,defaultLocale:h,allComponents:d,PropertyValueField:U,onUpload:a=>{P.current=a,y()}});if(s.type==="custom"){const a=(S=d[s.componentId])==null?void 0:S.data;return a?t.jsx(r.Box,{width:"100%",children:t.jsx(Q.CustomComponentRenderer,{componentId:a.id,props:{label:i,value:l,onChange:o},locale:v,dev:{mode:"draft",components:d,defaultLocale:h}})}):t.jsx(r.TextField,{...g,label:i,disabled:!0,placeholder:"Click right button select a component"})}if(s.type==="component")return t.jsxs(r.Stack,{width:"100%",direction:"column",gap:1,children:[t.jsx(ee,{allComponents:d,label:i,value:l==null?void 0:l.componentId,onChange:(a,j)=>{p||!l?o==null||o({...l&&JSON.parse(JSON.stringify(l)),componentId:j}):typeof l=="object"&&(l.componentId=j,o==null||o({...l&&JSON.parse(JSON.stringify(l)),componentId:j}))}}),(l==null?void 0:l.componentId)&&t.jsx(Et,{value:l,valueImmutable:p,onChange:o,defaultLocale:h,allComponents:d})]});if(!s.type||["string","url","multiline"].includes(s.type)){let a=s.type==="string"?s.multiline:void 0;s.type==="multiline"&&(a=!0);const j=s.type==="url"?l==null?void 0:l.url:l;return t.jsx(r.TextField,{...g,label:i,value:typeof j=="string"?j:"",multiline:a,minRows:a?2:void 0,maxRows:a?10:void 0,onChange:f=>o==null?void 0:o(s.type==="url"?{...l,url:f.target.value,mediaKitUrl:f.target.value}:f.target.value),InputProps:s.type==="url"?{sx:{pr:0},endAdornment:t.jsxs(r.InputAdornment,{position:"end",children:[t.jsx(F.UploaderButton,{onChange:async({response:f})=>{var w,O,B;const k=((w=f==null?void 0:f.data)==null?void 0:w.url)||((O=f==null?void 0:f.data)==null?void 0:O.fileUrl);let I;k&&(I=await F.getImageSize(k).catch(()=>F.getVideoSize(k)).catch(()=>{}));let m=((B=f==null?void 0:f.data)==null?void 0:B.filename)||"";m&&(m=`mediakit://${m}`),o==null||o({url:k,mediaKitUrl:m,width:I==null?void 0:I.naturalWidth,height:I==null?void 0:I.naturalHeight})}}),t.jsx(r.Tooltip,{title:"If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.",children:t.jsx(D.InfoRounded,{sx:{cursor:"default",mr:1},fontSize:"small"})})]})}:void 0})}return s.type==="array"?t.jsx(kt,{label:i,value:Array.isArray(l)?l:[],onChange:a=>o==null?void 0:o(a),property:s,renderItem:({item:a,index:j,onChange:f})=>s.subProperties&&Object.keys(s.subProperties).length>0?t.jsx(r.Stack,{gap:1,width:"100%",children:E.default(Object.values(s.subProperties),"index").filter(k=>k.data.visible!==!1).map(({data:k})=>k.key?t.jsx(U,{component:e,property:k,value:a[k.key],onChange:I=>{const m={...a,[k.key]:I};f(m)},size:"small",fullWidth:!0,defaultLocale:h,allComponents:d},k.id):null)},j):t.jsx(r.TextField,{size:g.size,fullWidth:!0,value:a,onChange:k=>f(k.target.value)})}):(console.error("Unsupported property type",s.type),null)}function zt({NumberProps:e,...s}){const{getInputProps:l}=Se.unstable_useNumberInput(e),o=l();return t.jsx(r.TextField,{...s,inputProps:o})}const Re=`import React from '@blocklet/pages-kit/builtin/react'
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),R=require("./chunks/state-tJl9YPbn.js"),De=require("@arcblock/ux/lib/Empty"),_=require("@arcblock/ux/lib/Locale/context"),ie=require("@blocklet/code-editor"),Ee=require("@mui/icons-material/AddRounded"),Ve=require("@mui/icons-material/ArrowDownward"),ze=require("@mui/icons-material/ArrowUpward"),Ae=require("@mui/icons-material/DeleteOutline"),r=require("@mui/material"),Ne=require("lodash/sortBy"),C=require("react"),ke=require("react-use"),ye=require("@blocklet/pages-kit/builtin/color-picker"),qe=require("./chunks/config-string-CN-vvf1B.js"),Fe=require("lodash/isEmpty"),Ue=require("lodash/set"),Me=require("yaml"),F=require("@blocklet/pages-kit/builtin/uploader"),We=require("lodash/cloneDeep"),Ke=require("@arcblock/ux/lib/Toast"),Q=require("@blocklet/pages-kit/components"),Le=require("@blocklet/pages-kit/utils/property"),Se=require("@mui/base"),D=require("@mui/icons-material"),Y=require("@syncedstore/core"),Pe=require("ahooks"),Je=require("lodash/assign"),He=require("lodash/get"),Ye=require("lodash/has"),$e=require("lodash/isEqual"),Ge=require("lodash/isNil"),Qe=require("lodash/isObject"),Xe=require("lodash/keyBy"),Ze=require("lodash/omit"),et=require("lodash/pick"),tt=require("lodash/reduce"),z=require("material-ui-popup-state/hooks"),rt=require("react-error-boundary"),st=require("@emotion/css"),te=require("react-dnd"),T=e=>e&&e.__esModule?e:{default:e};function lt(e){if(e&&e.__esModule)return e;const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const o=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(s,l,o.get?o:{enumerable:!0,get:()=>e[l]})}}return s.default=e,Object.freeze(s)}const Z=T(De),ot=T(Ee),it=T(Ve),nt=T(ze),ct=T(Ae),E=T(Ne),ne=T(Fe),we=T(Ue),re=lt(Me),at=T(We),se=T(Ke),ut=T(Je),dt=T(He),pt=T(Ye),mt=T($e),X=T(Ge),xt=T(Qe),ft=T(Xe),jt=T(Ze),bt=T(et),ht=T(tt);function yt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"warning",variant:"outlined",disabled:s,onClick:e,...o,children:t.jsx(ct.default,{fontSize:"small"})})}function gt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...o,children:t.jsx(nt.default,{fontSize:"small"})})}function vt({onClick:e,disabled:s,sx:l,...o}){return t.jsx(r.IconButton,{size:"small",color:"primary",disabled:s,onClick:e,...o,children:t.jsx(it.default,{fontSize:"small"})})}function kt({label:e,value:s,onChange:l,disabled:o=!1,itemLabel:p="",emptyHeight:h=40,property:d,renderItem:g,...v}){const{t:b,locale:P}=_.useLocaleContext(),y=ke.useUpdate(),i=C.useCallback(m=>{l(R.transformValue(m,d.type))},[l,d.type]),n=C.useMemo(()=>Array.isArray(s)?s:[],[s]),c=C.useCallback(()=>{const m=[...n,""];i(m),y()},[n,i,y]),u=C.useCallback(()=>{if(!d||!d.subProperties)return c();const m={};E.default(Object.values(d.subProperties),"index").forEach(({data:B})=>{var A,N;if(!B.key)return;const V=((N=(A=B.locales)==null?void 0:A[P])==null?void 0:N.defaultValue)??"";m[B.key]=V});const O=[...n,m];i(O),y()},[n,i,y,d,P,c]),x=C.useCallback(m=>{try{const w=JSON.parse(m);Array.isArray(w)?i(w):console.error("JSON解析结果不是数组")}catch(w){console.error("JSON解析错误:",w)}},[i]),S=C.useCallback(m=>{const w=n.filter((O,B)=>B!==m);i(w),y()},[n,i,y]),a=C.useCallback(m=>{if(m<=0)return;const w=[...n],O=w[m];w[m]=w[m-1],w[m-1]=O,i(w),y()},[n,i,y]),j=C.useCallback(m=>{if(m>=n.length-1)return;const w=[...n],O=w[m];w[m]=w[m+1],w[m+1]=O,i(w),y()},[n,i,y]),f=C.useCallback((m,w)=>{const O=[...n];O[m]=w,i(O)},[n,i]),k=d&&d.subProperties&&Object.keys(d.subProperties).length>0,I=C.useMemo(()=>[{field:"index",headerName:"#",width:40,align:"center",renderCell:({index:m})=>t.jsx(r.Typography,{variant:"body1",sx:{bgcolor:"action.hover",borderRadius:"50%",width:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:m+1})},{field:"content",headerName:"",renderCell:({row:m,index:w})=>g&&k?g({item:m,index:w,property:d,onChange:O=>f(w,O)}):t.jsx(r.TextField,{fullWidth:!0,size:"small",disabled:o,value:m,placeholder:p||`${b("item")} ${w+1}`,onChange:O=>f(w,O.target.value),...v})},{field:"actions",headerName:"",width:30,align:"center",renderCell:({index:m})=>t.jsxs(r.Stack,{direction:"column",spacing:.25,children:[t.jsx(gt,{disabled:o||m===0,onClick:()=>a(m)}),t.jsx(vt,{disabled:o||m===n.length-1,onClick:()=>j(m)}),t.jsx(yt,{disabled:o,onClick:()=>S(m)})]})}],[g,k,d,f,p,b,o,v,S,a,j,n.length]);return k?t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),n.length>0?t.jsx(r.TableContainer,{component:r.Paper,variant:"outlined",sx:{borderRadius:1,mb:1},children:t.jsxs(r.Table,{size:"small",sx:{"& .MuiTableCell-root":{py:.25,px:1,whiteSpace:"nowrap"},"& .MuiTableCell-head":{backgroundColor:"action.hover",py:.25,px:1},borderCollapse:"collapse"},children:[t.jsx(r.TableHead,{sx:{display:"none"},children:t.jsx(r.TableRow,{children:I.map(m=>t.jsx(r.TableCell,{width:m.width,align:m.align||"left",sx:{fontWeight:"bold"},children:m.renderHeader?m.renderHeader():m.headerName},m.field))})}),t.jsx(r.TableBody,{children:n.map((m,w,O)=>t.jsx(r.TableRow,{sx:{borderBottom:w<O.length-1?"1px solid":"none",borderColor:"divider","&:hover":{backgroundColor:"action.hover"}},children:I.map(B=>t.jsx(r.TableCell,{width:B.width,align:B.align||"left",sx:{borderBottom:"none"},children:B.renderCell({row:m,index:w,onChange:V=>f(w,V)})},`${w}-${B.field}`))},w))})]})}):t.jsx(Z.default,{style:{fontSize:12,height:h},children:b("maker.properties.arrayEmpty")}),t.jsx(r.Button,{fullWidth:!0,size:"small",variant:"outlined",disabled:o,startIcon:t.jsx(ot.default,{}),onClick:u,children:b("maker.properties.addArrayItem")})]}):t.jsxs(r.Stack,{width:"100%",gap:1,children:[e&&t.jsx(r.FormLabel,{children:e}),t.jsx(r.Box,{sx:{border:1,borderColor:"divider",borderRadius:1,minHeight:150},children:t.jsx(ie.CodeEditor,{keyId:d.id,locale:P,language:"json",value:JSON.stringify(n,null,2),onChange:m=>x(m||""),fullScreenOptions:{enableEscExit:!0,targetContainer:()=>document.getElementById("parameters-config-dialog")||null}},d.id)})]})}function St({value:e,onChange:s,...l}){const o=C.useRef(null);return t.jsxs(t.Fragment,{children:[t.jsx(qe.ConfigString,{...l,value:e,onChange:s,InputProps:{endAdornment:t.jsx(r.InputAdornment,{position:"end",children:t.jsx(ye.ColorItem,{color:e??"",style:{width:"1.5rem",height:"1.5rem",padding:0},onClick:()=>{var p;(p=o.current)==null||p.open({value:e??""})}})})}}),t.jsx(ye.ConfigColorDialog,{ref:o,onSave:({value:p},h)=>{s(p),h()}})]})}function Pt({label:e,value:s,onChange:l,property:o,component:p,defaultLocale:h,allComponents:d,PropertyValueField:g,onUpload:v}){const{locale:b}=_.useLocaleContext(),P=C.useRef(null);if(!ne.default(o.subProperties)){const i=E.default(Object.values(o.subProperties||{}),"index").filter(n=>n.data.visible!==!1&&n.data.key);return t.jsxs(r.Stack,{width:"100%",children:[t.jsx(r.FormLabel,{sx:{px:.25,py:.5},children:e}),t.jsx(r.Box,{children:t.jsx(r.Box,{sx:{position:"relative"},children:i.map((n,c)=>{const{data:u}=n,x=u.key??u.id,S=c===i.length-1;let a=null;try{s&&typeof s=="object"?a=s[x]:typeof s=="string"&&(a=(o.type==="yaml"?re.parse(s||""):JSON.parse(s||"{}"))[x])}catch{}a==null&&(u.locales&&b&&u.locales[b]?a=u.locales[b].defaultValue:u.locales&&h&&u.locales[h]&&(a=u.locales[h].defaultValue));const j=k=>{try{let I={};if(typeof s=="string")try{I=o.type==="yaml"?re.parse(s||""):JSON.parse(s||"{}")}catch{}else typeof s=="object"&&s!==null&&(I={...s});we.default(I,x,k);const m=R.transformValue(I,o.type);l==null||l(m)}catch(I){console.error("Error updating property:",I)}},f=8;return t.jsxs(r.Box,{sx:{mb:S?0:1,display:"flex",flexDirection:"row"},children:[t.jsxs(r.Box,{sx:{position:"relative",width:24,flexShrink:0},children:[t.jsx(r.Box,{sx:{position:"absolute",left:f,top:0,height:16,width:0,borderLeft:"1px dashed",borderColor:"divider"}}),t.jsx(r.Box,{sx:{position:"absolute",left:f,top:16,width:12,height:0,borderTop:"1px dashed",borderColor:"divider"}}),!S&&t.jsx(r.Box,{sx:{position:"absolute",left:f,top:16,bottom:-8,width:0,borderLeft:"1px dashed",borderColor:"divider"}})]}),t.jsx(r.Box,{sx:{flexGrow:1},children:t.jsx(g,{component:p,property:u,value:a,onChange:j,size:"small",fullWidth:!0,defaultLocale:h,allComponents:d})})]},u.id)})})})]})}return t.jsx(r.Stack,{width:"100%",gap:2,children:t.jsxs(r.Stack,{sx:{width:"100%",position:"relative",pt:1,pb:"6px",px:"1px",minHeight:50,".monaco-editor,.overflow-guard":{borderRadius:1}},children:[t.jsx(r.FormLabel,{sx:{position:"absolute",left:0,top:0,transform:"translate(0px, -7px) scale(0.75)"},children:e}),t.jsx(ie.CodeEditor,{keyId:o.id,locale:b,language:o.type==="yaml"?"yaml":"json",value:typeof s=="string"?s:"",onChange:i=>{l==null||l(i)},onUpload:i=>{P.current=i,v&&v(i)},fullScreenOptions:{enableEscExit:!0,targetContainer:()=>document.getElementById("parameters-config-dialog")||null}},o.id),t.jsx(r.Box,{component:"fieldset",sx:{pointerEvents:"none",position:"absolute",left:0,top:-5,width:"100%",height:"100%",border:1,borderColor:"rgba(0, 0, 0, 0.23)",borderRadius:1,px:1,py:0},children:t.jsx(r.Box,{component:"legend",sx:{fontSize:"0.75em"},children:t.jsx(r.Box,{component:"span",sx:{opacity:0},children:e})})})]})})}const wt=["string","multiline","json","yaml","url","component","custom"];function ge(e){return e.type?!wt.includes(e.type):!1}function Ie({disabled:e,list:s,renderItem:l,...o}){const p=C.useRef(null),h=C.useId(),d=Pe.useUpdate(),g=E.default(Object.entries(s),n=>n[1].index).map(n=>n[0]),v=C.useRef(g),b=C.useCallback(n=>{v.current=n,d()},[d]),P=C.useCallback(({index:n},{index:c})=>{const u=[...v.current];u.splice(c,0,...u.splice(n,1)),b(u)},[b]);C.useEffect(()=>{b(g)},[g.join("-")]);const[{isOver:y},i]=te.useDrop({accept:h,collect:n=>({isOver:n.isOver()}),canDrop:()=>!e,drop:()=>{var u;const n=()=>{v.current.forEach((x,S)=>{const a=s[x];a&&(a.index=S)})},c=(u=Y.getYjsValue(s))==null?void 0:u.doc;c?c.transact(()=>{n()}):n()}});return C.useEffect(()=>{y||b(g)},[y]),i(p),t.jsx(r.Box,{...o,ref:p,className:st.cx(y&&"isDragging"),children:v.current.map((n,c)=>t.jsx(It,{type:h,disabled:e,id:n,index:c,itemIndex:u=>v.current.indexOf(u),move:P,children:u=>{const x=s[n];return x?l(x.data,c,u):null}},n))})}function It({disabled:e,id:s,index:l,type:o,children:p,itemIndex:h,move:d}){const g=C.useRef(),[{isDragging:v},b,P]=te.useDrag({type:o,item:()=>({id:s}),canDrag:()=>!e,collect:i=>({isDragging:i.isDragging()})}),[,y]=te.useDrop({accept:o,canDrop:()=>!e,hover(i,n){var f;if(!g.current)return;const c=h(i.id),u=l;if(c===u)return;const x=(f=g.current)==null?void 0:f.getBoundingClientRect(),S=(x.bottom-x.top)/2,j=n.getClientOffset().y-x.top;c<u&&j<S||c>u&&j>S||d({id:i.id,index:c},{id:s,index:l})}});return typeof p=="function"?p({isDragging:v,drag:b,drop:i=>(g.current=i,y(i)),preview:P}):(b(y(P(g))),t.jsx(r.Box,{ref:g,children:p}))}function Ct({drop:e,preview:s,drag:l,disabled:o,isDragging:p,children:h,onDelete:d,onVisibilityChange:g,visible:v=!0,actions:b,alwaysShowActions:P=!1}){const{t:y}=_.useLocaleContext();return t.jsx(r.Box,{ref:e,sx:{":hover .hover-visible":{maxWidth:"100%"},opacity:v?1:.5},children:t.jsxs(r.Box,{sx:{position:"relative"},children:[t.jsx(r.Box,{ref:s,sx:{flex:1,borderRadius:.5,bgcolor:p?"action.hover":"background.paper",opacity:.9999},children:h}),!o&&t.jsx(r.Box,{className:P?"":"hover-visible",sx:{maxWidth:P?"100%":0,overflow:"hidden",position:"absolute",right:2,top:2,transition:"max-width 0.3s ease-in-out"},children:t.jsxs(r.Stack,{direction:"row",sx:{bgcolor:i=>r.alpha(i.palette.grey[200],.9),borderRadius:1,p:.5,[`.${r.buttonClasses.root}`]:{minWidth:24,width:24,height:24,p:0}},children:[b,g&&t.jsx(r.Tooltip,{title:y(v?"hideParameter":"showParameter"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:()=>g(!v),children:v?t.jsx(D.VisibilityOffRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}}):t.jsx(D.VisibilityRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),d&&t.jsx(r.Tooltip,{title:y("delete"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{onClick:d,children:t.jsx(D.DeleteOutlineRounded,{sx:{fontSize:"1.25rem",color:"grey.500"}})})}),t.jsx(r.Tooltip,{title:y("dragSort"),disableInteractive:!0,placement:"top",children:t.jsx(r.Button,{ref:l,children:t.jsx(D.DragIndicatorRounded,{sx:{color:"grey.500"}})})})]})})]})})}function Ot({label:e,value:s,onChange:l}){const[o,p]=C.useState(!1);return t.jsxs(r.Stack,{gap:1,children:[t.jsx(r.TextField,{label:e,size:"small",value:s,onChange:h=>l==null?void 0:l(h.target.value),InputProps:{endAdornment:t.jsx(F.UploaderButton,{onChange:({response:h})=>{var g;const d=(g=h==null?void 0:h.data)==null?void 0:g.filename;d&&(l==null||l(d))}})}}),s&&t.jsx(r.Box,{component:"img",sx:{objectFit:"contain",borderRadius:1,cursor:"pointer"},src:R.getImageAbsoluteUrl(s),alt:e,maxWidth:100,maxHeight:100,width:"100%",onClick:()=>p(!0)}),t.jsx(r.Dialog,{open:o,onClose:()=>p(!1),children:t.jsx(r.Box,{component:"img",sx:{objectFit:"contain"},src:R.getImageAbsoluteUrl(s),alt:e})})]})}function le(e,s=""){return ht.default(e,(l,o,p)=>{const h=s?`${s}.${p}`:p;return xt.default(o)?ut.default(l,le(o,h)):l[h]=o,l},{})}const Tt=[{value:"string",label:"Text"},{value:"multiline",label:"Text (Multiline)"},{value:"number",label:"Number"},{value:"decimal",label:"Decimal"},{value:"boolean",label:"Boolean"},{value:"color",label:"Color"},{value:"url",label:"URL (Upload)"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"array",label:"Array"},{value:"component",label:"Component"},{value:"custom",label:"Custom (Render by a Component)"}];function G(e,s,l){return!e||!l?!1:Object.values(e).some(({data:o})=>o.id!==s&&o.key===l)}function oe(e,s){var l;return!e||!s?!1:((l=e[s])==null?void 0:l.data.visible)??!0}function Bt({componentId:e}){const{state:{components:s}}=R.useStore(),l=s[e],o=l==null?void 0:l.data;return o?t.jsx(r.Stack,{maxHeight:"100%",overflow:"auto",children:t.jsx(r.Box,{p:2,children:t.jsx(rt.ErrorBoundary,{FallbackComponent:R.ErrorView,resetKeys:[e],children:t.jsx(Rt,{value:o})})})}):null}function Rt({value:e}){var b,P,y;const{t:s}=_.useLocaleContext(),{localState:{currentLocale:l,customComponentPreviewerProperties:o},state:{config:{defaultLocale:p}},localActions:{setCustomComponentPreviewerProperties:h}}=R.useStore(),d=Y.getYjsValue(e).doc,g=R.useAllComponents(),v=Pe.useReactive({propertiesValue:{...h}});return C.useEffect(()=>{const i=Object.fromEntries(Object.values(e.properties??{}).map(({data:n})=>{var c,u,x,S,a;return[n.id,{value:((c=v.propertiesValue[n.id])==null?void 0:c.value)??Le.parsePropertyValue(n,((x=(u=n.locales)==null?void 0:u[l])==null?void 0:x.defaultValue)??((a=(S=n.locales)==null?void 0:S[p])==null?void 0:a.defaultValue),{locale:l,defaultLocale:p})}]}));h(i)},[JSON.stringify(v.propertiesValue)]),t.jsx(r.Stack,{height:"100%",children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(Ce,{config:e}),t.jsx(Te,{config:e,currentLocale:l,defaultLocale:p,allComponents:g,onUpdateConfig:i=>{d.transact(()=>{i(e)})}}),t.jsxs(r.Stack,{gap:2,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("renderer")}),t.jsxs(r.TextField,{hiddenLabel:!0,size:"small",select:!0,SelectProps:{autoWidth:!0},value:((b=e.renderer)==null?void 0:b.type)||"react-component",onChange:i=>{d.transact(()=>{const n=i.target.value;e.renderer??(e.renderer={type:n}),e.renderer.type=n})},children:[t.jsx(r.MenuItem,{value:"react-component",children:"React Component"}),t.jsx(r.MenuItem,{value:"component",children:"Custom Component"})]})]}),((P=e.renderer)==null?void 0:P.type)==="component"&&t.jsx(Nt,{value:e}),((y=e.renderer)==null?void 0:y.type)==="react-component"&&t.jsx(At,{value:e}),t.jsx(ce,{config:e,currentLocale:l,defaultLocale:p,allComponents:g,propertiesValue:o,onChange:({value:i,id:n,path:c})=>{const u=[...c,"data"];if(!dt.default(e,u)){se.default.warning(s("cannotFindPropertyKey",{key:u.join(".")}));return}v.propertiesValue[n]={value:i.value}}})]})})}function Ce({config:e}){const{t:s}=_.useLocaleContext();return t.jsx(F.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsx(r.Typography,{variant:"subtitle1",children:s("basicInfo")}),t.jsx(r.TextField,{label:s("name"),size:"small",value:e.name||"",onChange:l=>e.name=l.target.value}),t.jsx(r.TextField,{label:s("description"),size:"small",multiline:!0,minRows:2,maxRows:10,inputProps:{maxLength:200},value:e.description||"",onChange:l=>e.description=l.target.value}),t.jsx(r.Autocomplete,{size:"small",options:[],multiple:!0,freeSolo:!0,value:e.tags??[],onChange:(l,o)=>e.tags=o,renderInput:l=>t.jsx(r.TextField,{label:s("tags"),...l})}),t.jsx(Ot,{label:s("previewImage"),value:e.previewImage||"",onChange:l=>e.previewImage=l})]})})}function Oe({data:e,params:s,visible:l,config:o,currentLocale:p,defaultLocale:h,allComponents:d,onUpdateConfig:g}){var P,y,i,n,c,u;const{t:v}=_.useLocaleContext(),b=C.useMemo(()=>e.type==="json"||e.type==="yaml"||e.type==="array"?Vt:U,[e.type]);return t.jsx(Ct,{preview:s.preview,drop:s.drop,drag:s.drag,isDragging:s.isDragging,onDelete:()=>{g(x=>{if(x.properties){const a=Object.entries(x.properties).sort(([,f],[,k])=>f.index-k.index);delete x.properties[e.id],a.filter(([f])=>f!==e.id).forEach(([,f],k)=>{f.index=k})}})},visible:l,onVisibilityChange:x=>{g(S=>{const a=S.properties[e.id].data;a.visible=x})},alwaysShowActions:!0,children:t.jsxs(r.Stack,{direction:"column",gap:2,children:[t.jsx(r.TextField,{label:v("key"),size:"small",required:!0,sx:{width:"calc(100% - 80px - 8px)",flex:1,"& .MuiOutlinedInput-root":{borderColor:e.key?G(o.properties,e.id,e.key)?"warning.main":void 0:"error.main"},"& .MuiFormLabel-root":{color:e.key?G(o.properties,e.id,e.key)?"warning.main":"text.secondary":"error.main"},"& .MuiFormLabel-root.Mui-focused":{color:e.key?G(o.properties,e.id,e.key)?"warning.main":"primary.main":"error.main"}},value:e.key||"",onChange:x=>{g(S=>{const a=S.properties[e.id].data;a.key=x.target.value.trim()})},InputProps:{endAdornment:!e.key||e.key&&G(o.properties,e.id,e.key)?t.jsx(r.InputAdornment,{position:"end",sx:{width:16,ml:0},children:t.jsx(r.Tooltip,{title:e.key?v("duplicateKey"):v("requiredKey"),children:t.jsx(D.InfoRounded,{sx:{color:e.key?"warning.main":"error.main",fontSize:16}})})}):null}}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(r.TextField,{label:v("label"),size:"small",sx:{flex:1},value:(((y=(P=e.locales)==null?void 0:P[p])==null?void 0:y.name)??((n=(i=e.locales)==null?void 0:i[h])==null?void 0:n.name))||"",onChange:x=>{g(S=>{var j;const a=S.properties[e.id].data;a.locales??(a.locales={}),(j=a.locales)[p]??(j[p]={}),a.locales[p].name=x.target.value})}}),t.jsx(r.TextField,{label:v("type"),size:"small",select:!0,sx:{flex:1},value:e.type==="string"&&e.multiline?"multiline":e.type||"string",onChange:x=>{g(S=>{const a=S.properties[e.id].data;if(a.locales)for(const f of Object.keys(a.locales))a.locales[f].defaultValue=void 0;const j=x.target.value;j==="multiline"?(a.type="string",a.multiline=!0):(typeof a.multiline<"u"&&delete a.multiline,a.type=j)})},children:Tt.map(x=>t.jsx(r.MenuItem,{value:x.value,children:x.label},x.value))})]}),t.jsxs(r.Stack,{direction:"row",gap:1,children:[t.jsx(b,{allComponents:d,defaultLocale:h,component:o,property:e,label:v("defaultValue"),size:"small",fullWidth:!0,value:(u=(c=e.locales)==null?void 0:c[p])==null?void 0:u.defaultValue,onChange:(x,S)=>{g(a=>{var f;const j=a.properties[e.id].data;if(S!=null&&S.forceUpdateProperty){const k=le(j),I=le(x);Object.keys(I).forEach(m=>{k[m]||we.default(j,m,I[m])})}else j.locales??(j.locales={}),(f=j.locales)[p]??(f[p]={}),j.locales[p].defaultValue=x})}}),e.type==="custom"?t.jsx(r.Box,{children:t.jsx(Dt,{property:e,allComponents:d})}):null]})]})})}function _t(e,s){const[l,o]=C.useState(0);return C.useEffect(()=>{const h=setTimeout(()=>{if(e.current){let d=e.current.parentElement,g=0;for(;d;)d.classList.contains("property-container")&&g++,d=d.parentElement;o(g)}},100);return()=>clearTimeout(h)},[e,s]),l}function Te({config:e,currentLocale:s,defaultLocale:l,allComponents:o,onUpdateConfig:p,useI18nEditor:h=!0}){const{t:d}=_.useLocaleContext(),g=z.usePopupState({variant:"dialog"}),v=e.properties&&E.default(Object.values(e.properties),"index");return t.jsx(F.UploaderProvider,{children:t.jsxs(r.Stack,{gap:2,children:[t.jsxs(r.Stack,{direction:"row",gap:1,alignItems:"center",justifyContent:"space-between",children:[t.jsx(r.Typography,{variant:"subtitle1",children:d("properties")}),t.jsx(r.Box,{flex:1}),h&&t.jsx(r.Button,{sx:{minWidth:32,minHeight:32,p:0},...z.bindTrigger(g),children:t.jsx(D.TranslateRounded,{fontSize:"small"})})]}),e.properties&&Object.keys(e.properties).length>0?t.jsx(Ie,{component:r.Stack,gap:2,list:e.properties,renderItem:(b,P,y)=>{const i=oe(e.properties,b.id);return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed",borderColor:"divider"},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Oe,{data:b,params:y,visible:i,config:e,currentLocale:s,defaultLocale:l,allComponents:o,onUpdateConfig:p})})},b.id)}}):t.jsx(Z.default,{style:{fontSize:12},children:d("maker.properties.noProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",onClick:()=>{p(b=>{var y;const P=R.nextId();b.properties??(b.properties={}),(y=b.properties)[P]??(y[P]={index:(v==null?void 0:v.length)||0,data:{id:P}})})},startIcon:t.jsx(D.AddRounded,{}),children:d("addObject",{object:d("property")})}),h&&t.jsx(Be,{...z.bindDialog(g),component:e})]})})}function Dt({property:e,allComponents:s}){const l=z.usePopupState({variant:"popper"});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{sx:{minWidth:0},...z.bindTrigger(l),children:t.jsx(D.SettingsRounded,{fontSize:"small"})}),t.jsx(r.Popper,{...z.bindPopper(l),children:t.jsx(Se.ClickAwayListener,{onClickAway:l.close,children:t.jsx(r.Paper,{children:t.jsx(r.Box,{width:500,p:2,children:t.jsx(ee,{value:e.componentId,onChange:(o,p)=>e.componentId=p,allComponents:s})})})})})]})}function Et({value:e,valueImmutable:s,onChange:l,defaultLocale:o,allComponents:p}){var P;const[h,d]=C.useState(!1),{t:g,locale:v}=_.useLocaleContext(),b=typeof(e==null?void 0:e.componentId)=="string"?(P=p[e.componentId])==null?void 0:P.data:void 0;return b?t.jsxs(r.Box,{sx:{width:"100%",position:"relative"},children:[t.jsx(r.IconButton,{sx:{minWidth:0},disabled:!b,size:"small",onClick:()=>d(!h),color:h?"primary":"default",children:t.jsx(D.SettingsRounded,{fontSize:"small"})}),h&&t.jsx(r.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,sx:{width:"100%",zIndex:10},children:t.jsxs(r.Paper,{elevation:1,sx:{mt:1,p:2,borderRadius:1,border:"1px solid",borderColor:"divider",width:"100%"},children:[t.jsx(r.Box,{width:"100%",mb:2,children:t.jsx(ce,{config:b,currentLocale:v,defaultLocale:o,allComponents:p,propertiesValue:e==null?void 0:e.properties,onChange:({id:y,value:i})=>{const n=at.default(i.value),c=JSON.parse(JSON.stringify(e));c!=null&&c.componentId&&(s?l==null||l({...c,properties:{...c.properties,[y]:{value:n}}}):(c.properties=c.properties??{},c.properties[y]={value:n},l==null||l(c)))}})}),t.jsx(r.Button,{size:"small",onClick:()=>d(!1),sx:{mt:1},children:g("close")})]})})]}):null}function Be({type:e="properties",component:s,...l}){var y,i,n;const{t:o}=_.useLocaleContext(),{state:{components:p,supportedLocales:h,config:{defaultLocale:d}}}=R.useStore(),g=R.useAllComponents(),v=Y.getYjsValue(s).doc,b=e==="properties"?s.properties:e==="parameters"&&((y=s.renderer)==null?void 0:y.type)==="component"?(i=p[s.renderer.componentId])==null?void 0:i.data.properties:void 0,P=((n=s.renderer)==null?void 0:n.type)==="component"?s:void 0;return t.jsxs(r.Dialog,{...l,fullWidth:!0,maxWidth:"lg",children:[t.jsx(r.DialogTitle,{children:o("i18nEditorTitle")}),t.jsx(r.DialogContent,{children:b&&t.jsx(r.Stack,{children:t.jsxs(r.Table,{stickyHeader:!0,sx:{td:{verticalAlign:"top"}},children:[t.jsx(r.TableHead,{children:t.jsx(r.TableRow,{children:h.map(({locale:c,name:u})=>t.jsx(r.TableCell,{children:t.jsxs(r.Typography,{color:"text.primary",children:[u,d===c&&t.jsx(D.StarRounded,{sx:{fontSize:12}})]})},c))})}),t.jsx(r.TableBody,{children:E.default(Object.values(b),"index").map(({data:c})=>t.jsx(r.TableRow,{children:h.map(({locale:u})=>{var x,S,a,j,f,k,I,m,w,O,B,V,A,N,$,W,K,L,J,H,ae,ue,de,pe,me,xe;return t.jsx(r.TableCell,{children:t.jsx(r.Stack,{gap:1,children:e==="properties"?t.jsxs(t.Fragment,{children:[t.jsx(r.TextField,{size:"small",label:"Key",value:c.key||"",onChange:M=>{v.transact(()=>{c.key=M.target.value.trim()})}}),t.jsx(r.TextField,{size:"small",label:o("label"),value:(((S=(x=c.locales)==null?void 0:x[u])==null?void 0:S.name)??((j=(a=c.locales)==null?void 0:a[d])==null?void 0:j.name))||"",onChange:M=>{v.transact(()=>{var q;c.locales??(c.locales={}),(q=c.locales)[u]??(q[u]={}),c.locales[u].name=M.target.value})}}),t.jsx(r.Box,{children:t.jsx(U,{allComponents:g,defaultLocale:d,component:s,property:c,size:"small",fullWidth:!0,label:"Default Value",valueImmutable:X.default((k=(f=c.locales)==null?void 0:f[u])==null?void 0:k.defaultValue),value:((m=(I=c.locales)==null?void 0:I[u])==null?void 0:m.defaultValue)??((O=(w=c.locales)==null?void 0:w[d])==null?void 0:O.defaultValue),onChange:M=>{v.transact(()=>{var q;c.locales??(c.locales={}),(q=c.locales)[u]??(q[u]={}),c.locales[u].defaultValue=M})}})})]}):e==="parameters"&&P?t.jsx(r.Box,{children:t.jsx(U,{allComponents:g,defaultLocale:d,component:s,property:c,size:"small",fullWidth:!0,valueImmutable:X.default((N=(A=(V=(B=P.renderer.properties)==null?void 0:B[c.id])==null?void 0:V.locales)==null?void 0:A[u])==null?void 0:N.value),value:((L=(K=(W=($=P.renderer.properties)==null?void 0:$[c.id])==null?void 0:W.locales)==null?void 0:K[u])==null?void 0:L.value)??((ue=(ae=(H=(J=P.renderer.properties)==null?void 0:J[c.id])==null?void 0:H.locales)==null?void 0:ae[d])==null?void 0:ue.value)??((pe=(de=c.locales)==null?void 0:de[u])==null?void 0:pe.defaultValue)??((xe=(me=c.locales)==null?void 0:me[d])==null?void 0:xe.defaultValue),onChange:M=>{v.transact(()=>{var q,fe,je,be,he;(q=P.renderer).properties??(q.properties={}),(fe=P.renderer.properties)[je=c.id]??(fe[je]={}),(be=P.renderer.properties[c.id]).locales??(be.locales={}),(he=P.renderer.properties[c.id].locales)[u]??(he[u]={}),P.renderer.properties[c.id].locales[u].value=M})}})}):null},c.id)},u)})},c.id))})]})})}),t.jsx(r.DialogActions,{children:t.jsx(r.Button,{onClick:c=>{var u;return(u=l.onClose)==null?void 0:u.call(l,c,"escapeKeyDown")},children:o("close")})})]})}const ve=(e,s)=>l=>{const o=[l.palette.info.main,l.palette.primary.main,l.palette.secondary.main,l.palette.success.main,l.palette.warning.main],p=Math.min(o.length-1,e),h=o[p],d=r.alpha(h,.5),g=r.alpha(h,1);return{borderColor:`${d} !important`,borderLeft:"3px solid !important",borderLeftColor:d,color:g,...s}};function Vt({property:e,onChange:s,defaultLocale:l,allComponents:o}){const{t:p,locale:h}=_.useLocaleContext(),d=C.useRef(null),g=_t(d,e),v=C.useCallback(()=>{if(!(e.type!=="json"&&e.type!=="yaml"&&e.type!=="array")&&e.subProperties)try{let b={};E.default(Object.values(e.subProperties),"index").filter(i=>i.data.visible!==!1&&i.data.key).forEach(({data:i})=>{var c,u,x,S;if(!i.key)return;let n=((u=(c=i.locales)==null?void 0:c[h])==null?void 0:u.defaultValue)??((S=(x=i.locales)==null?void 0:x[l])==null?void 0:S.defaultValue);if(i.type==="number")n=Number(n);else if(i.type==="boolean")n=n===!0||n==="true";else if((i.type==="json"||i.type==="yaml")&&typeof n=="string")try{i.type==="json"?n=JSON.parse(n):n=re.parse(n)}catch(a){console.error("Error parsing nested value",n,a),n={}}b[i.key]=n}),e.type==="array"&&!Array.isArray(b)&&(b=ne.default(b)?[]:[b]);const y=R.transformValue(b,e.type);s==null||s(y)}catch(b){console.error("Error converting structure to text:",b)}},[e,h,l,s]);return e.type!=="json"&&e.type!=="yaml"&&e.type!=="array"?null:t.jsxs(r.Stack,{direction:"column",gap:1.5,sx:{width:"100%"},ref:d,children:[t.jsx(r.Divider,{sx:{mt:-1},children:t.jsx(r.Typography,{variant:"caption",color:"text.secondary",children:p("maker.properties.subProperties")})}),e.subProperties&&Object.keys(e.subProperties).length>0?t.jsx(Ie,{component:r.Stack,gap:2,list:e.subProperties,renderItem:(b,P,y)=>{const i=b.visible!==!1;return t.jsx(r.Paper,{elevation:0,className:"property-container",sx:{p:1.25,borderRadius:1,border:i?"1px solid":"1px dashed","&":ve(g)},children:t.jsx(r.Stack,{gap:2,children:t.jsx(Oe,{data:b,params:y,visible:i,config:{properties:e.subProperties},currentLocale:h,defaultLocale:l,allComponents:o,onUpdateConfig:n=>{try{const c={properties:e.subProperties||{}};n(c);const u={...e,subProperties:c.properties};s==null||s(u,{forceUpdateProperty:!0}),v()}catch(c){console.error("Error updating property:",c)}}})})},b.id)}}):t.jsx(Z.default,{style:{fontSize:12,height:100},children:p("maker.properties.noSubProperties")}),t.jsx(r.Button,{fullWidth:!0,variant:"outlined",className:"ignore-style-override",size:"small",startIcon:t.jsx(D.AddRounded,{}),onClick:()=>{try{const b=e.subProperties||{},P=R.nextId(),i={index:Object.values(b).length,data:{id:P,key:"",type:"string",visible:!0,locales:{[h]:{name:"",defaultValue:""}},subProperties:{}}},n={...e,subProperties:{...b,[P]:i}};s==null||s(n,{forceUpdateProperty:!0}),v()}catch(b){console.error("Error adding property:",b)}},sx:{"&":ve(g,{})},children:p("maker.properties.addSubProperty")})]})}function U({component:e,property:s,value:l,onChange:o,valueImmutable:p,defaultLocale:h,allComponents:d,...g}){var n,c,u,x,S;const{locale:v}=_.useLocaleContext(),b=F.useUploader(),P=C.useRef(null),y=()=>{var j;const a=(j=b==null?void 0:b.current)==null?void 0:j.getUploader();a==null||a.open(),P.current&&a.onceUploadSuccess(({response:f})=>{var I,m;let k=((I=f==null?void 0:f.data)==null?void 0:I.filename)||"";k&&(k=`mediakit://${k}`,l&&!l.includes("mediakit://")&&(k+=" # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")),(m=P.current)==null||m.call(P,k)})},i=g.label??(((c=(n=s.locales)==null?void 0:n[v])==null?void 0:c.name)||((x=(u=s.locales)==null?void 0:u[h])==null?void 0:x.name)||s.key||s.id);if(s.type==="number")return t.jsx(zt,{...g,label:i,NumberProps:{value:["number","string"].includes(typeof l)?l:null,onChange:(a,j)=>o==null?void 0:o(j)}});if(s.type==="decimal")return t.jsx(r.TextField,{...g,label:i,type:"text",value:l??"",onChange:a=>{const j=a.target.value;if(j===""||j==="-"){o==null||o(j);return}if(/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(j)){let k=j;/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(k)&&(k=Number(k)),o==null||o(k)}}});if(s.type==="boolean")return t.jsx(r.FormControlLabel,{label:i,labelPlacement:"start",control:t.jsx(r.Switch,{checked:l===!0,onChange:(a,j)=>o==null?void 0:o(j)})});if(s.type==="color")return t.jsx(St,{label:i,value:l,onChange:a=>{o==null||o(a)}});if(s.type==="json"||s.type==="yaml")return t.jsx(Pt,{label:i,value:l,onChange:a=>{o==null||o(a)},property:s,component:e,defaultLocale:h,allComponents:d,PropertyValueField:U,onUpload:a=>{P.current=a,y()}});if(s.type==="custom"){const a=(S=d[s.componentId])==null?void 0:S.data;return a?t.jsx(r.Box,{width:"100%",children:t.jsx(Q.CustomComponentRenderer,{componentId:a.id,props:{label:i,value:l,onChange:o},locale:v,dev:{mode:"draft",components:d,defaultLocale:h}})}):t.jsx(r.TextField,{...g,label:i,disabled:!0,placeholder:"Click right button select a component"})}if(s.type==="component")return t.jsxs(r.Stack,{width:"100%",direction:"column",gap:1,children:[t.jsx(ee,{allComponents:d,label:i,value:l==null?void 0:l.componentId,onChange:(a,j)=>{p||!l?o==null||o({...l&&JSON.parse(JSON.stringify(l)),componentId:j}):typeof l=="object"&&(l.componentId=j,o==null||o({...l&&JSON.parse(JSON.stringify(l)),componentId:j}))}}),(l==null?void 0:l.componentId)&&t.jsx(Et,{value:l,valueImmutable:p,onChange:o,defaultLocale:h,allComponents:d})]});if(!s.type||["string","url","multiline"].includes(s.type)){let a=s.type==="string"?s.multiline:void 0;s.type==="multiline"&&(a=!0);const j=s.type==="url"?l==null?void 0:l.url:l;return t.jsx(r.TextField,{...g,label:i,value:typeof j=="string"?j:"",multiline:a,minRows:a?2:void 0,maxRows:a?10:void 0,onChange:f=>o==null?void 0:o(s.type==="url"?{...l,url:f.target.value,mediaKitUrl:f.target.value}:f.target.value),InputProps:s.type==="url"?{sx:{pr:0},endAdornment:t.jsxs(r.InputAdornment,{position:"end",children:[t.jsx(F.UploaderButton,{onChange:async({response:f})=>{var w,O,B;const k=((w=f==null?void 0:f.data)==null?void 0:w.url)||((O=f==null?void 0:f.data)==null?void 0:O.fileUrl);let I;k&&(I=await F.getImageSize(k).catch(()=>F.getVideoSize(k)).catch(()=>{}));let m=((B=f==null?void 0:f.data)==null?void 0:B.filename)||"";m&&(m=`mediakit://${m}`),o==null||o({url:k,mediaKitUrl:m,width:I==null?void 0:I.naturalWidth,height:I==null?void 0:I.naturalHeight})}}),t.jsx(r.Tooltip,{title:"If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.",children:t.jsx(D.InfoRounded,{sx:{cursor:"default",mr:1},fontSize:"small"})})]})}:void 0})}return s.type==="array"?t.jsx(kt,{label:i,value:Array.isArray(l)?l:[],onChange:a=>o==null?void 0:o(a),property:s,renderItem:({item:a,index:j,onChange:f})=>s.subProperties&&Object.keys(s.subProperties).length>0?t.jsx(r.Stack,{gap:1,width:"100%",children:E.default(Object.values(s.subProperties),"index").filter(k=>k.data.visible!==!1).map(({data:k})=>k.key?t.jsx(U,{component:e,property:k,value:a[k.key],onChange:I=>{const m={...a,[k.key]:I};f(m)},size:"small",fullWidth:!0,defaultLocale:h,allComponents:d},k.id):null)},j):t.jsx(r.TextField,{size:g.size,fullWidth:!0,value:a,onChange:k=>f(k.target.value)})}):(console.error("Unsupported property type",s.type),null)}function zt({NumberProps:e,...s}){const{getInputProps:l}=Se.unstable_useNumberInput(e),o=l();return t.jsx(r.TextField,{...s,inputProps:o})}const Re=`import React from '@blocklet/pages-kit/builtin/react'
2
2
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
3
3
 
4
4
  export default function () {
package/lib/cjs/theme.js CHANGED
@@ -1,239 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),F=require("@arcblock/ux/lib/Colors"),g=require("@arcblock/ux/lib/Theme"),m=require("@blocklet/pages-kit/utils/style"),v=require("@iconify-icon/react"),w=require("@iconify-icons/tabler/chevron-down"),x=require("@mui/lab"),e=require("@mui/material"),u=require("defu"),b=t=>t&&t.__esModule?t:{default:t},r=b(F),E=b(w);function n(t){const o=r.default.common.white,f=e.getContrastRatio(t,o)>=2?o:"rgba(0, 0, 0, 0.87)";return{main:t,light:e.lighten(t,.2),dark:e.darken(t,.3),contrastText:f}}function i(t={},s=g.createTheme){const o=m.getBlockletTheme();return s(u.defu(t,{palette:{_did:n(r.default.did.primary),black:n(r.default.grey[900])},breakpoints:o.breakpoints}))}const p=`
2
- :root {
3
- /* Light */
4
- /* colors */
5
- --backgrounds-bg-base: #FFFFFF;
6
- --backgrounds-bg-base-hover: #F9FAFB;
7
- --backgrounds-bg-base-pressed: #F3F4F6;
8
- --backgrounds-bg-component: #F1F3F5;
9
- --backgrounds-bg-disabled: #F3F4F6;
10
- --backgrounds-bg-field: #F9FAFB;
11
- --backgrounds-bg-field-hover: #F3F4F6;
12
- --backgrounds-bg-glass: #ffffffb8;
13
- --backgrounds-bg-highlight: #EFF6FF;
14
- --backgrounds-bg-highlight-hover: #DBEAFE;
15
- --backgrounds-bg-interactive: #3B82F6;
16
- --backgrounds-bg-interactive-hover: #2563EB;
17
- --backgrounds-bg-overlay: #03071266;
18
- --backgrounds-bg-subtle: #F9FAFB;
19
- --backgrounds-bg-subtle-hover: #F3F4F6;
20
- --backgrounds-bg-subtle-pressed: #E5E7EB;
21
- --backgrounds-bg-switch-off: #E5E7EB;
22
- --backgrounds-bg-switch-off-hover: #D1D5DB;
23
- --buttons-button-danger: #E11D48;
24
- --buttons-button-danger-hover: #BE123C;
25
- --buttons-button-danger-pressed: #9F1239;
26
- --buttons-button-inverted: #030712;
27
- --buttons-button-inverted-hover: #111827;
28
- --buttons-button-inverted-pressed: #1F2937;
29
- --buttons-button-neutral: #FFFFFF;
30
- --buttons-button-neutral-hover: #F3F4F6;
31
- --buttons-button-neutral-pressed: #E5E7EB;
32
- --buttons-button-transparent: #ffffff00;
33
- --buttons-button-transparent-hover: #F3F4F6;
34
- --buttons-button-transparent-pressed: #E5E7EB;
35
- --foregrounds-fg-base: #030712;
36
- --foregrounds-fg-danger: #E11D48;
37
- --foregrounds-fg-disabled: #D1D5DB;
38
- --foregrounds-fg-interactive: #3B82F6;
39
- --foregrounds-fg-interactive-hover: #2563EB;
40
- --foregrounds-fg-muted: #9CA3AF;
41
- --foregrounds-fg-on-color: #FFFFFF;
42
- --foregrounds-fg-on-inverted: #FFFFFF;
43
- --foregrounds-fg-subtle: #4B5563;
44
- --others-spacer: #ffffff00;
45
- --shadows-card-hover-1: #03071214;
46
- --shadows-card-hover-2: #03071214;
47
- --shadows-card-hover-3: #0307121a;
48
- --shadows-card-rest-1: #03071214;
49
- --shadows-card-rest-2: #03071214;
50
- --shadows-card-rest-3: #0307120a;
51
- --shadows-danger-1: #E11D48;
52
- --shadows-error-2: #e11d4826;
53
- --shadows-flyout-1: #03071214;
54
- --shadows-flyout-2: #03071214;
55
- --shadows-interactive-with-active-1: #3B82F6;
56
- --shadows-interactive-with-active-2: #3b82f633;
57
- --shadows-interactive-with-shadow-1: #1e3a8a80;
58
- --shadows-interactive-with-shadow-2: #3B82F6;
59
- --shadows-modal-1: #FFFFFF;
60
- --shadows-modal-2: #e5e7eb66;
61
- --shadows-modal-3: #03071214;
62
- --shadows-modal-4: #03071214;
63
- --shadows-modal-5: #03071214;
64
- --shadows-switch-background-1: #0307120a;
65
- --shadows-switch-background-2: #0307120a;
66
- --shadows-switch-background-3: #0307120f;
67
- --shadows-switch-background-4: #03071205;
68
- --shadows-switch-background-5: #0307120a;
69
- --shadows-switch-handle-1: #FFFFFF;
70
- --shadows-switch-handle-2: #FFFFFF;
71
- --shadows-switch-handle-3: #03071205;
72
- --shadows-switch-handle-4: #03071205;
73
- --shadows-switch-handle-5: #0307120a;
74
- --shadows-switch-handle-6: #0307121f;
75
- --shadows-switch-handle-7: #03071214;
76
- --shadows-tooltip-1: #03071214;
77
- --shadows-tooltip-2: #03071214;
78
- --stroke-border-base: #E5E7EB;
79
- --stroke-border-error: #E11D48;
80
- --stroke-border-interactive: #3B82F6;
81
- --stroke-border-loud: #030712;
82
- --stroke-border-strong: #D1D5DB;
83
- --stroke-sep: #E5E7EB;
84
- --tags-tag-blue-bg: #DBEAFE;
85
- --tags-tag-blue-bg-hover: #BFDBFE;
86
- --tags-tag-blue-border: #BFDBFE;
87
- --tags-tag-blue-icon: #2563EB;
88
- --tags-tag-blue-text: #1D4ED8;
89
- --tags-tag-green-bg: #D1FAE5;
90
- --tags-tag-green-bg-hover: #A7F3D0;
91
- --tags-tag-green-border: #A7F3D0;
92
- --tags-tag-green-icon: #059669;
93
- --tags-tag-green-text: #047857;
94
- --tags-tag-neutral-bg: #F3F4F6;
95
- --tags-tag-neutral-bg-hover: #E5E7EB;
96
- --tags-tag-neutral-border: #E5E7EB;
97
- --tags-tag-neutral-icon: #6B7280;
98
- --tags-tag-neutral-text: #4B5563;
99
- --tags-tag-orange-bg: #FEF4C7;
100
- --tags-tag-orange-bg-hover: #FDE68A;
101
- --tags-tag-orange-border: #FDE68A;
102
- --tags-tag-orange-icon: #D97706;
103
- --tags-tag-orange-text: #B45309;
104
- --tags-tag-purple-bg: #EDE9FE;
105
- --tags-tag-purple-bg-hover: #DDD6FE;
106
- --tags-tag-purple-border: #DDD6FE;
107
- --tags-tag-purple-icon: #7C3AED;
108
- --tags-tag-purple-text: #6D28D9;
109
- --tags-tag-red-bg: #FFE4E6;
110
- --tags-tag-red-bg-hover: #FECDD3;
111
- --tags-tag-red-border: #FECDD3;
112
- --tags-tag-red-icon: #E11D48;
113
- --tags-tag-red-text: #BE123C;
114
- /* numbers */
115
- --others-max-width-root: 1200px;
116
- --radius-s: 4px;
117
- --radius-m: 8px;
118
- --radius-l: 12px;
119
- --radius-round: 9999px;
120
- }`,B=`
121
- :root {
122
- /* Dark */
123
- /* colors */
124
- --backgrounds-bg-base: #1B1B1F;
125
- --backgrounds-bg-base-hover: #27282D;
126
- --backgrounds-bg-base-pressed: #2E3035;
127
- --backgrounds-bg-component: #27282D;
128
- --backgrounds-bg-disabled: #27282D;
129
- --backgrounds-bg-field: #27282D;
130
- --backgrounds-bg-field-hover: #2E3035;
131
- --backgrounds-bg-glass: #1b1b1fb8;
132
- --backgrounds-bg-highlight: #172554;
133
- --backgrounds-bg-highlight-hover: #1E3A8A;
134
- --backgrounds-bg-interactive: #60A5FA;
135
- --backgrounds-bg-interactive-hover: #60A5FA;
136
- --backgrounds-bg-overlay: #18181ab2;
137
- --backgrounds-bg-subtle: #18181A;
138
- --backgrounds-bg-subtle-hover: #1B1B1F;
139
- --backgrounds-bg-subtle-pressed: #27282D;
140
- --backgrounds-bg-switch-off: #35373C;
141
- --backgrounds-bg-switch-off-hover: #464B50;
142
- --buttons-button-danger: #9F1239;
143
- --buttons-button-danger-hover: #BE123C;
144
- --buttons-button-danger-pressed: #E11D48;
145
- --buttons-button-inverted: #EDEEF0;
146
- --buttons-button-inverted-hover: #FFFFFF;
147
- --buttons-button-inverted-pressed: #EDEEF0;
148
- --buttons-button-neutral: #27282D;
149
- --buttons-button-neutral-hover: #35373C;
150
- --buttons-button-neutral-pressed: #3C3F44;
151
- --buttons-button-transparent: #ffffff00;
152
- --buttons-button-transparent-hover: #27282D;
153
- --buttons-button-transparent-pressed: #2E3035;
154
- --foregrounds-fg-base: #EDEEF0;
155
- --foregrounds-fg-danger: #FB7185;
156
- --foregrounds-fg-disabled: #3C3F44;
157
- --foregrounds-fg-interactive: #60A5FA;
158
- --foregrounds-fg-interactive-hover: #3B82F6;
159
- --foregrounds-fg-muted: #696E77;
160
- --foregrounds-fg-on-color: #FFFFFF;
161
- --foregrounds-fg-on-inverted: #0A0A0A;
162
- --foregrounds-fg-subtle: #ADB1B8;
163
- --others-spacer: #FFFFFF;
164
- --shadows-card-hover-1: #ffffff1a;
165
- --shadows-card-hover-2: #ffffff29;
166
- --shadows-card-hover-3: #00000066;
167
- --shadows-card-rest-1: #ffffff1a;
168
- --shadows-card-rest-2: #ffffff29;
169
- --shadows-card-rest-3: #00000066;
170
- --shadows-danger-1: #f43f5e1a;
171
- --shadows-error-2: #e11d4840;
172
- --shadows-flyout-1: #ffffff1a;
173
- --shadows-flyout-2: #00000052;
174
- --shadows-interactive-with-active-1: #60A5FA;
175
- --shadows-interactive-with-active-2: #3b82f640;
176
- --shadows-interactive-with-shadow-1: #dbeafe80;
177
- --shadows-interactive-with-shadow-2: #60A5FA;
178
- --shadows-modal-1: #171717;
179
- --shadows-modal-2: #2e303566;
180
- --shadows-modal-3: #ffffff1a;
181
- --shadows-modal-4: #00000052;
182
- --shadows-modal-5: #00000052;
183
- --shadows-switch-background-1: #0000001a;
184
- --shadows-switch-background-2: #0000001a;
185
- --shadows-switch-background-3: #ffffff29;
186
- --shadows-switch-background-4: #0000001a;
187
- --shadows-switch-background-5: #00000033;
188
- --shadows-switch-handle-1: #FFFFFF;
189
- --shadows-switch-handle-2: #FFFFFF;
190
- --shadows-switch-handle-3: #00000029;
191
- --shadows-switch-handle-4: #0000001a;
192
- --shadows-switch-handle-5: #0000001a;
193
- --shadows-switch-handle-6: #0000001a;
194
- --shadows-switch-handle-7: #0000001a;
195
- --shadows-tooltip-1: #ffffff1a;
196
- --shadows-tooltip-2: #00000052;
197
- --stroke-border-base: #2E3035;
198
- --stroke-border-error: #F43F5E;
199
- --stroke-border-interactive: #60A5FA;
200
- --stroke-border-loud: #EDEEF0;
201
- --stroke-border-strong: #35373C;
202
- --stroke-sep: #2E3035;
203
- --tags-tag-blue-bg: #172554;
204
- --tags-tag-blue-bg-hover: #1E2A8A;
205
- --tags-tag-blue-border: #1E3A8A;
206
- --tags-tag-blue-icon: #1D4ED8;
207
- --tags-tag-blue-text: #3B82F6;
208
- --tags-tag-green-bg: #022C22;
209
- --tags-tag-green-bg-hover: #064E3B;
210
- --tags-tag-green-border: #064E3B;
211
- --tags-tag-green-icon: #047857;
212
- --tags-tag-green-text: #10B981;
213
- --tags-tag-neutral-bg: #2E3035;
214
- --tags-tag-neutral-bg-hover: #35373C;
215
- --tags-tag-neutral-border: #3C3F44;
216
- --tags-tag-neutral-icon: #7D828A;
217
- --tags-tag-neutral-text: #ADB1B8;
218
- --tags-tag-orange-bg: #451A03;
219
- --tags-tag-orange-bg-hover: #78350F;
220
- --tags-tag-orange-border: #78350F;
221
- --tags-tag-orange-icon: #B45309;
222
- --tags-tag-orange-text: #F59E0B;
223
- --tags-tag-purple-bg: #2E1064;
224
- --tags-tag-purple-bg-hover: #4C1D95;
225
- --tags-tag-purple-border: #3C3F44;
226
- --tags-tag-purple-icon: #6D28D9;
227
- --tags-tag-purple-text: #8B5CF6;
228
- --tags-tag-red-bg: #4C0519;
229
- --tags-tag-red-bg-hover: #881337;
230
- --tags-tag-red-border: #881337;
231
- --tags-tag-red-icon: #F43F5E;
232
- --tags-tag-red-text: #FF6369;
233
- /* numbers */
234
- --others-max-width-root: 1200px;
235
- --radius-s: 4px;
236
- --radius-m: 8px;
237
- --radius-l: 12px;
238
- --radius-round: 9999px;
239
- }`,a=i(u.defu(g.createDefaultThemeOptions(),{typography:{button:{textTransform:"none",WebkitTextTransform:"none"},subtitle1:{fontWeight:600,fontSize:"18px",color:"#000",lineHeight:1.5},subtitle2:{fontSize:"14px",lineHeight:"24px",fontWeight:500,color:"#030712",marginBottom:"4px"}},palette:{background:{paper:"#ffffff",default:"#F9FAFB"},action:{selected:"rgba(25, 118, 210, 0.08)"}},shape:{borderRadius:8},components:{MuiCssBaseline:{styleOverrides:p},MuiFormLabel:{styleOverrides:{root:{fontSize:"0.875rem"}}},MuiFormControlLabel:{styleOverrides:{root:{marginLeft:0},label:{fontSize:"0.875rem"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:"0.875rem"}}},MuiRadio:{styleOverrides:{root:{padding:4,[`.${e.svgIconClasses.fontSizeMedium}`]:{fontSize:"1.25rem"},[`.${e.svgIconClasses.fontSizeSmall}`]:{fontSize:"1.125rem"}}}},MuiCheckbox:{styleOverrides:{root:{padding:4,[`.${e.svgIconClasses.fontSizeMedium}`]:{fontSize:"1.25rem"},[`.${e.svgIconClasses.fontSizeSmall}`]:{fontSize:"1.125rem"}}}},MuiSwitch:{styleOverrides:{root:{height:28,width:48,padding:8,[`&.${e.switchClasses.sizeSmall}`]:{height:26,width:40,padding:8}},switchBase:{padding:4}}},MuiAutocomplete:{defaultProps:{popupIcon:l.jsx(d,{fontSize:14})},variants:[{props:{},style:({theme:t})=>t.unstable_sx({[`.${e.autocompleteClasses.inputRoot}`]:{pt:1.5,pb:.25,[`.${e.autocompleteClasses.input}.${e.inputBaseClasses.input}`]:{px:0,pt:.5,pb:.25},[`&.${e.inputBaseClasses.sizeSmall}`]:{[`.${e.autocompleteClasses.input}.${e.inputBaseClasses.input}`]:{px:0,py:0,pb:"1px"}}}})}]},MuiTextField:{defaultProps:{variant:"filled"},variants:[{props:{},style:({theme:t,ownerState:s})=>t.unstable_sx({[`.${e.inputBaseClasses.root}`]:{borderRadius:1,lineHeight:"1.5rem",[`.${e.inputBaseClasses.input}`]:{height:"1.5rem"},[`&.${e.inputClasses.multiline}`]:{pl:0,pr:0,pt:"16px","& .MuiInputBase-inputMultiline":{py:0}}},[`.${e.inputClasses.root}`]:{mt:1.5,[`&.${e.inputBaseClasses.hiddenLabel}`]:{mt:0,pt:0,[`.${e.selectClasses.select}.${e.inputClasses.input}:focus`]:{bgcolor:"transparent"}}},[`.${e.inputLabelClasses.standard}`]:{transform:"translate(0px, 18px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(0px, 15px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(0px, -1px) scale(0.8)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(0px, -1px) scale(0.8)"}}},[`.${e.filledInputClasses.root}`]:{":before,:after":{display:"none"},[`.${e.inputBaseClasses.input}`]:{pb:.5,pt:s!=null&&s.label?2:.5,px:1,":focus":{borderRadius:1},[`&.${e.inputBaseClasses.inputSizeSmall}`]:{pb:.25,pt:s!=null&&s.label?1.25:.25},[`&.${e.inputBaseClasses.inputHiddenLabel}`]:{py:.5,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}},[`.${e.inputLabelClasses.filled}`]:{transform:"translate(8px, 11px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 7px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(8px, 2px) scale(0.8)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 0) scale(0.8)"}}},[`.${e.outlinedInputClasses.root}`]:{[`.${e.inputBaseClasses.input}`]:{py:1.25,px:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:.875},[`&.${e.inputBaseClasses.inputHiddenLabel}`]:{py:.5,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}},[`.${e.inputLabelClasses.outlined}`]:{transform:"translate(8px, 10px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 7px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(16px, -7px) scale(0.8)"}}})}]},MuiInput:{defaultProps:{disableUnderline:!0},variants:[{props:{disableUnderline:!0},style:({theme:t})=>t.unstable_sx({fontSize:"0.875rem",lineHeight:"1.5rem",[`&.${e.inputBaseClasses.multiline}`]:{py:0},[`.${e.inputBaseClasses.input}`]:{py:.5,height:"1.5rem"},[`&.${e.inputBaseClasses.sizeSmall}`]:{[`.${e.inputBaseClasses.input}`]:{py:"1px"}}})}]},MuiFilledInput:{styleOverrides:{root:{fontSize:"0.875rem",backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgb(0, 0, 0, 0.06)","@media (hover: none)":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}}}},MuiSelect:{styleOverrides:{select:{display:"flex",alignItems:"center",[`.${e.listItemIconClasses.root}`]:{minWidth:20}}},defaultProps:{variant:"filled",IconComponent:d},variants:[{props:{},style:({theme:t})=>t.unstable_sx({fontSize:"0.875rem",borderRadius:1,lineHeight:"1.5rem",[`&.${e.filledInputClasses.root}`]:{":before,:after":{display:"none"},[`.${e.inputBaseClasses.input}`]:{py:.5,borderRadius:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}},[`&.${e.outlinedInputClasses.root}`]:{[`.${e.inputBaseClasses.input}`]:{py:.5,borderRadius:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}})}]},MuiSlider:{defaultProps:{},variants:[{props:{},style:({theme:t})=>t.unstable_sx({height:3,[`.${e.sliderClasses.track}`]:{borderWidth:0},[`.${e.sliderClasses.thumb}`]:{width:16,height:16},[`&.${e.sliderClasses.sizeSmall}`]:{height:2,[`.${e.sliderClasses.thumb}`]:{width:12,height:12}}})}]},MuiFormHelperText:{styleOverrides:{root:({theme:t})=>t.unstable_sx({mx:1})}},MuiTypography:{variants:[{props:{variant:"body1"},style:({theme:t})=>t.unstable_sx({fontSize:"0.875rem"})},{props:{variant:"body2"},style:({theme:t})=>t.unstable_sx({fontSize:"0.75rem"})}]},MuiMenuItem:{styleOverrides:{root:({theme:t})=>t.unstable_sx({padding:"6px 12px",fontSize:"0.875rem",borderRadius:1,".MuiListItemIcon-root":{minWidth:0,mr:1}})}},MuiListItemButton:{styleOverrides:{root:{padding:"6px 12px"}}},MuiList:{styleOverrides:{root:{padding:4}}},MuiListItemText:{styleOverrides:{primary:{fontSize:"0.875rem"}}},MuiDialogTitle:{styleOverrides:{root:{padding:"16px 24px",borderBottom:"1px solid #E5E7EB"}}},MuiDialogActions:{styleOverrides:{root:{borderTop:"1px solid #E5E7EB",padding:"16px 24px"}}},MuiDialogContent:{styleOverrides:{root:{padding:"12px 24px !important"}}},MuiButton:{defaultProps:{size:"small"},styleOverrides:{contained:({ownerState:t})=>({...(t.color==="inherit"||t.color==="primary")&&t.className!=="ignore-style-override"&&{backgroundColor:"#030712",color:"white","&:hover":{backgroundColor:"#030712"}},[`&.${x.loadingButtonClasses.loading}`]:{color:"grey"}}),outlined:({ownerState:t})=>({...(t.color==="inherit"||t.color==="primary")&&t.className!=="ignore-style-override"&&{bgcolor:"#fff",color:"#000",border:"1px solid #E5E7EB",fontSize:"13px",fontWeight:500,padding:"4px 12px","&:hover":{border:"1px solid #E5E7EB"}}})}}}}),e.createTheme),h={fontSize:"5rem",[a.breakpoints.down("xl")]:{fontSize:"5rem"},[a.breakpoints.down("lg")]:{fontSize:"4rem"},[a.breakpoints.down("md")]:{fontSize:"3rem"},[a.breakpoints.down("sm")]:{fontSize:"2rem"}};a.typography.big={...h};const c=i({typography:{button:{textTransform:"none",WebkitTextTransform:"none"}}});c.typography.big={...h};function d(t){return l.jsx(e.Box,{...t,component:v.Icon,icon:E.default})}exports.create=i;exports.darkThemeRoot=B;exports.genPaletteColor=n;exports.lightThemeRoot=p;exports.pagesTheme=c;exports.theme=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("react/jsx-runtime"),l=require("@arcblock/ux/lib/Config"),o=require("@iconify-icon/react"),p=require("@iconify-icons/tabler/chevron-down"),e=require("@mui/material"),n=require("./locales.js"),u=s=>s&&s.__esModule?s:{default:s},d=u(p),r={fontSize:"5rem","@media (max-width: 1536px)":{fontSize:"5rem"},"@media (max-width: 1200px)":{fontSize:"4rem"},"@media (max-width: 900px)":{fontSize:"3rem"},"@media (max-width: 600px)":{fontSize:"2rem"}};function a(s){return i.jsx(e.Box,{...s,component:o.Icon,icon:d.default})}const m={typography:{big:{...r},button:{textTransform:"none",WebkitTextTransform:"none"},subtitle1:{fontWeight:600,fontSize:"18px",lineHeight:1.5},subtitle2:{fontSize:"14px",lineHeight:"24px",fontWeight:500,marginBottom:"4px"}},palette:{background:{},action:{}},shape:{borderRadius:8},components:{MuiCssBaseline:{},MuiFormLabel:{styleOverrides:{root:{fontSize:"0.875rem"}}},MuiFormControlLabel:{styleOverrides:{root:{marginLeft:0},label:{fontSize:"0.875rem"}}},MuiInputLabel:{styleOverrides:{root:{fontSize:"0.875rem"}}},MuiRadio:{styleOverrides:{root:{padding:4,[`.${e.svgIconClasses.fontSizeMedium}`]:{fontSize:"1.25rem"},[`.${e.svgIconClasses.fontSizeSmall}`]:{fontSize:"1.125rem"}}}},MuiCheckbox:{styleOverrides:{root:{padding:4,[`.${e.svgIconClasses.fontSizeMedium}`]:{fontSize:"1.25rem"},[`.${e.svgIconClasses.fontSizeSmall}`]:{fontSize:"1.125rem"}}}},MuiSwitch:{styleOverrides:{root:{height:28,width:48,padding:8,[`&.${e.switchClasses.sizeSmall}`]:{height:26,width:40,padding:8}},switchBase:{padding:4}}},MuiAutocomplete:{defaultProps:{popupIcon:i.jsx(a,{fontSize:14})},variants:[{props:{},style:({theme:s})=>s.unstable_sx({[`.${e.autocompleteClasses.inputRoot}`]:{pt:1.5,pb:.25,[`.${e.autocompleteClasses.input}.${e.inputBaseClasses.input}`]:{px:0,pt:.5,pb:.25},[`&.${e.inputBaseClasses.sizeSmall}`]:{[`.${e.autocompleteClasses.input}.${e.inputBaseClasses.input}`]:{px:0,py:0,pb:"1px"}}}})}]},MuiTextField:{defaultProps:{variant:"filled"},variants:[{props:{},style:({theme:s,ownerState:t})=>s.unstable_sx({[`.${e.inputBaseClasses.root}`]:{borderRadius:1,lineHeight:"1.5rem",[`.${e.inputBaseClasses.input}`]:{height:"1.5rem"},[`&.${e.inputClasses.multiline}`]:{pl:0,pr:0,pt:"16px","& .MuiInputBase-inputMultiline":{py:0}}},[`.${e.inputClasses.root}`]:{mt:1.5,[`&.${e.inputBaseClasses.hiddenLabel}`]:{mt:0,pt:0,[`.${e.selectClasses.select}.${e.inputClasses.input}:focus`]:{bgcolor:"transparent"}}},[`.${e.inputLabelClasses.standard}`]:{transform:"translate(0px, 18px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(0px, 15px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(0px, -1px) scale(0.8)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(0px, -1px) scale(0.8)"}}},[`.${e.filledInputClasses.root}`]:{":before,:after":{display:"none"},[`.${e.inputBaseClasses.input}`]:{pb:.5,pt:t!=null&&t.label?2:.5,px:1,":focus":{borderRadius:1},[`&.${e.inputBaseClasses.inputSizeSmall}`]:{pb:.25,pt:t!=null&&t.label?1.25:.25},[`&.${e.inputBaseClasses.inputHiddenLabel}`]:{py:.5,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}},[`.${e.inputLabelClasses.filled}`]:{transform:"translate(8px, 11px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 7px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(8px, 2px) scale(0.8)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 0) scale(0.8)"}}},[`.${e.outlinedInputClasses.root}`]:{[`.${e.inputBaseClasses.input}`]:{py:1.25,px:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:.875},[`&.${e.inputBaseClasses.inputHiddenLabel}`]:{py:.5,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}},[`.${e.inputLabelClasses.outlined}`]:{transform:"translate(8px, 10px) scale(1)",[`&.${e.inputLabelClasses.sizeSmall}`]:{transform:"translate(8px, 7px) scale(1)"},[`&.${e.inputLabelClasses.shrink}`]:{transform:"translate(16px, -7px) scale(0.8)"}}})}]},MuiInput:{defaultProps:{disableUnderline:!0},variants:[{props:{disableUnderline:!0},style:({theme:s})=>s.unstable_sx({fontSize:"0.875rem",lineHeight:"1.5rem",[`&.${e.inputBaseClasses.multiline}`]:{py:0},[`.${e.inputBaseClasses.input}`]:{py:.5,height:"1.5rem"},[`&.${e.inputBaseClasses.sizeSmall}`]:{[`.${e.inputBaseClasses.input}`]:{py:"1px"}}})}]},MuiFilledInput:{styleOverrides:{root:({theme:s})=>s.unstable_sx({fontSize:"0.875rem",bgcolor:s.palette.grey[100],"&:hover":{bgcolor:s.palette.grey[100]},"@media (hover: none)":{bgcolor:s.palette.grey[100]}})}},MuiSelect:{styleOverrides:{select:{display:"flex",alignItems:"center",[`.${e.listItemIconClasses.root}`]:{minWidth:20}}},defaultProps:{variant:"filled",IconComponent:a},variants:[{props:{},style:({theme:s})=>s.unstable_sx({fontSize:"0.875rem",borderRadius:1,lineHeight:"1.5rem",[`&.${e.filledInputClasses.root}`]:{":before,:after":{display:"none"},[`.${e.inputBaseClasses.input}`]:{py:.5,borderRadius:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}},[`&.${e.outlinedInputClasses.root}`]:{[`.${e.inputBaseClasses.input}`]:{py:.5,borderRadius:1,[`&.${e.inputBaseClasses.inputSizeSmall}`]:{py:"1px"}}}})}]},MuiSlider:{defaultProps:{},variants:[{props:{},style:({theme:s})=>s.unstable_sx({height:3,[`.${e.sliderClasses.track}`]:{borderWidth:0},[`.${e.sliderClasses.thumb}`]:{width:16,height:16},[`&.${e.sliderClasses.sizeSmall}`]:{height:2,[`.${e.sliderClasses.thumb}`]:{width:12,height:12}}})}]},MuiFormHelperText:{styleOverrides:{root:({theme:s})=>s.unstable_sx({mx:1})}},MuiTypography:{variants:[{props:{variant:"body1"},style:({theme:s})=>s.unstable_sx({fontSize:"0.875rem"})},{props:{variant:"body2"},style:({theme:s})=>s.unstable_sx({fontSize:"0.75rem"})}]},MuiMenuItem:{styleOverrides:{root:({theme:s})=>s.unstable_sx({padding:"6px 12px",fontSize:"0.875rem",borderRadius:1,".MuiListItemIcon-root":{minWidth:0,mr:1}})}},MuiListItemButton:{styleOverrides:{root:{padding:"6px 12px"}}},MuiList:{styleOverrides:{root:{padding:4}}},MuiListItemText:{styleOverrides:{primary:{fontSize:"0.875rem"}}},MuiDialogTitle:{styleOverrides:{root:({theme:s})=>s.unstable_sx({padding:"16px 24px",borderBottom:`1px solid ${s.palette.divider}`})}},MuiDialogActions:{styleOverrides:{root:({theme:s})=>s.unstable_sx({borderTop:`1px solid ${s.palette.divider}`,padding:"16px 24px"})}},MuiDialogContent:{styleOverrides:{root:{padding:"12px 24px !important"}}},MuiButton:{defaultProps:{size:"small"},styleOverrides:{}}}},x={typography:{big:{...r},button:{textTransform:"none",WebkitTextTransform:"none"}}},b=({children:s})=>i.jsx(l.ConfigProvider,{theme:m,translations:n.translations,fallbackLocale:"en",injectFirst:!0,children:s}),c=({children:s})=>i.jsx(l.ConfigProvider,{theme:x,translations:n.translations,fallbackLocale:"en",injectFirst:!0,children:s});exports.DashboardProvider=b;exports.PageProvider=c;