!function(){"use strict";jQuery(document).on("contentloaded",function(e){var t=jQuery(e.target);t.find(".field[data-trigger]").each(function(e,n){var a=jQuery(n),i=a.attr("data-trigger"),r=a.find("input"),d=t.find("[data-trigger-name="+i+"]");if(r.length&&d.length){var c=function(){d.removeClass("selected");var e=r.filter(":checked").val()||0;d.filter('[data-trigger-value="'+e+'"]').addClass("selected")};r.on("change",c),c()}})})}(),function(){"use strict";var e=jQuery(document);e.on("contentloaded",function(e){var t=jQuery(e.target),n=t.find(".field.submission-type input"),a=t.find(".submission");if(n.length&&a.length){var i=function(){var e=n.filter(":checked").val();e&&(a.removeClass("selected"),a.filter('[data-type="'+e+'"]').addClass("selected"))};n.on("change",function(){i()}),i()}}),e.on("contentloaded",function(e){var t=jQuery(e.target),n=t.find(".collision.vehicle .damages"),a=n.find(".scheme svg"),i=n.find(".field"),r=n.find("ol.selection"),d=n.data("selectionRemoveText"),c=function(e){var t=jQuery("#"+e),n=t.find("title").text(),a=jQuery("<li>"+n+'<button class="remove" type="button" title="'+d+'"><span class="text">'+d+"</button></li>");a.data("partId",e),r.append(a)},o=function(e){r.find("li").filter(function(){return jQuery(this).data("partId")==e}).remove()},l=function(){a.on("part:toggle",".part[id]",function(e,t){var n=jQuery(e.target),a=n.attr("id");void 0===t&&(t=!n.is(".selected")),n.toggleClass("selected",t),i.filter('[data-name="'+a+'_damage"]').find("input").prop("checked",t),t?c(a):o(a)}),a.on("part:select",".part[id]",function(e){jQuery(e.target).trigger("part:toggle",!0)}),a.on("part:deselect",".part[id]",function(e){jQuery(e.target).trigger("part:toggle",!1)}),a.on("click",".part[id]",function(e){jQuery(this).trigger("part:toggle")}),n.on("change",'input[type="checkbox"]',function(e){var t=jQuery(this).closest(".field").data("name").replace("_damage","");jQuery("#"+t).click()}),n.on("click","button.remove",function(e){var t=jQuery(this).closest("li");jQuery("#"+t.data("partId")).trigger("part:deselect")})};!function(){r.length||(r=jQuery('<ol class="selection">'),n.append(r)),a.find(".part[id]").each(function(){var e=jQuery(this),t=e.attr("id"),n=i.filter('[data-name="'+t+'_damage"]').find("label").text();if(n&&!e.find("title").length){var a=document.createElementNS("http://www.w3.org/2000/svg","title");jQuery(a).text(n).appendTo(e)}}),l(),i.find("input:checked").trigger("change")}()})}();