/* [MS-OLEPS] 2.15 TypedPropertyValue
500866
function parse_TypedPropertyValue(blob, type, _opts) {
	var t = blob.read_shift(2), ret, opts = _opts||{};
	blob.l += 2;
	if(type !== VT_VARIANT)
	if(t !== type && VT_CUSTOM.indexOf(type)===-1) throw new Error('Expected type ' + type + ' saw ' + t);
	switch(type === VT_VARIANT ? t : type) {
		case 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;
		case 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;
		case 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;
		case 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;
		case 0x1E /*VT_LPSTR*/: return parse_lpstr(blob, t, 4).replace(chr0,'');
		case 0x1F /*VT_LPWSTR*/: return parse_lpwstr(blob);
		case 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);
		case 0x41 /*VT_BLOB*/: return parse_BLOB(blob);
		case 0x47 /*VT_CF*/: return parse_ClipboardData(blob);
		case 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw && 4).replace(chr0,'');
		case 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t/*, 4*/).replace(chr0,'');
		case 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPair(blob);
		case 0x101E /*VT_LPSTR*/: return parse_VtVecUnalignedLpstr(blob);
		default: throw new Error("TypedPropertyValue unrecognized type " + type + " " + t);
	}
}
205982
function missingValue(oValue, sSegment, iPathLength) {
			var sPropertyPath = "",
				sReadLink,
				sServiceUrl;

			if (sPath[0] !== '(') {
				sPropertyPath += "/";
			}
			sPropertyPath += sPath.split("/").slice(0, iPathLength).join("/");
			return that.oRequestor.getModelInterface()
				.fetchMetadata(that.sMetaPath + _Helper.getMetaPath(sPropertyPath))
				.then(function (oProperty) {
					if (!oProperty) {
						return invalidSegment(sSegment);
					}
					if (oProperty.$Type === "Edm.Stream") {
						sReadLink = oValue[sSegment + "@odata.mediaReadLink"];
						sServiceUrl = that.oRequestor.getServiceUrl();
						return sReadLink || sServiceUrl + that.sResourcePath + sPropertyPath;
					}
					if (!bTransient) {
						return invalidSegment(sSegment);
					}
					if (oProperty.$kind === "NavigationProperty") {
						return null;
					}
					if (!oProperty.$Type.startsWith("Edm.")) {
						return {};
					}
					if ("$DefaultValue" in oProperty) {
						return oProperty.$Type === "Edm.String"
							? oProperty.$DefaultValue
							: _Helper.parseLiteral(oProperty.$DefaultValue, oProperty.$Type,
								sPropertyPath);
					}
					return null;
				});
		}
794234
function (sPropertyValue) {
			var bIsBinding = false;
			if (sPropertyValue && typeof sPropertyValue === "string" && sPropertyValue.substring(0, 1) === "{" && sPropertyValue.slice(-1) === "}") {
				bIsBinding = true;
			}
			return bIsBinding;
		}
