1"use strict";(self.webpackChunksketchfab=self.webpackChunksketchfab||[]).push([[8813],{i2hM:(t,e,i)=>{i.d(e,{Z:()=>m});for(var n,o,r=i("Hjnd"),a=i.n(r),l={bold:"**",code:"```",italic:"*",quote:"> ","unordered-list":"* ","ordered-list":"1. "},c=["[","](#url#)"],s=[""],d=/Mac/.test(navigator.platform),g=[].concat([{action:"toggleBold",shortcut:"Cmd-B",title:"Bold",icon:"fa-bold"},{action:"toggleItalic",shortcut:"Cmd-I",title:"Italic",icon:"fa-italic"},{action:"drawLink",shortcut:"Cmd-K",title:"Link",icon:"fa-link"},{action:"toggleHeading",shortcut:"Cmd-H",title:"Heading",icon:"fa-heading"},{action:"drawImage",shortcut:"Cmd-Alt-I",title:"Insert Image",icon:"fa-image"},{action:"toggleBlockquote",shortcut:"Cmd-'",title:"Quote",icon:"fa-quote-left"},{action:"toggleOrderedList",shortcut:"Cmd-Alt-L",title:"Numbered List",icon:"fa-list-ol"},{action:"toggleUnorderedList",shortcut:"Cmd-L",title:"Generic List",icon:"fa-list-ul"}]),h="",u={},f={initializeToolbar:function(t){var e,i=(new DOMParser).parseFromString((e=h,'<div class="editor-toolbar">'+e+"</div>"),"text/html").body.firstChild;return a()(i).on("mousedown","[data-action]",function(t){t.stopImmediatePropagation(),t.preventDefault(),this[t.currentTarget.getAttribute("data-action")]()}.bind(this)),a()(t.container).prepend(i),i},getEditor:function(){return this.__editorInstance},setEditor:function(t){this.__editorInstance=t},getShortcuts:function(){return u},getMarkdownEditorValue:function(){var t=this.getEditor();return t?t.getValue():""},toggleBold:function(){this._toggleBlock("bold",l.bold)},toggleItalic:function(){this._toggleBlock("italic",l.italic)},toggleHeading:function(){this._toggleHeading()},toggleBlockquote:function(){this._toggleLine("quote")},toggleOrderedList:function(){this._toggleLine("ordered-list")},toggleUnorderedList:function(){this._toggleLine("unordered-list")},drawLink:function(){var t=this._getCodemirrorState();this._replaceSelection(t.link,c,"http://")},drawImage:function(){var t=this._getCodemirrorState();this._replaceSelection(t.image,s,"http://")},_getCodemirrorState:function(t){var e=this.getEditor();t=t||e.getCursor("start");var i=e.getTokenAt(t);if(!i.type)return{};for(var n,o,r=i.type.split(" "),a={},l=0;l<r.length;l++)"strong"===(n=r[l])?a.bold=!0:"variable-2"===n?(o=e.getLine(t.line),/^\s*\d+\.\s/.test(o)?a["ordered-list"]=!0:a["unordered-list"]=!0):"atom"===n?a.quote=!0:"em"===n?a.italic=!0:"quote"===n?a.quote=!0:"strikethrough"===n?a.strikethrough=!0:"comment"===n?a.co
1de=!0:"link"===n?a.link=!0:"tag"===n?a.image=!0:n.match(/^header(\-[1-6])?$/)&&(a[n.replace("header","heading")]=!0);return a},_toggleBlock:function(t,e,i){if(!/editor-preview-active/.test(this.getEditor().getWrapperElement().lastChild.className)){i=void 0===i?e:i;var n,o=this.getEditor(),r=this._getCodemirrorState(),a=e,l=i,c=o.getCursor("start"),s=o.getCursor("end");r[t]?(a=(n=o.getLine(c.line)).slice(0,c.ch),l=n.slice(c.ch),"bold"===t?(a=a.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),l=l.replace(/(\*\*|__)/,"")):"italic"===t?(a=a.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),l=l.replace(/(\*|_)/,"")):"strikethrough"===t&&(a=a.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),l=l.replace(/(\*\*|~~)/,"")),o.replaceRange(a+l,{line:c.line,ch:0},{line:c.line,ch:99999999999999}),"bold"===t||"strikethrough"===t?(c.ch-=2,c!==s&&(s.ch-=2)):"italic"===t&&(c.ch-=1,c!==s&&(s.ch-=1))):(n=o.getSelection(),"bold"===t?n=(n=n.split("**").join("")).split("__").join(""):"italic"===t?n=(n=n.split("*").join("")).split("_").join(""):"strikethrough"===t&&(n=n.split("~~").join("")),o.replaceSelection(a+n+l),c.ch+=e.length,s.ch=c.ch+n.length),o.setSelection(c,s),o.focus()}},_toggleHeading:function(){var t=this.getEditor();if(!/editor-preview-active/.test(t.getWrapperElement().lastChild.className)){for(var e=t.getCursor("start"),i=t.getCursor("end"),n=e.line;n<=i.line;n++)!function(e){var i=t.getLine(e),n=i.search(/[^#]/);i=n<=0?"# "+i:6===n?i.substr(7):"#"+i,t.replaceRange(i,{line:e,ch:0},{line:e,ch:99999999999999})}(n);t.focus()}},_toggleLine:function(t){var e=this.getEditor();if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var i=this._getCodemirrorState(),n=e.getCursor("start"),o=e.getCursor("end"),r={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},a=n.line;a<=o.line;a++)!function(n){var o=e.getLine(n);o=i[t]?o.replace(r[t],"$1"):l[t]+o,e.replaceRange(o,{line:n,ch:0},{line:n,ch:99999999999999})}(a);e.focus()}},_replaceSelection:function(t,e,i){var n=this.getEditor();if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){var o,r=e[0],a=e[1],l=n.getCursor("start"),c=n.getCursor("end");i&&(a=a.replace("#url#",i)),t?(r=(o=n.getLine(l.line)).slice(0,l.ch),a=o.slice(l.ch),n.replaceRange(r+a,{line:l.line,ch:0})):(o=n.getSelection(),n.replaceSelection(r+o+a),l.ch+=r.length,l!==c&&(c.ch+=r.length)),n.setSelection(l,c),n.focus()}},_tabAndIndentMarkdownList:function(t){var e=t.listSelections()[0].head;if(!1!==t.getStateAfter(e.line).list)t.execCommand("indentMore");else if(t.options.indentWithTabs)t.execCommand("insertTab");else{var i=Array(t.options.tabSize+1).join(" ");t.replaceSelection(i)}},_shiftTabAndUnindentMarkdownList:function(t){var e=t.listSelections()[0].head;if(!1!==t.getStateAfter(e.line).list)t.execCommand("indentLess");else if(t.options.indentWithTabs)t.execCommand("insertTab");else{var i=Array(t.options.tabSize+1).join(" ");t.replaceSelection(i)}}},p=0;p<g.length;p++)g[p].action&&f[g[p].action]&&(h+='<a title="'+(o=g[p]).title+" ("+o.shortcut+')" data-action="'+o.action+'" tabindex="-1" class="fa-regular '+o.icon+'"></a>',u[(n=g[p].shortcut,d?n.replace("Ctrl","Cmd"):n.replace("Cmd","Ctrl"))]=function(t){return f[t.action]()}.bind(f,g[p]));u.Enter="newlineAndIndentContinueMarkdownList",u.Tab=f._tabAndIndentMarkdownList.bind(f),u["Shift-Tab"]=f._shiftTabAndUnindentMarkdownList.bind(f);const m=f}}]); 2//# sourceMappingURL=8274b12b0eeb1eb8f81799be10c44eb7-v2.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.