(function(){"use strict";window.SwaggerUi=Backbone.Router.extend({dom_id:"swagger_ui",options:null,api:null,headerView:null,mainView:null,initialize:function(e){e=e||{},e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),e.supportedSubmitMethods||(e.supportedSubmitMethods=["get","put","post","delete","head","options","patch"]),$("#"+this.dom_id).length||$("body").append('
'),this.options=e,marked.setOptions({gfm:!0});var n=this;this.options.success=function(){return n.render()},this.options.progress=function(e){return n.showMessage(e)},this.options.failure=function(e){return n.onLoadFailure(e)},this.headerView=new SwaggerUi.Views.HeaderView({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return this.updateSwaggerUi(e)})},setOption:function(e,n){this.options[e]=n},getOption:function(e){return this.options[e]},updateSwaggerUi:function(e){this.options.url=e.url,this.load()},load:function(){this.mainView&&this.mainView.clear();var e=this.options.url;e&&0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerClient(this.options)},collapseAll:function(){e.collapseEndpointListForResource("")},listAll:function(){e.collapseOperationsForResource("")},expandAll:function(){e.expandOperationsForResource("")},render:function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new SwaggerUi.Views.MainView({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options,router:this}).render(),this.showMessage(),this.options.docExpansion){case"full":this.expandAll();break;case"list":this.listAll()}this.renderGFM(),this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(e.shebang.bind(this),100)},buildUrl:function(e,n){if(0===n.indexOf("/")){var a=e.split("/");return e=a[0]+"//"+a[2],e+n}var t=e.length;return e.indexOf("?")>-1&&(t=Math.min(t,e.indexOf("?"))),e.indexOf("#")>-1&&(t=Math.min(t,e.indexOf("#"))),e=e.substring(0,t),-1!==e.indexOf("/",e.length-1)?e+n:e+"/"+n},showMessage:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)},onLoadFailure:function(e){void 0===e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail");var n=$("#message-bar").html(e);return this.options.onFailure&&this.options.onFailure(e),n},renderGFM:function(){$(".markdown").each(function(){$(this).html(marked($(this).html()))})}}),window.SwaggerUi.Views={},this.Handlebars=this.Handlebars||{},this.Handlebars.templates=this.Handlebars.templates||{},this.Handlebars.templates.apikey_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,a,t){var i,s="function",l=n.helperMissing,r=this.escapeExpression;return"\n\n\n'},useData:!0}),this.Handlebars.templates.basic_auth_button_view=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(){return'\n\n\n'},useData:!0}),this.Handlebars.templates.content_type=Handlebars.template({1:function(e,n,a,t){var i,s="";return i=n.each.call(e,null!=e?e.produces:e,{name:"each",hash:{},fn:this.program(2,t),inverse:this.noop,data:t}),null!=i&&(s+=i),s},2:function(e){var n,a=this.lambda,t=' \n"},4:function(){return' \n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,n,a,t){var i,s='\n\n"},useData:!0}),$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),n=$(this).parent().height(),a=(n-e)/2;$(this).css("margin-top",a)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),n=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-n-a)})},$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent(),$("ul.downplayed li div.content p").vAlign(),$("form.sandbox").submit(function(){var e=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error"),""===$(this).val()&&($(this).addClass("error"),$(this).wiggle(),e=!1)}),e})}),Function.prototype.bind&&console&&"object"==typeof console.log&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(e){console[e]=this.bind(console[e],console)},Function.prototype.call);var e={shebang:function(){var n=$.param.fragment().split("/");switch(n.shift(),n.length){case 1:var a="resource_"+n[0];e.expandEndpointListForResource(n[0]),$("#"+a).slideto({highlight:!1});break;case 2:e.expandEndpointListForResource(n[0]),$("#"+a).slideto({highlight:!1});var t=n.join("_"),i=t+"_content";e.expandOperation($("#"+i)),$("#"+t).slideto({highlight:!1})}},toggleEndpointListForResource:function(n){var a=$("li#resource_"+e.escapeResourceName(n)+" ul.endpoints");a.is(":visible")?e.collapseEndpointListForResource(n):e.expandEndpointListForResource(n)},expandEndpointListForResource:function(n){var n=e.escapeResourceName(n);if(""==n)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+n).addClass("active");var a=$("li#resource_"+n+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(n){var n=e.escapeResourceName(n);if(""==n)return void $(".resource ul.endpoints").slideUp();$("li#resource_"+n).removeClass("active");var a=$("li#resource_"+n+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(n){return e.expandEndpointListForResource(n),""==n?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+e.escapeResourceName(n)+" li.operation div.content").each(function(){e.expandOperation($(this))})},collapseOperationsForResource:function(n){return e.expandEndpointListForResource(n),""==n?void $(".resource ul.endpoints li.operation div.content").slideUp():void $("li#resource_"+e.escapeResourceName(n)+" li.operation div.content").each(function(){e.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}};Handlebars.registerHelper("sanitize",function(e){return e=e.replace(/