!function(){"use strict";document.addEventListener("DOMContentLoaded",(()=>{!function(e){const{activating:t,installing:s,done:n,activationUrl:a,ajaxUrl:i,nonce:o,otterRefNonce:c,otterStatus:r}=riverbankData,d=e(".riverbank-welcome-notice #riverbank-install-otter"),l=e(".riverbank-welcome-notice .notice-dismiss"),u=e(".riverbank-welcome-notice"),v=d.find(".text"),m=d.find(".dashicons"),w=()=>{u.fadeTo(100,0,(()=>{u.slideUp(100,(()=>{u.remove()}))}))},k=async()=>{var s;v.text(t),await(s=a,new Promise((e=>{jQuery.get(s).done((()=>{e({success:!0})})).fail((()=>{e({success:!1})}))}))),await e.post(i,{nonce:c,action:"riverbank_set_otter_ref"}),m.removeClass("dashicons-update"),m.addClass("dashicons-yes"),v.text(n),setTimeout(w,1500)};e(d).on("click",(async()=>{m.removeClass("hidden"),d.attr("disabled",!0),"installed"!==r?(v.text(s),await new Promise((e=>{wp.updates.ajax("install-plugin",{slug:"otter-blocks",success:()=>{e({success:!0})},error:t=>{e({success:!1,code:t.errorCode})}})})),await k()):await k()})),e(l).on("click",(()=>{e.post(i,{nonce:o,action:"riverbank_dismiss_welcome_notice",success:w})}))}(jQuery)}))}();