/////////////////////////////////////////// /   Utility functions /////////////////////////////////////////// eslint-disable-next-line require-jsdoc
507691
function pingNet(net, ip) {
    return new Promise((ac, rj)=>{
        try {
            let params = {timeout: PING_TIMEOUT_IN_SEC};
            switch (process.platform) {
            case 'win32':
            case 'win64': // Never hits
                break;
            case 'darwin':
            case 'freebsd':
                params.extra = ['-S', net];
                break;
            default:
                params.extra = ['-I', net];
                break;
            }

            ping.sys.probe(ip, ac, params);
        } catch (e) {
            rj(e);
        } ;
    });
}
983757
function (subtype, context, done) {
    var types = this.types
      , loaded = {};
    this.allExtensions(function (type, id, plugin, next) {
      if (!plugin[subtype]) return next();
      if ('string' === typeof plugin[subtype]) {
        try {
          plugin[subtype] = require(path.resolve(path.join(plugin.dir, plugin[subtype])));
        } catch (e) {
          // eslint-disable-next-line no-console
          console.log('failed to load plugin', id, e.message, e.stack);
          e.message += '; error loading plugin ' + id;
          return next(e);
        }
      }

      if (!loaded[type]) loaded[type] = {};
      if (!types[type][subtype]) {
        loaded[type][id] = plugin[subtype];
        return next();
      }
      types[type][subtype](id, plugin[subtype], plugin, context, function (err, initialized) {
        loaded[type][id] = initialized;
        next(err);
      });
    }, function (err) {
      done(err, loaded);
    });
  }
679783
function preprocessComment(e) {

	var src = e.comment;

	// add a default visibility
	if ( !/@private|@public|@protected|@sap-restricted|@ui5-restricted/.test(src) ) {
		src = unwrap(src);
		src = src + "\n@private";
		src = wrap(src);
		// console.log("added default visibility to '" + src + "'");
	}

	if ( /@class/.test(src) && /@static/.test(src) ) {
		warning("combination of @class and @static is no longer supported with jsdoc3, converting it to @namespace and @classdesc: (line " + e.lineno + ")");
		src = unwrap(src);
		src = src.replace(/@class/, "@classdesc").replace(/@static/, "@namespace");
		src = wrap(src);
		//console.log(src);
	}

	return src;

}
1209274
function procES6(src, base, dest = '', handle_error = false, min = false) {
    const babelOptions = requireJSON.parse(fs.readFileSync('./.babelrc', 'utf8'));
    let bo = Object.assign(babelOptions);
    let bplg = bo.plugins || (bo.plugins = []);
    bplg.push("external-helpers");
    bo.exclude = "node_modules/**";

    let plugins = [
        // require('rollup-plugin-strip')(),
        require('rollup-plugin-babel')(bo),
    ];

    if ( min ) {
        plugins.push(require('rollup-plugin-uglify')({
            output: {
                comments: function(node, comment) {
                    let { value, type } = comment;
                    // multiline comment
                    if (type === "comment2") {
                        return /@preserve|@license|@cc_on/i.test(value);
                    }
                },
            },
        }));
    }

    let s = gulp.src(src, { base })
        .pipe($.sourcemaps.init({loadMaps:true}))
        // .pipe($.babel(babelOptions))

        .pipe($.betterRollup({ plugins }, 'umd'))
        // .pipe($.rename((fn)=>{fn.basename = path.basename(fn.basename, '.es')}))
    ;
    if ( handle_error ) {
        handle_stream_error(s);
    }
    if ( min ) {
        s = s.pipe($.rename({extname: '.min.js'}));
    }
    s = s.pipe($.sourcemaps.write('.'));
    if ( dest ) {
        s = s.pipe(gulp.dest(dest));
    }
    return s;
}
404824
function () {
  var args = Array.prototype.slice.call(arguments);
  console.error();
  console.error.apply(console, [" "].concat(args));
  console.error();
  process.exit(1); // eslint-disable-line no-process-exit
}
615578
function linterResults(_results, code) {
        /* eslint-enable no-unused-vars */
        var results = JSON.parse(_results);
        var res = [{
            filePath: resourcePath,
            messages: Object.assign([], results[resourcePath])
        }];

        if (res[0].messages.length > 0) {
            (function () {
                var warnings = 0;
                var errors = 0;
                var messages = res[0].messages;
                messages.forEach(function (linter) {
                    if (linter.severity === 'warning') {
                        warnings++;
                    } else if (linter.severity === 'error') {
                        errors++;
                    }
                });
                var msg = (0, _scsslintStylish2.default)(res);
                var emitter = void 0;
                if (errors > 0) {
                    emitter = webpack.emitError;
                } else {
                    emitter = webpack.emitWarning;
                }
                emitter(msg);
            })();
        }
    }
