function fillOptionsWithMissingValue(options, value, optionLabelProp, labelInValue) {
  var values = toArray(value).slice().sort();

  var cloneOptions = _toConsumableArray(options); // Convert options value to set


  var optionValues = new Set();
  options.forEach(function (opt) {
    if (opt.options) {
      opt.options.forEach(function (subOpt) {
        optionValues.add(subOpt.value);
      });
    } else {
      optionValues.add(opt.value);
    }
  }); // Fill missing value

  values.forEach(function (item) {
    var val = labelInValue ? item.value : item;

    if (!optionValues.has(val)) {
      var _ref5;

      cloneOptions.push(labelInValue ? (_ref5 = {}, _defineProperty(_ref5, optionLabelProp, item.label), _defineProperty(_ref5, "value", val), _ref5) : {
        value: val
      });
    }
  });
  return cloneOptions;
}
/**
 * `tags` mode should fill un-list item into the option list
 */
`tags` mode should fill un-list item into the option list
` tags ` mode should fill un - list item into the option list
function fillOptionsWithMissingValue(options, value, optionLabelProp, labelInValue) {
  var values = toArray(value).slice().sort();
  var cloneOptions = _toConsumableArray(options); 
  var optionValues = new Set();
  options.forEach(function (opt) {
    if (opt.options) {
      opt.options.forEach(function (subOpt) {
        optionValues.add(subOpt.value);
      });
    } else {
      optionValues.add(opt.value);
    }
  }); 
  values.forEach(function (item) {
    var val = labelInValue ? item.value : item;
    if (!optionValues.has(val)) {
      var _ref5;
      cloneOptions.push(labelInValue ? (_ref5 = {}, _defineProperty(_ref5, optionLabelProp, item.label), _defineProperty(_ref5, "value", val), _ref5) : {
        value: val
      });
    }
  });
  return cloneOptions;
}
function fillOptionsWithMissingValue ( options , value , optionLabelProp , labelInValue ) { var values = toArray ( value ) . slice ( ) . sort ( ) ; var cloneOptions = _toConsumableArray ( options ) ; var optionValues = new Set ( ) ; options . forEach ( function ( opt ) { if ( opt . options ) { opt . options . forEach ( function ( subOpt ) { optionValues . add ( subOpt . value ) ; } ) ; } else { optionValues . add ( opt . value ) ; } } ) ; values . forEach ( function ( item ) { var val = labelInValue ? item . value : item ; if ( ! optionValues . has ( val ) ) { var _ref5 ; cloneOptions . push ( labelInValue ? ( _ref5 = { } , _defineProperty ( _ref5 , optionLabelProp , item . label ) , _defineProperty ( _ref5 , "value" , val ) , _ref5 ) : { value : val } ) ; } } ) ; return cloneOptions ; }
`tags` mode should fill un-list item into the option list
` tags ` mode should fill un - list item into the option list
// Convert options value to set // Fill missing value