amis.define("8a165f8",function(e,r){"use strict";function t(e,r){return u.Range.create(e.positionAt(r.offset),e.positionAt(r.offset+r.length))}Object.defineProperty(r,"__esModule",{value:!0});var n=e("11ed2ab"),o=n.__importStar(e("8408640")),a=n.__importStar(e("a0f93b8")),i=e("e7af929"),u=e("737c70e"),c=function(){function e(e){this.schemaService=e}return e.prototype.findDocumentSymbols=function(e,r){var n=this,i=r.root;if(!i)return null;var c=e.uri;if(("vscode://defaultsettings/keybindings.json"===c||a.endsWith(c.toLowerCase(),"/user/keybindings.json"))&&"array"===i.type){var s=[];return i.items.forEach(function(r){if("object"===r.type)for(var n=0,a=r.properties;n<a.length;n++){var i=a[n];if("key"===i.keyNode.value&&i.valueNode){if(i.valueNode){var c=u.Location.create(e.uri,t(e,r));s.push({name:o.getNodeValue(i.valueNode),kind:u.SymbolKind.Function,location:c})}return}}}),s}var l=function(r,o,a){return"array"===o.type?o.items.forEach(function(e){return l(r,e,a)}):"object"===o.type&&o.properties.forEach(function(o){var i=u.Location.create(e.uri,t(e,o)),c=o.valueNode;if(c){var s=a?a+"."+o.keyNode.value:o.keyNode.value;r.push({name:n.getKeyLabel(o),kind:n.getSymbolKind(c.type),location:i,containerName:a}),l(r,c,s)}}),r},d=l([],i,void 0);return d},e.prototype.findDocumentSymbols2=function(e,r){var n=this,i=r.root;if(!i)return null;var c=e.uri;if(("vscode://defaultsettings/keybindings.json"===c||a.endsWith(c.toLowerCase(),"/user/keybindings.json"))&&"array"===i.type){var s=[];return i.items.forEach(function(r){if("object"===r.type)for(var n=0,a=r.properties;n<a.length;n++){var i=a[n];if("key"===i.keyNode.value){if(i.valueNode){var c=t(e,r),l=t(e,i.keyNode);s.push({name:o.getNodeValue(i.valueNode),kind:u.SymbolKind.Function,range:c,selectionRange:l})}return}}}),s}var l=function(r,o){return"array"===o.type?o.items.forEach(function(o,a){if(o){var i=t(e,o),u=i,c=String(a),s=l([],o);r.push({name:c,kind:n.getSymbolKind(o.type),range:i,selectionRange:u,children:s})}}):"object"===o.type&&o.properties.forEach(function(o){var a=o.valueNode;if(a){var i=t(e,o),u=t(e,o.keyNode),c=l([],a);r.push({name:n.getKeyLabel(o),kind:n.getSymbolKind(a.type),range:i,selectionRange:u,children:c})}}),r},d=l([],i);return d},e.prototype.getSymbolKind=function(e){switch(e){case"object":return u.SymbolKind.Module;case"string":return u.SymbolKind.String;case"number":return u.SymbolKind.Number;case"array":return u.SymbolKind.Array;case"boolean":return u.SymbolKind.Boolean;default:return u.SymbolKind.Variable}},e.prototype.getKeyLabel=function(e){var r=e.keyNode.value;return r&&(r=r.replace(/[\n]/g,"↵")),r&&r.trim()?r:'"'+r+'"'},e.prototype.findDocumentColors=function(e,r){return this.schemaService.getSchemaForResource(e.uri,r).then(function(n){var a=[];if(n)for(var u=r.getMatchingSchemas(n.schema),c={},s=0,l=u;s<l.length;s++){var d=l[s];if(!d.inverted&&d.schema&&("color"===d.schema.format||"color-hex"===d.schema.format)&&d.node&&"string"===d.node.type){var f=String(d.node.offset);if(!c[f]){var y=i.colorFromHex(o.getNodeValue(d.node));if(y){var p=t(e,d.node);a.push({color:y,range:p})}c[f]=!0}}}return a})},e.prototype.getColorPresentations=function(e,r,t,n){function o(e){var r=e.toString(16);return 2!==r.length?"0"+r:r}var a,i=[],c=Math.round(255*t.red),s=Math.round(255*t.green),l=Math.round(255*t.blue);return a=1===t.alpha?"#"+o(c)+o(s)+o(l):"#"+o(c)+o(s)+o(l)+o(Math.round(255*t.alpha)),i.push({label:a,textEdit:u.TextEdit.replace(n,JSON.stringify(a))}),i},e}();r.JSONDocumentSymbols=c});