1341534
function requireCLI(preferLocal) {
    /* eslint-disable global-require */
    if (preferLocal) {
        try {
            const localCLI = require.resolve(path.join(process.cwd(), 'node_modules', 'generator-jhipster', 'cli', 'cli.js'));
            if (__dirname !== path.dirname(localCLI)) {
                // load local version
                /* eslint-disable import/no-dynamic-require */
                logger.info("Using JHipster version installed locally in current project's node_modules");
                require(localCLI);
                return;
            }
        } catch (e) {
            // Unable to find local version, so global one will be loaded anyway
        }
    }
    // load global version
    logger.info('Using JHipster version installed globally');
    require('./cli');
    /* eslint-enable  */
}
351735
function _entry(dirs) {
  return Utils.reduce(dirs, (memo, dir) => {
    const packs = glob.sync(resolve(dir, '**/*.pack.+(s[ac]ss|js)'));
    packs.forEach((pack) => {
      const key = relative(dir, pack).replace(/\.pack\.[^/.]+$/, '');
      /* eslint-disable-next-line no-param-reassign */
      memo[key] = [pack];
    });

    return memo;
  }, {});
}
484129
function(hljs) {
  return {
    aliases: ['rs'],
    keywords:
      'alignof as be box break const continue crate do else enum extern ' +
      'false fn for if impl in let loop match mod mut offsetof once priv ' +
      'proc pub pure ref return self sizeof static struct super trait true ' +
      'type typeof unsafe unsized use virtual while yield ' +
      'int i8 i16 i32 i64 ' +
      'uint u8 u32 u64 ' +
      'float f32 f64 ' +
      'str char bool',
    illegal: '</',
    contains: [
      hljs.C_LINE_COMMENT_MODE,
      hljs.C_BLOCK_COMMENT_MODE,
      hljs.inherit(hljs.QUOTE_STRING_MODE, {illegal: null}),
      {
        className: 'string',
        begin: /r(#*)".*?"\1(?!#)/
      },
      {
        className: 'string',
        begin: /'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/
      },
      {
        begin: /'[a-zA-Z_][a-zA-Z0-9_]*/
      },
      {
        className: 'number',
        begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
        relevance: 0
      },
      {
        className: 'function',
        beginKeywords: 'fn', end: '(\\(|<)', excludeEnd: true,
        contains: [hljs.UNDERSCORE_TITLE_MODE]
      },
      {
        className: 'preprocessor',
        begin: '#\\[', end: '\\]'
      },
      {
        beginKeywords: 'type', end: '(=|<)',
        contains: [hljs.UNDERSCORE_TITLE_MODE],
        illegal: '\\S'
      },
      {
        beginKeywords: 'trait enum', end: '({|<)',
        contains: [hljs.UNDERSCORE_TITLE_MODE],
        illegal: '\\S'
      },
      {
        begin: hljs.IDENT_RE + '::'
      },
      {
        begin: '->'
      }
    ]
  };
}
278993
function configureESLint(options) {
	const ESLintConfig = {
		rules: options.rules
	}

	ESLintConfig.extends = 'xo'
	if (options.esnext) {
		ESLintConfig.extends = 'xo/esnext'
	}

	if (!options.semicolon) {
		ESLintConfig.rules.semi = [2, 'never']
	}

	if (options.space === false) {
		ESLintConfig.rules.indent = [
			2, 'tab', {
				SwitchCase: 1
			}
		]
	} else {
		ESLintConfig.rules.indent = [
			2, parseInt(options.space, 10), {
				SwitchCase: 0
			}
		]
	}

	ESLintConfig.rules['valid-jsdoc'] = [0]
	ESLintConfig.rules['require-jsdoc'] = [0]

	console.debug(stripIndent`
		${clr.title}ESlint Options${clr.title.out}:
	`)
	if (console.canWrite(5)) {
		console.pretty(ESLintConfig, 2)
	}

	return () => new ESLint({
		baseConfig: ESLintConfig,
		fix: true,
		rules: options.rules
	})
}
284574
function _osxPs() {
  const fieldsInfo = _.map({user: 'user', pid: 'pid', ppid: 'ppid', cmd: 'comm', full_cmd: 'command'}, (value, key) => {
    return {name: key, specifier: value};
  });

  // Parsing OS X version of ps seems very complicated, you cannot specify a separator
  // but specifying a header is possible. So we will specify a well known header pattern and
  // read each column size to be able to parse the rest
  const spacerLength = 100;
  const spacer = '_'.repeat(spacerLength);
  const specifiersArg = _.map(fieldsInfo, e => `${e.specifier}=${spacer}`).join(',');

  let firstLine = true;
  const sizes = [];
  return _ps(['wwaxo', specifiersArg], line => {
    // Use the first line (the header) to calculate all columns length
    if (firstLine) {
      const re = new RegExp(`(${spacer} *)`, 'g');
      let match = null;
      /* eslint-disable no-cond-assign */
      while ((match = re.exec(line)) !== null) {
        const field = match[1];
        sizes.push(field.length);
      }
      /* eslint-enable no-cond-assign */
      if (sizes.length !== fieldsInfo.length) throw new Error('Cannot parse ps output');
      firstLine = false;
      return null;
    }

    const process = {};
    let startIdx = 0;
    // Split the line using the column sizes
    _.each(sizes, (size, index) => {
      const value = line.slice(startIdx, startIdx + size).trim();
      startIdx += size;
      const key = fieldsInfo[index].name;
      process[key] = value;
    });
    return process;
  });
}
718934
function(msg) {
      // eslint-disable-next-line no-console
      if (console.debug) {
        // eslint-disable-next-line no-console
        console.debug.apply(console, arguments);
      } else {
        // eslint-disable-next-line no-console
        console.log.apply(console, arguments);
      }
    }
939246
function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();var _react=__webpack_require__(0);var _react2=_interopRequireDefault(_react);var _propTypes=__webpack_require__(1);var _propTypes2=_interopRequireDefault(_propTypes);var _Component2=__webpack_require__(5);var _Component3=_interopRequireDefault(_Component2);var _Css=__webpack_require__(2);var _Css2=_interopRequireDefault(_Css);var _Icon=__webpack_require__(10);var _Icon2=_interopRequireDefault(_Icon);var _Spinner=__webpack_require__(15);var _Spinner2=_interopRequireDefault(_Spinner);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&((typeof call==='undefined'?'undefined':_typeof2(call))==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+(typeof superClass==='undefined'?'undefined':_typeof2(superClass)));}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var Button=function(_Component){_inherits(Button,_Component);function Button(props){_classCallCheck(this,Button);var _this=_possibleConstructorReturn(this,(Button.__proto__||Object.getPrototypeOf(Button)).call(this,props));_this.handleMouseOver=_this.handleMouseOver.bind(_this);_this.handleMouseOut=_this.handleMouseOut.bind(_this);return _this;}_createClass(Button,[{key:'handleMouseOver',value:function handleMouseOver(e){var onMouseOver=this.props.onMouseOver;if(onMouseOver){onMouseOver(e);}this.setState({isHovered:true});}},{key:'handleMouseOut',value:function handleMouseOut(e){var onMouseOut=this.props.onMouseOut;if(onMouseOut){onMouseOut(e);}this.setState({isHovered:false});}},{key:'render',value:function render(){var _props=this.props,buttonRef=_props.buttonRef,children=_props.children,className=_props.className,cssMap=_props.cssMap,defaultValue=_props.defaultValue,forceHover=_props.forceHover,iconPosition=_props.iconPosition,iconType=_props.iconType,isDisabled=_props.isDisabled,isReadOnly=_props.isReadOnly,isLoading=_props.isLoading,label=_props.label,onClick=_props.onClick,role=_props.role,type=_props.type,value=_props.value;var _state=this.state,id=_state.id,isHovered=_state.isHovered;var iconMarkup=void 0;if(iconType&&iconType!=='none'){iconMarkup=_react2.default.createElement('div',{className:cssMap.iconContainer},_react2.default.createElement(_Icon2.default,{className:cssMap.icon,type:iconType,theme:role==='control'?role:'button',variant:'stroke',forceHover:isHovered,isDisabled:isDisabled}));}var content=_react2.default.createElement('div',{className:cssMap.content},iconMarkup,_react2.default.createElement('div',{className:cssMap.label},children||label));return _react2.default.createElement(_Css2.default,{cssMap:cssMap,cssProps:{role:role,iconPosition:iconPosition,loading:isLoading&&!isDisabled,disabled:isDisabled,fakeHovered:forceHover}},_react2.default.createElement('button',{ref:buttonRef,type:type,className:className,id:id,defaultValue:defaultValue,value:value,disabled:isDisabled||isLoading||isReadOnly,onClick:onClick,onMouseEnter:this.handleMouseOver,onMouseLeave:this.handleMouseOut},content,isLoading&&!isDisabled&&_react2.default.createElement('div',{className:cssMap.loadingOverlay},_react2.default.createElement(_Spinner2.default,{className:cssMap.spinner}))));}}]);return Button;}(_Component3.default);Button.propTypes={/**
    *  Label text
    */label:_propTypes2.default.string,/**
    *  HTML type attribute
    */type:_propTypes2.default.oneOf(['button','reset','submit']),/**
    *  Button role/style
    */role:_propTypes2.default.oneOf(['default','subtle','promoted','critical','control']),/**
    *  Icon type to display (overrides customIcon)
    */iconType:_propTypes2.default.oneOf(['add','alert','approved','calendar','close','declined','delete','down','download','duplicate','edit','ended','error','info','inspect','left','link','pending','preview','reset','right','search','up','upload','validation','none']),/*
     *  Icon position relative to Button text
     */iconPosition:_propTypes2.default.oneOf(['left','right']),/**
    *  Display as disabled
    */isDisabled:_propTypes2.default.bool,/**
    *  Display as read-only
    */isReadOnly:_propTypes2.default.bool,/**
    *  Display loading state
    */isLoading:_propTypes2.default.bool,/**
    *  Initial HTML value attribute
    */defaultValue:_propTypes2.default.string,/**
    *  HTML value attribute
    */value:_propTypes2.default.string,/**
     * HTML id attribute (overwrite default)
     */id:_propTypes2.default.string,/**
     *  Button click callback function: ( e ) => { ... }
     */onClick:_propTypes2.default.func,/**
     *  Mouse over callback function: ( e ) => { ... }
     */onMouseOver:_propTypes2.default.func,/**
     *  Mouse out callback function: ( e ) => { ... }
     */onMouseOut:_propTypes2.default.func,/**
     * Display as hover when required from another component
     */forceHover:_propTypes2.default.bool,/**
     * Callback that receives the native <button>: ( ref ) => { ... }
     */buttonRef:_propTypes2.default.func};Button.defaultProps={type:'button',role:'default',iconType:'none',iconPosition:'left',isLoading:false,isDisabled:false,isReadOnly:false,forceHover:false,cssMap:__webpack_require__(111)};exports.default=Button;/***/}