1237615
function propertyType(property) {
  var type;
  if (property === null || property.type === null) {
    return 'null';
  } else if (property.$ref != null) {
    // Type is a reference
    return simpleRef(property.$ref);
  } else if (property['x-type']) {
    // Type is read from the x-type vendor extension
    type = (property['x-type'] || '').toString().replace('List<', 'Array<');
    return type.length == 0 ? 'null' : type;
  } else if (property['x-nullable']) {
    return 'null | ' + propertyType(
      Object.assign(property, {'x-nullable': undefined}));
  } else if (!property.type && (property.anyOf || property.oneOf)) {
    let variants = (property.anyOf || property.oneOf).map(propertyType);
    return {
      allTypes: mergeTypes(...variants),
      toString: () => variants.join(' | ')
    };
  } else if (Array.isArray(property.type)) {
    let variants = property.type.map(type => propertyType(Object.assign({}, property, {type})));
    return {
      allTypes: mergeTypes(...variants),
      toString: () => variants.join(' | ')
    };
  }
  switch (property.type) {
    case 'null':
      return 'null';
    case 'string':
      if (property.enum && property.enum.length > 0) {
        return '\'' + property.enum.join('\' | \'') + '\'';
      }
      else if (property.const) {
        return '\'' + property.const + '\'';
      }
      return 'string';
    case 'array':
      if (Array.isArray(property.items)) { // support for tuples
        if (!property.maxItems) return 'Array<any>'; // there is unable to define unlimited tuple in TypeScript
        let minItems = property.minItems || 0,
            maxItems = property.maxItems,
            types = property.items.map(propertyType);
        types.push(property.additionalItems ? propertyType(property.additionalItems) : 'any');
        let variants = [];
        for (let i = minItems; i <= maxItems; i++) variants.push(types.slice(0, i));
        return {
          allTypes: mergeTypes(...types.slice(0, maxItems)),
          toString: () => variants.map(types => `[${types.join(', ')}]`).join(' | ')
        };
      }
      else {
        let itemType = propertyType(property.items);
        return {
          allTypes: mergeTypes(itemType),
          toString: () => 'Array<' + itemType + '>'
        };
      }
    case 'integer':
    case 'number':
      if (property.enum && property.enum.length > 0) return property.enum.join(' | ');
      if (property.const) return property.const;
      return 'number';
    case 'boolean':
      return 'boolean';
    case 'file':
      return 'Blob';
    case 'object':
      var def = '{';
      let memberCount = 0;
      var allTypes = [];
      if (property.properties) {
        for (var name in property.properties) {
          var prop = property.properties[name];
          if (memberCount++) def += ', ';
          type = propertyType(prop);
          allTypes.push(type);
	        let required = property.required && property.required.indexOf(name) >= 0;
	        def += name + (required ? ': ' : '?: ') + type;
        }
      }
      if (property.additionalProperties) {
        if (memberCount++) def += ', ';
        type = typeof property.additionalProperties === 'object' ?
            propertyType(property.additionalProperties) : 'any';
	      allTypes.push(type);
        def += '[key: string]: ' + type;
      }
      def += '}';

      return {
        allTypes: mergeTypes(...allTypes),
        toString: () => def,
      };
    default:
      return 'any';
  }
}
48004
function T(iid, val, type, hasGetterSetter, internalIid) {
        var aret;
        associateSidWithFunction(val, internalIid);
        if (hasGetterSetter) {
            for (var offset in val) {
                if (hasGetOwnPropertyDescriptor && val.hasOwnProperty(offset)) {
                    var desc = Object.getOwnPropertyDescriptor(val, offset);
                    if (desc !== undefined) {
                        if (typeof desc.get === 'function') {
                            T(iid, desc.get, 12, false, internalIid);
                        }
                        if (typeof desc.set === 'function') {
                            T(iid, desc.set, 12, false, internalIid);
                        }
                    }
                }
            }
        }
        if (sandbox.analysis && sandbox.analysis.literal) {
            aret = sandbox.analysis.literal(iid, val, hasGetterSetter);
            if (aret) {
                val = aret.result;
            }
        }
        return (lastComputedValue = val);
    }
1371656
public static TypedValue untypedValue(Object value, boolean isTransient) {
    if(value == null) {
      return untypedNullValue(isTransient);
    } else if (value instanceof TypedValueBuilder<?>) {
      return ((TypedValueBuilder<?>) value).setTransient(isTransient).create();
    } else if (value instanceof TypedValue) {
      TypedValue transientValue = (TypedValue) value;
      if (value instanceof NullValueImpl) {
        transientValue = untypedNullValue(isTransient);
      } else if (value instanceof FileValue) {
        ((FileValueImpl) transientValue).setTransient(isTransient);
      } else if (value instanceof AbstractTypedValue<?>) {
        ((AbstractTypedValue<?>) transientValue).setTransient(isTransient);
      }
      return transientValue;
    }
    else {
      // unknown value
      return new UntypedValueImpl(value, isTransient);
    }
  }
