UNPKG

diya-test

Version:

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