445590
async function compile() {
  let codes;
  const paths = await glob(['./es/**/*.less', './lib/**/*.less'], { absolute: true });

  codes = await Promise.all(paths.map(path => fs.readFile(path, 'utf-8')));
  codes = await compileLess(codes, paths);
  codes = await compilePostcss(codes, paths);
  codes = await compileCsso(codes);

  await dest(codes, paths);
}
106099
function stripify(file) {
  if (/\.json$/.test(file)) return through();

  var code = '';

  function transform(chunk, encoding, next) {
    code += chunk;
    next();
  }

  function flush(done) {
    /* jshint validthis: true */
    var ast = rocambole.parse(code);

    code = rocambole.moonwalk(ast, function strip(node) {
      if (( // var debug = function() {};
          'VariableDeclaration' === node.type
        && 'debug' === node.declarations[0].id.name
      ) || ( // if (process.env.NODE_ENV !== 'production') { debug = ... }
          'IfStatement' === node.type
        && 'BinaryExpression' === node.test.type
        && 'production' === node.test.right.value
      ) || ( // debug( ... );
          'ExpressionStatement' === node.type
        && 'CallExpression' === node.expression.type
        && 'debug' === node.expression.callee.name
      )) {
        return remove(node);
      }
    });

    this.push(code.toString());
    done();
  }

  return through(transform, flush);
}
1225310
async function build() {
  console.time('Packager');

  let requires = [];
  let esmExportString = '';
  let cjsExportString = '';

  try {
    if (!fs.existsSync(DIST_PATH)) fs.mkdirSync(DIST_PATH);
    fs.writeFileSync(ROLLUP_INPUT_FILE, '');
    fs.writeFileSync(TEST_MODULE_FILE, '');

    // All the snippets that are Node.js-based and will break in a browser
    // environment
    const nodeSnippets = fs
      .readFileSync('tag_database', 'utf8')
      .split('\n')
      .filter(v => v.search(/:.*node/g) !== -1)
      .map(v => v.slice(0, v.indexOf(':')));

    const snippets = fs.readdirSync(SNIPPETS_PATH);
    const archivedSnippets = fs
      .readdirSync(SNIPPETS_ARCHIVE_PATH)
      .filter(v => v !== 'README.md');

    snippets.forEach(snippet => {
      const rawSnippetString = getRawSnippetString(SNIPPETS_PATH, snippet);
      const snippetName = snippet.replace('.md', '');
      let code = getCode(rawSnippetString);
      if (nodeSnippets.includes(snippetName)) {
        requires.push(code.match(/const.*=.*require\(([^\)]*)\);/g));
        code = code.replace(/const.*=.*require\(([^\)]*)\);/g, '');
      }
      esmExportString += `export ${code}`;
      cjsExportString += code;
    });
    archivedSnippets.forEach(snippet => {
      const rawSnippetString = getRawSnippetString(
        SNIPPETS_ARCHIVE_PATH,
        snippet
      );
      cjsExportString += getCode(rawSnippetString);
    });

    requires = [
      ...new Set(
        requires
          .filter(Boolean)
          .map(v =>
            v[0].replace(
              'require(',
              'typeof require !== "undefined" && require('
            )
          )
      )
    ].join('\n');

    fs.writeFileSync(ROLLUP_INPUT_FILE, `${requires}\n\n${esmExportString}`);

    const testExports = `module.exports = {${[...snippets, ...archivedSnippets]
      .map(v => v.replace('.md', ''))
      .join(',')}}`;

    fs.writeFileSync(
      TEST_MODULE_FILE,
      `${requires}\n\n${cjsExportString}\n\n${testExports}`
    );

    // Check Travis builds - Will skip builds on Travis if not CRON/API
    if (util.isTravisCI() && util.isNotTravisCronOrAPI()) {
      fs.unlink(ROLLUP_INPUT_FILE);
      console.log(
        `${chalk.green(
          'NOBUILD'
        )} Module build terminated, not a cron job or a custom build!`
      );
      console.timeEnd('Packager');
      process.exit(0);
    }

    await doRollup();

    // Clean up the temporary input file Rollup used for building the module
    fs.unlink(ROLLUP_INPUT_FILE);

    console.log(`${chalk.green('SUCCESS!')} Snippet module built!`);
    console.timeEnd('Packager');
  } catch (err) {
    console.log(`${chalk.red('ERROR!')} During module creation: ${err}`);
    process.exit(1);
  }
}
662908
function(target, dist) { // eslint-disable-line complexity
        var compareObject = function(targetObj, distObj) {
            var result = false;

            snippet.forEach(targetObj, function(item, key) {
                result = (item === distObj[key]);

                return result;
            });

            return result;
        };
        var result = true;
        var isDiff;

        if (typeof target !== typeof dist) {
            result = false;
        } else if (_.isArray(target) && target.length !== dist.length) {
            result = false;
        } else if (_.isObject(target)) {
            isDiff = !compareObject(target, dist) || !compareObject(dist, target);

            result = !isDiff;
        } else if (target !== dist) {
            result = false;
        }

        return result;
    }