iobroker.admin 7.6.13 → 7.6.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/README.md +7 -8
  2. package/adminWww/assets/{AdapterUpdateDialog-B8g_ZuhP.js → AdapterUpdateDialog-DnnNHIQJ.js} +1 -1
  3. package/adminWww/assets/{Adapters-XtPWdL3s.js → Adapters-Ctxos-gw.js} +4 -4
  4. package/adminWww/assets/{Config-Dhj9WMpz.js → Config-Dyad6_tq.js} +1 -1
  5. package/adminWww/assets/CustomModal-BNDSg_P8.js +1 -0
  6. package/adminWww/assets/{CustomTab-CSgGzXlh.js → CustomTab-BEL1ttN8.js} +1 -1
  7. package/adminWww/assets/{EasyMode-Bwx_UimW.js → EasyMode-3ydknWSd.js} +1 -1
  8. package/adminWww/assets/{Enums-B-PrqYys.js → Enums-nRoQYhch.js} +2 -2
  9. package/adminWww/assets/{Fields-CYjxm_8L.js → Fields-Bwvci3VO.js} +1 -1
  10. package/adminWww/assets/{Files-CsBMd5VX.js → Files-Dzs9GmrC.js} +1 -1
  11. package/adminWww/assets/{Hosts-D7aAXH9U.js → Hosts-BjpHSLCf.js} +3 -3
  12. package/adminWww/assets/{Instances-Bj8CqStT.js → Instances-BtTV4PMv.js} +2 -2
  13. package/adminWww/assets/Intro-DD3K3IVm.js +2 -0
  14. package/adminWww/assets/{Logs-Bb16bYuu.js → Logs-BXU61QOI.js} +1 -1
  15. package/adminWww/assets/{Objects-C7k5tHdx.js → Objects-jsWq-neK.js} +2 -2
  16. package/adminWww/assets/{State-DPLzxZ6D.js → State-CuA1h-bU.js} +1 -1
  17. package/adminWww/assets/{Users-BQ3pWAxq.js → Users-BFdQMyo4.js} +1 -1
  18. package/adminWww/assets/{ace-j1VT51C2.js → ace-CI9-Cq3I.js} +2 -2
  19. package/adminWww/assets/{bootstrap-BNkcLa73.js → bootstrap-FCtLxt0T.js} +14 -14
  20. package/adminWww/assets/{index-jZ28cZd6.js → index-3IvffoSA.js} +1 -1
  21. package/adminWww/assets/{index-C6O1p4S2.js → index-DPxBLJAn.js} +2 -2
  22. package/adminWww/assets/{sentry-9i5rBs6L.js → sentry-BNaNpYqi.js} +1 -1
  23. package/adminWww/assets/{zh-cn-CULr7ytT.js → zh-cn-CbEN7EL2.js} +1 -1
  24. package/adminWww/index.html +1 -1
  25. package/adminWww/mf-manifest.json +1 -1
  26. package/adminWww/remoteEntry.js +2 -2
  27. package/io-package.json +15 -15
  28. package/package.json +12 -7
  29. package/adminWww/assets/CustomModal-4eTuDNla.js +0 -1
  30. package/adminWww/assets/Intro-sAT0x17e.js +0 -2
