text: define("jquery",[],function(){return window.jQuery}),define("backbone",[],function(){return window.Backbone}),define("backbone.marionette",[],function(){return window.Marionette}),define("apps/api-documentation/router",["exports","module","backbone"],function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var i=r(n);t.exports=i["default"].Router.extend({routes:{"*path":"show"},initialize:function(t){this.app=t.app},show:function(t){this.app.controller.show(t)}})}),define("underscore",[],function(){return window._}),this.Templates=this.Templates||{},this.Templates["api-documentation-action"]=Handlebars.template({1:function(e,t,n,r){return"POST"},3:function(e,t,n,r){return"GET"},5:function(e,t,n,r){return'      <span class="badge spacer-right">internal</span>\n'},7:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'      <span class="note spacer-right">Since '+u((i=(i=t.since||(e!=null?e.since:e))!=null?i:o,typeof i===s?i.call(e,{name:"since",hash:{},data:r}):i))+"</span>\n"},9:function(e,t,n,r){var i,s='  <h4 class="spacer-top little-spacer-bottom">Parameters</h4>\n  <table class="width-100 data zebra">\n';return i=t.each.call(e,e!=null?e.params:e,{name:"each",hash:{},fn:this.program(10,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+"  </table>\n"},10:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='      <tr>\n        <td style="width: 10em;">\n          <code>'+a((s=(s=t.key||(e!=null?e.key:e))!=null?s:u,typeof s===o?s.call(e,{name:"key",hash:{},data:r}):s))+'</code>\n          <div class="note">';return i=t["if"].call(e,e!=null?e.required:e,{name:"if",hash:{},fn:this.program(11,r),inverse:this.program(13,r),data:r}),i!=null&&(f+=i),f+='</div>\n        </td>\n        <td>\n          <div class="markdown">',i=(s=(s=t.description||(e!=null?e.description:e))!=null?s:u,typeof s===o?s.call(e,{name:"description",hash:{},data:r}):s),i!=null&&(f+=i),f+="</div>\n\n",i=t["if"].call(e,e!=null?e.possibleValues:e,{name:"if",hash:{},fn:this.program(15,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=t["if"].call(e,e!=null?e.defaultValue:e,{name:"if",hash:{},fn:this.program(18,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=t["if"].call(e,e!=null?e.exampleValue:e,{name:"if",hash:{},fn:this.program(20,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+"        </td>\n      </tr>\n"},11:function(e,t,n,r){return"required"},13:function(e,t,n,r){return"optional"},15:function(e,t,n,r){var i,s='            <p class="little-spacer-top">\n              <strong>Possible values:</strong>\n            </p>\n            <ul class="list-styled">\n';return i=t.each.call(e,e!=null?e.possibleValues:e,{name:"each",hash:{},fn:this.program(16,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+"            </ul>\n"},16:function(e,t,n,r){var i=this.lambda,s=this.escapeExpression;return'                <li class="little-spacer-top"><code>'+s(i(e,e))+"</code></li>\n"},18:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'            <p class="little-spacer-top">\n              <strong>Default value:</strong> <code>'+u((i=(i=t.defaultValue||(e!=null?e.defaultValue:e))!=null?i:o,typeof i===s?i.call(e,{name:"defaultValue",hash:{},data:r}):i))+"</code>\n            </p>\n"},20:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'            <p class="little-spacer-top">\n              <strong>Example value:</strong> <code>'+u((i=(i=t.exampleValue||(e!=null?e.exampleValue:e))!=null?i:o,typeof i===s?i.call(e,{name:"exampleValue",hash:{},data:r}):i))+"</code>\n            </p>\n"},22:function(e,t,n,r){var i,s='  <h4 class="spacer-top">\n    Example Response\n';return i=t["if"].call(e,e!=null?e.responseExample:e,{name:"if",hash:{},fn:this.program(23,r),inverse:this.program(25,r),data:r}),i!=null&&(s+=i),s+="  </h4>\n\n",i=t["if"].call(e,e!=null?e.responseExample:e,{name:"if",hash:{},fn:this.program(27,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s},23:function(e,t,n,r){return'      <a class="js-hide-response-example little-spacer-left" href="#">Hide</a>\n'},25:function(e,t,n,r){return'      <a class="js-show-response-example little-spacer-left" href="#">Show</a>\n'},27:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'    <div class="little-spacer-top">\n      <pre style="white-space: pre-wrap;">'+u((i=(i=t.responseExample||(e!=null?e.responseExample:e))!=null?i:o,typeof i===s?i.call(e,{name:"responseExample",hash:{},data:r}):i))+"</pre>\n    </div>\n"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<header class="page-header">\n  <h3 class="page-title big">';return i=t["if"].call(e,e!=null?e.post:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.program(3,r),data:r}),i!=null&&(f+=i),f+=" "+a((s=(s=t.path||(e!=null?e.path:e))!=null?s:u,typeof s===o?s.call(e,{name:"path",hash:{},data:r}):s))+"/"+a((s=(s=t.key||(e!=null?e.key:e))!=null?s:u,typeof s===o?s.call(e,{name:"key",hash:{},data:r}):s))+'</h3>\n\n  <div class="page-actions">\n',i=t["if"].call(e,e!=null?e.internal:e,{name:"if",hash:{},fn:this.program(5,r),inverse:this.noop,data:r}),i!=null&&(f+=i),i=t["if"].call(e,e!=null?e.since:e,{name:"if",hash:{},fn:this.program(7,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='\n    <a class="js-permalink icon-link" href="'+a((t.link||e&&e.link||u).call(e,"/api_documentation/",e!=null?e.path:e,"/",e!=null?e.key:e,{name:"link",hash:{},data:r}))+'" target="_blank"></a>\n  </div>\n</header>\n\n<div class="markdown">',i=(s=(s=t.description||(e!=null?e.description:e))!=null?s:u,typeof s===o?s.call(e,{name:"description",hash:{},data:r}):s),i!=null&&(f+=i),f+="</div>\n\n",i=t["if"].call(e,e!=null?e.params:e,{name:"if",hash:{},fn:this.program(9,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+="\n",i=t["if"].call(e,e!=null?e.hasResponseExample:e,{name:"if",hash:{},fn:this.program(22,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f},useData:!0}),this.Templates["api-documentation-filters"]=Handlebars.template({1:function(e,t,n,r){return"checked"},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s='<h1 class="page-title">Web Service API</h1>\n\n<div class="page-actions">\n  <input class="js-toggle-internal" type="checkbox" id="api-documentation-show-internal" ';return i=t["if"].call(e,(i=e!=null?e.state:e)!=null?i.internal:i,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(s+=i),s+'>\n  <label for="api-documentation-show-internal">Show Internal</label>\n</div>\n'},useData:!0}),this.Templates["api-documentation-header"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s="function",o=t.helperMissing,u=this.escapeExpression;return'<h2 class="search-navigator-header-component">'+u((i=(i=t.path||(e!=null?e.path:e))!=null?i:o,typeof i===s?i.call(e,{name:"path",hash:{},data:r}):i))+"</h2>\n"},useData:!0}),this.Templates["api-documentation-layout"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<div class="search-navigator sticky">\n  <div class="search-navigator-side search-navigator-side-light">\n    <div class="search-navigator-filters"></div>\n    <div class="api-documentation-search"></div>\n    <div class="api-documentation-results panel"></div>\n  </div>\n\n  <div class="search-navigator-workspace">\n    <div class="search-navigator-workspace-header"></div>\n    <div class="search-navigator-workspace-details"></div>\n  </div>\n</div>\n'},useData:!0}),this.Templates["api-documentation-search"]=Handlebars.template({compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){return'<form id="api-documentation-search-form" class="search-box">\n  <span id="api-documentation-search-submit" class="search-box-submit button-clean"><i class="icon-search"></i></span>\n  <input id="api-documentation-search-query" class="search-box-input" type="search" name="q" placeholder="Search" maxlength="100">\n</form>\n'},useData:!0}),this.Templates["api-documentation-web-service"]=Handlebars.template({1:function(e,t,n,r){return'    <span class="badge">internal</span>\n'},compiler:[6,">= 2.0.0-beta.1"],main:function(e,t,n,r){var i,s,o="function",u=t.helperMissing,a=this.escapeExpression,f='<h3 class="list-group-item-heading">\n  '+a((s=(s=t.path||(e!=null?e.path:e))!=null?s:u,typeof s===o?s.call(e,{name:"path",hash:{},data:r}):s))+"\n";return i=t["if"].call(e,e!=null?e.internal:e,{name:"if",hash:{},fn:this.program(1,r),inverse:this.noop,data:r}),i!=null&&(f+=i),f+='</h3>\n<p class="list-group-item-text">',i=(s=(s=t.description||(e!=null?e.description:e))!=null?s:u,typeof s===o?s.call(e,{name:"description",hash:{},data:r}):s),i!=null&&(f+=i),f+"</p>\n"},useData:!0}),define("apps/api-documentation/templates",function(){}),define("apps/api-documentation/action-view",["exports","module","jquery","backbone.marionette","./templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].ItemView.extend({className:"panel panel-vertical",template:Templates["api-documentation-action"],modelEvents:{change:"render"},events:{"click .js-show-response-example":"onShowResponseExampleClick","click .js-hide-response-example":"onHideResponseExampleClick"},initialize:function(){this.listenTo(this.options.state,"change:query",this.toggleHidden)},onRender:function(){this.$el.attr("data-web-service",this.model.get("path")),this.$el.attr("data-action",this.model.get("key")),this.toggleHidden()},onShowResponseExampleClick:function(t){t.preventDefault(),this.fetchResponse()},onHideResponseExampleClick:function(t){t.preventDefault(),this.model.unset("responseExample")},fetchResponse:function(){var t=this,n=baseUrl+"/api/webservices/response_example",r={controller:this.model.get("path"),action:this.model.get("key")};return o["default"].get(n,r).done(function(e){t.model.set({responseExample:e.example})})},toggleHidden:function(){var t=this.model.get("path")+"/"+this.model.get("key");this.$el.toggleClass("hidden",!this.options.state.match(t))}})}),define("apps/api-documentation/actions-view",["exports","module","jquery","backbone.marionette","./action-view"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r),a=s(i);t.exports=u["default"].CollectionView.extend({childView:a["default"],childViewOptions:function(){return{state:this.options.state}},scrollToTop:function(){var t=this.$el.scrollParent();t.is(document)&&(t=(0,o["default"])(window)),t.scrollTop(0)},scrollToAction:function(t){var n=this.collection.findWhere({key:t});if(n!=null){var r=this.children.findByModel(n);r!=null&&this.scrollToView(r)}},scrollToView:function(t){var n=t.$el,r=n.scrollParent(),i=n.offset(),s=r.offset();r.is(document)&&(s={top:0});if(i!=null&&s!=null){var o=i.top-s.top-70;r.scrollTop(o)}}})}),define("apps/api-documentation/header-view",["exports","module","backbone.marionette","./templates"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n);t.exports=s["default"].ItemView.extend({template:Templates["api-documentation-header"],modelEvents:{change:"render"}})}),define("apps/api-documentation/controller",["exports","module","underscore","backbone","backbone.marionette","./actions-view","./header-view"],function(e,t,n,r,i,s,o){"use strict";function u(e){return e&&e.__esModule?e:{"default":e}}var a=u(n),f=u(r),l=u(i),c=u(s),h=u(o);t.exports=l["default"].Controller.extend({initialize:function(t){this.list=t.app.list,this.listenTo(this.list,"select",this.onItemSelect)},show:function(t){var n=this;this.fetchList().done(function(){if(t){var e=n.list.findWhere({path:t});e!=null?n.showWebService(t):n.showAction(t)}})},showWebService:function(t){var n=this.list.findWhere({path:t});n!=null&&n.trigger("select",n)},showAction:function(t){var n=this.list.find(function(e){return t.indexOf(e.get("path"))===0});if(n!=null){var r=t.substr(n.get("path").length+1);n.trigger("select",n,{trigger:!1,action:r})}},onItemSelect:function(t,n){var r=t.get("path"),i=a["default"].defaults(n||{},{trigger:!0});i.trigger&&this.options.app.router.navigate(r),this.options.app.listView.highlight(r),t.get("internal")&&this.options.state.set({internal:!0});var s=new f["default"].Collection(t.get("actions")),o=new c["default"]({collection:s,state:this.options.state});this.options.app.layout.detailsRegion.show(o),this.options.app.layout.headerRegion.show(new h["default"]({model:t})),i.action!=null?o.scrollToAction(i.action):o.scrollToTop()},fetchList:function(){return this.list.fetch({data:{include_internals:!0}})}})}),define("apps/api-documentation/layout",["exports","module","backbone.marionette","./templates"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n);t.exports=s["default"].LayoutView.extend({template:Templates["api-documentation-layout"],regions:{headerRegion:".search-navigator-workspace-header",actionsRegion:".search-navigator-filters",searchRegion:".api-documentation-search",resultsRegion:".api-documentation-results",detailsRegion:".search-navigator-workspace-details"},onRender:function(){var t=this.$(".search-navigator");t.addClass("sticky search-navigator-extended-view");var n=t.offset().top;this.$(".search-navigator-workspace-header").css({top:n}),this.$(".search-navigator-side").css({top:n}).isolatedScroll()}})}),define("apps/api-documentation/list",["exports","module","underscore","backbone"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=o["default"].Collection.extend({url:baseUrl+"/api/webservices/list",comparator:"path",parse:function(t){return t.webServices.map(function(e){var t=s["default"].every(e.actions,function(e){return e.internal}),n=e.actions.map(function(t){return s["default"].extend(t,{path:e.path})});return s["default"].extend(e,{internal:t,actions:n})})}})}),define("apps/api-documentation/item-view",["exports","module","underscore","backbone.marionette","./templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].ItemView.extend({tagName:"a",className:"list-group-item",template:Templates["api-documentation-web-service"],modelEvents:{change:"render"},events:{click:"onClick"},initialize:function(){this.listenTo(this.options.state,"change:query",this.toggleHidden),this.listenTo(this.options.state,"change:internal",this.toggleHidden)},shouldBeHidden:function(){var t=this,n=this.options.state.match(this.model.get("path"))||o["default"].some(this.model.get("actions"),function(e){var n=e.path+"/"+e.key;return t.options.state.match(n)}),r=this.options.state.get("internal"),i=this.model.get("internal")&&!r;return!n||i},onRender:function(){this.$el.attr("data-path",this.model.get("path")),this.$el.toggleClass("active",this.options.highlighted),this.toggleHidden()},onClick:function(t){t.preventDefault(),this.model.trigger("select",this.model)},toggleHidden:function(){this.$el.toggleClass("hidden",this.shouldBeHidden())}})}),define("apps/api-documentation/list-view",["exports","module","backbone.marionette","./item-view"],function(e,t,n,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}var s=i(n),o=i(r);t.exports=s["default"].CollectionView.extend({className:"list-group",childView:o["default"],childViewOptions:function(t){return{collectionView:this,highlighted:t.get("path")===this.highlighted,state:this.options.state}},highlight:function(t){this.highlighted=t,this.render()}})}),define("apps/api-documentation/filters-view",["exports","module","underscore","backbone.marionette","./templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].ItemView.extend({template:Templates["api-documentation-filters"],events:{"change .js-toggle-internal":"toggleInternal"},initialize:function(){this.listenTo(this.options.state,"change:internal",this.render)},toggleInternal:function(){this.options.state.set({internal:!this.options.state.get("internal")})},serializeData:function(){return o["default"].extend(u["default"].ItemView.prototype.serializeData.apply(this,arguments),{state:this.options.state.toJSON()})}})}),define("apps/api-documentation/search-view",["exports","module","underscore","backbone.marionette","./templates"],function(e,t,n,r,i){"use strict";function s(e){return e&&e.__esModule?e:{"default":e}}var o=s(n),u=s(r);t.exports=u["default"].ItemView.extend({template:Templates["api-documentation-search"],ui:{input:".search-box-input"},events:{"keyup @ui.input":"onChange","search @ui.input":"onChange"},initialize:function(){this.query="",this.debouncedFilter=o["default"].debounce(this.filter,250)},onChange:function(){var t=this.ui.input.val();if(t===this.query)return;this.query=this.ui.input.val(),this.debouncedFilter(t)},filter:function(t){this.options.state.set({query:t})}})}),define("apps/api-documentation/app",["exports","module","jquery","backbone","backbone.marionette","./router","./controller","./layout","./list","./list-view","./filters-view","./search-view"],function(e,t,n,r,i,s,o,u,a,f,l,c){"use strict";function h(e){return e&&e.__esModule?e:{"default":e}}var p=h(n),d=h(r),v=h(i),m=h(s),g=h(o),y=h(u),b=h(a),w=h(f),E=h(l),S=h(c),x=new v["default"].Application,T=function(t){this.state=new d["default"].Model({internal:!1}),this.state.match=function(e){var t=new RegExp(this.get("query"),"i");return e.search(t)!==-1},this.layout=new y["default"]({el:t.el}),this.layout.render(),(0,p["default"])("#footer").addClass("search-navigator-footer"),this.list=new b["default"],this.controller=new g["default"]({app:this,state:this.state}),this.listView=new w["default"]({collection:this.list,state:this.state}),this.layout.resultsRegion.show(this.listView),this.filtersView=new E["default"]({collection:this.list,state:this.state}),this.layout.actionsRegion.show(this.filtersView),this.searchView=new S["default"]({state:this.state}),this.layout.searchRegion.show(this.searchView),this.router=new m["default"]({app:this}),d["default"].history.start({pushState:!0,root:t.urlRoot})};x.on("start",function(e){window.requestMessages().done(function(){T.call(x,e)})}),t.exports=x});