1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/codeEditorMatlabRun-CMyr9R4y.js","assets/ctMediaProgressUi-wz6CtyvX.js","assets/create-BNwNidU0.js","assets/defineProperty-DbXIQDXj.js","assets/typeof-QjJsDpFa.js","assets/_commonjsHelpers-BosuxZz1.js","assets/index-BBCD2oyF.js","assets/___vite-browser-external_commonjs-proxy-DRaEfepn.js"])))=>i.map(i=>d[i]); 2import{T as ee,_ as te,e as ne,C as V}from"./app-gOHIPY12.js";import{a as I}from"./ace-CIBRknMz.js";import"./ext-language_tools-wD3CM2Gn.js";import{bindHashStyleCopy as J}from"./hashStyleCopy-B7l2OPhl.js";import"./_commonjsHelpers-BosuxZz1.js";import"./ctFullscreenAd-CL-AA_Ul.js";var oe={exports:{}};(function(c,p){ace.define("ace/ext/searchbox-css",["require","exports","module"],function(a,h,T){T.exports=` 3 4/* ------------------------------------------------------------------------------------------ 5 * Editor Search Form 6 * --------------------------------------------------------------------------------------- */ 7.ace_search { 8 background-color: #ddd; 9 color: #666; 10 border: 1px solid #cbcbcb; 11 border-top: 0 none; 12 overflow: hidden; 13 margin: 0; 14 padding: 4px 6px 0 4px; 15 position: absolute; 16 top: 0; 17 z-index: 99; 18 white-space: normal; 19} 20.ace_search.left { 21 border-left: 0 none; 22 border-radius: 0px 0px 5px 0px; 23 left: 0; 24} 25.ace_search.right { 26 border-radius: 0px 0px 0px 5px; 27 border-right: 0 none; 28 right: 0; 29} 30 31.ace_search_form, .ace_replace_form { 32 margin: 0 20px 4px 0; 33 overflow: hidden; 34 line-height: 1.9; 35} 36.ace_replace_form { 37 margin-right: 0; 38} 39.ace_search_form.ace_nomatch { 40 outline: 1px solid red; 41} 42 43.ace_search_field { 44 border-radius: 3px 0 0 3px; 45 background-color: white; 46 color: black; 47 border: 1px solid #cbcbcb; 48 border-right: 0 none; 49 outline: 0; 50 padding: 0; 51 font-size: inherit; 52 margin: 0; 53 line-height: inherit; 54 padding: 0 6px; 55 min-width: 17em; 56 vertical-align: top; 57 min-height: 1.8em; 58 box-sizing: content-box; 59} 60.ace_searchbtn { 61 border: 1px solid #cbcbcb; 62 line-height: inherit; 63 display: inline-block; 64 padding: 0 6px; 65 background: #fff; 66 border-right: 0 none; 67 border-left: 1px solid #dcdcdc; 68 cursor: pointer; 69 margin: 0; 70 position: relative; 71 color: #666; 72} 73.ace_searchbtn:last-child { 74 border-radius: 0 3px 3px 0; 75 border-right: 1px solid #cbcbcb; 76} 77.ace_searchbtn:disabled { 78 background: none; 79 cursor: default; 80} 81.ace_searchbtn:hover { 82 background-color: #eef1f6; 83} 84.ace_searchbtn.prev, .ace_searchbtn.next { 85 padding: 0px 0.7em 86} 87.ace_searchbtn.prev:after, .ace_searchbtn.next:after { 88 content: ""; 89 border: solid 2px #888; 90 width: 0.5em; 91 height: 0.5em; 92 border-width: 2px 0 0 2px; 93 display:inline-block; 94 transform: rotate(-45deg); 95} 96.ace_searchbtn.next:after { 97 border-width: 0 2px 2px 0 ; 98} 99.ace_searchbtn_close { 100 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; 101 border-radius: 50%; 102 border: 0 none; 103 color: #656565; 104 cursor: pointer; 105 font: 16px/16px Arial; 106 padding: 0; 107 height: 14px; 108 width: 14px; 109 top: 9px; 110 right: 7px; 111 position: absolute; 112} 113.ace_searchbtn_close:hover { 114 background-color: #656565; 115 background-position: 50% 100%; 116 color: white; 117} 118 119.ace_button { 120 margin-left: 2px; 121 cursor: pointer; 122 -webkit-user-select: none; 123 -moz-user-select: none; 124 -o-user-select: none; 125 -ms-user-select: none; 126 user-select: none; 127 overflow: hidden; 128 opacity: 0.7; 129 border: 1px solid rgba(100,100,100,0.23); 130 padding: 1px; 131 box-sizing: border-box!important; 132 color: black; 133} 134 135.ace_button:hover { 136 background-color: #eee; 137 opacity:1; 138} 139.ace_button:active { 140 background-color: #ddd; 141} 142 143.ace_button.checked { 144 border-color: #3399ff; 145 opacity:1; 146} 147 148.ace_search_options{ 149 margin-bottom: 3px; 150 text-align: right; 151 -webkit-user-select: none; 152 -moz-user-select: none; 153 -o-user-select: none;
154 -ms-user-select: none; 155 user-select: none; 156 clear: both; 157} 158 159.ace_search_counter { 160 float: left; 161 font-family: arial; 162 padding: 0 8px; 163}`}),ace.define("ace/ext/searchbox",["require","exports","module","ace/ext/searchbox","ace/ext/searchbox","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/ext/searchbox-css","ace/keyboard/hash_handler","ace/lib/keys","ace/config"],function(a,h,T){var y=a("../lib/dom"),u=a("../lib/lang"),f=a("../lib/event"),k=a("./searchbox-css"),i=a("../keyboard/hash_handler").HashHandler,_=a("../lib/keys"),d=a("../config").nls,M=999;y.importCssString(k,"ace_searchbox",!1);var L=function(){function e(t,o,r){this.activeInput,this.element=y.buildDom(["div",{class:"ace_search right"},["span",{action:"hide",class:"ace_searchbtn_close"}],["div",{class:"ace_search_form"},["input",{class:"ace_search_field",placeholder:d("search-box.find.placeholder","Search for"),spellcheck:"false"}],["span",{action:"findPrev",class:"ace_searchbtn prev"},"â"],["span",{action:"findNext",class:"ace_searchbtn next"},"â"],["span",{action:"findAll",class:"ace_searchbtn",title:"Alt-Enter"},d("search-box.find-all.text","All")]],["div",{class:"ace_replace_form"},["input",{class:"ace_search_field",placeholder:d("search-box.replace.placeholder","Replace with"),spellcheck:"false"}],["span",{action:"replaceAndFindNext",class:"ace_searchbtn"},d("search-box.replace-next.text","Replace")],["span",{action:"replaceAll",class:"ace_searchbtn"},d("search-box.replace-all.text","All")]],["div",{class:"ace_search_options"},["span",{action:"toggleReplace",class:"ace_button",title:d("search-box.toggle-replace.title","Toggle Replace mode"),style:"float:left;margin-top:-2px;padding:0 5px;"},"+"],["span",{class:"ace_search_counter"}],["span",{action:"toggleRegexpMode",class:"ace_button",title:d("search-box.toggle-regexp.title","RegExp Search")},".*"],["span",{action:"toggleCaseSensitive",class:"ace_button",title:d("search-box.toggle-case.title","CaseSensitive Search")},"Aa"],["span",{action:"toggleWholeWords",class:"ace_button",title:d("search-box.toggle-whole-word.title","Whole Word Search")},"\\b"],["span",{action:"searchInSelection",class:"ace_button",title:d("search-box.toggle-in-selection.title","Search In Selection")},"S"]]]),this.setSession=this.setSession.bind(this),this.$onEditorInput=this.onEditorInput.bind(this),this.$init(),this.setEditor(t),y.importCssString(k,"ace_searchbox",t.container),f.addListener(this.element,"touchstart",function(m){m.stopPropagation()},t)}return e.prototype.setEditor=function(t){t.searchBox=this,t.renderer.scroller.appendChild(this.element),this.editor=t},e.prototype.setSession=function(t){this.searchRange=null,this.$syncOptions(!0)},e.prototype.onEditorInput=function(){this.find(!1,!1,!0)},e.prototype.$initElements=function(t){this.searchBox=t.querySelector(".ace_search_form"),this.replaceBox=t.querySelector(".ace_replace_form"),this.searchOption=t.querySelector("[action=searchInSelection]"),this.replaceOption=t.querySelector("[action=toggleReplace]"),this.regExpOption=t.querySelector("[action=toggleRegexpMode]"),this.caseSensitiveOption=t.querySelector("[action=toggleCaseSensitive]"),this.wholeWordOption=t.querySelector("[action=toggleWholeWords]"),this.searchInput=this.searchBox.querySelector(".ace_search_field"),this.replaceInput=this.replaceBox.querySelector(".ace_search_field"),this.searchCounter=t.querySelector(".ace_search_counter")},e.prototype.$init=function(){var t=this.element;this.$initElements(t);var o=this;f.addListener(t,"mousedown",function(r){setTimeout(function(){o.activeInput.focus()},0),f.stopPropagation(r)}),f.addListener(t,"click",function(r){var m=r.target||r.srcElement,l=m.getAttribute("action");l&&o[l]?o[l]():o.$searchBarKb.commands[l]&&o.$searchBarKb.commands[l].exec(o),f.stopPropagation(r)}),f.addCommandKeyListener(t,function(r,m,l){var C=_.keyCodeToString(l),E=o.$searchBarKb.findKeyCommand(m,C);E&&E.exec&&(E.exec(o),f.stopEvent(r))}),this.$onChange=u.delayedCall(function(){o.find(!1,!1)}),f.addListener(this.searchInput,"input",function(){o.$onChange.schedule(20)}),f.addListener(this.searchInput,"focus",function(){o.activeInput=o.searchInput,o.searchInput.value&&o.highlight()}),f.addListener(this.replaceInput,"focus",function(){o.activeInput=o.replaceInput,o.searchInput.value&&o.highlight()})}
163,e.prototype.setSearchRange=function(t){this.searchRange=t,t?this.searchRangeMarker=this.editor.session.addMarker(t,"ace_active-line"):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},e.prototype.$syncOptions=function(t){y.setCssClass(this.replaceOption,"checked",this.searchRange),y.setCssClass(this.searchOption,"checked",this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?"-":"+",y.setCssClass(this.regExpOption,"checked",this.regExpOption.checked),y.setCssClass(this.wholeWordOption,"checked",this.wholeWordOption.checked),y.setCssClass(this.caseSensitiveOption,"checked",this.caseSensitiveOption.checked);var o=this.editor.getReadOnly();this.replaceOption.style.display=o?"none":"",this.replaceBox.style.display=this.replaceOption.checked&&!o?"":"none",this.find(!1,!1,t)},e.prototype.highlight=function(t){this.editor.session.highlight(t||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},e.prototype.find=function(t,o,r){if(this.editor.session){var m=this.editor.find(this.searchInput.value,{skipCurrent:t,backwards:o,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:r,range:this.searchRange}),l=!m&&this.searchInput.value;y.setCssClass(this.searchBox,"ace_nomatch",l),this.editor._emit("findSearchBox",{match:!l}),this.highlight(),this.updateCounter()}},e.prototype.updateCounter=function(){var t=this.editor,o=t.$search.$options.re,r=o.unicode,m=0,l=0;if(o){var C=this.searchRange?t.session.getTextRange(this.searchRange):t.getValue();t.$search.$isMultilineSearch(t.getLastSearchOptions())&&(C=C.replace(/\r\n|\r|\n/g,` 164`),t.session.doc.$autoNewLine=` 165`);var E=t.session.doc.positionToIndex(t.selection.anchor);this.searchRange&&(E-=t.session.doc.positionToIndex(this.searchRange.start));for(var b=o.lastIndex=0,v;(v=o.exec(C))&&(m++,b=v.index,b<=E&&l++,!(m>M||!v[0]&&(o.lastIndex=b+=u.skipEmptyMatch(C,b,r),b>=C.length))););}this.searchCounter.textContent=d("search-box.search-counter","$0 of $1",[l,m>M?M+"+":m])},e.prototype.findNext=function(){this.find(!0,!1)},e.prototype.findPrev=function(){this.find(!0,!0)},e.prototype.findAll=function(){var t=this.editor.findAll(this.searchInput.value,{regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked}),o=!t&&this.searchInput.value;y.setCssClass(this.searchBox,"ace_nomatch",o),this.editor._emit("findSearchBox",{match:!o}),this.highlight(),this.hide()},e.prototype.replace=function(){this.editor.getReadOnly()||this.editor.replace(this.replaceInput.value)},e.prototype.replaceAndFindNext=function(){this.editor.getReadOnly()||(this.editor.replace(this.replaceInput.value),this.findNext())},e.prototype.replaceAll=function(){this.editor.getReadOnly()||this.editor.replaceAll(this.replaceInput.value)},e.prototype.hide=function(){this.active=!1,this.setSearchRange(null),this.editor.off("changeSession",this.setSession),this.editor.off("input",this.$onEditorInput),this.element.style.display="none",this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb),this.editor.focus()},e.prototype.show=function(t,o){this.active=!0,this.editor.on("changeSession",this.setSession),this.editor.on("input",this.$onEditorInput),this.element.style.display="",this.replaceOption.checked=o,this.editor.$search.$options.regExp&&(t=u.escapeRegExp(t)),t!=null&&(this.searchInput.value=t),this.searchInput.focus(),this.searchInput.select(),this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb),this.$syncOptions(!0)},e.prototype.isFocused=function(){var t=document.activeElement;return t==this.searchInput||t==this.replaceInput},e}(),g=new i;g.bindKeys({"Ctrl-f|Command-f":function(e){var t=e.isReplace=!e.isReplace;e.replaceBox.style.display=t?"":"none",e.replaceOption.checked=!1,e.$syncOptions(),e.searchInput.focus()},"Ctrl-H|Command-Option-F":function(e){e.editor.getReadOnly()||(e.replaceOption.checked=!0,e.$syncOptions(),e.replaceInput.focus())}
165,"Ctrl-G|Command-G":function(e){e.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(e){e.findPrev()},esc:function(e){setTimeout(function(){e.hide()})},Return:function(e){e.activeInput==e.replaceInput&&e.replace(),e.findNext()},"Shift-Return":function(e){e.activeInput==e.replaceInput&&e.replace(),e.findPrev()},"Alt-Return":function(e){e.activeInput==e.replaceInput&&e.replaceAll(),e.findAll()},Tab:function(e){(e.activeInput==e.replaceInput?e.searchInput:e.replaceInput).focus()}}),g.addCommands([{name:"toggleRegexpMode",bindKey:{win:"Alt-R|Alt-/",mac:"Ctrl-Alt-R|Ctrl-Alt-/"},exec:function(e){e.regExpOption.checked=!e.regExpOption.checked,e.$syncOptions()}},{name:"toggleCaseSensitive",bindKey:{win:"Alt-C|Alt-I",mac:"Ctrl-Alt-R|Ctrl-Alt-I"},exec:function(e){e.caseSensitiveOption.checked=!e.caseSensitiveOption.checked,e.$syncOptions()}},{name:"toggleWholeWords",bindKey:{win:"Alt-B|Alt-W",mac:"Ctrl-Alt-B|Ctrl-Alt-W"},exec:function(e){e.wholeWordOption.checked=!e.wholeWordOption.checked,e.$syncOptions()}},{name:"toggleReplace",exec:function(e){e.replaceOption.checked=!e.replaceOption.checked,e.$syncOptions()}},{name:"searchInSelection",exec:function(e){e.searchOption.checked=!e.searchRange,e.setSearchRange(e.searchOption.checked&&e.editor.getSelectionRange()),e.$syncOptions()}}]);var S=new i([{bindKey:"Esc",name:"closeSearchBar",exec:function(e){e.searchBox.hide()}}]);L.prototype.$searchBarKb=g,L.prototype.$closeSearchBarKb=S,h.SearchBox=L,h.Search=function(e,t){var o=e.searchBox||new L(e),r=e.session.selection.getRange(),m=r.isMultiLine()?"":e.session.getTextRange(r);o.show(m,t)}}),function(){ace.require(["ace/ext/searchbox"],function(a){c&&(c.exports=a)})}()})(oe);var re={exports:{}};(function(c,p){ace.define("ace/ext/beautify",["require","exports","module","ace/token_iterator"],function(a,h,T){var y=a("../token_iterator").TokenIterator;function u(f,k){return f.type.lastIndexOf(k+".xml")>-1}h.singletonTags=["area","base","br","col","command","embed","hr","html","img","input","keygen","link","meta","param","source","track","wbr"],h.blockTags=["article","aside","blockquote","body","div","dl","fieldset","footer","form","head","header","html","nav","ol","p","script","section","style","table","tbody","tfoot","thead","ul"],h.formatOptions={lineBreaksAfterCommasInCurlyBlock:!0},h.beautify=function(f){for(var k=new y(f,0,0),i=k.getCurrentToken(),_=f.getTabString(),d=h.singletonTags,M=h.blockTags,L=h.formatOptions||{},g,S=!1,e=!1,t=!1,o="",r="",m="",l=0,C=0,E=0,b=0,v=0,W=0,z=0,q,j=0,x=0,n,s=!1,$=!1,w=!1,A=!1,O={0:0},F=[],D=!1,K=function(){g&&g.value&&g.type!=="string.regexp"&&(g.value=g.value.replace(/^\s*/,""))},U=function(){for(var P=o.length-1;!(P==0||o[P]!==" ");)P=P-1;o=o.slice(0,P+1)},R=function(){o=o.trimRight(),S=!1};i!==null;){if(j=k.getCurrentTokenRow(),k.$rowTokens,g=k.stepForward(),typeof i<"u"){if(r=i.value,v=0,w=m==="style"||f.$modeId==="ace/mode/css",u(i,"tag-open")?($=!0,g&&(A=M.indexOf(g.value)!==-1),r==="</"&&(A&&!S&&x<1&&x++,w&&(x=1),v=1,A=!1)):u(i,"tag-close")?$=!1:u(i,"comment.start")?A=!0:u(i,"comment.end")&&(A=!1),!$&&!x&&i.type==="paren.rparen"&&i.value.substr(0,1)==="}"&&x++,j!==q&&(x=j,q&&(x-=q)),x){for(R();x>0;x--)o+=` 166`;S=!0,!u(i,"comment")&&!i.type.match(/^(comment|string)$/)&&(r=r.trimLeft())}if(r){if(i.type==="keyword"&&r.match(/^(if|else|elseif|for|foreach|while|switch)$/)?(F[l]=r,K(),t=!0,r.match(/^(else|elseif)$/)&&o.match(/\}[\s]*$/)&&(R(),e=!0)):i.type==="paren.lparen"?(K(),r.substr(-1)==="{"&&(t=!0,s=!1,$||(x=1)),r.substr(0,1)==="{"&&(e=!0,o.substr(-1)!=="["&&o.trimRight().substr(-1)==="["?(R(),e=!1):o.trimRight().substr(-1)===")"?R():U())):i.type==="paren.rparen"?(v=1,r.substr(0,1)==="}"&&(F[l-1]==="case"&&v++,o.trimRight().substr(-1)==="{"?R():(e=!0,w&&(x+=2))),r.substr(0,1)==="]"&&o.substr(-1)!=="}"&&o.trimRight().substr(-1)==="}"&&(e=!1,b++,R()),r.substr(0,1)===")"&&o.substr(-1)!=="("&&o.trimRight().substr(-1)==="("&&(e=!1,b++,R()),U()):(i.type==="
166keyword.operator"||i.type==="keyword")&&r.match(/^(=|==|===|!=|!==|&&|\|\||and|or|xor|\+=|.=|>|>=|<|<=|=>)$/)?(R(),K(),e=!0,t=!0):i.type==="punctuation.operator"&&r===";"?(R(),K(),t=!0,w&&x++):i.type==="punctuation.operator"&&r.match(/^(:|,)$/)?(R(),K(),r.match(/^(,)$/)&&z>0&&W===0&&L.lineBreaksAfterCommasInCurlyBlock?x++:(t=!0,S=!1)):i.type==="support.php_tag"&&r==="?>"&&!S?(R(),e=!0):u(i,"attribute-name")&&o.substr(-1).match(/^\s$/)?e=!0:u(i,"attribute-equals")?(U(),K()):u(i,"tag-close")?(U(),r==="/>"&&(e=!0)):i.type==="keyword"&&r.match(/^(case|default)$/)&&D&&(v=1),S&&!(i.type.match(/^(comment)$/)&&!r.substr(0,1).match(/^[/#]$/))&&!(i.type.match(/^(string)$/)&&!r.substr(0,1).match(/^['"@]$/))){if(b=E,l>C)for(b++,n=l;n>C;n--)O[n]=b;else l<C&&(b=O[l]);for(C=l,E=b,v&&(b-=v),s&&!W&&(b++,s=!1),n=0;n<b;n++)o+=_}if(i.type==="keyword"&&r.match(/^(case|default)$/)?D===!1&&(F[l]=r,l++,D=!0):i.type==="keyword"&&r.match(/^(break)$/)&&F[l-1]&&F[l-1].match(/^(case|default)$/)&&(l--,D=!1),i.type==="paren.lparen"&&(W+=(r.match(/\(/g)||[]).length,z+=(r.match(/\{/g)||[]).length,l+=r.length),i.type==="keyword"&&r.match(/^(if|else|elseif|for|while)$/)?(s=!0,W=0):!W&&r.trim()&&i.type!=="comment"&&(s=!1),i.type==="paren.rparen")for(W-=(r.match(/\)/g)||[]).length,z-=(r.match(/\}/g)||[]).length,n=0;n<r.length;n++)l--,r.substr(n,1)==="}"&&F[l]==="case"&&l--;i.type=="text"&&(r=r.replace(/\s+$/," ")),e&&!S&&(U(),o.substr(-1)!==` 167`&&(o+=" ")),o+=r,t&&(o+=" "),S=!1,e=!1,t=!1,(u(i,"tag-close")&&(A||M.indexOf(m)!==-1)||u(i,"doctype")&&r===">")&&(A&&g&&g.value==="</"?x=-1:x=1),g&&d.indexOf(g.value)===-1&&(u(i,"tag-open")&&r==="</"?l--:u(i,"tag-open")&&r==="<"?l++:u(i,"tag-close")&&r==="/>"&&l--),u(i,"tag-name")&&(m=r),q=j}}i=g}o=o.trim(),f.doc.setValue(o)},h.commands=[{name:"beautify",description:"Format selection (Beautify)",exec:function(f){h.beautify(f.session)},bindKey:"Ctrl-Shift-B"}]}),function(){ace.require(["ace/ext/beautify"],function(a){c&&(c.exports=a)})}()})(re);const ie=typeof I.version=="string"&&I.version?I.version:"1.43.6",H=`https://cdn.jsdelivr.net/npm/ace-builds@${ie}/src-noconflict`,ae=Object.freeze({golang:"golang",csharp:"csharp",sh:"sh",php_laravel_blade:"php"}),Q="ct-code-editor-theme",X="ct-code-editor-font-size",Z="ct-code-editor-wrap",B=Object.freeze([10,11,12,13,14,15,16,18,20,22,24]),ce=Object.freeze(["monokai","ambiance","chaos","chrome","clouds","cobalt","crimson_editor","dawn","dracula","dreamweaver","eclipse","github","gob","gruvbox","idle_fingers","iplastic","katzenmilch","kr_theme","kuroir","merbivore","merbivore_soft","nord_dark","pastel_on_dark","solarized_dark","solarized_light","sqlserver","terminal","textmate","tomorrow","tomorrow_night","tomorrow_night_blue","tomorrow_night_bright","tomorrow_night_eighties","twilight","vibrant_ink","xcode"]);function se(){try{return window.localStorage.getItem(Q)}catch{return null}}function G(c){return String(c).replace(/_/g," ").replace(/\b\w/g,p=>p.toUpperCase())}function le(c){try{window.localStorage.setItem(Q,c)}catch{}}function he(){try{const c=window.localStorage.getItem(X);if(c==null)return null;const p=Number.parseInt(c,10);return Number.isFinite(p)&&B.includes(p)?p:null}catch{return null}}function de(c){try{window.localStorage.setItem(X,String(c))}catch{}}function pe(){try{const c=window.localStorage.getItem(Z);return c==="1"||c==="true"?!0:c==="0"||c==="false"?!1:null}catch{return null}}function ue(c){try{window.localStorage.setItem(Z,c?"1":"0")}catch{}}function fe(c,p){const a=(c||"").trim();return a||(p.includes("javascript")?"javascript":p[0]||"text")}const Y={javascript:".js",typescript:".ts",markdown:".md",golang:".go",csharp:".cs",objectivec:".m",matlab:".m",ruby:".rb",perl:".pl",python:".py",rust:".rs",kotlin:".kt",powershell:".ps1",handlebars:".hbs",batchfile:".bat",haskell:".hs",protobuf:".proto",yaml:".yaml",jsx:".jsx",tsx:".tsx",plain_text:".txt",text:".txt"};function me(c){const p=String(c||"text");if(Y[p])return{extension:Y[p],mimeType:"text/plain"};const a=p.replace(/_/g,"");return{extension:/^[a-z0-9]{1,5}$/i.test(a)?`.${a.toLowerCase()}`:".txt",mimeType:"text/plain"}}function N(c){const p=document.getElementById("ctCeToastBody"),a=document.getElementById("ctCeToast");!p||!a||(p.textContent=c,ee.getOrCreateInstance(a).show())}function we(){const c=document.getElementById("ct-code-editor-root");
167if(!c)return;be();const p=document.getElementById("ct-code-editor-json");let a={modes:[],themes:[],modeMap:{}};try{a=JSON.parse((p==null?void 0:p.textContent)||"{}")}catch{N("Editor configuration failed to load.")}I.config.set("basePath",H),I.config.set("modePath",H),I.config.set("themePath",H),I.config.set("workerPath",H);try{I.require("ace/ext/language_tools")}catch{}const h=document.getElementById("ctCeEditor"),T=document.getElementById("ctCeTheme"),y=document.getElementById("ctCeFontSize"),u=document.getElementById("ctCeFontDec"),f=document.getElementById("ctCeFontInc"),k=document.getElementById("ctCeWrap"),i=document.getElementById("ctCeFind"),_=document.getElementById("ctCeFormat"),d=document.getElementById("ctCeFileName");!h||!T||!y||!u||!f||!k||!i||!_||!d||requestAnimationFrame(()=>{ge({root:c,host:h,themeSel:T,fontSel:y,fontDec:u,fontInc:f,wrapBtn:k,findBtn:i,formatBtn:_,fileNameInp:d,cfg:a})})}function ge({root:c,host:p,themeSel:a,fontSel:h,fontDec:T,fontInc:y,wrapBtn:u,findBtn:f,formatBtn:k,fileNameInp:i,cfg:_}){var x;const d=I.edit(p),M=he()??14,L=pe()??!1;d.setOptions({fontSize:`${M}px`,showPrintMargin:!1,tabSize:2,useSoftTabs:!0,enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,liveAutocompletionDelay:250,liveAutocompletionThreshold:1,enableSnippets:!0,behavioursEnabled:!0,wrapBehavioursEnabled:!0,highlightActiveLine:!0,showGutter:!0}),d.session.setUseWorker(!1),d.session.setUseWrapMode(L);try{const n=I.require("ace/ext/beautify");n&&Array.isArray(n.commands)&&d.commands.addCommands(n.commands)}catch{}if(h.options.length===0)for(const n of B){const s=document.createElement("option");s.value=String(n),s.textContent=`${n}px`,h.appendChild(s)}h.value=String(M);const g=_.modeMap&&typeof _.modeMap=="object"?_.modeMap:{},S=Array.isArray(_.themes)?_.themes:[],e=S.length>0?[...new Set(S)]:[...ce];e.sort((n,s)=>n.localeCompare(s));let t=Array.isArray(_.modes)?[..._.modes]:[];for(const n of Object.keys(g))t.includes(n)||t.push(n);if(a.options.length===0){a.replaceChildren();for(const n of e){const s=document.createElement("option");s.value=n,s.textContent=G(n),a.appendChild(s)}}const o=(c.getAttribute("data-ct-mode")||"").trim(),r=fe(o,t),m=se(),l=m&&e.includes(m)?m:e.includes("chrome")?"chrome":e[0];a.value=l;function C(n){const s=ae[n]||n;d.session.setMode(`ace/mode/${s}`,$=>{$&&N(`Could not load ${n} syntax highlighting.`)})}function E(n){const s=`ace/theme/${n}`;d.setTheme(s,$=>{if($){N(`Could not load the â${G(n)}â theme. Try another.`);return}const w=c.querySelector(".ct-ce-editor-shell"),A=d.container;if(w&&A){const O=window.getComputedStyle(A).backgroundColor;O&&O!=="rgba(0, 0, 0, 0)"&&O!=="transparent"&&(w.style.backgroundColor=O)}})}function b(){const n=Number.parseInt(h.value,10),s=B.indexOf(n);T.disabled=s<=0,y.disabled=s<0||s>=B.length-1}function v(n){const s=B.includes(n)?n:14;h.value=String(s),d.setFontSize(`${s}px`),de(s),b()}function W(n){d.session.setUseWrapMode(n),u.setAttribute("aria-pressed",n?"true":"false"),u.classList.toggle("active",n),u.title=n?"Word wrap on":"Word wrap off",ue(n)}function z(){try{I.require("ace/ext/searchbox").Search(d)}catch{I.require(["ace/ext/searchbox"],function(n){n.Search(d)})}}C(r),E(a.value),b(),W(L),a.addEventListener("change",()=>{const n=a.value;le(n),E(n)}),h.addEventListener("change",()=>{const n=Number.parseInt(h.value,10);B.includes(n)&&v(n)}),T.addEventListener("click",()=>{const n=Number.parseInt(h.value,10),s=B.indexOf(n);s>0&&v(B[s-1])}),y.addEventListener("click",()=>{const n=Number.parseInt(h.value,10),s=B.indexOf(n);s>=0&&s<B.length-1&&v(B[s+1])}),u.addEventListener("click",()=>{W(!d.session.getUseWrapMode())}),f.addEventListener("click",()=>z()),k.addEventListener("click",()=>{try{I.require("ace/ext/beautify").beautify(d.session)}catch{N("Could not format this content.")}});const q=()=>{const n=d.getValue();return n||(N("Nothing to copy."),"")};(n=>{n instanceof HTMLButtonElement&&J(n,q,s=>N(s))})(document.getElementById("ctCeCopy")),c.getAttribute("data-ct-matlab-runner")==="1"&&(te(()=>import("./codeEditorMatlabRun-CMyr9R4y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(n=>n.initMatlabRunner(d,c)),xe()),(x=document.getElementById("ctCeDl"))==null||x.addEventListener("click",()=>{const n=g[r]||me(r),s=(n.extension||".txt").replace(/^\./,""),$=n.mimeType||"text/plain";let w=i.value.trim();w||(w=`code-snippet.${s}`),w=w.replace(/[/\\]/g,"-").replace(/^\.+/,"")||`code-snippet.${s}`;
167const A=new Blob([d.getValue()],{type:$}),O=document.createElement("a");O.href=URL.createObjectURL(A),O.download=w,O.click(),URL.revokeObjectURL(O.href)})}function be(){document.querySelectorAll("[data-ct-ce-copy-sample]").forEach(c=>{if(!(c instanceof HTMLButtonElement))return;const p=c.closest(".ct-ce-snippet"),a=p==null?void 0:p.querySelector("pre.ct-ce-code-sample code");J(c,()=>(a==null?void 0:a.textContent)||"",h=>N(h))})}function xe(){document.querySelectorAll('[data-ct-ce-sidebar-anchor="1"]').forEach(c=>{c.addEventListener("click",p=>{const a=c.getAttribute("href");if(!(a!=null&&a.startsWith("#")))return;const h=document.querySelector(a);h&&(p.preventDefault(),typeof ne<"u"&&V?V.getOrCreateInstance(h,{toggle:!1}).show():h.classList.add("show"),window.setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"start"})},180))})})}export{we as initCodeEditorPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.