@@ -1 +1 @@
1
- import{j as e,E as i,J as o}from"./DefaultPropsProvider-BrbE0teb.js";import{i as r,a as _}from"./bootstrap-BNkcLa73.js";const a={checkIcon:{color:i[700]},cancelIcon:{color:o[700]},wrapperContent:{display:"flex",flexFlow:"nowrap",alignItems:"inherit"}};function l(n){return e.jsxs(r.Grid2,{container:!0,style:a.wrapperContent,alignItems:"center",direction:"row",spacing:1,children:[e.jsx(r.Grid2,{children:n.state?e.jsx(_.CheckCircle,{style:a.checkIcon}):e.jsx(_.Cancel,{style:a.cancelIcon})}),e.jsx(r.Grid2,{children:e.jsx(r.Typography,{children:n.children})})]})}export{l as S};
1
+ import{j as e,E as i,J as o}from"./DefaultPropsProvider-BrbE0teb.js";import{i as r,a as _}from"./bootstrap-FCtLxt0T.js";const a={checkIcon:{color:i[700]},cancelIcon:{color:o[700]},wrapperContent:{display:"flex",flexFlow:"nowrap",alignItems:"inherit"}};function l(n){return e.jsxs(r.Grid2,{container:!0,style:a.wrapperContent,alignItems:"center",direction:"row",spacing:1,children:[e.jsx(r.Grid2,{children:n.state?e.jsx(_.CheckCircle,{style:a.checkIcon}):e.jsx(_.Cancel,{style:a.cancelIcon})}),e.jsx(r.Grid2,{children:e.jsx(r.Typography,{children:n.children})})]})}export{l as S};
@@ -1 +1 @@
1
- import{j as t}from"./DefaultPropsProvider-BrbE0teb.js";import{X as P,Y as O,U as h,i,a as d,b as w,Z as F,f as b,_ as E,$ as N,a0 as W,a1 as z,h as B,T as R}from"./bootstrap-BNkcLa73.js";import{i as j}from"./iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js";import{I as y,a as S,b as $}from"./Fields-CYjxm_8L.js";import A from"./user1-BHHH0LIq.js";import M from"./user2-BN56rMPt.js";import L from"./user3-Mx6XZSLK.js";import H from"./user4-DpEs_YiD.js";import Y from"./user5-CVfrnlXE.js";import q from"./user6-C7HkYnq4.js";import V from"./user7-VAQcubFn.js";import X from"./user8-CwACr_jq.js";import Z from"./user9-Dk4Mlhcc.js";import J from"./user10-Dvmqf8l1.js";import K from"./user11-C8ly5pY7.js";import Q from"./user12-CHtaF3qG.js";import ee from"./group1-DBYxcyxq.js";import te from"./group2-BUQSell7.js";import se from"./group3-B0AdMrOp.js";import oe from"./group4-TeCgDok7.js";import ie from"./group5-CJ_-VPxg.js";import re from"./group6-JW-nEhw_.js";import ne from"./group7-CWpVuR4T.js";import le from"./group8-CRGBxCwd.js";import ae from"./group9-BXRQchYG.js";import ce from"./group10-BIcZMfE3.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js";import"./ace-j1VT51C2.js";import"./FilledInput-D-tz8rvg.js";import"./preload-helper-C1FmrZbK.js";import"./blueGrey-B0oIowPK.js";import"./emotion-cache.browser.esm-B8BFze5o.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js";import"./extends-CF3RwP-h.js";const k=e=>{const s=e.isDragging?0:1,o=h.getInvertedColor(e.user.common.color,e.themeType,!0),r={cursor:"grab",opacity:s,overflow:"hidden",color:o};return e.user.common.color&&(r.backgroundColor=e.user.common.color),t.jsx(i.Card,{style:r,sx:e.styles.userGroupCard2,children:t.jsxs("div",{style:e.styles.userCardContent,children:[t.jsxs("div",{style:e.styles.right,children:[t.jsx(i.Checkbox,{checked:e.user.common.enabled,style:{color:o},disabled:e.user.common.dontDelete,onChange:()=>{e.socket.extendObject(e.user._id,{common:{enabled:!e.user.common.enabled}}).then(()=>e.updateData())}}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showUserEditDialog(e.user,!1),children:t.jsx(d.Edit,{style:{color:o}})}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showUserDeleteDialog(e.user),disabled:e.user.common.dontDelete,children:t.jsx(d.Delete,{style:e.user.common.dontDelete?null:{color:o}})})]}),t.jsxs(i.CardContent,{children:[t.jsxs(i.Typography,{gutterBottom:!0,component:"div",style:e.styles.userGroupTitle,children:[e.user.common.icon?t.jsx(w,{style:e.styles.icon,src:e.user.common.icon}):t.jsx(d.Person,{style:e.styles.icon}),t.jsxs("div",{children:[t.jsxs("div",{children:[t.jsx("span",{style:e.styles.userGroupUserName,children:e.getText(e.user.common.name)}),t.jsxs("span",{style:e.styles.userGroupUserID,children:["[",e.user._id,"]"]})]}),t.jsx("span",{children:e.user.common.desc?t.jsx("div",{style:e.styles.description,children:e.getText(e.user.common.desc)}):null})]})]}),e.groups.find(n=>n.common.members&&n.common.members.includes(e.user._id))?t.jsxs("div",{children:[e.t("In groups"),":"]}):null,t.jsx("div",{children:e.groups.map(n=>{var m,p;if(!n.common.members||!n.common.members.includes(e.user._id))return null;const a=n&&((m=n.common)!=null&&m.color)?h.getInvertedColor(n.common.color,e.themeType,!0):o;return t.jsxs(i.Card,{variant:"outlined",sx:e.styles.userGroupMember,style:{color:a,borderColor:`${a}80`,background:((p=n.common)==null?void 0:p.color)||"inherit"},children:[n.common.icon?t.jsx(w,{style:e.styles.icon,src:n.common.icon}):t.jsx(d.Group,{style:e.styles.icon}),e.getText(n.common.name),t.jsx(i.IconButton,{size:"small",onClick:()=>e.removeUserFromGroup(e.user._id,n._id),children:t.jsx(d.Clear,{style:{color:a}})})]},n._id)})})]})]})})},de=e=>{const s=j.useRef(),[{isDragging:o},r,n]=P({type:"user",item:()=>{var a;return{userId:e.user._id,preview:t.jsx("div",{style:{width:(a=s.current)==null?void 0:a.offsetWidth},children:t.jsx(k,{...e})})}},end:(a,m)=>{const p=m.getDropResult();a&&p&&e.addUserToGroup(a.userId,p.groupId)},collect:a=>({isDragging:a.isDragging(),handlerId:a.getHandlerId()})});return j.useEffect(()=>{n(O(),{captureDraggingState:!0})},[n]),t.jsx("div",{ref:r,children:t.jsx("div",{ref:s,children:t.jsx(k,{isDragging:o,...e})})})};function he(e,s){return s.group.common.members?!s.group.common.members.includes(e.getItem().userId):!0}const me=e=>{var D;const[{CanDrop:s,isOver:o},r]=F(()=>({accept:"user",drop:()=>({groupId:e.group._id}),canDrop:(g,c)=>he(c,e),collect:g=>({isOver:g.isOver(),CanDrop:g.canDrop()})}),[e.group.common.members]);let n=.7,a;s&&o?(n=s?1:.125,a=e.styles.userGroupCardSecondary):s&&(n=s?.75:.25);const p=h.getInvertedColor(e.group.common.color,e.themeType,!0),x={opacity:n,overflow:"hidden",color:p};return e.group.common.color&&(x.backgroundColor=e.group.common.color),t.jsxs(i.Card,{style:x,ref:r,sx:h.getStyle(e.theme,e.styles.userGroupCard2,a),children:[t.jsxs("div",{style:e.styles.right,children:[t.jsx(i.IconButton,{size:"small",onClick:()=>e.showGroupEditDialog(e.group,!1),children:t.jsx(d.Edit,{style:{color:p}})}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showGroupDeleteDialog(e.group),disabled:e.group.common.dontDelete,children:t.jsx(d.Delete,{style:e.group.common.dontDelete?null:{color:p}})})]}),t.jsxs(i.CardContent,{children:[t.jsxs(i.Typography,{gutterBottom:!0,component:"div",style:e.styles.userGroupTitle,children:[e.group.common.icon?t.jsx(w,{style:e.styles.icon,src:e.group.common.icon}):t.jsx(d.Group,{style:e.styles.icon}),t.jsxs("div",{children:[t.jsxs("div",{children:[t.jsx("span",{style:e.styles.userGroupUserName,children:e.getText(e.group.common.name)}),t.jsxs("span",{children:["[",e.group._id,"]"]})]}),e.group.common.desc?t.jsx("div",{style:e.styles.description,children:e.getText(e.group.common.desc)}):null]})]}),(D=e.group.common.members)!=null&&D.length?t.jsxs("div",{children:[e.t("Group members"),":"]}):null,t.jsx("div",{children:(e.group.common.members||[]).map((g,c)=>{var G,T;const l=e.users.find(I=>I._id===g),f=l&&((G=l.common)!=null&&G.color)?h.getInvertedColor(l.common.color,e.themeType,!0):p;return l?t.jsxs(i.Card,{variant:"outlined",sx:e.styles.userGroupMember,style:{color:f,borderColor:`${f}40`,background:((T=l.common)==null?void 0:T.color)||"inherit"},children:[l.common.icon?t.jsx(w,{style:e.styles.icon,src:l.common.icon}):t.jsx(d.Person,{style:e.styles.icon}),e.getText(l.common.name),t.jsx(i.IconButton,{size:"small",onClick:()=>e.removeUserFromGroup(g,e.group._id),children:t.jsx(d.Clear,{style:{color:f}})})]},c):null})})]})]})},_=[A,M,L,H,Y,q,V,X,Z,J,K,Q],pe={contentRoot:{padding:"16px 24px"}};class ue extends j.Component{constructor(s){super(s),this.state={originalId:s.user._id,passwordRepeat:s.user.common.password}}componentDidMount(){if(this.props.isNew){const s=_[Math.round(Math.random()*(_.length-1))];s&&h.getSvg(s).then(o=>{const r=h.clone(this.props.user);r.common.icon=o,this.props.onChange(r)})}}render(){const s=this.props.users.find(c=>c._id===this.props.user._id),o=this.props.user._id!==this.state.originalId,r=c=>c.split(".").pop(),n=c=>c.replace(h.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").replace(/,/g,"_").replace(/__/g,"_").replace(/__/g,"_").toLowerCase(),a=(c,l)=>{const f=c.split(".");return f[f.length-1]=l,f.join(".")},m=this.props.getText(this.props.user.common.desc),p=this.props.getText(this.props.user.common.name),x=b.checkPassword(this.props.user.common.password),D=b.checkPassword(this.props.user.common.password,this.state.passwordRepeat);let g=this.props.user._id!=="system.user."&&!x&&!D;return(this.props.isNew&&s||s&&o)&&(g=!1),t.jsxs(i.Dialog,{fullWidth:this.props.innerWidth<500,open:!0,onClose:(c,l)=>{l!=="backdropClick"&&l!=="escapeKeyDown"&&this.props.onClose()},children:[t.jsx(i.DialogTitle,{style:{...this.props.styles.dialogTitle,padding:12},children:this.props.t("User parameters")}),t.jsx(i.DialogContent,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...pe.contentRoot}},children:t.jsxs(i.Grid2,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Name",t:this.props.t,value:p,onChange:c=>{const l=h.clone(this.props.user);!this.props.user.common.dontDelete&&n(this.props.getText(l.common.name))===r(l._id)&&(l._id=a(l._id,n(c))),l.common.name=c,this.props.onChange(l)},autoComplete:"new-password",icon:d.TextFields,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID edit",t:this.props.t,disabled:this.props.user.common.dontDelete,value:this.props.user._id.split(".")[this.props.user._id.split(".").length-1],onChange:c=>{const l=h.clone(this.props.user);l._id=a(l._id,n(c)),this.props.onChange(l)},icon:d.LocalOffer,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID preview",t:this.props.t,disabled:!0,value:this.props.user._id,icon:d.Pageview,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Description",t:this.props.t,value:m,onChange:c=>{const l=h.clone(this.props.user);l.common.desc=c,this.props.onChange(l)},icon:d.Description,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Password",t:this.props.t,value:this.props.user.common.password,error:x?this.props.t(x):void 0,onChange:c=>{const l=h.clone(this.props.user);l.common.password=c,this.props.onChange(l)},type:"password",autoComplete:"new-password",icon:d.VpnKey,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Password repeat",t:this.props.t,value:this.state.passwordRepeat,error:D?this.props.t(D):void 0,onChange:c=>this.setState({passwordRepeat:c}),type:"password",autoComplete:"new-password",icon:d.VpnKey,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(E,{icons:_,label:"Icon",value:this.props.user.common.icon,onChange:c=>{const l=h.clone(this.props.user);l.common.icon=c,this.props.onChange(l)},previewStyle:this.props.styles.iconPreview,icon:d.Image})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(S,{label:"Color",t:this.props.t,value:this.props.user.common.color,previewStyle:this.props.styles.iconPreview,onChange:c=>{const l=h.clone(this.props.user);l.common.color=c,this.props.onChange(l)},icon:d.ColorLens,style:this.props.styles.colorPicker,styles:this.props.styles})})]})}),t.jsxs(i.DialogActions,{style:this.props.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!g,startIcon:t.jsx(d.Check,{}),children:this.props.t("Save")}),t.jsx(i.Button,{variant:"contained",color:"grey",onClick:this.props.onClose,startIcon:t.jsx(d.Close,{}),children:this.props.t("Cancel")})]})]})}}const v=[ee,te,se,oe,ie,re,ne,le,ae,ce];function ge(e){const s=(r,n)=>Object.values(r).map((a,m)=>{const p=Object.keys(r)[m];return n(a,p)});let o=e.group.common.acl;return o=o||{},o.object=o.object||{read:!0,list:!0,write:!0,delete:!1,create:void 0},o.object={read:!0,list:!0,write:!0,delete:!1,...o.object},o.state=o.state||{read:!0,list:!0,write:!0,delete:!1,create:void 0},o.state={read:!0,list:!0,write:!0,delete:!1,...o.state},o.users=o.users||{write:!1,delete:!1,create:!1,list:void 0,read:void 0},o.users={write:!1,delete:!1,create:!1,...o.users},o.other=o.other||{http:!1,execute:!1,sendto:!0},o.other={http:!1,execute:!1,sendto:!0,...o.other},o.file=o.file||{read:!0,list:!0,write:!1,delete:!1,create:!1},o.file={read:!0,list:!0,write:!1,delete:!1,create:!1,...o.file},t.jsx(i.Grid2,{container:!0,spacing:e.innerWidth<500?1:4,style:e.styles.dialog,children:s(e.group.common.acl||{},(r,n)=>t.jsxs(i.Grid2,{size:{xs:12,md:12},children:[t.jsx(i.Box,{component:"h2",sx:e.styles.permHeaders,children:e.t(`group_acl_${n}`)}),s(r,(a,m)=>t.jsx(i.FormControlLabel,{control:t.jsx(i.Checkbox,{disabled:e.group._id==="system.group.administrator",checked:a,onChange:p=>{const x=h.clone(e.group);x.common.acl[n][m]=p.target.checked,e.onChange(x)}}),label:e.t(`group_acl_${m}`),labelPlacement:"top"},m))]},n))},"PermissionsTab")}const xe={contentRoot:{padding:"16px 24px"}};class fe extends j.Component{constructor(s){super(s),this.state={tab:0,originalId:s.group._id}}componentDidMount(){if(this.props.isNew){const s=v[Math.round(Math.random()*(v.length-1))];s&&h.getSvg(s).then(o=>{const r=h.clone(this.props.group);r.common.icon=o,this.props.onChange(r)})}}render(){const s=this.props.groups.find(c=>c._id===this.props.group._id),o=this.props.group._id!==this.state.originalId;let r=this.props.group._id!=="system.group."&&this.props.group.common.password===this.props.group.common.passwordRepeat;const n=c=>c.split(".").pop(),a=c=>c.replace(h.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").toLowerCase(),m=(c,l)=>{const f=c.split(".");return f[f.length-1]=l,f.join(".")};this.props.isNew?s&&(r=!1):s&&o&&(r=!1);const p=this.props.getText(this.props.group.common.desc),x=this.props.getText(this.props.group.common.name),g=[t.jsxs(i.Grid2,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Name",t:this.props.t,value:x,onChange:c=>{const l=h.clone(this.props.group);!this.props.group.common.dontDelete&&a(this.props.getText(l.common.name))===n(l._id)&&(l._id=m(l._id,a(c))),l.common.name=c,this.props.onChange(l)},autoComplete:"off",icon:d.TextFields,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID edit",t:this.props.t,disabled:this.props.group.common.dontDelete,value:this.props.group._id.split(".")[this.props.group._id.split(".").length-1],onChange:c=>{const l=h.clone(this.props.group);l._id=m(l._id,a(c)),this.props.onChange(l)},icon:d.LocalOffer,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID preview",t:this.props.t,disabled:!0,value:this.props.group._id,icon:d.Pageview,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Description",t:this.props.t,value:p,onChange:c=>{const l=h.clone(this.props.group);l.common.desc=c,this.props.onChange(l)},icon:d.Description,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(E,{label:"Icon",icons:v,value:this.props.group.common.icon,onChange:c=>{const l=h.clone(this.props.group);l.common.icon=c,this.props.onChange(l)},previewStyle:this.props.styles.iconPreview,icon:d.Image})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(S,{label:"Color",t:this.props.t,value:this.props.group.common.color,previewStyle:this.props.styles.iconPreview,onChange:c=>{const l=h.clone(this.props.group);l.common.color=c,this.props.onChange(l)},icon:d.ColorLens,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),ge(this.props)][this.state.tab];return t.jsxs(i.Dialog,{open:!0,onClose:(c,l)=>{l!=="backdropClick"&&l!=="escapeKeyDown"&&this.props.onClose()},fullWidth:this.props.innerWidth<500,children:[t.jsx(i.DialogTitle,{style:this.props.styles.dialogTitle,children:t.jsxs(i.Tabs,{variant:"fullWidth",value:this.state.tab,onChange:(c,l)=>this.setState({tab:l}),children:[t.jsx(i.Tab,{label:this.props.t("Main"),value:0}),t.jsx(i.Tab,{label:this.props.t("Permissions"),value:1})]})}),t.jsx(i.DialogContent,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...xe.contentRoot}},children:g}),t.jsxs(i.DialogActions,{style:this.props.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!r,startIcon:t.jsx(d.Check,{}),children:this.props.t("Save")}),t.jsx(i.Button,{variant:"contained",color:"grey",onClick:this.props.onClose,startIcon:t.jsx(d.Close,{}),children:this.props.t("Cancel")})]})]})}}function ye(e){return t.jsxs(i.Dialog,{open:!0,onClose:e.onClose,children:[t.jsx(i.DialogTitle,{children:e.t("Please confirm")}),t.jsx(i.DialogContent,{children:t.jsx(i.DialogContentText,{children:e.t("Do you want to delete user %s?",e.getText(e.user.common.name))})}),t.jsxs(i.DialogActions,{children:[t.jsx(i.Button,{variant:"contained",color:"primary",onClick:()=>e.deleteUser(e.user._id),startIcon:t.jsx(d.Delete,{}),children:e.t("Delete")}),t.jsx(i.Button,{variant:"contained",color:"grey",autoFocus:!0,onClick:e.onClose,startIcon:t.jsx(d.Close,{}),children:e.t("Cancel")})]})]})}function De(e){return t.jsxs(i.Dialog,{open:!0,onClose:e.onClose,children:[t.jsx(i.DialogTitle,{children:e.t("Please confirm")}),t.jsx(i.DialogContent,{children:t.jsx(i.DialogContentText,{children:e.t("Do you want to delete group %s?",e.getText(e.group.common.name))})}),t.jsxs(i.DialogActions,{style:e.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",onClick:()=>e.deleteGroup(e.group._id),startIcon:t.jsx(d.Delete,{}),children:e.t("Delete")}),t.jsx(i.Button,{variant:"contained",color:"grey",autoFocus:!0,onClick:e.onClose,startIcon:t.jsx(d.Close,{}),children:e.t("Cancel")})]})]})}const U="***********",Ce="0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)",u={mainGridCont:{height:"calc(100% - 55px)",overflowY:"auto"},childGridCont:{display:"flex",flexDirection:"column"},childGridContWide:{height:"100%"},canDrop:e=>({backgroundColor:e.palette.background.default}),headContainer:{margin:10},blocksContainer:{overflowY:"auto",overflowX:"hidden"},userGroupCard2:e=>({border:"1px solid #FFF",borderColor:e.palette.divider,m:"10px",minHeight:150,backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:"all 200ms ease-out",opacity:1,overflow:"hidden","&:hover":{overflowY:"auto",boxShadow:Ce}}),userGroupCardSecondary:e=>({color:e.palette.text.primary,backgroundColor:e.palette.success.light}),permHeaders:e=>({backgroundColor:e.palette.mode==="dark"?e.palette.background.default:e.palette.primary.main,p:"4px",borderRadius:"2px",color:"#EEE"}),userCardContent:{height:"100%",opacity:1},userGroupTitle:{display:"inline-flex",alignItems:"center"},userGroupUserName:{fontWeight:900,padding:5},userGroupUserID:{opacity:.7,padding:5},description:{fontSize:10,fontStyle:"italic",marginLeft:5,opacity:.7},userGroupMember:e=>({display:"inline-flex",m:"4px",p:"4px",backgroundColor:"#00000010",border:"1px solid #FFF",borderColor:e.palette.text.primary,color:e.palette.text.primary,alignItems:"center"}),icon:{height:32,width:32,marginRight:5,backgroundSize:"cover",backgroundPosition:"center"},right:{float:"right"},left:{float:"left",marginRight:10},dialog:{},flex:{display:"flex"},formControl:{display:"flex",padding:24,flexGrow:1e3},formContainer:{display:"flex",justifyContent:"center",alignItems:"center"},formIcon:{margin:10,opacity:.6},descriptionPanel:e=>({width:"100%",backgroundColor:"transparent",mb:"20px",mt:"20px",ml:"20px",opacity:.75,border:"none",display:"flex",alignItems:"center","& a":{pl:"3px",color:e.palette.mode==="dark"?"#EEE":"#111"}}),dialogTitle:{borderBottom:"1px solid #00000020",padding:0,width:"100%"},dialogActions:{borderTop:"1px solid #00000020",width:"100%"},dialogPaper:{overflowY:"initial",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"calc(100% - 100px)",height:"calc(100% - 100px)",maxWidth:800,maxHeight:"100%"},dialogPaperMini:{maxHeight:300},colorPicker:{},iconPreview:{height:40,width:40},mainDescription:{fontSize:"200%"},deleteDialog:{padding:20},narrowContent:{padding:"8px 8px 8px 8px"}},je=()=>{const e=$();return e.display?t.jsx("div",{style:e.style,children:e.item.preview}):null},we={_id:"system.user.",type:"user",common:{name:"",password:"",enabled:!0,color:"",desc:""},native:{},enums:{}},_e={_id:void 0,native:{},type:"group",common:{name:"",desc:"",members:[],dontDelete:void 0,acl:{object:{list:!1,read:!1,write:!1,delete:!1,create:void 0},state:{list:!1,read:!1,write:!1,create:!1,delete:!1},users:{list:!1,read:!1,write:!1,create:!1,delete:!1},other:{execute:!1,http:!1,sendto:!1},file:{list:!1,read:!1,write:!1,create:!1,delete:!1}},icon:"",color:""}};class C extends j.Component{constructor(s){super(s),this.state={users:null,groups:null,userEditDialog:!1,userEditDialogNew:null,groupEditDialog:!1,groupEditDialogNew:null,userDeleteDialog:!1,groupDeleteDialog:!1,innerWidth:0}}componentDidMount(){this.setState({innerWidth:window.innerWidth},()=>this.updateData())}componentDidUpdate(){window.innerWidth!==this.state.innerWidth&&setTimeout(()=>this.setState({innerWidth:window.innerWidth}),100)}getText=s=>s&&(typeof s=="object"?s[this.props.lang]||s.en||"":s||"")||"";showUserEditDialog=(s,o)=>{s=h.clone(s),s.common.password=s.common.password?U:"",this.setState({userEditDialog:s,userEditDialogNew:o})};showGroupEditDialog=(s,o)=>{s=h.clone(s),this.setState({groupEditDialog:s,groupEditDialogNew:o})};updateData=()=>{let s;return this.props.socket.getForeignObjects("system.user.*","user").then(o=>(s=Object.values(o).sort((r,n)=>r._id>n._id?1:-1),s.forEach(r=>{r.common&&r.common.description&&(r.common.desc||(r.common.desc=r.common.description),delete r.common.description)}),this.props.socket.getForeignObjects("system.group.*","group"))).then(o=>{const r=Object.values(o).sort((n,a)=>n._id>a._id?1:-1);r.forEach(n=>{n.common&&n.common.description&&(n.common.desc||(n.common.desc=n.common.description),delete n.common.description)}),this.setState({groups:r,users:s})})};changeUserFormData=s=>this.setState({userEditDialog:s});changeGroupFormData=s=>this.setState({groupEditDialog:s});saveUser=async s=>{const o=h.clone(this.state.userEditDialog),r=this.state.users.find(a=>a._id===o._id),n=o.common.password&&o.common.password!==U?o.common.password:"";if(r?o.common.password=r.common.password:o.common.password="",await this.props.socket.setObject(o._id,o),typeof this.state.userEditDialog=="object"&&s&&s!==this.state.userEditDialog._id)try{await this.props.socket.delObject(s);for(let a=0;a<this.state.groups.length;a++){const m=this.state.groups[a];if(m.common.members.includes(s)){const p=h.clone(m);p.common.members[p.common.members.indexOf(s)]=o._id,await this.props.socket.setObject(p._id,p)}}}catch(a){window.alert(`Cannot delete user: ${a}`)}if(n)try{await this.props.socket.changePassword(o._id,n)}catch(a){window.alert(`Cannot change password: ${a}`)}this.setState({userEditDialog:!1},()=>this.updateData())};saveGroup=async s=>{if(typeof this.state.groupEditDialog=="object"){if(await this.props.socket.setObject(this.state.groupEditDialog._id,this.state.groupEditDialog),s&&s!==this.state.groupEditDialog._id)try{await this.props.socket.delObject(s)}catch(o){window.alert(`Cannot delete user: ${o}`)}this.setState({groupEditDialog:!1},()=>this.updateData())}};showUserDeleteDialog=s=>this.setState({userDeleteDialog:s});showGroupDeleteDialog=s=>this.setState({groupDeleteDialog:s});deleteUser=s=>{this.props.socket.delObject(s).then(()=>Promise.all(this.state.groups.map(o=>{if(o.common.members.includes(s)){const r=h.clone(o);return r.common.members.splice(r.common.members.indexOf(s),1),this.props.socket.setObject(r._id,r)}return Promise.resolve(null)}))).catch(o=>window.alert(`Cannot delete user: ${o}`)).then(()=>{this.setState({userDeleteDialog:!1},()=>this.updateData())})};deleteGroup=s=>this.props.socket.delObject(s).then(()=>this.setState({groupDeleteDialog:!1},()=>this.updateData())).catch(o=>window.alert(`Cannot delete user: ${o}`));addUserToGroup=(s,o)=>{const r=this.state.groups.find(a=>a._id===o),n=r.common.members;n.includes(s)||(n.push(s),this.props.socket.setObject(r._id,r).then(()=>this.updateData()).catch(a=>window.alert(`Cannot delete user: ${a}`)))};removeUserFromGroup=(s,o)=>{const r=this.state.groups.find(a=>a._id===o),n=r.common.members;n.includes(s)&&(n.splice(n.indexOf(s),1),this.props.socket.setObject(r._id,r).then(()=>this.updateData()))};static _isUniqueName(s,o,r){return!s.find(n=>n._id===`system.user.${o.toLowerCase()}_${r}`||n.common.name===`${o} ${r}`)}static findNewUniqueName(s,o,r){let n=1;for(;!C._isUniqueName(o,r,n);)n++;return{_id:`system.${s?"group":"user"}.${r.toLowerCase()}_${n}`,name:`${r} ${n}`}}render(){return!this.state.users||!this.state.groups?t.jsx(i.LinearProgress,{}):t.jsxs(N,{backend:b.isTouchDevice()?W:z,children:[t.jsx(je,{}),t.jsx(i.Box,{component:"div",sx:u.descriptionPanel,children:this.props.t("You can drag users to groups.")}),t.jsxs(i.Grid2,{container:!0,spacing:2,style:u.mainGridCont,children:[t.jsxs(i.Grid2,{size:{xs:12,md:6},style:{...u.childGridCont,...this.state.innerWidth>600?u.childGridContWide:void 0},children:[t.jsxs("div",{style:u.headContainer,children:[t.jsx(i.Fab,{size:"small",style:u.right,onClick:()=>{const{_id:s,name:o}=C.findNewUniqueName(!0,this.state.groups,this.props.t("Group")),r=h.clone(_e);r._id=s,r.common.name=o,this.showGroupEditDialog(r,!0)},children:t.jsx(d.GroupAdd,{})}),t.jsx(i.Typography,{gutterBottom:!0,variant:"h4",component:"h4",children:this.props.t("Groups")})]}),t.jsx("div",{style:u.blocksContainer,children:this.state.groups.sort((s,o)=>{var a,m;const r=(this.getText((a=s==null?void 0:s.common)==null?void 0:a.name)||s._id).toLowerCase(),n=(this.getText((m=o==null?void 0:o.common)==null?void 0:m.name)||o._id).toLowerCase();return r>n?1:r<n?-1:0}).map(s=>t.jsx(me,{themeType:this.props.themeType,group:s,users:this.state.users,showGroupEditDialog:this.showGroupEditDialog,showGroupDeleteDialog:this.showGroupDeleteDialog,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:u,...this.props},s._id))})]}),t.jsxs(i.Grid2,{size:{xs:12,md:6},style:{...u.childGridCont,...this.state.innerWidth>600?u.childGridContWide:void 0},children:[t.jsxs("div",{style:u.headContainer,children:[t.jsx(i.Fab,{size:"small",style:u.right,onClick:()=>{const{_id:s,name:o}=C.findNewUniqueName(!1,this.state.users,this.props.t("User")),r=h.clone(we);r._id=s,r.common.name=o,this.showUserEditDialog(r,!0)},children:t.jsx(d.PersonAdd,{})}),t.jsx(i.Typography,{gutterBottom:!0,variant:"h4",component:"h4",children:this.props.t("Users")})]}),t.jsx("div",{style:u.blocksContainer,children:this.state.users.sort((s,o)=>{var a,m;const r=(this.getText((a=s==null?void 0:s.common)==null?void 0:a.name)||s._id).toLowerCase(),n=(this.getText((m=o==null?void 0:o.common)==null?void 0:m.name)||o._id).toLowerCase();return r>n?1:r<n?-1:0}).map(s=>t.jsx(de,{themeType:this.props.themeType,user:s,groups:this.state.groups,showUserEditDialog:this.showUserEditDialog,showUserDeleteDialog:this.showUserDeleteDialog,updateData:this.updateData,addUserToGroup:this.addUserToGroup,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:u,...this.props},s._id))})]})]}),this.state.userEditDialog?t.jsx(ue,{onClose:()=>this.setState({userEditDialog:!1}),users:this.state.users,user:this.state.userEditDialog,isNew:this.state.userEditDialogNew,t:this.props.t,getText:this.getText,styles:u,onChange:this.changeUserFormData,saveData:this.saveUser,innerWidth:this.state.innerWidth}):null,this.state.groupEditDialog?t.jsx(fe,{onClose:()=>this.setState({groupEditDialog:!1}),groups:this.state.groups,group:this.state.groupEditDialog,isNew:this.state.groupEditDialogNew,t:this.props.t,getText:this.getText,styles:u,onChange:this.changeGroupFormData,innerWidth:this.state.innerWidth,saveData:this.saveGroup}):null,this.state.userDeleteDialog?t.jsx(ye,{getText:this.getText,onClose:()=>this.setState({userDeleteDialog:!1}),user:this.state.userDeleteDialog,t:this.props.t,deleteUser:this.deleteUser}):null,this.state.groupDeleteDialog?t.jsx(De,{getText:this.getText,onClose:()=>this.setState({groupDeleteDialog:!1}),group:this.state.groupDeleteDialog,t:this.props.t,styles:u,deleteGroup:this.deleteGroup}):null]})}}function at(e){return t.jsx(B,{children:t.jsx(R,{style:{display:"flex",flexDirection:"column",overflow:"auto"},children:t.jsx(C,{t:e.t,lang:e.lang,socket:e.socket,ready:e.ready,expertMode:e.expertMode,themeType:e.themeType,theme:e.theme})})})}export{at as default};
1
+ import{j as t}from"./DefaultPropsProvider-BrbE0teb.js";import{X as P,Y as O,U as h,i,a as d,b as w,Z as F,f as b,_ as E,$ as N,a0 as W,a1 as z,h as B,T as R}from"./bootstrap-FCtLxt0T.js";import{i as j}from"./iobroker_admin__loadShare__react__loadShare__-DtlEM_52.js";import{I as y,a as S,b as $}from"./Fields-Bwvci3VO.js";import A from"./user1-BHHH0LIq.js";import M from"./user2-BN56rMPt.js";import L from"./user3-Mx6XZSLK.js";import H from"./user4-DpEs_YiD.js";import Y from"./user5-CVfrnlXE.js";import q from"./user6-C7HkYnq4.js";import V from"./user7-VAQcubFn.js";import X from"./user8-CwACr_jq.js";import Z from"./user9-Dk4Mlhcc.js";import J from"./user10-Dvmqf8l1.js";import K from"./user11-C8ly5pY7.js";import Q from"./user12-CHtaF3qG.js";import ee from"./group1-DBYxcyxq.js";import te from"./group2-BUQSell7.js";import se from"./group3-B0AdMrOp.js";import oe from"./group4-TeCgDok7.js";import ie from"./group5-CJ_-VPxg.js";import re from"./group6-JW-nEhw_.js";import ne from"./group7-CWpVuR4T.js";import le from"./group8-CRGBxCwd.js";import ae from"./group9-BXRQchYG.js";import ce from"./group10-BIcZMfE3.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BGyJCibC.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-VDoBF19b.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-gw2iqPBS.js";import"./ace-CI9-Cq3I.js";import"./FilledInput-D-tz8rvg.js";import"./preload-helper-C1FmrZbK.js";import"./blueGrey-B0oIowPK.js";import"./emotion-cache.browser.esm-B8BFze5o.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-B1OZ7tj-.js";import"./extends-CF3RwP-h.js";const k=e=>{const s=e.isDragging?0:1,o=h.getInvertedColor(e.user.common.color,e.themeType,!0),r={cursor:"grab",opacity:s,overflow:"hidden",color:o};return e.user.common.color&&(r.backgroundColor=e.user.common.color),t.jsx(i.Card,{style:r,sx:e.styles.userGroupCard2,children:t.jsxs("div",{style:e.styles.userCardContent,children:[t.jsxs("div",{style:e.styles.right,children:[t.jsx(i.Checkbox,{checked:e.user.common.enabled,style:{color:o},disabled:e.user.common.dontDelete,onChange:()=>{e.socket.extendObject(e.user._id,{common:{enabled:!e.user.common.enabled}}).then(()=>e.updateData())}}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showUserEditDialog(e.user,!1),children:t.jsx(d.Edit,{style:{color:o}})}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showUserDeleteDialog(e.user),disabled:e.user.common.dontDelete,children:t.jsx(d.Delete,{style:e.user.common.dontDelete?null:{color:o}})})]}),t.jsxs(i.CardContent,{children:[t.jsxs(i.Typography,{gutterBottom:!0,component:"div",style:e.styles.userGroupTitle,children:[e.user.common.icon?t.jsx(w,{style:e.styles.icon,src:e.user.common.icon}):t.jsx(d.Person,{style:e.styles.icon}),t.jsxs("div",{children:[t.jsxs("div",{children:[t.jsx("span",{style:e.styles.userGroupUserName,children:e.getText(e.user.common.name)}),t.jsxs("span",{style:e.styles.userGroupUserID,children:["[",e.user._id,"]"]})]}),t.jsx("span",{children:e.user.common.desc?t.jsx("div",{style:e.styles.description,children:e.getText(e.user.common.desc)}):null})]})]}),e.groups.find(n=>n.common.members&&n.common.members.includes(e.user._id))?t.jsxs("div",{children:[e.t("In groups"),":"]}):null,t.jsx("div",{children:e.groups.map(n=>{var m,p;if(!n.common.members||!n.common.members.includes(e.user._id))return null;const a=n&&((m=n.common)!=null&&m.color)?h.getInvertedColor(n.common.color,e.themeType,!0):o;return t.jsxs(i.Card,{variant:"outlined",sx:e.styles.userGroupMember,style:{color:a,borderColor:`${a}80`,background:((p=n.common)==null?void 0:p.color)||"inherit"},children:[n.common.icon?t.jsx(w,{style:e.styles.icon,src:n.common.icon}):t.jsx(d.Group,{style:e.styles.icon}),e.getText(n.common.name),t.jsx(i.IconButton,{size:"small",onClick:()=>e.removeUserFromGroup(e.user._id,n._id),children:t.jsx(d.Clear,{style:{color:a}})})]},n._id)})})]})]})})},de=e=>{const s=j.useRef(),[{isDragging:o},r,n]=P({type:"user",item:()=>{var a;return{userId:e.user._id,preview:t.jsx("div",{style:{width:(a=s.current)==null?void 0:a.offsetWidth},children:t.jsx(k,{...e})})}},end:(a,m)=>{const p=m.getDropResult();a&&p&&e.addUserToGroup(a.userId,p.groupId)},collect:a=>({isDragging:a.isDragging(),handlerId:a.getHandlerId()})});return j.useEffect(()=>{n(O(),{captureDraggingState:!0})},[n]),t.jsx("div",{ref:r,children:t.jsx("div",{ref:s,children:t.jsx(k,{isDragging:o,...e})})})};function he(e,s){return s.group.common.members?!s.group.common.members.includes(e.getItem().userId):!0}const me=e=>{var D;const[{CanDrop:s,isOver:o},r]=F(()=>({accept:"user",drop:()=>({groupId:e.group._id}),canDrop:(g,c)=>he(c,e),collect:g=>({isOver:g.isOver(),CanDrop:g.canDrop()})}),[e.group.common.members]);let n=.7,a;s&&o?(n=s?1:.125,a=e.styles.userGroupCardSecondary):s&&(n=s?.75:.25);const p=h.getInvertedColor(e.group.common.color,e.themeType,!0),x={opacity:n,overflow:"hidden",color:p};return e.group.common.color&&(x.backgroundColor=e.group.common.color),t.jsxs(i.Card,{style:x,ref:r,sx:h.getStyle(e.theme,e.styles.userGroupCard2,a),children:[t.jsxs("div",{style:e.styles.right,children:[t.jsx(i.IconButton,{size:"small",onClick:()=>e.showGroupEditDialog(e.group,!1),children:t.jsx(d.Edit,{style:{color:p}})}),t.jsx(i.IconButton,{size:"small",onClick:()=>e.showGroupDeleteDialog(e.group),disabled:e.group.common.dontDelete,children:t.jsx(d.Delete,{style:e.group.common.dontDelete?null:{color:p}})})]}),t.jsxs(i.CardContent,{children:[t.jsxs(i.Typography,{gutterBottom:!0,component:"div",style:e.styles.userGroupTitle,children:[e.group.common.icon?t.jsx(w,{style:e.styles.icon,src:e.group.common.icon}):t.jsx(d.Group,{style:e.styles.icon}),t.jsxs("div",{children:[t.jsxs("div",{children:[t.jsx("span",{style:e.styles.userGroupUserName,children:e.getText(e.group.common.name)}),t.jsxs("span",{children:["[",e.group._id,"]"]})]}),e.group.common.desc?t.jsx("div",{style:e.styles.description,children:e.getText(e.group.common.desc)}):null]})]}),(D=e.group.common.members)!=null&&D.length?t.jsxs("div",{children:[e.t("Group members"),":"]}):null,t.jsx("div",{children:(e.group.common.members||[]).map((g,c)=>{var G,T;const l=e.users.find(I=>I._id===g),f=l&&((G=l.common)!=null&&G.color)?h.getInvertedColor(l.common.color,e.themeType,!0):p;return l?t.jsxs(i.Card,{variant:"outlined",sx:e.styles.userGroupMember,style:{color:f,borderColor:`${f}40`,background:((T=l.common)==null?void 0:T.color)||"inherit"},children:[l.common.icon?t.jsx(w,{style:e.styles.icon,src:l.common.icon}):t.jsx(d.Person,{style:e.styles.icon}),e.getText(l.common.name),t.jsx(i.IconButton,{size:"small",onClick:()=>e.removeUserFromGroup(g,e.group._id),children:t.jsx(d.Clear,{style:{color:f}})})]},c):null})})]})]})},_=[A,M,L,H,Y,q,V,X,Z,J,K,Q],pe={contentRoot:{padding:"16px 24px"}};class ue extends j.Component{constructor(s){super(s),this.state={originalId:s.user._id,passwordRepeat:s.user.common.password}}componentDidMount(){if(this.props.isNew){const s=_[Math.round(Math.random()*(_.length-1))];s&&h.getSvg(s).then(o=>{const r=h.clone(this.props.user);r.common.icon=o,this.props.onChange(r)})}}render(){const s=this.props.users.find(c=>c._id===this.props.user._id),o=this.props.user._id!==this.state.originalId,r=c=>c.split(".").pop(),n=c=>c.replace(h.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").replace(/,/g,"_").replace(/__/g,"_").replace(/__/g,"_").toLowerCase(),a=(c,l)=>{const f=c.split(".");return f[f.length-1]=l,f.join(".")},m=this.props.getText(this.props.user.common.desc),p=this.props.getText(this.props.user.common.name),x=b.checkPassword(this.props.user.common.password),D=b.checkPassword(this.props.user.common.password,this.state.passwordRepeat);let g=this.props.user._id!=="system.user."&&!x&&!D;return(this.props.isNew&&s||s&&o)&&(g=!1),t.jsxs(i.Dialog,{fullWidth:this.props.innerWidth<500,open:!0,onClose:(c,l)=>{l!=="backdropClick"&&l!=="escapeKeyDown"&&this.props.onClose()},children:[t.jsx(i.DialogTitle,{style:{...this.props.styles.dialogTitle,padding:12},children:this.props.t("User parameters")}),t.jsx(i.DialogContent,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...pe.contentRoot}},children:t.jsxs(i.Grid2,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Name",t:this.props.t,value:p,onChange:c=>{const l=h.clone(this.props.user);!this.props.user.common.dontDelete&&n(this.props.getText(l.common.name))===r(l._id)&&(l._id=a(l._id,n(c))),l.common.name=c,this.props.onChange(l)},autoComplete:"new-password",icon:d.TextFields,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID edit",t:this.props.t,disabled:this.props.user.common.dontDelete,value:this.props.user._id.split(".")[this.props.user._id.split(".").length-1],onChange:c=>{const l=h.clone(this.props.user);l._id=a(l._id,n(c)),this.props.onChange(l)},icon:d.LocalOffer,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID preview",t:this.props.t,disabled:!0,value:this.props.user._id,icon:d.Pageview,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Description",t:this.props.t,value:m,onChange:c=>{const l=h.clone(this.props.user);l.common.desc=c,this.props.onChange(l)},icon:d.Description,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Password",t:this.props.t,value:this.props.user.common.password,error:x?this.props.t(x):void 0,onChange:c=>{const l=h.clone(this.props.user);l.common.password=c,this.props.onChange(l)},type:"password",autoComplete:"new-password",icon:d.VpnKey,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Password repeat",t:this.props.t,value:this.state.passwordRepeat,error:D?this.props.t(D):void 0,onChange:c=>this.setState({passwordRepeat:c}),type:"password",autoComplete:"new-password",icon:d.VpnKey,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(E,{icons:_,label:"Icon",value:this.props.user.common.icon,onChange:c=>{const l=h.clone(this.props.user);l.common.icon=c,this.props.onChange(l)},previewStyle:this.props.styles.iconPreview,icon:d.Image})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(S,{label:"Color",t:this.props.t,value:this.props.user.common.color,previewStyle:this.props.styles.iconPreview,onChange:c=>{const l=h.clone(this.props.user);l.common.color=c,this.props.onChange(l)},icon:d.ColorLens,style:this.props.styles.colorPicker,styles:this.props.styles})})]})}),t.jsxs(i.DialogActions,{style:this.props.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!g,startIcon:t.jsx(d.Check,{}),children:this.props.t("Save")}),t.jsx(i.Button,{variant:"contained",color:"grey",onClick:this.props.onClose,startIcon:t.jsx(d.Close,{}),children:this.props.t("Cancel")})]})]})}}const v=[ee,te,se,oe,ie,re,ne,le,ae,ce];function ge(e){const s=(r,n)=>Object.values(r).map((a,m)=>{const p=Object.keys(r)[m];return n(a,p)});let o=e.group.common.acl;return o=o||{},o.object=o.object||{read:!0,list:!0,write:!0,delete:!1,create:void 0},o.object={read:!0,list:!0,write:!0,delete:!1,...o.object},o.state=o.state||{read:!0,list:!0,write:!0,delete:!1,create:void 0},o.state={read:!0,list:!0,write:!0,delete:!1,...o.state},o.users=o.users||{write:!1,delete:!1,create:!1,list:void 0,read:void 0},o.users={write:!1,delete:!1,create:!1,...o.users},o.other=o.other||{http:!1,execute:!1,sendto:!0},o.other={http:!1,execute:!1,sendto:!0,...o.other},o.file=o.file||{read:!0,list:!0,write:!1,delete:!1,create:!1},o.file={read:!0,list:!0,write:!1,delete:!1,create:!1,...o.file},t.jsx(i.Grid2,{container:!0,spacing:e.innerWidth<500?1:4,style:e.styles.dialog,children:s(e.group.common.acl||{},(r,n)=>t.jsxs(i.Grid2,{size:{xs:12,md:12},children:[t.jsx(i.Box,{component:"h2",sx:e.styles.permHeaders,children:e.t(`group_acl_${n}`)}),s(r,(a,m)=>t.jsx(i.FormControlLabel,{control:t.jsx(i.Checkbox,{disabled:e.group._id==="system.group.administrator",checked:a,onChange:p=>{const x=h.clone(e.group);x.common.acl[n][m]=p.target.checked,e.onChange(x)}}),label:e.t(`group_acl_${m}`),labelPlacement:"top"},m))]},n))},"PermissionsTab")}const xe={contentRoot:{padding:"16px 24px"}};class fe extends j.Component{constructor(s){super(s),this.state={tab:0,originalId:s.group._id}}componentDidMount(){if(this.props.isNew){const s=v[Math.round(Math.random()*(v.length-1))];s&&h.getSvg(s).then(o=>{const r=h.clone(this.props.group);r.common.icon=o,this.props.onChange(r)})}}render(){const s=this.props.groups.find(c=>c._id===this.props.group._id),o=this.props.group._id!==this.state.originalId;let r=this.props.group._id!=="system.group."&&this.props.group.common.password===this.props.group.common.passwordRepeat;const n=c=>c.split(".").pop(),a=c=>c.replace(h.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").toLowerCase(),m=(c,l)=>{const f=c.split(".");return f[f.length-1]=l,f.join(".")};this.props.isNew?s&&(r=!1):s&&o&&(r=!1);const p=this.props.getText(this.props.group.common.desc),x=this.props.getText(this.props.group.common.name),g=[t.jsxs(i.Grid2,{container:!0,spacing:this.props.innerWidth<500?1:4,style:this.props.styles.dialog,children:[t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Name",t:this.props.t,value:x,onChange:c=>{const l=h.clone(this.props.group);!this.props.group.common.dontDelete&&a(this.props.getText(l.common.name))===n(l._id)&&(l._id=m(l._id,a(c))),l.common.name=c,this.props.onChange(l)},autoComplete:"off",icon:d.TextFields,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID edit",t:this.props.t,disabled:this.props.group.common.dontDelete,value:this.props.group._id.split(".")[this.props.group._id.split(".").length-1],onChange:c=>{const l=h.clone(this.props.group);l._id=m(l._id,a(c)),this.props.onChange(l)},icon:d.LocalOffer,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"ID preview",t:this.props.t,disabled:!0,value:this.props.group._id,icon:d.Pageview,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(y,{label:"Description",t:this.props.t,value:p,onChange:c=>{const l=h.clone(this.props.group);l.common.desc=c,this.props.onChange(l)},icon:d.Description,styles:this.props.styles})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(E,{label:"Icon",icons:v,value:this.props.group.common.icon,onChange:c=>{const l=h.clone(this.props.group);l.common.icon=c,this.props.onChange(l)},previewStyle:this.props.styles.iconPreview,icon:d.Image})}),t.jsx(i.Grid2,{size:{xs:12,md:6},children:t.jsx(S,{label:"Color",t:this.props.t,value:this.props.group.common.color,previewStyle:this.props.styles.iconPreview,onChange:c=>{const l=h.clone(this.props.group);l.common.color=c,this.props.onChange(l)},icon:d.ColorLens,style:this.props.styles.colorPicker,styles:this.props.styles})})]}),ge(this.props)][this.state.tab];return t.jsxs(i.Dialog,{open:!0,onClose:(c,l)=>{l!=="backdropClick"&&l!=="escapeKeyDown"&&this.props.onClose()},fullWidth:this.props.innerWidth<500,children:[t.jsx(i.DialogTitle,{style:this.props.styles.dialogTitle,children:t.jsxs(i.Tabs,{variant:"fullWidth",value:this.state.tab,onChange:(c,l)=>this.setState({tab:l}),children:[t.jsx(i.Tab,{label:this.props.t("Main"),value:0}),t.jsx(i.Tab,{label:this.props.t("Permissions"),value:1})]})}),t.jsx(i.DialogContent,{sx:{"&.MuiDialogContent-root":{...this.props.innerWidth<500?this.props.styles.narrowContent:void 0,...xe.contentRoot}},children:g}),t.jsxs(i.DialogActions,{style:this.props.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>this.props.saveData(this.props.isNew?null:this.state.originalId),disabled:!r,startIcon:t.jsx(d.Check,{}),children:this.props.t("Save")}),t.jsx(i.Button,{variant:"contained",color:"grey",onClick:this.props.onClose,startIcon:t.jsx(d.Close,{}),children:this.props.t("Cancel")})]})]})}}function ye(e){return t.jsxs(i.Dialog,{open:!0,onClose:e.onClose,children:[t.jsx(i.DialogTitle,{children:e.t("Please confirm")}),t.jsx(i.DialogContent,{children:t.jsx(i.DialogContentText,{children:e.t("Do you want to delete user %s?",e.getText(e.user.common.name))})}),t.jsxs(i.DialogActions,{children:[t.jsx(i.Button,{variant:"contained",color:"primary",onClick:()=>e.deleteUser(e.user._id),startIcon:t.jsx(d.Delete,{}),children:e.t("Delete")}),t.jsx(i.Button,{variant:"contained",color:"grey",autoFocus:!0,onClick:e.onClose,startIcon:t.jsx(d.Close,{}),children:e.t("Cancel")})]})]})}function De(e){return t.jsxs(i.Dialog,{open:!0,onClose:e.onClose,children:[t.jsx(i.DialogTitle,{children:e.t("Please confirm")}),t.jsx(i.DialogContent,{children:t.jsx(i.DialogContentText,{children:e.t("Do you want to delete group %s?",e.getText(e.group.common.name))})}),t.jsxs(i.DialogActions,{style:e.styles.dialogActions,children:[t.jsx(i.Button,{variant:"contained",color:"primary",onClick:()=>e.deleteGroup(e.group._id),startIcon:t.jsx(d.Delete,{}),children:e.t("Delete")}),t.jsx(i.Button,{variant:"contained",color:"grey",autoFocus:!0,onClick:e.onClose,startIcon:t.jsx(d.Close,{}),children:e.t("Cancel")})]})]})}const U="***********",Ce="0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)",u={mainGridCont:{height:"calc(100% - 55px)",overflowY:"auto"},childGridCont:{display:"flex",flexDirection:"column"},childGridContWide:{height:"100%"},canDrop:e=>({backgroundColor:e.palette.background.default}),headContainer:{margin:10},blocksContainer:{overflowY:"auto",overflowX:"hidden"},userGroupCard2:e=>({border:"1px solid #FFF",borderColor:e.palette.divider,m:"10px",minHeight:150,backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:"all 200ms ease-out",opacity:1,overflow:"hidden","&:hover":{overflowY:"auto",boxShadow:Ce}}),userGroupCardSecondary:e=>({color:e.palette.text.primary,backgroundColor:e.palette.success.light}),permHeaders:e=>({backgroundColor:e.palette.mode==="dark"?e.palette.background.default:e.palette.primary.main,p:"4px",borderRadius:"2px",color:"#EEE"}),userCardContent:{height:"100%",opacity:1},userGroupTitle:{display:"inline-flex",alignItems:"center"},userGroupUserName:{fontWeight:900,padding:5},userGroupUserID:{opacity:.7,padding:5},description:{fontSize:10,fontStyle:"italic",marginLeft:5,opacity:.7},userGroupMember:e=>({display:"inline-flex",m:"4px",p:"4px",backgroundColor:"#00000010",border:"1px solid #FFF",borderColor:e.palette.text.primary,color:e.palette.text.primary,alignItems:"center"}),icon:{height:32,width:32,marginRight:5,backgroundSize:"cover",backgroundPosition:"center"},right:{float:"right"},left:{float:"left",marginRight:10},dialog:{},flex:{display:"flex"},formControl:{display:"flex",padding:24,flexGrow:1e3},formContainer:{display:"flex",justifyContent:"center",alignItems:"center"},formIcon:{margin:10,opacity:.6},descriptionPanel:e=>({width:"100%",backgroundColor:"transparent",mb:"20px",mt:"20px",ml:"20px",opacity:.75,border:"none",display:"flex",alignItems:"center","& a":{pl:"3px",color:e.palette.mode==="dark"?"#EEE":"#111"}}),dialogTitle:{borderBottom:"1px solid #00000020",padding:0,width:"100%"},dialogActions:{borderTop:"1px solid #00000020",width:"100%"},dialogPaper:{overflowY:"initial",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"calc(100% - 100px)",height:"calc(100% - 100px)",maxWidth:800,maxHeight:"100%"},dialogPaperMini:{maxHeight:300},colorPicker:{},iconPreview:{height:40,width:40},mainDescription:{fontSize:"200%"},deleteDialog:{padding:20},narrowContent:{padding:"8px 8px 8px 8px"}},je=()=>{const e=$();return e.display?t.jsx("div",{style:e.style,children:e.item.preview}):null},we={_id:"system.user.",type:"user",common:{name:"",password:"",enabled:!0,color:"",desc:""},native:{},enums:{}},_e={_id:void 0,native:{},type:"group",common:{name:"",desc:"",members:[],dontDelete:void 0,acl:{object:{list:!1,read:!1,write:!1,delete:!1,create:void 0},state:{list:!1,read:!1,write:!1,create:!1,delete:!1},users:{list:!1,read:!1,write:!1,create:!1,delete:!1},other:{execute:!1,http:!1,sendto:!1},file:{list:!1,read:!1,write:!1,create:!1,delete:!1}},icon:"",color:""}};class C extends j.Component{constructor(s){super(s),this.state={users:null,groups:null,userEditDialog:!1,userEditDialogNew:null,groupEditDialog:!1,groupEditDialogNew:null,userDeleteDialog:!1,groupDeleteDialog:!1,innerWidth:0}}componentDidMount(){this.setState({innerWidth:window.innerWidth},()=>this.updateData())}componentDidUpdate(){window.innerWidth!==this.state.innerWidth&&setTimeout(()=>this.setState({innerWidth:window.innerWidth}),100)}getText=s=>s&&(typeof s=="object"?s[this.props.lang]||s.en||"":s||"")||"";showUserEditDialog=(s,o)=>{s=h.clone(s),s.common.password=s.common.password?U:"",this.setState({userEditDialog:s,userEditDialogNew:o})};showGroupEditDialog=(s,o)=>{s=h.clone(s),this.setState({groupEditDialog:s,groupEditDialogNew:o})};updateData=()=>{let s;return this.props.socket.getForeignObjects("system.user.*","user").then(o=>(s=Object.values(o).sort((r,n)=>r._id>n._id?1:-1),s.forEach(r=>{r.common&&r.common.description&&(r.common.desc||(r.common.desc=r.common.description),delete r.common.description)}),this.props.socket.getForeignObjects("system.group.*","group"))).then(o=>{const r=Object.values(o).sort((n,a)=>n._id>a._id?1:-1);r.forEach(n=>{n.common&&n.common.description&&(n.common.desc||(n.common.desc=n.common.description),delete n.common.description)}),this.setState({groups:r,users:s})})};changeUserFormData=s=>this.setState({userEditDialog:s});changeGroupFormData=s=>this.setState({groupEditDialog:s});saveUser=async s=>{const o=h.clone(this.state.userEditDialog),r=this.state.users.find(a=>a._id===o._id),n=o.common.password&&o.common.password!==U?o.common.password:"";if(r?o.common.password=r.common.password:o.common.password="",await this.props.socket.setObject(o._id,o),typeof this.state.userEditDialog=="object"&&s&&s!==this.state.userEditDialog._id)try{await this.props.socket.delObject(s);for(let a=0;a<this.state.groups.length;a++){const m=this.state.groups[a];if(m.common.members.includes(s)){const p=h.clone(m);p.common.members[p.common.members.indexOf(s)]=o._id,await this.props.socket.setObject(p._id,p)}}}catch(a){window.alert(`Cannot delete user: ${a}`)}if(n)try{await this.props.socket.changePassword(o._id,n)}catch(a){window.alert(`Cannot change password: ${a}`)}this.setState({userEditDialog:!1},()=>this.updateData())};saveGroup=async s=>{if(typeof this.state.groupEditDialog=="object"){if(await this.props.socket.setObject(this.state.groupEditDialog._id,this.state.groupEditDialog),s&&s!==this.state.groupEditDialog._id)try{await this.props.socket.delObject(s)}catch(o){window.alert(`Cannot delete user: ${o}`)}this.setState({groupEditDialog:!1},()=>this.updateData())}};showUserDeleteDialog=s=>this.setState({userDeleteDialog:s});showGroupDeleteDialog=s=>this.setState({groupDeleteDialog:s});deleteUser=s=>{this.props.socket.delObject(s).then(()=>Promise.all(this.state.groups.map(o=>{if(o.common.members.includes(s)){const r=h.clone(o);return r.common.members.splice(r.common.members.indexOf(s),1),this.props.socket.setObject(r._id,r)}return Promise.resolve(null)}))).catch(o=>window.alert(`Cannot delete user: ${o}`)).then(()=>{this.setState({userDeleteDialog:!1},()=>this.updateData())})};deleteGroup=s=>this.props.socket.delObject(s).then(()=>this.setState({groupDeleteDialog:!1},()=>this.updateData())).catch(o=>window.alert(`Cannot delete user: ${o}`));addUserToGroup=(s,o)=>{const r=this.state.groups.find(a=>a._id===o),n=r.common.members;n.includes(s)||(n.push(s),this.props.socket.setObject(r._id,r).then(()=>this.updateData()).catch(a=>window.alert(`Cannot delete user: ${a}`)))};removeUserFromGroup=(s,o)=>{const r=this.state.groups.find(a=>a._id===o),n=r.common.members;n.includes(s)&&(n.splice(n.indexOf(s),1),this.props.socket.setObject(r._id,r).then(()=>this.updateData()))};static _isUniqueName(s,o,r){return!s.find(n=>n._id===`system.user.${o.toLowerCase()}_${r}`||n.common.name===`${o} ${r}`)}static findNewUniqueName(s,o,r){let n=1;for(;!C._isUniqueName(o,r,n);)n++;return{_id:`system.${s?"group":"user"}.${r.toLowerCase()}_${n}`,name:`${r} ${n}`}}render(){return!this.state.users||!this.state.groups?t.jsx(i.LinearProgress,{}):t.jsxs(N,{backend:b.isTouchDevice()?W:z,children:[t.jsx(je,{}),t.jsx(i.Box,{component:"div",sx:u.descriptionPanel,children:this.props.t("You can drag users to groups.")}),t.jsxs(i.Grid2,{container:!0,spacing:2,style:u.mainGridCont,children:[t.jsxs(i.Grid2,{size:{xs:12,md:6},style:{...u.childGridCont,...this.state.innerWidth>600?u.childGridContWide:void 0},children:[t.jsxs("div",{style:u.headContainer,children:[t.jsx(i.Fab,{size:"small",style:u.right,onClick:()=>{const{_id:s,name:o}=C.findNewUniqueName(!0,this.state.groups,this.props.t("Group")),r=h.clone(_e);r._id=s,r.common.name=o,this.showGroupEditDialog(r,!0)},children:t.jsx(d.GroupAdd,{})}),t.jsx(i.Typography,{gutterBottom:!0,variant:"h4",component:"h4",children:this.props.t("Groups")})]}),t.jsx("div",{style:u.blocksContainer,children:this.state.groups.sort((s,o)=>{var a,m;const r=(this.getText((a=s==null?void 0:s.common)==null?void 0:a.name)||s._id).toLowerCase(),n=(this.getText((m=o==null?void 0:o.common)==null?void 0:m.name)||o._id).toLowerCase();return r>n?1:r<n?-1:0}).map(s=>t.jsx(me,{themeType:this.props.themeType,group:s,users:this.state.users,showGroupEditDialog:this.showGroupEditDialog,showGroupDeleteDialog:this.showGroupDeleteDialog,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:u,...this.props},s._id))})]}),t.jsxs(i.Grid2,{size:{xs:12,md:6},style:{...u.childGridCont,...this.state.innerWidth>600?u.childGridContWide:void 0},children:[t.jsxs("div",{style:u.headContainer,children:[t.jsx(i.Fab,{size:"small",style:u.right,onClick:()=>{const{_id:s,name:o}=C.findNewUniqueName(!1,this.state.users,this.props.t("User")),r=h.clone(we);r._id=s,r.common.name=o,this.showUserEditDialog(r,!0)},children:t.jsx(d.PersonAdd,{})}),t.jsx(i.Typography,{gutterBottom:!0,variant:"h4",component:"h4",children:this.props.t("Users")})]}),t.jsx("div",{style:u.blocksContainer,children:this.state.users.sort((s,o)=>{var a,m;const r=(this.getText((a=s==null?void 0:s.common)==null?void 0:a.name)||s._id).toLowerCase(),n=(this.getText((m=o==null?void 0:o.common)==null?void 0:m.name)||o._id).toLowerCase();return r>n?1:r<n?-1:0}).map(s=>t.jsx(de,{themeType:this.props.themeType,user:s,groups:this.state.groups,showUserEditDialog:this.showUserEditDialog,showUserDeleteDialog:this.showUserDeleteDialog,updateData:this.updateData,addUserToGroup:this.addUserToGroup,removeUserFromGroup:this.removeUserFromGroup,getText:this.getText,styles:u,...this.props},s._id))})]})]}),this.state.userEditDialog?t.jsx(ue,{onClose:()=>this.setState({userEditDialog:!1}),users:this.state.users,user:this.state.userEditDialog,isNew:this.state.userEditDialogNew,t:this.props.t,getText:this.getText,styles:u,onChange:this.changeUserFormData,saveData:this.saveUser,innerWidth:this.state.innerWidth}):null,this.state.groupEditDialog?t.jsx(fe,{onClose:()=>this.setState({groupEditDialog:!1}),groups:this.state.groups,group:this.state.groupEditDialog,isNew:this.state.groupEditDialogNew,t:this.props.t,getText:this.getText,styles:u,onChange:this.changeGroupFormData,innerWidth:this.state.innerWidth,saveData:this.saveGroup}):null,this.state.userDeleteDialog?t.jsx(ye,{getText:this.getText,onClose:()=>this.setState({userDeleteDialog:!1}),user:this.state.userDeleteDialog,t:this.props.t,deleteUser:this.deleteUser}):null,this.state.groupDeleteDialog?t.jsx(De,{getText:this.getText,onClose:()=>this.setState({groupDeleteDialog:!1}),group:this.state.groupDeleteDialog,t:this.props.t,styles:u,deleteGroup:this.deleteGroup}):null]})}}function at(e){return t.jsx(B,{children:t.jsx(R,{style:{display:"flex",flexDirection:"column",overflow:"auto"},children:t.jsx(C,{t:e.t,lang:e.lang,socket:e.socket,ready:e.ready,expertMode:e.expertMode,themeType:e.themeType,theme:e.theme})})})}export{at as default};
@@ -163,7 +163,7 @@ var ye={exports:{}};(function(pe,$e){(function(){var R="ace",x=function(){return
163
163
  .ace-tm .ace_indent-guide-active {
164
164
  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;
165
165
  }
166
- `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(R,x,P){x.isDark=!1,x.cssClass="ace-tm",x.cssText=R("./textmate-css"),x.$id="ace/theme/textmate";var k=R("../lib/dom");k.importCssString(x.cssText,x.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(R,x,P){"no use strict";var k=R("./lib/lang"),M=R("./lib/net"),$=R("./lib/dom"),a=R("./lib/app_config").AppConfig;P.exports=x=new a;var h={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};x.get=function(t){if(!h.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return h[t]},x.set=function(t,e){if(h.hasOwnProperty(t))h[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&$.useStrictCSP(e)},x.all=function(){return k.copyObject(h)},x.$modes={},x.moduleUrl=function(t,e){if(h.$moduleUrls[t])return h.$moduleUrls[t];var i=t.split("/");e=e||i[i.length-2]||"";var s=e=="snippets"?"/":"-",l=i[i.length-1];if(e=="worker"&&s=="-"){var c=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");l=l.replace(c,"")}(!l||l==e)&&i.length>1&&(l=i[i.length-2]);var m=h[e+"Path"];return m==null?m=h.basePath:s=="/"&&(e=s=""),m&&m.slice(-1)!="/"&&(m+="/"),m+e+s+l+this.get("suffix")},x.setModuleUrl=function(t,e){return h.$moduleUrls[t]=e};var r=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,R("./theme/textmate"));if(o)return o(t,e);console.error("loader is not configured")},o;x.setLoader=function(t){o=t},x.dynamicModules=Object.create(null),x.$loading={},x.$loaded={},x.loadModule=function(t,e){var i;if(Array.isArray(t))var s=t[0],l=t[1];else if(typeof t=="string")var l=t;var c=function(m){if(m&&!x.$loading[l])return e&&e(m);if(x.$loading[l]||(x.$loading[l]=[]),x.$loading[l].push(e),!(x.$loading[l].length>1)){var v=function(){r(l,function(g,f){f&&(x.$loaded[l]=f),x._emit("load.module",{name:l,module:f});var b=x.$loading[l];x.$loading[l]=null,b.forEach(function(L){L&&L(f)})})};if(!x.get("packaged"))return v();M.loadScript(x.moduleUrl(l,s),v),n()}};if(x.dynamicModules[l])x.dynamicModules[l]().then(function(m){m.default?c(m.default):c(m)});else{try{i=this.$require(l)}catch{}c(i||x.$loaded[l])}},x.$require=function(t){if(typeof P.require=="function"){var e="require";return P[e](t)}},x.setModuleLoader=function(t,e){x.dynamicModules[t]=e};var n=function(){!h.basePath&&!h.workerPath&&!h.modePath&&!h.themePath&&!Object.keys(h.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),n=function(){})};x.version="1.40.0"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(R,x,P){R("./lib/fixoldbrowsers");var k=R("./config");k.setLoader(function(h,r){R([h],function(o){r(null,o)})});var M=function(){return this||typeof window<"u"&&window}();P.exports=function(h){k.init=$,k.$require=R,h.require=R},$(!0);function $(h){if(!(!M||!M.document)){k.set("packaged",h||R.packaged||P.packaged||M.define&&(void 0).packaged);var r={},o="",n=document.currentScript||document._currentScript,t=n&&n.ownerDocument||document;n&&n.src&&(o=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),i=0;i<e.length;i++){var s=e[i],l=s.src||s.getAttribute("src");if(l){for(var c=s.attributes,m=0,v=c.length;m<v;m++){var g=c[m];g.name.indexOf("data-ace-")===0&&(r[a(g.name.replace(/^data-ace-/,""))]=g.value)}var f=l.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);f&&(o=f[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var b in r)typeof r[b]<"u"&&k.set(b,r[b])}}function a(h){return h.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(R,x,P){var k=function(){function M($,a,h,r){this.start={row:$,column:a},this.end={row:h,column:r}}return M.prototype.isEqual=function($){return this.start.row===$.start.row&&this.end.row===$.end.row&&this.start.column===$.start.column&&this.end.column===$.end.column},M.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},M.prototype.contains=function($,a){return this.compare($,a)==0},M.prototype.compareRange=function($){var a,h=$.end,r=$.start;return a=this.compare(h.row,h.column),a==1?(a=this.compare(r.row,r.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(r.row,r.column),a==-1?-1:a==1?42:0)},M.prototype.comparePoint=function($){return this.compare($.row,$.column)},M.prototype.containsRange=function($){return this.comparePoint($.start)==0&&this.comparePoint($.end)==0},M.prototype.intersects=function($){var a=this.compareRange($);return a==-1||a==0||a==1},M.prototype.isEnd=function($,a){return this.end.row==$&&this.end.column==a},M.prototype.isStart=function($,a){return this.start.row==$&&this.start.column==a},M.prototype.setStart=function($,a){typeof $=="object"?(this.start.column=$.column,this.start.row=$.row):(this.start.row=$,this.start.column=a)},M.prototype.setEnd=function($,a){typeof $=="object"?(this.end.column=$.column,this.end.row=$.row):(this.end.row=$,this.end.column=a)},M.prototype.inside=function($,a){return this.compare($,a)==0?!(this.isEnd($,a)||this.isStart($,a)):!1},M.prototype.insideStart=function($,a){return this.compare($,a)==0?!this.isEnd($,a):!1},M.prototype.insideEnd=function($,a){return this.compare($,a)==0?!this.isStart($,a):!1},M.prototype.compare=function($,a){return!this.isMultiLine()&&$===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:$<this.start.row?-1:$>this.end.row?1:this.start.row===$?a>=this.start.column?0:-1:this.end.row===$?a<=this.end.column?0:1:0},M.prototype.compareStart=function($,a){return this.start.row==$&&this.start.column==a?-1:this.compare($,a)},M.prototype.compareEnd=function($,a){return this.end.row==$&&this.end.column==a?1:this.compare($,a)},M.prototype.compareInside=function($,a){return this.end.row==$&&this.end.column==a?1:this.start.row==$&&this.start.column==a?-1:this.compare($,a)},M.prototype.clipRows=function($,a){if(this.end.row>a)var h={row:a+1,column:0};else if(this.end.row<$)var h={row:$,column:0};if(this.start.row>a)var r={row:a+1,column:0};else if(this.start.row<$)var r={row:$,column:0};return M.fromPoints(r||this.start,h||this.end)},M.prototype.extend=function($,a){var h=this.compare($,a);if(h==0)return this;if(h==-1)var r={row:$,column:a};else var o={row:$,column:a};return M.fromPoints(r||this.start,o||this.end)},M.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},M.prototype.isMultiLine=function(){return this.start.row!==this.end.row},M.prototype.clone=function(){return M.fromPoints(this.start,this.end)},M.prototype.collapseRows=function(){return this.end.column==0?new M(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new M(this.start.row,0,this.end.row,0)},M.prototype.toScreenRange=function($){var a=$.documentToScreenPosition(this.start),h=$.documentToScreenPosition(this.end);return new M(a.row,a.column,h.row,h.column)},M.prototype.moveBy=function($,a){this.start.row+=$,this.start.column+=a,this.end.row+=$,this.end.column+=a},M}();k.fromPoints=function(M,$){return new k(M.row,M.column,$.row,$.column)},k.comparePoints=function(M,$){return M.row-$.row||M.column-$.column},x.Range=k}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(R,x,P){for(var k=R("./oop"),M={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},$={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},a=0;a<10;a++)$["Digit"+a]=48+a,$["Numpad"+a]=96+a,M.PRINTABLE_KEYS[48+a]=""+a,M.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var h=String.fromCharCode(a+32);$["Key"+h.toUpperCase()]=a,M.PRINTABLE_KEYS[a]=h}for(var a=1;a<13;a++)$["F"+a]=111+a,M.FUNCTION_KEYS[111+a]="F"+a;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)$[o]=$[o+"Left"]=$[o+"Right"]=r[o];x.$codeToKeyCode=$,M.PRINTABLE_KEYS[173]="-";for(var n in M.FUNCTION_KEYS){var t=M.FUNCTION_KEYS[n].toLowerCase();M[t]=parseInt(n,10)}for(var n in M.PRINTABLE_KEYS){var t=M.PRINTABLE_KEYS[n].toLowerCase();M[t]=parseInt(n,10)}k.mixin(M,M.MODIFIER_KEYS),k.mixin(M,M.PRINTABLE_KEYS),k.mixin(M,M.FUNCTION_KEYS),M.enter=M.return,M.escape=M.esc,M.del=M.delete,function(){for(var e=["cmd","ctrl","alt","shift"],i=Math.pow(2,e.length);i--;)M.KEY_MODS[i]=e.filter(function(s){return i&M.KEY_MODS[s]}).join("-")+"-"}(),M.KEY_MODS[0]="",M.KEY_MODS[-1]="input-",k.mixin(x,M),x.default=x,x.keyCodeToString=function(e){var i=M[e];return typeof i!="string"&&(i=String.fromCharCode(e)),i.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(R,x,P){var k=R("./keys"),M=R("./useragent"),$=null,a=0,h;function r(){h=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return h={passive:!1},!0}})}catch{}}function o(){return h==null&&r(),h}function n(m,v,g){this.elem=m,this.type=v,this.callback=g}n.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=x.addListener=function(m,v,g,f){m.addEventListener(v,g,o()),f&&f.$toDestroy.push(new n(m,v,g))},e=x.removeListener=function(m,v,g){m.removeEventListener(v,g,o())};x.stopEvent=function(m){return x.stopPropagation(m),x.preventDefault(m),!1},x.stopPropagation=function(m){m.stopPropagation&&m.stopPropagation()},x.preventDefault=function(m){m.preventDefault&&m.preventDefault()},x.getButton=function(m){return m.type=="dblclick"?0:m.type=="contextmenu"||M.isMac&&m.ctrlKey&&!m.altKey&&!m.shiftKey?2:m.button},x.capture=function(m,v,g){var f=m&&m.ownerDocument||document;function b(L){v&&v(L),g&&g(L),e(f,"mousemove",v),e(f,"mouseup",b),e(f,"dragstart",b)}return t(f,"mousemove",v),t(f,"mouseup",b),t(f,"dragstart",b),b},x.addMouseWheelListener=function(m,v,g){t(m,"wheel",function(f){var b=.15,L=f.deltaX||0,A=f.deltaY||0;switch(f.deltaMode){case f.DOM_DELTA_PIXEL:f.wheelX=L*b,f.wheelY=A*b;break;case f.DOM_DELTA_LINE:var C=15;f.wheelX=L*C,f.wheelY=A*C;break;case f.DOM_DELTA_PAGE:var _=150;f.wheelX=L*_,f.wheelY=A*_;break}v(f)},g)},x.addMultiMouseDownListener=function(m,v,g,f,b){var L=0,A,C,_,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function y(d){if(x.getButton(d)!==0?L=0:d.detail>1?(L++,L>4&&(L=1)):L=1,M.isIE){var u=Math.abs(d.clientX-A)>5||Math.abs(d.clientY-C)>5;(!_||u)&&(L=1),_&&clearTimeout(_),_=setTimeout(function(){_=null},v[L-1]||600),L==1&&(A=d.clientX,C=d.clientY)}if(d._clicks=L,g[f]("mousedown",d),L>4)L=0;else if(L>1)return g[f](w[L],d)}Array.isArray(m)||(m=[m]),m.forEach(function(d){t(d,"mousedown",y,b)})};function i(m){return 0|(m.ctrlKey?1:0)|(m.altKey?2:0)|(m.shiftKey?4:0)|(m.metaKey?8:0)}x.getModifierString=function(m){return k.KEY_MODS[i(m)]};function s(m,v,g){var f=i(v);if(!g&&v.code&&(g=k.$codeToKeyCode[v.code]||g),!M.isMac&&$){if(v.getModifierState&&(v.getModifierState("OS")||v.getModifierState("Win"))&&(f|=8),$.altGr)if((3&f)!=3)$.altGr=0;else return;if(g===18||g===17){var b=v.location;if(g===17&&b===1)$[g]==1&&(a=v.timeStamp);else if(g===18&&f===3&&b===2){var L=v.timeStamp-a;L<50&&($.altGr=!0)}}}if(g in k.MODIFIER_KEYS&&(g=-1),!(!f&&g===13&&v.location===3&&(m(v,f,-g),v.defaultPrevented))){if(M.isChromeOS&&f&8){if(m(v,f,g),v.defaultPrevented)return;f&=-9}return!f&&!(g in k.FUNCTION_KEYS)&&!(g in k.PRINTABLE_KEYS)?!1:m(v,f,g)}}x.addCommandKeyListener=function(m,v,g){var f=null;t(m,"keydown",function(b){$[b.keyCode]=($[b.keyCode]||0)+1;var L=s(v,b,b.keyCode);return f=b.defaultPrevented,L},g),t(m,"keypress",function(b){f&&(b.ctrlKey||b.altKey||b.shiftKey||b.metaKey)&&(x.stopEvent(b),f=null)},g),t(m,"keyup",function(b){$[b.keyCode]=null},g),$||(l(),t(window,"focus",l))};function l(){$=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!M.isOldIE){var c=1;x.nextTick=function(m,v){v=v||window;var g="zero-timeout-message-"+c++,f=function(b){b.data==g&&(x.stopPropagation(b),e(v,"message",f),m())};t(v,"message",f),v.postMessage(g,"*")}}x.$idleBlocked=!1,x.onIdle=function(m,v){return setTimeout(function g(){x.$idleBlocked?setTimeout(g,100):m()},v)},x.$idleBlockId=null,x.blockIdle=function(m){x.$idleBlockId&&clearTimeout(x.$idleBlockId),x.$idleBlocked=!0,x.$idleBlockId=setTimeout(function(){x.$idleBlocked=!1},m||100)},x.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),x.nextFrame?x.nextFrame=x.nextFrame.bind(window):x.nextFrame=function(m){setTimeout(m,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(R,x,P){var k;P.exports={lineMode:!1,pasteCancelled:function(){return k&&k>Date.now()-50?!0:k=!1},cancel:function(){k=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(R,x,P){var k=R("../lib/event"),M=R("../config").nls,$=R("../lib/useragent"),a=R("../lib/dom"),h=R("../lib/lang"),r=R("../clipboard"),o=$.isChrome<18,n=$.isIE,t=$.isChrome>63,e=400,i=R("../lib/keys"),s=i.KEY_MODS,l=$.isIOS,c=l?/\s/:/\n/,m=$.isMobile,v;v=function(g,f){var b=a.createElement("textarea");b.className="ace_text-input",b.setAttribute("wrap","off"),b.setAttribute("autocorrect","off"),b.setAttribute("autocapitalize","off"),b.setAttribute("spellcheck","false"),b.style.opacity="0",g.insertBefore(b,g.firstChild);var L=!1,A=!1,C=!1,_=!1,w="";m||(b.style.fontSize="1px");var y=!1,d=!1,u="",p=0,S=0,T=0,E=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,D=0;try{var H=document.activeElement===b}catch{}this.setNumberOfExtraLines=function(B){if(E=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,B<0){D=0;return}D=B},this.setAriaLabel=function(){var B="";if(f.$textInputAriaLabel&&(B+="".concat(f.$textInputAriaLabel,", ")),f.session){var G=f.session.selection.cursor.row;B+=M("text-input.aria-label","Cursor at row $0",[G+1])}b.setAttribute("aria-label",B)},this.setAriaOptions=function(B){B.activeDescendant?(b.setAttribute("aria-haspopup","true"),b.setAttribute("aria-autocomplete",B.inline?"both":"list"),b.setAttribute("aria-activedescendant",B.activeDescendant)):(b.setAttribute("aria-haspopup","false"),b.setAttribute("aria-autocomplete","both"),b.removeAttribute("aria-activedescendant")),B.role&&b.setAttribute("role",B.role),B.setLabel&&(b.setAttribute("aria-roledescription",M("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),k.addListener(b,"blur",function(B){d||(f.onBlur(B),H=!1)},f),k.addListener(b,"focus",function(B){if(!d){if(H=!0,$.isEdge)try{if(!document.hasFocus())return}catch{}f.onFocus(B),$.isEdge?setTimeout(N):N()}},f),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:f.renderer.enableKeyboardAccessibility}),w||t||this.$focusScroll=="browser")return b.focus({preventScroll:!0});var B=b.style.top;b.style.position="fixed",b.style.top="0px";try{var G=b.getBoundingClientRect().top!=0}catch{return}var K=[];if(G)for(var Q=b.parentElement;Q&&Q.nodeType==1;)K.push(Q),Q.setAttribute("ace_nocontext","true"),!Q.parentElement&&Q.getRootNode?Q=Q.getRootNode().host:Q=Q.parentElement;b.focus({preventScroll:!0}),G&&K.forEach(function(X){X.removeAttribute("ace_nocontext")}),setTimeout(function(){b.style.position="",b.style.top=="0px"&&(b.style.top=B)},0)},this.blur=function(){b.blur()},this.isFocused=function(){return H},f.on("beforeEndOperation",function(){var B=f.curOp,G=B&&B.command&&B.command.name;if(G!="insertstring"){var K=G&&(B.docChanged||B.selectionChanged);C&&K&&(u=b.value="",ce()),N()}}),f.on("changeSelection",this.setAriaLabel);var O=function(B,G){for(var K=G,Q=1;Q<=B-E&&Q<2*D+1;Q++)K+=f.session.getLine(B-Q).length+1;return K},N=l?function(B){if(!(!H||L&&!B||_)){B||(B="");var G=`
166
+ `}),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],function(R,x,P){x.isDark=!1,x.cssClass="ace-tm",x.cssText=R("./textmate-css"),x.$id="ace/theme/textmate";var k=R("../lib/dom");k.importCssString(x.cssText,x.cssClass,!1)}),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],function(R,x,P){"no use strict";var k=R("./lib/lang"),M=R("./lib/net"),$=R("./lib/dom"),a=R("./lib/app_config").AppConfig;P.exports=x=new a;var h={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};x.get=function(t){if(!h.hasOwnProperty(t))throw new Error("Unknown config key: "+t);return h[t]},x.set=function(t,e){if(h.hasOwnProperty(t))h[t]=e;else if(this.setDefaultValue("",t,e)==!1)throw new Error("Unknown config key: "+t);t=="useStrictCSP"&&$.useStrictCSP(e)},x.all=function(){return k.copyObject(h)},x.$modes={},x.moduleUrl=function(t,e){if(h.$moduleUrls[t])return h.$moduleUrls[t];var i=t.split("/");e=e||i[i.length-2]||"";var s=e=="snippets"?"/":"-",l=i[i.length-1];if(e=="worker"&&s=="-"){var c=new RegExp("^"+e+"[\\-_]|[\\-_]"+e+"$","g");l=l.replace(c,"")}(!l||l==e)&&i.length>1&&(l=i[i.length-2]);var m=h[e+"Path"];return m==null?m=h.basePath:s=="/"&&(e=s=""),m&&m.slice(-1)!="/"&&(m+="/"),m+e+s+l+this.get("suffix")},x.setModuleUrl=function(t,e){return h.$moduleUrls[t]=e};var r=function(t,e){if(t==="ace/theme/textmate"||t==="./theme/textmate")return e(null,R("./theme/textmate"));if(o)return o(t,e);console.error("loader is not configured")},o;x.setLoader=function(t){o=t},x.dynamicModules=Object.create(null),x.$loading={},x.$loaded={},x.loadModule=function(t,e){var i;if(Array.isArray(t))var s=t[0],l=t[1];else if(typeof t=="string")var l=t;var c=function(m){if(m&&!x.$loading[l])return e&&e(m);if(x.$loading[l]||(x.$loading[l]=[]),x.$loading[l].push(e),!(x.$loading[l].length>1)){var v=function(){r(l,function(g,f){f&&(x.$loaded[l]=f),x._emit("load.module",{name:l,module:f});var b=x.$loading[l];x.$loading[l]=null,b.forEach(function(L){L&&L(f)})})};if(!x.get("packaged"))return v();M.loadScript(x.moduleUrl(l,s),v),n()}};if(x.dynamicModules[l])x.dynamicModules[l]().then(function(m){m.default?c(m.default):c(m)});else{try{i=this.$require(l)}catch{}c(i||x.$loaded[l])}},x.$require=function(t){if(typeof P.require=="function"){var e="require";return P[e](t)}},x.setModuleLoader=function(t,e){x.dynamicModules[t]=e};var n=function(){!h.basePath&&!h.workerPath&&!h.modePath&&!h.themePath&&!Object.keys(h.$moduleUrls).length&&(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),n=function(){})};x.version="1.40.1"}),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],function(R,x,P){R("./lib/fixoldbrowsers");var k=R("./config");k.setLoader(function(h,r){R([h],function(o){r(null,o)})});var M=function(){return this||typeof window<"u"&&window}();P.exports=function(h){k.init=$,k.$require=R,h.require=R},$(!0);function $(h){if(!(!M||!M.document)){k.set("packaged",h||R.packaged||P.packaged||M.define&&(void 0).packaged);var r={},o="",n=document.currentScript||document._currentScript,t=n&&n.ownerDocument||document;n&&n.src&&(o=n.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var e=t.getElementsByTagName("script"),i=0;i<e.length;i++){var s=e[i],l=s.src||s.getAttribute("src");if(l){for(var c=s.attributes,m=0,v=c.length;m<v;m++){var g=c[m];g.name.indexOf("data-ace-")===0&&(r[a(g.name.replace(/^data-ace-/,""))]=g.value)}var f=l.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);f&&(o=f[1])}}o&&(r.base=r.base||o,r.packaged=!0),r.basePath=r.base,r.workerPath=r.workerPath||r.base,r.modePath=r.modePath||r.base,r.themePath=r.themePath||r.base,delete r.base;for(var b in r)typeof r[b]<"u"&&k.set(b,r[b])}}function a(h){return h.replace(/-(.)/g,function(r,o){return o.toUpperCase()})}}),ace.define("ace/range",["require","exports","module"],function(R,x,P){var k=function(){function M($,a,h,r){this.start={row:$,column:a},this.end={row:h,column:r}}return M.prototype.isEqual=function($){return this.start.row===$.start.row&&this.end.row===$.end.row&&this.start.column===$.start.column&&this.end.column===$.end.column},M.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},M.prototype.contains=function($,a){return this.compare($,a)==0},M.prototype.compareRange=function($){var a,h=$.end,r=$.start;return a=this.compare(h.row,h.column),a==1?(a=this.compare(r.row,r.column),a==1?2:a==0?1:0):a==-1?-2:(a=this.compare(r.row,r.column),a==-1?-1:a==1?42:0)},M.prototype.comparePoint=function($){return this.compare($.row,$.column)},M.prototype.containsRange=function($){return this.comparePoint($.start)==0&&this.comparePoint($.end)==0},M.prototype.intersects=function($){var a=this.compareRange($);return a==-1||a==0||a==1},M.prototype.isEnd=function($,a){return this.end.row==$&&this.end.column==a},M.prototype.isStart=function($,a){return this.start.row==$&&this.start.column==a},M.prototype.setStart=function($,a){typeof $=="object"?(this.start.column=$.column,this.start.row=$.row):(this.start.row=$,this.start.column=a)},M.prototype.setEnd=function($,a){typeof $=="object"?(this.end.column=$.column,this.end.row=$.row):(this.end.row=$,this.end.column=a)},M.prototype.inside=function($,a){return this.compare($,a)==0?!(this.isEnd($,a)||this.isStart($,a)):!1},M.prototype.insideStart=function($,a){return this.compare($,a)==0?!this.isEnd($,a):!1},M.prototype.insideEnd=function($,a){return this.compare($,a)==0?!this.isStart($,a):!1},M.prototype.compare=function($,a){return!this.isMultiLine()&&$===this.start.row?a<this.start.column?-1:a>this.end.column?1:0:$<this.start.row?-1:$>this.end.row?1:this.start.row===$?a>=this.start.column?0:-1:this.end.row===$?a<=this.end.column?0:1:0},M.prototype.compareStart=function($,a){return this.start.row==$&&this.start.column==a?-1:this.compare($,a)},M.prototype.compareEnd=function($,a){return this.end.row==$&&this.end.column==a?1:this.compare($,a)},M.prototype.compareInside=function($,a){return this.end.row==$&&this.end.column==a?1:this.start.row==$&&this.start.column==a?-1:this.compare($,a)},M.prototype.clipRows=function($,a){if(this.end.row>a)var h={row:a+1,column:0};else if(this.end.row<$)var h={row:$,column:0};if(this.start.row>a)var r={row:a+1,column:0};else if(this.start.row<$)var r={row:$,column:0};return M.fromPoints(r||this.start,h||this.end)},M.prototype.extend=function($,a){var h=this.compare($,a);if(h==0)return this;if(h==-1)var r={row:$,column:a};else var o={row:$,column:a};return M.fromPoints(r||this.start,o||this.end)},M.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},M.prototype.isMultiLine=function(){return this.start.row!==this.end.row},M.prototype.clone=function(){return M.fromPoints(this.start,this.end)},M.prototype.collapseRows=function(){return this.end.column==0?new M(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new M(this.start.row,0,this.end.row,0)},M.prototype.toScreenRange=function($){var a=$.documentToScreenPosition(this.start),h=$.documentToScreenPosition(this.end);return new M(a.row,a.column,h.row,h.column)},M.prototype.moveBy=function($,a){this.start.row+=$,this.start.column+=a,this.end.row+=$,this.end.column+=a},M}();k.fromPoints=function(M,$){return new k(M.row,M.column,$.row,$.column)},k.comparePoints=function(M,$){return M.row-$.row||M.column-$.column},x.Range=k}),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],function(R,x,P){for(var k=R("./oop"),M={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete","-13":"NumpadEnter",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",59:";",61:"=",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}},$={Command:224,Backspace:8,Tab:9,Return:13,Enter:13,Pause:19,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,Insert:45,Delete:46,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Backquote:192,Minus:189,Equal:187,BracketLeft:219,Backslash:220,BracketRight:221,Semicolon:186,Quote:222,Comma:188,Period:190,Slash:191,Space:32,NumpadAdd:107,NumpadDecimal:110,NumpadSubtract:109,NumpadDivide:111,NumpadMultiply:106},a=0;a<10;a++)$["Digit"+a]=48+a,$["Numpad"+a]=96+a,M.PRINTABLE_KEYS[48+a]=""+a,M.FUNCTION_KEYS[96+a]="Numpad"+a;for(var a=65;a<91;a++){var h=String.fromCharCode(a+32);$["Key"+h.toUpperCase()]=a,M.PRINTABLE_KEYS[a]=h}for(var a=1;a<13;a++)$["F"+a]=111+a,M.FUNCTION_KEYS[111+a]="F"+a;var r={Shift:16,Control:17,Alt:18,Meta:224};for(var o in r)$[o]=$[o+"Left"]=$[o+"Right"]=r[o];x.$codeToKeyCode=$,M.PRINTABLE_KEYS[173]="-";for(var n in M.FUNCTION_KEYS){var t=M.FUNCTION_KEYS[n].toLowerCase();M[t]=parseInt(n,10)}for(var n in M.PRINTABLE_KEYS){var t=M.PRINTABLE_KEYS[n].toLowerCase();M[t]=parseInt(n,10)}k.mixin(M,M.MODIFIER_KEYS),k.mixin(M,M.PRINTABLE_KEYS),k.mixin(M,M.FUNCTION_KEYS),M.enter=M.return,M.escape=M.esc,M.del=M.delete,function(){for(var e=["cmd","ctrl","alt","shift"],i=Math.pow(2,e.length);i--;)M.KEY_MODS[i]=e.filter(function(s){return i&M.KEY_MODS[s]}).join("-")+"-"}(),M.KEY_MODS[0]="",M.KEY_MODS[-1]="input-",k.mixin(x,M),x.default=x,x.keyCodeToString=function(e){var i=M[e];return typeof i!="string"&&(i=String.fromCharCode(e)),i.toLowerCase()}}),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(R,x,P){var k=R("./keys"),M=R("./useragent"),$=null,a=0,h;function r(){h=!1;try{document.createComment("").addEventListener("test",function(){},{get passive(){return h={passive:!1},!0}})}catch{}}function o(){return h==null&&r(),h}function n(m,v,g){this.elem=m,this.type=v,this.callback=g}n.prototype.destroy=function(){e(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var t=x.addListener=function(m,v,g,f){m.addEventListener(v,g,o()),f&&f.$toDestroy.push(new n(m,v,g))},e=x.removeListener=function(m,v,g){m.removeEventListener(v,g,o())};x.stopEvent=function(m){return x.stopPropagation(m),x.preventDefault(m),!1},x.stopPropagation=function(m){m.stopPropagation&&m.stopPropagation()},x.preventDefault=function(m){m.preventDefault&&m.preventDefault()},x.getButton=function(m){return m.type=="dblclick"?0:m.type=="contextmenu"||M.isMac&&m.ctrlKey&&!m.altKey&&!m.shiftKey?2:m.button},x.capture=function(m,v,g){var f=m&&m.ownerDocument||document;function b(L){v&&v(L),g&&g(L),e(f,"mousemove",v),e(f,"mouseup",b),e(f,"dragstart",b)}return t(f,"mousemove",v),t(f,"mouseup",b),t(f,"dragstart",b),b},x.addMouseWheelListener=function(m,v,g){t(m,"wheel",function(f){var b=.15,L=f.deltaX||0,A=f.deltaY||0;switch(f.deltaMode){case f.DOM_DELTA_PIXEL:f.wheelX=L*b,f.wheelY=A*b;break;case f.DOM_DELTA_LINE:var C=15;f.wheelX=L*C,f.wheelY=A*C;break;case f.DOM_DELTA_PAGE:var _=150;f.wheelX=L*_,f.wheelY=A*_;break}v(f)},g)},x.addMultiMouseDownListener=function(m,v,g,f,b){var L=0,A,C,_,w={2:"dblclick",3:"tripleclick",4:"quadclick"};function y(d){if(x.getButton(d)!==0?L=0:d.detail>1?(L++,L>4&&(L=1)):L=1,M.isIE){var u=Math.abs(d.clientX-A)>5||Math.abs(d.clientY-C)>5;(!_||u)&&(L=1),_&&clearTimeout(_),_=setTimeout(function(){_=null},v[L-1]||600),L==1&&(A=d.clientX,C=d.clientY)}if(d._clicks=L,g[f]("mousedown",d),L>4)L=0;else if(L>1)return g[f](w[L],d)}Array.isArray(m)||(m=[m]),m.forEach(function(d){t(d,"mousedown",y,b)})};function i(m){return 0|(m.ctrlKey?1:0)|(m.altKey?2:0)|(m.shiftKey?4:0)|(m.metaKey?8:0)}x.getModifierString=function(m){return k.KEY_MODS[i(m)]};function s(m,v,g){var f=i(v);if(!g&&v.code&&(g=k.$codeToKeyCode[v.code]||g),!M.isMac&&$){if(v.getModifierState&&(v.getModifierState("OS")||v.getModifierState("Win"))&&(f|=8),$.altGr)if((3&f)!=3)$.altGr=0;else return;if(g===18||g===17){var b=v.location;if(g===17&&b===1)$[g]==1&&(a=v.timeStamp);else if(g===18&&f===3&&b===2){var L=v.timeStamp-a;L<50&&($.altGr=!0)}}}if(g in k.MODIFIER_KEYS&&(g=-1),!(!f&&g===13&&v.location===3&&(m(v,f,-g),v.defaultPrevented))){if(M.isChromeOS&&f&8){if(m(v,f,g),v.defaultPrevented)return;f&=-9}return!f&&!(g in k.FUNCTION_KEYS)&&!(g in k.PRINTABLE_KEYS)?!1:m(v,f,g)}}x.addCommandKeyListener=function(m,v,g){var f=null;t(m,"keydown",function(b){$[b.keyCode]=($[b.keyCode]||0)+1;var L=s(v,b,b.keyCode);return f=b.defaultPrevented,L},g),t(m,"keypress",function(b){f&&(b.ctrlKey||b.altKey||b.shiftKey||b.metaKey)&&(x.stopEvent(b),f=null)},g),t(m,"keyup",function(b){$[b.keyCode]=null},g),$||(l(),t(window,"focus",l))};function l(){$=Object.create(null)}if(typeof window=="object"&&window.postMessage&&!M.isOldIE){var c=1;x.nextTick=function(m,v){v=v||window;var g="zero-timeout-message-"+c++,f=function(b){b.data==g&&(x.stopPropagation(b),e(v,"message",f),m())};t(v,"message",f),v.postMessage(g,"*")}}x.$idleBlocked=!1,x.onIdle=function(m,v){return setTimeout(function g(){x.$idleBlocked?setTimeout(g,100):m()},v)},x.$idleBlockId=null,x.blockIdle=function(m){x.$idleBlockId&&clearTimeout(x.$idleBlockId),x.$idleBlocked=!0,x.$idleBlockId=setTimeout(function(){x.$idleBlocked=!1},m||100)},x.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),x.nextFrame?x.nextFrame=x.nextFrame.bind(window):x.nextFrame=function(m){setTimeout(m,17)}}),ace.define("ace/clipboard",["require","exports","module"],function(R,x,P){var k;P.exports={lineMode:!1,pasteCancelled:function(){return k&&k>Date.now()-50?!0:k=!1},cancel:function(){k=Date.now()}}}),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],function(R,x,P){var k=R("../lib/event"),M=R("../config").nls,$=R("../lib/useragent"),a=R("../lib/dom"),h=R("../lib/lang"),r=R("../clipboard"),o=$.isChrome<18,n=$.isIE,t=$.isChrome>63,e=400,i=R("../lib/keys"),s=i.KEY_MODS,l=$.isIOS,c=l?/\s/:/\n/,m=$.isMobile,v;v=function(g,f){var b=a.createElement("textarea");b.className="ace_text-input",b.setAttribute("wrap","off"),b.setAttribute("autocorrect","off"),b.setAttribute("autocapitalize","off"),b.setAttribute("spellcheck","false"),b.style.opacity="0",g.insertBefore(b,g.firstChild);var L=!1,A=!1,C=!1,_=!1,w="";m||(b.style.fontSize="1px");var y=!1,d=!1,u="",p=0,S=0,T=0,E=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,D=0;try{var H=document.activeElement===b}catch{}this.setNumberOfExtraLines=function(B){if(E=Number.MAX_SAFE_INTEGER,I=Number.MIN_SAFE_INTEGER,B<0){D=0;return}D=B},this.setAriaLabel=function(){var B="";if(f.$textInputAriaLabel&&(B+="".concat(f.$textInputAriaLabel,", ")),f.session){var G=f.session.selection.cursor.row;B+=M("text-input.aria-label","Cursor at row $0",[G+1])}b.setAttribute("aria-label",B)},this.setAriaOptions=function(B){B.activeDescendant?(b.setAttribute("aria-haspopup","true"),b.setAttribute("aria-autocomplete",B.inline?"both":"list"),b.setAttribute("aria-activedescendant",B.activeDescendant)):(b.setAttribute("aria-haspopup","false"),b.setAttribute("aria-autocomplete","both"),b.removeAttribute("aria-activedescendant")),B.role&&b.setAttribute("role",B.role),B.setLabel&&(b.setAttribute("aria-roledescription",M("text-input.aria-roledescription","editor")),this.setAriaLabel())},this.setAriaOptions({role:"textbox"}),k.addListener(b,"blur",function(B){d||(f.onBlur(B),H=!1)},f),k.addListener(b,"focus",function(B){if(!d){if(H=!0,$.isEdge)try{if(!document.hasFocus())return}catch{}f.onFocus(B),$.isEdge?setTimeout(N):N()}},f),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:f.renderer.enableKeyboardAccessibility}),w||t||this.$focusScroll=="browser")return b.focus({preventScroll:!0});var B=b.style.top;b.style.position="fixed",b.style.top="0px";try{var G=b.getBoundingClientRect().top!=0}catch{return}var K=[];if(G)for(var Q=b.parentElement;Q&&Q.nodeType==1;)K.push(Q),Q.setAttribute("ace_nocontext","true"),!Q.parentElement&&Q.getRootNode?Q=Q.getRootNode().host:Q=Q.parentElement;b.focus({preventScroll:!0}),G&&K.forEach(function(X){X.removeAttribute("ace_nocontext")}),setTimeout(function(){b.style.position="",b.style.top=="0px"&&(b.style.top=B)},0)},this.blur=function(){b.blur()},this.isFocused=function(){return H},f.on("beforeEndOperation",function(){var B=f.curOp,G=B&&B.command&&B.command.name;if(G!="insertstring"){var K=G&&(B.docChanged||B.selectionChanged);C&&K&&(u=b.value="",ce()),N()}}),f.on("changeSelection",this.setAriaLabel);var O=function(B,G){for(var K=G,Q=1;Q<=B-E&&Q<2*D+1;Q++)K+=f.session.getLine(B-Q).length+1;return K},N=l?function(B){if(!(!H||L&&!B||_)){B||(B="");var G=`
167
167
  ab`+B+`cde fg
168
168
  `;G!=b.value&&(b.value=u=G);var K=4,Q=4+(B.length||(f.selection.isEmpty()?0:1));(p!=K||S!=Q)&&b.setSelectionRange(K,Q),p=K,S=Q}}:function(){if(!(C||_)&&!(!H&&!U)){C=!0;var B=0,G=0,K="";if(f.session){var Q=f.selection,X=Q.getRange(),ie=Q.cursor.row;ie===I+1?(E=I+1,I=E+2*D):ie===E-1?(I=E-1,E=I-2*D):(ie<E-1||ie>I+1)&&(E=ie>D?ie-D:0,I=ie>D?ie+D:2*D);for(var re=[],ne=E;ne<=I;ne++)re.push(f.session.getLine(ne));if(K=re.join(`
169
169
  `),B=O(X.start.row,X.start.column),G=O(X.end.row,X.end.column),X.start.row<E){var ee=f.session.getLine(E-1);B=X.start.row<E-1?0:B,G+=ee.length+1,K=ee+`
@@ -212,7 +212,7 @@ var ye={exports:{}};(function(pe,$e){(function(){var R="ace",x=function(){return
212
212
  `||u==`\r
213
213
  `){var F=S.getLine(E.row);if(E.column>F.search(/\S|$/)){var H=F.substr(E.column).search(/\S|$/);S.doc.removeInLine(E.row,E.column,E.column+H)}}this.clearSelection();var O=E.column,N=S.getState(E.row),F=S.getLine(E.row),W=T.checkOutdent(N,F,u);if(S.insert(E,u),I&&I.selection&&(I.selection.length==2?this.selection.setSelectionRange(new s(E.row,O+I.selection[0],E.row,O+I.selection[1])):this.selection.setSelectionRange(new s(E.row+I.selection[0],I.selection[1],E.row+I.selection[2],I.selection[3]))),this.$enableAutoIndent){if(S.getDocument().isNewLine(u)){var z=T.getNextLineIndent(N,F.slice(0,E.column),S.getTabString());S.insert({row:E.row+1,column:0},z)}W&&T.autoOutdent(N,S,E.row)}},d.prototype.autoIndent=function(){for(var u=this.session,p=u.getMode(),S=this.selection.isEmpty()?[new s(0,0,u.doc.getLength()-1,0)]:this.selection.getAllRanges(),T="",E="",I="",D=u.getTabString(),H=0;H<S.length;H++)for(var O=S[H].start.row,N=S[H].end.row,F=O;F<=N;F++){F>0&&(T=u.getState(F-1),E=u.getLine(F-1),I=p.getNextLineIndent(T,E,D));var W=u.getLine(F),z=p.$getIndent(W);if(I!==z){if(z.length>0){var U=new s(F,0,F,z.length);u.remove(U)}I.length>0&&u.insert({row:F,column:0},I)}p.autoOutdent(T,u,F)}},d.prototype.onTextInput=function(u,p){if(!p)return this.keyBinding.onTextInput(u);this.startOperation({command:{name:"insertstring"}});var S=this.applyComposition.bind(this,u,p);this.selection.rangeCount?this.forEachSelection(S):S(),this.endOperation()},d.prototype.applyComposition=function(u,p){if(p.extendLeft||p.extendRight){var S=this.selection.getRange();S.start.column-=p.extendLeft,S.end.column+=p.extendRight,S.start.column<0&&(S.start.row--,S.start.column+=this.session.getLine(S.start.row).length+1),this.selection.setRange(S),!u&&!S.isEmpty()&&this.remove()}if((u||!this.selection.isEmpty())&&this.insert(u,!0),p.restoreStart||p.restoreEnd){var S=this.selection.getRange();S.start.column-=p.restoreStart,S.end.column-=p.restoreEnd,this.selection.setRange(S)}},d.prototype.onCommandKey=function(u,p,S){return this.keyBinding.onCommandKey(u,p,S)},d.prototype.setOverwrite=function(u){this.session.setOverwrite(u)},d.prototype.getOverwrite=function(){return this.session.getOverwrite()},d.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},d.prototype.setScrollSpeed=function(u){this.setOption("scrollSpeed",u)},d.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},d.prototype.setDragDelay=function(u){this.setOption("dragDelay",u)},d.prototype.getDragDelay=function(){return this.getOption("dragDelay")},d.prototype.setSelectionStyle=function(u){this.setOption("selectionStyle",u)},d.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},d.prototype.setHighlightActiveLine=function(u){this.setOption("highlightActiveLine",u)},d.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},d.prototype.setHighlightGutterLine=function(u){this.setOption("highlightGutterLine",u)},d.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},d.prototype.setHighlightSelectedWord=function(u){this.setOption("highlightSelectedWord",u)},d.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},d.prototype.setAnimatedScroll=function(u){this.renderer.setAnimatedScroll(u)},d.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},d.prototype.setShowInvisibles=function(u){this.renderer.setShowInvisibles(u)},d.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},d.prototype.setDisplayIndentGuides=function(u){this.renderer.setDisplayIndentGuides(u)},d.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},d.prototype.setHighlightIndentGuides=function(u){this.renderer.setHighlightIndentGuides(u)},d.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},d.prototype.setShowPrintMargin=function(u){this.renderer.setShowPrintMargin(u)},d.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},d.prototype.setPrintMarginColumn=function(u){this.renderer.setPrintMarginColumn(u)},d.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},d.prototype.setReadOnly=function(u){this.setOption("readOnly",u)},d.prototype.getReadOnly=function(){return this.getOption("readOnly")},d.prototype.setBehavioursEnabled=function(u){this.setOption("behavioursEnabled",u)},d.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},d.prototype.setWrapBehavioursEnabled=function(u){this.setOption("wrapBehavioursEnabled",u)},d.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},d.prototype.setShowFoldWidgets=function(u){this.setOption("showFoldWidgets",u)},d.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},d.prototype.setFadeFoldWidgets=function(u){this.setOption("fadeFoldWidgets",u)},d.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},d.prototype.remove=function(u){this.selection.isEmpty()&&(u=="left"?this.selection.selectLeft():this.selection.selectRight());var p=this.getSelectionRange();if(this.getBehavioursEnabled()){var S=this.session,T=S.getState(p.start.row),E=S.getMode().transformAction(T,"deletion",this,S,p);if(p.end.column===0){var I=S.getTextRange(p);if(I[I.length-1]==`
214
214
  `){var D=S.getLine(p.end.row);/^\s+$/.test(D)&&(p.end.column=D.length)}}E&&(p=E)}this.session.remove(p),this.clearSelection()},d.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},d.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},d.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},d.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var u=this.getSelectionRange();u.start.column==u.end.column&&u.start.row==u.end.row&&(u.end.column=0,u.end.row++),this.session.remove(u),this.clearSelection()},d.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var u=this.getCursorPosition();this.insert(`
215
- `),this.moveCursorToPosition(u)},d.prototype.setGhostText=function(u,p){this.renderer.setGhostText(u,p)},d.prototype.removeGhostText=function(){this.renderer.removeGhostText()},d.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),p=u.column;if(p!==0){var S=this.session.getLine(u.row),T,E;p<S.length?(T=S.charAt(p)+S.charAt(p-1),E=new s(u.row,p-1,u.row,p+1)):(T=S.charAt(p-1)+S.charAt(p-2),E=new s(u.row,p-2,u.row,p)),this.session.replace(E,T),this.session.selection.moveToPosition(E.end)}}},d.prototype.toLowerCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),S=this.session.getTextRange(p);this.session.replace(p,S.toLowerCase()),this.selection.setSelectionRange(u)},d.prototype.toUpperCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),S=this.session.getTextRange(p);this.session.replace(p,S.toUpperCase()),this.selection.setSelectionRange(u)},d.prototype.indent=function(){var u=this.session,p=this.getSelectionRange();if(p.start.row<p.end.row){var S=this.$getSelectedRows();u.indentRows(S.first,S.last," ");return}else if(p.start.column<p.end.column){var T=u.getTextRange(p);if(!/^\s+$/.test(T)){var S=this.$getSelectedRows();u.indentRows(S.first,S.last," ");return}}var E=u.getLine(p.start.row),I=p.start,D=u.getTabSize(),H=u.documentToScreenColumn(I.row,I.column);if(this.session.getUseSoftTabs())var O=D-H%D,N=a.stringRepeat(" ",O);else{for(var O=H%D;E[p.start.column-1]==" "&&O;)p.start.column--,O--;this.selection.setSelectionRange(p),N=" "}return this.insert(N)},d.prototype.blockIndent=function(){var u=this.$getSelectedRows();this.session.indentRows(u.first,u.last," ")},d.prototype.blockOutdent=function(){var u=this.session.getSelection();this.session.outdentRows(u.getRange())},d.prototype.sortLines=function(){for(var u=this.$getSelectedRows(),p=this.session,S=[],T=u.first;T<=u.last;T++)S.push(p.getLine(T));S.sort(function(D,H){return D.toLowerCase()<H.toLowerCase()?-1:D.toLowerCase()>H.toLowerCase()?1:0});for(var E=new s(0,0,0,0),T=u.first;T<=u.last;T++){var I=p.getLine(T);E.start.row=T,E.end.row=T,E.end.column=I.length,p.replace(E,S[T-u.first])}},d.prototype.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),p=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,p.first,p.last)},d.prototype.toggleBlockComment=function(){var u=this.getCursorPosition(),p=this.session.getState(u.row),S=this.getSelectionRange();this.session.getMode().toggleBlockComment(p,this.session,S,u)},d.prototype.getNumberAt=function(u,p){var S=/[\-]?[0-9]+(?:\.[0-9]+)?/g;S.lastIndex=0;for(var T=this.session.getLine(u);S.lastIndex<p;){var E=S.exec(T);if(E.index<=p&&E.index+E[0].length>=p){var I={value:E[0],start:E.index,end:E.index+E[0].length};return I}}return null},d.prototype.modifyNumber=function(u){var p=this.selection.getCursor().row,S=this.selection.getCursor().column,T=new s(p,S-1,p,S),E=this.session.getTextRange(T);if(!isNaN(parseFloat(E))&&isFinite(E)){var I=this.getNumberAt(p,S);if(I){var D=I.value.indexOf(".")>=0?I.start+I.value.indexOf(".")+1:I.end,H=I.start+I.value.length-D,O=parseFloat(I.value);O*=Math.pow(10,H),D!==I.end&&S<D?u*=Math.pow(10,I.end-S-1):u*=Math.pow(10,I.end-S),O+=u,O/=Math.pow(10,H);var N=O.toFixed(H),F=new s(p,I.start,p,I.end);this.session.replace(F,N),this.moveCursorTo(p,Math.max(I.start+1,S+N.length-I.value.length))}}else this.toggleWord()},d.prototype.toggleWord=function(){var u=this.selection.getCursor().row,p=this.selection.getCursor().column;this.selection.selectWord();var S=this.getSelectedText(),T=this.selection.getWordRange().start.column,E=S.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),I=p-T-1;I<0&&(I=0);var D=0,H=0,O=this;S.match(/[A-Za-z0-9_]+/)&&E.forEach(function(Z,te){H=D+Z.length,I>=D&&I<=H&&(S=Z,O.selection.clearSelection(),O.moveCursorTo(u,D+T),O.selection.selectTo(u,H+T)),D=H});for(var N=this.$toggleWordPairs,F,W=0;W<N.length;W++)for(var z=N[W],U=0;U<=1;U++){var V=+!U,j=S.match(new RegExp("^\\s?_?("+a.escapeRegExp(z[U])+")\\s?$","i"));if(j){var Y=S.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(j[1])+")($|\\s)","g"));Y&&(F=S.replace(new RegExp(a.escapeRegExp(z[U]),"i"),function(Z){var te=z[V];return Z.toUpperCase()==Z?te=te.toUpperCase():Z.charAt(0).toUpperCase()==Z.charAt(0)&&(te=te.substr(0,0)+z[V].charAt(0).toUpperCase()+te.substr(1)),te}),this.insert(F),F="")}}},d.prototype.findLinkAt=function(u,p){var S,T,E=this.session.getLine(u),I=E.split(/((?:https?|ftp):\/\/[\S]+)/),D=p;D<0&&(D=0);var H=0,O=0,N;try{for(var F=k(I),W=F.next();!W.done;W=F.next()){var z=W.value;if(O=H+z.length,D>=H&&D<=O&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){N=z.replace(/[\s:.,'";}\]]+$/,"");break}H=O}}catch(U){S={error:U}}finally{try{W&&!W.done&&(T=F.return)&&T.call(F)}finally{if(S)throw S.error}}return N},d.prototype.openLink=function(){var u=this.selection.getCursor(),p=this.findLinkAt(u.row,u.column);return p&&window.open(p,"_blank"),p!=null},d.prototype.removeLines=function(){var u=this.$getSelectedRows();this.session.removeFullLines(u.first,u.last),this.clearSelection()},d.prototype.duplicateSelection=function(){var u=this.selection,p=this.session,S=u.getRange(),T=u.isBackwards();if(S.isEmpty()){var E=S.start.row;p.duplicateLines(E,E)}else{var I=T?S.start:S.end,D=p.insert(I,p.getTextRange(S));S.start=I,S.end=D,u.setSelectionRange(S,T)}},d.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},d.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},d.prototype.moveText=function(u,p,S){return this.session.moveText(u,p,S)},d.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},d.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},d.prototype.$moveLines=function(u,p){var S,T,E=this.selection;if(!E.inMultiSelectMode||this.inVirtualSelectionMode){var I=E.toOrientedRange();S=this.$getSelectedRows(I),T=this.session.$moveLines(S.first,S.last,p?0:u),p&&u==-1&&(T=0),I.moveBy(T,0),E.fromOrientedRange(I)}else{var D=E.rangeList.ranges;E.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var H=0,O=0,N=D.length,F=0;F<N;F++){var W=F;D[F].moveBy(H,0),S=this.$getSelectedRows(D[F]);for(var z=S.first,U=S.last;++F<N;){O&&D[F].moveBy(O,0);var V=this.$getSelectedRows(D[F]);if(p&&V.first!=U)break;if(!p&&V.first>U+1)break;U=V.last}for(F--,H=this.session.$moveLines(z,U,p?0:u),p&&u==-1&&(W=F+1);W<=F;)D[W].moveBy(H,0),W++;p||(H=0),O+=H}E.fromOrientedRange(E.ranges[0]),E.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},d.prototype.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},d.prototype.onCompositionStart=function(u){this.renderer.showComposition(u)},d.prototype.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},d.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},d.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},d.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},d.prototype.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},d.prototype.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},d.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},d.prototype.$moveByPage=function(u,p){var S=this.renderer,T=this.renderer.layerConfig,E=u*Math.floor(T.height/T.lineHeight);p===!0?this.selection.$moveSelection(function(){this.moveCursorBy(E,0)}):p===!1&&(this.selection.moveCursorBy(E,0),this.selection.clearSelection());var I=S.scrollTop;S.scrollBy(0,E*T.lineHeight),p!=null&&S.scrollCursorIntoView(null,.5),S.animateScrolling(I)},d.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},d.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},d.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},d.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},d.prototype.scrollPageDown=function(){this.$moveByPage(1)},d.prototype.scrollPageUp=function(){this.$moveByPage(-1)},d.prototype.scrollToRow=function(u){this.renderer.scrollToRow(u)},d.prototype.scrollToLine=function(u,p,S,T){this.renderer.scrollToLine(u,p,S,T)},d.prototype.centerSelection=function(){var u=this.getSelectionRange(),p={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(p,.5)},d.prototype.getCursorPosition=function(){return this.selection.getCursor()},d.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},d.prototype.getSelectionRange=function(){return this.selection.getRange()},d.prototype.selectAll=function(){this.selection.selectAll()},d.prototype.clearSelection=function(){this.selection.clearSelection()},d.prototype.moveCursorTo=function(u,p){this.selection.moveCursorTo(u,p)},d.prototype.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},d.prototype.jumpToMatching=function(u,p){var S=this.getCursorPosition(),T=new g(this.session,S.row,S.column),E=T.getCurrentToken(),I=0;E&&E.type.indexOf("tag-name")!==-1&&(E=T.stepBackward());var D=E||T.stepForward();if(D){var H,O=!1,N={},F=S.column-D.start,W,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(D.value.match(/[{}()\[\]]/g)){for(;F<D.value.length&&!O;F++)if(z[D.value[F]])switch(W=z[D.value[F]]+"."+D.type.replace("rparen","lparen"),isNaN(N[W])&&(N[W]=0),D.value[F]){case"(":case"[":case"{":N[W]++;break;case")":case"]":case"}":N[W]--,N[W]===-1&&(H="bracket",O=!0);break}}else D.type.indexOf("tag-name")!==-1&&(isNaN(N[D.value])&&(N[D.value]=0),E.value==="<"&&I>1?N[D.value]++:E.value==="</"&&N[D.value]--,N[D.value]===-1&&(H="tag",O=!0));O||(E=D,I++,D=T.stepForward(),F=0)}while(D&&!O);if(H){var U,V;if(H==="bracket")U=this.session.getBracketRange(S),U||(U=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),V=U.start,(p||V.row===S.row&&Math.abs(V.column-S.column)<2)&&(U=this.session.getBracketRange(V)));else if(H==="tag"){if(!D||D.type.indexOf("tag-name")===-1)return;if(U=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),U.compare(S.row,S.column)===0){var j=this.session.getMatchingTags(S);j&&(j.openTag.contains(S.row,S.column)?(U=j.closeTag,V=U.start):(U=j.openTag,j.closeTag.start.row===S.row&&j.closeTag.start.column===S.column?V=U.end:V=U.start))}V=V||U.start}V=U&&U.cursor||V,V&&(u?U&&p?this.selection.setRange(U):U&&U.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(V.row,V.column):this.selection.moveTo(V.row,V.column))}}},d.prototype.gotoLine=function(u,p,S){this.selection.clearSelection(),this.session.unfold({row:u-1,column:p||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(u-1,p||0),this.isRowFullyVisible(u-1)||this.scrollToLine(u-1,!0,S)},d.prototype.navigateTo=function(u,p){this.selection.moveTo(u,p)},d.prototype.navigateUp=function(u){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(-u||-1,0)},d.prototype.navigateDown=function(u){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(u||1,0)},d.prototype.navigateLeft=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorLeft();else{var p=this.getSelectionRange().start;this.moveCursorToPosition(p)}this.clearSelection()},d.prototype.navigateRight=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorRight();else{var p=this.getSelectionRange().end;this.moveCursorToPosition(p)}this.clearSelection()},d.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},d.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},d.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},d.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},d.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},d.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},d.prototype.replace=function(u,p){p&&this.$search.set(p);var S=this.$search.find(this.session),T=0;return S&&(this.$tryReplace(S,u)&&(T=1),this.selection.setSelectionRange(S),this.renderer.scrollSelectionIntoView(S.start,S.end)),T},d.prototype.replaceAll=function(u,p){p&&this.$search.set(p);var S=this.$search.findAll(this.session),T=0;if(!S.length)return T;var E=this.getSelectionRange();this.selection.moveTo(0,0);for(var I=S.length-1;I>=0;--I)this.$tryReplace(S[I],u)&&T++;return this.selection.setSelectionRange(E),T},d.prototype.$tryReplace=function(u,p){var S=this.session.getTextRange(u);return p=this.$search.replace(S,p),p!==null?(u.end=this.session.replace(u,p),u):null},d.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},d.prototype.find=function(u,p,S){p||(p={}),typeof u=="string"||u instanceof RegExp?p.needle=u:typeof u=="object"&&M.mixin(p,u);var T=this.selection.getRange();p.needle==null&&(u=this.session.getTextRange(T)||this.$search.$options.needle,u||(T=this.session.getWordRange(T.start.row,T.start.column),u=this.session.getTextRange(T)),this.$search.set({needle:u})),this.$search.set(p),p.start||this.$search.set({start:T});var E=this.$search.find(this.session);if(p.preventScroll)return E;if(E)return this.revealRange(E,S),E;p.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},d.prototype.findNext=function(u,p){this.find({skipCurrent:!0,backwards:!1},u,p)},d.prototype.findPrevious=function(u,p){this.find(u,{skipCurrent:!0,backwards:!0},p)},d.prototype.revealRange=function(u,p){this.session.unfold(u),this.selection.setSelectionRange(u);var S=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),p!==!1&&this.renderer.animateScrolling(S)},d.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},d.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},d.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},d.prototype.setAutoScrollEditorIntoView=function(u){if(u){var p,S=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var E=this.$scrollAnchor;E.style.cssText="position:absolute",this.container.insertBefore(E,this.container.firstChild);var I=this.on("changeSelection",function(){T=!0}),D=this.renderer.on("beforeRender",function(){T&&(p=S.renderer.container.getBoundingClientRect())}),H=this.renderer.on("afterRender",function(){if(T&&p&&(S.isFocused()||S.searchBox&&S.searchBox.isFocused())){var O=S.renderer,N=O.$cursorLayer.$pixelPos,F=O.layerConfig,W=N.top-F.offset;N.top>=0&&W+p.top<0?T=!0:N.top<F.height&&N.top+p.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(E.style.top=W+"px",E.style.left=N.left+"px",E.style.height=F.lineHeight+"px",E.scrollIntoView(T)),T=p=null}});this.setAutoScrollEditorIntoView=function(O){O||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",I),this.renderer.off("afterRender",H),this.renderer.off("beforeRender",D))}}},d.prototype.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",p=this.renderer.$cursorLayer;p&&(p.setSmoothBlinking(/smooth/.test(u)),p.isBlinking=!this.$readOnly&&u!="wide",$.setCssClass(p.element,"ace_slim-cursors",/slim/.test(u)))},d.prototype.prompt=function(u,p,S){var T=this;v.loadModule("ace/ext/prompt",function(E){E.prompt(T,u,p,S)})},d}();w.$uid=0,w.prototype.curOp=null,w.prototype.prevOp={},w.prototype.$mergeableCommands=["backspace","del","insertstring"],w.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],M.implement(w.prototype,l),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(d){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:d})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(d){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(d){var u=this;this.textInput.setReadOnly(d),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(S){var T=!1;if(S&&S.type=="keydown"){if(T=S&&S.key&&S.key.length==1&&!S.ctrlKey&&!S.metaKey,!T)return}else S&&S.type!=="exec"&&(T=!0);if(T){u.hoverTooltip||(u.hoverTooltip=new _);var E=$.createElement("div");E.textContent=b("editor.tooltip.disable-editing","Editing is disabled"),u.hoverTooltip.isOpen||u.hoverTooltip.showForRange(u,u.getSelectionRange(),E)}else u.hoverTooltip&&u.hoverTooltip.isOpen&&u.hoverTooltip.hide()});var p=this.textInput.getElement();d?(C.addListener(p,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(C.removeListener(p,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(d){this.textInput.setCopyWithEmptySelection(d)},initialValue:!1},cursorStyle:{set:function(d){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(d){this.setAutoScrollEditorIntoView(d)}},keyboardHandler:{set:function(d){this.setKeyboardHandler(d)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(d){this.session.setValue(d)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(d){this.setSession(d)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(d){this.renderer.$gutterLayer.setShowLineNumbers(d),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),d&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(d){this.$showLineNumbers&&d?y.attach(this):y.detach(this)}},placeholder:{set:function(d){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var u=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(u&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),$.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!u&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),$.addCssClass(this.container,"ace_hasPlaceholder");var p=$.createElement("div");p.className="ace_placeholder",p.textContent=this.$placeholder||"",this.renderer.placeholderNode=p,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!u&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(d){var u={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},p=function(T){if(T.target==this.renderer.scroller&&T.keyCode===A.enter){T.preventDefault();var E=this.getCursorPosition().row;this.isRowVisible(E)||this.scrollToLine(E,!0,!0),this.focus()}},S;d?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(h.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",b("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",b("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",p.bind(this)),this.commands.addCommand(u),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",b("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",b("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),S||(S=new f(this)),S.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",p.bind(this)),this.commands.removeCommand(u),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),S&&S.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(d){this.$textInputAriaLabel=d},initialValue:""},enableMobileMenu:{set:function(d){this.$enableMobileMenu=d},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(d,u){return(Math.abs(d.selection.lead.row-u)||u+1+(u<9?"·":""))+""},getWidth:function(d,u,p){return Math.max(u.toString().length,(p.lastRow+1).toString().length,2)*p.characterWidth},update:function(d,u){u.renderer.$loop.schedule(u.renderer.CHANGE_GUTTER)},attach:function(d){d.renderer.$gutterLayer.$renderer=this,d.on("changeSelection",this.update),this.update(null,d)},detach:function(d){d.renderer.$gutterLayer.$renderer==this&&(d.renderer.$gutterLayer.$renderer=null),d.off("changeSelection",this.update),this.update(null,d)}};x.Editor=w}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(R,x,P){var k=R("../lib/dom"),M=function(){function $(a,h){this.element=a,this.canvasHeight=h||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return $.prototype.moveContainer=function(a){k.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},$.prototype.pageChanged=function(a,h){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(h.firstRowScreen*h.lineHeight/this.canvasHeight)},$.prototype.computeLineTop=function(a,h,r){var o=h.firstRowScreen*h.lineHeight,n=Math.floor(o/this.canvasHeight),t=r.documentToScreenRow(a,0)*h.lineHeight;return t-n*this.canvasHeight},$.prototype.computeLineHeight=function(a,h,r){return h.lineHeight*r.getRowLineCount(a)},$.prototype.getLength=function(){return this.cells.length},$.prototype.get=function(a){return this.cells[a]},$.prototype.shift=function(){this.$cacheCell(this.cells.shift())},$.prototype.pop=function(){this.$cacheCell(this.cells.pop())},$.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var h=k.createFragment(this.element),r=0;r<a.length;r++)h.appendChild(a[r].element);this.element.appendChild(h)}else this.cells.push(a),this.element.appendChild(a.element)},$.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var h=k.createFragment(this.element),r=0;r<a.length;r++)h.appendChild(a[r].element);this.element.firstChild?this.element.insertBefore(h,this.element.firstChild):this.element.appendChild(h)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},$.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},$.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},$.prototype.createCell=function(a,h,r,o){var n=this.cellCache.pop();if(!n){var t=k.createElement("div");o&&o(t),this.element.appendChild(t),n={element:t,text:"",row:a}}return n.row=a,n},$}();x.Lines=M}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(R,x,P){var k=R("../lib/dom"),M=R("../lib/oop"),$=R("../lib/lang"),a=R("../lib/event_emitter").EventEmitter,h=R("./lines").Lines,r=R("../config").nls,o=function(){function t(e){this.element=k.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new h(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,i){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,i)},t.prototype.removeGutterDecoration=function(e,i){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,i)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var i=0;i<e.length;i++){var s=e[i],l=s.row,c=this.$annotations[l];c||(c=this.$annotations[l]={text:[],type:[],displayText:[]});var m=s.text,v=s.text,g=s.type;m=m?$.escapeHTML(m):s.html||"",v=v||s.html||"",c.text.indexOf(m)===-1&&(c.text.push(m),c.type.push(g),c.displayText.push(v));var f=s.className;f?c.className=f:g==="error"?c.className=" ace_error":g==="security"&&!/\bace_error\b/.test(c.className)?c.className=" ace_security":g==="warning"&&!/\bace_(error|security)\b/.test(c.className)?c.className=" ace_warning":g==="info"&&!c.className?c.className=" ace_info":g==="hint"&&!c.className&&(c.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var i=e.start.row,s=e.end.row-i;if(s!==0)if(e.action=="remove")this.$annotations.splice(i,s+1,null);else{var l=new Array(s+1);l.unshift(i,1),this.$annotations.splice.apply(this.$annotations,l)}}},t.prototype.update=function(e){this.config=e;var i=this.session,s=e.firstRow,l=Math.min(e.lastRow+e.gutterOffset,i.getLength()-1);this.oldLastRow=l,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var c=i.getNextFoldLine(s),m=c?c.start.row:1/0,v=null,g=-1,f=s;;){if(f>m&&(f=c.end.row+1,c=i.getNextFoldLine(f,c),m=c?c.start.row:1/0),f>l){for(;this.$lines.getLength()>g+1;)this.$lines.pop();break}v=this.$lines.get(++g),v?v.row=f:(v=this.$lines.createCell(f,e,this.session,n),this.$lines.push(v)),this.$renderCell(v,e,c,f),f++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var i=this.session,s=i.gutterRenderer||this.$renderer,l=i.$firstLineNumber,c=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||i.$useWrapMode)&&(c=i.getLength()+l-1);var m=s?s.getWidth(i,c,e):c.toString().length*e.characterWidth,v=this.$padding||this.$computePadding();m+=v.left+v.right,m!==this.gutterWidth&&!isNaN(m)&&(this.gutterWidth=m,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",m))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var i=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<i.length;s++){var l=i[s];if(l.row>=this.$cursorRow){if(l.row>this.$cursorRow){var c=this.session.getFoldLine(this.$cursorRow);if(s>0&&c&&c.start.row==i[s-1].row)l=i[s-1];else break}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},t.prototype.scrollLines=function(e){var i=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(i,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=s,!i||l<e.firstRow)return this.update(e);if(s<i.firstRow)return this.update(e);if(i.firstRow<e.firstRow)for(var c=this.session.getFoldedRowCount(i.firstRow,e.firstRow-1);c>0;c--)this.$lines.shift();if(l>s)for(var c=this.session.getFoldedRowCount(s+1,l);c>0;c--)this.$lines.pop();e.firstRow<i.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,i.firstRow-1)),s>l&&this.$lines.push(this.$renderLines(e,l+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,i,s){for(var l=[],c=i,m=this.session.getNextFoldLine(c),v=m?m.start.row:1/0;c>v&&(c=m.end.row+1,m=this.session.getNextFoldLine(c,m),v=m?m.start.row:1/0),!(c>s);){var g=this.$lines.createCell(c,e,this.session,n);this.$renderCell(g,e,m,c),l.push(g),c++}return l},t.prototype.$renderCell=function(e,i,s,l){var c=e.element,m=this.session,v=c.childNodes[0],g=c.childNodes[1],f=c.childNodes[2],b=c.childNodes[3],L=f.firstChild,A=m.$firstLineNumber,C=m.$breakpoints,_=m.$decorations,w=m.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&m.foldWidgets,d=s?s.start.row:Number.MAX_VALUE,u=i.lineHeight+"px",p=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",S=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(w?w.getText(m,l):l+A).toString();if(this.$highlightGutterLine&&(l==this.$cursorRow||s&&l<this.$cursorRow&&l>=d&&this.$cursorRow<=s.end.row)&&(p+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),C[l]&&(p+=C[l]),_[l]&&(p+=_[l]),this.$annotations[l]&&l!==d&&(p+=this.$annotations[l].className),y){var E=y[l];E==null&&(E=y[l]=m.getFoldWidget(l))}if(E){var I="ace_fold-widget ace_"+E,D=E=="start"&&l==d&&l<s.end.row;if(D){I+=" ace_closed";for(var H="",O=!1,N=l+1;N<=s.end.row;N++)if(this.$annotations[N]){if(this.$annotations[N].className===" ace_error"){O=!0,H=" ace_error_fold";break}this.$annotations[N].className===" ace_security"?(O=!0,H=" ace_security_fold"):this.$annotations[N].className===" ace_warning"&&H!==" ace_security_fold"&&(O=!0,H=" ace_warning_fold")}p+=H}else I+=" ace_open";g.className!=I&&(g.className=I),k.setStyle(g.style,"height",u),k.setStyle(g.style,"display","inline-block"),g.setAttribute("role","button"),g.setAttribute("tabindex","-1");var F=m.getFoldWidgetRange(l);F?g.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[F.start.row+1,F.end.row+1])):s?g.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):g.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[l+1])),D?(g.setAttribute("aria-expanded","false"),g.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(g.setAttribute("aria-expanded","true"),g.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else g&&(k.setStyle(g.style,"display","none"),g.setAttribute("tabindex","0"),g.removeAttribute("role"),g.removeAttribute("aria-label"));var W=this.session.$gutterCustomWidgets[l];if(W?this.$addCustomWidget(l,W,e):b&&this.$removeCustomWidget(l,e),O&&this.$showFoldedAnnotations){f.className="ace_gutter_annotation",L.className=S,L.className+=H,k.setStyle(L.style,"height",u),k.setStyle(f.style,"display","block"),k.setStyle(f.style,"height",u);var z;switch(H){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break}f.setAttribute("aria-label",z),f.setAttribute("tabindex","-1"),f.setAttribute("role","button")}else if(this.$annotations[l]){f.className="ace_gutter_annotation",L.className=S,this.$useSvgGutterIcons?L.className+=this.$annotations[l].className:c.classList.add(this.$annotations[l].className.replace(" ","")),k.setStyle(L.style,"height",u),k.setStyle(f.style,"display","block"),k.setStyle(f.style,"height",u);var z;switch(this.$annotations[l].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[T]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[T]);break}f.setAttribute("aria-label",z),f.setAttribute("tabindex","-1"),f.setAttribute("role","button")}else k.setStyle(f.style,"display","none"),f.removeAttribute("aria-label"),f.removeAttribute("role"),f.setAttribute("tabindex","0");return T!==v.data&&(v.data=T),c.className!=p&&(c.className=p),k.setStyle(e.element.style,"height",this.$lines.computeLineHeight(l,i,m)+"px"),k.setStyle(e.element.style,"top",this.$lines.computeLineTop(l,i,m)+"px"),e.text=T,f.style.display==="none"&&g.style.display==="none"&&!W?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?k.addCssClass(this.element,"ace_folding-enabled"):k.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,i){var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&k.setStyle(l.style,"display","none")}},t.prototype.$showFoldWidget=function(e,i){var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&this.session.foldWidgets[s.row]&&k.setStyle(l.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var i=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return i[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,i,s){var l=i.className,c=i.label,m=i.title,v=i.callbacks;this.session.$gutterCustomWidgets[e]={className:l,label:c,title:m,callbacks:v},this.$hideFoldWidget(e,s);var g=s||this.$getGutterCell(e);if(g&&g.element){var f=g.element.querySelector(".ace_custom-widget");f&&f.remove(),f=k.createElement("span"),f.className="ace_custom-widget ".concat(l),f.setAttribute("tabindex","-1"),f.setAttribute("role","button"),f.setAttribute("aria-label",c),f.setAttribute("title",m),k.setStyle(f.style,"display","inline-block"),k.setStyle(f.style,"height","inherit"),v&&v.onClick&&f.addEventListener("click",function(b){v.onClick(b,e),b.stopPropagation()}),g.element.appendChild(f)}},t.prototype.$removeCustomWidget=function(e,i){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,i);var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.querySelector(".ace_custom-widget");l&&s.element.removeChild(l)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=k.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var i=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<i.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-i.right)return"foldWidgets"},t}();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,M.implement(o.prototype,a);function n(t){var e=document.createTextNode("");t.appendChild(e);var i=k.createElement("span");t.appendChild(i);var s=k.createElement("span");t.appendChild(s);var l=k.createElement("span");return s.appendChild(l),t}x.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(R,x,P){var k=R("../range").Range,M=R("../lib/dom"),$=function(){function h(r){this.element=M.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return h.prototype.setPadding=function(r){this.$padding=r},h.prototype.setSession=function(r){this.session=r},h.prototype.setMarkers=function(r){this.markers=r},h.prototype.elt=function(r,o){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=o,n.className=r},h.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var n in this.markers){var t=this.markers[n];if(!t.range){t.update(o,this,this.session,r);continue}var e=t.range.clipRows(r.firstRow,r.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var i=this.$getTop(e.start.row,r),s=this.$padding+e.start.column*r.characterWidth;t.renderer(o,e,s,i,r)}else t.type=="fullLine"?this.drawFullLineMarker(o,e,t.clazz,r):t.type=="screenLine"?this.drawScreenLineMarker(o,e,t.clazz,r):e.isMultiLine()?t.type=="text"?this.drawTextMarker(o,e,t.clazz,r):this.drawMultiLineMarker(o,e,t.clazz,r):this.drawSingleLineMarker(o,e,t.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},h.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},h.prototype.drawTextMarker=function(r,o,n,t,e){for(var i=this.session,s=o.start.row,l=o.end.row,c=s,m=0,v=0,g=i.getScreenLastRowColumn(c),f=new k(c,o.start.column,c,v);c<=l;c++)f.start.row=f.end.row=c,f.start.column=c==s?o.start.column:i.getRowWrapIndent(c),f.end.column=g,m=v,v=g,g=c+1<l?i.getScreenLastRowColumn(c+1):c==l?0:o.end.column,this.drawSingleLineMarker(r,f,n+(c==s?" ace_start":"")+" ace_br"+a(c==s||c==s+1&&o.start.column,m<v,v>g,c==l),t,c==l?0:1,e)},h.prototype.drawMultiLineMarker=function(r,o,n,t,e){var i=this.$padding,s=t.lineHeight,l=this.$getTop(o.start.row,t),c=i+o.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var m=o.clone();m.end.row=m.start.row,m.end.column=this.session.getLine(m.start.row).length,this.drawBidiSingleLineMarker(r,m,n+" ace_br1 ace_start",t,null,e)}else this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:"+i+"px;top:"+l+"px;left:"+c+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var m=o.clone();m.start.row=m.end.row,m.start.column=0,this.drawBidiSingleLineMarker(r,m,n+" ace_br12",t,null,e)}else{l=this.$getTop(o.end.row,t);var v=o.end.column*t.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+v+"px;top:"+l+"px;left:"+i+"px;"+(e||""))}if(s=(o.end.row-o.start.row-1)*t.lineHeight,!(s<=0)){l=this.$getTop(o.start.row+1,t);var g=(o.start.column?1:0)|(o.end.column?0:8);this.elt(n+(g?" ace_br"+g:""),"height:"+s+"px;right:"+i+"px;top:"+l+"px;left:"+i+"px;"+(e||""))}},h.prototype.drawSingleLineMarker=function(r,o,n,t,e,i){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,n,t,e,i);var s=t.lineHeight,l=(o.end.column+(e||0)-o.start.column)*t.characterWidth,c=this.$getTop(o.start.row,t),m=this.$padding+o.start.column*t.characterWidth;this.elt(n,"height:"+s+"px;width:"+l+"px;top:"+c+"px;left:"+m+"px;"+(i||""))},h.prototype.drawBidiSingleLineMarker=function(r,o,n,t,e,i){var s=t.lineHeight,l=this.$getTop(o.start.row,t),c=this.$padding,m=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);m.forEach(function(v){this.elt(n,"height:"+s+"px;width:"+(v.width+(e||0))+"px;top:"+l+"px;left:"+(c+v.left)+"px;"+(i||""))},this)},h.prototype.drawFullLineMarker=function(r,o,n,t,e){var i=this.$getTop(o.start.row,t),s=t.lineHeight;o.start.row!=o.end.row&&(s+=this.$getTop(o.end.row,t)-i),this.elt(n,"height:"+s+"px;top:"+i+"px;left:0;right:0;"+(e||""))},h.prototype.drawScreenLineMarker=function(r,o,n,t,e){var i=this.$getTop(o.start.row,t),s=t.lineHeight;this.elt(n,"height:"+s+"px;top:"+i+"px;left:0;right:0;"+(e||""))},h}();$.prototype.$padding=0;function a(h,r,o,n){return(h?1:0)|(r?2:0)|(o?4:0)|(n?8:0)}x.Marker=$}),ace.define("ace/layer/text_util",["require","exports","module"],function(R,x,P){var k=new Set(["text","rparen","lparen"]);x.isTextToken=function(M){return k.has(M)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(R,x,P){var k=R("../lib/oop"),M=R("../lib/dom"),$=R("../lib/lang"),a=R("./lines").Lines,h=R("../lib/event_emitter").EventEmitter,r=R("../config").nls,o=R("./text_util").isTextToken,n=function(){function t(e){this.dom=M,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,i=e.getNewLineCharacter()==`
215
+ `),this.moveCursorToPosition(u)},d.prototype.setGhostText=function(u,p){this.renderer.setGhostText(u,p)},d.prototype.removeGhostText=function(){this.renderer.removeGhostText()},d.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var u=this.getCursorPosition(),p=u.column;if(p!==0){var S=this.session.getLine(u.row),T,E;p<S.length?(T=S.charAt(p)+S.charAt(p-1),E=new s(u.row,p-1,u.row,p+1)):(T=S.charAt(p-1)+S.charAt(p-2),E=new s(u.row,p-2,u.row,p)),this.session.replace(E,T),this.session.selection.moveToPosition(E.end)}}},d.prototype.toLowerCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),S=this.session.getTextRange(p);this.session.replace(p,S.toLowerCase()),this.selection.setSelectionRange(u)},d.prototype.toUpperCase=function(){var u=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var p=this.getSelectionRange(),S=this.session.getTextRange(p);this.session.replace(p,S.toUpperCase()),this.selection.setSelectionRange(u)},d.prototype.indent=function(){var u=this.session,p=this.getSelectionRange();if(p.start.row<p.end.row){var S=this.$getSelectedRows();u.indentRows(S.first,S.last," ");return}else if(p.start.column<p.end.column){var T=u.getTextRange(p);if(!/^\s+$/.test(T)){var S=this.$getSelectedRows();u.indentRows(S.first,S.last," ");return}}var E=u.getLine(p.start.row),I=p.start,D=u.getTabSize(),H=u.documentToScreenColumn(I.row,I.column);if(this.session.getUseSoftTabs())var O=D-H%D,N=a.stringRepeat(" ",O);else{for(var O=H%D;E[p.start.column-1]==" "&&O;)p.start.column--,O--;this.selection.setSelectionRange(p),N=" "}return this.insert(N)},d.prototype.blockIndent=function(){var u=this.$getSelectedRows();this.session.indentRows(u.first,u.last," ")},d.prototype.blockOutdent=function(){var u=this.session.getSelection();this.session.outdentRows(u.getRange())},d.prototype.sortLines=function(){for(var u=this.$getSelectedRows(),p=this.session,S=[],T=u.first;T<=u.last;T++)S.push(p.getLine(T));S.sort(function(D,H){return D.toLowerCase()<H.toLowerCase()?-1:D.toLowerCase()>H.toLowerCase()?1:0});for(var E=new s(0,0,0,0),T=u.first;T<=u.last;T++){var I=p.getLine(T);E.start.row=T,E.end.row=T,E.end.column=I.length,p.replace(E,S[T-u.first])}},d.prototype.toggleCommentLines=function(){var u=this.session.getState(this.getCursorPosition().row),p=this.$getSelectedRows();this.session.getMode().toggleCommentLines(u,this.session,p.first,p.last)},d.prototype.toggleBlockComment=function(){var u=this.getCursorPosition(),p=this.session.getState(u.row),S=this.getSelectionRange();this.session.getMode().toggleBlockComment(p,this.session,S,u)},d.prototype.getNumberAt=function(u,p){var S=/[\-]?[0-9]+(?:\.[0-9]+)?/g;S.lastIndex=0;for(var T=this.session.getLine(u);S.lastIndex<p;){var E=S.exec(T);if(E.index<=p&&E.index+E[0].length>=p){var I={value:E[0],start:E.index,end:E.index+E[0].length};return I}}return null},d.prototype.modifyNumber=function(u){var p=this.selection.getCursor().row,S=this.selection.getCursor().column,T=new s(p,S-1,p,S),E=this.session.getTextRange(T);if(!isNaN(parseFloat(E))&&isFinite(E)){var I=this.getNumberAt(p,S);if(I){var D=I.value.indexOf(".")>=0?I.start+I.value.indexOf(".")+1:I.end,H=I.start+I.value.length-D,O=parseFloat(I.value);O*=Math.pow(10,H),D!==I.end&&S<D?u*=Math.pow(10,I.end-S-1):u*=Math.pow(10,I.end-S),O+=u,O/=Math.pow(10,H);var N=O.toFixed(H),F=new s(p,I.start,p,I.end);this.session.replace(F,N),this.moveCursorTo(p,Math.max(I.start+1,S+N.length-I.value.length))}}else this.toggleWord()},d.prototype.toggleWord=function(){var u=this.selection.getCursor().row,p=this.selection.getCursor().column;this.selection.selectWord();var S=this.getSelectedText(),T=this.selection.getWordRange().start.column,E=S.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),I=p-T-1;I<0&&(I=0);var D=0,H=0,O=this;S.match(/[A-Za-z0-9_]+/)&&E.forEach(function(Z,te){H=D+Z.length,I>=D&&I<=H&&(S=Z,O.selection.clearSelection(),O.moveCursorTo(u,D+T),O.selection.selectTo(u,H+T)),D=H});for(var N=this.$toggleWordPairs,F,W=0;W<N.length;W++)for(var z=N[W],U=0;U<=1;U++){var V=+!U,j=S.match(new RegExp("^\\s?_?("+a.escapeRegExp(z[U])+")\\s?$","i"));if(j){var Y=S.match(new RegExp("([_]|^|\\s)("+a.escapeRegExp(j[1])+")($|\\s)","g"));Y&&(F=S.replace(new RegExp(a.escapeRegExp(z[U]),"i"),function(Z){var te=z[V];return Z.toUpperCase()==Z?te=te.toUpperCase():Z.charAt(0).toUpperCase()==Z.charAt(0)&&(te=te.substr(0,0)+z[V].charAt(0).toUpperCase()+te.substr(1)),te}),this.insert(F),F="")}}},d.prototype.findLinkAt=function(u,p){var S,T,E=this.session.getLine(u),I=E.split(/((?:https?|ftp):\/\/[\S]+)/),D=p;D<0&&(D=0);var H=0,O=0,N;try{for(var F=k(I),W=F.next();!W.done;W=F.next()){var z=W.value;if(O=H+z.length,D>=H&&D<=O&&z.match(/((?:https?|ftp):\/\/[\S]+)/)){N=z.replace(/[\s:.,'";}\]]+$/,"");break}H=O}}catch(U){S={error:U}}finally{try{W&&!W.done&&(T=F.return)&&T.call(F)}finally{if(S)throw S.error}}return N},d.prototype.openLink=function(){var u=this.selection.getCursor(),p=this.findLinkAt(u.row,u.column);return p&&window.open(p,"_blank"),p!=null},d.prototype.removeLines=function(){var u=this.$getSelectedRows();this.session.removeFullLines(u.first,u.last),this.clearSelection()},d.prototype.duplicateSelection=function(){var u=this.selection,p=this.session,S=u.getRange(),T=u.isBackwards();if(S.isEmpty()){var E=S.start.row;p.duplicateLines(E,E)}else{var I=T?S.start:S.end,D=p.insert(I,p.getTextRange(S));S.start=I,S.end=D,u.setSelectionRange(S,T)}},d.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},d.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},d.prototype.moveText=function(u,p,S){return this.session.moveText(u,p,S)},d.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},d.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},d.prototype.$moveLines=function(u,p){var S,T,E=this.selection;if(!E.inMultiSelectMode||this.inVirtualSelectionMode){var I=E.toOrientedRange();S=this.$getSelectedRows(I),T=this.session.$moveLines(S.first,S.last,p?0:u),p&&u==-1&&(T=0),I.moveBy(T,0),E.fromOrientedRange(I)}else{var D=E.rangeList.ranges;E.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var H=0,O=0,N=D.length,F=0;F<N;F++){var W=F;D[F].moveBy(H,0),S=this.$getSelectedRows(D[F]);for(var z=S.first,U=S.last;++F<N;){O&&D[F].moveBy(O,0);var V=this.$getSelectedRows(D[F]);if(p&&V.first!=U)break;if(!p&&V.first>U+1)break;U=V.last}for(F--,H=this.session.$moveLines(z,U,p?0:u),p&&u==-1&&(W=F+1);W<=F;)D[W].moveBy(H,0),W++;p||(H=0),O+=H}E.fromOrientedRange(E.ranges[0]),E.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},d.prototype.$getSelectedRows=function(u){return u=(u||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(u.start.row),last:this.session.getRowFoldEnd(u.end.row)}},d.prototype.onCompositionStart=function(u){this.renderer.showComposition(u)},d.prototype.onCompositionUpdate=function(u){this.renderer.setCompositionText(u)},d.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},d.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},d.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},d.prototype.isRowVisible=function(u){return u>=this.getFirstVisibleRow()&&u<=this.getLastVisibleRow()},d.prototype.isRowFullyVisible=function(u){return u>=this.renderer.getFirstFullyVisibleRow()&&u<=this.renderer.getLastFullyVisibleRow()},d.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},d.prototype.$moveByPage=function(u,p){var S=this.renderer,T=this.renderer.layerConfig,E=u*Math.floor(T.height/T.lineHeight);p===!0?this.selection.$moveSelection(function(){this.moveCursorBy(E,0)}):p===!1&&(this.selection.moveCursorBy(E,0),this.selection.clearSelection());var I=S.scrollTop;S.scrollBy(0,E*T.lineHeight),p!=null&&S.scrollCursorIntoView(null,.5),S.animateScrolling(I)},d.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},d.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},d.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},d.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},d.prototype.scrollPageDown=function(){this.$moveByPage(1)},d.prototype.scrollPageUp=function(){this.$moveByPage(-1)},d.prototype.scrollToRow=function(u){this.renderer.scrollToRow(u)},d.prototype.scrollToLine=function(u,p,S,T){this.renderer.scrollToLine(u,p,S,T)},d.prototype.centerSelection=function(){var u=this.getSelectionRange(),p={row:Math.floor(u.start.row+(u.end.row-u.start.row)/2),column:Math.floor(u.start.column+(u.end.column-u.start.column)/2)};this.renderer.alignCursor(p,.5)},d.prototype.getCursorPosition=function(){return this.selection.getCursor()},d.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},d.prototype.getSelectionRange=function(){return this.selection.getRange()},d.prototype.selectAll=function(){this.selection.selectAll()},d.prototype.clearSelection=function(){this.selection.clearSelection()},d.prototype.moveCursorTo=function(u,p){this.selection.moveCursorTo(u,p)},d.prototype.moveCursorToPosition=function(u){this.selection.moveCursorToPosition(u)},d.prototype.jumpToMatching=function(u,p){var S=this.getCursorPosition(),T=new g(this.session,S.row,S.column),E=T.getCurrentToken(),I=0;E&&E.type.indexOf("tag-name")!==-1&&(E=T.stepBackward());var D=E||T.stepForward();if(D){var H,O=!1,N={},F=S.column-D.start,W,z={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(D.value.match(/[{}()\[\]]/g)){for(;F<D.value.length&&!O;F++)if(z[D.value[F]])switch(W=z[D.value[F]]+"."+D.type.replace("rparen","lparen"),isNaN(N[W])&&(N[W]=0),D.value[F]){case"(":case"[":case"{":N[W]++;break;case")":case"]":case"}":N[W]--,N[W]===-1&&(H="bracket",O=!0);break}}else D.type.indexOf("tag-name")!==-1&&(isNaN(N[D.value])&&(N[D.value]=0),E.value==="<"&&I>1?N[D.value]++:E.value==="</"&&N[D.value]--,N[D.value]===-1&&(H="tag",O=!0));O||(E=D,I++,D=T.stepForward(),F=0)}while(D&&!O);if(H){var U,V;if(H==="bracket")U=this.session.getBracketRange(S),U||(U=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1,T.getCurrentTokenRow(),T.getCurrentTokenColumn()+F-1),V=U.start,(p||V.row===S.row&&Math.abs(V.column-S.column)<2)&&(U=this.session.getBracketRange(V)));else if(H==="tag"){if(!D||D.type.indexOf("tag-name")===-1)return;if(U=new s(T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2,T.getCurrentTokenRow(),T.getCurrentTokenColumn()-2),U.compare(S.row,S.column)===0){var j=this.session.getMatchingTags(S);j&&(j.openTag.contains(S.row,S.column)?(U=j.closeTag,V=U.start):(U=j.openTag,j.closeTag.start.row===S.row&&j.closeTag.start.column===S.column?V=U.end:V=U.start))}V=V||U.start}V=U&&U.cursor||V,V&&(u?U&&p?this.selection.setRange(U):U&&U.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(V.row,V.column):this.selection.moveTo(V.row,V.column))}}},d.prototype.gotoLine=function(u,p,S){this.selection.clearSelection(),this.session.unfold({row:u-1,column:p||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(u-1,p||0),this.isRowFullyVisible(u-1)||this.scrollToLine(u-1,!0,S)},d.prototype.navigateTo=function(u,p){this.selection.moveTo(u,p)},d.prototype.navigateUp=function(u){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(-u||-1,0)},d.prototype.navigateDown=function(u){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var p=this.selection.anchor.getPosition();return this.moveCursorToPosition(p)}this.selection.clearSelection(),this.selection.moveCursorBy(u||1,0)},d.prototype.navigateLeft=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorLeft();else{var p=this.getSelectionRange().start;this.moveCursorToPosition(p)}this.clearSelection()},d.prototype.navigateRight=function(u){if(this.selection.isEmpty())for(u=u||1;u--;)this.selection.moveCursorRight();else{var p=this.getSelectionRange().end;this.moveCursorToPosition(p)}this.clearSelection()},d.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},d.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},d.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},d.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},d.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},d.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},d.prototype.replace=function(u,p){p&&this.$search.set(p);var S=this.$search.find(this.session),T=0;return S&&(this.$tryReplace(S,u)&&(T=1),this.selection.setSelectionRange(S),this.renderer.scrollSelectionIntoView(S.start,S.end)),T},d.prototype.replaceAll=function(u,p){p&&this.$search.set(p);var S=this.$search.findAll(this.session),T=0;if(!S.length)return T;var E=this.getSelectionRange();this.selection.moveTo(0,0);for(var I=S.length-1;I>=0;--I)this.$tryReplace(S[I],u)&&T++;return this.selection.setSelectionRange(E),T},d.prototype.$tryReplace=function(u,p){var S=this.session.getTextRange(u);return p=this.$search.replace(S,p),p!==null?(u.end=this.session.replace(u,p),u):null},d.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},d.prototype.find=function(u,p,S){p||(p={}),typeof u=="string"||u instanceof RegExp?p.needle=u:typeof u=="object"&&M.mixin(p,u);var T=this.selection.getRange();p.needle==null&&(u=this.session.getTextRange(T)||this.$search.$options.needle,u||(T=this.session.getWordRange(T.start.row,T.start.column),u=this.session.getTextRange(T)),this.$search.set({needle:u})),this.$search.set(p),p.start||this.$search.set({start:T});var E=this.$search.find(this.session);if(p.preventScroll)return E;if(E)return this.revealRange(E,S),E;p.backwards?T.start=T.end:T.end=T.start,this.selection.setRange(T)},d.prototype.findNext=function(u,p){this.find({skipCurrent:!0,backwards:!1},u,p)},d.prototype.findPrevious=function(u,p){this.find(u,{skipCurrent:!0,backwards:!0},p)},d.prototype.revealRange=function(u,p){this.session.unfold(u),this.selection.setSelectionRange(u);var S=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(u.start,u.end,.5),p!==!1&&this.renderer.animateScrolling(S)},d.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},d.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},d.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach(function(u){u.destroy()}),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},d.prototype.setAutoScrollEditorIntoView=function(u){if(u){var p,S=this,T=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var E=this.$scrollAnchor;E.style.cssText="position:absolute",this.container.insertBefore(E,this.container.firstChild);var I=this.on("changeSelection",function(){T=!0}),D=this.renderer.on("beforeRender",function(){T&&(p=S.renderer.container.getBoundingClientRect())}),H=this.renderer.on("afterRender",function(){if(T&&p&&(S.isFocused()||S.searchBox&&S.searchBox.isFocused())){var O=S.renderer,N=O.$cursorLayer.$pixelPos,F=O.layerConfig,W=N.top-F.offset;N.top>=0&&W+p.top<0?T=!0:N.top<F.height&&N.top+p.top+F.lineHeight>window.innerHeight?T=!1:T=null,T!=null&&(E.style.top=W+"px",E.style.left=N.left+"px",E.style.height=F.lineHeight+"px",E.scrollIntoView(T)),T=p=null}});this.setAutoScrollEditorIntoView=function(O){O||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",I),this.renderer.off("afterRender",H),this.renderer.off("beforeRender",D))}}},d.prototype.$resetCursorStyle=function(){var u=this.$cursorStyle||"ace",p=this.renderer.$cursorLayer;p&&(p.setSmoothBlinking(/smooth/.test(u)),p.isBlinking=!this.$readOnly&&u!="wide",$.setCssClass(p.element,"ace_slim-cursors",/slim/.test(u)))},d.prototype.prompt=function(u,p,S){var T=this;v.loadModule("ace/ext/prompt",function(E){E.prompt(T,u,p,S)})},d}();w.$uid=0,w.prototype.curOp=null,w.prototype.prevOp={},w.prototype.$mergeableCommands=["backspace","del","insertstring"],w.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],M.implement(w.prototype,l),v.defineOptions(w.prototype,"editor",{selectionStyle:{set:function(d){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:d})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(d){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(d){var u=this;this.textInput.setReadOnly(d),this.$resetCursorStyle(),this.$readOnlyCallback||(this.$readOnlyCallback=function(S){var T=!1;if(S&&S.type=="keydown"){if(T=S&&S.key&&S.key.length==1&&!S.ctrlKey&&!S.metaKey,!T)return}else S&&S.type!=="exec"&&(T=!0);if(T){u.hoverTooltip||(u.hoverTooltip=new _);var E=$.createElement("div");E.textContent=b("editor.tooltip.disable-editing","Editing is disabled"),u.hoverTooltip.isOpen||u.hoverTooltip.showForRange(u,u.getSelectionRange(),E)}else u.hoverTooltip&&u.hoverTooltip.isOpen&&u.hoverTooltip.hide()});var p=this.textInput.getElement();d?(C.addListener(p,"keydown",this.$readOnlyCallback,this),this.commands.on("exec",this.$readOnlyCallback),this.commands.on("commandUnavailable",this.$readOnlyCallback)):(C.removeListener(p,"keydown",this.$readOnlyCallback),this.commands.off("exec",this.$readOnlyCallback),this.commands.off("commandUnavailable",this.$readOnlyCallback),this.hoverTooltip&&(this.hoverTooltip.destroy(),this.hoverTooltip=null))},initialValue:!1},copyWithEmptySelection:{set:function(d){this.textInput.setCopyWithEmptySelection(d)},initialValue:!1},cursorStyle:{set:function(d){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(d){this.setAutoScrollEditorIntoView(d)}},keyboardHandler:{set:function(d){this.setKeyboardHandler(d)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(d){this.session.setValue(d)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(d){this.setSession(d)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(d){this.renderer.$gutterLayer.setShowLineNumbers(d),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),d&&this.$relativeLineNumbers?y.attach(this):y.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(d){this.$showLineNumbers&&d?y.attach(this):y.detach(this)}},placeholder:{set:function(d){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var u=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(u&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),$.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(!u&&!this.renderer.placeholderNode){this.renderer.on("afterRender",this.$updatePlaceholder),$.addCssClass(this.container,"ace_hasPlaceholder");var p=$.createElement("div");p.className="ace_placeholder",p.textContent=this.$placeholder||"",this.renderer.placeholderNode=p,this.renderer.content.appendChild(this.renderer.placeholderNode)}else!u&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"")}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(d){var u={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(T){T.blur(),T.renderer.scroller.focus()},readOnly:!0},p=function(T){if(T.target==this.renderer.scroller&&T.keyCode===A.enter){T.preventDefault();var E=this.getCursorPosition().row;this.isRowVisible(E)||this.scrollToLine(E,!0,!0),this.focus()}},S;d?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(h.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",b("editor.scroller.aria-roledescription","editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",b("editor.scroller.aria-label","Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",p.bind(this)),this.commands.addCommand(u),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",b("editor.gutter.aria-roledescription","editor gutter")),this.renderer.$gutter.setAttribute("aria-label",b("editor.gutter.aria-label","Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),S||(S=new f(this)),S.addListener(),this.textInput.setAriaOptions({setLabel:!0})):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",p.bind(this)),this.commands.removeCommand(u),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),S&&S.removeListener())},initialValue:!1},textInputAriaLabel:{set:function(d){this.$textInputAriaLabel=d},initialValue:""},enableMobileMenu:{set:function(d){this.$enableMobileMenu=d},initialValue:!0},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var y={getText:function(d,u){return(Math.abs(d.selection.lead.row-u)||u+1+(u<9?"·":""))+""},getWidth:function(d,u,p){return Math.max(u.toString().length,(p.lastRow+1).toString().length,2)*p.characterWidth},update:function(d,u){u.renderer.$loop.schedule(u.renderer.CHANGE_GUTTER)},attach:function(d){d.renderer.$gutterLayer.$renderer=this,d.on("changeSelection",this.update),this.update(null,d)},detach:function(d){d.renderer.$gutterLayer.$renderer==this&&(d.renderer.$gutterLayer.$renderer=null),d.off("changeSelection",this.update),this.update(null,d)}};x.Editor=w}),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],function(R,x,P){var k=R("../lib/dom"),M=function(){function $(a,h){this.element=a,this.canvasHeight=h||5e5,this.element.style.height=this.canvasHeight*2+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return $.prototype.moveContainer=function(a){k.translate(this.element,0,-(a.firstRowScreen*a.lineHeight%this.canvasHeight)-a.offset*this.$offsetCoefficient)},$.prototype.pageChanged=function(a,h){return Math.floor(a.firstRowScreen*a.lineHeight/this.canvasHeight)!==Math.floor(h.firstRowScreen*h.lineHeight/this.canvasHeight)},$.prototype.computeLineTop=function(a,h,r){var o=h.firstRowScreen*h.lineHeight,n=Math.floor(o/this.canvasHeight),t=r.documentToScreenRow(a,0)*h.lineHeight;return t-n*this.canvasHeight},$.prototype.computeLineHeight=function(a,h,r){return h.lineHeight*r.getRowLineCount(a)},$.prototype.getLength=function(){return this.cells.length},$.prototype.get=function(a){return this.cells[a]},$.prototype.shift=function(){this.$cacheCell(this.cells.shift())},$.prototype.pop=function(){this.$cacheCell(this.cells.pop())},$.prototype.push=function(a){if(Array.isArray(a)){this.cells.push.apply(this.cells,a);for(var h=k.createFragment(this.element),r=0;r<a.length;r++)h.appendChild(a[r].element);this.element.appendChild(h)}else this.cells.push(a),this.element.appendChild(a.element)},$.prototype.unshift=function(a){if(Array.isArray(a)){this.cells.unshift.apply(this.cells,a);for(var h=k.createFragment(this.element),r=0;r<a.length;r++)h.appendChild(a[r].element);this.element.firstChild?this.element.insertBefore(h,this.element.firstChild):this.element.appendChild(h)}else this.cells.unshift(a),this.element.insertAdjacentElement("afterbegin",a.element)},$.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},$.prototype.$cacheCell=function(a){a&&(a.element.remove(),this.cellCache.push(a))},$.prototype.createCell=function(a,h,r,o){var n=this.cellCache.pop();if(!n){var t=k.createElement("div");o&&o(t),this.element.appendChild(t),n={element:t,text:"",row:a}}return n.row=a,n},$}();x.Lines=M}),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],function(R,x,P){var k=R("../lib/dom"),M=R("../lib/oop"),$=R("../lib/lang"),a=R("../lib/event_emitter").EventEmitter,h=R("./lines").Lines,r=R("../config").nls,o=function(){function t(e){this.element=k.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new h(this.element),this.$lines.$offsetCoefficient=1}return t.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},t.prototype.addGutterDecoration=function(e,i){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,i)},t.prototype.removeGutterDecoration=function(e,i){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,i)},t.prototype.setAnnotations=function(e){this.$annotations=[];for(var i=0;i<e.length;i++){var s=e[i],l=s.row,c=this.$annotations[l];c||(c=this.$annotations[l]={text:[],type:[],displayText:[]});var m=s.text,v=s.text,g=s.type;m=m?$.escapeHTML(m):s.html||"",v=v||s.html||"",c.text.indexOf(m)===-1&&(c.text.push(m),c.type.push(g),c.displayText.push(v));var f=s.className;f?c.className=f:g==="error"?c.className=" ace_error":g==="security"&&!/\bace_error\b/.test(c.className)?c.className=" ace_security":g==="warning"&&!/\bace_(error|security)\b/.test(c.className)?c.className=" ace_warning":g==="info"&&!c.className?c.className=" ace_info":g==="hint"&&!c.className&&(c.className=" ace_hint")}},t.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var i=e.start.row,s=e.end.row-i;if(s!==0)if(e.action=="remove")this.$annotations.splice(i,s+1,null);else{var l=new Array(s+1);l.unshift(i,1),this.$annotations.splice.apply(this.$annotations,l)}}},t.prototype.update=function(e){this.config=e;var i=this.session,s=e.firstRow,l=Math.min(e.lastRow+e.gutterOffset,i.getLength()-1);this.oldLastRow=l,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var c=i.getNextFoldLine(s),m=c?c.start.row:1/0,v=null,g=-1,f=s;;){if(f>m&&(f=c.end.row+1,c=i.getNextFoldLine(f,c),m=c?c.start.row:1/0),f>l){for(;this.$lines.getLength()>g+1;)this.$lines.pop();break}v=this.$lines.get(++g),v?v.row=f:(v=this.$lines.createCell(f,e,this.session,n),this.$lines.push(v)),this.$renderCell(v,e,c,f),f++}this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$updateGutterWidth=function(e){var i=this.session,s=i.gutterRenderer||this.$renderer,l=i.$firstLineNumber,c=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||i.$useWrapMode)&&(c=i.getLength()+l-1);var m=s?s.getWidth(i,c,e):c.toString().length*e.characterWidth,v=this.$padding||this.$computePadding();m+=v.left+v.right,m!==this.gutterWidth&&!isNaN(m)&&(this.gutterWidth=m,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",m))},t.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},t.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!(this.$cursorCell&&this.$cursorCell.row==e)){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var i=this.$lines.cells;this.$cursorCell=null;for(var s=0;s<i.length;s++){var l=i[s];if(l.row>=this.$cursorRow){if(l.row>this.$cursorRow){var c=this.session.getFoldLine(this.$cursorRow);if(s>0&&c&&c.start.row==i[s-1].row)l=i[s-1];else break}l.element.className="ace_gutter-active-line "+l.element.className,this.$cursorCell=l;break}}}}},t.prototype.scrollLines=function(e){var i=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(i,e))return this.update(e);this.$lines.moveContainer(e);var s=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),l=this.oldLastRow;if(this.oldLastRow=s,!i||l<e.firstRow)return this.update(e);if(s<i.firstRow)return this.update(e);if(i.firstRow<e.firstRow)for(var c=this.session.getFoldedRowCount(i.firstRow,e.firstRow-1);c>0;c--)this.$lines.shift();if(l>s)for(var c=this.session.getFoldedRowCount(s+1,l);c>0;c--)this.$lines.pop();e.firstRow<i.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,i.firstRow-1)),s>l&&this.$lines.push(this.$renderLines(e,l+1,s)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},t.prototype.$renderLines=function(e,i,s){for(var l=[],c=i,m=this.session.getNextFoldLine(c),v=m?m.start.row:1/0;c>v&&(c=m.end.row+1,m=this.session.getNextFoldLine(c,m),v=m?m.start.row:1/0),!(c>s);){var g=this.$lines.createCell(c,e,this.session,n);this.$renderCell(g,e,m,c),l.push(g),c++}return l},t.prototype.$renderCell=function(e,i,s,l){var c=e.element,m=this.session,v=c.childNodes[0],g=c.childNodes[1],f=c.childNodes[2],b=c.childNodes[3],L=f.firstChild,A=m.$firstLineNumber,C=m.$breakpoints,_=m.$decorations,w=m.gutterRenderer||this.$renderer,y=this.$showFoldWidgets&&m.foldWidgets,d=s?s.start.row:Number.MAX_VALUE,u=i.lineHeight+"px",p=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",S=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",T=(w?w.getText(m,l):l+A).toString();if(this.$highlightGutterLine&&(l==this.$cursorRow||s&&l<this.$cursorRow&&l>=d&&this.$cursorRow<=s.end.row)&&(p+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),C[l]&&(p+=C[l]),_[l]&&(p+=_[l]),this.$annotations[l]&&l!==d&&(p+=this.$annotations[l].className),y){var E=y[l];E==null&&(E=y[l]=m.getFoldWidget(l))}if(E){var I="ace_fold-widget ace_"+E,D=E=="start"&&l==d&&l<s.end.row;if(D){I+=" ace_closed";for(var H="",O=!1,N=l+1;N<=s.end.row;N++)if(this.$annotations[N]){if(this.$annotations[N].className===" ace_error"){O=!0,H=" ace_error_fold";break}this.$annotations[N].className===" ace_security"?(O=!0,H=" ace_security_fold"):this.$annotations[N].className===" ace_warning"&&H!==" ace_security_fold"&&(O=!0,H=" ace_warning_fold")}p+=H}else I+=" ace_open";g.className!=I&&(g.className=I),k.setStyle(g.style,"height",u),k.setStyle(g.style,"display","inline-block"),g.setAttribute("role","button"),g.setAttribute("tabindex","-1");var F=m.getFoldWidgetRange(l);F?g.setAttribute("aria-label",r("gutter.code-folding.range.aria-label","Toggle code folding, rows $0 through $1",[F.start.row+1,F.end.row+1])):s?g.setAttribute("aria-label",r("gutter.code-folding.closed.aria-label","Toggle code folding, rows $0 through $1",[s.start.row+1,s.end.row+1])):g.setAttribute("aria-label",r("gutter.code-folding.open.aria-label","Toggle code folding, row $0",[l+1])),D?(g.setAttribute("aria-expanded","false"),g.setAttribute("title",r("gutter.code-folding.closed.title","Unfold code"))):(g.setAttribute("aria-expanded","true"),g.setAttribute("title",r("gutter.code-folding.open.title","Fold code")))}else g&&(k.setStyle(g.style,"display","none"),g.setAttribute("tabindex","0"),g.removeAttribute("role"),g.removeAttribute("aria-label"));var W=this.session.$gutterCustomWidgets[l];if(W?this.$addCustomWidget(l,W,e):b&&this.$removeCustomWidget(l,e),O&&this.$showFoldedAnnotations){f.className="ace_gutter_annotation",L.className=S,L.className+=H,k.setStyle(L.style,"height",u),k.setStyle(f.style,"display","block"),k.setStyle(f.style,"height",u);var z;switch(H){case" ace_error_fold":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security_fold":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning_fold":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break}f.setAttribute("aria-label",z),f.setAttribute("tabindex","-1"),f.setAttribute("role","button")}else if(this.$annotations[l]){f.className="ace_gutter_annotation",L.className=S,this.$useSvgGutterIcons?L.className+=this.$annotations[l].className:c.classList.add(this.$annotations[l].className.replace(" ","")),k.setStyle(L.style,"height",u),k.setStyle(f.style,"display","block"),k.setStyle(f.style,"height",u);var z;switch(this.$annotations[l].className){case" ace_error":z=r("gutter.annotation.aria-label.error","Error, read annotations row $0",[T]);break;case" ace_security":z=r("gutter.annotation.aria-label.security","Security finding, read annotations row $0",[T]);break;case" ace_warning":z=r("gutter.annotation.aria-label.warning","Warning, read annotations row $0",[T]);break;case" ace_info":z=r("gutter.annotation.aria-label.info","Info, read annotations row $0",[T]);break;case" ace_hint":z=r("gutter.annotation.aria-label.hint","Suggestion, read annotations row $0",[T]);break}f.setAttribute("aria-label",z),f.setAttribute("tabindex","-1"),f.setAttribute("role","button")}else k.setStyle(f.style,"display","none"),f.removeAttribute("aria-label"),f.removeAttribute("role"),f.setAttribute("tabindex","0");return T!==v.data&&(v.data=T),c.className!=p&&(c.className=p),k.setStyle(e.element.style,"height",this.$lines.computeLineHeight(l,i,m)+"px"),k.setStyle(e.element.style,"top",this.$lines.computeLineTop(l,i,m)+"px"),e.text=T,f.style.display==="none"&&g.style.display==="none"&&!W?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},t.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},t.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},t.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},t.prototype.setShowFoldWidgets=function(e){e?k.addCssClass(this.element,"ace_folding-enabled"):k.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},t.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},t.prototype.$hideFoldWidget=function(e,i){var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&k.setStyle(l.style,"display","none")}},t.prototype.$showFoldWidget=function(e,i){var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.childNodes[1];l&&this.session.foldWidgets&&this.session.foldWidgets[s.row]&&k.setStyle(l.style,"display","inline-block")}},t.prototype.$getGutterCell=function(e){var i=this.$lines.cells,s=this.session.documentToScreenRow(e,0);return i[e-this.config.firstRowScreen-(e-s)]},t.prototype.$addCustomWidget=function(e,i,s){var l=i.className,c=i.label,m=i.title,v=i.callbacks;this.session.$gutterCustomWidgets[e]={className:l,label:c,title:m,callbacks:v},this.$hideFoldWidget(e,s);var g=s||this.$getGutterCell(e);if(g&&g.element){var f=g.element.querySelector(".ace_custom-widget");f&&f.remove(),f=k.createElement("span"),f.className="ace_custom-widget ".concat(l),f.setAttribute("tabindex","-1"),f.setAttribute("role","button"),f.setAttribute("aria-label",c),f.setAttribute("title",m),k.setStyle(f.style,"display","inline-block"),k.setStyle(f.style,"height","inherit"),v&&v.onClick&&f.addEventListener("click",function(b){v.onClick(b,e),b.stopPropagation()}),g.element.appendChild(f)}},t.prototype.$removeCustomWidget=function(e,i){delete this.session.$gutterCustomWidgets[e],this.$showFoldWidget(e,i);var s=i||this.$getGutterCell(e);if(s&&s.element){var l=s.element.querySelector(".ace_custom-widget");l&&s.element.removeChild(l)}},t.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=k.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},t.prototype.getRegion=function(e){var i=this.$padding||this.$computePadding(),s=this.element.getBoundingClientRect();if(e.x<i.left+s.left)return"markers";if(this.$showFoldWidgets&&e.x>s.right-i.right)return"foldWidgets"},t}();o.prototype.$fixedWidth=!1,o.prototype.$highlightGutterLine=!0,o.prototype.$renderer="",o.prototype.$showLineNumbers=!0,o.prototype.$showFoldWidgets=!0,M.implement(o.prototype,a);function n(t){var e=document.createTextNode("");t.appendChild(e);var i=k.createElement("span");t.appendChild(i);var s=k.createElement("span");t.appendChild(s);var l=k.createElement("span");return s.appendChild(l),t}x.Gutter=o}),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],function(R,x,P){var k=R("../range").Range,M=R("../lib/dom"),$=function(){function h(r){this.element=M.createElement("div"),this.element.className="ace_layer ace_marker-layer",r.appendChild(this.element)}return h.prototype.setPadding=function(r){this.$padding=r},h.prototype.setSession=function(r){this.session=r},h.prototype.setMarkers=function(r){this.markers=r},h.prototype.elt=function(r,o){var n=this.i!=-1&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=o,n.className=r},h.prototype.update=function(r){if(r){this.config=r,this.i=0;var o;for(var n in this.markers){var t=this.markers[n];if(!t.range){t.update(o,this,this.session,r);continue}var e=t.range.clipRows(r.firstRow,r.lastRow);if(!e.isEmpty())if(e=e.toScreenRange(this.session),t.renderer){var i=this.$getTop(e.start.row,r),s=this.$padding+e.start.column*r.characterWidth;t.renderer(o,e,s,i,r)}else t.type=="fullLine"?this.drawFullLineMarker(o,e,t.clazz,r):t.type=="screenLine"?this.drawScreenLineMarker(o,e,t.clazz,r):e.isMultiLine()?t.type=="text"?this.drawTextMarker(o,e,t.clazz,r):this.drawMultiLineMarker(o,e,t.clazz,r):this.drawSingleLineMarker(o,e,t.clazz+" ace_start ace_br15",r)}if(this.i!=-1)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},h.prototype.$getTop=function(r,o){return(r-o.firstRowScreen)*o.lineHeight},h.prototype.drawTextMarker=function(r,o,n,t,e){for(var i=this.session,s=o.start.row,l=o.end.row,c=s,m=0,v=0,g=i.getScreenLastRowColumn(c),f=new k(c,o.start.column,c,v);c<=l;c++)f.start.row=f.end.row=c,f.start.column=c==s?o.start.column:i.getRowWrapIndent(c),f.end.column=g,m=v,v=g,g=c+1<l?i.getScreenLastRowColumn(c+1):c==l?0:o.end.column,this.drawSingleLineMarker(r,f,n+(c==s?" ace_start":"")+" ace_br"+a(c==s||c==s+1&&o.start.column,m<v,v>g,c==l),t,c==l?0:1,e)},h.prototype.drawMultiLineMarker=function(r,o,n,t,e){var i=this.$padding,s=t.lineHeight,l=this.$getTop(o.start.row,t),c=i+o.start.column*t.characterWidth;if(e=e||"",this.session.$bidiHandler.isBidiRow(o.start.row)){var m=o.clone();m.end.row=m.start.row,m.end.column=this.session.getLine(m.start.row).length,this.drawBidiSingleLineMarker(r,m,n+" ace_br1 ace_start",t,null,e)}else this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:"+i+"px;top:"+l+"px;left:"+c+"px;"+(e||""));if(this.session.$bidiHandler.isBidiRow(o.end.row)){var m=o.clone();m.start.row=m.end.row,m.start.column=0,this.drawBidiSingleLineMarker(r,m,n+" ace_br12",t,null,e)}else{l=this.$getTop(o.end.row,t);var v=o.end.column*t.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+v+"px;top:"+l+"px;left:"+i+"px;"+(e||""))}if(s=(o.end.row-o.start.row-1)*t.lineHeight,!(s<=0)){l=this.$getTop(o.start.row+1,t);var g=(o.start.column?1:0)|(o.end.column?0:8);this.elt(n+(g?" ace_br"+g:""),"height:"+s+"px;right:"+i+"px;top:"+l+"px;left:"+i+"px;"+(e||""))}},h.prototype.drawSingleLineMarker=function(r,o,n,t,e,i){if(this.session.$bidiHandler.isBidiRow(o.start.row))return this.drawBidiSingleLineMarker(r,o,n,t,e,i);var s=t.lineHeight,l=(o.end.column+(e||0)-o.start.column)*t.characterWidth,c=this.$getTop(o.start.row,t),m=this.$padding+o.start.column*t.characterWidth;this.elt(n,"height:"+s+"px;width:"+l+"px;top:"+c+"px;left:"+m+"px;"+(i||""))},h.prototype.drawBidiSingleLineMarker=function(r,o,n,t,e,i){var s=t.lineHeight,l=this.$getTop(o.start.row,t),c=this.$padding,m=this.session.$bidiHandler.getSelections(o.start.column,o.end.column);m.forEach(function(v){this.elt(n,"height:"+s+"px;width:"+(v.width+(e||0))+"px;top:"+l+"px;left:"+(c+v.left)+"px;"+(i||""))},this)},h.prototype.drawFullLineMarker=function(r,o,n,t,e){var i=this.$getTop(o.start.row,t),s=t.lineHeight;o.start.row!=o.end.row&&(s+=this.$getTop(o.end.row,t)-i),this.elt(n,"height:"+s+"px;top:"+i+"px;left:0;right:0;"+(e||""))},h.prototype.drawScreenLineMarker=function(r,o,n,t,e){var i=this.$getTop(o.start.row,t),s=t.lineHeight;this.elt(n,"height:"+s+"px;top:"+i+"px;left:0;right:0;"+(e||""))},h}();$.prototype.$padding=0;function a(h,r,o,n){return(h?1:0)|(r?2:0)|(o?4:0)|(n?8:0)}x.Marker=$}),ace.define("ace/layer/text_util",["require","exports","module"],function(R,x,P){var k=new Set(["text","rparen","lparen"]);x.isTextToken=function(M){return k.has(M)}}),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config","ace/layer/text_util"],function(R,x,P){var k=R("../lib/oop"),M=R("../lib/dom"),$=R("../lib/lang"),a=R("./lines").Lines,h=R("../lib/event_emitter").EventEmitter,r=R("../config").nls,o=R("./text_util").isTextToken,n=function(){function t(e){this.dom=M,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new a(this.element)}return t.prototype.$updateEolChar=function(){var e=this.session.doc,i=e.getNewLineCharacter()==`
216
216
  `&&e.getNewLineMode()!="windows",s=i?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=s)return this.EOL_CHAR=s,!0},t.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},t.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},t.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},t.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(i){this._signal("changeCharacterSize",i)}.bind(this)),this.$pollSizeChanges()},t.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},t.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},t.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},t.prototype.setShowInvisibles=function(e){return this.showInvisibles==e?!1:(this.showInvisibles=e,typeof e=="string"?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},t.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides==e?!1:(this.displayIndentGuides=e,this.$computeTabString(),!0)},t.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides===e?!1:(this.$highlightIndentGuides=e,e)},t.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var i=this.$tabStrings=[0],s=1;s<e+1;s++)if(this.showTabs){var l=this.dom.createElement("span");l.className="ace_invisible ace_invisible_tab",l.textContent=$.stringRepeat(this.TAB_CHAR,s),i.push(l)}else i.push(this.dom.createTextNode($.stringRepeat(" ",s),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var c="ace_indent-guide",m=this.showSpaces?" ace_invisible ace_invisible_space":"",v=this.showSpaces?$.stringRepeat(this.SPACE_CHAR,this.tabSize):$.stringRepeat(" ",this.tabSize),g=this.showTabs?" ace_invisible ace_invisible_tab":"",f=this.showTabs?$.stringRepeat(this.TAB_CHAR,this.tabSize):v,l=this.dom.createElement("span");l.className=c+m,l.textContent=v,this.$tabStrings[" "]=l;var l=this.dom.createElement("span");l.className=c+g,l.textContent=f,this.$tabStrings[" "]=l}},t.prototype.updateLines=function(e,i,s){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var l=Math.max(i,e.firstRow),c=Math.min(s,e.lastRow),m=this.element.childNodes,v=0,f=e.firstRow;f<l;f++){var b=this.session.getFoldLine(f);if(b)if(b.containsRow(l)){l=b.start.row;break}else f=b.end.row;v++}for(var g=!1,f=l,b=this.session.getNextFoldLine(f),L=b?b.start.row:1/0;f>L&&(f=b.end.row+1,b=this.session.getNextFoldLine(f,b),L=b?b.start.row:1/0),!(f>c);){var A=m[v++];if(A){this.dom.removeChildren(A),this.$renderLine(A,f,f==L?b:!1),g&&(A.style.top=this.$lines.computeLineTop(f,e,this.session)+"px");var C=e.lineHeight*this.session.getRowLength(f)+"px";A.style.height!=C&&(g=!0,A.style.height=C)}f++}if(g)for(;v<this.$lines.cells.length;){var _=this.$lines.cells[v++];_.element.style.top=this.$lines.computeLineTop(_.row,e,this.session)+"px"}},t.prototype.scrollLines=function(e){var i=this.config;if(this.config=e,this.$lines.pageChanged(i,e))return this.update(e);this.$lines.moveContainer(e);var s=e.lastRow,l=i?i.lastRow:-1;if(!i||l<e.firstRow)return this.update(e);if(s<i.firstRow)return this.update(e);if(!i||i.lastRow<e.firstRow)return this.update(e);if(e.lastRow<i.firstRow)return this.update(e);if(i.firstRow<e.firstRow)for(var c=this.session.getFoldedRowCount(i.firstRow,e.firstRow-1);c>0;c--)this.$lines.shift();if(i.lastRow>e.lastRow)for(var c=this.session.getFoldedRowCount(e.lastRow+1,i.lastRow);c>0;c--)this.$lines.pop();e.firstRow<i.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,i.firstRow-1)),e.lastRow>i.lastRow&&this.$lines.push(this.$renderLinesFragment(e,i.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},t.prototype.$renderLinesFragment=function(e,i,s){for(var l=[],c=i,m=this.session.getNextFoldLine(c),v=m?m.start.row:1/0;c>v&&(c=m.end.row+1,m=this.session.getNextFoldLine(c,m),v=m?m.start.row:1/0),!(c>s);){var g=this.$lines.createCell(c,e,this.session),f=g.element;this.dom.removeChildren(f),M.setStyle(f.style,"height",this.$lines.computeLineHeight(c,e,this.session)+"px"),M.setStyle(f.style,"top",this.$lines.computeLineTop(c,e,this.session)+"px"),this.$renderLine(f,c,c==v?m:!1),this.$useLineGroups()?f.className="ace_line_group":f.className="ace_line",l.push(g),c++}return l},t.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var i=e.firstRow,s=e.lastRow,l=this.$lines;l.getLength();)l.pop();l.push(this.$renderLinesFragment(e,i,s))},t.prototype.$renderToken=function(e,i,s,l){for(var c=this,m=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069\u2060\u2061\u2062\u2063\u2064\u206A\u206B\u206B\u206C\u206D\u206E\u206F]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,v=this.dom.createFragment(this.element),g,f=0;g=m.exec(l);){var b=g[1],L=g[2],A=g[3],C=g[4],_=g[5];if(!(!c.showSpaces&&L)){var w=f!=g.index?l.slice(f,g.index):"";if(f=g.index+g[0].length,w&&v.appendChild(this.dom.createTextNode(w,this.element)),b){var y=c.session.getScreenTabSize(i+g.index);v.appendChild(c.$tabStrings[y].cloneNode(!0)),i+=y-1}else if(L)if(c.showSpaces){var d=this.dom.createElement("span");d.className="ace_invisible ace_invisible_space",d.textContent=$.stringRepeat(c.SPACE_CHAR,L.length),v.appendChild(d)}else v.appendChild(this.dom.createTextNode(L,this.element));else if(A){var d=this.dom.createElement("span");d.className="ace_invisible ace_invisible_space ace_invalid",d.textContent=$.stringRepeat(c.SPACE_CHAR,A.length),v.appendChild(d)}else if(C){i+=1;var d=this.dom.createElement("span");d.style.width=c.config.characterWidth*2+"px",d.className=c.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",d.textContent=c.showSpaces?c.SPACE_CHAR:C,v.appendChild(d)}else if(_){i+=1;var d=this.dom.createElement("span");d.style.width=c.config.characterWidth*2+"px",d.className="ace_cjk",d.textContent=_,v.appendChild(d)}}}if(v.appendChild(this.dom.createTextNode(f?l.slice(f):l,this.element)),o(s.type))e.appendChild(v);else{var u="ace_"+s.type.replace(/\./g," ace_"),d=this.dom.createElement("span");s.type=="fold"&&(d.style.width=s.value.length*this.config.characterWidth+"px",d.setAttribute("title",r("inline-fold.closed.title","Unfold code"))),d.className=u,d.appendChild(v),e.appendChild(d)}return i+l.length},t.prototype.renderIndentGuide=function(e,i,s){var l=i.search(this.$indentGuideRe);if(l<=0||l>=s)return i;if(i[0]==" "){l-=l%this.tabSize;for(var c=l/this.tabSize,m=0;m<c;m++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),i.substr(l)}else if(i[0]==" "){for(var m=0;m<l;m++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),i.substr(l)}return this.$highlightIndentGuide(),i},t.prototype.$highlightIndentGuide=function(){if(!(!this.$highlightIndentGuides||!this.displayIndentGuides)){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var i=this.session.selection.getCursor(),s=/^\s*/.exec(this.session.doc.getLine(i.row))[0].length,l=Math.floor(s/this.tabSize);this.$highlightIndentGuideMarker={indentLevel:l,start:i.row};var c=this.session.$bracketHighlight;if(c){for(var m=this.session.$bracketHighlight.ranges,v=0;v<m.length;v++)if(i.row!==m[v].start.row){this.$highlightIndentGuideMarker.end=m[v].start.row+1,i.row>m[v].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}}if(!this.$highlightIndentGuideMarker.end&&e[i.row]!==""&&i.column===e[i.row].length){this.$highlightIndentGuideMarker.dir=1;for(var v=i.row+1;v<e.length;v++){var g=e[v],f=/^\s*/.exec(g)[0].length;if(g!==""&&(this.$highlightIndentGuideMarker.end=v,f<=s))break}}this.$renderHighlightIndentGuide()}}},t.prototype.$clearActiveIndentGuide=function(){for(var e=this.element.querySelectorAll(".ace_indent-guide-active"),i=0;i<e.length;i++)e[i].classList.remove("ace_indent-guide-active")},t.prototype.$setIndentGuideActive=function(e,i){var s=this.session.doc.getLine(e.row);if(s!==""){var l=e.element;if(e.element.classList&&e.element.classList.contains("ace_line_group"))if(e.element.childNodes.length>0)l=e.element.childNodes[0];else return;var c=l.childNodes;if(c){var m=c[i-1];m&&m.classList&&m.classList.contains("ace_indent-guide")&&m.classList.add("ace_indent-guide-active")}}},t.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var i=this.$highlightIndentGuideMarker.indentLevel;if(i!==0)if(this.$highlightIndentGuideMarker.dir===1)for(var s=0;s<e.length;s++){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row>=this.$highlightIndentGuideMarker.start+1){if(l.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,i)}}else for(var s=e.length-1;s>=0;s--){var l=e[s];if(this.$highlightIndentGuideMarker.end&&l.row<this.$highlightIndentGuideMarker.start){if(l.row<this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(l,i)}}}},t.prototype.$createLineElement=function(e){var i=this.dom.createElement("div");return i.className="ace_line",i.style.height=this.config.lineHeight+"px",i},t.prototype.$renderWrappedLine=function(e,i,s){var l=0,c=0,m=s[0],v=0,g=this.$createLineElement();e.appendChild(g);for(var f=0;f<i.length;f++){var b=i[f],L=b.value;if(f==0&&this.displayIndentGuides){if(l=L.length,L=this.renderIndentGuide(g,L,m),!L)continue;l-=L.length}if(l+L.length<m)v=this.$renderToken(g,v,b,L),l+=L.length;else{for(;l+L.length>=m;)v=this.$renderToken(g,v,b,L.substring(0,m-l)),L=L.substring(m-l),l=m,g=this.$createLineElement(),e.appendChild(g),g.appendChild(this.dom.createTextNode($.stringRepeat(" ",s.indent),this.element)),c++,v=0,m=s[c]||Number.MAX_VALUE;L.length!=0&&(l+=L.length,v=this.$renderToken(g,v,b,L))}}s[s.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(g,v,null,"",!0)},t.prototype.$renderSimpleLine=function(e,i){for(var s=0,l=0;l<i.length;l++){var c=i[l],m=c.value;if(!(l==0&&this.displayIndentGuides&&(m=this.renderIndentGuide(e,m),!m))){if(s+m.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,s,c,m);s=this.$renderToken(e,s,c,m)}}},t.prototype.$renderOverflowMessage=function(e,i,s,l,c){s&&this.$renderToken(e,i,s,l.slice(0,this.MAX_LINE_LENGTH-i));var m=this.dom.createElement("span");m.className="ace_inline_button ace_keyword ace_toggle_wrap",m.textContent=c?"<hide>":"<click to see more...>",e.appendChild(m)},t.prototype.$renderLine=function(e,i,s){if(!s&&s!=!1&&(s=this.session.getFoldLine(i)),s)var l=this.$getFoldLineTokens(i,s);else var l=this.session.getTokens(i);var c=e;if(l.length){var m=this.session.getRowSplitData(i);if(m&&m.length){this.$renderWrappedLine(e,l,m);var c=e.lastChild}else{var c=e;this.$useLineGroups()&&(c=this.$createLineElement(),e.appendChild(c)),this.$renderSimpleLine(c,l)}}else this.$useLineGroups()&&(c=this.$createLineElement(),e.appendChild(c));if(this.showEOL&&c){s&&(i=s.end.row);var v=this.dom.createElement("span");v.className="ace_invisible ace_invisible_eol",v.textContent=i==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,c.appendChild(v)}},t.prototype.$getFoldLineTokens=function(e,i){var s=this.session,l=[];function c(v,g,f){for(var b=0,L=0;L+v[b].value.length<g;)if(L+=v[b].value.length,b++,b==v.length)return;if(L!=g){var A=v[b].value.substring(g-L);A.length>f-g&&(A=A.substring(0,f-g)),l.push({type:v[b].type,value:A}),L=g+A.length,b+=1}for(;L<f&&b<v.length;){var A=v[b].value;A.length+L>f?l.push({type:v[b].type,value:A.substring(0,f-L)}):l.push(v[b]),L+=A.length,b+=1}}var m=s.getTokens(e);return i.walk(function(v,g,f,b,L){v!=null?l.push({type:"fold",value:v}):(L&&(m=s.getTokens(g)),m.length&&c(m,b,f))},i.end.row,this.session.getLine(i.end.row).length),l},t.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},t}();n.prototype.EOF_CHAR="¶",n.prototype.EOL_CHAR_LF="¬",n.prototype.EOL_CHAR_CRLF="¤",n.prototype.EOL_CHAR=n.prototype.EOL_CHAR_LF,n.prototype.TAB_CHAR="—",n.prototype.SPACE_CHAR="·",n.prototype.$padding=0,n.prototype.MAX_LINE_LENGTH=1e4,n.prototype.showInvisibles=!1,n.prototype.showSpaces=!1,n.prototype.showTabs=!1,n.prototype.showEOL=!1,n.prototype.displayIndentGuides=!0,n.prototype.$highlightIndentGuides=!0,n.prototype.$tabStrings=[],n.prototype.destroy={},n.prototype.onChangeTabSize=n.prototype.$computeTabString,k.implement(n.prototype,h),x.Text=n}),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],function(R,x,P){var k=R("../lib/dom"),M=function(){function $(a){this.element=k.createElement("div"),this.element.className="ace_layer ace_cursor-layer",a.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),k.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return $.prototype.$updateOpacity=function(a){for(var h=this.cursors,r=h.length;r--;)k.setStyle(h[r].style,"opacity",a?"":"0")},$.prototype.$startCssAnimation=function(){for(var a=this.cursors,h=a.length;h--;)a[h].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&k.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},$.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,k.removeCssClass(this.element,"ace_animate-blinking")},$.prototype.setPadding=function(a){this.$padding=a},$.prototype.setSession=function(a){this.session=a},$.prototype.setBlinking=function(a){a!=this.isBlinking&&(this.isBlinking=a,this.restartTimer())},$.prototype.setBlinkInterval=function(a){a!=this.blinkInterval&&(this.blinkInterval=a,this.restartTimer())},$.prototype.setSmoothBlinking=function(a){a!=this.smoothBlinking&&(this.smoothBlinking=a,k.setCssClass(this.element,"ace_smooth-blinking",a),this.$updateCursors(!0),this.restartTimer())},$.prototype.addCursor=function(){var a=k.createElement("div");return a.className="ace_cursor",this.element.appendChild(a),this.cursors.push(a),a},$.prototype.removeCursor=function(){if(this.cursors.length>1){var a=this.cursors.pop();return a.parentNode.removeChild(a),a}},$.prototype.hideCursor=function(){this.isVisible=!1,k.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.showCursor=function(){this.isVisible=!0,k.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},$.prototype.restartTimer=function(){var a=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,k.removeCssClass(this.element,"ace_smooth-blinking")),a(!0),!this.isBlinking||!this.blinkInterval||!this.isVisible){this.$stopCssAnimation();return}if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&k.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),k.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var h=function(){this.timeoutId=setTimeout(function(){a(!1)},.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval(function(){a(!0),h()},this.blinkInterval),h()}},$.prototype.getPixelPosition=function(a,h){if(!this.config||!this.session)return{left:0,top:0};a||(a=this.session.selection.getCursor());var r=this.session.documentToScreenPosition(a),o=this.$padding+(this.session.$bidiHandler.isBidiRow(r.row,a.row)?this.session.$bidiHandler.getPosLeft(r.column):r.column*this.config.characterWidth),n=(r.row-(h?this.config.firstRowScreen:0))*this.config.lineHeight;return{left:o,top:n}},$.prototype.isCursorInView=function(a,h){return a.top>=0&&a.top<h.maxHeight},$.prototype.update=function(a){this.config=a;var h=this.session.$selectionMarkers,r=0,o=0;(h===void 0||h.length===0)&&(h=[{cursor:null}]);for(var r=0,n=h.length;r<n;r++){var t=this.getPixelPosition(h[r].cursor,!0);if(!((t.top>a.height+a.offset||t.top<0)&&r>1)){var e=this.cursors[o++]||this.addCursor(),i=e.style;this.drawCursor?this.drawCursor(e,t,a,h[r],this.session):this.isCursorInView(t,a)?(k.setStyle(i,"display","block"),k.translate(e,t.left,t.top),k.setStyle(i,"width",Math.round(a.characterWidth)+"px"),k.setStyle(i,"height",a.lineHeight+"px")):k.setStyle(i,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=t,this.restartTimer()},$.prototype.$setOverwrite=function(a){a!=this.overwrite&&(this.overwrite=a,a?k.addCssClass(this.element,"ace_overwrite-cursors"):k.removeCssClass(this.element,"ace_overwrite-cursors"))},$.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},$}();M.prototype.$padding=0,M.prototype.drawCursor=null,x.Cursor=M}),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(R,x,P){var k=this&&this.__extends||function(){var e=function(i,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var m in c)Object.prototype.hasOwnProperty.call(c,m)&&(l[m]=c[m])},e(i,s)};return function(i,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");e(i,s);function l(){this.constructor=i}i.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}}(),M=R("./lib/oop"),$=R("./lib/dom"),a=R("./lib/event"),h=R("./lib/event_emitter").EventEmitter,r=32768,o=function(){function e(i,s){this.element=$.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+s,this.inner=$.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),i.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(i){this.element.style.display=i?"":"none",this.isVisible=i,this.coeff=1},e}();M.implement(o.prototype,h);var n=function(e){k(i,e);function i(s,l){var c=e.call(this,s,"-v")||this;return c.scrollTop=0,c.scrollHeight=0,l.$scrollbarWidth=c.width=$.scrollbarWidth(s.ownerDocument),c.inner.style.width=c.element.style.width=(c.width||15)+5+"px",c.$minWidth=0,c}return i.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,this.coeff!=1){var s=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-s)/(this.coeff-s)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},i.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},i.prototype.setHeight=function(s){this.element.style.height=s+"px"},i.prototype.setScrollHeight=function(s){this.scrollHeight=s,s>r?(this.coeff=r/s,s=r):this.coeff!=1&&(this.coeff=1),this.inner.style.height=s+"px"},i.prototype.setScrollTop=function(s){this.scrollTop!=s&&(this.skipEvent=!0,this.scrollTop=s,this.element.scrollTop=s*this.coeff)},i}(o);n.prototype.setInnerHeight=n.prototype.setScrollHeight;var t=function(e){k(i,e);function i(s,l){var c=e.call(this,s,"-h")||this;return c.scrollLeft=0,c.height=l.$scrollbarWidth,c.inner.style.height=c.element.style.height=(c.height||15)+5+"px",c}return i.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},i.prototype.getHeight=function(){return this.isVisible?this.height:0},i.prototype.setWidth=function(s){this.element.style.width=s+"px"},i.prototype.setInnerWidth=function(s){this.inner.style.width=s+"px"},i.prototype.setScrollWidth=function(s){this.inner.style.width=s+"px"},i.prototype.setScrollLeft=function(s){this.scrollLeft!=s&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=s)},i}(o);x.ScrollBar=n,x.ScrollBarV=n,x.ScrollBarH=t,x.VScrollBar=n,x.HScrollBar=t}),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(R,x,P){var k=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(s[c]=l[c])},t(e,i)};return function(e,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");t(e,i);function s(){this.constructor=e}e.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}}(),M=R("./lib/oop"),$=R("./lib/dom"),a=R("./lib/event"),h=R("./lib/event_emitter").EventEmitter;$.importCssString(`.ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{
217
217
  position: absolute;
218
218
  background: rgba(128, 128, 128, 0.6);