!function(e){function setupHiding(){var t=e(this),i=e(t.data("h5p-visibility-subject-selector")),toggle=function(){i.toggle(t.is(":checked"))};t.change(toggle),toggle()}function setupRevealing(){var t=e(this),i=e("#"+t.data("control"));if(i.data("value")){var a=!1,l=t.html();t.click((function(){a?(i.val(""),t.html(l),a=!1):(i.val(i.data("value")),t.html(t.data("hide")),a=!0)}))}else t.remove()}e(document).ready((function(){e(".h5p-visibility-toggler").each(setupHiding),e(".h5p-reveal-value").each(setupRevealing)}))}(H5P.jQuery);