forked from microsoft/PowerBI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpowerbi.min.js
More file actions
6 lines (6 loc) · 43.6 KB
/
Copy pathpowerbi.min.js
File metadata and controls
6 lines (6 loc) · 43.6 KB
1
2
3
4
5
6
/*! powerbi-client v2.3.1 | (c) 2016 Microsoft Corporation MIT */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["powerbi-client"]=t():e["powerbi-client"]=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){var n=r(1);t.service=n;var i=r(10);t.factories=i;var o=r(5);t.models=o;var s=r(4);t.Report=s.Report;var a=r(9);t.Tile=a.Tile;var u=r(2);t.Embed=u.Embed;var c=r(6);t.Page=c.Page;var d=new n.Service(i.hpmFactory,i.wpmpFactory,i.routerFactory);window.powerbi=d},function(e,t,r){var n=r(2),i=r(4),o=r(7),s=r(8),a=r(9),u=r(6),c=r(3),d=function(){function e(t,r,n,i){var o=this;void 0===i&&(i={}),this.wpmp=r(i.wpmpName,i.logMessages),this.hpm=t(this.wpmp,null,i.version,i.type),this.router=n(this.wpmp),this.router.post("/reports/:uniqueId/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/reports/:uniqueId/pages/:pageName/events/:eventName",function(e,t){var r={type:"report",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.router.post("/dashboards/:uniqueId/events/:eventName",function(e,t){var r={type:"dashboard",id:e.params.uniqueId,name:e.params.eventName,value:e.body};o.handleEvent(r)}),this.embeds=[],this.config=c.assign({},e.defaultConfig,i),this.config.autoEmbedOnContentLoaded&&this.enableAutoEmbed()}return e.prototype.createReport=function(e,t){t.type="create";var r=e,n=new o.Create(this,r,t);return r.powerBiEmbed=n,this.addOrOverwriteEmbed(n,e),n},e.prototype.init=function(e,t){var r=this;void 0===t&&(t=void 0),e=e&&e instanceof HTMLElement?e:document.body;var i=Array.prototype.slice.call(e.querySelectorAll("["+n.Embed.embedUrlAttribute+"]"));return i.map(function(e){return r.embed(e,t)})},e.prototype.embed=function(e,t){void 0===t&&(t={});var r,n=e;return r=n.powerBiEmbed?this.embedExisting(n,t):this.embedNew(n,t)},e.prototype.embedNew=function(t,r){var o=r.type||t.getAttribute(n.Embed.typeAttribute);if(!o)throw new Error("Attempted to embed using config "+JSON.stringify(r)+" on element "+t.outerHTML+", but could not determine what type of component to embed. You must specify a type in the configuration or as an attribute such as '"+n.Embed.typeAttribute+'="'+i.Report.type.toLowerCase()+"\"'.");r.type=o;var s=c.find(function(e){return o===e.type.toLowerCase()},e.components);if(!s)throw new Error("Attempted to embed component of type: "+o+" but did not find any matching component. Please verify the type you specified is intended.");var a=new s(this,t,r);return t.powerBiEmbed=a,this.addOrOverwriteEmbed(a,t),a},e.prototype.embedExisting=function(e,t){var r=c.find(function(t){return t.element===e},this.embeds);if(!r)throw new Error("Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+" which already has embedded comopnent associated, but could not find the existing comopnent in the list of active components. This could indicate the embeds list is out of sync with the DOM, or the component is referencing the incorrect HTML element.");if("string"==typeof t.type&&t.type!==r.config.type){if("report"===t.type&&"create"===r.config.type){var n=new i.Report(this,e,t,e.powerBiEmbed.iframe);return n.load(t),e.powerBiEmbed=n,this.addOrOverwriteEmbed(r,e),n}throw new Error("Embedding on an existing element with a different type than the previous embed object is not supported. Attempted to embed using config "+JSON.stringify(t)+" on element "+e.outerHTML+", but the existing element contains an embed of type: "+this.config.type+" which does not match the new type: "+t.type)}return r.load(t),r},e.prototype.enableAutoEmbed=function(){var e=this;window.addEventListener("DOMContentLoaded",function(t){return e.init(document.body)},!1)},e.prototype.get=function(e){var t=e;if(!t.powerBiEmbed)throw new Error("You attempted to get an instance of powerbi component associated with element: "+e.outerHTML+" but there was no associated instance.");return t.powerBiEmbed},e.prototype.find=function(e){return c.find(function(t){return t.config.uniqueId===e},this.embeds)},e.prototype.addOrOverwriteEmbed=function(e,t){this.embeds=this.embeds.filter(function(e){return e.element.id!==t.id}),this.embeds.push(e)},e.prototype.reset=function(e){var t=e;if(t.powerBiEmbed){c.remove(function(e){return e===t.powerBiEmbed},this.embeds),delete t.powerBiEmbed;var r=e.querySelector("iframe");r&&(void 0!==r.remove?r.remove():r.parentElement.removeChild(r))}},e.prototype.handleTileEvents=function(e){"tile"===e.type&&this.handleEvent(e)},e.prototype.handleEvent=function(e){var t=c.find(function(t){return t.config.uniqueId===e.id},this.embeds);if(t){var r=e.value;if("pageChanged"===e.name){var n="newPage",i=r[n];if(!i)throw new Error("Page model not found at 'event.value."+n+"'.");r[n]=new u.Page(t,i.name,i.displayName)}c.raiseCustomEvent(t.element,e.name,r)}},e.components=[a.Tile,i.Report,s.Dashboard],e.defaultConfig={autoEmbedOnContentLoaded:!1,onError:function(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];return console.log(e[0],e.slice(1))}},e}();t.Service=d},function(e,t,r){var n=r(3),i=function(){function e(t,r,n,i){this.allowedEvents=[],Array.prototype.push.apply(this.allowedEvents,e.allowedEvents),this.eventHandlers=[],this.service=t,this.element=r,this.iframe=i,this.embeType=n.type.toLowerCase(),this.populateConfig(n),"create"===this.embeType?this.setIframe(!1):this.setIframe(!0)}return e.prototype.createReport=function(e){var t=this.validate(e);if(t)throw t;return this.service.hpm.post("/report/create",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.save=function(){return this.service.hpm.post("/report/save",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},e.prototype.saveAs=function(e){return this.service.hpm.post("/report/saveAs",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},e.prototype.load=function(e){var t=this,r=this.validate(e);if(r)throw r;return this.service.hpm.post(this.loadPath,e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(r){return n.assign(t.config,e),r.body},function(e){throw e.body})},e.prototype.off=function(e,t){var r=this,i={name:e,type:null,id:null,value:null};if(t)n.remove(function(e){return e.test(i)&&e.handle===t},this.eventHandlers),this.element.removeEventListener(e,t);else{var o=this.eventHandlers.filter(function(e){return e.test(i)});o.forEach(function(t){n.remove(function(e){return e===t},r.eventHandlers),r.element.removeEventListener(e,t.handle)})}},e.prototype.on=function(e,t){if(this.allowedEvents.indexOf(e)===-1)throw new Error("eventName is must be one of "+this.allowedEvents+". You passed: "+e);this.eventHandlers.push({test:function(t){return t.name===e},handle:t}),this.element.addEventListener(e,t)},e.prototype.reload=function(){return this.load(this.config)},e.prototype.setAccessToken=function(e){return this.service.hpm.post("/report/token",e,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},e.prototype.getAccessToken=function(t){var r=this.config.accessToken||this.element.getAttribute(e.accessTokenAttribute)||t;if(!r)throw new Error("No access token was found for element. You must specify an access token directly on the element using attribute '"+e.accessTokenAttribute+"' or specify a global token at: powerbi.accessToken.");return r},e.prototype.populateConfig=function(t){var r=n.assign({},e.defaultSettings,t.settings);this.config=n.assign({settings:r},t),this.config.uniqueId=this.getUniqueId(),this.config.embedUrl=this.getEmbedUrl(),"create"===this.embeType?this.createConfig={datasetId:t.datasetId||this.getId(),accessToken:this.getAccessToken(this.service.accessToken),tokenType:t.tokenType,settings:r}:(this.config.id=this.getId(),this.config.accessToken=this.getAccessToken(this.service.accessToken),"tile"==this.embeType&&(this.config.action=t.action,this.config.height=t.height,this.config.width=t.width))},e.prototype.getEmbedUrl=function(){var t=this.config.embedUrl||this.element.getAttribute(e.embedUrlAttribute);if("string"!=typeof t||0===t.length)throw new Error("Embed Url is required, but it was not found. You must provide an embed url either as part of embed configuration or as attribute '"+e.embedUrlAttribute+"'.");return t},e.prototype.getUniqueId=function(){return this.config.uniqueId||this.element.getAttribute(e.nameAttribute)||n.createRandomString()},e.prototype.fullscreen=function(){var e=this.iframe.requestFullscreen||this.iframe.msRequestFullscreen||this.iframe.mozRequestFullScreen||this.iframe.webkitRequestFullscreen;e.call(this.iframe)},e.prototype.exitFullscreen=function(){if(this.isFullscreen(this.iframe)){var e=document.exitFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.msExitFullscreen;e.call(document)}},e.prototype.isFullscreen=function(e){var t=["fullscreenElement","webkitFullscreenElement","mozFullscreenScreenElement","msFullscreenElement"];return t.some(function(t){return document[t]===e})},e.prototype.setIframe=function(e){var t=this;if(!this.iframe){var r=document.createElement("iframe"),n=this.config.embedUrl;r.setAttribute("style","width:100%;height:100%;"),r.setAttribute("src",n),r.setAttribute("scrolling","no"),r.setAttribute("allowfullscreen","true");for(var i=this.element;i.firstChild;)i.removeChild(i.firstChild);i.appendChild(r),this.iframe=i.firstChild}e?this.iframe.addEventListener("load",function(){return t.load(t.config)},!1):this.iframe.addEventListener("load",function(){return t.createReport(t.createConfig)},!1)},e.allowedEvents=["loaded","saved","rendered","saveAsTriggered","error","dataSelected"],e.accessTokenAttribute="powerbi-access-token",e.embedUrlAttribute="powerbi-embed-url",e.nameAttribute="powerbi-name",e.typeAttribute="powerbi-type",e.defaultSettings={filterPaneEnabled:!0},e}();t.Embed=i},function(e,t){function r(e,t,r){var n;"function"==typeof CustomEvent?n=new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(t,!0,!0,r)),e.dispatchEvent(n)}function n(e,t){if(!Array.isArray(t))throw new Error("You attempted to call find with second parameter that was not an array. You passed: "+t);var r;return t.some(function(t,n){if(e(t))return r=n,!0}),r}function i(e,t){var r=n(e,t);return t[r]}function o(e,t){var r=n(e,t);t.splice(r,1)}function s(){for(var e=[],t=0;t<arguments.length;t++)e[t-0]=arguments[t];var r=e[0];if(void 0===r||null===r)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(r),i=1;i<arguments.length;i++){var o=arguments[i];if(void 0!==o&&null!==o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n}function a(){return(Math.random()+1).toString(36).substring(7)}t.raiseCustomEvent=r,t.findIndex=n,t.find=i,t.remove=o,t.assign=s,t.createRandomString=a},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(2),o=r(5),s=r(3),a=r(6),u=function(e){function t(r,n,i,o){var a=i.settings&&i.settings.filterPaneEnabled||!("false"===n.getAttribute(t.filterPaneEnabledAttribute)),u=i.settings&&i.settings.navContentPaneEnabled||!("false"===n.getAttribute(t.navContentPaneEnabledAttribute)),c=s.assign({filterPaneEnabled:a,navContentPaneEnabled:u},i.settings),d=s.assign({settings:c},i);e.call(this,r,n,d,o),this.loadPath="/report/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=/reportId="?([^&]+)"?/,n=e.match(r);return n&&(t=n[1]),t},t.prototype.getFilters=function(){return this.service.hpm.get("/report/filters",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.reportIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Report id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.reportIdAttribute+"'.");return e},t.prototype.getPages=function(){var e=this;return this.service.hpm.get("/report/pages",{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(t){return t.body.map(function(t){return new a.Page(e,t.name,t.displayName)})},function(e){throw e.body})},t.prototype.page=function(e,t){return new a.Page(this,e,t)},t.prototype.print=function(){return this.service.hpm.post("/report/print",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},t.prototype.removeFilters=function(){return this.setFilters([])},t.prototype.setPage=function(e){var t={name:e,displayName:null};return this.service.hpm.put("/report/pages/active",t,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(e){throw e.body})},t.prototype.setFilters=function(e){return this.service.hpm.put("/report/filters",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(e){throw e.body})},t.prototype.updateSettings=function(e){return this.service.hpm.patch("/report/settings",e,{uid:this.config.uniqueId},this.iframe.contentWindow)["catch"](function(e){throw e.body})},t.prototype.validate=function(e){return o.validateReportLoad(e)},t.prototype.switchMode=function(e){var t="/report/switchMode/"+e;return this.service.hpm.post(t,null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},t.prototype.refresh=function(){return this.service.hpm.post("/report/refresh",null,{uid:this.config.uniqueId},this.iframe.contentWindow).then(function(e){return e.body})["catch"](function(e){throw e.body})},t.allowedEvents=["filtersApplied","pageChanged"],t.reportIdAttribute="powerbi-report-id",t.filterPaneEnabledAttribute="powerbi-settings-filter-pane-enabled",t.navContentPaneEnabledAttribute="powerbi-settings-nav-content-pane-enabled",t.typeAttribute="powerbi-type",t.type="Report",t}(i.Embed);t.Report=u},function(e,t,r){/*! powerbi-models v0.11.2 | (c) 2016 Microsoft Corporation MIT */
!function(t,r){e.exports=r()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){function n(e,t){return function(e){}}function i(e){return u(e)&&!!e.keys}function o(e){return s(e)===p.Basic&&!!e.keyValues}function s(e){var t=e,r=e;return"string"==typeof t.operator&&Array.isArray(t.values)?p.Basic:"string"==typeof r.logicalOperator&&Array.isArray(r.conditions)?p.Advanced:p.Unknown}function a(e){return void 0!==e.table&&void 0!==e.measure}function u(e){return void 0!==e.table&&void 0!==e.column}function c(e){return void 0!==e.table&&void 0!==e.hierarchy&&void 0!==e.hierarchyLevel}var d=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0}),t.advancedFilterSchema=r(1),t.filterSchema=r(2),t.loadSchema=r(3),t.dashboardLoadSchema=r(4),t.pageSchema=r(5),t.settingsSchema=r(6),t.basicFilterSchema=r(7),t.createReportSchema=r(8),t.saveAsParametersSchema=r(9),t.validateSettings=n(t.settingsSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateReportLoad=n(t.loadSchema,{schemas:{settings:t.settingsSchema,basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}}),t.validateCreateReport=n(t.createReportSchema),t.validateDashboardLoad=n(t.dashboardLoadSchema),t.validatePage=n(t.pageSchema),t.validateFilter=n(t.filterSchema,{schemas:{basicFilter:t.basicFilterSchema,advancedFilter:t.advancedFilterSchema}});var p;!function(e){e[e.Advanced=0]="Advanced",e[e.Basic=1]="Basic",e[e.Unknown=2]="Unknown"}(p=t.FilterType||(t.FilterType={})),t.isFilterKeyColumnsTarget=i,t.isBasicFilterWithKeys=o,t.getFilterType=s,t.isMeasure=a,t.isColumn=u,t.isHierarchy=c;var h=function(){function e(e){this.target=e}return e.prototype.toJSON=function(){return{$schema:this.schemaUrl,target:this.target}},e}();t.Filter=h;var l=function(e){function t(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var s=e.call(this,r)||this;if(s.operator=n,s.schemaUrl=t.schemaUrl,0===i.length&&"All"!==n)throw new Error('values must be a non-empty array unless your operator is "All".');return Array.isArray(i[0])?s.values=i[0]:s.values=i,s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.operator=this.operator,t.values=this.values,t},t}(h);l.schemaUrl="http://powerbi.com/product/schema#basic",t.BasicFilter=l;var f=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n)||this;o.keyValues=i,o.target=t;var s=t.keys?t.keys.length:0;if(s>0&&!i)throw new Error("You shold pass the values to be filtered for each key. You passed: no values and "+s+" keys");if(0===s&&i&&i.length>0)throw new Error("You passed key values but your target object doesn't contain the keys to be filtered");for(var a=0;a<o.keyValues.length;a++)if(o.keyValues[a]){var u=o.keyValues[a].length;if(u!==s)throw new Error("Each tuple of key values should contain a value for each of the keys. You passed: "+u+" values and "+s+" keys")}return o}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.keyValues=this.keyValues,t},t}(l);t.BasicFilterWithKeys=f;var m=function(e){function t(r,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];var s=e.call(this,r)||this;if(s.schemaUrl=t.schemaUrl,"string"!=typeof n||0===n.length)throw new Error("logicalOperator must be a valid operator, You passed: "+n);s.logicalOperator=n;var a;if(a=Array.isArray(i[0])?i[0]:i,0===a.length)throw new Error("conditions must be a non-empty array. You passed: "+i);if(a.length>2)throw new Error("AdvancedFilters may not have more than two conditions. You passed: "+i.length);if(1===a.length&&"And"!==n)throw new Error('Logical Operator must be "And" when there is only one condition provided');return s.conditions=a,s}return d(t,e),t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.logicalOperator=this.logicalOperator,t.conditions=this.conditions,t},t}(h);m.schemaUrl="http://powerbi.com/product/schema#advanced",t.AdvancedFilter=m;var g;!function(e){e[e.Read=0]="Read",e[e.ReadWrite=1]="ReadWrite",e[e.Copy=2]="Copy",e[e.Create=4]="Create",e[e.All=7]="All"}(g=t.Permissions||(t.Permissions={}));var v;!function(e){e[e.View=0]="View",e[e.Edit=1]="Edit"}(v=t.ViewMode||(t.ViewMode={}));var y;!function(e){e[e.Aad=0]="Aad",e[e.Embed=1]="Embed"}(y=t.TokenType||(t.TokenType={})),t.validateSaveAsParameters=n(t.saveAsParametersSchema)},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{oneOf:[{type:"object",properties:{table:{type:"string"},column:{type:"string"}},required:["table","column"]},{type:"object",properties:{table:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"}},required:["table","hierarchy","hierarchyLevel"]},{type:"object",properties:{table:{type:"string"},measure:{type:"string"}},required:["table","measure"]}]},logicalOperator:{type:"string"},conditions:{type:"array",items:{type:"object",properties:{value:{type:["string","boolean","number"]},operator:{type:"string"}},required:["value","operator"]}}},required:["target","logicalOperator","conditions"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}],invalidMessage:"filter is invalid"}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},settings:{$ref:"#settings"},pageName:{type:"string",messages:{type:"pageName must be a string"}},filters:{type:"array",items:{type:"object",oneOf:[{$ref:"#basicFilter"},{$ref:"#advancedFilter"}]},invalidMessage:"filters property is invalid"},permissions:{type:"number","enum":[0,1,2,4,7],"default":0,invalidMessage:"permissions property is invalid"},viewMode:{type:"number","enum":[0,1],"default":0,invalidMessage:"viewMode property is invalid"},tokenType:{type:"number","enum":[0,1],"default":0,invalidMessage:"tokenType property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},id:{type:"string",messages:{type:"id must be a string",required:"id is required"}},pageView:{type:"string",messages:{type:'pageView must be a string with one of the following values: "actualSize", "fitToWidth", "oneColumn"'}},tokenType:{type:"number","enum":[0,1],"default":0,invalidMessage:"tokenType property is invalid"}},required:["accessToken","id"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{filterPaneEnabled:{type:"boolean",messages:{type:"filterPaneEnabled must be a boolean"}},navContentPaneEnabled:{type:"boolean",messages:{type:"navContentPaneEnabled must be a boolean"}},useCustomSaveAsDialog:{type:"boolean",messages:{type:"useCustomSaveAsDialog must be a boolean"}}}}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{target:{type:"object",properties:{table:{type:"string"},column:{type:"string"},hierarchy:{type:"string"},hierarchyLevel:{type:"string"},measure:{type:"string"}},required:["table"]},operator:{type:"string"},values:{type:"array",items:{type:["string","boolean","number"]}}},required:["target","operator","values"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{accessToken:{type:"string",messages:{type:"accessToken must be a string",required:"accessToken is required"}},datasetId:{type:"string",messages:{type:"datasetId must be a string",required:"datasetId is required"}},tokenType:{type:"number","enum":[0,1],"default":0,invalidMessage:"tokenType property is invalid"}},required:["accessToken","datasetId"]}},function(e,t){e.exports={$schema:"http://json-schema.org/draft-04/schema#",type:"object",properties:{name:{type:"string",messages:{type:"name must be a string",required:"name is required"}}},required:["name"]}}])})},function(e,t){var r=function(){function e(e,t,r){this.report=e,this.name=t,this.displayName=r}return e.prototype.getFilters=function(){return this.report.service.hpm.get("/report/pages/"+this.name+"/filters",{uid:this.report.config.uniqueId},this.report.iframe.contentWindow).then(function(e){return e.body},function(e){throw e.body})},e.prototype.removeFilters=function(){return this.setFilters([])},e.prototype.setActive=function(){var e={name:this.name,displayName:null};return this.report.service.hpm.put("/report/pages/active",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow)["catch"](function(e){throw e.body})},e.prototype.setFilters=function(e){return this.report.service.hpm.put("/report/pages/"+this.name+"/filters",e,{uid:this.report.config.uniqueId},this.report.iframe.contentWindow)["catch"](function(e){throw e.body})},e}();t.Page=r},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(5),o=r(2),s=function(e){function t(t,r,n){e.call(this,t,r,n)}return n(t,e),t.prototype.getId=function(){var e=this.createConfig&&this.createConfig.datasetId?this.createConfig.datasetId:t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dataset id is required, but it was not found. You must provide an id either as part of embed configuration.");return e},t.prototype.validate=function(e){return i.validateCreateReport(e)},t.findIdFromEmbedUrl=function(e){var t,r=/datasetId="?([^&]+)"?/,n=e.match(r);return n&&(t=n[1]),t},t}(o.Embed);t.Create=s},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(2),o=r(5),s=function(e){function t(r,n,i){e.call(this,r,n,i),this.loadPath="/dashboard/load",Array.prototype.push.apply(this.allowedEvents,t.allowedEvents)}return n(t,e),t.findIdFromEmbedUrl=function(e){var t,r=/dashboardId="?([^&]+)"?/,n=e.match(r);return n&&(t=n[1]),t},t.prototype.getId=function(){var e=this.config.id||this.element.getAttribute(t.dashboardIdAttribute)||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Dashboard id is required, but it was not found. You must provide an id either as part of embed configuration or as attribute '"+t.dashboardIdAttribute+"'.");return e},t.prototype.validate=function(e){var t=o.validateDashboardLoad(e);return t?t:this.ValidatePageView(e.pageView)},t.prototype.ValidatePageView=function(e){if(e&&"fitToWidth"!==e&&"oneColumn"!==e&&"actualSize"!==e)return[{message:"pageView must be one of the followings: fitToWidth, oneColumn, actualSize"}]},t.allowedEvents=["tileClicked","error"],t.dashboardIdAttribute="powerbi-dashboard-id",t.typeAttribute="powerbi-type",t.type="Dashboard",t}(i.Embed);t.Dashboard=s},function(e,t,r){var n=this&&this.__extends||function(e,t){function r(){this.constructor=e}for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},i=r(5),o=r(2),s=function(e){function t(r,n,i){var o=i.embedUrl,s=o.indexOf("?")>0,a=s?"&":"?";o=o+a+"dashboardId="+i.dashboardId+"&tileId="+i.id,i.embedUrl=o,e.call(this,r,n,i),Array.prototype.push.apply(this.allowedEvents,t.allowedEvents),window.addEventListener("message",this.receiveMessage.bind(this),!1)}return n(t,e),t.prototype.getId=function(){var e=this.config.id||t.findIdFromEmbedUrl(this.config.embedUrl);if("string"!=typeof e||0===e.length)throw new Error("Tile id is required, but it was not found. You must provide an id either as part of embed configuration.");return e},t.prototype.validate=function(e){return i.validateReportLoad(e)},t.prototype.load=function(e){var t=this.validate(e);if(t)throw t;var r=e.height?e.height:this.iframe.offsetHeight,n=e.width?e.width:this.iframe.offsetWidth,i=e.action?e.action:"loadTile",o={action:i,height:r,width:n,accessToken:e.accessToken,tokenType:e.tokenType};return this.iframe.contentWindow.postMessage(JSON.stringify(o),"*"),new Promise(function(){})},t.findIdFromEmbedUrl=function(e){var t,r=/tileId="?([^&]+)"?/,n=e.match(r);return n&&(t=n[1]),t},t.prototype.receiveMessage=function(e){if(e.data)try{var t=JSON.parse(e.data),r={navigationUrl:t.navigationUrl,errors:t.error,openReport:t.openReport},n={type:"tile",id:this.config.uniqueId,name:t.event,value:r};this.service.handleTileEvents(n)}catch(i){return void console.log("invalid message data")}},t.type="Tile",t.allowedEvents=["tileClicked","tileLoaded"],t}(o.Embed);t.Tile=s},function(e,t,r){var n=r(11),i=r(12),o=r(13),s=r(14);t.hpmFactory=function(e,t,r,i){return void 0===r&&(r=n["default"].version),void 0===i&&(i=n["default"].type),new o.HttpPostMessage(e,{"x-sdk-type":i,"x-sdk-version":r},t)},t.wpmpFactory=function(e,t,r){return new i.WindowPostMessageProxy({processTrackingProperties:{addTrackingProperties:o.HttpPostMessage.addTrackingProperties,getTrackingProperties:o.HttpPostMessage.getTrackingProperties},isErrorMessage:o.HttpPostMessage.isErrorMessage,name:e,logMessages:t,eventSourceOverrideWindow:r})},t.routerFactory=function(e){return new s.Router(e)}},function(e,t){var r={version:"2.3.1",type:"js"};Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=r},function(e,t,r){/*! window-post-message-proxy v0.2.4 | (c) 2016 Microsoft Corporation MIT */
!function(t,r){e.exports=r()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";var r=function(){function e(t){var r=this;void 0===t&&(t={processTrackingProperties:{addTrackingProperties:e.defaultAddTrackingProperties,getTrackingProperties:e.defaultGetTrackingProperties},isErrorMessage:e.defaultIsErrorMessage,receiveWindow:window,name:e.createRandomString()}),this.pendingRequestPromises={},this.addTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.addTrackingProperties||e.defaultAddTrackingProperties,this.getTrackingProperties=t.processTrackingProperties&&t.processTrackingProperties.getTrackingProperties||e.defaultGetTrackingProperties,this.isErrorMessage=t.isErrorMessage||e.defaultIsErrorMessage,this.receiveWindow=t.receiveWindow||window,this.name=t.name||e.createRandomString(),this.logMessages=t.logMessages||!1,this.eventSourceOverrideWindow=t.eventSourceOverrideWindow,this.suppressWarnings=t.suppressWarnings||!1,this.logMessages&&console.log("new WindowPostMessageProxy created with name: "+this.name+" receiving on window: "+this.receiveWindow.document.title),this.handlers=[],this.windowMessageHandler=function(e){return r.onMessageReceived(e)},this.start()}return e.defaultAddTrackingProperties=function(t,r){return t[e.messagePropertyName]=r,t},e.defaultGetTrackingProperties=function(t){return t[e.messagePropertyName]},e.defaultIsErrorMessage=function(e){return!!e.error},e.createDeferred=function(){var e={resolve:null,reject:null,promise:null},t=new Promise(function(t,r){e.resolve=t,e.reject=r});return e.promise=t,e},e.createRandomString=function(){return(Math.random()+1).toString(36).substring(7)},e.prototype.addHandler=function(e){this.handlers.push(e)},e.prototype.removeHandler=function(e){var t=this.handlers.indexOf(e);if(t===-1)throw new Error("You attempted to remove a handler but no matching handler was found.");this.handlers.splice(t,1)},e.prototype.start=function(){this.receiveWindow.addEventListener("message",this.windowMessageHandler)},e.prototype.stop=function(){this.receiveWindow.removeEventListener("message",this.windowMessageHandler)},e.prototype.postMessage=function(t,r){var n={id:e.createRandomString()};this.addTrackingProperties(r,n),this.logMessages&&(console.log(this.name+" Posting message:"),console.log(JSON.stringify(r,null," "))),t.postMessage(r,"*");var i=e.createDeferred();return this.pendingRequestPromises[n.id]=i,i.promise},e.prototype.sendResponse=function(e,t,r){this.addTrackingProperties(t,r),this.logMessages&&(console.log(this.name+" Sending response:"),console.log(JSON.stringify(t,null," "))),e.postMessage(t,"*")},e.prototype.onMessageReceived=function(e){var t=this;this.logMessages&&(console.log(this.name+" Received message:"),console.log("type: "+e.type),console.log(JSON.stringify(e.data,null," ")));var r=this.eventSourceOverrideWindow||e.source,n=e.data;if("object"!=typeof n)return void(this.suppressWarnings||console.warn("Proxy("+this.name+"): Received message that was not an object. Discarding message"));var i;try{i=this.getTrackingProperties(n)}catch(o){this.suppressWarnings||console.warn("Proxy("+this.name+"): Error occurred when attempting to get tracking properties from incoming message:",JSON.stringify(n,null," "),"Error: ",o)}var s;if(i&&(s=this.pendingRequestPromises[i.id]),s){var a=!0;try{a=this.isErrorMessage(n)}catch(o){console.warn("Proxy("+this.name+") Error occurred when trying to determine if message is consider an error response. Message: ",JSON.stringify(n,null,""),"Error: ",o)}a?s.reject(n):s.resolve(n),delete this.pendingRequestPromises[i.id]}else{var u=this.handlers.some(function(e){var o=!1;try{o=e.test(n)}catch(s){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was testing incoming message:",JSON.stringify(n,null," "),"Error: ",s)}if(o){var a=void 0;try{a=Promise.resolve(e.handle(n))}catch(s){t.suppressWarnings||console.warn("Proxy("+t.name+"): Error occurred when handler was processing incoming message:",JSON.stringify(n,null," "),"Error: ",s),a=Promise.resolve()}return a.then(function(e){if(!e){var o="Handler for message: "+JSON.stringify(n,null," ")+" did not return a response message. The default response message will be returned instead.";t.suppressWarnings||console.warn("Proxy("+t.name+"): "+o),e={warning:o}}t.sendResponse(r,e,i)}),!0}});u||this.suppressWarnings||console.warn("Proxy("+this.name+") did not handle message. Handlers: "+this.handlers.length+" Message: "+JSON.stringify(n,null,"")+".")}},e.messagePropertyName="windowPostMessageProxy",e}();t.WindowPostMessageProxy=r}])})},function(e,t,r){/*! http-post-message v0.2.3 | (c) 2016 Microsoft Corporation MIT */
!function(t,r){e.exports=r()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t){"use strict";var r=function(){function e(e,t,r){void 0===t&&(t={}),this.defaultHeaders=t,this.defaultTargetWindow=r,this.windowPostMessageProxy=e}return e.addTrackingProperties=function(e,t){return e.headers=e.headers||{},t&&t.id&&(e.headers.id=t.id),e},e.getTrackingProperties=function(e){return{id:e.headers&&e.headers.id}},e.isErrorMessage=function(e){return"number"==typeof(e&&e.statusCode)&&!(200<=e.statusCode&&e.statusCode<300)},e.prototype.get=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r=this.defaultTargetWindow),this.send({method:"GET",url:e,headers:t},r)},e.prototype.post=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"POST",url:e,headers:r,body:t},n)},e.prototype.put=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PUT",url:e,headers:r,body:t},n)},e.prototype.patch=function(e,t,r,n){return void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"PATCH",url:e,headers:r,body:t},n)},e.prototype["delete"]=function(e,t,r,n){return void 0===t&&(t=null),void 0===r&&(r={}),void 0===n&&(n=this.defaultTargetWindow),this.send({method:"DELETE",url:e,headers:r,body:t},n)},e.prototype.send=function(e,t){if(void 0===t&&(t=this.defaultTargetWindow),e.headers=this.assign({},this.defaultHeaders,e.headers),!t)throw new Error("target window is not provided. You must either provide the target window explicitly as argument to request, or specify default target window when constructing instance of this class.");return this.windowPostMessageProxy.postMessage(t,e)},e.prototype.assign=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");var n=Object(e);return t.forEach(function(e){if(void 0!==e&&null!==e)for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}),n},e}();t.HttpPostMessage=r}])})},function(e,t,r){/*! powerbi-router v0.1.5 | (c) 2016 Microsoft Corporation MIT */
!function(t,r){e.exports=r()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";var n=r(1),i=function(){function e(e){this.handlers=e,this.getRouteRecognizer=new n,this.patchRouteRecognizer=new n,this.postRouteRecognizer=new n,this.putRouteRecognizer=new n,this.deleteRouteRecognizer=new n}return e.prototype.get=function(e,t){return this.registerHandler(this.getRouteRecognizer,"GET",e,t),this},e.prototype.patch=function(e,t){return this.registerHandler(this.patchRouteRecognizer,"PATCH",e,t),this},e.prototype.post=function(e,t){return this.registerHandler(this.postRouteRecognizer,"POST",e,t),this},e.prototype.put=function(e,t){return this.registerHandler(this.putRouteRecognizer,"PUT",e,t),this},e.prototype["delete"]=function(e,t){return this.registerHandler(this.deleteRouteRecognizer,"DELETE",e,t),this},e.prototype.registerHandler=function(e,t,r,n){var i=function(e){var t=new o;return Promise.resolve(n(e,t)).then(function(e){return t})};e.add([{path:r,handler:i}]);var s={test:function(r){if(r.method!==t)return!1;var n=e.recognize(r.url);if(void 0===n)return!1;var i=n[0];return r.params=i.params,r.queryParams=n.queryParams,r.handler=i.handler,!0},handle:function(e){return e.handler(e)}};this.handlers.addHandler(s)},e}();t.Router=i;var o=function(){function e(){this.statusCode=200,this.headers={},this.body=null}return e.prototype.send=function(e,t){this.statusCode=e,this.body=t},e}();t.Response=o},function(e,t,r){var n;(function(e){(function(){"use strict";function i(e,t,r){this.path=e,this.matcher=t,this.delegate=r}function o(e){this.routes={},this.children={},this.target=e}function s(e,t,r){return function(n,o){var a=e+n;return o?void o(s(a,t,r)):new i(e+n,t,r)}}function a(e,t,r){for(var n=0,i=0;i<e.length;i++)n+=e[i].path.length;t=t.substr(n);var o={path:t,handler:r};e.push(o)}function u(e,t,r,n){var i=t.routes;for(var o in i)if(i.hasOwnProperty(o)){var s=e.slice();a(s,o,i[o]),t.children[o]?u(s,t.children[o],r,n):r.call(n,s)}}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}function d(e){this.string=e}function p(e){this.name=e}function h(e){this.name=e}function l(){}function f(e,t,r){"/"===e.charAt(0)&&(e=e.substr(1));var n=e.split("/"),i=new Array(n.length);r.val="";for(var o=0;o<n.length;o++){var s,a=n[o];(s=a.match(/^:([^\/]+)$/))?(i[o]=new p(s[1]),t.push(s[1]),r.val+="3"):(s=a.match(/^\*([^\/]+)$/))?(i[o]=new h(s[1]),r.val+="1",t.push(s[1])):""===a?(i[o]=new l,r.val+="2"):(i[o]=new d(a),r.val+="4")}return r.val=+r.val,i}function m(e){this.charSpec=e,this.nextStates=[],this.charSpecs={},this.regex=void 0,this.handlers=void 0,this.specificity=void 0}function g(e){return e.sort(function(e,t){return t.specificity.val-e.specificity.val})}function v(e,t){for(var r=[],n=0,i=e.length;n<i;n++){var o=e[n];r=r.concat(o.match(t))}return r}function y(e){this.queryParams=e||{}}function b(e,t,r){var n=e.handlers,i=e.regex,o=t.match(i),s=1,a=new y(r);a.length=n.length;for(var u=0;u<n.length;u++){for(var c=n[u],d=c.names,p={},h=0;h<d.length;h++)p[d[h]]=o[s++];a[u]={handler:c.handler,params:p,isDynamic:!!d.length}}return a}function w(e){e=e.replace(/\+/gm,"%20");var t;try{t=decodeURIComponent(e)}catch(r){t=""}return t}i.prototype={to:function(e,t){var r=this.delegate;if(r&&r.willAddRoute&&(e=r.willAddRoute(this.matcher.target,e)),this.matcher.add(this.path,e),t){if(0===t.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,e,t,this.delegate)}return this}},o.prototype={add:function(e,t){this.routes[e]=t},addChild:function(e,t,r,n){var i=new o(t);this.children[e]=i;var a=s(e,i,n);n&&n.contextEntered&&n.contextEntered(t,a),r(a)}};var E=function(e,t){var r=new o;e(s("",r,this.delegate)),u([],r,function(e){t?t(this,e):this.add(e)},this)},P=["/",".","*","+","?","|","(",")","[","]","{","}","\\"],T=new RegExp("(\\"+P.join("|\\")+")","g");d.prototype={eachChar:function(e){for(var t,r=this.string,n=0;n<r.length;n++)t=r.charAt(n),e=e.put({invalidChars:void 0,repeat:!1,validChars:t});return e},regex:function(){return this.string.replace(T,"\\$1")},generate:function(){return this.string}},p.prototype={eachChar:function(e){return e.put({invalidChars:"/",repeat:!0,validChars:void 0})},regex:function(){return"([^/]+)"},generate:function(e){return e[this.name]}},h.prototype={eachChar:function(e){return e.put({invalidChars:"",repeat:!0,validChars:void 0})},regex:function(){return"(.+)"},generate:function(e){return e[this.name]}},l.prototype={eachChar:function(e){return e},regex:function(){return""},generate:function(){return""}},m.prototype={get:function(e){if(this.charSpecs[e.validChars])return this.charSpecs[e.validChars];for(var t=this.nextStates,r=0;r<t.length;r++){var n=t[r],i=n.charSpec.validChars===e.validChars;if(i=i&&n.charSpec.invalidChars===e.invalidChars)return this.charSpecs[e.validChars]=n,n}},put:function(e){var t;return(t=this.get(e))?t:(t=new m(e),this.nextStates.push(t),e.repeat&&t.nextStates.push(t),t)},match:function(e){for(var t,r,n,i=this.nextStates,o=[],s=0;s<i.length;s++)t=i[s],r=t.charSpec,"undefined"!=typeof(n=r.validChars)?n.indexOf(e)!==-1&&o.push(t):"undefined"!=typeof(n=r.invalidChars)&&n.indexOf(e)===-1&&o.push(t);return o}};var A=Object.create||function(e){function t(){}return t.prototype=e,new t};y.prototype=A({splice:Array.prototype.splice,slice:Array.prototype.slice,push:Array.prototype.push,length:0,queryParams:null});var x=function(){this.rootState=new m,this.names={}};x.prototype={add:function(e,t){for(var r,n=this.rootState,i="^",o={},s=new Array(e.length),a=[],u=!0,c=0;c<e.length;c++){var d=e[c],p=[],h=f(d.path,p,o);a=a.concat(h);for(var m=0;m<h.length;m++){var g=h[m];g instanceof l||(u=!1,n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/",n=g.eachChar(n),i+=g.regex())}var v={handler:d.handler,names:p};s[c]=v}u&&(n=n.put({invalidChars:void 0,repeat:!1,validChars:"/"}),i+="/"),n.handlers=s,n.regex=new RegExp(i+"$"),n.specificity=o,(r=t&&t.as)&&(this.names[r]={segments:a,handlers:s})},handlersFor:function(e){var t=this.names[e];if(!t)throw new Error("There is no route named "+e);for(var r=new Array(t.handlers.length),n=0;n<t.handlers.length;n++)r[n]=t.handlers[n];return r},hasRoute:function(e){return!!this.names[e]},generate:function(e,t){var r=this.names[e],n="";if(!r)throw new Error("There is no route named "+e);for(var i=r.segments,o=0;o<i.length;o++){var s=i[o];s instanceof l||(n+="/",n+=s.generate(t))}return"/"!==n.charAt(0)&&(n="/"+n),t&&t.queryParams&&(n+=this.generateQueryString(t.queryParams,r.handlers)),n},generateQueryString:function(e,t){var r=[],n=[];for(var i in e)e.hasOwnProperty(i)&&n.push(i);n.sort();for(var o=0;o<n.length;o++){i=n[o];var s=e[i];if(null!=s){var a=encodeURIComponent(i);if(c(s))for(var u=0;u<s.length;u++){var d=i+"[]="+encodeURIComponent(s[u]);r.push(d)}else a+="="+encodeURIComponent(s),r.push(a)}}return 0===r.length?"":"?"+r.join("&")},parseQueryString:function(e){for(var t=e.split("&"),r={},n=0;n<t.length;n++){var i,o=t[n].split("="),s=w(o[0]),a=s.length,u=!1;1===o.length?i="true":(a>2&&"[]"===s.slice(a-2)&&(u=!0,s=s.slice(0,a-2),r[s]||(r[s]=[])),i=o[1]?w(o[1]):""),u?r[s].push(i):r[s]=i}return r},recognize:function(e){var t,r,n,i=[this.rootState],o={},s=!1;if(n=e.indexOf("?"),n!==-1){var a=e.substr(n+1,e.length);e=e.substr(0,n),o=this.parseQueryString(a)}for(e=decodeURI(e),"/"!==e.charAt(0)&&(e="/"+e),t=e.length,t>1&&"/"===e.charAt(t-1)&&(e=e.substr(0,t-1),s=!0),r=0;r<e.length&&(i=v(i,e.charAt(r)),i.length);r++);var u=[];for(r=0;r<i.length;r++)i[r].handlers&&u.push(i[r]);i=g(u);var c=u[0];if(c&&c.handlers)return s&&"(.+)$"===c.regex.source.slice(-5)&&(e+="/"),b(c,e,o)}},x.prototype.map=E,x.VERSION="0.1.11";var k=x;r(3).amd?(n=function(){return k}.call(t,r,t,e),!(void 0!==n&&(e.exports=n))):"undefined"!=typeof e&&e.exports?e.exports=k:"undefined"!=typeof this&&(this.RouteRecognizer=k)}).call(this)}).call(t,r(2)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}}])})}])});