Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/events/events",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.addListenersFromObj=addListenersFromObj;exports.getComponentFn=getComponentFn;var _metal=require("frontend-js-metal-web$metal");function addListenersFromObj(component,events){var eventNames=Object.keys(events||{});var handles=[];for(var i=
0;i<eventNames.length;i++){var info=extractListenerInfo_(component,events[eventNames[i]]);if(info.fn){var handle=void 0;if(info.selector)handle=component.delegate(eventNames[i],info.selector,info.fn);else handle=component.on(eventNames[i],info.fn);handles.push(handle)}}return handles}function extractListenerInfo_(component,value){var info={fn:value};if((0,_metal.isObject)(value)&&!(0,_metal.isFunction)(value)){info.selector=value.selector;info.fn=value.fn}if((0,_metal.isString)(info.fn))info.fn=getComponentFn(component,
info.fn);return info}function getComponentFn(component,fnName){if((0,_metal.isFunction)(component[fnName]))return component[fnName].bind(component);else console.error("No function named "+fnName+' was found in the component\n\t\t\t"'+(0,_metal.getFunctionName)(component.constructor)+'". Make sure that you specify\n\t\t\tvalid function names when adding inline listeners')}});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/sync/sync",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.syncState=syncState;var _metal=require("frontend-js-metal-web$metal");var SYNC_FNS_KEY="__METAL_SYNC_FNS__";function getSyncFns_(component){var ctor=component.constructor;if(ctor.hasOwnProperty(SYNC_FNS_KEY))return ctor[SYNC_FNS_KEY];var fns=
{};var keys=component.getDataManager().getSyncKeys(component);var canCache=true;for(var i=0;i<keys.length;i++){var name="sync"+keys[i].charAt(0).toUpperCase()+keys[i].slice(1);var fn=component[name];if(fn){fns[keys[i]]=fn;canCache=canCache&&component.constructor.prototype[name]}}if(canCache)ctor[SYNC_FNS_KEY]=fns;return fns}function syncState(component,changes){var syncFns=getSyncFns_(component);var keys=Object.keys(changes||syncFns);for(var i=0;i<keys.length;i++){var fn=syncFns[keys[i]];if((0,_metal.isFunction)(fn)){var change=
changes&&changes[keys[i]];var manager=component.getDataManager();fn.call(component,change?change.newVal:manager.get(component,keys[i]),change?change.prevVal:undefined)}}}});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.16.5/lib/validators",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};var _metal=require("frontend-js-metal-web$metal");
var ERROR_OBJECT_OF_TYPE="Expected object of one type.";var ERROR_ONE_OF="Expected one of the following values:";var ERROR_ONE_OF_TYPE="Expected one of given types.";var validators={any:function any(){return function(){return true}},array:buildTypeValidator("array"),bool:buildTypeValidator("boolean"),func:buildTypeValidator("function"),number:buildTypeValidator("number"),object:buildTypeValidator("object"),string:buildTypeValidator("string"),arrayOf:function arrayOf(validator){if(isInvalid(validators.func(validator)))throwConfigError("function",
validator,"arrayOf");return maybe(function(value,name,context){var result=validators.array(value,name,context);if(isInvalid(result))return result;return validateArrayItems(validator,value,name,context)})},inRange:function inRange(min,max){var minResult=validators.number(min);var maxResult=validators.number(max);if(isInvalid(minResult))return minResult;if(isInvalid(maxResult))return maxResult;return maybe(function(value){var valueResult=validators.number(value);if(isInvalid(valueResult))return valueResult;
return value>=min&&value<=max})},instanceOf:function instanceOf(expectedClass){return maybe(function(value,name,context){if(value instanceof expectedClass)return true;var msg="Expected instance of "+expectedClass;return composeError(msg,name,context)})},objectOf:function objectOf(validator){if(isInvalid(validators.func(validator)))throwConfigError("function",validator,"objectOf");return maybe(function(value,name,context){for(var key in value)if(isInvalid(validator(value[key])))return composeError(ERROR_OBJECT_OF_TYPE,
name,context);return true})},oneOf:function oneOf(arrayOfValues){return maybe(function(value,name,context){var result=validators.array(arrayOfValues,name,context);if(isInvalid(result))return result;return arrayOfValues.indexOf(value)===-1?composeError(composeOneOfErrorMessage(arrayOfValues),name,context):true})},oneOfType:function oneOfType(arrayOfTypeValidators){return maybe(function(value,name,context){var result=validators.array(arrayOfTypeValidators,name,context);if(isInvalid(result))return result;
for(var i=0;i<arrayOfTypeValidators.length;i++)if(!isInvalid(arrayOfTypeValidators[i](value,name,context)))return true;return composeError(ERROR_ONE_OF_TYPE,name,context)})},shapeOf:function shapeOf(shape){if(isInvalid(validators.object(shape)))throwConfigError("object",shape,"shapeOf");return maybe(function(value,name,context){var valueResult=validators.object(value,name,context);if(isInvalid(valueResult))return valueResult;for(var key in shape)if(Object.prototype.hasOwnProperty.call(shape,key)){var validator=
shape[key];var required=false;if(validator.config){required=validator.config.required;validator=validator.config.validator}if(required&&!(0,_metal.isDefAndNotNull)(value[key])||isInvalid(validator(value[key])))return validator(value[key],name+"."+key,context)}return true})}};function buildTypeValidator(expectedType){var validatorFn=maybe(validateType.bind(null,expectedType));return function(){if(arguments.length===0)return validatorFn;else return validatorFn.apply(undefined,arguments)}}function composeError(error,
name,context){var compName=context?(0,_metal.getFunctionName)(context.constructor):null;var renderer=context&&context.getRenderer&&context.getRenderer();var parent=renderer&&renderer.getParent&&renderer.getParent();var parentName=parent?(0,_metal.getFunctionName)(parent.constructor):null;var location=parentName?"Check render method of '"+parentName+"'.":"";return new Error("Invalid state passed to '"+name+"'."+(" "+error+" Passed to '"+compName+"'. "+location))}function composeOneOfErrorMessage(arrayOfValues){return ERROR_ONE_OF+
" "+JSON.stringify(arrayOfValues)+"."}function getType(value){return Array.isArray(value)?"array":typeof value==="undefined"?"undefined":_typeof(value)}function isInvalid(result){return result instanceof Error}function maybe(typeValidator){return function(value,name,context){return(0,_metal.isDefAndNotNull)(value)?typeValidator(value,name,context):true}}function throwConfigError(expectedType,value,name){var type=getType(value);throw new Error("Expected type "+expectedType+", but received type "+type+
". passed to "+name+".");}function validateArrayItems(validator,value,name,context){for(var i=0;i<value.length;i++)if(isInvalid(validator(value[i],name,context))){var itemValidatorError=validator(value[i],name,context);var errorMessage="Validator for "+name+"["+i+'] says: "'+itemValidatorError+'"';return composeError(errorMessage,name,context)}return true}function validateType(expectedType,value,name,context){var type=getType(value);if(type!==expectedType){var msg="Expected type '"+expectedType+"', but received type '"+
type+"'.";return composeError(msg,name,context)}return true}exports.default=validators});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.16.5/lib/Config",["module","exports","require","./validators"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _validators=require("./validators");var _validators2=_interopRequireDefault(_validators);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var Config={any:setPrimitiveValidators("any"),array:setPrimitiveValidators("array"),arrayOf:setNestedValidators("arrayOf"),
bool:setPrimitiveValidators("bool"),func:setPrimitiveValidators("func"),inRange:function inRange(min,max){return this.validator(_validators2.default.inRange(min,max))},instanceOf:setExplicitValueValidators("instanceOf"),number:setPrimitiveValidators("number"),object:setPrimitiveValidators("object"),objectOf:setNestedValidators("objectOf"),oneOf:setExplicitValueValidators("oneOf"),oneOfType:function oneOfType(validatorArray){validatorArray=validatorArray.map(function(configObj){return configObj.config.validator});
return this.validator(_validators2.default.oneOfType(validatorArray))},shapeOf:function shapeOf(shapeObj){shapeObj=destructShapeOfConfigs(shapeObj);return this.validator(_validators2.default.shapeOf(shapeObj))},string:setPrimitiveValidators("string"),internal:function internal(){var internal=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;return mergeConfig(this,{internal:internal})},required:function required(){var required=arguments.length>0&&arguments[0]!==undefined?arguments[0]:
true;return mergeConfig(this,{required:required})},setter:function setter(_setter){return mergeConfig(this,{setter:_setter})},validator:function validator(_validator){return mergeConfig(this,{validator:_validator})},value:function value(_value){return mergeConfig(this,{value:_value})},valueFn:function valueFn(_valueFn){return mergeConfig(this,{valueFn:_valueFn})},writeOnce:function writeOnce(){var writeOnce=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;return mergeConfig(this,{writeOnce:writeOnce})}};
function destructShapeOfConfigs(shape){var keys=Object.keys(shape);var retShape={};keys.forEach(function(key){var value=shape[key];retShape[key]=value.config&&value.config.validator?value.config.validator:destructShapeOfConfigs(value)});return retShape}function mergeConfig(context,config){var obj=context;var objConfig=obj.config||{};obj=Object.create(Config);obj.config={};Object.assign(obj.config,objConfig,config);return obj}function setExplicitValueValidators(name){return function(arg){return this.validator(_validators2.default[name](arg))}}
function setNestedValidators(name){return function(arg){return this.validator(_validators2.default[name](arg.config.validator))}}function setPrimitiveValidators(name){return function(){return this.validator(_validators2.default[name])}}exports.default=Config});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.16.5/lib/State",["module","exports","require","frontend-js-metal-web$metal","frontend-js-metal-web$metal-events"],function(module,exports,require){var define=undefined;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 _get=function get(object,property,receiver){if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null)return undefined;
else return get(parent,property,receiver)}else if("value"in desc)return desc.value;else{var getter=desc.get;if(getter===undefined)return undefined;return getter.call(receiver)}};var _metal=require("frontend-js-metal-web$metal");var _metalEvents=require("frontend-js-metal-web$metal-events");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==="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);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 State=function(_EventEmitter){_inherits(State,_EventEmitter);function State(config,obj,context){_classCallCheck(this,State);var _this=_possibleConstructorReturn(this,(State.__proto__||Object.getPrototypeOf(State)).call(this));_this.context_=context||_this;_this.keysBlacklist_=null;_this.obj_=obj||_this;_this.eventData_=null;_this.scheduledBatchData_=null;_this.stateInfo_={};_this.stateConfigs_={};_this.initialValues_=_metal.object.mixin({},config);_this.setShouldUseFacade(true);_this.configStateFromStaticHint_();
Object.defineProperty(_this.obj_,State.STATE_REF_KEY,{configurable:true,enumerable:false,value:_this});return _this}_createClass(State,[{key:"assertGivenIfRequired_",value:function assertGivenIfRequired_(name){var config=this.stateConfigs_[name];if(config.required){var info=this.getStateInfo(name);var value=info.state===State.KeyStates.INITIALIZED?this.get(name):this.initialValues_[name];if(!(0,_metal.isDefAndNotNull)(value)){var errorMessage='The property called "'+name+"\" is required but didn't receive a value.";
if(this.shouldThrowValidationError())throw new Error(errorMessage);else console.error(errorMessage)}}}},{key:"assertValidatorReturnInstanceOfError_",value:function assertValidatorReturnInstanceOfError_(validatorReturn){if(validatorReturn instanceof Error)if(this.shouldThrowValidationError())throw validatorReturn;else console.error("Warning: "+validatorReturn)}},{key:"assertValidStateKeyName_",value:function assertValidStateKeyName_(name){if(this.keysBlacklist_&&this.keysBlacklist_[name])throw new Error("It's not allowed to create a state key with the name \""+
name+'".');}},{key:"buildKeyPropertyDef_",value:function buildKeyPropertyDef_(name){return{configurable:true,enumerable:true,get:function get(){return this[State.STATE_REF_KEY].getStateKeyValue_(name)},set:function set(val){this[State.STATE_REF_KEY].setStateKeyValue_(name,val)}}}},{key:"callFunction_",value:function callFunction_(fn,args){if((0,_metal.isString)(fn))return this.context_[fn].apply(this.context_,args);else if((0,_metal.isFunction)(fn))return fn.apply(this.context_,args)}},{key:"callSetter_",
value:function callSetter_(name,value,currentValue){var config=this.stateConfigs_[name];if(config.setter)value=this.callFunction_(config.setter,[value,currentValue]);return value}},{key:"callValidator_",value:function callValidator_(name,value){var config=this.stateConfigs_[name];if(config.validator){var validatorReturn=this.callFunction_(config.validator,[value,name,this.context_]);this.assertValidatorReturnInstanceOfError_(validatorReturn);return validatorReturn}return true}},{key:"canSetState",
value:function canSetState(name){var info=this.getStateInfo(name);return!this.stateConfigs_[name].writeOnce||!info.written}},{key:"configState",value:function configState(configs,context){var names=Object.keys(configs);if(names.length===0)return;if(context!==false){var props={};for(var i=0;i<names.length;i++){var name=names[i];this.assertValidStateKeyName_(name);props[name]=this.buildKeyPropertyDef_(name)}Object.defineProperties(context||this.obj_,props)}this.stateConfigs_=configs;for(var _i=0;_i<
names.length;_i++){var _name=names[_i];configs[_name]=configs[_name].config?configs[_name].config:configs[_name];this.assertGivenIfRequired_(names[_i]);this.validateInitialValue_(names[_i])}}},{key:"configStateFromStaticHint_",value:function configStateFromStaticHint_(){var ctor=this.constructor;if(ctor!==State){var defineContext=void 0;if(this.obj_===this){var staticKey=State.STATE_STATIC_HINT_CONFIGURED;ctor[staticKey]=ctor[staticKey]||{};defineContext=ctor[staticKey][ctor.name]?false:ctor.prototype;
ctor[staticKey][ctor.name]=true}this.configState(State.getStateStatic(ctor),defineContext)}}},{key:"disposeInternal",value:function disposeInternal(){_get(State.prototype.__proto__||Object.getPrototypeOf(State.prototype),"disposeInternal",this).call(this);this.initialValues_=null;this.stateInfo_=null;this.stateConfigs_=null;this.scheduledBatchData_=null}},{key:"emitBatchEvent_",value:function emitBatchEvent_(){if(!this.isDisposed()){this.context_.emit("stateWillChange",this.scheduledBatchData_);var data=
this.scheduledBatchData_;this.scheduledBatchData_=null;this.context_.emit("stateChanged",data)}}},{key:"get",value:function get(name){return this.obj_[name]}},{key:"getState",value:function getState(){var names=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.getStateKeys();var state={};for(var i=0;i<names.length;i++)state[names[i]]=this.get(names[i]);return state}},{key:"getStateInfo",value:function getStateInfo(name){if(!this.stateInfo_[name])this.stateInfo_[name]={};return this.stateInfo_[name]}},
{key:"getStateKeyConfig",value:function getStateKeyConfig(name){return this.stateConfigs_?this.stateConfigs_[name]:null}},{key:"getStateKeys",value:function getStateKeys(){return this.stateConfigs_?Object.keys(this.stateConfigs_):[]}},{key:"getStateKeyValue_",value:function getStateKeyValue_(name){if(!this.warnIfDisposed_(name)){this.initStateKey_(name);return this.getStateInfo(name).value}}},{key:"hasBeenSet",value:function hasBeenSet(name){var info=this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZED||
this.hasInitialValue_(name)}},{key:"hasInitialValue_",value:function hasInitialValue_(name){return this.initialValues_.hasOwnProperty(name)&&(0,_metal.isDef)(this.initialValues_[name])}},{key:"hasStateKey",value:function hasStateKey(key){if(!this.warnIfDisposed_(key))return!!this.stateConfigs_[key]}},{key:"informChange_",value:function informChange_(name,prevVal){if(this.shouldInformChange_(name,prevVal)){var data=_metal.object.mixin({key:name,newVal:this.get(name),prevVal:prevVal},this.eventData_);
this.context_.emit(name+"Changed",data);this.context_.emit("stateKeyChanged",data);this.scheduleBatchEvent_(data)}}},{key:"initStateKey_",value:function initStateKey_(name){var info=this.getStateInfo(name);if(info.state!==State.KeyStates.UNINITIALIZED)return;info.state=State.KeyStates.INITIALIZING;this.setInitialValue_(name);if(!info.written)this.setDefaultValue(name);info.state=State.KeyStates.INITIALIZED}},{key:"removeStateKey",value:function removeStateKey(name){this.stateInfo_[name]=null;this.stateConfigs_[name]=
null;delete this.obj_[name]}},{key:"scheduleBatchEvent_",value:function scheduleBatchEvent_(changeData){if(!this.scheduledBatchData_){_metal.async.nextTick(this.emitBatchEvent_,this);this.scheduledBatchData_=_metal.object.mixin({changes:{}},this.eventData_)}var name=changeData.key;var changes=this.scheduledBatchData_.changes;if(changes[name])changes[name].newVal=changeData.newVal;else changes[name]=changeData}},{key:"set",value:function set(name,value){if(this.hasStateKey(name))this.obj_[name]=value}},
{key:"setDefaultValue",value:function setDefaultValue(name){var config=this.stateConfigs_[name];if(config.value!==undefined)this.set(name,config.value);else this.set(name,this.callFunction_(config.valueFn))}},{key:"setEventData",value:function setEventData(data){this.eventData_=data}},{key:"setInitialValue_",value:function setInitialValue_(name){if(this.hasInitialValue_(name)){this.set(name,this.initialValues_[name]);this.initialValues_[name]=undefined}}},{key:"setKeysBlacklist",value:function setKeysBlacklist(blacklist){this.keysBlacklist_=
blacklist}},{key:"setState",value:function setState(values,callback){var _this2=this;Object.keys(values).forEach(function(name){return _this2.set(name,values[name])});if(callback&&this.scheduledBatchData_)this.context_.once("stateChanged",callback)}},{key:"setStateKeyValue_",value:function setStateKeyValue_(name,value){if(this.warnIfDisposed_(name)||!this.canSetState(name)||!this.validateKeyValue_(name,value))return;var prevVal=this.get(name);var info=this.getStateInfo(name);info.value=this.callSetter_(name,
value,prevVal);this.assertGivenIfRequired_(name);info.written=true;this.informChange_(name,prevVal)}},{key:"shouldInformChange_",value:function shouldInformChange_(name,prevVal){var info=this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZED&&((0,_metal.isObject)(prevVal)||prevVal!==this.get(name))}},{key:"shouldThrowValidationError",value:function shouldThrowValidationError(){return false}},{key:"validateInitialValue_",value:function validateInitialValue_(name){if(this.initialValues_.hasOwnProperty(name)&&
!this.callValidator_(name,this.initialValues_[name]))delete this.initialValues_[name]}},{key:"validateKeyValue_",value:function validateKeyValue_(name,value){var info=this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZING||this.callValidator_(name,value)}},{key:"warnIfDisposed_",value:function warnIfDisposed_(name){var disposed=this.isDisposed();if(disposed)console.warn('Error. Trying to access property "'+name+'" on disposed instance');return disposed}}],[{key:"getStateStatic",
value:function getStateStatic(ctor){return(0,_metal.getStaticProperty)(ctor,"STATE",State.mergeState)}},{key:"mergeState",value:function mergeState(mergedVal,currVal){return _metal.object.mixin({},currVal,mergedVal)}}]);return State}(_metalEvents.EventEmitter);State.STATE_REF_KEY="__METAL_STATE_REF_KEY__";State.STATE_STATIC_HINT_CONFIGURED="__METAL_STATE_STATIC_HINT_CONFIGURED__";State.KeyStates={UNINITIALIZED:undefined,INITIALIZING:1,INITIALIZED:2};exports.default=State});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.16.5/lib/all/state",["module","exports","require","../validators","../Config","../State"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.State=exports.Config=exports.validators=undefined;var _validators=require("../validators");var _validators2=_interopRequireDefault(_validators);var _Config=require("../Config");var _Config2=_interopRequireDefault(_Config);var _State=
require("../State");var _State2=_interopRequireDefault(_State);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=_State2.default;exports.validators=_validators2.default;exports.Config=_Config2.default;exports.State=_State2.default});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/ComponentDataManager",["module","exports","require","frontend-js-metal-web$metal","frontend-js-metal-web$metal-state"],function(module,exports,require){var define=undefined;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 _metal=require("frontend-js-metal-web$metal");var _metalState=require("frontend-js-metal-web$metal-state");var _metalState2=_interopRequireDefault(_metalState);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");}var BLACKLIST={components:true,context:true,element:true,refs:true,state:true,stateKey:true,wasRendered:true};var DATA_MANAGER_DATA="__DATA_MANAGER_DATA__";var ComponentDataManager=function(){function ComponentDataManager(){_classCallCheck(this,ComponentDataManager)}_createClass(ComponentDataManager,[{key:"createState_",value:function createState_(component,
data){var state=new _metalState2.default(component.getInitialConfig(),component,component);state.setKeysBlacklist(BLACKLIST);state.configState(_metal.object.mixin({},data,_metalState2.default.getStateStatic(component.constructor)));this.getManagerData(component).state_=state}},{key:"dispose",value:function dispose(component){var data=this.getManagerData(component);if(data.state_)data.state_.dispose();component[DATA_MANAGER_DATA]=null}},{key:"get",value:function get(component,name){return this.getManagerData(component).state_.get(name)}},
{key:"getManagerData",value:function getManagerData(component){return component[DATA_MANAGER_DATA]}},{key:"getSyncKeys",value:function getSyncKeys(component){return this.getManagerData(component).state_.getStateKeys()}},{key:"getStateKeys",value:function getStateKeys(component){return this.getManagerData(component).state_.getStateKeys()}},{key:"getState",value:function getState(component){return this.getManagerData(component).state_.getState()}},{key:"getStateInstance",value:function getStateInstance(component){return this.getManagerData(component).state_}},
{key:"replaceNonInternal",value:function replaceNonInternal(component,data){var state=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.getManagerData(component).state_;var keys=state.getStateKeys();for(var i=0;i<keys.length;i++){var key=keys[i];if(!state.getStateKeyConfig(key).internal)if(data.hasOwnProperty(key)&&(0,_metal.isDef)(data[key]))state.set(key,data[key]);else state.setDefaultValue(key)}}},{key:"setState",value:function setState(component,state,callback){this.getManagerData(component).state_.setState(state,
callback)}},{key:"setUp",value:function setUp(component,data){component[DATA_MANAGER_DATA]={};this.createState_(component,data)}}]);return ComponentDataManager}();exports.default=new ComponentDataManager});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/ComponentRenderer",["module","exports","require"],function(module,exports,require){var define=undefined;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}}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}var ComponentRenderer=function(){function ComponentRenderer(){_classCallCheck(this,ComponentRenderer)}_createClass(ComponentRenderer,
[{key:"dispose",value:function dispose(){}},{key:"getExtraDataConfig",value:function getExtraDataConfig(){}},{key:"render",value:function render(component){if(!component.element)component.element=document.createElement("div");component.informRendered()}},{key:"setUp",value:function setUp(){}},{key:"update",value:function update(){}}]);return ComponentRenderer}();exports.default=new ComponentRenderer});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/Component",["module","exports","require","./events/events","frontend-js-metal-web$metal","./sync/sync","frontend-js-metal-web$metal-dom","./ComponentDataManager","./ComponentRenderer","frontend-js-metal-web$metal-events"],function(module,exports,require){var define=undefined;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 _get=function get(object,property,receiver){if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,
property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null)return undefined;else return get(parent,property,receiver)}else if("value"in desc)return desc.value;else{var getter=desc.get;if(getter===undefined)return undefined;return getter.call(receiver)}};var _events=require("./events/events");var _metal=require("frontend-js-metal-web$metal");var _sync=require("./sync/sync");var _metalDom=require("frontend-js-metal-web$metal-dom");var _ComponentDataManager=require("./ComponentDataManager");
var _ComponentDataManager2=_interopRequireDefault(_ComponentDataManager);var _ComponentRenderer=require("./ComponentRenderer");var _ComponentRenderer2=_interopRequireDefault(_ComponentRenderer);var _metalEvents=require("frontend-js-metal-web$metal-events");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){if(key in obj)Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});else obj[key]=value;
return obj}function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++)arr2[i]=arr[i];return arr2}else return Array.from(arr)}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==="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);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 Component=function(_EventEmitter){_inherits(Component,
_EventEmitter);function Component(config,parentElement){_classCallCheck(this,Component);var _this=_possibleConstructorReturn(this,(Component.__proto__||Object.getPrototypeOf(Component)).call(this));_this.elementEventProxy_=new _metalDom.DomEventEmitterProxy(null,_this,proxyBlackList_);_this.eventsStateKeyHandler_=null;_this.forceUpdateCallback_=null;_this.inDocument=false;_this.initialConfig_=config||{};_this.portalElement=null;_this.wasRendered=false;_this.DEFAULT_ELEMENT_PARENT=typeof document!==
"undefined"?document.body:null;_this.setShouldUseFacade(true);_this.element=_this.initialConfig_.element;_this.setUpRenderer_();_this.setUpDataManager_();_this.setUpSyncUpdates_();_this.setUpPortal_(_this.initialConfig_.portalElement);_this.on("stateWillChange",_this.handleStateWillChange_);_this.on("stateChanged",_this.handleComponentStateChanged_);_this.on("eventsChanged",_this.onEventsChanged_);_this.addListenersFromObj_(_this.dataManager_.get(_this,"events"));_this.created();_this.componentCreated_=
true;if(parentElement!==false)_this.renderComponent(parentElement);return _this}_createClass(Component,[{key:"addListenersFromObj_",value:function addListenersFromObj_(obj){var _eventsStateKeyHandle;if(!this.eventsStateKeyHandler_)this.eventsStateKeyHandler_=new _metalEvents.EventHandler;var handles=(0,_events.addListenersFromObj)(this,obj);(_eventsStateKeyHandle=this.eventsStateKeyHandler_).add.apply(_eventsStateKeyHandle,_toConsumableArray(handles))}},{key:"attach",value:function attach(parentElement,
siblingElement){if(!this.inDocument){this.emit("willAttach");this.willAttach();this.attachElement(parentElement,siblingElement);this.inDocument=true;this.attachData_={parent:parentElement,sibling:siblingElement};this.emit("attached",this.attachData_);this.attached()}return this}},{key:"attached",value:function attached(){}},{key:"attachElement",value:function attachElement(parentElement,siblingElement){var element=this.element;if(element&&(siblingElement||!element.parentNode)){var parent=(0,_metalDom.toElement)(parentElement)||
this.DEFAULT_ELEMENT_PARENT;parent.insertBefore(element,(0,_metalDom.toElement)(siblingElement))}}},{key:"created",value:function created(){}},{key:"delegate",value:function delegate(eventName,selector,callback){return this.on("delegate:"+eventName+":"+selector,callback)}},{key:"detach",value:function detach(){if(this.inDocument){this.emit("willDetach");this.willDetach();if(this.element&&this.element.parentNode)this.element.parentNode.removeChild(this.element);this.inDocument=false;this.detached()}this.emit("detached");
return this}},{key:"detached",value:function detached(){}},{key:"disposed",value:function disposed(){}},{key:"disposeInternal",value:function disposeInternal(){this.detach();this.disposed();this.emit("disposed");this.elementEventProxy_.dispose();this.elementEventProxy_=null;this.dataManager_.dispose(this);this.dataManager_=null;this.renderer_.dispose(this);this.renderer_=null;_get(Component.prototype.__proto__||Object.getPrototypeOf(Component.prototype),"disposeInternal",this).call(this)}},{key:"forceUpdate",
value:function forceUpdate(callback){this.forceUpdateCallback_=callback;this.updateRenderer_({forceUpdate:true})}},{key:"getAttachData",value:function getAttachData(){return this.attachData_}},{key:"getDataManager",value:function getDataManager(){return this.dataManager_}},{key:"getInitialConfig",value:function getInitialConfig(){return this.initialConfig_}},{key:"getPortalElement_",value:function getPortalElement_(portalElementSelector){var portalElement=(0,_metalDom.toElement)(portalElementSelector);
if(portalElement)return portalElement;if(portalElementSelector.indexOf("#")===0&&portalElementSelector.indexOf(" ")===-1){portalElement=document.createElement("div");portalElement.setAttribute("id",portalElementSelector.slice(1));(0,_metalDom.enterDocument)(portalElement)}return portalElement}},{key:"getState",value:function getState(){return this.dataManager_.getState(this)}},{key:"getStateKeys",value:function getStateKeys(){return this.dataManager_.getStateKeys(this)}},{key:"getRenderer",value:function getRenderer(){return this.renderer_}},
{key:"handleComponentElementChanged_",value:function handleComponentElementChanged_(prevVal,newVal){this.elementEventProxy_.setOriginEmitter(newVal);if(this.componentCreated_){this.emit("elementChanged",{prevVal:prevVal,newVal:newVal});if(newVal&&this.wasRendered)this.syncVisible(this.dataManager_.get(this,"visible"))}}},{key:"handleComponentStateChanged_",value:function handleComponentStateChanged_(event){if(!this.hasSyncUpdates())this.updateRenderer_(event);(0,_sync.syncState)(this,event.changes);
this.emit("stateSynced",event)}},{key:"handleComponentStateKeyChanged_",value:function handleComponentStateKeyChanged_(data){this.updateRenderer_({changes:_defineProperty({},data.key,data)})}},{key:"handleStateWillChange_",value:function handleStateWillChange_(event){this.willReceiveState(event.changes)}},{key:"hasSyncUpdates",value:function hasSyncUpdates(){return this.syncUpdates_}},{key:"informRendered",value:function informRendered(){var firstRender=!this.hasRendererRendered_;this.hasRendererRendered_=
true;if(this.forceUpdateCallback_){this.forceUpdateCallback_();this.forceUpdateCallback_=null}this.rendered(firstRender);this.emit("rendered",firstRender)}},{key:"informWillUpdate",value:function informWillUpdate(){this.willUpdate.apply(this,arguments)}},{key:"mergeElementClasses_",value:function mergeElementClasses_(class1,class2){return class1?class1+" "+(class2||""):class2}},{key:"onEventsChanged_",value:function onEventsChanged_(event){this.eventsStateKeyHandler_.removeAllListeners();this.addListenersFromObj_(event.newVal)}},
{key:"renderComponent",value:function renderComponent(parentElement){if(!this.hasRendererRendered_){if(!(0,_metal.isServerSide)()&&window.__METAL_DEV_TOOLS_HOOK__)window.__METAL_DEV_TOOLS_HOOK__(this);this.getRenderer().render(this)}this.emit("render");(0,_sync.syncState)(this);this.attach(parentElement);this.wasRendered=true}},{key:"setState",value:function setState(state,callback){this.dataManager_.setState(this,state,callback)}},{key:"setterElementClassesFn_",value:function setterElementClassesFn_(val){var elementClasses=
(0,_metal.getStaticProperty)(this.constructor,"ELEMENT_CLASSES",this.mergeElementClasses_);if(elementClasses)val+=" "+elementClasses;return val.trim()}},{key:"setUpDataManager_",value:function setUpDataManager_(){this.dataManager_=(0,_metal.getStaticProperty)(this.constructor,"DATA_MANAGER");this.dataManager_.setUp(this,_metal.object.mixin({},this.renderer_.getExtraDataConfig(this),Component.DATA))}},{key:"setUpPortal_",value:function setUpPortal_(portalElement){if(!portalElement||!(0,_metal.isElement)(portalElement)&&
!(0,_metal.isString)(portalElement)&&!(0,_metal.isBoolean)(portalElement))return;else if((0,_metal.isBoolean)(portalElement)&&portalElement)portalElement="body";if((0,_metal.isServerSide)()){this.portalElement=true;return}portalElement=this.getPortalElement_(portalElement);if(portalElement){var placeholder=document.createElement("div");portalElement.appendChild(placeholder);this.element=placeholder;this.portalElement=portalElement}}},{key:"setUpRenderer_",value:function setUpRenderer_(){this.renderer_=
(0,_metal.getStaticProperty)(this.constructor,"RENDERER");this.renderer_.setUp(this)}},{key:"setUpSyncUpdates_",value:function setUpSyncUpdates_(){this.syncUpdates_=(0,_metal.getStaticProperty)(this.constructor,"SYNC_UPDATES");if(this.hasSyncUpdates())this.on("stateKeyChanged",this.handleComponentStateKeyChanged_.bind(this))}},{key:"startSkipUpdates",value:function startSkipUpdates(){this.skipUpdates_=true}},{key:"stopSkipUpdates",value:function stopSkipUpdates(){this.skipUpdates_=false}},{key:"syncVisible",
value:function syncVisible(newVal){if(this.element)this.element.style.display=newVal?"":"none"}},{key:"rendered",value:function rendered(){}},{key:"updateRenderer_",value:function updateRenderer_(data){if(!data.forceUpdate)this.forceUpdateCallback_=null;if(!this.skipUpdates_&&this.hasRendererRendered_)this.getRenderer().update(this,data)}},{key:"validatorEventsFn_",value:function validatorEventsFn_(val){return!(0,_metal.isDefAndNotNull)(val)||(0,_metal.isObject)(val)}},{key:"willAttach",value:function willAttach(){}},
{key:"willDetach",value:function willDetach(){}},{key:"willReceiveState",value:function willReceiveState(){}},{key:"willUpdate",value:function willUpdate(){}},{key:"element",get:function get(){return this.elementValue_},set:function set(val){if(!(0,_metal.isElement)(val)&&!(0,_metal.isString)(val)&&(0,_metal.isDefAndNotNull)(val))return;if(val)val=(0,_metalDom.toElement)(val)||this.elementValue_;if(this.elementValue_!==val){var prev=this.elementValue_;this.elementValue_=val;this.handleComponentElementChanged_(prev,
val)}}}],[{key:"isComponentCtor",value:function isComponentCtor(fn){return fn.prototype&&fn.prototype[Component.COMPONENT_FLAG]}},{key:"render",value:function render(Ctor,configOrElement,element){var config=configOrElement;if((0,_metal.isElement)(configOrElement)){config=null;element=configOrElement}var instance=new Ctor(config,false);instance.renderComponent(element);return instance}},{key:"renderToString",value:function renderToString(Ctor,configOrElement){var rendererName=Ctor.RENDERER&&Ctor.RENDERER.RENDERER_NAME;
switch(rendererName){case "jsx":case "soy":case "incremental-dom":{if(typeof IncrementalDOM==="undefined")throw new Error("Error. Trying to render incremental dom "+"based component to string requires IncrementalDOM "+"implementation to be loaded.");var interceptedComponentStrings=[];var patch=IncrementalDOM.patch;var patchInterceptor=function patchInterceptor(){var currentElement=patch.apply(undefined,arguments);interceptedComponentStrings.push(currentElement.innerHTML);IncrementalDOM.patch=patch};
IncrementalDOM.patch=patchInterceptor;Component.render(Ctor,configOrElement).dispose();return interceptedComponentStrings[0]}default:throw new Error("Error. Trying to render non incremental dom "+"based component to string.");}}}]);return Component}(_metalEvents.EventEmitter);Component.DATA={children:{validator:Array.isArray,value:[]},elementClasses:{setter:"setterElementClassesFn_",validator:_metal.isString,value:""},events:{validator:"validatorEventsFn_",value:null},visible:{validator:_metal.isBoolean,
value:true}};Component.COMPONENT_FLAG="__metal_component__";Component.DATA_MANAGER=_ComponentDataManager2.default;Component.ELEMENT_CLASSES="";Component.RENDERER=_ComponentRenderer2.default;Component.SYNC_UPDATES=false;Component.prototype[Component.COMPONENT_FLAG]=true;var proxyBlackList_={eventsChanged:true,stateChanged:true,stateKeyChanged:true};exports.default=Component});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/ComponentRegistry",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;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 _metal=require("frontend-js-metal-web$metal");function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}var ComponentRegistry=function(){function ComponentRegistry(){_classCallCheck(this,
ComponentRegistry)}_createClass(ComponentRegistry,null,[{key:"getConstructor",value:function getConstructor(name){var constructorFn=ComponentRegistry.components_[name];if(!constructorFn)console.error("There's no constructor registered for the component named "+name+".\n\t\t\t\tComponents need to be registered via ComponentRegistry.register.");return constructorFn}},{key:"register",value:function register(constructorFn,name){if(!name)if(constructorFn.hasOwnProperty("NAME"))name=constructorFn.NAME;
else name=(0,_metal.getFunctionName)(constructorFn);constructorFn.NAME=name;ComponentRegistry.components_[name]=constructorFn}}]);return ComponentRegistry}();ComponentRegistry.components_={};exports.default=ComponentRegistry});
Liferay.Loader.define("frontend-js-metal-web$metal-component@2.16.5/lib/all/component",["module","exports","require","../events/events","../Component","../ComponentDataManager","../ComponentRegistry","../ComponentRenderer"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.ComponentRenderer=exports.ComponentRegistry=exports.ComponentDataManager=exports.Component=undefined;var _events=require("../events/events");Object.keys(_events).forEach(function(key){if(key===
"default"||key==="__esModule")return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _events[key]}})});var _Component=require("../Component");var _Component2=_interopRequireDefault(_Component);var _ComponentDataManager=require("../ComponentDataManager");var _ComponentDataManager2=_interopRequireDefault(_ComponentDataManager);var _ComponentRegistry=require("../ComponentRegistry");var _ComponentRegistry2=_interopRequireDefault(_ComponentRegistry);var _ComponentRenderer=
require("../ComponentRenderer");var _ComponentRenderer2=_interopRequireDefault(_ComponentRenderer);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=_Component2.default;exports.Component=_Component2.default;exports.ComponentDataManager=_ComponentDataManager2.default;exports.ComponentRegistry=_ComponentRegistry2.default;exports.ComponentRenderer=_ComponentRenderer2.default});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.7.0/lib/validators",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};var _metal=require("frontend-js-metal-web$metal");
var ERROR_ARRAY_OF_TYPE="Expected an array of single type.";var ERROR_OBJECT_OF_TYPE="Expected object of one type.";var ERROR_ONE_OF="Expected one of given values.";var ERROR_ONE_OF_TYPE="Expected one of given types.";var ERROR_SHAPE_OF="Expected object with a specific shape.";var validators={any:function any(){return function(){return true}},array:buildTypeValidator("array"),bool:buildTypeValidator("boolean"),func:buildTypeValidator("function"),number:buildTypeValidator("number"),object:buildTypeValidator("object"),
string:buildTypeValidator("string"),arrayOf:function arrayOf(validator){return maybe(function(value,name,context){var result=validators.array(value,name,context);if(isInvalid(result))return result;return validateArrayItems(validator,value,name,context)})},instanceOf:function instanceOf(expectedClass){return maybe(function(value,name,context){if(value instanceof expectedClass)return true;var msg="Expected instance of "+expectedClass;return composeError(msg,name,context)})},objectOf:function objectOf(validator){return maybe(function(value,
name,context){for(var key in value)if(isInvalid(validator(value[key])))return composeError(ERROR_OBJECT_OF_TYPE,name,context);return true})},oneOf:function oneOf(arrayOfValues){return maybe(function(value,name,context){var result=validators.array(arrayOfValues,name,context);if(isInvalid(result))return result;return arrayOfValues.indexOf(value)===-1?composeError(ERROR_ONE_OF,name,context):true})},oneOfType:function oneOfType(arrayOfTypeValidators){return maybe(function(value,name,context){var result=
validators.array(arrayOfTypeValidators,name,context);if(isInvalid(result))return result;for(var i=0;i<arrayOfTypeValidators.length;i++)if(!isInvalid(arrayOfTypeValidators[i](value,name,context)))return true;return composeError(ERROR_ONE_OF_TYPE,name,context)})},shapeOf:function shapeOf(shape){return maybe(function(value,name,context){var result=validators.object(shape,name,context);if(isInvalid(result))return result;for(var key in shape){var validator=shape[key];var required=false;if(validator.config){required=
validator.config.required;validator=validator.config.validator}if(required&&!(0,_metal.isDefAndNotNull)(value[key])||isInvalid(validator(value[key])))return composeError(ERROR_SHAPE_OF,name,context)}return true})}};function buildTypeValidator(expectedType){var validatorFn=maybe(validateType.bind(null,expectedType));return function(){if(arguments.length===0)return validatorFn;else return validatorFn.apply(undefined,arguments)}}function composeError(error,name,context){var compName=context?(0,_metal.getFunctionName)(context.constructor):
null;var renderer=context&&context.getRenderer&&context.getRenderer();var parent=renderer&&renderer.getParent&&renderer.getParent();var parentName=parent?(0,_metal.getFunctionName)(parent.constructor):null;var location=parentName?"Check render method of '"+parentName+"'.":"";return new Error("Warning: Invalid state passed to '"+name+"'. "+(error+" Passed to '"+compName+"'. "+location))}function getType(value){return Array.isArray(value)?"array":typeof value==="undefined"?"undefined":_typeof(value)}
function isInvalid(result){return result instanceof Error}function maybe(typeValidator){return function(value,name,context){return(0,_metal.isDefAndNotNull)(value)?typeValidator(value,name,context):true}}function validateArrayItems(validator,value,name,context){for(var i=0;i<value.length;i++)if(isInvalid(validator(value[i],name,context)))return composeError(ERROR_ARRAY_OF_TYPE,name,context);return true}function validateType(expectedType,value,name,context){var type=getType(value);if(type!==expectedType){var msg=
"Expected type '"+expectedType+"', but received type '"+type+"'.";return composeError(msg,name,context)}return true}exports.default=validators});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.7.0/lib/Config",["module","exports","require","frontend-js-metal-web$metal","./validators"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _metal=require("frontend-js-metal-web$metal");var _validators=require("./validators");var _validators2=_interopRequireDefault(_validators);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var Config={internal:function internal(){var _internal=
arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;return mergeConfig(this,{internal:_internal})},required:function required(){var _required=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;return mergeConfig(this,{required:_required})},setter:function setter(_setter){return mergeConfig(this,{setter:_setter})},validator:function validator(_validator){return mergeConfig(this,{validator:_validator})},value:function value(_value){return mergeConfig(this,{value:_value})}};function mergeConfig(context,
config){var obj=context;if(obj===Config){obj=Object.create(Config);obj.config={}}_metal.object.mixin(obj.config,config);return obj}var fnNames=Object.keys(_validators2.default);fnNames.forEach(function(name){return Config[name]=function(){return this.validator(_validators2.default[name])}});exports.default=Config});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.7.0/lib/State",["module","exports","require","frontend-js-metal-web$metal","frontend-js-metal-web$metal-events"],function(module,exports,require){var define=undefined;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 _get=function get(object,property,receiver){if(object===null)object=Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc===undefined){var parent=Object.getPrototypeOf(object);if(parent===null)return undefined;
else return get(parent,property,receiver)}else if("value"in desc)return desc.value;else{var getter=desc.get;if(getter===undefined)return undefined;return getter.call(receiver)}};var _metal=require("frontend-js-metal-web$metal");var _metalEvents=require("frontend-js-metal-web$metal-events");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==="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);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 State=function(_EventEmitter){_inherits(State,_EventEmitter);function State(opt_config,opt_obj,opt_context){_classCallCheck(this,State);var _this=_possibleConstructorReturn(this,(State.__proto__||Object.getPrototypeOf(State)).call(this));_this.context_=opt_context||_this;_this.keysBlacklist_=null;_this.obj_=opt_obj||_this;_this.eventData_=null;_this.scheduledBatchData_=null;_this.stateInfo_={};_this.stateConfigs_={};_this.initialValues_=_metal.object.mixin({},opt_config);_this.setShouldUseFacade(true);
_this.configStateFromStaticHint_();Object.defineProperty(_this.obj_,State.STATE_REF_KEY,{configurable:true,enumerable:false,value:_this});return _this}_createClass(State,[{key:"assertGivenIfRequired_",value:function assertGivenIfRequired_(name){var config=this.stateConfigs_[name];if(config.required){var info=this.getStateInfo(name);var value=info.state===State.KeyStates.INITIALIZED?this.get(name):this.initialValues_[name];if(!(0,_metal.isDefAndNotNull)(value)){var errorMessage='The property called "'+
name+"\" is required but didn't receive a value.";if(this.shouldThrowValidationError())throw new Error(errorMessage);else console.error(errorMessage)}}}},{key:"assertValidatorReturnInstanceOfError_",value:function assertValidatorReturnInstanceOfError_(validatorReturn){if(validatorReturn instanceof Error)if(this.shouldThrowValidationError())throw validatorReturn;else console.error("Warning: "+validatorReturn)}},{key:"assertValidStateKeyName_",value:function assertValidStateKeyName_(name){if(this.keysBlacklist_&&
this.keysBlacklist_[name])throw new Error("It's not allowed to create a state key with the name \""+name+'".');}},{key:"buildKeyPropertyDef_",value:function buildKeyPropertyDef_(name){return{configurable:true,enumerable:true,get:function get(){return this[State.STATE_REF_KEY].getStateKeyValue_(name)},set:function set(val){this[State.STATE_REF_KEY].setStateKeyValue_(name,val)}}}},{key:"callFunction_",value:function callFunction_(fn,args){if((0,_metal.isString)(fn))return this.context_[fn].apply(this.context_,
args);else if((0,_metal.isFunction)(fn))return fn.apply(this.context_,args)}},{key:"callSetter_",value:function callSetter_(name,value,currentValue){var config=this.stateConfigs_[name];if(config.setter)value=this.callFunction_(config.setter,[value,currentValue]);return value}},{key:"callValidator_",value:function callValidator_(name,value){var config=this.stateConfigs_[name];if(config.validator){var validatorReturn=this.callFunction_(config.validator,[value,name,this.context_]);this.assertValidatorReturnInstanceOfError_(validatorReturn);
return validatorReturn}return true}},{key:"canSetState",value:function canSetState(name){var info=this.getStateInfo(name);return!this.stateConfigs_[name].writeOnce||!info.written}},{key:"configState",value:function configState(configs,opt_context){var names=Object.keys(configs);if(names.length===0)return;if(opt_context!==false){var props={};for(var i=0;i<names.length;i++){var name=names[i];this.assertValidStateKeyName_(name);props[name]=this.buildKeyPropertyDef_(name)}Object.defineProperties(opt_context||
this.obj_,props)}this.stateConfigs_=configs;for(var _i=0;_i<names.length;_i++){var _name=names[_i];configs[_name]=configs[_name].config?configs[_name].config:configs[_name];this.assertGivenIfRequired_(names[_i]);this.validateInitialValue_(names[_i])}}},{key:"configStateFromStaticHint_",value:function configStateFromStaticHint_(){var ctor=this.constructor;if(ctor!==State){var defineContext=void 0;if(this.obj_===this){defineContext=ctor.hasConfiguredState_?false:ctor.prototype;ctor.hasConfiguredState_=
true}this.configState(State.getStateStatic(ctor),defineContext)}}},{key:"disposeInternal",value:function disposeInternal(){_get(State.prototype.__proto__||Object.getPrototypeOf(State.prototype),"disposeInternal",this).call(this);this.initialValues_=null;this.stateInfo_=null;this.stateConfigs_=null;this.scheduledBatchData_=null}},{key:"emitBatchEvent_",value:function emitBatchEvent_(){if(!this.isDisposed()){var data=this.scheduledBatchData_;this.scheduledBatchData_=null;this.context_.emit("stateChanged",
data)}}},{key:"get",value:function get(name){return this.obj_[name]}},{key:"getState",value:function getState(opt_names){var state={};var names=opt_names||this.getStateKeys();for(var i=0;i<names.length;i++)state[names[i]]=this.get(names[i]);return state}},{key:"getStateInfo",value:function getStateInfo(name){if(!this.stateInfo_[name])this.stateInfo_[name]={};return this.stateInfo_[name]}},{key:"getStateKeyConfig",value:function getStateKeyConfig(name){return this.stateConfigs_?this.stateConfigs_[name]:
null}},{key:"getStateKeys",value:function getStateKeys(){return this.stateConfigs_?Object.keys(this.stateConfigs_):[]}},{key:"getStateKeyValue_",value:function getStateKeyValue_(name){if(!this.warnIfDisposed_(name)){this.initStateKey_(name);return this.getStateInfo(name).value}}},{key:"hasBeenSet",value:function hasBeenSet(name){var info=this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZED||this.hasInitialValue_(name)}},{key:"hasInitialValue_",value:function hasInitialValue_(name){return this.initialValues_.hasOwnProperty(name)}},
{key:"hasStateKey",value:function hasStateKey(key){if(!this.warnIfDisposed_(key))return!!this.stateConfigs_[key]}},{key:"informChange_",value:function informChange_(name,prevVal){if(this.shouldInformChange_(name,prevVal)){var data=_metal.object.mixin({key:name,newVal:this.get(name),prevVal:prevVal},this.eventData_);this.context_.emit(name+"Changed",data);this.context_.emit("stateKeyChanged",data);this.scheduleBatchEvent_(data)}}},{key:"initStateKey_",value:function initStateKey_(name){var info=this.getStateInfo(name);
if(info.state!==State.KeyStates.UNINITIALIZED)return;info.state=State.KeyStates.INITIALIZING;this.setInitialValue_(name);if(!info.written)this.setDefaultValue(name);info.state=State.KeyStates.INITIALIZED}},{key:"removeStateKey",value:function removeStateKey(name){this.stateInfo_[name]=null;this.stateConfigs_[name]=null;delete this.obj_[name]}},{key:"scheduleBatchEvent_",value:function scheduleBatchEvent_(changeData){if(!this.scheduledBatchData_){_metal.async.nextTick(this.emitBatchEvent_,this);this.scheduledBatchData_=
_metal.object.mixin({changes:{}},this.eventData_)}var name=changeData.key;var changes=this.scheduledBatchData_.changes;if(changes[name])changes[name].newVal=changeData.newVal;else changes[name]=changeData}},{key:"set",value:function set(name,value){if(this.hasStateKey(name))this.obj_[name]=value}},{key:"setDefaultValue",value:function setDefaultValue(name){var config=this.stateConfigs_[name];if(config.value!==undefined)this.set(name,config.value);else this.set(name,this.callFunction_(config.valueFn))}},
{key:"setEventData",value:function setEventData(data){this.eventData_=data}},{key:"setInitialValue_",value:function setInitialValue_(name){if(this.hasInitialValue_(name)){this.set(name,this.initialValues_[name]);this.initialValues_[name]=undefined}}},{key:"setKeysBlacklist",value:function setKeysBlacklist(blacklist){this.keysBlacklist_=blacklist}},{key:"setState",value:function setState(values,opt_callback){var _this2=this;Object.keys(values).forEach(function(name){return _this2.set(name,values[name])});
if(opt_callback&&this.scheduledBatchData_)this.context_.once("stateChanged",opt_callback)}},{key:"setStateKeyValue_",value:function setStateKeyValue_(name,value){if(this.warnIfDisposed_(name)||!this.canSetState(name)||!this.validateKeyValue_(name,value))return;var prevVal=this.get(name);var info=this.getStateInfo(name);info.value=this.callSetter_(name,value,prevVal);this.assertGivenIfRequired_(name);info.written=true;this.informChange_(name,prevVal)}},{key:"shouldInformChange_",value:function shouldInformChange_(name,
prevVal){var info=this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZED&&((0,_metal.isObject)(prevVal)||prevVal!==this.get(name))}},{key:"shouldThrowValidationError",value:function shouldThrowValidationError(){return false}},{key:"validateInitialValue_",value:function validateInitialValue_(name){if(this.hasInitialValue_(name)&&!this.callValidator_(name,this.initialValues_[name]))delete this.initialValues_[name]}},{key:"validateKeyValue_",value:function validateKeyValue_(name,value){var info=
this.getStateInfo(name);return info.state===State.KeyStates.INITIALIZING||this.callValidator_(name,value)}},{key:"warnIfDisposed_",value:function warnIfDisposed_(name){var disposed=this.isDisposed();if(disposed)console.warn('Error. Trying to access property "'+name+'" on disposed instance');return disposed}}],[{key:"getStateStatic",value:function getStateStatic(ctor){return(0,_metal.getStaticProperty)(ctor,"STATE",State.mergeState)}},{key:"mergeState",value:function mergeState(mergedVal,currVal){return _metal.object.mixin({},
currVal,mergedVal)}}]);return State}(_metalEvents.EventEmitter);State.STATE_REF_KEY="__METAL_STATE_REF_KEY__";State.KeyStates={UNINITIALIZED:undefined,INITIALIZING:1,INITIALIZED:2};exports.default=State});
Liferay.Loader.define("frontend-js-metal-web$metal-state@2.7.0/lib/all/state",["module","exports","require","../validators","../Config","../State"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.State=exports.Config=exports.validators=undefined;var _validators=require("../validators");var _validators2=_interopRequireDefault(_validators);var _Config=require("../Config");var _Config2=_interopRequireDefault(_Config);var _State=require("../State");
var _State2=_interopRequireDefault(_State);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.default=_State2.default;exports.validators=_validators2.default;exports.Config=_Config2.default;exports.State=_State2.default});
Liferay.Loader.define("frontend-js-metal-web$metal-web-component@2.16.6/lib/define_web_component",["module","exports","require","frontend-js-metal-web$metal-state","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.defineWebComponent=defineWebComponent;var _metalState=require("frontend-js-metal-web$metal-state");var _metalState2=_interopRequireDefault(_metalState);var _metal=require("frontend-js-metal-web$metal");
function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function defineWebComponent(tagName,Ctor){if(!("customElements"in window))return;var observedAttributes=Object.keys(_metalState2.default.getStateStatic(Ctor));var props=(0,_metal.getStaticProperty)(Ctor,"PROPS",_metalState.mergeState);var hasProps=(0,_metal.isObject)(props)&&Object.keys(props).length;if(hasProps)observedAttributes=Object.keys(props);function CustomElement(){return Reflect.construct(HTMLElement,[],CustomElement)}
CustomElement.observedAttributes=observedAttributes;Object.setPrototypeOf(CustomElement.prototype,HTMLElement.prototype);Object.setPrototypeOf(CustomElement,HTMLElement);Object.assign(CustomElement.prototype,{attributeChangedCallback:function attributeChangedCallback(attrName,oldVal,newVal){if(!this.component)return;newVal=this.deserializeValue_(newVal);if(this.componentHasProps)this.component.props[attrName]=newVal;else this.component[attrName]=newVal},connectedCallback:function connectedCallback(){var useShadowDOM=
this.getAttribute("useShadowDOM")||false;var element=this;if(useShadowDOM)element=this.attachShadow({mode:"open"});var opts={};for(var i=0,l=observedAttributes.length;i<l;i++){var deserializedValue=this.deserializeValue_(this.getAttribute(observedAttributes[i]));if(deserializedValue)opts[observedAttributes[i]]=deserializedValue}this.component=new Ctor(opts,element);this.componentHasProps=hasProps;this.componentEventHandler=this.emit.bind(this);this.component.on("*",this.componentEventHandler)},deserializeValue_:function deserializeValue_(value){var retVal=
void 0;try{retVal=JSON.parse(value)}catch(e){}return retVal||value},disconnectedCallback:function disconnectedCallback(){this.component.off("*",this.componentEventHandler);this.component.dispose()},emit:function emit(){for(var _len=arguments.length,data=Array(_len),_key=0;_key<_len;_key++)data[_key]=arguments[_key];var eventData=data.pop();var event=new CustomEvent(eventData.type,{detail:data});this.dispatchEvent(event)}});window.customElements.define(tagName,CustomElement)}exports.default=defineWebComponent});
Liferay.Loader.define("frontend-js-metal-web$metal-incremental-dom@2.16.5/lib/html/HTMLParser",["module","exports","require"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var startTag=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,endTag=/^<\/([-A-Za-z0-9_]+)[^>]*>/,attr=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
var empty=makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr");var block=makeMap("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video");var inline=makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var");
var closeSelf=makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var fillAttrs=makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected");var special=makeMap("script,style");var HTMLParser=function HTMLParser(html,handler){var index,chars,match,stack=[],last=html;stack.last=function(){return this[this.length-1]};while(html){chars=true;if(!stack.last()||!special[stack.last()]){if(html.indexOf("\x3c!--")==0){index=html.indexOf("--\x3e");
if(index>=0){if(handler.comment)handler.comment(html.substring(4,index));html=html.substring(index+3);chars=false}}else if(html.indexOf("\x3c/")==0){match=html.match(endTag);if(match){html=html.substring(match[0].length);match[0].replace(endTag,parseEndTag);chars=false}}else if(html.indexOf("\x3c")==0){match=html.match(startTag);if(match){html=html.substring(match[0].length);match[0].replace(startTag,parseStartTag);chars=false}}if(chars){index=html.indexOf("\x3c");var text=index<0?html:html.substring(0,
index);html=index<0?"":html.substring(index);if(handler.chars)handler.chars(text)}}else{html=html.replace(new RegExp("([\\s\\S]*?)\x3c/"+stack.last()+"[^\x3e]*\x3e"),function(all,text){text=text.replace(/\x3c!--([\s\S]*?)--\x3e|<!\[CDATA\[([\s\S]*?)]]\x3e/g,"$1$2");if(handler.chars)handler.chars(text);return""});parseEndTag("",stack.last())}if(html==last)throw"Parse Error: "+html;last=html}parseEndTag();function parseStartTag(tag,tagName,rest,unary){tagName=tagName.toLowerCase();if(block[tagName])while(stack.last()&&
inline[stack.last()]&&stack.last()!=="span")parseEndTag("",stack.last());if(closeSelf[tagName]&&stack.last()==tagName)parseEndTag("",tagName);unary=empty[tagName]||!!unary;if(!unary)stack.push(tagName);if(handler.start){var attrs=[];rest.replace(attr,function(match,name){var value=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:fillAttrs[name]?name:"";attrs.push({name:name,value:value,escaped:value.replace(/(^|[^\\])"/g,'$1\\"')})});if(handler.start)handler.start(tagName,
attrs,unary)}}function parseEndTag(tag,tagName){if(!tagName)var pos=0;else for(var pos=stack.length-1;pos>=0;pos--)if(stack[pos]==tagName)break;if(pos>=0){for(var i=stack.length-1;i>=pos;i--)if(handler.end)handler.end(stack[i]);stack.length=pos}}};function makeMap(str){var obj={},items=str.split(",");for(var i=0;i<items.length;i++)obj[items[i]]=true;return obj}exports.default=HTMLParser});
Liferay.Loader.define("frontend-js-metal-web$metal-incremental-dom@2.16.5/lib/html/unescape",["module","exports","require"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});function unescape(str){var seen={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26quot;":'"'};var div=document.createElement("div");return str.replace(HTML_ENTITY_PATTERN_,function(s,entity){var value=seen[s];if(value)return value;if(entity.charAt(0)==="#"){var n=
Number("0"+entity.substr(1));if(!isNaN(n))value=String.fromCharCode(n)}if(!value){div.innerHTML=s+" ";value=div.firstChild.nodeValue.slice(0,-1)}seen[s]=value;return value})}exports.default=unescape;var HTML_ENTITY_PATTERN_=/&([^;\s<&]+);?/g});
Liferay.Loader.define("frontend-js-metal-web$metal-incremental-dom@2.16.5/lib/html/HTML2IncDom",["module","exports","require","./HTMLParser","./unescape"],function(module,exports,require){var define=undefined;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 _HTMLParser=require("./HTMLParser");var _HTMLParser2=_interopRequireDefault(_HTMLParser);var _unescape=require("./unescape");var _unescape2=_interopRequireDefault(_unescape);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");}var parser_=void 0;var HTML2IncDom=function(){function HTML2IncDom(){_classCallCheck(this,HTML2IncDom)}_createClass(HTML2IncDom,null,[{key:"buildFn",value:function buildFn(html){return function(){return HTML2IncDom.run(html)}}},{key:"getParser",value:function getParser(){return parser_||_HTMLParser2.default}},{key:"run",value:function run(html){HTML2IncDom.getParser()(html,
{start:function start(tag,attrs,unary){var fn=unary?IncrementalDOM.elementVoid:IncrementalDOM.elementOpen;var args=[tag,null,[]];for(var i=0;i<attrs.length;i++)args.push(attrs[i].name,attrs[i].value);fn.apply(undefined,args)},end:function end(tag){IncrementalDOM.elementClose(tag)},chars:function chars(text){IncrementalDOM.text(text,_unescape2.default)}})}},{key:"setParser",value:function setParser(newParser){parser_=newParser}}]);return HTML2IncDom}();exports.default=HTML2IncDom});
/*

 Copyright 2015 The Incremental DOM Authors. All Rights Reserved.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS-IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
*/
Liferay.Loader.define("frontend-js-metal-web$incremental-dom@0.5.1/dist/incremental-dom-cjs",["module","exports","require"],function(module,exports,require){var define=undefined;var hasOwnProperty=Object.prototype.hasOwnProperty;function Blank(){}Blank.prototype=Object.create(null);var has=function(map,property){return hasOwnProperty.call(map,property)};var createMap=function(){return new Blank};function NodeData(nodeName,key){this.attrs=createMap();this.attrsArr=[];this.newAttrs=createMap();this.staticsApplied=
false;this.key=key;this.keyMap=createMap();this.keyMapValid=true;this.focused=false;this.nodeName=nodeName;this.text=null}var initData=function(node,nodeName,key){var data=new NodeData(nodeName,key);node["__incrementalDOMData"]=data;return data};var getData=function(node){importNode(node);return node["__incrementalDOMData"]};var importNode=function(node){if(node["__incrementalDOMData"])return;var isElement=node instanceof Element;var nodeName=isElement?node.localName:node.nodeName;var key=isElement?
node.getAttribute("key"):null;var data=initData(node,nodeName,key);if(key)getData(node.parentNode).keyMap[key]=node;if(isElement){var attributes=node.attributes;var attrs=data.attrs;var newAttrs=data.newAttrs;var attrsArr=data.attrsArr;for(var i=0;i<attributes.length;i+=1){var attr=attributes[i];var name=attr.name;var value=attr.value;attrs[name]=value;newAttrs[name]=undefined;attrsArr.push(name);attrsArr.push(value)}}for(var child=node.firstChild;child;child=child.nextSibling)importNode(child)};
var getNamespaceForTag=function(tag,parent){if(tag==="svg")return"http://www.w3.org/2000/svg";if(getData(parent).nodeName==="foreignObject")return null;return parent.namespaceURI};var createElement=function(doc,parent,tag,key){var namespace=getNamespaceForTag(tag,parent);var el=undefined;if(namespace)el=doc.createElementNS(namespace,tag);else el=doc.createElement(tag);initData(el,tag,key);return el};var createText=function(doc){var node=doc.createTextNode("");initData(node,"#text",null);return node};
var notifications={nodesCreated:null,nodesDeleted:null};function Context(){this.created=notifications.nodesCreated&&[];this.deleted=notifications.nodesDeleted&&[]}Context.prototype.markCreated=function(node){if(this.created)this.created.push(node)};Context.prototype.markDeleted=function(node){if(this.deleted)this.deleted.push(node)};Context.prototype.notifyChanges=function(){if(this.created&&this.created.length>0)notifications.nodesCreated(this.created);if(this.deleted&&this.deleted.length>0)notifications.nodesDeleted(this.deleted)};
var inAttributes=false;var inSkip=false;var assertInPatch=function(functionName,context){if(!context)throw new Error("Cannot call "+functionName+"() unless in patch.");};var assertNoUnclosedTags=function(openElement,root){if(openElement===root)return;var currentElement=openElement;var openTags=[];while(currentElement&&currentElement!==root){openTags.push(currentElement.nodeName.toLowerCase());currentElement=currentElement.parentNode}throw new Error("One or more tags were not closed:\n"+openTags.join("\n"));
};var assertNotInAttributes=function(functionName){if(inAttributes)throw new Error(functionName+"() can not be called between "+"elementOpenStart() and elementOpenEnd().");};var assertNotInSkip=function(functionName){if(inSkip)throw new Error(functionName+"() may not be called inside an element "+"that has called skip().");};var assertInAttributes=function(functionName){if(!inAttributes)throw new Error(functionName+"() can only be called after calling "+"elementOpenStart().");};var assertVirtualAttributesClosed=
function(){if(inAttributes)throw new Error("elementOpenEnd() must be called after calling "+"elementOpenStart().");};var assertCloseMatchesOpenTag=function(nodeName,tag){if(nodeName!==tag)throw new Error('Received a call to close "'+tag+'" but "'+nodeName+'" was open.');};var assertNoChildrenDeclaredYet=function(functionName,previousNode){if(previousNode!==null)throw new Error(functionName+"() must come before any child "+"declarations inside the current element.");};var assertPatchElementNoExtras=
function(startNode,currentNode,expectedNextNode,expectedPrevNode){var wasUpdated=currentNode.nextSibling===expectedNextNode&&currentNode.previousSibling===expectedPrevNode;var wasChanged=currentNode.nextSibling===startNode.nextSibling&&currentNode.previousSibling===expectedPrevNode;var wasRemoved=currentNode===startNode;if(!wasUpdated&&!wasChanged&&!wasRemoved)throw new Error("There must be exactly one top level call corresponding "+"to the patched element.");};var setInAttributes=function(value){var previous=
inAttributes;inAttributes=value;return previous};var setInSkip=function(value){var previous=inSkip;inSkip=value;return previous};var isDocumentRoot=function(node){return node instanceof Document||node instanceof DocumentFragment};var getAncestry=function(node,root){var ancestry=[];var cur=node;while(cur!==root){ancestry.push(cur);cur=cur.parentNode}return ancestry};var getRoot=function(node){var cur=node;var prev=cur;while(cur){prev=cur;cur=cur.parentNode}return prev};var getActiveElement=function(node){var root=
getRoot(node);return isDocumentRoot(root)?root.activeElement:null};var getFocusedPath=function(node,root){var activeElement=getActiveElement(node);if(!activeElement||!node.contains(activeElement))return[];return getAncestry(activeElement,root)};var moveBefore=function(parentNode,node,referenceNode){var insertReferenceNode=node.nextSibling;var cur=referenceNode;while(cur!==node){var next=cur.nextSibling;parentNode.insertBefore(cur,insertReferenceNode);cur=next}};var context=null;var currentNode=null;
var currentParent=null;var doc=null;var markFocused=function(focusPath,focused){for(var i=0;i<focusPath.length;i+=1)getData(focusPath[i]).focused=focused};var patchFactory=function(run){var f=function(node,fn,data){var prevContext=context;var prevDoc=doc;var prevCurrentNode=currentNode;var prevCurrentParent=currentParent;var previousInAttributes=false;var previousInSkip=false;context=new Context;doc=node.ownerDocument;currentParent=node.parentNode;if(true){previousInAttributes=setInAttributes(false);
previousInSkip=setInSkip(false)}var focusPath=getFocusedPath(node,currentParent);markFocused(focusPath,true);var retVal=run(node,fn,data);markFocused(focusPath,false);if(true){assertVirtualAttributesClosed();setInAttributes(previousInAttributes);setInSkip(previousInSkip)}context.notifyChanges();context=prevContext;doc=prevDoc;currentNode=prevCurrentNode;currentParent=prevCurrentParent;return retVal};return f};var patchInner=patchFactory(function(node,fn,data){currentNode=node;enterNode();fn(data);
exitNode();if(true)assertNoUnclosedTags(currentNode,node);return node});var patchOuter=patchFactory(function(node,fn,data){var startNode={nextSibling:node};var expectedNextNode=null;var expectedPrevNode=null;if(true){expectedNextNode=node.nextSibling;expectedPrevNode=node.previousSibling}currentNode=startNode;fn(data);if(true)assertPatchElementNoExtras(startNode,currentNode,expectedNextNode,expectedPrevNode);if(node!==currentNode&&node.parentNode)removeChild(currentParent,node,getData(currentParent).keyMap);
return startNode===currentNode?null:currentNode});var matches=function(matchNode,nodeName,key){var data=getData(matchNode);return nodeName===data.nodeName&&key==data.key};var alignWithDOM=function(nodeName,key){if(currentNode&&matches(currentNode,nodeName,key))return;var parentData=getData(currentParent);var currentNodeData=currentNode&&getData(currentNode);var keyMap=parentData.keyMap;var node=undefined;if(key){var keyNode=keyMap[key];if(keyNode)if(matches(keyNode,nodeName,key))node=keyNode;else if(keyNode===
currentNode)context.markDeleted(keyNode);else removeChild(currentParent,keyNode,keyMap)}if(!node){if(nodeName==="#text")node=createText(doc);else node=createElement(doc,currentParent,nodeName,key);if(key)keyMap[key]=node;context.markCreated(node)}if(getData(node).focused)moveBefore(currentParent,node,currentNode);else if(currentNodeData&&currentNodeData.key&&!currentNodeData.focused){currentParent.replaceChild(node,currentNode);parentData.keyMapValid=false}else currentParent.insertBefore(node,currentNode);
currentNode=node};var removeChild=function(node,child,keyMap){node.removeChild(child);context.markDeleted(child);var key=getData(child).key;if(key)delete keyMap[key]};var clearUnvisitedDOM=function(){var node=currentParent;var data=getData(node);var keyMap=data.keyMap;var keyMapValid=data.keyMapValid;var child=node.lastChild;var key=undefined;if(child===currentNode&&keyMapValid)return;while(child!==currentNode){removeChild(node,child,keyMap);child=node.lastChild}if(!keyMapValid){for(key in keyMap){child=
keyMap[key];if(child.parentNode!==node){context.markDeleted(child);delete keyMap[key]}}data.keyMapValid=true}};var enterNode=function(){currentParent=currentNode;currentNode=null};var getNextNode=function(){if(currentNode)return currentNode.nextSibling;else return currentParent.firstChild};var nextNode=function(){currentNode=getNextNode()};var exitNode=function(){clearUnvisitedDOM();currentNode=currentParent;currentParent=currentParent.parentNode};var coreElementOpen=function(tag,key){nextNode();
alignWithDOM(tag,key);enterNode();return currentParent};var coreElementClose=function(){if(true)setInSkip(false);exitNode();return currentNode};var coreText=function(){nextNode();alignWithDOM("#text",null);return currentNode};var currentElement=function(){if(true){assertInPatch("currentElement",context);assertNotInAttributes("currentElement")}return currentParent};var currentPointer=function(){if(true){assertInPatch("currentPointer",context);assertNotInAttributes("currentPointer")}return getNextNode()};
var skip=function(){if(true){assertNoChildrenDeclaredYet("skip",currentNode);setInSkip(true)}currentNode=currentParent.lastChild};var skipNode=nextNode;var symbols={default:"__default"};var getNamespace=function(name){if(name.lastIndexOf("xml:",0)===0)return"http://www.w3.org/XML/1998/namespace";if(name.lastIndexOf("xlink:",0)===0)return"http://www.w3.org/1999/xlink"};var applyAttr=function(el,name,value){if(value==null)el.removeAttribute(name);else{var attrNS=getNamespace(name);if(attrNS)el.setAttributeNS(attrNS,
name,value);else el.setAttribute(name,value)}};var applyProp=function(el,name,value){el[name]=value};var setStyleValue=function(style,prop,value){if(prop.indexOf("-")>=0)style.setProperty(prop,value);else style[prop]=value};var applyStyle=function(el,name,style){if(typeof style==="string")el.style.cssText=style;else{el.style.cssText="";var elStyle=el.style;var obj=style;for(var prop in obj)if(has(obj,prop))setStyleValue(elStyle,prop,obj[prop])}};var applyAttributeTyped=function(el,name,value){var type=
typeof value;if(type==="object"||type==="function")applyProp(el,name,value);else applyAttr(el,name,value)};var updateAttribute=function(el,name,value){var data=getData(el);var attrs=data.attrs;if(attrs[name]===value)return;var mutator=attributes[name]||attributes[symbols.default];mutator(el,name,value);attrs[name]=value};var attributes=createMap();attributes[symbols.default]=applyAttributeTyped;attributes["style"]=applyStyle;var ATTRIBUTES_OFFSET=3;var argsBuilder=[];var elementOpen=function(tag,
key,statics,var_args){if(true){assertNotInAttributes("elementOpen");assertNotInSkip("elementOpen")}var node=coreElementOpen(tag,key);var data=getData(node);if(!data.staticsApplied){if(statics)for(var _i=0;_i<statics.length;_i+=2){var name=statics[_i];var value=statics[_i+1];updateAttribute(node,name,value)}data.staticsApplied=true}var attrsArr=data.attrsArr;var newAttrs=data.newAttrs;var isNew=!attrsArr.length;var i=ATTRIBUTES_OFFSET;var j=0;for(;i<arguments.length;i+=2,j+=2){var _attr=arguments[i];
if(isNew){attrsArr[j]=_attr;newAttrs[_attr]=undefined}else if(attrsArr[j]!==_attr)break;var value=arguments[i+1];if(isNew||attrsArr[j+1]!==value){attrsArr[j+1]=value;updateAttribute(node,_attr,value)}}if(i<arguments.length||j<attrsArr.length){for(;i<arguments.length;i+=1,j+=1)attrsArr[j]=arguments[i];if(j<attrsArr.length)attrsArr.length=j;for(i=0;i<attrsArr.length;i+=2){var name=attrsArr[i];var value=attrsArr[i+1];newAttrs[name]=value}for(var _attr2 in newAttrs){updateAttribute(node,_attr2,newAttrs[_attr2]);
newAttrs[_attr2]=undefined}}return node};var elementOpenStart=function(tag,key,statics){if(true){assertNotInAttributes("elementOpenStart");setInAttributes(true)}argsBuilder[0]=tag;argsBuilder[1]=key;argsBuilder[2]=statics};var attr=function(name,value){if(true)assertInAttributes("attr");argsBuilder.push(name);argsBuilder.push(value)};var elementOpenEnd=function(){if(true){assertInAttributes("elementOpenEnd");setInAttributes(false)}var node=elementOpen.apply(null,argsBuilder);argsBuilder.length=0;
return node};var elementClose=function(tag){if(true)assertNotInAttributes("elementClose");var node=coreElementClose();if(true)assertCloseMatchesOpenTag(getData(node).nodeName,tag);return node};var elementVoid=function(tag,key,statics,var_args){elementOpen.apply(null,arguments);return elementClose(tag)};var text=function(value,var_args){if(true){assertNotInAttributes("text");assertNotInSkip("text")}var node=coreText();var data=getData(node);if(data.text!==value){data.text=value;var formatted=value;
for(var i=1;i<arguments.length;i+=1){var fn=arguments[i];formatted=fn(formatted)}node.data=formatted}return node};exports.patch=patchInner;exports.patchInner=patchInner;exports.patchOuter=patchOuter;exports.currentElement=currentElement;exports.currentPointer=currentPointer;exports.skip=skip;exports.skipNode=skipNode;exports.elementVoid=elementVoid;exports.elementOpenStart=elementOpenStart;exports.elementOpenEnd=elementOpenEnd;exports.elementOpen=elementOpen;exports.elementClose=elementClose;exports.text=
text;exports.attr=attr;exports.symbols=symbols;exports.attributes=attributes;exports.applyAttr=applyAttr;exports.applyProp=applyProp;exports.notifications=notifications;exports.importNode=importNode});
Liferay.Loader.define("frontend-js-metal-web$incremental-dom-string@0.0.2/dist/incremental-dom-string",["module","exports","require"],function(module,exports,require){var define=undefined;(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):factory(global.IncrementalDOM=global.IncrementalDOM||{})})(this,function(exports){exports.buffer=[];exports.currentParent=null;var currentElement=function currentElement(){return exports.currentParent};
var currentPointer=function currentPointer(){return{}};var patch=function patch(node,fn,data){exports.currentParent=node;fn(data);exports.currentParent.innerHTML=exports.buffer.join("");exports.buffer=[];return exports.currentParent};var patchOuter=patch;var patchInner=patch;var text=function text(value,var_args){var formatted=value;for(var i=1;i<arguments.length;i+=1){var fn=arguments[i];formatted=fn(formatted)}exports.buffer.push(formatted)};var symbols={default:"__default"};var attributes={};var updateAttribute=
function updateAttribute(el,name,value){var mutator=attributes[name]||attributes[symbols.default];mutator(el,name,value)};attributes[symbols.default]=function(el,name,value){if(Array.isArray(el))el.push(" "+name+'\x3d"'+value+'"')};var truncateArray=function truncateArray(arr,length){while(arr.length>length)arr.pop()};var ATTRIBUTES_OFFSET=3;var argsBuilder=[];var attr=function attr(name,value){argsBuilder.push(name);argsBuilder.push(value)};var elementClose=function elementClose(nameOrCtor){if(typeof nameOrCtor===
"function"){new nameOrCtor;return}exports.buffer.push("\x3c/"+nameOrCtor+"\x3e")};var elementVoid=function elementVoid(nameOrCtor,key,statics,var_args){elementOpen.apply(null,arguments);return elementClose(nameOrCtor)};var elementOpen=function elementOpen(nameOrCtor,key,statics,var_args){if(typeof nameOrCtor==="function"){new nameOrCtor;return exports.currentParent}exports.buffer.push("\x3c"+nameOrCtor);if(statics)for(var _i=0;_i<statics.length;_i+=2){var name=statics[_i];var value=statics[_i+1];
updateAttribute(exports.buffer,name,value)}var i=ATTRIBUTES_OFFSET;var j=0;for(;i<arguments.length;i+=2,j+=2){var _name=arguments[i];var _value=arguments[i+1];updateAttribute(exports.buffer,_name,_value)}exports.buffer.push("\x3e");return exports.currentParent};var elementOpenEnd=function elementOpenEnd(){elementOpen.apply(null,argsBuilder);truncateArray(argsBuilder,0)};var elementOpenStart=function elementOpenStart(nameOrCtor,key,statics){argsBuilder[0]=nameOrCtor;argsBuilder[1]=key;argsBuilder[2]=
statics};var renderToString=function renderToString(fn){patch({},fn);return currentElement().innerHTML};exports.currentElement=currentElement;exports.currentPointer=currentPointer;exports.patch=patch;exports.patchInner=patchInner;exports.patchOuter=patchOuter;exports.text=text;exports.attr=attr;exports.elementClose=elementClose;exports.elementOpen=elementOpen;exports.elementOpenEnd=elementOpenEnd;exports.elementOpenStart=elementOpenStart;exports.elementVoid=elementVoid;exports.renderToString=renderToString;
exports.symbols=symbols;exports.attributes=attributes;exports.updateAttribute=updateAttribute;Object.defineProperty(exports,"__esModule",{value:true})})});
