/*! phoscon-app 2024-02-26 */

var wizNext,wizDev,wizEventHandler,wiz={stack:[]};function wizInit($modal,modal){wiz.$modal=$modal,modal&&(wiz.modal=document.querySelector(modal)),wiz.btnNext=$modal.find(".btn-next"),wiz.btnPrev=$modal.find(".btn-prev"),wiz.footer=$modal.find(".modal-footer"),wiz.btnNext.off("click"),wiz.btnPrev.off("click"),wiz.btnNext.on("click",function(e){$(this).blur(),e.altKey||$(this).hasClass("disabled")}),wiz.btnPrev.on("click",function(e){$(this).blur(),e.altKey||$(this).hasClass("disabled")})}function wizEnableNextButton(){wiz.btnNext.removeClass("btn-danger"),wiz.btnNext.addClass("btn-primary"),wiz.btnNext.removeClass("btn-default disabled hidden")}function wizEnableNextDangerButton(){wiz.btnNext.addClass("btn-danger"),wiz.btnNext.removeClass("btn-primary"),wiz.btnNext.removeClass("btn-default disabled hidden")}function wizDisableNextButton(){wiz.btnNext.removeClass("btn-primary hidden"),wiz.btnNext.addClass("btn-default disabled")}function wizHideNextButton(){wiz.btnNext.addClass("hidden")}function wizEnablePrevButton(){wiz.btnPrev.removeClass("hidden disabled")}function wizDisablePrevButton(){wiz.btnPrev.removeClass("hidden"),wiz.btnPrev.addClass("disabled")}function wizHidePrevButton(){wiz.btnPrev.addClass("hidden")}function wizResetFooter(){var $info=wiz.footer.find(".info");$info.css("opacity",0),$info.empty(),wiz.footer.removeClass("success danger note warning"),wiz.btnNext.removeClass("btn-danger btn-warning")}function wizShowFooter(infoText){var $info=wiz.footer.find(".info");$info.html(infoText),$info.fadeTo(300,1)}function wizShowSuccessFooter(infoText){wiz.footer.addClass("success");var $info=wiz.footer.find(".info");$info.html(infoText),$info.fadeTo(300,1)}function wizShowWarningFooter(infoText){wiz.footer.addClass("warning");var $info=wiz.footer.find(".info");$info.html(infoText),$info.fadeTo(300,1)}function wizShowInfoFooter(infoText){wiz.footer.addClass("note");var $info=wiz.footer.find(".info");$info.html(infoText),$info.fadeTo(300,.7)}function wizShowDangerFooter(infoText){wiz.footer.addClass("danger");var $info=wiz.footer.find(".info");$info.html(infoText),$info.fadeTo(300,1)}function wizLoadSvg(dest,dev,page){if("#"!==dest[0]&&wiz.modal){dest="#"+wiz.$modal[0].id+" "+dest}var swel=Snap.select(dest);if(!swel)return!1;var data=Snap("#src-sw-svg");swel.clear();var s=data.select(dev);if(!s)return!1;let w=(s=s.clone()).select(".sw-wizzard");w&&w.attr("display","none"),s.parent().attr("display","inline"),swel.append(s),s.attr("display","inline");var bb=s.getBBox(),viewBox=swel.attr("viewBox"),wMargin=swel.attr("data-wmargin");wMargin=wMargin?parseInt(wMargin):310;var bottomMargin=swel.attr("data-bmargin");bottomMargin=bottomMargin?parseInt(bottomMargin):200;var width=Math.floor(bb.width+2*wMargin),height=Math.floor(bb.height+20+bottomMargin);return viewBox.x=Math.floor(bb.x-wMargin),viewBox.y=Math.floor(bb.y-20),viewBox.width=width,viewBox.height=height,swel.attr("viewBox",viewBox),swel.attr("width",width),swel.attr("height",height),(w=s.select(".sw-wizzard"))&&(w.attr("display","inline"),w.selectAll("[data-wizzard-page]").forEach(function(el){var p=el.attr("data-wizzard-page");page!=p?el.attr("display","none"):el.attr("display","inline"),el.selectAll("text").forEach(function(txt){txt.attr("display","none")})})),$(".sw-target").parent().css("display","block"),!0}