function escapeHtml(t){return String(t).replace(/[&<>"'\/]/g,function(t){return entityMap[t]})}function removeParentCookie(t){window.parent&&(window.parent.document.cookie=t+"=; Max-Age=-99999999; Path=/;")}var JSON;Array.prototype.to_sentence=function(t){var e=t||"and";return 2==this.length?this.join(" "+e+" "):this.join(", ").replace(/,\s([^,]+)$/,", "+e+" $1")},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var i=e||0,o=this.length;i-1?e:t}function _(t,e){var i=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new r(t.headers)),this.method=t.method,this.mode=t.mode,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new r(e.headers)),this.method=p(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function f(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var i=t.split("="),o=i.shift().replace(/\+/g," "),r=i.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(r))}}),e}function h(t){var e=new r;return t.replace(/\r?\n[\t ]+/," ").split(/\r?\n/).forEach(function(t){var i=t.split(":"),o=i.shift().trim();if(o){var r=i.join(":").trim();e.append(o,r)}}),e}function m(t,e){e||(e={}),this.type="default",this.status="status"in e?e.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new r(e.headers),this.url=e.url||"",this._initBody(t)}if(!t.fetch){var g={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(g.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=function(t){return t&&DataView.prototype.isPrototypeOf(t)},y=ArrayBuffer.isView||function(t){return t&&v.indexOf(Object.prototype.toString.call(t))>-1};r.prototype.append=function(t,o){t=e(t),o=i(o);var r=this.map[t];this.map[t]=r?r+","+o:o},r.prototype["delete"]=function(t){delete this.map[e(t)]},r.prototype.get=function(t){return t=e(t),this.has(t)?this.map[t]:null},r.prototype.has=function(t){return this.map.hasOwnProperty(e(t))},r.prototype.set=function(t,o){this.map[e(t)]=i(o)},r.prototype.forEach=function(t,e){for(var i in this.map)this.map.hasOwnProperty(i)&&t.call(e,this.map[i],i,this)},r.prototype.keys=function(){var t=[];return this.forEach(function(e,i){t.push(i)}),o(t)},r.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),o(t)},r.prototype.entries=function(){var t=[];return this.forEach(function(e,i){t.push([i,e])}),o(t)},g.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},c.call(_.prototype),c.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},m.error=function(){var t=new m(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];m.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new m(null,{status:e,headers:{location:t}})},t.Headers=r,t.Request=_,t.Response=m,t.fetch=function(t,e){return new Promise(function(i,o){var r=new _(t,e),n=new XMLHttpRequest;n.onload=function(){var t={status:n.status,statusText:n.statusText,headers:h(n.getAllResponseHeaders()||"")};t.url="responseURL"in n?n.responseURL:t.headers.get("X-Request-URL");var e="response"in n?n.response:n.responseText;i(new m(e,t))},n.onerror=function(){o(new TypeError("Network request failed"))},n.ontimeout=function(){o(new TypeError("Network request failed"))},n.open(r.method,r.url,!0),"include"===r.credentials&&(n.withCredentials=!0),"responseType"in n&&g.blob&&(n.responseType="blob"),r.headers.forEach(function(t,e){n.setRequestHeader(e,t)}),n.send("undefined"==typeof r._bodyInit?null:r._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),function(){var t,e,i,o,r,n,a={}.hasOwnProperty,s=[].slice;n="undefined"!=typeof exports&&null!==exports?exports:this,(i=function(t){this.message=t}).prototype=new Error,e={GROUP:1,CAT:2,SYMBOL:3,OR:4,STAR:5,LITERAL:6,SLASH:7,DOT:8},t=!1,o=["anchor","trailing_slash","host","port","protocol"],r={configuration:{prefix:"",default_url_options:{},special_options_key:"_options",serializer:null},default_serializer:function(t,e){var i,o,r,n,s,u,d;if(null==e&&(e=null),null==t)return"";if(!e&&"object"!==this.get_object_type(t))throw new Error("Url parameters should be a javascript hash");switch(d=[],this.get_object_type(t)){case"array":for(o=r=0,s=t.length;rt&&void 0===i||null!=i&&"object"===this.get_object_type(i)&&!this.looks_like_serialized_model(i)?(delete(o=e.pop()||{})[this.configuration.special_options_key],o):{}},looks_like_serialized_model:function(t){return!t[this.configuration.special_options_key]&&("id"in t||"to_param"in t)},path_identifier:function(t){var e;if(0===t)return"0";if(!t)return"";if(e=t,"object"===this.get_object_type(t)){if("to_param"in t){if(null==t.to_param)throw new i("Route parameter missing: to_param");e=t.to_param}else if("id"in t){if(null==t.id)throw new i("Route parameter missing: id");e=t.id}else e=t;"function"===this.get_object_type(e)&&(e=e.call(t))}return e.toString()},clone:function(t){var e,i,o;if(null==t||"object"!==this.get_object_type(t))return t;for(o in i=t.constructor(),t)a.call(t,o)&&(e=t[o],i[o]=e);return i},merge:function(){var t,e;if(t=function(t,e){return e(t),t},(null!=(e=1<=arguments.length?s.call(arguments,0):[])?e.length:void 0)>0)return t({},function(t){var i,o,r,n,a,s;for(n=[],i=0,r=e.length;ie.length)throw new Error("Too many parameters provided for path");for(d in g=t||n.length>i.length,_={},c)a.call(c,d)&&(g=!0,this.indexOf(e,d)>=0&&(_[d]=v));for(d in c=this.merge(this.configuration.default_url_options,r,c),m={},(f={}).url_parameters=m,c)a.call(c,d)&&(v=c[d],this.indexOf(o,d)>=0?f[d]=v:m[d]=v);for(s=0,u=0,l=(h=g?e:i).length;u=0},build_path_spec:function(t,i){var o,r,n;switch(null==i&&(i=!1),n=t[0],o=t[1],r=t[2],n){case e.GROUP:return"("+this.build_path_spec(o)+")";case e.CAT:return""+this.build_path_spec(o)+this.build_path_spec(r);case e.STAR:return this.build_path_spec(o,!0);case e.SYMBOL:return!0===i?("*"===o[0]?"":"*")+o:":"+o;case e.SLASH:case e.DOT:case e.LITERAL:return o;default:throw new Error("Unknown Rails node type")}},visit_globbing:function(t,e,i){var o,r;return t[0],o=t[1],t[2],o.replace(/^\*/i,"")!==o&&(t[1]=o=o.replace(/^\*/i,"")),null==(r=e[o])?this.visit(t,e,i):(e[o]=function(){switch(this.get_object_type(r)){case"array":return r.join("/");default:return r}}.call(this),this.visit(t,e,i))},get_prefix:function(){var t;return""!==(t=this.configuration.prefix)&&(t=t.match("/$")?t:t+"/"),t},route:function(t,e,i,o){var n,a,s,u,d,l,c,p;for(p=[],u=[],n=0,a=t.length;n'),l='';u===e||s===e||i.isCrossDomain(r)||(l+=''),a&&d.attr("target",a),d.hide().append(l).appendTo("body"),d.submit()},formElements:function(e,i){return e.is("form")?t(e[0].elements).filter(i):e.find(i)},disableFormElements:function(e){i.formElements(e,i.disableSelector).each(function(){i.disableFormElement(t(this))})},disableFormElement:function(t){var i,o;i=t.is("button")?"html":"val",(o=t.data("disable-with"))!==e&&(t.data("ujs:enable-with",t[i]()),t[i](o)),t.prop("disabled",!0),t.data("ujs:disabled",!0)},enableFormElements:function(e){i.formElements(e,i.enableSelector).each(function(){i.enableFormElement(t(this))})},enableFormElement:function(t){var i=t.is("button")?"html":"val";t.data("ujs:enable-with")!==e&&(t[i](t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.prop("disabled",!1),t.removeData("ujs:disabled")},allowAction:function(t){var e,o=t.data("confirm"),r=!1;if(!o)return!0;if(i.fire(t,"confirm")){try{r=i.confirm(o)}catch(n){(console.error||console.log).call(console,n.stack||n)}e=i.fire(t,"confirm:complete",[r])}return r&&e},blankInputs:function(e,i,o){var r,n,a,s=t(),u=i||"input,textarea",d=e.find(u),l={};return d.each(function(){(r=t(this)).is("input[type=radio]")?(a=r.attr("name"),l[a]||(0===e.find('input[type=radio]:checked[name="'+a+'"]').length&&(n=e.find('input[type=radio][name="'+a+'"]'),s=s.add(n)),l[a]=a)):(r.is("input[type=checkbox],input[type=radio]")?r.is(":checked"):!!r.val())===o&&(s=s.add(r))}),!!s.length&&s},nonBlankInputs:function(t,e){return i.blankInputs(t,e,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(t){var o=t.data("disable-with");o!==e&&(t.data("ujs:enable-with",t.html()),t.html(o)),t.bind("click.railsDisable",function(t){return i.stopEverything(t)}),t.data("ujs:disabled",!0)},enableElement:function(t){t.data("ujs:enable-with")!==e&&(t.html(t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.unbind("click.railsDisable"),t.removeData("ujs:disabled")}},i.fire(o,"rails:attachBindings")&&(t.ajaxPrefilter(function(t,e,o){t.crossDomain||i.CSRFProtection(o)}),t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableFormElement(e)}),t(t.rails.linkDisableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableElement(e)})}),o.on("ajax:complete",i.linkDisableSelector,function(){i.enableElement(t(this))}),o.on("ajax:complete",i.buttonDisableSelector,function(){i.enableFormElement(t(this))}),o.on("click.rails",i.linkClickSelector,function(e){var o=t(this),r=o.data("method"),n=o.data("params"),a=e.metaKey||e.ctrlKey;if(!i.allowAction(o))return i.stopEverything(e);if(!a&&o.is(i.linkDisableSelector)&&i.disableElement(o),i.isRemote(o)){if(a&&(!r||"GET"===r)&&!n)return!0;var s=i.handleRemote(o);return!1===s?i.enableElement(o):s.fail(function(){i.enableElement(o)}),!1}return r?(i.handleMethod(o),!1):void 0}),o.on("click.rails",i.buttonClickSelector,function(e){var o=t(this);if(!i.allowAction(o)||!i.isRemote(o))return i.stopEverything(e);o.is(i.buttonDisableSelector)&&i.disableFormElement(o);var r=i.handleRemote(o);return!1===r?i.enableFormElement(o):r.fail(function(){i.enableFormElement(o)}),!1}),o.on("change.rails",i.inputChangeSelector,function(e){var o=t(this);return i.allowAction(o)&&i.isRemote(o)?(i.handleRemote(o),!1):i.stopEverything(e)}),o.on("submit.rails",i.formSubmitSelector,function(o){var r,n,a=t(this),s=i.isRemote(a);if(!i.allowAction(a))return i.stopEverything(o);if(a.attr("novalidate")===e)if(a.data("ujs:formnovalidate-button")===e){if((r=i.blankInputs(a,i.requiredInputSelector,!1))&&i.fire(a,"ajax:aborted:required",[r]))return i.stopEverything(o)}else a.data("ujs:formnovalidate-button",e);if(s){if(n=i.nonBlankInputs(a,i.fileInputSelector)){setTimeout(function(){i.disableFormElements(a)},13);var u=i.fire(a,"ajax:aborted:file",[n]);return u||setTimeout(function(){i.enableFormElements(a)},13),u}return i.handleRemote(a),!1}setTimeout(function(){i.disableFormElements(a)},13)}),o.on("click.rails",i.formInputClickSelector,function(e){var o=t(this);if(!i.allowAction(o))return i.stopEverything(e);var r=o.attr("name"),n=r?{name:r,value:o.val()}:null,a=o.closest("form");0===a.length&&(a=t("#"+o.attr("form"))),a.data("ujs:submit-button",n),a.data("ujs:formnovalidate-button",o.attr("formnovalidate")),a.data("ujs:submit-button-formaction",o.attr("formaction")),a.data("ujs:submit-button-formmethod",o.attr("formmethod"))}),o.on("ajax:send.rails",i.formSubmitSelector,function(e){this===e.target&&i.disableFormElements(t(this))}),o.on("ajax:complete.rails",i.formSubmitSelector,function(e){this===e.target&&i.enableFormElements(t(this))}),t(function(){i.refreshCSRFTokens()}))}(jQuery),function(t){t(function(){"use strict";var e;t.support.transition=(e=function(){var t,e=document.createElement("bootstrap"),i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(t in i)if(e.style[t]!==undefined)return i[t]}())&&{end:e}})}(window.jQuery),function(t){"use strict";var e=function(e,i){this.options=i,this.$element=t(e).delegate('[data-dismiss="modal"]',"click.dismiss.modal",t.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};e.prototype={constructor:e,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var e=this,i=t.Event("show");this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(t("body").addClass("modal-open"),this.isShown=!0,this.escape(),this.backdrop(function(){var i=t.support.transition&&e.$element.hasClass("fade");e.$element.parent().length||e.$element.appendTo(document.body),e.$element.show(),i&&e.$element[0].offsetWidth,e.$element.addClass("in").attr("aria-hidden",!1).focus(),e.enforceFocus(),i?e.$element.one(t.support.transition.end,function(){e.$element.trigger("shown")}):e.$element.trigger("shown")}))},hide:function(e){e&&e.preventDefault();e=t.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,t("body").removeClass("modal-open"),this.escape(),t(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),t.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var e=this;t(document).on("focusin.modal",function(t){e.$element[0]===t.target||e.$element.has(t.target).length||e.$element.focus()})},escape:function(){var t=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&t.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var e=this,i=setTimeout(function(){e.$element.off(t.support.transition.end),e.hideModal()},500);this.$element.one(t.support.transition.end,function(){clearTimeout(i),e.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(e){var i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=t.support.transition&&i;this.$backdrop=t('