//>>built
define("dojox/rails",["dojo","dijit","dojox","dojo/require!dojo/NodeList-traverse"],function(b,r,g){b.provide("dojox.rails");b.require("dojo.NodeList-traverse");g.rails.live=function(a,h,k){b.isIE&&h.match(/^(on)?submit$/i)?g.rails.live(a,"click",function(a){a=a.target;var e=a.tagName.toLowerCase();if(("input"==e||"button"==e)&&"submit"==b.attr(a,"type").toLowerCase()&&(a=b.query(a).closest("form"),a.length))var f=b.connect(a[0],"submit",function(a){b.disconnect(f);k.call(a.target,a)})}):b.connect(b.body(),
h,function(f){var e=b.query(f.target).closest(a);e.length&&k.call(e[0],f)})};b.ready(function(a,h,k){return function(){var f=a.query,e=h.live,g=f("meta[name\x3dcsrf-token]").attr("content"),n=f("meta[name\x3dcsrf-param]").attr("content"),m=function(a,c){return b.place('\x3cform style\x3d"display:none" method\x3d"post" action\x3d"'+a+'"\x3e\x3cinput type\x3d"hidden" name\x3d"_method" value\x3d"'+c+'" /\x3e\x3cinput type\x3d"hidden" name\x3d"'+n+'" value\x3d"'+g+'" /\x3e\x3c/form\x3e',b.body())},p=
function(d){a.forEach(d,function(c){if(!a.attr(c,"disabled")){var d="input"==c.tagName.toLowerCase()?"value":"innerHTML",b=a.attr(c,"data-disable-with"),e=a.attr(c,d);a.attr(c,"disabled",!0);a.attr(c,"data-original-value",e);a.attr(c,d,b)}})},q={text:"text",json:"application/json","json-comment-optional":"text","json-comment-filtered":"text",javascript:"application/javascript",xml:"text/xml"},l=function(d){var c=d.target,b=c.tagName.toLowerCase(),e="form"==b.toLowerCase()?a.formToObject(c):{},f=a.attr(c,
"data-type")||"javascript",g=(a.attr(c,"method")||a.attr(c,"data-method")||"get").toLowerCase(),h=a.attr(c,"action")||a.attr(c,"href");"form"!=b&&"get"!=g&&(c=m(h,g),g="POST");d.preventDefault();a.publish("ajax:before",[c]);a.xhr(g,{url:h,headers:{Accept:q[f]},content:e,handleAs:f,load:function(b,d){a.publish("ajax:success",[c,b,d])},error:function(b,d){a.publish("ajax:failure",[c,b,d])},handle:function(b,d){a.publish("ajax:complete",[c,b,d])}});a.publish("ajax:after",[c])};e("*[data-confirm]","click",
function(b){k.confirm(a.attr(b.target,"data-confirm"))?a.attr(b.target,"data-remote")&&l(b):b.preventDefault()});a.subscribe("ajax:complete",function(b){f("*[data-disable-with][disabled]",b).forEach(function(c){var b="input"==c.tagName.toLowerCase()?"value":"innerHTML",d=a.attr(c,"data-original-value");a.attr(c,"disabled",!1);a.attr(c,"data-original-value",null);a.attr(c,b,d)})});e("a[data-remote]:not([data-confirm])","click",l);e("a[data-method]:not([data-remote])","click",function(a){var c=a.target,
c=m(c.href,b.attr(c,"data-method"));a.preventDefault();c.submit()});e("form","submit",function(b){var c=b.target,d=f("*[data-disable-with]",c);d.length&&p(d);a.attr(c,"data-remote")&&(b.preventDefault(),l(b))})}}(b,g.rails,b.global))});