1033515
@SuppressWarnings("unchecked")
	private <T> T getPropertyAs(String propertyName, Class<T> propertyType) {
		final String sValue = properties == null ? null : properties.getProperty(propertyName);
		final T value;
		if (sValue == null) {
			value = null;
		} else if (propertyType.equals(String.class)) {
			value = propertyType.cast(sValue);
		} else if (propertyType.equals(Integer.class)) {
			value = propertyType.cast(Integer.valueOf(sValue));
		} else if (propertyType.equals(int.class)) {
			value = (T) Integer.valueOf(sValue);
		} else if (propertyType.equals(Long.class)) {
			value = propertyType.cast(Long.valueOf(sValue));
		} else if (propertyType.equals(long.class)) {
			value = (T) Long.valueOf(sValue);
		} else if (propertyType.equals(Boolean.class)) {
			value = propertyType.cast(Boolean.valueOf(sValue));
		} else if (propertyType.equals(boolean.class)) {
			value = (T) Boolean.valueOf(sValue);
		} else {
			value = null;
		}
		return value;
	}
80466
function isJSValueCompatibleWithColumnType(value, columnType) {
    
    // Allow NULL values to be stored in columns of any type
    if (_.isNull(value)) {
        return true;
    }
    
    switch (columnType) {
        case ColumnType.Object:
            return _.isObject(value);
        case ColumnType.Array:
            return _.isArray(value);
        case ColumnType.String:
        case ColumnType.Text:
            return true; // Allow any value to be stored in a string column
        case ColumnType.Boolean:
        case ColumnType.Bool:
        case ColumnType.Integer:
        case ColumnType.Int:
            return _.isBool(value) || _.isInteger(value);
        case ColumnType.Date:
            return _.isDate(value);
        case ColumnType.Real:
        case ColumnType.Float:
            return _.isNumber(value);
        default:
            return false;
    }
}
170702
function (control) {
				var properties = control.getMetadata().getAllProperties();
				var propertiesBindingData = Object.create(null);

				for (var key in properties) {
					if (properties.hasOwnProperty(key) && control.getBinding(key)) {
						propertiesBindingData[key] = Object.create(null);
						propertiesBindingData[key].path = control.getBinding(key).getPath();
						propertiesBindingData[key].value = control.getBinding(key).getValue();
						propertiesBindingData[key].type = control.getMetadata().getProperty(key).getType().getName ? control.getMetadata().getProperty(key).getType().getName() : '';
						propertiesBindingData[key].mode = control.getBinding(key).getBindingMode();
						propertiesBindingData[key].model = this._getModelFromContext(control, key);
					}
				}

				return propertiesBindingData;
			}
80576
function customPropertiesSupported () {
  if (typeof cachedReturnVal !== 'undefined') return cachedReturnVal
  return cachedReturnVal = (
    canUseDOM &&
    !(Browser.msedge) && // polyfill edge until improved css variable support
    window.CSS && window.CSS.supports && window.CSS.supports('color', 'var(--primary)')
  )
}
1090688
public Object convertFormValueToModelValue(Object propertyValue) {
    if (propertyValue==null || "".equals(propertyValue)) {
      return null;
    }
    return Boolean.valueOf(propertyValue.toString());
  }
