!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):e.jQuery.xdr=t(e.jquery)}(this,function(e){return function(e){"use strict";e(window.jQuery)}(function(e){"use strict";e.XDR=function(){var t={position:"absolute",width:"0px",height:"0px",top:"-1000px"},o=0,n=function(){return e.ajax({url:e.XDR.domain+"/xdr.json",dataType:"jsonp",data:{_method:"put"},crossDomain:!0})},r=function(t,o){for(var n=e.dataToInputs(o,"hidden"),r=0;r"),u=e(""),p=n();return r(s,a.data),s.css(t),s.attr("action",a.url),u.val(a.type.toLowerCase()),s.prepend(u),p.success(function(t){var o=e("");o.val(t.xdr_token),s.prepend(o),i.resolveWith(s,[t.xdr_token])}),e(document.body).append(s),i},d=function(){var n=e.Deferred(),r=o,a="xdr_form_"+r,d=!1,i=e("");return i.css(t),i.bind("load",function(){d||(d=!0,n.resolveWith(i))}),e(document.body).append(i),n},i=function(t){return e.ajax({url:e.XDR.domain+"/xdr/"+t+".json",dataType:"jsonp",crossDomain:!0})};return function(t){t="object"!=typeof t?{}:t;var o={get:function(){var o=e.Deferred();return t.dataType="jsonp",t.crossDomain=!0,e.ajax(t).done(function(e){"object"==typeof e&&e.status&&e.body?o.reject({headers:{},response:e.body,status:e.status}):o.resolve({response:e,headers:{},status:200})}),o.promise()},post:function(){var o=e.Deferred(),n=a(t,o);return n.done(function(e){var t=d();n=this,t.done(function(){t=this,iframePostLoaded=!1,n.attr("target",t.attr("name")),n.attr("id",t.attr("name")),t.bind("load",function(){iframePostLoaded||(iframePostLoaded=!0,t.remove(),n.remove(),i(e).done(function(e){(e.status+"").match(/2[0-9]+/)?o.resolve(e):o.reject(e)}))}),n.get(0).submit()})}),o.promise()}};return"string"==typeof t.type&&"get"!=t.type.toLowerCase()?o.post():o.get()}}(),e.XDR.domain=window.location.protocol+"//"+window.location.host}),jQuery.xdr});