diya-test
Version:
1 lines • 44.1 kB
JavaScript
(()=>{var e={932:(e,t,n)=>{"use strict";const i=n(501),s=n(844),r=n(192);e.exports={XMLParser:s,XMLValidator:i,XMLBuilder:r}},849:(e,t)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+i+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const i=Object.keys(t),s=i.length;for(let r=0;r<s;r++)e[i[r]]="strict"===n?[t[i[r]]]:t[i[r]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==s.exec(e))},t.getAllMatches=function(e,t){const n=[];let i=t.exec(e);for(;i;){const s=[];s.startIndex=t.lastIndex-i[0].length;const r=i.length;for(let e=0;e<r;e++)s.push(i[e]);n.push(s),i=t.exec(e)}return n},t.nameRegexp=i},501:(e,t,n)=>{"use strict";const i=n(849),s={allowBooleanAttributes:!1,unpairedTags:[]};function r(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function o(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const i=e.substr(n,t-n);if(t>5&&"xml"===i)return f("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},s,t);const n=[];let l=!1,c=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let s=0;s<e.length;s++)if("<"===e[s]&&"?"===e[s+1]){if(s+=2,s=o(e,s),s.err)return s}else{if("<"!==e[s]){if(r(e[s]))continue;return f("InvalidChar","char '"+e[s]+"' is not expected.",m(e,s))}{let g=s;if(s++,"!"===e[s]){s=a(e,s);continue}{let y=!1;"/"===e[s]&&(y=!0,s++);let x="";for(;s<e.length&&">"!==e[s]&&" "!==e[s]&&"\t"!==e[s]&&"\n"!==e[s]&&"\r"!==e[s];s++)x+=e[s];if(x=x.trim(),"/"===x[x.length-1]&&(x=x.substring(0,x.length-1),s--),d=x,!i.isName(d)){let t;return t=0===x.trim().length?"Invalid space after '<'.":"Tag '"+x+"' is an invalid name.",f("InvalidTag",t,m(e,s))}const v=u(e,s);if(!1===v)return f("InvalidAttr","Attributes for '"+x+"' have open quote.",m(e,s));let b=v.value;if(s=v.index,"/"===b[b.length-1]){const n=s-b.length;b=b.substring(0,b.length-1);const i=h(b,t);if(!0!==i)return f(i.err.code,i.err.msg,m(e,n+i.err.line));l=!0}else if(y){if(!v.tagClosed)return f("InvalidTag","Closing tag '"+x+"' doesn't have proper closing.",m(e,s));if(b.trim().length>0)return f("InvalidTag","Closing tag '"+x+"' can't have attributes or invalid starting.",m(e,g));{const t=n.pop();if(x!==t.tagName){let n=m(e,t.tagStartPos);return f("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+x+"'.",m(e,g))}0==n.length&&(c=!0)}}else{const i=h(b,t);if(!0!==i)return f(i.err.code,i.err.msg,m(e,s-b.length+i.err.line));if(!0===c)return f("InvalidXml","Multiple possible root nodes found.",m(e,s));-1!==t.unpairedTags.indexOf(x)||n.push({tagName:x,tagStartPos:g}),l=!0}for(s++;s<e.length;s++)if("<"===e[s]){if("!"===e[s+1]){s++,s=a(e,s);continue}if("?"!==e[s+1])break;if(s=o(e,++s),s.err)return s}else if("&"===e[s]){const t=p(e,s);if(-1==t)return f("InvalidChar","char '&' is not expected.",m(e,s));s=t}else if(!0===c&&!r(e[s]))return f("InvalidXml","Extra text at the end",m(e,s));"<"===e[s]&&s--}}}var d;return l?1==n.length?f("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",m(e,n[0].tagStartPos)):!(n.length>0)||f("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):f("InvalidXml","Start tag expected.",1)};const l='"',c="'";function u(e,t){let n="",i="",s=!1;for(;t<e.length;t++){if(e[t]===l||e[t]===c)""===i?i=e[t]:i!==e[t]||(i="");else if(">"===e[t]&&""===i){s=!0;break}n+=e[t]}return""===i&&{value:n,index:t,tagClosed:s}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(e,t){const n=i.getAllMatches(e,d),s={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return f("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",y(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return f("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",y(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return f("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",y(n[e]));const i=n[e][2];if(!g(i))return f("InvalidAttr","Attribute '"+i+"' is an invalid name.",y(n[e]));if(s.hasOwnProperty(i))return f("InvalidAttr","Attribute '"+i+"' is repeated.",y(n[e]));s[i]=1}return!0}function p(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function f(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function g(e){return i.isName(e)}function m(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function y(e){return e.startIndex+e[1].length}},192:(e,t,n)=>{"use strict";const i=n(592),s={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(e){this.options=Object.assign({},s,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=l),this.processTextOrObjNode=o,this.options.format?(this.indentate=a,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function o(e,t,n){const i=this.j2x(e,n+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,n):this.buildObjectNode(i.val,t,i.attrStr,n)}function a(e){return this.options.indentBy.repeat(e)}function l(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}r.prototype.build=function(e){return this.options.preserveOrder?i(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},r.prototype.j2x=function(e,t){let n="",i="";for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(void 0===e[s])this.isAttribute(s)&&(i+="");else if(null===e[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,"",t);else if("object"!=typeof e[s]){const r=this.isAttribute(s);if(r)n+=this.buildAttrPairStr(r,""+e[s]);else if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const n=e[s].length;let r="";for(let o=0;o<n;o++){const n=e[s][o];void 0===n||(null===n?"?"===s[0]?i+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+s+"/"+this.tagEndChar:"object"==typeof n?this.options.oneListGroup?r+=this.j2x(n,t+1).val:r+=this.processTextOrObjNode(n,s,t):r+=this.buildTextValNode(n,s,"",t))}this.options.oneListGroup&&(r=this.buildObjectNode(r,s,"",t)),i+=r}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),i=t.length;for(let r=0;r<i;r++)n+=this.buildAttrPairStr(t[r],""+e[s][t[r]])}else i+=this.processTextOrObjNode(e[s],s,t);return{attrStr:n,val:i}},r.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},r.prototype.buildObjectNode=function(e,t,n,i){if(""===e)return"?"===t[0]?this.indentate(i)+"<"+t+n+"?"+this.tagEndChar:this.indentate(i)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let s="</"+t+this.tagEndChar,r="";return"?"===t[0]&&(r="?",s=""),!n&&""!==n||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(i)+"<"+t+n+r+this.tagEndChar+e+this.indentate(i)+s:this.indentate(i)+"<"+t+n+r+">"+e+s}},r.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},r.prototype.buildTextValNode=function(e,t,n,i){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(i)+"<"+t+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+n+">"+s+"</"+t+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e},e.exports=r},592:e=>{function t(e,o,a,l){let c="",u=!1;for(let d=0;d<e.length;d++){const h=e[d],p=n(h);if(void 0===p)continue;let f="";if(f=0===a.length?p:`${a}.${p}`,p===o.textNodeName){let e=h[p];s(f,o)||(e=o.tagValueProcessor(p,e),e=r(e,o)),u&&(c+=l),c+=e,u=!1;continue}if(p===o.cdataPropName){u&&(c+=l),c+=`<![CDATA[${h[p][0][o.textNodeName]}]]>`,u=!1;continue}if(p===o.commentPropName){c+=l+`\x3c!--${h[p][0][o.textNodeName]}--\x3e`,u=!0;continue}if("?"===p[0]){const e=i(h[":@"],o),t="?xml"===p?"":l;let n=h[p][0][o.textNodeName];n=0!==n.length?" "+n:"",c+=t+`<${p}${n}${e}?>`,u=!0;continue}let g=l;""!==g&&(g+=o.indentBy);const m=l+`<${p}${i(h[":@"],o)}`,y=t(h[p],o,f,g);-1!==o.unpairedTags.indexOf(p)?o.suppressUnpairedNode?c+=m+">":c+=m+"/>":y&&0!==y.length||!o.suppressEmptyNode?y&&y.endsWith(">")?c+=m+`>${y}${l}</${p}>`:(c+=m+">",y&&""!==l&&(y.includes("/>")||y.includes("</"))?c+=l+o.indentBy+y+l:c+=y,c+=`</${p}>`):c+=m+"/>",u=!0}return c}function n(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const i=t[n];if(e.hasOwnProperty(i)&&":@"!==i)return i}}function i(e,t){let n="";if(e&&!t.ignoreAttributes)for(let i in e){if(!e.hasOwnProperty(i))continue;let s=t.attributeValueProcessor(i,e[i]);s=r(s,t),!0===s&&t.suppressBooleanAttributes?n+=` ${i.substr(t.attributeNamePrefix.length)}`:n+=` ${i.substr(t.attributeNamePrefix.length)}="${s}"`}return n}function s(e,t){let n=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let i in t.stopNodes)if(t.stopNodes[i]===e||t.stopNodes[i]==="*."+n)return!0;return!1}function r(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const i=t.entities[n];e=e.replace(i.regex,i.val)}return e}e.exports=function(e,n){let i="";return n.format&&n.indentBy.length>0&&(i="\n"),t(e,n,"",i)}},780:(e,t,n)=>{const i=n(849);function s(e,t){let n="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)n+=e[t];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=e[t++];let s="";for(;t<e.length&&e[t]!==i;t++)s+=e[t];return[n,s,t]}function r(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function o(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function a(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function l(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function c(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function u(e){if(i.isName(e))return e;throw new Error(`Invalid entity name ${e}`)}e.exports=function(e,t){const n={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let i=1,d=!1,h=!1,p="";for(;t<e.length;t++)if("<"!==e[t]||h)if(">"===e[t]){if(h?"-"===e[t-1]&&"-"===e[t-2]&&(h=!1,i--):i--,0===i)break}else"["===e[t]?d=!0:p+=e[t];else{if(d&&o(e,t))t+=7,[entityName,val,t]=s(e,t+1),-1===val.indexOf("&")&&(n[u(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(d&&a(e,t))t+=8;else if(d&&l(e,t))t+=8;else if(d&&c(e,t))t+=9;else{if(!r)throw new Error("Invalid DOCTYPE");h=!0}i++,p=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:t}}},745:(e,t)=>{const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e}};t.buildOptions=function(e){return Object.assign({},n,e)},t.defaultOptions=n},78:(e,t,n)=>{"use strict";const i=n(849),s=n(311),r=n(780),o=n(153);function a(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const i=t[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:e[i]}}}function l(e,t,n,i,s,r,o){if(void 0!==e&&(this.options.trimValues&&!i&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));const i=this.options.tagValueProcessor(t,e,n,s,r);return null==i?e:typeof i!=typeof e||i!==e?i:this.options.trimValues||e.trim()===e?b(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function c(e){if(this.options.removeNSPrefix){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,i.nameRegexp);const u=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function d(e,t,n){if(!this.options.ignoreAttributes&&"string"==typeof e){const n=i.getAllMatches(e,u),s=n.length,r={};for(let e=0;e<s;e++){const i=this.resolveNameSpace(n[e][1]);let s=n[e][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const e=this.options.attributeValueProcessor(i,s,t);r[o]=null==e?s:typeof e!=typeof s||e!==s?e:b(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=r,e}return r}}const h=function(e){e=e.replace(/\r\n?/g,"\n");const t=new s("!xml");let n=t,i="",o="";for(let a=0;a<e.length;a++)if("<"===e[a])if("/"===e[a+1]){const t=y(e,">",a,"Closing Tag is not closed.");let s=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=s.indexOf(":");-1!==e&&(s=s.substr(e+1))}this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&(i=this.saveTextToParentTag(i,n,o));const r=o.substring(o.lastIndexOf(".")+1);if(s&&-1!==this.options.unpairedTags.indexOf(s))throw new Error(`Unpaired tag can not be used as closing tag: </${s}>`);let l=0;r&&-1!==this.options.unpairedTags.indexOf(r)?(l=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=o.lastIndexOf("."),o=o.substring(0,l),n=this.tagsNodeStack.pop(),i="",a=t}else if("?"===e[a+1]){let t=x(e,a,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,o),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new s(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,o,t.tagName)),this.addChild(n,e,o)}a=t.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=y(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const s=e.substring(a+4,t-2);i=this.saveTextToParentTag(i,n,o),n.add(this.options.commentPropName,[{[this.options.textNodeName]:s}])}a=t}else if("!D"===e.substr(a+1,2)){const t=r(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=y(e,"]]>",a,"CDATA is not closed.")-2,s=e.substring(a+9,t);if(i=this.saveTextToParentTag(i,n,o),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:s}]);else{let e=this.parseTextData(s,n.tagname,o,!0,!1,!0);null==e&&(e=""),n.add(this.options.textNodeName,e)}a=t+2}else{let r=x(e,a,this.options.removeNSPrefix),l=r.tagName;const c=r.rawTagName;let u=r.tagExp,d=r.attrExpPresent,h=r.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,o,!1));const p=n;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(n=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),l!==t.tagname&&(o+=o?"."+l:l),this.isItStopNode(this.options.stopNodes,o,l)){let t="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)a=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))a=r.closeIndex;else{const n=this.readStopNodeData(e,c,h+1);if(!n)throw new Error(`Unexpected end of ${c}`);a=n.i,t=n.tagContent}const i=new s(l);l!==u&&d&&(i[":@"]=this.buildAttributesMap(u,o,l)),t&&(t=this.parseTextData(t,l,o,!0,d,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),i.add(this.options.textNodeName,t),this.addChild(n,i,o)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),o=o.substr(0,o.length-1),u=l):u=u.substr(0,u.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const e=new s(l);l!==u&&d&&(e[":@"]=this.buildAttributesMap(u,o,l)),this.addChild(n,e,o),o=o.substr(0,o.lastIndexOf("."))}else{const e=new s(l);this.tagsNodeStack.push(n),l!==u&&d&&(e[":@"]=this.buildAttributesMap(u,o,l)),this.addChild(n,e,o),n=e}i="",a=h}}else i+=e[a];return t.child};function p(e,t,n){const i=this.options.updateTag(t.tagname,n,t[":@"]);!1===i||("string"==typeof i?(t.tagname=i,e.addChild(t)):e.addChild(t))}const f=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function g(e,t,n,i){return e&&(void 0===i&&(i=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,n,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,i))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function m(e,t,n){const i="*."+n;for(const n in e){const s=e[n];if(i===s||t===s)return!0}return!1}function y(e,t,n,i){const s=e.indexOf(t,n);if(-1===s)throw new Error(i);return s+t.length-1}function x(e,t,n,i=">"){const s=function(e,t,n=">"){let i,s="";for(let r=t;r<e.length;r++){let t=e[r];if(i)t===i&&(i="");else if('"'===t||"'"===t)i=t;else if(t===n[0]){if(!n[1])return{data:s,index:r};if(e[r+1]===n[1])return{data:s,index:r}}else"\t"===t&&(t=" ");s+=t}}(e,t+1,i);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,c=!0;-1!==a&&(l=r.substr(0,a).replace(/\s\s*$/,""),r=r.substr(a+1));const u=l;if(n){const e=l.indexOf(":");-1!==e&&(l=l.substr(e+1),c=l!==s.data.substr(e+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:c,rawTagName:u}}function v(e,t,n){const i=n;let s=1;for(;n<e.length;n++)if("<"===e[n])if("/"===e[n+1]){const r=y(e,">",n,`${t} is not closed`);if(e.substring(n+2,r).trim()===t&&(s--,0===s))return{tagContent:e.substring(i,n),i:r};n=r}else if("?"===e[n+1])n=y(e,"?>",n+1,"StopNode is not closed.");else if("!--"===e.substr(n+1,3))n=y(e,"--\x3e",n+3,"StopNode is not closed.");else if("!["===e.substr(n+1,2))n=y(e,"]]>",n,"StopNode is not closed.")-2;else{const i=x(e,n,">");i&&((i&&i.tagName)===t&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex)}}function b(e,t,n){if(t&&"string"==typeof e){const t=e.trim();return"true"===t||"false"!==t&&o(e,n)}return i.isExist(e)?e:""}e.exports=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=a,this.parseXml=h,this.parseTextData=l,this.resolveNameSpace=c,this.buildAttributesMap=d,this.isItStopNode=m,this.replaceEntitiesValue=f,this.readStopNodeData=v,this.saveTextToParentTag=g,this.addChild=p}}},844:(e,t,n)=>{const{buildOptions:i}=n(745),s=n(78),{prettify:r}=n(997),o=n(501);e.exports=class{constructor(e){this.externalEntities={},this.options=i(e)}parse(e,t){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const n=o.validate(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new s(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(e);return this.options.preserveOrder||void 0===i?i:r(i,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}},997:(e,t)=>{"use strict";function n(e,t,o){let a;const l={};for(let c=0;c<e.length;c++){const u=e[c],d=i(u);let h="";if(h=void 0===o?d:o+"."+d,d===t.textNodeName)void 0===a?a=u[d]:a+=""+u[d];else{if(void 0===d)continue;if(u[d]){let e=n(u[d],t,h);const i=r(e,t);u[":@"]?s(e,u[":@"],h,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==l[d]&&l.hasOwnProperty(d)?(Array.isArray(l[d])||(l[d]=[l[d]]),l[d].push(e)):t.isArray(d,h,i)?l[d]=[e]:l[d]=e}}}return"string"==typeof a?a.length>0&&(l[t.textNodeName]=a):void 0!==a&&(l[t.textNodeName]=a),l}function i(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function s(e,t,n,i){if(t){const s=Object.keys(t),r=s.length;for(let o=0;o<r;o++){const r=s[o];i.isArray(r,n+"."+r,!0,!0)?e[r]=[t[r]]:e[r]=t[r]}}}function r(e,t){const{textNodeName:n}=t,i=Object.keys(e).length;return 0===i||!(1!==i||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}t.prettify=function(e,t){return n(e,t)}},311:e=>{"use strict";e.exports=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}},470:(e,t,n)=>{"use strict";var i=n(155);function s(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var n,i="",s=0,r=-1,o=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(r===a-1||1===o);else if(r!==a-1&&2===o){if(i.length<2||2!==s||46!==i.charCodeAt(i.length-1)||46!==i.charCodeAt(i.length-2))if(i.length>2){var l=i.lastIndexOf("/");if(l!==i.length-1){-1===l?(i="",s=0):s=(i=i.slice(0,l)).length-1-i.lastIndexOf("/"),r=a,o=0;continue}}else if(2===i.length||1===i.length){i="",s=0,r=a,o=0;continue}t&&(i.length>0?i+="/..":i="..",s=2)}else i.length>0?i+="/"+e.slice(r+1,a):i=e.slice(r+1,a),s=a-r-1;r=a,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var o={resolve:function(){for(var e,t="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a;o>=0?a=arguments[o]:(void 0===e&&(e=i.cwd()),a=e),s(a),0!==a.length&&(t=a+"/"+t,n=47===a.charCodeAt(0))}return t=r(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(s(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return s(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];s(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":o.normalize(e)},relative:function(e,t){if(s(e),s(t),e===t)return"";if((e=o.resolve(e))===(t=o.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var i=e.length,r=i-n,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var l=t.length-a,c=r<l?r:l,u=-1,d=0;d<=c;++d){if(d===c){if(l>c){if(47===t.charCodeAt(a+d))return t.slice(a+d+1);if(0===d)return t.slice(a+d)}else r>c&&(47===e.charCodeAt(n+d)?u=d:0===d&&(u=0));break}var h=e.charCodeAt(n+d);if(h!==t.charCodeAt(a+d))break;47===h&&(u=d)}var p="";for(d=n+u+1;d<=i;++d)d!==i&&47!==e.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+t.slice(a+u):(a+=u,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(s(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,i=-1,r=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!r){i=o;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');s(e);var n,i=0,r=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,l=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!o){i=n+1;break}}else-1===l&&(o=!1,l=n+1),a>=0&&(c===t.charCodeAt(a)?-1==--a&&(r=n):(a=-1,r=l))}return i===r?r=l:-1===r&&(r=e.length),e.slice(i,r)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else-1===r&&(o=!1,r=n+1);return-1===r?"":e.slice(i,r)},extname:function(e){s(e);for(var t=-1,n=0,i=-1,r=!0,o=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(r=!1,i=a+1),46===l?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!r){n=a+1;break}}return-1===t||-1===i||0===o||1===o&&t===i-1&&t===n+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+"/"+i:i}(0,e)},parse:function(e){s(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,i=e.charCodeAt(0),r=47===i;r?(t.root="/",n=1):n=0;for(var o=-1,a=0,l=-1,c=!0,u=e.length-1,d=0;u>=n;--u)if(47!==(i=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===i?-1===o?o=u:1!==d&&(d=1):-1!==o&&(d=-1);else if(!c){a=u+1;break}return-1===o||-1===l||0===d||1===d&&o===l-1&&o===a+1?-1!==l&&(t.base=t.name=0===a&&r?e.slice(1,l):e.slice(a,l)):(0===a&&r?(t.name=e.slice(1,o),t.base=e.slice(1,l)):(t.name=e.slice(a,o),t.base=e.slice(a,l)),t.ext=e.slice(o,l)),a>0?t.dir=e.slice(0,a-1):r&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,e.exports=o},155:e=>{var t,n,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{n="function"==typeof clearTimeout?clearTimeout:r}catch(e){n=r}}();var a,l=[],c=!1,u=-1;function d(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===r||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||c||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=f,i.addListener=f,i.once=f,i.off=f,i.removeListener=f,i.removeAllListeners=f,i.emit=f,i.prependListener=f,i.prependOnceListener=f,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},153:e=>{const t=/^[-+]?0x[a-fA-F0-9]+$/,n=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e,s={}){if(s=Object.assign({},i,s),!e||"string"!=typeof e)return e;let r=e.trim();if(void 0!==s.skipLike&&s.skipLike.test(r))return e;if(s.hex&&t.test(r))return Number.parseInt(r,16);{const t=n.exec(r);if(t){const n=t[1],i=t[2];let a=(o=t[3])&&-1!==o.indexOf(".")?("."===(o=o.replace(/0+$/,""))?o="0":"."===o[0]?o="0"+o:"."===o[o.length-1]&&(o=o.substr(0,o.length-1)),o):o;const l=t[4]||t[6];if(!s.leadingZeros&&i.length>0&&n&&"."!==r[2])return e;if(!s.leadingZeros&&i.length>0&&!n&&"."!==r[1])return e;{const t=Number(r),o=""+t;return-1!==o.search(/[eE]/)||l?s.eNotation?t:e:-1!==r.indexOf(".")?"0"===o&&""===a||o===a||n&&o==="-"+a?t:e:i?a===o||n+a===o?t:e:r===o||r===n+o?t:e}}return e}var o}},94:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeybindingsJsonGenerator=void 0,t.KeybindingsJsonGenerator=class{static gene(e){return JSON.stringify(e,void 0,4)}}},642:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImporterTypePickerList=t.DEFAULT=t.XML_FILE=void 0,t.XML_FILE={label:"Import from XML file",detail:"Import key maps (schemas) from IntelliJ settings."},t.DEFAULT={label:"Use Default"},t.ImporterTypePickerList=[t.XML_FILE,t.DEFAULT]},521:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OSPickerList=t.WINDOWS_TO_WINDOWS=t.WINDOWS_TO_MAC=t.WINDOWS_TO_LINUX=t.MAC_TO_WINDOWS=t.MAC_TO_MAC=t.MAC_TO_LINUX=t.LINUX_TO_WINDOWS=t.LINUX_TO_MAC=t.LINUX_TO_LINUX=void 0,t.LINUX_TO_LINUX={label:"Linux to Linux"},t.LINUX_TO_MAC={label:"Linux to Mac"},t.LINUX_TO_WINDOWS={label:"Linux to Windows"},t.MAC_TO_LINUX={label:"Mac to Linux"},t.MAC_TO_MAC={label:"Mac to Mac"},t.MAC_TO_WINDOWS={label:"Mac to Windows"},t.WINDOWS_TO_LINUX={label:"Windows to Linux"},t.WINDOWS_TO_MAC={label:"Windows to Mac"},t.WINDOWS_TO_WINDOWS={label:"Windows to Windows"},t.OSPickerList=[t.LINUX_TO_LINUX,t.LINUX_TO_MAC,t.LINUX_TO_WINDOWS,t.MAC_TO_LINUX,t.MAC_TO_MAC,t.MAC_TO_WINDOWS,t.WINDOWS_TO_LINUX,t.WINDOWS_TO_MAC,t.WINDOWS_TO_WINDOWS]},288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelliJKeymapXML=void 0,t.IntelliJKeymapXML=class{static INTELLIJ_KEY_DELIMITTER=/ /g;static INTELLIJ_META_KEY=/meta/g;actionId;first;second;constructor(e,t,n){this.actionId=e,this.first=t,this.second=n}}},652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionIdCommandMapping=void 0,t.ActionIdCommandMapping=class{intellij;vscode;constructor(e,t){this.intellij=e,this.vscode=t}}},84:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeystrokeKeyMapping=void 0,t.KeystrokeKeyMapping=class{intellij;vscode;constructor(e,t){this.intellij=new RegExp(`\\b${e}\\b`,"g"),this.vscode=t}}},7:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeKeyAbstract=void 0;class n{static VSCODE_SECOND_DELIMITER=" ";keystrokeKeyMappings;key;constructor(e,t){this.keystrokeKeyMappings=t,this.key=this.convert(e.first),e.second&&(this.key+=n.VSCODE_SECOND_DELIMITER+this.convert(e.second))}convert(e){for(const t of this.keystrokeKeyMappings)e=e.replace(t.intellij,t.vscode);return e}}t.VSCodeKeyAbstract=n},404:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeKeyLinux=void 0;const i=n(7);class s extends i.VSCodeKeyAbstract{}t.VSCodeKeyLinux=s},962:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeKeyMac=void 0;const i=n(288),s=n(7);class r extends s.VSCodeKeyAbstract{static VSCODE_META="cmd";convert(e){return super.convert(e).replace(i.IntelliJKeymapXML.INTELLIJ_META_KEY,r.VSCODE_META)}}t.VSCodeKeyMac=r},878:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeKeyWindows=void 0;const i=n(288),s=n(7);class r extends s.VSCodeKeyAbstract{static VSCODE_META="win";convert(e){return super.convert(e).replace(i.IntelliJKeymapXML.INTELLIJ_META_KEY,r.VSCODE_META)}}t.VSCodeKeyWindows=r},827:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeKeybindingDefault=void 0,t.VSCodeKeybindingDefault=class{command;key;when;constructor(e,t,n){this.command=e,this.key=t,this.when=n}}},545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ActionIdCommandMappingJsonParser=void 0;const i=n(652);t.ActionIdCommandMappingJsonParser=class{static desirialize(e){if(!e)return[];const t=new Array,n=JSON.parse(e);for(let e=0;e<n.length;e++){const s=n[e],r=new i.ActionIdCommandMapping(s.intellij,s.vscode);t.push(r)}return t}}},371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelliJXMLParser=void 0;const i=n(932),s=n(288);class r{static ALWAYS_ARRAY=["keymap.action","keymap.action.keyboard-shortcut"];static parseToJson(e){if(!e)return;const t={ignoreDeclaration:!0,ignoreAttributes:!1,parseAttributeValue:!0,isArray:(e,t,n,i)=>r.ALWAYS_ARRAY.includes(t)},n=new i.XMLParser(t);try{return n.parse(e,t)}catch(e){throw Error("Cannot load this IntelliJ IDEA Keymap file. Plesase check the file format.")}}static desirialize(e){if(!e||!e.keymap)return[];const t=new Array,n=e.keymap.action;for(const e in n){const i=n[e]["@_id"],r=n[e]["keyboard-shortcut"];r instanceof Array&&r.forEach((e=>{const n=e["@_first-keystroke"],r=e["@_second-keystroke"],o=new s.IntelliJKeymapXML(i,n,r);t.push(o)}))}return t}}t.IntelliJXMLParser=r},537:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeystrokeKeyMappingJsonParser=void 0;const i=n(84);t.KeystrokeKeyMappingJsonParser=class{static desirialize(e){if(!e)return[];const t=new Array,n=JSON.parse(e);for(let e=0;e<n.length;e++){const s=n[e],r=new i.KeystrokeKeyMapping(s.intellij,s.vscode);t.push(r)}return t}}},863:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VSCodeJsonParser=void 0;const i=n(827);t.VSCodeJsonParser=class{static desirialize(e){if(!e)return[];const t=new Array;return JSON.parse(e).map((e=>{const n=new i.VSCodeKeybindingDefault(e.command,e.key,e.when);t.push(n)})),t}}},236:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileOpenDialog=void 0;const i=n(496),s=n(923);t.FileOpenDialog=class{static async showXml(){const e=await i.window.showOpenDialog({canSelectFiles:!0,filters:{XML:["xml"]}});if(e&&e[0])return s.FileReader.read(e[0])}}},923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileReader=void 0;const i=n(496);t.FileReader=class{static async read(e){const t=await i.workspace.fs.readFile(e);return Buffer.from(t).toString("utf8")}}},446:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileReaderDefault=void 0;const i=n(470),s=n(496),r=n(923);class o{static RESOURCE_PATH="resource";static DEFAULT_PATH=i.posix.join(o.RESOURCE_PATH,"default");static async readIntelliJ(e,t){const n=s.Uri.file(t.asAbsolutePath(i.posix.join(this.DEFAULT_PATH,e,"IntelliJ.xml")));return r.FileReader.read(n)}static async readVSCode(e,t){const n=s.Uri.file(t.asAbsolutePath(i.posix.join(this.DEFAULT_PATH,e,"VSCode.json")));return r.FileReader.read(n)}static async readActionIdCommandMapping(e){const t=s.Uri.file(e.asAbsolutePath(i.posix.join(this.RESOURCE_PATH,"ActionIdCommandMapping.json")));return r.FileReader.read(t)}static async readKeystrokeKeyMapping(e){const t=s.Uri.file(e.asAbsolutePath(i.posix.join(this.RESOURCE_PATH,"KeystrokeKeyMapping.json")));return r.FileReader.read(t)}}t.FileReaderDefault=o},777:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Picker=void 0;const i=n(496),s=n(642),r=n(521);t.Picker=class{static async pickImporterType(){switch(await i.window.showQuickPick(s.ImporterTypePickerList,{placeHolder:"Which OS do you want to convert for?",ignoreFocusOut:!0})){case s.XML_FILE:return"XmlFile";case s.DEFAULT:return"Default";case void 0:return}}static async pickOSDestionation(){switch(await i.window.showQuickPick(r.OSPickerList,{placeHolder:"Which OS do you want to convert for?",ignoreFocusOut:!0})){case r.LINUX_TO_LINUX:return{src:"Linux",dst:"Linux"};case r.LINUX_TO_MAC:return{src:"Linux",dst:"Mac"};case r.LINUX_TO_WINDOWS:return{src:"Linux",dst:"Windows"};case r.MAC_TO_LINUX:return{src:"Mac",dst:"Linux"};case r.MAC_TO_MAC:return{src:"Mac",dst:"Mac"};case r.MAC_TO_WINDOWS:return{src:"Mac",dst:"Windows"};case r.WINDOWS_TO_LINUX:return{src:"Windows",dst:"Linux"};case r.WINDOWS_TO_MAC:return{src:"Windows",dst:"Mac"};case r.WINDOWS_TO_WINDOWS:return{src:"Windows",dst:"Windows"};case void 0:return}}}},59:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntelliJSyntaxAnalyzer=void 0;const i=n(827),s=n(404),r=n(962),o=n(878);class a{static REMOVE_KEYBINDING="-";osDestination;actionIdCommandMappings;keystrokeKeyMappings;vscodeDefaults;intellijDefaults;intellijCustoms;constructor(e,t,n,i,s,r){this.osDestination=e,this.actionIdCommandMappings=a.groupBy(t,(e=>e.intellij)),this.keystrokeKeyMappings=n,this.vscodeDefaults=a.groupBy(i,(e=>e.command)),this.intellijDefaults=s,this.intellijCustoms=a.groupBy(r,(e=>e.actionId))}convert(){let e=[];const t=this.action(e,this.addCustomIntelliJ);e=e.concat(t);const n=this.action(e,void 0,this.addDefaultIntelliJ);e=e.concat(n);const i=this.action(e,this.removeDefaultVSCode,this.removeDefaultVSCode);e=e.concat(i);const s=this.action(e,this.removeDefaultIntelliJ,this.removeDefaultIntelliJ);return e=e.concat(s),e}action(e,t,n=void 0){const i=[];for(const s of this.intellijDefaults)if(this.actionIdCommandMappings[s.actionId])for(const r of this.actionIdCommandMappings[s.actionId]){const o=r.intellij,a=r.vscode;if(this.vscodeDefaults[a])for(const r of this.vscodeDefaults[a])if(this.intellijCustoms[o]){if(t)for(const n of this.intellijCustoms[o]){const o=t(i.concat(e),r,s,n);o&&i.push(o)}}else if(n){const t=n(i.concat(e),r,s,void 0);t&&i.push(t)}}return i}addCustomIntelliJ=(e,t,n,s)=>{const r=this.convertToKey(s).key,o=t.when,a=t.command;return e.some((e=>e.key===r&&e.command===a&&e.when===o))?void 0:new i.VSCodeKeybindingDefault(a,r,o)};addDefaultIntelliJ=(e,t,n)=>{const s=this.convertToKey(n).key,r=t.when,o=t.command;return e.some((e=>e.key===s&&e.command===o&&e.when===r))?void 0:new i.VSCodeKeybindingDefault(o,s,r)};removeDefaultVSCode=(e,t,n,s=void 0)=>{const r=t.key,o=t.command;if(e.some((e=>e.key===r&&e.command.endsWith(o))))return;const l=`${a.REMOVE_KEYBINDING}${o}`;return new i.VSCodeKeybindingDefault(l,r)};removeDefaultIntelliJ=(e,t,n,s=void 0)=>{const r=this.convertToKey(n).key,o=t.command;if(e.some((e=>e.key===r&&e.command.endsWith(o))))return;const l=`${a.REMOVE_KEYBINDING}${o}`;return new i.VSCodeKeybindingDefault(l,r)};convertToKey(e){switch(this.osDestination){case"Linux":return new s.VSCodeKeyLinux(e,this.keystrokeKeyMappings);case"Mac":return new r.VSCodeKeyMac(e,this.keystrokeKeyMappings);case"Windows":return new o.VSCodeKeyWindows(e,this.keystrokeKeyMappings)}}static groupBy(e,t){return e.reduce(((e,n)=>{const i=t(n);return e[i]=e[i]??[],e[i].push(n),e}),{})}}t.IntelliJSyntaxAnalyzer=a},514:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FileOpen=void 0;const i=n(496);t.FileOpen=class{static async openText(e){return await i.workspace.openTextDocument({language:"json",content:e})}static async showKeybindingsJson(e){await i.commands.executeCommand("workbench.action.openGlobalKeybindingsFile");const t=new i.Range(e.lineAt(0).range.start,e.lineAt(e.lineCount-1).range.end);await i.window.showTextDocument(e,{selection:t}),await i.window.showInformationMessage("Please copy & paste it into keybindings.json")}}},496:e=>{"use strict";e.exports=require("vscode")}},t={};function n(i){var s=t[i];if(void 0!==s)return s.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}var i={};(()=>{"use strict";var e=i;Object.defineProperty(e,"__esModule",{value:!0}),e.importKeyMapsSchema=e.activate=void 0;const t=n(496),s=n(94),r=n(545),o=n(371),a=n(537),l=n(863),c=n(236),u=n(446),d=n(777),h=n(59),p=n(514);async function f(e){const t=await d.Picker.pickImporterType();if(!t)return;const n=await d.Picker.pickOSDestionation();if(!n)return;let i;if("XmlFile"===t&&(i=await c.FileOpenDialog.showXml(),!i))return;const f=await u.FileReaderDefault.readIntelliJ(n.src,e),g=await u.FileReaderDefault.readVSCode(n.src,e),m=await u.FileReaderDefault.readActionIdCommandMapping(e),y=await u.FileReaderDefault.readKeystrokeKeyMapping(e),x=await o.IntelliJXMLParser.parseToJson(i),v=await o.IntelliJXMLParser.parseToJson(f),b=o.IntelliJXMLParser.desirialize(x),N=o.IntelliJXMLParser.desirialize(v),O=l.VSCodeJsonParser.desirialize(g),T=r.ActionIdCommandMappingJsonParser.desirialize(m),w=a.KeystrokeKeyMappingJsonParser.desirialize(y),A=new h.IntelliJSyntaxAnalyzer(n.dst,T,w,O,N,b).convert(),_=s.KeybindingsJsonGenerator.gene(A),E=await p.FileOpen.openText(_);await p.FileOpen.showKeybindingsJson(E)}e.activate=function(e){e.subscriptions.push(t.commands.registerCommand("intellij.importKeyMapsSchema",(async()=>await f(e))))},e.importKeyMapsSchema=f})();var s=exports;for(var r in i)s[r]=i[r];i.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})();