Liferay.Loader.define("frontend-js-metal-web$metal-dom@2.16.8/lib/dom",["module","exports","require","./domNamed"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.dom=undefined;var _domNamed=require("./domNamed");Object.keys(_domNamed).forEach(function(key){if(key==="default"||key==="__esModule")return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _domNamed[key]}})});var dom=_interopRequireWildcard(_domNamed); function _interopRequireWildcard(obj){if(obj&&obj.__esModule)return obj;else{var newObj={};if(obj!=null)for(var key in obj)if(Object.prototype.hasOwnProperty.call(obj,key))newObj[key]=obj[key];newObj.default=obj;return newObj}}exports.default=dom;exports.dom=dom}); Liferay.Loader.define("frontend-js-metal-web$metal-dom@2.16.8/lib/DomEventEmitterProxy",["module","exports","require","./dom","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=0;i--){var last=parts[i];if(last===".")parts.splice(i,1);else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot)for(;up--;up)parts.unshift("..");return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string")throw new TypeError("Arguments to path.resolve must be strings");else if(!path)continue;resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}), !resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute)path=".";if(path&&trailingSlash)path+="/";return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments, 0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string")throw new TypeError("Arguments to path.join must be strings");return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--)if(arr[end]!=="")break;if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/")); var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i1){result=parts[0]+"@";string=parts[1]}string=string.replace(regexSeparators,".");var labels=string.split(".");var encoded=map(labels,fn).join(".");return result+encoded}function ucs2decode(string){var output=[],counter=0,length=string.length,value,extra;while(counter=55296&& value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value);return output}).join("")}function basicToDigit(codePoint){if(codePoint-48<10)return codePoint- 22;if(codePoint-65<26)return codePoint-65;if(codePoint-97<26)return codePoint-97;return base}function digitToBasic(digit,flag){return digit+22+75*(digit<26)-((flag!=0)<<5)}function adapt(delta,numPoints,firstTime){var k=0;delta=firstTime?floor(delta/700):delta>>1;delta+=floor(delta/numPoints);for(;delta>baseMinusTMin*tMax>>1;k+=base)delta=floor(delta/baseMinusTMin);return floor(k+(baseMinusTMin+1)*delta/(delta+38))}function decode(input){var output=[],inputLength=input.length,out,i=0,n=initialN,bias= initialBias,basic,j,index,oldi,w,k,digit,t,baseMinusT;basic=input.lastIndexOf(delimiter);if(basic<0)basic=0;for(j=0;j=128)error("not-basic");output.push(input.charCodeAt(j))}for(index=basic>0?basic+1:0;index=inputLength)error("invalid-input");digit=basicToDigit(input.charCodeAt(index++));if(digit>=base||digit>floor((maxInt-i)/w))error("overflow");i+=digit*w;t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(digitfloor(maxInt/baseMinusT))error("overflow");w*=baseMinusT}out=output.length+1;bias=adapt(i-oldi,out,oldi==0);if(floor(i/out)>maxInt-n)error("overflow");n+=floor(i/out);i%=out;output.splice(i++,0,n)}return ucs2encode(output)}function encode(input){var n,delta,handledCPCount,basicLength,bias,j,m,q,k,t,currentValue,output=[],inputLength,handledCPCountPlusOne,baseMinusT,qMinusT;input=ucs2decode(input);inputLength=input.length;n=initialN;delta=0;bias=initialBias;for(j=0;j=n&¤tValuefloor((maxInt-delta)/handledCPCountPlusOne))error("overflow");delta+=(m-n)*handledCPCountPlusOne;n=m;for(j=0;jmaxInt)error("overflow");if(currentValue==n){for(q=delta,k=base;;k+=base){t=k<=bias?tMin:k>=bias+tMax?tMax:k-bias;if(q0&&len>maxKeys)len=maxKeys;for(var i=0;i=0){kstr=x.substr(0,idx);vstr=x.substr(idx+1)}else{kstr=x;vstr=""}k=decodeURIComponent(kstr);v=decodeURIComponent(vstr);if(!hasOwnProperty(obj,k))obj[k]=v;else if(Array.isArray(obj[k]))obj[k].push(v);else obj[k]=[obj[k],v]}return obj}}); Liferay.Loader.define("frontend-js-node-shims$querystring@0.2.0/encode",["module","exports","require"],function(module,exports,require){var define=undefined;var stringifyPrimitive=function(v){switch(typeof v){case "string":return v;case "boolean":return v?"true":"false";case "number":return isFinite(v)?v:"";default:return""}};module.exports=function(obj,sep,eq,name){sep=sep||"\x26";eq=eq||"\x3d";if(obj===null)obj=undefined;if(typeof obj==="object")return Object.keys(obj).map(function(k){var ks=encodeURIComponent(stringifyPrimitive(k))+ eq;if(Array.isArray(obj[k]))return obj[k].map(function(v){return ks+encodeURIComponent(stringifyPrimitive(v))}).join(sep);else return ks+encodeURIComponent(stringifyPrimitive(obj[k]))}).join(sep);if(!name)return"";return encodeURIComponent(stringifyPrimitive(name))+eq+encodeURIComponent(stringifyPrimitive(obj))}}); Liferay.Loader.define("frontend-js-node-shims$querystring@0.2.0/index",["module","exports","require","./decode","./encode"],function(module,exports,require){var define=undefined;exports.decode=exports.parse=require("./decode");exports.encode=exports.stringify=require("./encode")}); Liferay.Loader.define("frontend-js-node-shims$url@0.11.0/url",["module","exports","require","frontend-js-node-shims$punycode","./util","frontend-js-node-shims$querystring"],function(module,exports,require){var define=undefined;var punycode=require("frontend-js-node-shims$punycode");var util=require("./util");exports.parse=urlParse;exports.resolve=urlResolve;exports.resolveObject=urlResolveObject;exports.format=urlFormat;exports.Url=Url;function Url(){this.protocol=null;this.slashes=null;this.auth= null;this.host=null;this.port=null;this.hostname=null;this.hash=null;this.search=null;this.query=null;this.pathname=null;this.path=null;this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["\x3c","\x3e",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255, hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={"javascript":true,"javascript:":true},hostlessProtocol={"javascript":true,"javascript:":true},slashedProtocol={"http":true,"https":true,"ftp":true,"gopher":true,"file":true,"http:":true,"https:":true,"ftp:":true,"gopher:":true,"file:":true},querystring=require("frontend-js-node-shims$querystring");function urlParse(url,parseQueryString,slashesDenoteHost){if(url&&util.isObject(url)&&url instanceof Url)return url;var u=new Url;u.parse(url,parseQueryString,slashesDenoteHost);return u}Url.prototype.parse=function(url,parseQueryString,slashesDenoteHost){if(!util.isString(url))throw new TypeError("Parameter 'url' must be a string, not "+typeof url);var queryIndex=url.indexOf("?"),splitter=queryIndex!==-1&&queryIndex127)newpart+="x";else newpart+=part[j];if(!newpart.match(hostnamePartPattern)){var validParts=hostparts.slice(0,i);var notHost=hostparts.slice(i+1);var bit=part.match(hostnamePartStart);if(bit){validParts.push(bit[1]);notHost.unshift(bit[2])}if(notHost.length)rest="/"+notHost.join(".")+rest;this.hostname=validParts.join("."); break}}}}if(this.hostname.length>hostnameMaxLen)this.hostname="";else this.hostname=this.hostname.toLowerCase();if(!ipv6Hostname)this.hostname=punycode.toASCII(this.hostname);var p=this.port?":"+this.port:"";var h=this.hostname||"";this.host=h+p;this.href+=this.host;if(ipv6Hostname){this.hostname=this.hostname.substr(1,this.hostname.length-2);if(rest[0]!=="/")rest="/"+rest}}if(!unsafeProtocol[lowerProto])for(var i=0,l=autoEscape.length;i0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}result.search=relative.search;result.query=relative.query;if(!util.isNull(result.pathname)||!util.isNull(result.search))result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"");result.href=result.format();return result}if(!srcPath.length){result.pathname=null;if(result.search)result.path= "/"+result.search;else result.path=null;result.href=result.format();return result}var last=srcPath.slice(-1)[0];var hasTrailingSlash=(result.host||relative.host||srcPath.length>1)&&(last==="."||last==="..")||last==="";var up=0;for(var i=srcPath.length;i>=0;i--){last=srcPath[i];if(last===".")srcPath.splice(i,1);else if(last===".."){srcPath.splice(i,1);up++}else if(up){srcPath.splice(i,1);up--}}if(!mustEndAbs&&!removeAllDots)for(;up--;up)srcPath.unshift("..");if(mustEndAbs&&srcPath[0]!==""&&(!srcPath[0]|| srcPath[0].charAt(0)!=="/"))srcPath.unshift("");if(hasTrailingSlash&&srcPath.join("/").substr(-1)!=="/")srcPath.push("");var isAbsolute=srcPath[0]===""||srcPath[0]&&srcPath[0].charAt(0)==="/";if(psychotic){result.hostname=result.host=isAbsolute?"":srcPath.length?srcPath.shift():"";var authInHost=result.host&&result.host.indexOf("@")>0?result.host.split("@"):false;if(authInHost){result.auth=authInHost.shift();result.host=result.hostname=authInHost.shift()}}mustEndAbs=mustEndAbs||result.host&&srcPath.length; if(mustEndAbs&&!isAbsolute)srcPath.unshift("");if(!srcPath.length){result.pathname=null;result.path=null}else result.pathname=srcPath.join("/");if(!util.isNull(result.pathname)||!util.isNull(result.search))result.path=(result.pathname?result.pathname:"")+(result.search?result.search:"");result.auth=relative.auth||result.auth;result.slashes=result.slashes||relative.slashes;result.href=result.format();return result};Url.prototype.parseHost=function(){var host=this.host;var port=portPattern.exec(host); if(port){port=port[0];if(port!==":")this.port=port.substr(1);host=host.substr(0,host.length-port.length)}if(host)this.hostname=host}}); Liferay.Loader.define("frontend-js-metal-web$metal-uri@2.4.0/node",["module","exports","require","./lib/Uri","frontend-js-node-shims$path","frontend-js-node-shims$url"],function(module,exports,require){var define=undefined;var Uri=require("./lib/Uri").default;if(typeof URL==="undefined"&&typeof require!=="undefined"){var path=require("frontend-js-node-shims$path");var url=require("frontend-js-node-shims$url");Uri.setParseFn(function(urlStr){var parsed=url.parse(urlStr);parsed.pathname=path.normalize(parsed.pathname); return parsed})}module.exports=Uri}); Liferay.Loader.define("frontend-js-spa-web$senna@2.7.7/lib/utils/utils",["module","exports","require","frontend-js-metal-web$metal-dom","../globals/globals","frontend-js-metal-web$metal-uri"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i1&&path[length-1]==="/")path=path.substr(0, length-1);return path}},{key:"setElementWithRandomHref",value:function setElementWithRandomHref(element){element.href=element.href+"?q\x3d"+Math.random();return element}},{key:"setReferrer",value:function setReferrer(referrer){Object.defineProperty(_globals2.default.document,"referrer",{configurable:true,get:function get(){return referrer}})}}]);return utils}();exports.default=utils}); Liferay.Loader.define("frontend-js-spa-web$senna@2.7.7/lib/app/version",["module","exports","require"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var version="2.7.7";exports.default=version}); /* Promises polyfill from Google's Closure Library. Copyright 2013 The Closure Library Authors. All Rights Reserved. NOTE(eduardo): Promise support is not ready on all supported browsers, therefore metal-promise is temporarily using Google's promises as polyfill. It supports cancellable promises and has clean and fast implementation. */ Liferay.Loader.define("frontend-js-metal-web$metal-promise@2.0.1/lib/promise/Promise",["module","exports","require","frontend-js-metal-web$metal"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});exports.CancellablePromise=undefined;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");}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 Thenable=function Thenable(){};Thenable.prototype.then=function(){};Thenable.IMPLEMENTED_BY_PROP="$goog_Thenable";Thenable.addImplementation=function(ctor){ctor.prototype.then=ctor.prototype.then;ctor.prototype.$goog_Thenable=true};Thenable.isImplementedBy=function(object){if(!object)return false;try{return!!object.$goog_Thenable}catch(e){return false}};var partial=function partial(fn){var args= Array.prototype.slice.call(arguments,1);return function(){var newArgs=args.slice();newArgs.push.apply(newArgs,arguments);return fn.apply(this,newArgs)}};var CancellablePromise=function CancellablePromise(resolver,opt_context){this.state_=CancellablePromise.State_.PENDING;this.result_=undefined;this.parent_=null;this.callbackEntries_=null;this.executing_=false;if(CancellablePromise.UNHANDLED_REJECTION_DELAY>0)this.unhandledRejectionId_=0;else if(CancellablePromise.UNHANDLED_REJECTION_DELAY===0)this.hadUnhandledRejection_= false;try{var self=this;resolver.call(opt_context,function(value){self.resolve_(CancellablePromise.State_.FULFILLED,value)},function(reason){self.resolve_(CancellablePromise.State_.REJECTED,reason)})}catch(e){this.resolve_(CancellablePromise.State_.REJECTED,e)}};CancellablePromise.UNHANDLED_REJECTION_DELAY=0;CancellablePromise.State_={PENDING:0,BLOCKED:1,FULFILLED:2,REJECTED:3};CancellablePromise.CallbackEntry_=null;CancellablePromise.resolve=function(opt_value){return new CancellablePromise(function(resolve){resolve(opt_value)})}; CancellablePromise.reject=function(opt_reason){return new CancellablePromise(function(resolve,reject){reject(opt_reason)})};CancellablePromise.race=function(promises){return new CancellablePromise(function(resolve,reject){if(!promises.length)resolve(undefined);for(var i=0,promise;promise=promises[i];i++)promise.then(resolve,reject)})};CancellablePromise.all=function(promises){return new CancellablePromise(function(resolve,reject){var toFulfill=promises.length;var values=[];if(!toFulfill){resolve(values); return}var onFulfill=function onFulfill(index,value){toFulfill--;values[index]=value;if(toFulfill===0)resolve(values)};var onReject=function onReject(reason){reject(reason)};for(var i=0,promise;promise=promises[i];i++)promise.then(partial(onFulfill,i),onReject)})};CancellablePromise.firstFulfilled=function(promises){return new CancellablePromise(function(resolve,reject){var toReject=promises.length;var reasons=[];if(!toReject){resolve(undefined);return}var onFulfill=function onFulfill(value){resolve(value)}; var onReject=function onReject(index,reason){toReject--;reasons[index]=reason;if(toReject===0)reject(reasons)};for(var i=0,promise;promise=promises[i];i++)promise.then(onFulfill,partial(onReject,i))})};CancellablePromise.prototype.then=function(opt_onFulfilled,opt_onRejected,opt_context){return this.addChildPromise_((0,_metal.isFunction)(opt_onFulfilled)?opt_onFulfilled:null,(0,_metal.isFunction)(opt_onRejected)?opt_onRejected:null,opt_context)};Thenable.addImplementation(CancellablePromise);CancellablePromise.prototype.thenAlways= function(onResolved,opt_context){var callback=function callback(){try{onResolved.call(opt_context)}catch(err){CancellablePromise.handleRejection_.call(null,err)}};this.addCallbackEntry_({child:null,onRejected:callback,onFulfilled:callback});return this};CancellablePromise.prototype.thenCatch=function(onRejected,opt_context){return this.addChildPromise_(null,onRejected,opt_context)};CancellablePromise.prototype.catch=CancellablePromise.prototype.thenCatch;CancellablePromise.prototype.cancel=function(opt_message){if(this.state_=== CancellablePromise.State_.PENDING)_metal.async.run(function(){var err=new CancellablePromise.CancellationError(opt_message);err.IS_CANCELLATION_ERROR=true;this.cancelInternal_(err)},this)};CancellablePromise.prototype.cancelInternal_=function(err){if(this.state_===CancellablePromise.State_.PENDING)if(this.parent_)this.parent_.cancelChild_(this,err);else this.resolve_(CancellablePromise.State_.REJECTED,err)};CancellablePromise.prototype.cancelChild_=function(childPromise,err){if(!this.callbackEntries_)return; var childCount=0;var childIndex=-1;for(var i=0,entry;entry=this.callbackEntries_[i];i++){var child=entry.child;if(child){childCount++;if(child===childPromise)childIndex=i;if(childIndex>=0&&childCount>1)break}}if(childIndex>=0)if(this.state_===CancellablePromise.State_.PENDING&&childCount===1)this.cancelInternal_(err);else{var callbackEntry=this.callbackEntries_.splice(childIndex,1)[0];this.executeCallback_(callbackEntry,CancellablePromise.State_.REJECTED,err)}};CancellablePromise.prototype.addCallbackEntry_= function(callbackEntry){if((!this.callbackEntries_||!this.callbackEntries_.length)&&(this.state_===CancellablePromise.State_.FULFILLED||this.state_===CancellablePromise.State_.REJECTED))this.scheduleCallbacks_();if(!this.callbackEntries_)this.callbackEntries_=[];this.callbackEntries_.push(callbackEntry)};CancellablePromise.prototype.addChildPromise_=function(onFulfilled,onRejected,opt_context){var callbackEntry={child:null,onFulfilled:null,onRejected:null};callbackEntry.child=new CancellablePromise(function(resolve, reject){callbackEntry.onFulfilled=onFulfilled?function(value){try{var result=onFulfilled.call(opt_context,value);resolve(result)}catch(err){reject(err)}}:resolve;callbackEntry.onRejected=onRejected?function(reason){try{var result=onRejected.call(opt_context,reason);if(!(0,_metal.isDef)(result)&&reason.IS_CANCELLATION_ERROR)reject(reason);else resolve(result)}catch(err){reject(err)}}:reject});callbackEntry.child.parent_=this;this.addCallbackEntry_(callbackEntry);return callbackEntry.child};CancellablePromise.prototype.unblockAndFulfill_= function(value){if(this.state_!==CancellablePromise.State_.BLOCKED)throw new Error("CancellablePromise is not blocked.");this.state_=CancellablePromise.State_.PENDING;this.resolve_(CancellablePromise.State_.FULFILLED,value)};CancellablePromise.prototype.unblockAndReject_=function(reason){if(this.state_!==CancellablePromise.State_.BLOCKED)throw new Error("CancellablePromise is not blocked.");this.state_=CancellablePromise.State_.PENDING;this.resolve_(CancellablePromise.State_.REJECTED,reason)};CancellablePromise.prototype.resolve_= function(state,x){if(this.state_!==CancellablePromise.State_.PENDING)return;if(this===x){state=CancellablePromise.State_.REJECTED;x=new TypeError("CancellablePromise cannot resolve to itself")}else if(Thenable.isImplementedBy(x)){x=x;this.state_=CancellablePromise.State_.BLOCKED;x.then(this.unblockAndFulfill_,this.unblockAndReject_,this);return}else if((0,_metal.isObject)(x))try{var then=x.then;if((0,_metal.isFunction)(then)){this.tryThen_(x,then);return}}catch(e){state=CancellablePromise.State_.REJECTED; x=e}this.result_=x;this.state_=state;this.scheduleCallbacks_();if(state===CancellablePromise.State_.REJECTED&&!x.IS_CANCELLATION_ERROR)CancellablePromise.addUnhandledRejection_(this,x)};CancellablePromise.prototype.tryThen_=function(thenable,then){this.state_=CancellablePromise.State_.BLOCKED;var promise=this;var called=false;var resolve=function resolve(value){if(!called){called=true;promise.unblockAndFulfill_(value)}};var reject=function reject(reason){if(!called){called=true;promise.unblockAndReject_(reason)}}; try{then.call(thenable,resolve,reject)}catch(e){reject(e)}};CancellablePromise.prototype.scheduleCallbacks_=function(){if(!this.executing_){this.executing_=true;_metal.async.run(this.executeCallbacks_,this)}};CancellablePromise.prototype.executeCallbacks_=function(){while(this.callbackEntries_&&this.callbackEntries_.length){var entries=this.callbackEntries_;this.callbackEntries_=[];for(var i=0;i0)for(p=this;p&&p.unhandledRejectionId_;p=p.parent_){clearTimeout(p.unhandledRejectionId_);p.unhandledRejectionId_=0}else if(CancellablePromise.UNHANDLED_REJECTION_DELAY===0)for(p=this;p&&p.hadUnhandledRejection_;p= p.parent_)p.hadUnhandledRejection_=false};CancellablePromise.addUnhandledRejection_=function(promise,reason){if(CancellablePromise.UNHANDLED_REJECTION_DELAY>0)promise.unhandledRejectionId_=setTimeout(function(){CancellablePromise.handleRejection_.call(null,reason)},CancellablePromise.UNHANDLED_REJECTION_DELAY);else if(CancellablePromise.UNHANDLED_REJECTION_DELAY===0){promise.hadUnhandledRejection_=true;_metal.async.run(function(){if(promise.hadUnhandledRejection_)CancellablePromise.handleRejection_.call(null, reason)})}};CancellablePromise.handleRejection_=_metal.async.throwException;CancellablePromise.setUnhandledRejectionHandler=function(handler){CancellablePromise.handleRejection_=handler};CancellablePromise.CancellationError=function(_Error){_inherits(_class,_Error);function _class(opt_message){_classCallCheck(this,_class);var _this=_possibleConstructorReturn(this,_Error.call(this,opt_message));if(opt_message)_this.message=opt_message;return _this}return _class}(Error);CancellablePromise.CancellationError.prototype.name= "cancel";exports.CancellablePromise=CancellablePromise;exports.default=CancellablePromise}); Liferay.Loader.define("frontend-js-metal-web$metal-ajax@2.1.1/lib/Ajax",["module","exports","require","frontend-js-metal-web$metal","frontend-js-metal-web$metal-uri","frontend-js-metal-web$metal-promise"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});var _createClass=function(){function defineProperties(target,props){for(var i=0;i0){var name=pairs[i].substring(0,index);var value=pairs[i].substring(index+2);headers.push({name:name,value:value})}}return headers}},{key:"request",value:function request(url,method,body,opt_headers,opt_params,opt_timeout,opt_sync,opt_withCredentials){url=url||"";method=method||"GET";var request=new XMLHttpRequest;var previousReadyState=0;var promise=(new _metalPromise.CancellablePromise(function(resolve,reject){request.onload=function(){if(request.aborted){request.onerror(); return}resolve(request)};request.onreadystatechange=function(){if(previousReadyState&&previousReadyState<3&&4===request.readyState)request.terminatedPrematurely=true;previousReadyState=request.readyState};request.onerror=function(){var message="Request error";if(request.terminatedPrematurely)message="Request terminated prematurely";var error=new Error(message);error.request=request;reject(error)}})).thenCatch(function(reason){request.abort();throw reason;}).thenAlways(function(){clearTimeout(timeout)}); url=new _metalUri2.default(url);if(opt_params)url.addParametersFromMultiMap(opt_params).toString();url=url.toString();request.open(method,url,!opt_sync);if(opt_withCredentials)request.withCredentials=true;if(opt_headers)opt_headers.names().forEach(function(name){request.setRequestHeader(name,opt_headers.getAll(name).join(", "))});request.send((0,_metal.isDef)(body)?body:null);if((0,_metal.isDefAndNotNull)(opt_timeout))var timeout=setTimeout(function(){promise.cancel("Request timeout")},opt_timeout); return promise}}]);return Ajax}();exports.default=Ajax}); Liferay.Loader.define("frontend-js-spa-web$senna@2.7.7/lib/errors/errors",["module","exports","require"],function(module,exports,require){var define=undefined;Object.defineProperty(exports,"__esModule",{value:true});function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function");}var errors=function errors(){_classCallCheck(this,errors)};errors.INVALID_STATUS="Invalid status code";errors.REQUEST_ERROR="Request error";errors.REQUEST_TIMEOUT= "Request timeout";errors.REQUEST_PREMATURE_TERMINATION="Request terminated prematurely";exports.default=errors}); Liferay.Loader.define("frontend-js-spa-web$senna@2.7.7/lib/cacheable/Cacheable",["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;i0&&arguments[0]!==undefined?arguments[0]:"";var platform=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";UA.userAgent=userAgent;UA.platform=platform;UA.isMac=UA.matchPlatform("Mac");UA.isWin=UA.matchPlatform("Win");UA.isOpera=UA.matchUserAgent("Opera")||UA.matchUserAgent("OPR");UA.isIe=UA.matchUserAgent("Trident")||UA.matchUserAgent("MSIE"); UA.isEdge=UA.matchUserAgent("Edge");UA.isIeOrEdge=UA.isIe||UA.isEdge;UA.isChrome=(UA.matchUserAgent("Chrome")||UA.matchUserAgent("CriOS"))&&!UA.isOpera&&!UA.isEdge;UA.isSafari=UA.matchUserAgent("Safari")&&!(UA.isChrome||UA.isOpera||UA.isEdge);UA.isFirefox=UA.matchUserAgent("Firefox")}}]);return UA}();Object.defineProperty(UA,"globals",{writable:true,value:{window:(0,_metal.isServerSide)()?null:window}});UA.testUserAgent(UA.getNativeUserAgent(),UA.getNativePlatform());exports.default=UA}); Liferay.Loader.define("frontend-js-spa-web$senna@2.7.7/lib/screen/RequestScreen",["module","exports","require","frontend-js-metal-web$metal","frontend-js-metal-web$metal-ajax","frontend-js-metal-web$metal-structs","frontend-js-metal-web$metal-promise","../errors/errors","../utils/utils","../globals/globals","./Screen","frontend-js-metal-web$metal-uri","frontend-js-metal-web$metal-useragent"],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=200&&statusCode<=399}},{key:"load", value:function load(path){var _this2=this;var cache=this.getCache();if((0,_metal.isDefAndNotNull)(cache))return _metalPromise2.default.resolve(cache);var body=null;var httpMethod=this.httpMethod;var headers=new _metalStructs.MultiMap;Object.keys(this.httpHeaders).forEach(function(header){return headers.add(header,_this2.httpHeaders[header])});if(_globals2.default.capturedFormElement){this.addSafariXHRPolyfill();body=new FormData(_globals2.default.capturedFormElement);this.maybeAppendSubmitButtonValue_(body); httpMethod=RequestScreen.POST;if(_metalUseragent2.default.isIeOrEdge)headers.add("If-None-Match",'"0"')}var requestPath=this.formatLoadPath(path);return _metalAjax2.default.request(requestPath,httpMethod,body,headers,null,this.timeout).then(function(xhr){_this2.removeSafariXHRPolyfill();_this2.setRequest(xhr);_this2.assertValidResponseStatusCode(xhr.status);if(httpMethod===RequestScreen.GET&&_this2.isCacheable())_this2.addCache(xhr.responseText);xhr.requestPath=requestPath;return xhr.responseText}).catch(function(reason){_this2.removeSafariXHRPolyfill(); switch(reason.message){case _errors2.default.REQUEST_TIMEOUT:reason.timeout=true;break;case _errors2.default.REQUEST_ERROR:reason.requestError=true;break;case _errors2.default.REQUEST_PREMATURE_TERMINATION:reason.requestError=true;reason.requestPrematureTermination=true;break}throw reason;})}},{key:"maybeAppendSubmitButtonValue_",value:function maybeAppendSubmitButtonValue_(body){var button=_globals2.default.capturedFormButtonElement;if(button&&button.name)body.append(button.name,button.value)}}, {key:"maybeExtractResponseUrlFromRequest",value:function maybeExtractResponseUrlFromRequest(request){var responseUrl=request.responseURL;if(responseUrl)return responseUrl;return request.getResponseHeader(RequestScreen.X_REQUEST_URL_HEADER)}},{key:"addSafariXHRPolyfill",value:function addSafariXHRPolyfill(){if(_globals2.default.capturedFormElement&&_metalUseragent2.default.isSafari){var inputs=_globals2.default.capturedFormElement.querySelectorAll('input[type\x3d"file"]:not([disabled])');for(var index= 0;index0)return;input.setAttribute("data-safari-temp-disabled","true");input.setAttribute("disabled","")}}}},{key:"removeSafariXHRPolyfill",value:function removeSafariXHRPolyfill(){if(_globals2.default.capturedFormElement&&_metalUseragent2.default.isSafari){var inputs=_globals2.default.capturedFormElement.querySelectorAll('input[type\x3d"file"][data-safari-temp-disabled]');for(var index=0;index