/*</function> 
混淆 JS 代码

@param {string} code JS 代码字符串
@param {Object} options 配置项
@param {string} options.type 混淆类型 'zero': 零宽字符, 'reverse': 颠掉字符
@param {string} options.export 是否导出函数
@return {string} 返回混淆后的代码
514593
function obfuscate(code, options) {
    if (!code) {
      return code;
    }
    options = options || {};
    var prefix = options.prefix || '$fog$';
    function identFrom(index) {
      return prefix + index;
    }
    code = String(code).replace(/\r\n?|[\n\u2028\u2029]/g, '\n')
      .replace(/^\uFEFF/, ''); // 数据清洗
    var syntax = esprimaInstance.parse(code, {
      range: true,
      loc: false
    });
    var breakoutVariants = [];
    if (options.breakout) { // 是否自动导出
      syntax.body.forEach(function(item) {
        if (item.type === 'VariableDeclaration') { // 变量定义
          item.declarations.forEach(function(sub) {
            breakoutVariants.push(sub.id.name);
          });
        } else if (item.type === 'FunctionDeclaration') { // 函数定义
          breakoutVariants.push(item.id.name);
        }
      });
    }
    var guid = 0;
    var memberExpressions = [];
    var propertys = {};
    var names = [];
    var expressions = [];
    var ranges = {};
    function record(obj, name) {
      var range;
      if (obj.type === 'Literal') {
        range = obj.range;
      } else {
        range = obj.property.range;
      }
      if (ranges[range]) {
        return;
      }
      ranges[range] = true;
      obj.$name = name;
      memberExpressions.push(obj);
      if (!propertys[name]) {
        propertys[name] = identFrom(guid++);
        names.push(propertys[name]);
        expressions.push(name);
      }
    }
    function scan(obj, parentKey) {
      if (!obj) {
        return;
      }
      if (parentKey === 'range') {
        return;
      }
      if (obj.type === 'MemberExpression') {
        if (obj.property.type === 'Identifier' && !obj.computed) {
          record(obj, JSON.stringify(obj.property.name));
        }
      }
      if (obj.type === 'Literal') {
        if (parentKey === 'expression') {
          return;
        }
        if (/^(["']|\d)/.test(obj.raw)) {
          if (parentKey !== 'key') { // 不能是 JSON 的 key
            /* jslint evil: true */
            record(obj, JSON.stringify(eval(obj.raw)));
          }
        } else {
          record(obj, obj.raw);
        }
        return;
      }
      for (var key in obj) {
        if (typeof obj[key] === 'object') {
          scan(obj[key], key);
        }
      }
    }
    scan(syntax);
    switch (options.type) {
      case 'reverse':
        var items = expressions.slice().reverse();
        items.forEach(function(item, index) {
          propertys[item] = names[index];
        });
        break;
    }
    /*<debug> //
    console.log(JSON.stringify(syntax, null, '  '));
    //</debug>*/
    memberExpressions.sort(function(a, b) {
      if (a.type === 'Literal') {
        a = a.range[1];
      } else {
        a = a.property.range[1];
      }
      if (b.type === 'Literal') {
        b = b.range[1];
      } else {
        b = b.property.range[1];
      }
      return b - a;
    }).forEach(function(obj) {
      if (obj.type === 'Literal') {
        var begin = code.slice(0, obj.range[0]);
        var end = code.slice(obj.range[1]);
        code = begin;
        if (/[^\s~!%^&*()_+\-={}\[\]|:";'<>,.?]$/.test(begin)) { // compress
          code += ' ';
        }
        code += propertys[obj.$name];
        if (/^[^\s~!%^&*()_+\-={}\[\]|:";'<>,.?]/.test(end)) {
          code += ' ';
        }
        code += end;
      } else { // if (obj.type === 'MemberExpression') {
        code = code.slice(0, obj.property.range[0]).replace(/\.\s*$/, '') +
          '[' + propertys[obj.$name] + ']' +
          code.slice(obj.property.range[1]);
      }
    });
    var decryption = '';
    var hasString; // 是否存在字符串处理
    var params = {};
    switch (options.type) {
      case 'zero':
        var existsUnicode = false;
        expressions.every(function(item) {
          if (/[\u0100-\uffff]/.test(item)) {
            existsUnicode = true;
          }
          return !existsUnicode;
        });
        var t;
        if (existsUnicode) {
          t = parseInt('100000000', 2);
        } else {
          t = parseInt('10000000', 2);
        }
        expressions = expressions.map(function(item) {
          if (!(/^["]/.test(item)) || item.length <= 2) {
            return item;
          }
          hasString = true;
          var value = JSON.parse(item);
          if (existsUnicode) {
            value = encodeUTF8(value);
          }
          return '"' + value.replace(/[^]/g, function(all) {
            return (t + all.charCodeAt()).toString(2).substring(1).replace(/[^]/g, function(n) {
              return {
                0: '\u200c',
                1: '\u200d'
              }[n];
            });
          }) + '"';
        });
        if (hasString) {
          params = {
            argv: identFrom(guid++),
            index: identFrom(guid++),
            empty: identFrom(guid++),
            len: identFrom(guid++),
            string: identFrom(guid++),
            replace: identFrom(guid++),
            fromCharCode: identFrom(guid++),
            length: identFrom(guid++),
            0: identFrom(guid++),
            1: identFrom(guid++),
            2: identFrom(guid++),
            String: identFrom(guid++),
            regex1: identFrom(guid++),
            regex2: identFrom(guid++),
            parseInt: identFrom(guid++),
            rightToLeft: identFrom(guid++),
            u202e: '"\u202e"',
            6: identFrom(guid++),
            charCodeAt: identFrom(guid++),
            '0x0f': identFrom(guid++),
            '0x1f': identFrom(guid++),
            '0x3f': identFrom(guid++),
            regex3: identFrom(guid++),
            regex4: identFrom(guid++),
          };
          names.push(params.rightToLeft);
          expressions.push('"\u202e"'); // 干扰字符
          names.push(params.len);
          expressions.push(expressions.length - 1);
          names.push(params.string);
          expressions.push('"string"');
          names.push(params.replace);
          expressions.push('"replace"');
          names.push(params.regex1);
          expressions.push('/./g');
          names.push(params.regex2);
          if (existsUnicode) {
            expressions.push('/.{8}/g');
            names.push(params.regex3);
            expressions.push('/[\\u00c0-\\u00df][\\u0080-\\u00bf]/g');
            names.push(params.regex4);
            expressions.push('/[\\u00e0-\\u00ef][\\u0080-\\u00bf][\\u0080-\\u00bf]/g');
            names.push(params.charCodeAt);
            expressions.push('"charCodeAt"');
            names.push(params[6]);
            expressions.push(6);
            names.push(params['0x0f']);
            expressions.push(0x1f);
            names.push(params['0x1f']);
            expressions.push(0x1f);
            names.push(params['0x3f']);
            expressions.push(0x3f);
          } else {
            expressions.push('/.{7}/g');
          }
          names.push(params.String);
          expressions.push('String');
          names.push(params.fromCharCode);
          expressions.push('"fromCharCode"');
          names.push(params[0]);
          expressions.push(0);
          names.push(params[1]);
          expressions.push(1);
          names.push(params[2]);
          expressions.push(2);
          names.push(params.parseInt);
          expressions.push('parseInt');
          if (existsUnicode) {
            decryption = format( "\nif (#{u202e} !== #{rightToLeft}) {\n  return;\n}\n\nvar #{argv} = arguments;\nfor (var #{index} = #{0}; #{index} < #{len}; #{index}++) {\n  if (typeof #{argv}[#{index}] !== #{string}) {\n    continue;\n  }\n  #{argv}[#{index}] = #{argv}[#{index}][#{replace}](#{regex1},\n    function (a) {\n      return {\n        '\\u200c': #{0},\n        '\\u200d': #{1}\n      }[a];\n    }\n  )[#{replace}](#{regex2}, function (a) {\n    return #{String}[#{fromCharCode}](#{parseInt}(a, #{2}));\n  })[#{replace}](\n    #{regex3},\n    function(c) {\n      var cc = (c[#{charCodeAt}](#{0}) & #{0x1f}) << #{6} | (c[#{charCodeAt}](#{1}) & #{0x3f});\n      return #{String}[#{fromCharCode}](cc);\n    }\n  )[#{replace}](\n    #{regex4},\n    function(c) {\n      var cc = (c[#{charCodeAt}](#{0}) & #{0x0f}) << #{6} * #{2} | (c[#{charCodeAt}](#{1}) & #{0x3f}) << #{6} | (c[#{charCodeAt}](2) & #{0x3f});\n      return #{String}[#{fromCharCode}](cc);\n    }\n  );\n}\n    ", params);
          } else {
            decryption = format( "\nif (#{u202e} !== #{rightToLeft}) {\n  return;\n}\n\nvar #{argv} = arguments;\nfor (var #{index} = #{0}; #{index} < #{len}; #{index}++) {\n  if (typeof #{argv}[#{index}] !== #{string}) {\n    continue;\n  }\n  #{argv}[#{index}] = #{argv}[#{index}][#{replace}](#{regex1},\n    function (a) {\n      return {\n        '\\u200c': #{0},\n        '\\u200d': #{1}\n      }[a];\n    }\n  )[#{replace}](#{regex2}, function (a) {\n    return #{String}[#{fromCharCode}](#{parseInt}(a, #{2}));\n  });\n}\n    ", params);
          }
        }
        break;
      case 'reverse':
        expressions = expressions.map(function(item) {
          if (/^"/.test(item)) {
            hasString = true;
            return JSON.stringify(JSON.parse(item).split('').reverse().join(''));
          }
          return item;
        });
        params = {
          argv: identFrom(guid++),
          index: identFrom(guid++),
          empty: identFrom(guid++),
          len: identFrom(guid++),
          temp: identFrom(guid++),
          string: identFrom(guid++),
          split: identFrom(guid++),
          reverse: identFrom(guid++),
          0: identFrom(guid++),
          1: identFrom(guid++),
          2: identFrom(guid++),
          join: identFrom(guid++),
          rightToLeft: identFrom(guid++),
          u202e: '"\u202e"'
        };
        names.push(params.rightToLeft);
        expressions.push('"\u202e"'); // 干扰字符
        names.push(params.len);
        expressions.push(expressions.length - 1);
        if (hasString || expressions.length > 1) {
          decryption += format( "\nif (#{u202e} !== #{rightToLeft}) {\n  return;\n}\nvar #{argv} = arguments;\nvar #{index};\n        ", params);
          names.push(params.empty);
          expressions.push('""');
          names.push(params[0]);
          expressions.push('0');
        }
        if (hasString) {
          names.push(params.string);
          expressions.push('"string"');
          names.push(params.split);
          expressions.push('"split"');
          names.push(params.reverse);
          expressions.push('"reverse"');
          names.push(params.join);
          expressions.push('"join"');
          decryption += format( "\nfor (#{index} = #{0}; #{index} < #{len}; #{index}++) {\n  if (typeof #{argv}[#{index}] === #{string}) {\n    #{argv}[#{index}] = #{argv}[#{index}][#{split}](#{empty})[#{reverse}]()[#{join}](#{empty});\n  }\n}\n        ", params);
        }
        if (expressions.length > 1) {
          names.push(params[1]);
          expressions.push('1');
          names.push(params[2]);
          expressions.push('2');
          decryption += format( "\nfor (#{index} = #{0}; #{index} < #{len} / #{2}; #{index}++) {\n  var #{temp} = #{argv}[#{index}];\n  #{argv}[#{index}] = #{argv}[#{len} - #{index} - #{1}];\n  #{argv}[#{len} - #{index} - #{1}] = #{temp};\n}\n        ", params);
        }
        break;
      default:
        params = {
          rightToLeft: identFrom(guid++),
          u202e: '"\u202e"'
        };
        names.unshift(params.rightToLeft);
        expressions.unshift('"\u202e"'); // 干扰字符
        decryption += format( "\nif (#{u202e} !== #{rightToLeft}) {\n  return;\n}\n        ", params);
        break;
    }
    if (options.breakout && breakoutVariants.length) {
      var breakoutIdent = identFrom(guid++);
      var breakoutInside = breakoutVariants.map(function (name) {
        return format('#{ident}.#{name} = #{name};', {
          ident: breakoutIdent,
          name: name
        });
      }).join('\n');
      var breakoutOutside = breakoutVariants.map(function (name) {
        return format('var #{name} = #{ident}.#{name};', {
          ident: breakoutIdent,
          name: name
        });
      }).join('\n');
      return format( "\nvar #{breakoutIdent} = {};\n(function (#{names}) {\n  #{decryption}\n  #{code}\n  #{breakoutInside}\n})(#{expressions});\n#{breakoutOutside}\n     ", {
        breakoutIdent: breakoutIdent,
        breakoutInside: breakoutInside,
        breakoutOutside: breakoutOutside,
        names: names.join(', '),
        decryption: decryption,
        code: code,
        expressions: expressions.join(', ')
      });
    }
    return format( "\n(function (#{names}) {\n  #{decryption}\n  #{code}\n})(#{expressions});\n     ", {
      names: names.join(', '),
      decryption: decryption,
      code: code,
      expressions: expressions.join(', ')
    });
  }
419765
function updateSourceCode(code, changes) {
  // Summary:
  //  This must be called before code is changed some places else rather than ast

  changes.sort((c1, c2) => c2.start - c1.start);
  // Remove same or overlapped changes
  const newChanges = _.reduce(
    changes,
    (cleanChanges, curr) => {
      const last = _.last(cleanChanges);

      if (!cleanChanges.length || last.start > curr.end) {
        cleanChanges.push(curr);
      } else if (last.start === last.end && last.end === curr.start && curr.start === curr.end) {
        // insert code at the same position, merge them
        last.replacement += curr.replacement;
      }
      return cleanChanges;
    },
    [],
  );

  const chars = code.split('');
  newChanges.forEach(c => {
    // Special case: after the change, two empty lines occurs, should delete one line
    if (
      c.replacement === '' &&
      (c.start === 0 || chars[c.start - 1] === '\n') &&
      chars[c.end] === '\n'
    ) {
      c.end += 1;
    }
    chars.splice(c.start, c.end - c.start, c.replacement);
  });
  return chars.join('');
}
461869
function isHtmlFile(code, options) {
    const filePath =
        typeof options.filePath === "string" ? options.filePath : "unknown.js"
    for (const ext of container.targetExtensions) {
        if (filePath.endsWith(ext)) {
            return true
        }
    }
    if (filePath.endsWith(".vue")) {
        return false
    }
    return /^\s*</u.test(code)
}
341524
function compile(code, filename, options) {
  options = defaults(options || {}, {
    embedSourceMaps: true,
    bareModule: false,
    color: false
  });
  if (arguments.length !== compile.length) {
    throw new Error("incorrect argument count to compile");
  }
  var result = parse(ensureNewline(code));
  if (!result.status) {
    var expectations = uniq(result.expected);
    var data = "expected one of " + expectations.join(", ");
    var index = Math.min(result.index, code.length - 1);
    var oopsyInput = {index: index, data: data};
    var oopsies =
      OopsyData.fromIndices(code, [oopsyInput], {color: options.color});
    return {
      parsed: false,
      result: {
        expectations: expectations,
        oopsy: oopsies[0]
      }
    };
  }
  var squiggleAst = result.value;
  squiggleAst.bareModule = options.bareModule;
  var warnings = lint(squiggleAst);
  var contextualWarnings =
    OopsyData.fromLocations(code, warnings, {color: options.color});
  var esAst = transformAst(squiggleAst);
  var mangledAst = SHOULD_MANGLE ?
    esmangle.optimize(esAst) :
    esAst;
  var optimizedAst = SHOULD_OPTIMIZE ?
    optimize(mangledAst) :
    mangledAst;
  var stuff = generateCodeAndSourceMap(
    optimizedAst, filename, code);
  var js = ensureNewline(stuff.code);
  var sourceMap = stuff.map.toString();
  if (options.embedSourceMaps) {
    js = addSourceMapUrl(js, sourceMap);
  }
  return {
    parsed: true,
    warnings: contextualWarnings,
    sourceMap: sourceMap,
    code: js
  };
}
1053852
function outputClassBody( code ) {
    try {
        let out = '';
        if ( code.that ) out += "        const that = this;\n";
        if ( code.pm ) out += "        const pm = PM(this);\n";
        out += generate( code.section.attribs.define, "Create attributes", "        " );
        out += generate( code.section.elements.define, "Create elements", "        " );
        out += generate( code.section.events, "Events", "        " );
        out += arrayToCodeWithNewLine( code.generateLinks(), "        " );
        out += generate( code.section.ons, "On attribute changed", "        " );
        out += generate( code.section.elements.init, "Initialize elements", "        " );
        out += generate( code.section.attribs.init, "Initialize attributes", "        " );
        if ( code.section.init ) {
            out += "        // Initialization.\n";
            out += `        CODE_BEHIND.${code.section.init}.call( this );\n`;
        }
        out += "        $.addClass(this, 'view', 'custom');\n";
        return out;
    } catch ( ex ) {
        bubble( ex, "outputClassBody" );
        return null;
    }
}
18337
public static function invoke(
        array $options,
        string $code
    ): string {
        $codes = Property::getArray(
            $options,
            self::OPTION_CODES,
            null
        );

        if (empty($codes)) {
            return $code;
        }

        return Property::getString(
            $codes,
            $code,
            $code
        );
    }
900479
function deleteCodeComments(code) {
    // 另一种思路更简便的办法
    // 将'://'全部替换为特殊字符，删除注释代码后再将其恢复回来
    var tmp1 = ':\/\/';
    var regTmp1 = /:\/\//g;
    var tmp2 = '@:@/@/@';
    var regTmp2 = /@:@\/@\/@/g;
    code = code.replace(regTmp1, tmp2);
    code = code.replace(rComments, '');
    return code.replace(regTmp2, tmp1);
}
324381
function parseTemplate(code, parserOptions) {
    const sourceCodeStore = new SourceCodeStore(code)

    // 文字位置をそのままにしてscriptとhtmlを分解
    let script = ""
    let pre = 0
    let template = ""
    const microTemplateTokens = [] // テンプレートTokens
    for (const token of genMicroTemplateTokens(
        code,
        parserOptions,
        sourceCodeStore
    )) {
        microTemplateTokens.push(token)
        const start = token.start
        const end = token.end

        const part = code.slice(pre, start)
        script += replaceToWhitespace(part)
        template += part

        const scriptBeforeBase = token.expressionStart.chars
        const scriptAfterBase = token.expressionEnd.chars
        const scriptBefore = replaceToWhitespace(scriptBeforeBase)
        let scriptAfter = replaceToWhitespace(scriptAfterBase)
        if (token.type !== "MicroTemplateEvaluate") {
            scriptAfter = scriptAfter.replace(/ /u, ";")
        }
        script += `${scriptBefore}${token.code}${scriptAfter}`

        template += replaceToWhitespace(code.slice(start, end))

        pre = end
    }
    const part = code.slice(pre, code.length)
    script += replaceToWhitespace(part)
    template += part

    const scriptResult = parseScript(script, parserOptions)

    sourceCodeStore.template = template
    sourceCodeStore.script = script

    const service = new MicroTemplateService({
        code,
        template,
        script,
        microTemplateTokens,
        sourceCodeStore,
        ast: scriptResult.ast,
    })
    container.addService(parserOptions.filePath, service)
    scriptResult.services = Object.assign(scriptResult.services || {}, {
        getMicroTemplateService() {
            return service
        },
    })
    return scriptResult
}
153033
function toknam(code) {
  var keys = Object.keys(C);
  for (var i = 0, l = keys.length; i < l; i++) {
    var key = keys[i];
    if (C[key] === code) { return key; }
  }
  return code && ("0x" + code.toString(16));
}
1269417
function extractCodeBlocks(filepath) {
  return new Promise(function(fulfill, reject) {
    fs.readFile(filepath, 'utf8', function(err, text) {
      if (err) {
        console.log(err);
        reject(err);
      } else {
        var converter = new showdown.Converter();
        var html = converter.makeHtml(text);
        var $ = cheerio.load(html);
        var codeBlocks = $('pre code').map(function(index, elem) {
          var language = ($(elem).attr('class') || 'none language-none').split(' ')[0];
          return {
            filename: buildFilename(filepath, elem, $),
            content: $(elem).text(),
            language: language
          };
        });
        fulfill(codeBlocks.toArray());
      }
    });
  });
}
1249800
function codeHandle(e) {
            const $selectionElem = editor.selection.getSelectionContainerElem()
            if (!$selectionElem) {
                return
            }
            const $parentElem = $selectionElem.parent()
            const selectionNodeName = $selectionElem.getNodeName()
            const parentNodeName = $parentElem.getNodeName()

            if (selectionNodeName !== 'CODE' || parentNodeName !== 'PRE') {
                // 不符合要求 忽略
                return
            }

            if (!editor.cmd.queryCommandSupported('insertHTML')) {
                // 必须原生支持 insertHTML 命令
                return
            }

            // 处理：光标定位到代码末尾，联系点击两次回车，即跳出代码块
            if (editor._willBreakCode === true) {
                // 此时可以跳出代码块
                // 插入 <p> ，并将选取定位到 <p>
                const $p = $('<p><br></p>')
                $p.insertAfter($parentElem)
                editor.selection.createRangeByElem($p, true)
                editor.selection.restoreSelection()

                // 修改状态
                editor._willBreakCode = false

                e.preventDefault()
                return
            }

            const _startOffset = editor.selection.getRange().startOffset

            // 处理：回车时，不能插入 <br> 而是插入 \n ，因为是在 pre 标签里面
            editor.cmd.do('insertHTML', '\n')
            editor.selection.saveRange()
            if (editor.selection.getRange().startOffset === _startOffset) {
                // 没起作用，再来一遍
                editor.cmd.do('insertHTML', '\n')
            }

            const codeLength = $selectionElem.html().length
            if (editor.selection.getRange().startOffset + 1 === codeLength) {
                // 说明光标在代码最后的位置，执行了回车操作
                // 记录下来，以便下次回车时候跳出 code
                editor._willBreakCode = true
            }

            // 阻止默认行为
            e.preventDefault()
        }
500514
function(code, lineNumbers)
  {
    var _this = this,
        opts = _this.opts,
        html = '',
        count = _this.lines.length,
        firstLine = parseInt(opts.firstLine || 1),
        pad = opts.padLineNumbers,
        lineNumber,
        i
        ;

    if (pad == true)
      pad = (firstLine + count - 1).toString().length;
    else if (isNaN(pad) == true)
      pad = 0;

    for (i = 0; i < count; i++)
    {
      lineNumber = lineNumbers ? lineNumbers[i] : firstLine + i;
      code = lineNumber == 0 ? opts.space : padNumber(lineNumber, pad);
      html += _this.wrapLine(i, lineNumber, code);
    }

    return html;
  }
437640
public String[] generateCodes(final String code, final String objectName, final String field, final Class<?> fieldType) {
        
        final String baseCode = getPrefix().isEmpty() ? code : getPrefix() + code;
        final List<String> codeList = new ArrayList<>();
        
        final List<String> objectNameList = Arrays.asList(generateObjectNameCodes(objectName));
        final List<String> fieldList = new ArrayList<>();
        buildFieldList(field, fieldList);
        
        if(Utils.isNotEmpty(field)) {
            // 最後のフィールド名のみを取得する
            int dotIndex = field.lastIndexOf('.');
            if(dotIndex > 0) {
                buildFieldList(field.substring(dotIndex + 1), fieldList);
            }
        }
        
        for(final String name : objectNameList) {
            addCodes(codeList, baseCode, name, fieldList);
        }
        
        addCodes(codeList, code, null, fieldList);
        
        if(fieldType != null) {
            addCode(codeList, code, null, fieldType.getName());
            
            if(Enum.class.isAssignableFrom(fieldType)) {
                // 列挙型の場合は、java.lang.Enumとしてクラスタイプを追加する。
                addCode(codeList, code, null, Enum.class.getName());
                
            } else if(fieldType.isArray()) {
                // 配列の場合は、"配列のクラスタイプ+[]"を追加する。
                Class<?> componentType = fieldType.getComponentType();
                addCode(codeList, code, null, componentType.getName() + "[]");
                addCode(codeList, code, null, "java.lang.Object[]");
            }
        }
        
        addCode(codeList, code, null, null);
        
        return codeList.toArray(new String[codeList.size()]);
    }
794757
function parseCode2ChartOption(optionCode) {
  const reservedKeys = ['type', 'url'];
  let options = {};
  if (util.isUndefined(optionCode)) {
    return options;
  }

  const optionLines = optionCode.split(REGEX_LINE_ENDING);
  optionLines.forEach(line => {
    let [keyString, ...values] = line.split(OPTION_DELIMITER);
    let value = values.join(OPTION_DELIMITER);
    keyString = keyString.trim();
    if (value.length === 0) {
      return;
    }

    try {
      value = JSON.parse(value.trim());
    } catch (e) {
      value = value.trim();
    }

    // parse keys
    let [...keys] = keyString.split('.');
    let topKey = keys[0];
    if (util.inArray(topKey, reservedKeys) >= 0) {
      // reserved keys for chart plugin option
      keys.unshift('editorChart');
    } else if (keys.length === 1) {
      // short names for `chart`
      keys.unshift('chart');
    } else if (topKey === 'x' || topKey === 'y') {
      // short-handed keys
      keys[0] = `${topKey}Axis`;
    }

    let option = options;
    for (let i = 0; i < keys.length; i += 1) {
      let key = keys[i];
      option[key] = option[key] || (keys.length - 1 === i ? value : {});
      option = option[key];
    }
  });

  return options;
}
169750
function(code) {
    var lines = [];
    code.split(/\n/).forEach(line => {
      var segs = line.split(/(\s*#)/);
      var ln = {code: segs[0]};
      if (segs.length > 1)
        ln.comment = segs.reduce((c, seg, i) => i > 1 ? c + seg : seg, '');
      lines.push(ln);
    });
    return lines;
  }
623312
function replaceDefine(code) {
    var defineList = getDefineBlock(code);
    var segments = [];
    var index = 0;
    defineList.forEach(function (block) {

        if (block.type === 'function') {
            segments.push(code.slice(index, block.defineRange[0]));
            index = block.factoryRange[0] + 1;

            block.returnRange.forEach(function (range) {
                segments.push(code.slice(index, range[0]));
                segments.push('module.exports =');
                segments.push(code.slice(range[0] + 6, range[1]));
                index = range[1];
            });
            segments.push(code.slice(index, block.factoryRange[1] - 1));

            index = block.defineRange[1];
        }
        else if (block.type === 'object') {
            segments.push(code.slice(index, block.defineRange[0]));
            segments.push('module.exports = ');
            segments.push(code.slice(block.factoryRange[0], block.factoryRange[1]) + ';');
            index = block.defineRange[1];
        }
    });

    segments.push(code.slice(index));

    code = segments.join('');

    return code;
}
3525
function isDelimiter(code) {
  return code === 0x22                // '"'
    || code === 0x28                  // '('
    || code === 0x29                  // ')'
    || code === 0x2C                  // ','
    || code === 0x2F                  // '/'
    || code >= 0x3A && code <= 0x40   // ':', ';', '<', '=', '>', '?' '@'
    || code >= 0x5B && code <= 0x5D   // '[', '\', ']'
    || code === 0x7B                  // '{'
    || code === 0x7D;                 // '}'
}