text: function clippyCopiedCallback(){$("#api_key_copied").fadeIn().delay(1e3).fadeOut()}$(function(){$.fn.vAlign=function(){return this.each(function(){var e=$(this).height(),t=$(this).parent().height(),n=(t-e)/2;$(this).css("margin-top",n)})},$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var e=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),n=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",e-t-n)})},$("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})}),log=function(){log.history=log.history||[],log.history.push(arguments),this.console&&console.log(Array.prototype.slice.call(arguments))},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 Docs={shebang:function(){var e=$.param.fragment().split("/");switch(e.shift(),e.length){case 1:log("shebang resource:"+e[0]);var t="resource_"+e[0];Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});break;case 2:log("shebang endpoint: "+e.join("_")),Docs.expandEndpointListForResource(e[0]),$("#"+t).slideto({highlight:!1});var n=e.join("_"),a=n+"_content";log("li_dom_id "+n),log("li_content_dom_id "+a),Docs.expandOperation($("#"+a)),$("#"+n).slideto({highlight:!1})}},toggleEndpointListForResource:function(e){var t=$("li#resource_"+Docs.escapeResourceName(e)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(e):Docs.expandEndpointListForResource(e)},expandEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);if(""==e)return void $(".resource ul.endpoints").slideDown();$("li#resource_"+e).addClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(e){var e=Docs.escapeResourceName(e);$("li#resource_"+e).removeClass("active");var t=$("li#resource_"+e+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(e){return Docs.expandEndpointListForResource(e),""==e?void $(".resource ul.endpoints li.operation div.content").slideDown():void $("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(e){Docs.expandEndpointListForResource(e),$("li#resource_"+Docs.escapeResourceName(e)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(e){return e.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(e){e.slideDown()},collapseOperation:function(e){e.slideUp()}};!function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.content_type=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n  ",a=n.each.call(e,e.produces,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n"}function s(e){var t,n="";return n+='\n	<option value="',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+='">',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+="</option>\n	"}function i(){return'\n  <option value="application/json">application/json</option>\n'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var l,p="",d="function",c=this;return p+='<label for="contentType"></label>\n<select name="contentType">\n',l=n["if"].call(t,t.produces,{hash:{},inverse:c.program(4,i,r),fn:c.program(1,o,r),data:r}),(l||0===l)&&(p+=l),p+="\n</select>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.main=e(function(e,t,n,a,r){function o(e,t){var a,r,o="";return o+='\n    <div class="info_title">'+h((a=e.info,a=null==a||a===!1?a:a.title,typeof a===u?a.apply(e):a))+'</div>\n    <div class="info_description">',a=e.info,a=null==a||a===!1?a:a.description,r=typeof a===u?a.apply(e):a,(r||0===r)&&(o+=r),o+="</div>\n    ",r=n["if"].call(e,(a=e.info,null==a||a===!1?a:a.termsOfServiceUrl),{hash:{},inverse:m.noop,fn:m.program(2,s,t),data:t}),(r||0===r)&&(o+=r),o+="\n    ",r=n["if"].call(e,(a=e.info,null==a||a===!1?a:a.contact),{hash:{},inverse:m.noop,fn:m.program(4,i,t),data:t}),(r||0===r)&&(o+=r),o+="\n    ",r=n["if"].call(e,(a=e.info,null==a||a===!1?a:a.license),{hash:{},inverse:m.noop,fn:m.program(6,l,t),data:t}),(r||0===r)&&(o+=r),o+="\n  "}function s(e){var t,n="";return n+='<div class="info_tos"><a href="'+h((t=e.info,t=null==t||t===!1?t:t.termsOfServiceUrl,typeof t===u?t.apply(e):t))+'">Terms of service</a></div>'}function i(e){var t,n="";return n+="<div class='info_contact'><a href=\"mailto:"+h((t=e.info,t=null==t||t===!1?t:t.contact,typeof t===u?t.apply(e):t))+'">Contact the developer</a></div>'}function l(e){var t,n="";return n+="<div class='info_license'><a href='"+h((t=e.info,t=null==t||t===!1?t:t.licenseUrl,typeof t===u?t.apply(e):t))+"'>"+h((t=e.info,t=null==t||t===!1?t:t.license,typeof t===u?t.apply(e):t))+"</a></div>"}function p(e,t){var a,r="";return r+='\n        , <span style="font-variant: small-caps">api version</span>: ',(a=n.apiVersion)?a=a.call(e,{hash:{},data:t}):(a=e.apiVersion,a=typeof a===u?a.apply(e):a),r+=h(a)+"\n        "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var d,c="",u="function",h=this.escapeExpression,m=this;return c+="<div class='info' id='api_info'>\n  ",d=n["if"].call(t,t.info,{hash:{},inverse:m.noop,fn:m.program(1,o,r),data:r}),(d||0===d)&&(c+=d),c+="\n</div>\n<div class='container' id='resources_container'>\n    <ul id='resources'>\n    </ul>\n\n    <div class=\"footer\">\n        <br>\n        <br>\n        <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ",(d=n.basePath)?d=d.call(t,{hash:{},data:r}):(d=t.basePath,d=typeof d===u?d.apply(t):d),c+=h(d)+"\n        ",d=n["if"].call(t,t.apiVersion,{hash:{},inverse:m.noop,fn:m.program(8,p,r),data:r}),(d||0===d)&&(c+=d),c+="]</h4>\n    </div>\n</div>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.operation=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n        <h4>Implementation Notes</h4>\n        <p>",(a=n.notes)?a=a.call(e,{hash:{},data:t}):(a=e.notes,a=typeof a===$?a.apply(e):a),(a||0===a)&&(r+=a),r+="</p>\n        "}function s(){return'\n        <div class="auth">\n        <span class="api-ic ic-error"></span>'}function i(e,t){var a,r="";return r+='\n          <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n          ',a=n.each.call(e,e,{hash:{},inverse:_.noop,fn:_.program(6,l,t),data:t}),(a||0===a)&&(r+=a),r+="\n          </div>\n        "}function l(e){var t,n,a="";return a+="\n            <div title='",t=e.description,n=typeof t===$?t.apply(e):t,(n||0===n)&&(a+=n),a+="'>"+b((t=e.scope,typeof t===$?t.apply(e):t))+"</div>\n          "}function p(){return"</div>"}function d(){return'\n        <div class=\'access\'>\n          <span class="api-ic ic-off" title="click to authenticate"></span>\n        </div>\n        '}function c(){return'\n          <h4>Response Class</h4>\n          <p><span class="model-signature" /></p>\n          <br/>\n          <div class="response-content-type" />\n        '}function u(){return'\n          <h4>Parameters</h4>\n          <table class=\'fullwidth\'>\n          <thead>\n            <tr>\n            <th style="width: 100px; max-width: 100px">Parameter</th>\n            <th style="width: 310px; max-width: 310px">Value</th>\n            <th style="width: 200px; max-width: 200px">Description</th>\n            <th style="width: 100px; max-width: 100px">Parameter Type</th>\n            <th style="width: 220px; max-width: 230px">Data Type</th>\n            </tr>\n          </thead>\n          <tbody class="operation-params">\n\n          </tbody>\n          </table>\n          '}function h(){return"\n          <div style='margin:0;padding:0;display:inline'></div>\n          <h4>Response Messages</h4>\n          <table class='fullwidth'>\n            <thead>\n            <tr>\n              <th>HTTP Status Code</th>\n              <th>Reason</th>\n              <th>Response Model</th>\n            </tr>\n            </thead>\n            <tbody class=\"operation-status\">\n            \n            </tbody>\n          </table>\n          "}function m(){return"\n          "}function f(){return"\n          <div class='sandbox_header'>\n            <input class='submit' name='commit' type='button' value='Perform Query' />\n            <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n            <img alt='Throbber' class='response_throbber' src='images/throbber.gif' style='display:none' />\n          </div>\n          "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var y,g,v="",$="function",b=this.escapeExpression,_=this,w=n.blockHelperMissing;return v+="\n  <ul class='operations' >\n    <li class='",(y=n.method)?y=y.call(t,{hash:{},data:r}):(y=t.method,y=typeof y===$?y.apply(t):y),v+=b(y)+" operation' id='",(y=n.parentId)?y=y.call(t,{hash:{},data:r}):(y=t.parentId,y=typeof y===$?y.apply(t):y),v+=b(y)+"_",(y=n.nickname)?y=y.call(t,{hash:{},data:r}):(y=t.nickname,y=typeof y===$?y.apply(t):y),v+=b(y)+"'>\n      <div class='heading'>\n        <h3>\n          <span class='http_method'>\n          <a href='#!/",(y=n.parentId)?y=y.call(t,{hash:{},data:r}):(y=t.parentId,y=typeof y===$?y.apply(t):y),v+=b(y)+"/",(y=n.nickname)?y=y.call(t,{hash:{},data:r}):(y=t.nickname,y=typeof y===$?y.apply(t):y),v+=b(y)+'\' class="toggleOperation">',(y=n.method)?y=y.call(t,{hash:{},data:r}):(y=t.method,y=typeof y===$?y.apply(t):y),v+=b(y)+"</a>\n          </span>\n          <span class='path'>\n          <a href='#!/",(y=n.parentId)?y=y.call(t,{hash:{},data:r}):(y=t.parentId,y=typeof y===$?y.apply(t):y),v+=b(y)+"/",(y=n.nickname)?y=y.call(t,{hash:{},data:r}):(y=t.nickname,y=typeof y===$?y.apply(t):y),v+=b(y)+'\' class="toggleOperation">',(y=n.path)?y=y.call(t,{hash:{},data:r}):(y=t.path,y=typeof y===$?y.apply(t):y),v+=b(y)+"</a>\n          </span>\n        </h3>\n        <ul class='options'>\n          <li>\n          <a href='#!/",(y=n.parentId)?y=y.call(t,{hash:{},data:r}):(y=t.parentId,y=typeof y===$?y.apply(t):y),v+=b(y)+"/",(y=n.nickname)?y=y.call(t,{hash:{},data:r}):(y=t.nickname,y=typeof y===$?y.apply(t):y),v+=b(y)+'\' class="toggleOperation">',(y=n.summary)?y=y.call(t,{hash:{},data:r}):(y=t.summary,y=typeof y===$?y.apply(t):y),(y||0===y)&&(v+=y),v+="</a>\n          </li>\n        </ul>\n      </div>\n      <div class='content' id='",(y=n.parentId)?y=y.call(t,{hash:{},data:r}):(y=t.parentId,y=typeof y===$?y.apply(t):y),v+=b(y)+"_",(y=n.nickname)?y=y.call(t,{hash:{},data:r}):(y=t.nickname,y=typeof y===$?y.apply(t):y),v+=b(y)+"_content' style='display:none'>\n        ",y=n["if"].call(t,t.notes,{hash:{},inverse:_.noop,fn:_.program(1,o,r),data:r}),(y||0===y)&&(v+=y),v+="\n        ",g={hash:{},inverse:_.noop,fn:_.program(3,s,r),data:r},(y=n.oauth)?y=y.call(t,g):(y=t.oauth,y=typeof y===$?y.apply(t):y),n.oauth||(y=w.call(t,y,g)),(y||0===y)&&(v+=y),v+="\n        ",y=n.each.call(t,t.oauth,{hash:{},inverse:_.noop,fn:_.program(5,i,r),data:r}),(y||0===y)&&(v+=y),v+="\n        ",g={hash:{},inverse:_.noop,fn:_.program(8,p,r),data:r},(y=n.oauth)?y=y.call(t,g):(y=t.oauth,y=typeof y===$?y.apply(t):y),n.oauth||(y=w.call(t,y,g)),(y||0===y)&&(v+=y),v+="\n        ",g={hash:{},inverse:_.noop,fn:_.program(10,d,r),data:r},(y=n.oauth)?y=y.call(t,g):(y=t.oauth,y=typeof y===$?y.apply(t):y),n.oauth||(y=w.call(t,y,g)),(y||0===y)&&(v+=y),v+="\n        ",y=n["if"].call(t,t.type,{hash:{},inverse:_.noop,fn:_.program(12,c,r),data:r}),(y||0===y)&&(v+=y),v+="\n        <form accept-charset='UTF-8' class='sandbox'>\n          <div style='margin:0;padding:0;display:inline'></div>\n          ",y=n["if"].call(t,t.parameters,{hash:{},inverse:_.noop,fn:_.program(14,u,r),data:r}),(y||0===y)&&(v+=y),v+="\n          ",y=n["if"].call(t,t.responseMessages,{hash:{},inverse:_.noop,fn:_.program(16,h,r),data:r}),(y||0===y)&&(v+=y),v+="\n          ",y=n["if"].call(t,t.isReadOnly,{hash:{},inverse:_.program(20,f,r),fn:_.program(18,m,r),data:r}),(y||0===y)&&(v+=y),v+="\n        </form>\n        <div class='response' style='display:none'>\n          <h4>Request URL</h4>\n          <div class='block request_url'></div>\n          <h4>Response Body</h4>\n          <div class='block response_body'></div>\n          <h4>Response Code</h4>\n          <div class='block response_code'></div>\n          <h4>Response Headers</h4>\n          <div class='block response_headers'></div>\n        </div>\n      </div>\n    </li>\n  </ul>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n		",a=n["if"].call(e,e.isFile,{hash:{},inverse:g.program(4,i,t),fn:g.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n	"}function s(e,t){var a,r="";return r+='\n			<input type="file" name=\'',(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===f?a.apply(e):a),r+=y(a)+'\'/>\n			<div class="parameter-content-type" />\n		'}function i(e,t){var a,r="";return r+="\n			",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:g.program(7,p,t),fn:g.program(5,l,t),data:t}),(a||0===a)&&(r+=a),r+="\n		"}function l(e,t){var a,r="";return r+="\n				<textarea class='body-textarea' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===f?a.apply(e):a),r+=y(a)+"'>",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===f?a.apply(e):a),r+=y(a)+"</textarea>\n			"}function p(e,t){var a,r="";return r+="\n				<textarea class='body-textarea' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===f?a.apply(e):a),r+=y(a)+'\'></textarea>\n				<br />\n				<div class="parameter-content-type" />\n			'}function d(e,t){var a,r="";return r+="\n		",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:g.program(12,u,t),fn:g.program(10,c,t),data:t}),(a||0===a)&&(r+=a),r+="\n	"}function c(e,t){var a,r="";return r+="\n			<input class='parameter' minlength='0' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===f?a.apply(e):a),r+=y(a)+"' placeholder='' type='text' value='",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===f?a.apply(e):a),r+=y(a)+"'/>\n		"}function u(e,t){var a,r="";return r+="\n			<input class='parameter' minlength='0' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===f?a.apply(e):a),r+=y(a)+"' placeholder='' type='text' value=''/>\n		"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var h,m="",f="function",y=this.escapeExpression,g=this;return m+="<td class='code'>",(h=n.name)?h=h.call(t,{hash:{},data:r}):(h=t.name,h=typeof h===f?h.apply(t):h),m+=y(h)+"</td>\n<td>\n\n	",h=n["if"].call(t,t.isBody,{hash:{},inverse:g.program(9,d,r),fn:g.program(1,o,r),data:r}),(h||0===h)&&(m+=h),m+="\n\n</td>\n<td>",(h=n.description)?h=h.call(t,{hash:{},data:r}):(h=t.description,h=typeof h===f?h.apply(t):h),(h||0===h)&&(m+=h),m+="</td>\n<td>",(h=n.paramType)?h=h.call(t,{hash:{},data:r}):(h=t.paramType,h=typeof h===f?h.apply(t):h),(h||0===h)&&(m+=h),m+='</td>\n<td>\n	<span class="model-signature"></span>\n</td>\n'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_list=e(function(e,t,n,a,r){function o(){return" multiple='multiple'"}function s(){return"\n    "}function i(e,t){var a,r="";return r+="\n      ",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:$.program(8,p,t),fn:$.program(6,l,t),data:t}),(a||0===a)&&(r+=a),r+="\n    "}function l(){return"\n      "}function p(e,t){var a,r,o,s="";return s+="\n        ",o={hash:{},inverse:$.program(11,c,t),fn:$.program(9,d,t),data:t},a=n.isArray||e.isArray,r=a?a.call(e,e,o):b.call(e,"isArray",e,o),(r||0===r)&&(s+=r),s+="\n      "}function d(){return"\n        "}function c(){return"\n          <option selected=\"\" value=''></option>\n        "}function u(e,t){var a,r="";return r+="\n      ",a=n["if"].call(e,e.isDefault,{hash:{},inverse:$.program(16,m,t),fn:$.program(14,h,t),data:t}),(a||0===a)&&(r+=a),r+="\n    "}function h(e,t){var a,r="";return r+='\n        <option selected="" value=\'',(a=n.value)?a=a.call(e,{hash:{},data:t}):(a=e.value,a=typeof a===_?a.apply(e):a),r+=w(a)+"'>",(a=n.value)?a=a.call(e,{hash:{},data:t}):(a=e.value,a=typeof a===_?a.apply(e):a),r+=w(a)+" (default)</option>\n      "}function m(e,t){var a,r="";return r+="\n        <option value='",(a=n.value)?a=a.call(e,{hash:{},data:t}):(a=e.value,a=typeof a===_?a.apply(e):a),r+=w(a)+"'>",(a=n.value)?a=a.call(e,{hash:{},data:t}):(a=e.value,a=typeof a===_?a.apply(e):a),r+=w(a)+"</option>\n      "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var f,y,g,v="",$=this,b=n.helperMissing,_="function",w=this.escapeExpression;return v+="<td class='code'>",(f=n.name)?f=f.call(t,{hash:{},data:r}):(f=t.name,f=typeof f===_?f.apply(t):f),v+=w(f)+"</td>\n<td>\n  <select ",g={hash:{},inverse:$.noop,fn:$.program(1,o,r),data:r},f=n.isArray||t.isArray,y=f?f.call(t,t,g):b.call(t,"isArray",t,g),(y||0===y)&&(v+=y),v+=" class='parameter' name='",(y=n.name)?y=y.call(t,{hash:{},data:r}):(y=t.name,y=typeof y===_?y.apply(t):y),v+=w(y)+"'>\n    ",y=n["if"].call(t,t.required,{hash:{},inverse:$.program(5,i,r),fn:$.program(3,s,r),data:r}),(y||0===y)&&(v+=y),v+="\n    ",y=n.each.call(t,(f=t.allowableValues,null==f||f===!1?f:f.descriptiveValues),{hash:{},inverse:$.noop,fn:$.program(13,u,r),data:r}),(y||0===y)&&(v+=y),v+="\n  </select>\n</td>\n<td>",(y=n.description)?y=y.call(t,{hash:{},data:r}):(y=t.description,y=typeof y===_?y.apply(t):y),(y||0===y)&&(v+=y),v+="</td>\n<td>",(y=n.paramType)?y=y.call(t,{hash:{},data:r}):(y=t.paramType,y=typeof y===_?y.apply(t):y),(y||0===y)&&(v+=y),v+='</td>\n<td><span class="model-signature"></span></td>'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_readonly=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n        <textarea class='body-textarea' readonly='readonly' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===c?a.apply(e):a),r+=u(a)+"'>",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===c?a.apply(e):a),r+=u(a)+"</textarea>\n    "}function s(e,t){var a,r="";return r+="\n        ",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,i,t),data:t}),(a||0===a)&&(r+=a),r+="\n    "}function i(e,t){var a,r="";return r+="\n            ",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===c?a.apply(e):a),r+=u(a)+"\n        "}function l(){return"\n            (empty)\n        "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var p,d="",c="function",u=this.escapeExpression,h=this;return d+="<td class='code'>",(p=n.name)?p=p.call(t,{hash:{},data:r}):(p=t.name,p=typeof p===c?p.apply(t):p),d+=u(p)+"</td>\n<td>\n    ",p=n["if"].call(t,t.isBody,{hash:{},inverse:h.program(3,s,r),fn:h.program(1,o,r),data:r}),(p||0===p)&&(d+=p),d+="\n</td>\n<td>",(p=n.description)?p=p.call(t,{hash:{},data:r}):(p=t.description,p=typeof p===c?p.apply(t):p),(p||0===p)&&(d+=p),d+="</td>\n<td>",(p=n.paramType)?p=p.call(t,{hash:{},data:r}):(p=t.paramType,p=typeof p===c?p.apply(t):p),(p||0===p)&&(d+=p),d+='</td>\n<td><span class="model-signature"></span></td>\n'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_readonly_required=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n        <textarea class='body-textarea'  readonly='readonly' placeholder='(required)' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===c?a.apply(e):a),r+=u(a)+"'>",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===c?a.apply(e):a),r+=u(a)+"</textarea>\n    "}function s(e,t){var a,r="";return r+="\n        ",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:h.program(6,l,t),fn:h.program(4,i,t),data:t}),(a||0===a)&&(r+=a),r+="\n    "}function i(e,t){var a,r="";return r+="\n            ",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===c?a.apply(e):a),r+=u(a)+"\n        "}function l(){return"\n            (empty)\n        "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var p,d="",c="function",u=this.escapeExpression,h=this;return d+="<td class='code required'>",(p=n.name)?p=p.call(t,{hash:{},data:r}):(p=t.name,p=typeof p===c?p.apply(t):p),d+=u(p)+"</td>\n<td>\n    ",p=n["if"].call(t,t.isBody,{hash:{},inverse:h.program(3,s,r),fn:h.program(1,o,r),data:r}),(p||0===p)&&(d+=p),d+="\n</td>\n<td>",(p=n.description)?p=p.call(t,{hash:{},data:r}):(p=t.description,p=typeof p===c?p.apply(t):p),(p||0===p)&&(d+=p),d+="</td>\n<td>",(p=n.paramType)?p=p.call(t,{hash:{},data:r}):(p=t.paramType,p=typeof p===c?p.apply(t):p),(p||0===p)&&(d+=p),d+='</td>\n<td><span class="model-signature"></span></td>\n'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_required=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n		",a=n["if"].call(e,e.isFile,{hash:{},inverse:$.program(4,i,t),fn:$.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n	"}function s(e,t){var a,r="";return r+='\n			<input type="file" name=\'',(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+"'/>\n		"}function i(e,t){var a,r="";return r+="\n			",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:$.program(7,p,t),fn:$.program(5,l,t),data:t}),(a||0===a)&&(r+=a),r+="\n		"}function l(e,t){var a,r="";return r+="\n				<textarea class='body-textarea' placeholder='(required)' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+"'>",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===g?a.apply(e):a),r+=v(a)+"</textarea>\n			"}function p(e,t){var a,r="";return r+="\n				<textarea class='body-textarea' placeholder='(required)' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+'\'></textarea>\n				<br />\n				<div class="parameter-content-type" />\n			'}function d(e,t){var a,r="";return r+="\n		",a=n["if"].call(e,e.isFile,{hash:{},inverse:$.program(12,u,t),fn:$.program(10,c,t),data:t}),(a||0===a)&&(r+=a),r+="\n	"}function c(e,t){var a,r="";return r+="\n			<input class='parameter' class='required' type='file' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+"'/>\n		"}function u(e,t){var a,r="";return r+="\n			",a=n["if"].call(e,e.defaultValue,{hash:{},inverse:$.program(15,m,t),fn:$.program(13,h,t),data:t}),(a||0===a)&&(r+=a),r+="\n		"}function h(e,t){var a,r="";return r+="\n				<input class='parameter required' minlength='1' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+"' placeholder='(required)' type='text' value='",(a=n.defaultValue)?a=a.call(e,{hash:{},data:t}):(a=e.defaultValue,a=typeof a===g?a.apply(e):a),r+=v(a)+"'/>\n			"}function m(e,t){var a,r="";return r+="\n				<input class='parameter required' minlength='1' name='",(a=n.name)?a=a.call(e,{hash:{},data:t}):(a=e.name,a=typeof a===g?a.apply(e):a),r+=v(a)+"' placeholder='(required)' type='text' value=''/>\n			"}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var f,y="",g="function",v=this.escapeExpression,$=this;return y+="<td class='code required'>",(f=n.name)?f=f.call(t,{hash:{},data:r}):(f=t.name,f=typeof f===g?f.apply(t):f),y+=v(f)+"</td>\n<td>\n	",f=n["if"].call(t,t.isBody,{hash:{},inverse:$.program(9,d,r),fn:$.program(1,o,r),data:r}),(f||0===f)&&(y+=f),y+="\n</td>\n<td>\n	<strong>",(f=n.description)?f=f.call(t,{hash:{},data:r}):(f=t.description,f=typeof f===g?f.apply(t):f),(f||0===f)&&(y+=f),y+="</strong>\n</td>\n<td>",(f=n.paramType)?f=f.call(t,{hash:{},data:r}):(f=t.paramType,f=typeof f===g?f.apply(t):f),(f||0===f)&&(y+=f),y+='</td>\n<td><span class="model-signature"></span></td>\n'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.parameter_content_type=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n  ",a=n.each.call(e,e.consumes,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n"}function s(e){var t,n="";return n+='\n  <option value="',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+='">',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+="</option>\n  "}function i(){return'\n  <option value="application/json">application/json</option>\n'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var l,p="",d="function",c=this;return p+='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n',l=n["if"].call(t,t.consumes,{hash:{},inverse:c.program(4,i,r),fn:c.program(1,o,r),data:r}),(l||0===l)&&(p+=l),p+="\n</select>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.resource=e(function(e,t,n,a,r){function o(){return" : "}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var s,i,l="",p="function",d=this.escapeExpression,c=this,u=n.blockHelperMissing;return l+="<div class='heading'>\n  <h2>\n    <a href='#!/",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"' onclick=\"Docs.toggleEndpointListForResource('",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"');\">",(s=n.name)?s=s.call(t,{hash:{},data:r}):(s=t.name,s=typeof s===p?s.apply(t):s),l+=d(s)+"</a> ",i={hash:{},inverse:c.noop,fn:c.program(1,o,r),data:r},(s=n.description)?s=s.call(t,i):(s=t.description,s=typeof s===p?s.apply(t):s),n.description||(s=u.call(t,s,i)),(s||0===s)&&(l+=s),(s=n.description)?s=s.call(t,{hash:{},data:r}):(s=t.description,s=typeof s===p?s.apply(t):s),(s||0===s)&&(l+=s),l+="\n  </h2>\n  <ul class='options'>\n    <li>\n      <a href='#!/",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"' id='endpointListTogger_",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"'\n         onclick=\"Docs.toggleEndpointListForResource('",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"');\">Show/Hide</a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.collapseOperationsForResource('",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"'); return false;\">\n        List Operations\n      </a>\n    </li>\n    <li>\n      <a href='#' onclick=\"Docs.expandOperationsForResource('",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"'); return false;\">\n        Expand Operations\n      </a>\n    </li>\n    <li>\n      <a href='",(s=n.url)?s=s.call(t,{hash:{},data:r}):(s=t.url,s=typeof s===p?s.apply(t):s),l+=d(s)+"'>Raw</a>\n    </li>\n  </ul>\n</div>\n<ul class='endpoints' id='",(s=n.id)?s=s.call(t,{hash:{},data:r}):(s=t.id,s=typeof s===p?s.apply(t):s),l+=d(s)+"_endpoint_list' style='display:none'>\n\n</ul>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.response_content_type=e(function(e,t,n,a,r){function o(e,t){var a,r="";return r+="\n  ",a=n.each.call(e,e.produces,{hash:{},inverse:c.noop,fn:c.program(2,s,t),data:t}),(a||0===a)&&(r+=a),r+="\n"}function s(e){var t,n="";return n+='\n  <option value="',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+='">',t=typeof e===d?e.apply(e):e,(t||0===t)&&(n+=t),n+="</option>\n  "}function i(){return'\n  <option value="application/json">application/json</option>\n'}this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var l,p="",d="function",c=this;return p+='<label for="responseContentType"></label>\n<select name="responseContentType">\n',l=n["if"].call(t,t.produces,{hash:{},inverse:c.program(4,i,r),fn:c.program(1,o,r),data:r}),(l||0===l)&&(p+=l),p+="\n</select>\n"})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.signature=e(function(e,t,n,a,r){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var o,s="",i="function",l=this.escapeExpression;return s+='<div>\n<ul class="signature-nav">\n    <li><a class="description-link" href="#">Model</a></li>\n    <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n    <div class="description">\n        ',(o=n.signature)?o=o.call(t,{hash:{},data:r}):(o=t.signature,o=typeof o===i?o.apply(t):o),(o||0===o)&&(s+=o),s+='\n    </div>\n\n    <div class="snippet">\n        <pre><code>',(o=n.sampleJSON)?o=o.call(t,{hash:{},data:r}):(o=t.sampleJSON,o=typeof o===i?o.apply(t):o),s+=l(o)+'</code></pre>\n        <small class="notice"></small>\n    </div>\n</div>\n\n'})}(),function(){var e=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.status_code=e(function(e,t,n,a,r){this.compilerInfo=[4,">= 1.0.0"],n=this.merge(n,e.helpers),r=r||{};var o,s="",i="function",l=this.escapeExpression;return s+="<td width='15%' class='code'>",(o=n.code)?o=o.call(t,{hash:{},data:r}):(o=t.code,o=typeof o===i?o.apply(t):o),s+=l(o)+"</td>\n<td>",(o=n.message)?o=o.call(t,{hash:{},data:r}):(o=t.message,o=typeof o===i?o.apply(t):o),(o||0===o)&&(s+=o),s+="</td>\n<td width='50%'><span class=\"model-signature\" /></td>"})}(),function(){var e,t,n,a,r,o,s,i,l,p,d,c={}.hasOwnProperty,u=function(e,t){function n(){this.constructor=e}for(var a in t)c.call(t,a)&&(e[a]=t[a]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e};d=function(e){function a(){a.__super__.constructor.apply(this,arguments)}return u(a,e),a.prototype.dom_id="swagger_ui",a.prototype.options=null,a.prototype.api=null,a.prototype.headerView=null,a.prototype.mainView=null,a.prototype.initialize=function(e){var n=this;return null==e&&(e={}),null!=e.dom_id&&(this.dom_id=e.dom_id,delete e.dom_id),null==$("#"+this.dom_id)&&$("body").append('<div id="'+this.dom_id+'"></div>'),this.options=e,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 t({el:$("#header")}),this.headerView.on("update-swagger-ui",function(e){return n.updateSwaggerUi(e)})},a.prototype.updateSwaggerUi=function(e){return this.options.url=e.url,this.load()},a.prototype.load=function(){var e,t;return null!=(t=this.mainView)&&t.clear(),e=this.options.url,0!==e.indexOf("http")&&(e=this.buildUrl(window.location.href.toString(),e)),this.options.url=e,this.headerView.update(e),this.api=new SwaggerApi(this.options),this.api.build(),this.api},a.prototype.render=function(){switch(this.showMessage("Finished Loading Resource Information. Rendering Swagger UI..."),this.mainView=new n({model:this.api,el:$("#"+this.dom_id)}).render(),this.showMessage(),this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}return this.options.onComplete&&this.options.onComplete(this.api,this),setTimeout(function(){return Docs.shebang()},400)},a.prototype.buildUrl=function(e,t){var n,a;return log("base is "+e),0===t.indexOf("/")?(a=e.split("/"),e=a[0]+"//"+a[2],e+t):(n=e.length,e.indexOf("?")>-1&&(n=Math.min(n,e.indexOf("?"))),e.indexOf("#")>-1&&(n=Math.min(n,e.indexOf("#"))),e=e.substring(0,n),-1!==e.indexOf("/",e.length-1)?e+t:e+"/"+t)},a.prototype.showMessage=function(e){return null==e&&(e=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(e)
  },a.prototype.onLoadFailure=function(e){var t;return null==e&&(e=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail"),t=$("#message-bar").html(e),null!=this.options.onFailure&&this.options.onFailure(e),t},a}(Backbone.Router),window.SwaggerUi=d,t=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},t.prototype.initialize=function(){},t.prototype.showPetStore=function(){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},t.prototype.showWordnikDev=function(){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},t.prototype.showCustomOnKeyup=function(e){return 13===e.keyCode?this.showCustom():void 0},t.prototype.showCustom=function(e){return null!=e&&e.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},t.prototype.update=function(e,t,n){return null==n&&(n=!1),$("#input_baseUrl").val(e),n?this.trigger("update-swagger-ui",{url:e}):void 0},t}(Backbone.View),n=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e,t,n,a,r,o,s;for($(this.el).html(Handlebars.templates.main(this.model)),a={},e=0,s=this.model.apisArray,r=0,o=s.length;o>r;r++){for(n=s[r],t=n.name;"undefined"!=typeof a[t];)t=t+"_"+e,e+=1;n.id=t,a[t]=n,this.addResource(n)}return this},t.prototype.addResource=function(e){var t;return t=new s({model:e,tagName:"li",id:"resource_"+e.id,className:"resource"}),$("#resources").append(t.render().el)},t.prototype.clear=function(){return $(this.el).html("")},t}(Backbone.View),s=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e,t,n,a,r,o,s;for($(this.el).html(Handlebars.templates.resource(this.model)),n={},s=this.model.operationsArray,r=0,o=s.length;o>r;r++){for(a=s[r],e=0,t=a.nickname;"undefined"!=typeof n[t];)t=t+"_"+e,e+=1;n[t]=a,a.nickname=t,a.parentId=this.model.id,this.addOperation(a)}return this},t.prototype.addOperation=function(e){var t;return e.number=this.number,t=new a({model:e,tagName:"li",className:"endpoint"}),$(".endpoints",$(this.el)).append(t.render().el),this.number++},t}(Backbone.View),a=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.invocationUrl=null,t.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"},t.prototype.initialize=function(){},t.prototype.mouseEnter=function(e){var t,n,a,r,o,s,i,l,p,d;return t=$(e.currentTarget.parentNode).find("#api_information_panel"),p=event.pageX,d=event.pageY,s=$(window).scrollLeft(),i=$(window).scrollTop(),r=s+$(window).width(),o=i+$(window).height(),l=t.width(),n=t.height(),p+l>r&&(p=r-l),s>p&&(p=s),d+n>o&&(d=o-n),i>d&&(d=i),a={},a.top=d,a.left=p,t.css(a),$(e.currentTarget.parentNode).find("#api_information_panel").show()},t.prototype.mouseExit=function(e){return $(e.currentTarget.parentNode).find("#api_information_panel").hide()},t.prototype.render=function(){var e,t,n,a,r,o,s,p,d,c,u,h,m,f,y,g,v,b,_,w,x,k,H;if(t=!0,t||(this.model.isReadOnly=!0),this.model.oauth=null,this.model.authorizations){w=this.model.authorizations;for(n in w)if(u=w[n],"oauth2"===n)for(null===this.model.oauth&&(this.model.oauth={}),void 0===this.model.oauth.scopes&&(this.model.oauth.scopes=[]),h=0,g=u.length;g>h;h++)a=u[h],this.model.oauth.scopes.push(a)}for($(this.el).html(Handlebars.templates.operation(this.model)),this.model.responseClassSignature&&"string"!==this.model.responseClassSignature?(p={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature},s=new l({model:p,tagName:"div"}),$(".model-signature",$(this.el)).append(s.render().el)):$(".model-signature",$(this.el)).html(this.model.type),e={isParam:!1},e.consumes=this.model.consumes,e.produces=this.model.produces,x=this.model.parameters,m=0,v=x.length;v>m;m++)r=x[m],c=r.type||r.dataType,"file"===c.toLowerCase()&&(e.consumes||(log("set content type "),e.consumes="multipart/form-data"));for(o=new i({model:e}),$(".response-content-type",$(this.el)).append(o.render().el),k=this.model.parameters,f=0,b=k.length;b>f;f++)r=k[f],this.addParameter(r,e.consumes);for(H=this.model.responseMessages,y=0,_=H.length;_>y;y++)d=H[y],this.addStatusCode(d);return this},t.prototype.addParameter=function(e,t){var n;return e.consumes=t,n=new o({model:e,tagName:"tr",readOnly:this.model.isReadOnly}),$(".operation-params",$(this.el)).append(n.render().el)},t.prototype.addStatusCode=function(e){var t;return t=new p({model:e,tagName:"tr"}),$(".operation-status",$(this.el)).append(t.render().el)},t.prototype.submitOperation=function(e){var t,n,a,r,o,s,i,l,p,d,c,u,h,m,f,y;if(null!=e&&e.preventDefault(),n=$(".sandbox",$(this.el)),t=!0,n.find("input.required").each(function(){var e=this;return $(this).removeClass("error"),""===jQuery.trim($(this).val())?($(this).addClass("error"),$(this).wiggle({callback:function(){return $(e).focus()}}),t=!1):void 0}),t){for(r={},s={parent:this},a=!1,m=n.find("input"),l=0,c=m.length;c>l;l++)o=m[l],null!=o.value&&jQuery.trim(o.value).length>0&&(r[o.name]=o.value),"file"===o.type&&(a=!0);for(f=n.find("textarea"),p=0,u=f.length;u>p;p++)o=f[p],null!=o.value&&jQuery.trim(o.value).length>0&&(r.body=o.value);for(y=n.find("select"),d=0,h=y.length;h>d;d++)o=y[d],i=this.getSelectedValue(o),null!=i&&jQuery.trim(i).length>0&&(r[o.name]=i);return s.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),s.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),a?this.handleFileUpload(r,n):this.model["do"](r,s,this.showCompleteStatus,this.showErrorStatus,this)}},t.prototype.success=function(e,t){return t.showCompleteStatus(e)},t.prototype.handleFileUpload=function(e,t){var n,a,r,o,s,i,l,p,d,c,u,h,m,f,y,g,v,b,_,w=this;for(g=t.serializeArray(),p=0,h=g.length;h>p;p++)o=g[p],null!=o.value&&jQuery.trim(o.value).length>0&&(e[o.name]=o.value);for(n=new FormData,l=0,v=this.model.parameters,d=0,m=v.length;m>d;d++)i=v[d],"form"===i.paramType&&void 0!==e[i.name]&&n.append(i.name,e[i.name]);for(r={},b=this.model.parameters,c=0,f=b.length;f>c;c++)i=b[c],"header"===i.paramType&&(r[i.name]=e[i.name]);for(log(r),_=t.find('input[type~="file"]'),u=0,y=_.length;y>u;u++)a=_[u],"undefined"!=typeof a.files[0]&&(n.append($(a).attr("name"),a.files[0]),l+=1);return log(n),this.invocationUrl=this.model.supportHeaderParams()?(r=this.model.getHeaderParams(e),this.model.urlify(e,!1)):this.model.urlify(e,!0),$(".request_url",$(this.el)).html("<pre>"+this.invocationUrl+"</pre>"),s={type:this.model.method,url:this.invocationUrl,headers:r,data:n,dataType:"json",contentType:!1,processData:!1,error:function(e){return w.showErrorStatus(w.wrap(e),w)},success:function(e){return w.showResponse(e,w)},complete:function(e){return w.showCompleteStatus(w.wrap(e),w)}},window.authorizations&&window.authorizations.apply(s),0===l&&s.data.append("fake","true"),jQuery.ajax(s),!1},t.prototype.wrap=function(e){var t,n,a,r,o,s,i;for(a={},n=e.getAllResponseHeaders().split("\r"),s=0,i=n.length;i>s;s++)r=n[s],t=r.split(":"),void 0!==t[0]&&void 0!==t[1]&&(a[t[0].trim()]=t[1].trim());return o={},o.content={},o.content.data=e.responseText,o.headers=a,o.request={},o.request.url=this.invocationUrl,o.status=e.status,o},t.prototype.getSelectedValue=function(e){var t,n,a,r,o;if(e.multiple){for(n=[],o=e.options,a=0,r=o.length;r>a;a++)t=o[a],t.selected&&n.push(t.value);return n.length>0?n.join(","):null}return e.value},t.prototype.hideResponse=function(e){return null!=e&&e.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},t.prototype.showResponse=function(e){var t;return t=JSON.stringify(e,null,"	").replace(/\n/g,"<br>"),$(".response_body",$(this.el)).html(escape(t))},t.prototype.showErrorStatus=function(e,t){return t.showStatus(e)},t.prototype.showCompleteStatus=function(e,t){return t.showStatus(e)},t.prototype.formatXml=function(e){var t,n,a,r,o,s,i,l,p,d,c,u,h;for(l=/(>)(<)(\/*)/g,d=/[ ]*(.*)[ ]+\n/g,t=/(<.+>)(.+\n)/g,e=e.replace(l,"$1\n$2$3").replace(d,"$1\n").replace(t,"$1\n$2"),i=0,n="",o=e.split("\n"),a=0,r="other",p={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},c=function(e){var t,o,s,i,l,d,c;return d={single:Boolean(e.match(/<.+\/>/)),closing:Boolean(e.match(/<\/.+>/)),opening:Boolean(e.match(/<[^!?].*>/))},l=function(){var e;e=[];for(s in d)c=d[s],c&&e.push(s);return e}()[0],l=void 0===l?"other":l,t=r+"->"+l,r=l,i="",a+=p[t],i=function(){var e,t,n;for(n=[],o=e=0,t=a;t>=0?t>e:e>t;o=t>=0?++e:--e)n.push("  ");return n}().join(""),"opening->closing"===t?n=n.substr(0,n.length-1)+e+"\n":n+=i+e+"\n"},u=0,h=o.length;h>u;u++)s=o[u],c(s);return n},t.prototype.showStatus=function(e){var t,n,a,r,o,s,i;return void 0===e.content?(n=e.data,i=e.url):(n=e.content.data,i=e.request.url),r=e.headers,a=r&&r["Content-Type"]?r["Content-Type"].split(";")[0].trim():null,n?"application/json"===a||/\+json$/.test(a)?(t=$("<code />").text(JSON.stringify(JSON.parse(n),null,"  ")),o=$('<pre class="json" />').append(t)):"application/xml"===a||/\+xml$/.test(a)?(t=$("<code />").text(this.formatXml(n)),o=$('<pre class="xml" />').append(t)):"text/html"===a?(t=$("<code />").html(n),o=$('<pre class="xml" />').append(t)):/^image\//.test(a)?o=$("<img>").attr("src",i):(t=$("<code />").text(n),o=$('<pre class="json" />').append(t)):(t=$("<code />").text("no content"),o=$('<pre class="json" />').append(t)),s=o,$(".request_url",$(this.el)).html("<pre>"+i+"</pre>"),$(".response_code",$(this.el)).html("<pre>"+e.status+"</pre>"),$(".response_body",$(this.el)).html(s),$(".response_headers",$(this.el)).html("<pre>"+JSON.stringify(e.headers,null,"  ").replace(/\n/g,"<br>")+"</pre>"),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide(),hljs.highlightBlock($(".response_body",$(this.el))[0])},t.prototype.toggleOperationContent=function(){var e;return e=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content"),e.is(":visible")?Docs.collapseOperation(e):Docs.expandOperation(e)},t}(Backbone.View),p=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e,t,n;return n=this.template(),$(this.el).html(n(this.model)),swaggerUi.api.models.hasOwnProperty(this.model.responseModel)?(e={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:!1,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()},t=new l({model:e,tagName:"div"}),$(".model-signature",this.$el).append(t.render().el)):$(".model-signature",this.$el).html(""),this},t.prototype.template=function(){return Handlebars.templates.status_code},t}(Backbone.View),o=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(e,t){return"array"===e.type.toLowerCase()||e.allowMultiple?t.fn(this):t.inverse(this)})},t.prototype.render=function(){var e,t,n,a,o,s,p,d;return d=this.model.type||this.model.dataType,"body"===this.model.paramType&&(this.model.isBody=!0),"file"===d.toLowerCase()&&(this.model.isFile=!0),p=this.template(),$(this.el).html(p(this.model)),o={sampleJSON:this.model.sampleJSON,isParam:!0,signature:this.model.signature},this.model.sampleJSON?(s=new l({model:o,tagName:"div"}),$(".model-signature",$(this.el)).append(s.render().el)):$(".model-signature",$(this.el)).html(this.model.signature),t=!1,this.model.isBody&&(t=!0),e={isParam:t},e.consumes=this.model.consumes,t?(n=new r({model:e}),$(".parameter-content-type",$(this.el)).append(n.render().el)):(a=new i({model:e}),$(".response-content-type",$(this.el)).append(a.render().el)),this},t.prototype.template=function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param},t}(Backbone.View),l=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"},t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),this.switchToDescription(),this.isParam=this.model.isParam,this.isParam&&$(".notice",$(this.el)).text("Click to set as parameter value"),this},t.prototype.template=function(){return Handlebars.templates.signature},t.prototype.switchToDescription=function(e){return null!=e&&e.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},t.prototype.switchToSnippet=function(e){return null!=e&&e.preventDefault(),$(".description",$(this.el)).hide(),$(".snippet",$(this.el)).show(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},t.prototype.snippetToTextArea=function(e){var t;return this.isParam&&(null!=e&&e.preventDefault(),t=$("textarea",$(this.el.parentNode.parentNode.parentNode)),""===$.trim(t.val()))?t.val(this.model.sampleJSON):void 0},t}(Backbone.View),e=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.content_type},t}(Backbone.View),i=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=responseContentType]",$(this.el)).text("Response Content Type"),this},t.prototype.template=function(){return Handlebars.templates.response_content_type},t}(Backbone.View),r=function(e){function t(){t.__super__.constructor.apply(this,arguments)}return u(t,e),t.prototype.initialize=function(){},t.prototype.render=function(){var e;return e=this.template(),$(this.el).html(e(this.model)),$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:"),this},t.prototype.template=function(){return Handlebars.templates.parameter_content_type},t}(Backbone.View)}.call(this);