1019722
function getPropertyType (el, property) {
  var component;
  var componentName;
  var split;
  var propertyName;

  split = property.split('.');
  componentName = split[0];
  propertyName = split[1];
  component = el.components[componentName] || components[componentName];

  // Primitives.
  if (!component) { return null; }

  // Dynamic schema. We only care about vectors anyways.
  if (propertyName && !component.schema[propertyName]) { return null; }

  // Multi-prop.
  if (propertyName) { return component.schema[propertyName].type; }

  // Single-prop.
  return component.schema.type;
}
1370925
public void convert(TypeDesc fromType, TypeDesc toType) {
        if (toType == TypeDesc.OBJECT) {
            if (fromType.isPrimitive()) {
                toType = fromType.toObjectType();
            }
            else {
                return;
            }
        }

        if (fromType == toType) {
            return;
        }

        TypeDesc fromPrimitiveType = fromType.toPrimitiveType();
        if (fromPrimitiveType == null) {
            throw invalidConversion(fromType, toType);
        }
        int fromTypeCode = fromPrimitiveType.getTypeCode();

        if (!fromType.isPrimitive()) {
            unbox(fromType, fromPrimitiveType);
        }

        TypeDesc toPrimitiveType = toType.toPrimitiveType();
        if (toPrimitiveType == null) {
            throw invalidConversion(fromType, toType);
        }
        int toTypeCode = toPrimitiveType.getTypeCode();

        int stackAdjust = 0;
        byte op;

        switch (fromTypeCode) {
        case TypeDesc.INT_CODE:
        case TypeDesc.BYTE_CODE:
        case TypeDesc.SHORT_CODE:
        case TypeDesc.CHAR_CODE:
        case TypeDesc.BOOLEAN_CODE:
            switch (toTypeCode) {
            case TypeDesc.BYTE_CODE:
                op = (fromTypeCode == TypeDesc.BYTE_CODE) ?
                    Opcode.NOP : Opcode.I2B;
                break;
            case TypeDesc.SHORT_CODE:
                op = (fromTypeCode == TypeDesc.SHORT_CODE) ?
                    Opcode.NOP : Opcode.I2S;
                break;
            case TypeDesc.CHAR_CODE:
                op = (fromTypeCode == TypeDesc.CHAR_CODE) ?
                    Opcode.NOP : Opcode.I2C;
                break;
            case TypeDesc.FLOAT_CODE:
                op = Opcode.I2F;
                break;
            case TypeDesc.LONG_CODE:
                stackAdjust = 1;
                op = Opcode.I2L;
                break;
            case TypeDesc.DOUBLE_CODE:
                stackAdjust = 1;
                op = Opcode.I2D;
                break;
            case TypeDesc.INT_CODE:
                op = Opcode.NOP;
                break;
            case TypeDesc.BOOLEAN_CODE:
                toBoolean(!toType.isPrimitive());
                return;
            default:
                throw invalidConversion(fromType, toType);
            }
            break;

        case TypeDesc.LONG_CODE:
            switch (toTypeCode) {
            case TypeDesc.INT_CODE:
                stackAdjust = -1;
                op = Opcode.L2I;
                break;
            case TypeDesc.FLOAT_CODE:
                stackAdjust = -1;
                op = Opcode.L2F;
                break;
            case TypeDesc.DOUBLE_CODE:
                op = Opcode.L2D;
                break;
            case TypeDesc.BYTE_CODE:
            case TypeDesc.CHAR_CODE:
            case TypeDesc.SHORT_CODE:
                addCode(-1, Opcode.L2I);
                convert(TypeDesc.INT, toPrimitiveType);
                // fall through
            case TypeDesc.LONG_CODE:
                op = Opcode.NOP;
                break;
            case TypeDesc.BOOLEAN_CODE:
                loadConstant(0L);
                math(Opcode.LCMP);
                toBoolean(!toType.isPrimitive());
                return;
            default:
                throw invalidConversion(fromType, toType);
            }
            break;

        case TypeDesc.FLOAT_CODE:
            switch (toTypeCode) {
            case TypeDesc.INT_CODE:
                op = Opcode.F2I;
                break;
            case TypeDesc.LONG_CODE:
                stackAdjust = 1;
                op = Opcode.F2L;
                break;
            case TypeDesc.DOUBLE_CODE:
                stackAdjust = 1;
                op = Opcode.F2D;
                break;
            case TypeDesc.BYTE_CODE:
            case TypeDesc.CHAR_CODE:
            case TypeDesc.SHORT_CODE:
                addCode(0, Opcode.F2I);
                convert(TypeDesc.INT, toPrimitiveType);
                // fall through
            case TypeDesc.FLOAT_CODE:
                op = Opcode.NOP;
                break;
            case TypeDesc.BOOLEAN_CODE:
                loadConstant(0.0f);
                math(Opcode.FCMPG);
                toBoolean(!toType.isPrimitive());
                return;
            default:
                throw invalidConversion(fromType, toType);
            }
            break;

        case TypeDesc.DOUBLE_CODE:
            switch (toTypeCode) {
            case TypeDesc.INT_CODE:
                stackAdjust = -1;
                op = Opcode.D2I;
                break;
            case TypeDesc.FLOAT_CODE:
                stackAdjust = -1;
                op = Opcode.D2F;
                break;
            case TypeDesc.LONG_CODE:
                op = Opcode.D2L;
                break;
            case TypeDesc.BYTE_CODE:
            case TypeDesc.CHAR_CODE:
            case TypeDesc.SHORT_CODE:
                addCode(-1, Opcode.D2I);
                convert(TypeDesc.INT, toPrimitiveType);
                // fall through
            case TypeDesc.DOUBLE_CODE:
                op = Opcode.NOP;
                break;
            case TypeDesc.BOOLEAN_CODE:
                loadConstant(0.0d);
                math(Opcode.DCMPG);
                toBoolean(!toType.isPrimitive());
                return;
            default:
                throw invalidConversion(fromType, toType);
            }
            break;

        default:
            throw invalidConversion(fromType, toType);
        }

        if (toType.isPrimitive()) {
            if (op != Opcode.NOP) {
                addCode(stackAdjust, op);
            }
        }
        else {
            if (op == Opcode.NOP) {
                prebox(toPrimitiveType, toType);
            }
            // Slight optimization here. Perform prebox on single word value,
            // depending on what conversion is being applied.
            else if (!fromPrimitiveType.isDoubleWord() &&
                     toPrimitiveType.isDoubleWord()) {
                prebox(fromPrimitiveType, toType);
                addCode(stackAdjust, op);
            }
            else {
                addCode(stackAdjust, op);
                prebox(toPrimitiveType, toType);
            }
            box(toPrimitiveType, toType);
        }
    }
570730
@Override
    public Object getValue(Object instance, String propertyName) {
        PropertyAccessor accessor = PropertyProxyUtils.getPropertyAccessor(this.conversionService, this.useDirectFieldAccess, instance);
        Object value = accessor.getPropertyValue(propertyName);
        if(log.isDebugEnabled()) {
            getType(instance, propertyName);
            log.debug("Actual type of value for property '"+propertyName+"' on instance "+instance+" is "+(value != null ? value.getClass() : null));
        }
        
        TypeDescriptor targetType = accessor.getPropertyTypeDescriptor(propertyName);
        TypeDescriptor sourceType = value == null ? targetType : TypeDescriptor.valueOf(value.getClass());
        if (this.conversionService.canConvert(sourceType, targetType)) {
            value = this.conversionService.convert(value, sourceType, targetType);
        }
        return value;
    }
1363353
@SuppressWarnings("unchecked")
	public <T> T getPropertyValue(ElementDescriptor<T> property)
	{
		if (mProperties == null)
		{
			return null;
		}
		return (T) mProperties.get(property);
	}
268000
private static String readAnnotationValue(String ref, TypeDef source, Property property) {
        return convertMap(ref, source, ((ClassRef)property.getTypeRef()).getDefinition());
    }
1257655
function checkSelectPropTypes(inst, props) {
  var owner = inst._currentElement._owner;
  LinkedValueUtils.checkPropTypes('select', props, owner);

  if (props.valueLink !== undefined && !didWarnValueLink) {
     false ? warning(false, '`valueLink` prop on `select` is deprecated; set `value` and `onChange` instead.') : void 0;
    didWarnValueLink = true;
  }

  for (var i = 0; i < valuePropNames.length; i++) {
    var propName = valuePropNames[i];
    if (props[propName] == null) {
      continue;
    }
    var isArray = Array.isArray(props[propName]);
    if (props.multiple && !isArray) {
       false ? warning(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
    } else if (!props.multiple && isArray) {
       false ? warning(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum(owner)) : void 0;
    }
  }
}