diff --git a/publiccms-parent/publiccms/src/main/resources/templates/admin/index.html b/publiccms-parent/publiccms/src/main/resources/templates/admin/index.html
index 6e81558a7..50f72ca6d 100644
--- a/publiccms-parent/publiccms/src/main/resources/templates/admin/index.html
+++ b/publiccms-parent/publiccms/src/main/resources/templates/admin/index.html
@@ -132,6 +132,7 @@
window.TIMYMCE_FILETYPES = "<@sys.configData code='safe'>${object.allow_files!}@sys.configData>";
window.CKEDITOR_BASEPATH = "${(parentSite!site).dynamicPath}resource/plugins/ckeditor/";
window.CKEDITOR_LANGUAGE = "<@t.page 'ckeditor.lang'/>";
+ window.LANGUAGE = "<@t.page 'lang'/>";
window.LOADSCRIPTS_BASE = "${base}";
@@ -141,8 +142,6 @@
-
-
diff --git a/publiccms-parent/publiccms/src/main/webapp/resource/js/jui.min.js b/publiccms-parent/publiccms/src/main/webapp/resource/js/jui.min.js
index 8d3292288..14ee6c00c 100644
--- a/publiccms-parent/publiccms/src/main/webapp/resource/js/jui.min.js
+++ b/publiccms-parent/publiccms/src/main/webapp/resource/js/jui.min.js
@@ -1 +1 @@
-var JUI={version:"1.7.0",regPlugins:[],keyCode:{ENTER:13,ESC:27,END:35,HOME:36,SHIFT:16,TAB:9,LEFT:37,RIGHT:39,UP:38,DOWN:40,DELETE:46,BACKSPACE:8,CHAR_S:83},eventType:{pageClear:"pageClear",editorSync:"editorSync",resizeGrid:"resizeGrid",resizeChart:"resizeChart",initEnvAfter:"initEnvAfter"},isOverAxis:function(x,reference,size){return referenceHttp status: "+xhr.status+" "+xhr.statusText+"ajaxOptions: "+ajaxOptions+"
thrownError: "+thrownError+"
"):alert("Http status: "+xhr.status+" "+xhr.statusText+"\najaxOptions: "+ajaxOptions+"\nthrownError:"+thrownError)},ajaxDone:function(json){json[JUI.keys.statusCode]==JUI.statusCode.error?(json[JUI.keys.message]&&alertMsg&&alertMsg.error(json[JUI.keys.message]),json.fields&&$.each(json.fields.split(","),function(index,field){$("[name="+escapeJquery(field)+"]",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).addClass("error")})):json[JUI.keys.statusCode]==JUI.statusCode.timeout?alertMsg?alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:JUI.loadLogin}):JUI.loadLogin():json[JUI.keys.statusCode]==JUI.statusCode.okAndRefresh?json[JUI.keys.message]&&alertMsg&&alertMsg.correct(json[JUI.keys.message],{callback:function(){window.location.reload()}}):json[JUI.keys.message]&&alertMsg&&alertMsg.correct(json[JUI.keys.message])},init:function(_doc,options){var op=$.extend({loginUrl:"login.html",loginTitle:null,callback:null,debug:!1,statusCode:{}},options);this._set.loginUrl=op.loginUrl,this._set.loginTitle=op.loginTitle,this._set.debug=op.debug,$.extend(JUI.statusCode,op.statusCode),$.extend(JUI.keys,op.keys),$.extend(JUI.pageInfo,op.pageInfo),$.ajax({type:"GET",url:_doc,dataType:"html",cache:!1,error:function(xhr){alert(xhr.statusText)},success:function(html){$($.parseHTML(html,document,!0)).each(function(){var fragId=$(this).attr("id");fragId&&(JUI.frag[fragId]=$(this).text())}),"function"==typeof op.callback&&op.callback()}}),$(window).isBind(JUI.eventType.resizeChart)||$(window).on(JUI.eventType.resizeChart,null,null,function(){$(".chart").each(function(){$chart=$(this),$chart.data("id")&&window[$chart.data("id")]&&"function"==typeof window[$chart.data("id")].resize&&window[$chart.data("id")].resize()})});_doc=$(document);_doc.isBind(JUI.eventType.editorSync)||_doc.on(JUI.eventType.editorSync,null,null,function($box){$box=$box.target,$box=$($box);$("textarea.editor",$box).each(function(){"ckeditor"==$(this).attr("editorType")?CKEDITOR.instances[$(this).data("id")]&&CKEDITOR.instances[$(this).data("id")].updateElement():"tinymce"==$(this).attr("editorType")?tinymce.get($(this).data("id"))&&tinymce.get($(this).data("id")).save():UE.instants[$(this).data("id")]&&UE.instants[$(this).data("id")].sync()}),$("textarea.code",$box).each(function(){JUI.instances[$(this).data("id")]&&JUI.instances[$(this).data("id")].save()}),$(".miscSortDrag",$box).each(function(){var $sortBox=$(this);$sortBox.data("result")&&$sortBox.find($sortBox.data("result")).val(JUI.obj2str($sortBox.miscSortDragData($sortBox)))})}),_doc.isBind(JUI.eventType.pageClear)||_doc.on(JUI.eventType.pageClear,null,null,function($box){$box=$box.target,$box=$($box);$("textarea.editor",$box).each(function(){"ckeditor"==$(this).attr("editorType")?CKEDITOR.instances[$(this).data("id")]&&CKEDITOR.instances[$(this).data("id")].destroy():"tinymce"==$(this).attr("editorType")?tinymce.remove("#"+$(this).data("id")):UE.instants[$(this).data("id")]&&UE.instants[$(this).data("id")].destroy()}),$("textarea.code",$box).each(function(){JUI.instances[$(this).data("id")]&&(JUI.instances[$(this).data("id")].toTextArea(),delete JUI.instances[$(this).data("id")])}),$(".image-editor",$box).each(function(){JUI.instances[$(this).data("id")]&&delete JUI.instances[$(this).data("id")]}),$("[close-url]",$box).each(function(){$.getJSON($(this).attr("close-url"),function(data){})})})}};function html2Escape(sHtml){return Base64.encode(sHtml)}function escapeJquery(srcString){for(var escapseResult=srcString,jsSpecialChars=["\\","^","$","*","?",".","+","(",")","[","]","|","{","}"],jquerySpecialChars=["~","`","@","#","%","&","=","'",'"'," ",":",";","<",">",",","/"],i=0;i]*>/gi,""),tabid=$this.attr("rel")||"_blank",fresh=eval($this.attr("fresh")||"true"),external=eval($this.attr("external")||"false"),url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox:first")),newWindow=navigator.platform.match("Mac")?event.metaKey:event.ctrlKey;return(JUI.debug(url),url.isFinishedTm())?(navTab.openTab(tabid,url,{title:title,fresh:fresh,external:external,focusNewWindow:newWindow}),!1):(alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1)})}),$("a[target=dialog]",$p).each(function(){$(this).click(function(event){var $this=$(this),title=$this.attr("title")||$this.text(),rel=$this.attr("rel")||"_blank",options={},w=$this.attr("width"),h=$this.attr("height");w&&(options.width=w),h&&(options.height=h),options.max=eval($this.attr("max")||"false"),options.mask=eval($this.attr("mask")||"false"),options.maxable=eval($this.attr("maxable")||"true"),options.minable=eval($this.attr("minable")||"true"),options.fresh=eval($this.attr("fresh")||"true"),options.resizable=eval($this.attr("resizable")||"true"),options.drawable=eval($this.attr("drawable")||"true"),options.close=eval($this.attr("close")||""),options.param=$this.attr("param")||"",options.focusNewWindow=navigator.platform.match("Mac")?event.metaKey:event.ctrlKey;var url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox:first"));return(JUI.debug(url),url.isFinishedTm())?($.pdialog.open(url,rel,title,options),!1):(alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1)})}),$("a[target=ajax]",$p).each(function(){$(this).click(function(){var $rel,$this=$(this),rel=$this.attr("rel");return rel&&($rel=$("#"+rel)).loadUrl($this.attr("href"),{},function(){$rel.find("[layoutH]").layoutH()}),!1})}),$.fn.ajaxTodo&&$("a[target=ajaxTodo]",$p).ajaxTodo(),$.fn.dwzExport&&$("a[target=dwzExport]",$p).dwzExport(),$.fn.lookup&&$("a[lookupGroup]",$p).lookup(),$.fn.selectedTodo&&$("a[target=selectedTodo]",$p).selectedTodo()}!function($){$.setRegional=function(key,value){$.regional||($.regional={}),$.regional[key]=value},$.setMessage=function(key,value){JUI._msg[key]=value},$.fn.extend({ajaxUrl:function(op){var $this=$(this);$this.trigger(JUI.eventType.pageClear),$.ajax({type:op.type||"GET",url:op.url,data:op.data,cache:!1,success:function(response){var json=JUI.jsonEval(response);json[JUI.keys.statusCode]==JUI.statusCode.error?json[JUI.keys.message]&&alertMsg.error(json[JUI.keys.message]):json[JUI.keys.statusCode]==JUI.statusCode.timeout?($this.html(response),$.pdialog&&$.pdialog.checkTimeout(),navTab&&navTab.checkTimeout(),alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}})):($this.html(response).initUI(),"function"==typeof op.callback&&op.callback(response))},error:JUI.ajaxError,statusCode:{503:function(xhr,ajaxOptions,thrownError){alert(JUI.msg("statusCode_503")||thrownError)}}})},loadUrl:function(url,data,callback){$(this).ajaxUrl({url:url,data:data,callback:callback})},initUI:function(){return this.each(function(){"function"==typeof initUI&&initUI(this)})},layoutH:function($refBox){return this.each(function(){var $this=$(this),iH=($refBox=$refBox||$this.parents("div.layoutBox").first()).height(),iLayoutH=0;0!=$this.parents(".rightPageContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".rightPageContent")):0!=$this.parents(".leftPageContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".leftPageContent")):0!=$this.parents(".pageFormContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".pageFormContent"))+30:0!=$this.parents(".page").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".page")):0!=$this.parents(".dialogContent").length&&(iLayoutH=$this.getSiblingsElemsH($this.parents(".dialogContent")));iH=50'):$this.outerHeight(iH).css("overflow","auto")})},getSiblingsElemsH:function(tabsHeaderH){var $page=tabsHeaderH,headerH=this.getElemsH($page,".pageHeader"),formBarH=this.getElemsH($page,".formBar"),contentTitleH=this.getElemsH($page,".contentTitle"),gridHeaderH=this.getElemsH($page,".gridHeader"),tabsHeaderH=this.getElemsH($page,".tabsHeader");return headerH+this.getElemsH($page,".pageBar.panelBar")+gridHeaderH+this.getElemsH($page,".panelBar:not(.pageBar)")+formBarH+tabsHeaderH+contentTitleH},getElemsH:function($elem,elem){var h=0,$elem=$elem.find(elem),isSilbinsElem=!0;if(0!=$elem.length&&0==this.find(elem).length){for(var $silbingsElems=this.siblings(),i=0;i<$silbingsElems.length;i++)if(0!=$silbingsElems.eq(i).find(elem).length){isSilbinsElem=!1;break}isSilbinsElem&&(h=$elem.outerHeight(!0))}return h},isTag:function(tn){return!(!tn||null==$(this)[0])&&$(this)[0].tagName.toLowerCase()==tn},isBind:function(type){var _events=$(this).data("events");return _events&&type&&_events[type]}}),$.extend(String.prototype,{isPositiveInteger:function(){return new RegExp(/^[1-9]\d*$/).test(this)},isInteger:function(){return new RegExp(/^\d+$/).test(this)},isNumber:function(value,element){return new RegExp(/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/).test(this)},trimstr:function(){return this.replace(/(^\s*)|(\s*$)|\r|\n/g,"")},startsWith:function(pattern){return 0===this.indexOf(pattern)},endsWith:function(pattern){var d=this.length-pattern.length;return 0<=d&&this.lastIndexOf(pattern)===d},replaceSuffix:function(index){var i=this.lastIndexOf("[");return this.substring(0,i)+this.substring(i).replace(/\[[0-9]+\]/,"["+index+"]").replace("#index#",index)},encodeTXT:function(){return this.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll(" "," ")},replaceAll:function(os,ns){return this.replace(new RegExp(os,"gm"),ns)},replaceTm:function(data){return data?this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){return data[$1.replace(/[{}]+/g,"")]}):this},replaceTmById:function(_box){var $parent=_box||$(document);return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){var $input=$parent.find("#"+$1.replace(/[{}]+/g,""));return $input.val()?$input.val():$1})},isFinishedTm:function(){return!new RegExp("{[A-Za-z_]+[A-Za-z0-9_]*}").test(this)},skipChar:function(ch){return this&&0!==this.length?this.charAt(0)===ch?this.substring(1).skipChar(ch):this:""},isValidPwd:function(){return new RegExp(/^([_]|[a-zA-Z0-9]){6,32}$/).test(this)},isValidMail:function(){return new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.trimstr())},isUrl:function(){return new RegExp(/^([a-zA-z]+:)?\/\/([a-zA-Z0-9\-\.]+)([-\w .\/?%&=:]*)$/).test(this)},isExternalUrl:function(){var domain=document.domain;return""==domain&&(domain="localhost"),this.isUrl()&&-1==this.indexOf("//"+domain)}})}(jQuery),function(){var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(x){return(x<0||9'+t+""}for(t=1;t<=dw.days;t++){var _ctrClass=minDate<=(_date=new Date(dw.year,dw.month-1,t))&&_date<=maxDate?"":"disabled";t==dw.day?dayStr+=''+t+" ":dayStr+=''+t+" "}for(var _date,t=1;t<=42-startDay-dw.days;t++)dayStr+=''+t+" ";var $hour,$minute,$second,$inputs,$days=$(setting.days$).html(dayStr).find("dd");$days.not(".disabled").click(function(){var $day=$(this);dp.hasTime()?($days.removeClass("slt"),$day.addClass("slt")):($this.val(dp.formatDate(dp.changeDay($day.attr("day"),$day.attr("chMonth")))),closeCalendar())}),dp.hasDate()||$(setting.main$).addClass("nodate"),dp.hasTime()&&($("#calendar .time").show(),$hour=dw.hour,$minute=dw.minute,$second=dw.second,dp.opts.defaultTime&&!$this.val()&&(timeStr=dp.opts.defaultTime.split(":"),$hour=parseInt(timeStr[0]),$minute=parseInt(timeStr[1]),$second=parseInt(timeStr[2])),$minute=parseInt($minute/dp.opts.mmStep)*dp.opts.mmStep,$second=dp.hasSecond()?$second:0,$hour=$(setting.hour$).val($hour).focus(function(){changeTmMenu("hh")}),$minute=$(setting.minute$).val($minute).attr("step",dp.opts.mmStep).focus(function(){changeTmMenu("mm")}),$second=$(setting.second$).val($second).attr("step",dp.opts.ssStep).focus(function(){changeTmMenu("ss")}),$hour.add($minute).add($second).click(function(){return!1}),clickTmMenu($hour,"hh"),clickTmMenu($minute,"mm"),clickTmMenu($second,"ss"),$(setting.box$).click(function(){changeTmMenu()}),($inputs=$(setting.tmInputs$)).keydown(keydownInt).each(function(){var $input=$(this);$input.keyup(function(){changeTm($input,0)})}),$(setting.tmUp$).click(function(){$inputs.filter(".slt").each(function(){changeTm($(this),1)})}),$(setting.tmDown$).click(function(){$inputs.filter(".slt").each(function(){changeTm($(this),-1)})}),dp.hasHour()||$hour.attr("disabled",!0),dp.hasMinute()||$minute.attr("disabled",!0),dp.hasSecond()||$second.attr("disabled",!0))}function closeCalendar(){$(setting.box$).remove(),$(document).off("click",null,closeCalendar)}$this.click(function(event){closeCalendar();var dp=new Datepicker($this.val(),opts),offset=$this.offset(),iTop=offset.top+this.offsetHeight;$($.parseHTML(JUI.frag.calendarFrag,document,!0)).appendTo("body").css({left:offset.left+"px",top:iTop+"px"}).show().click(function(event){event.stopPropagation()});var dayNames="";$.each($.regional.datepicker.dayNames,function(i,v){dayNames+=""+v+" "}),$(setting.dayNames$).html(dayNames);var dw=dp.getDateWrap(),$year=$(setting.year$),iBoxH=dp.getMinDate().getFullYear(),yearend=dp.getMaxDate().getFullYear();for(y=iBoxH;y<=yearend;y++)$year.append('"+y+" ");var $month=$(setting.month$);$.each($.regional.datepicker.monthNames,function(m,v){m+=1;$month.append('"+v+" ")}),generateCalendar(dp),$year.add($month).change(function(){dp.changeDate($year.val(),$month.val()),generateCalendar(dp)});iBoxH=$(setting.box$).outerHeight(!0);return iBoxH$(window).height()-iBoxH&&$(setting.box$).css("top",offset.top-iBoxH),$(setting.close$).click(function(){closeCalendar()}),$(setting.clearBut$).click(function(){$this.val(""),closeCalendar()}),$(setting.okBut$).click(function(){var date=$(setting.days$).find("dd.slt");if(date.hasClass("disabled"))return!1;date=dp.changeDay(date.attr("day"),date.attr("chMonth"));dp.hasTime()&&(date.setHours(parseInt($(setting.hour$).val())),date.setMinutes(parseInt($(setting.minute$).val())),date.setSeconds(parseInt($(setting.second$).val()))),$this.val(dp.formatDate(date)),closeCalendar()}),$(document).on("click",null,null,closeCalendar),!1}),$this.next().is(setting.calIcon$)&&$this.next().click(function(){return $this.trigger("click"),!1})})};var Datepicker=function(sDate,now){this.opts=$.extend({pattern:"yyyy-MM-dd",minDate:"1970-01-01",maxDate:"2099-12-31",mmStep:1,ssStep:1},now);now=new Date;this.opts.minDate=now.formatDateTm(this.opts.minDate),this.opts.maxDate=now.formatDateTm(this.opts.maxDate),this.sDate=sDate.trimstr()};$.extend(Datepicker.prototype,{get:function(name){return this.opts[name]},_getDays:function(y,m){return 2==m?y%4||!(y%100)&&y%400?28:29:/4|6|9|11/.test(m)?30:31},_minMaxDate:function(sDate){var _count=sDate.split("-").length-1,_format="y-M-d";return 1==_count?_format="y-M":0==_count&&(_format="y"),sDate.parseDate(_format)},getMinDate:function(){return this._minMaxDate(this.opts.minDate)},getMaxDate:function(){var _day=this.opts.maxDate,_count=_day.split("-").length-1,_date=this._minMaxDate(_day);return _count<2&&(_day=this._getDays(_date.getFullYear(),_date.getMonth()+1),_date.setDate(_day),0==_count&&_date.setMonth(11)),_date},getDateWrap:function(date){var y=(date=date||(this.parseDate(this.sDate)||new Date)).getFullYear(),m=date.getMonth()+1,days=this._getDays(y,m);return{year:y,month:m,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds(),days:days,date:date}},changeDate:function(y,m,date){date=new Date(y,m-1,date||1);return this.sDate=this.formatDate(date),date},changeDay:function(day,chMonth){chMonth=chMonth||0;var dw=this.getDateWrap();return this.changeDate(dw.year,dw.month+parseInt(chMonth),day)},parseDate:function(sDate){return sDate?sDate.parseDate(this.opts.pattern):null},formatDate:function(date){return date.formatDate(this.opts.pattern)},hasHour:function(){return-1!=this.opts.pattern.indexOf("H")},hasMinute:function(){return-1!=this.opts.pattern.indexOf("m")},hasSecond:function(){return-1!=this.opts.pattern.indexOf("s")},hasTime:function(){return this.hasHour()||this.hasMinute()||this.hasSecond()},hasDate:function(){for(var _dateKeys=["y","M","d","E"],i=0;i<_dateKeys.length;i++)if(-1!=this.opts.pattern.indexOf(_dateKeys[i]))return!0;return!1}})}(jQuery),function($){$.scrollPosParents=function($el){var $el=$($el),scrollPos={top:0,left:0};return $el.parents().each(function(){var $p=$(this);scrollPos.top+=$p.scrollTop(),scrollPos.left+=$p.scrollLeft()}),scrollPos},$.fn.jDrag=function(options){return"string"==typeof options&&"destroy"==options?this.each(function(){$(this).off("mousedown",$.rwdrag.start),$.data(this,"pp-rwdrag",null)}):this.each(function(){var select=$(this);$.data($.rwdrag,"pp-rwdrag",{options:$.extend({el:select,obj:select},options)}),options.event?$.rwdrag.start(options.event):(select=options.selector,$(select,obj).on("mousedown",$.rwdrag.start))})},$.rwdrag={start:function(e){document.onselectstart=function(e){return!1};var me=$.data(this,"pp-rwdrag"),el=me.options.el[0];$.data(el,"pp-rwdrag",{options:me.options}),$.rwdrag.current||((me=e).touches&&(me=me.touches[0]),$.rwdrag.current={el:el,oleft:parseInt(el.style.left)||0,otop:parseInt(el.style.top)||0,ox:me.pageX||me.screenX,oy:me.pageY||me.screenY},e.touches?$(document).on("touchend",$.rwdrag.stop).on("touchmove",$.rwdrag.drag):$(document).on("mouseup",$.rwdrag.stop).on("mousemove",$.rwdrag.drag))},drag:function(e){e=e||window.event;var current=$.rwdrag.current,data=$.data(current.el,"pp-rwdrag");me=e,me.touches&&(me=me.touches[0]);var selector,left=current.oleft+(me.pageX||me.clientX)-current.ox,top=current.otop+(me.pageY||me.clientY)-current.oy;return"horizontal"==data.options.move?(data.options.minW&&left>=$(data.options.obj).cssv("left")+data.options.minW&&data.options.maxW&&left<=$(data.options.obj).cssv("left")+data.options.maxW||data.options.scop&&(!data.options.relObj||left-parseInt(data.options.relObj.style.left)>data.options.cellMinW))&&(current.el.style.left=left+"px"):"vertical"==data.options.move?current.el.style.top=top+"px":left>=2*-(selector=data.options.selector?$(data.options.selector,data.options.obj):$(data.options.obj)).outerWidth()/3&&left+selector.outerWidth()/3<$(window).width()&&top+selector.outerHeight()<$(window).height()&&(current.el.style.left=left+"px",current.el.style.top=top+"px"),data.options.drag&&data.options.drag.apply(current.el,[current.el,e]),$.rwdrag.preventEvent(e)},stop:function(e){var current=$.rwdrag.current,data=$.data(current.el,"pp-rwdrag");return e.touches?$(document).off("touchmove",$.rwdrag.drag).off("touchend",$.rwdrag.stop):$(document).off("mousemove",$.rwdrag.drag).off("mouseup",$.rwdrag.stop),data.options.stop&&data.options.stop.apply(current.el,[current.el,e]),$.rwdrag.current=null,document.onselectstart=function(e){return!0},$.rwdrag.preventEvent(e)},preventEvent:function(e){return e.stopPropagation&&e.stopPropagation(),!!e.touches||(e.preventDefault&&e.preventDefault(),!1)}}}(jQuery),function($){var _op={cursor:"move",sortBoxs:"div.sortDrag",items:">.dragItem",selector:"",zIndex:1e3};JUI.sortDrag={_onDrag:!1,start:function($sortBox,$item,event,op){var me=this;if(me._onDrag)return setTimeout(function(){me._onDrag=!1},500),!1;me._onDrag=!0;var $placeholder=this._createPlaceholder($item),$helper=$item.clone(),position=$item.position();$.scrollPosParents($sortBox);return $helper.data("$sortBox",$sortBox).data("op",op).data("$item",$item).data("$placeholder",$placeholder),$helper.addClass("sortDragHelper").css({position:"absolute",top:position.top,left:position.left,zIndex:op.zIndex,width:$item.width()+"px",height:$item.height()+"px"}).jDrag({selector:op.selector,drag:this.drag,stop:this.stop,event:event}),$item.before($placeholder).before($helper).hide(),!1},drag:function(el,event){var $helper=$(el),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$items=$sortBox.find($helper.data("op").items).filter(":visible").filter(":not(.sortDragPlaceholder, .sortDragHelper)"),helperPos=$helper.position(),$overBox=JUI.sortDrag._getOverSortBox($helper);if(1==$sortBox.data("over-sort")&&0<$overBox.length&&$overBox[0]!=$sortBox[0])$placeholder.appendTo($overBox),$helper.data("$sortBox",$overBox);else if($items.length)for(var i=0;i<$items.length;i++){var $this=$items.eq(i),position=$this.position();if(helperPos.top>position.top+10)$this.after($placeholder);else if(helperPos.top<=position.top||helperPos.left<=position.left){$this.before($placeholder);break}}},stop:function(){var $helper=$(arguments[0]),$item=$helper.data("$item"),$placeholder=$helper.data("$placeholder");$item.insertAfter($placeholder).show(),$placeholder.remove(),$helper.remove(),JUI.sortDrag._onDrag=!1},_createPlaceholder:function($item){return $("<"+$item[0].nodeName+' class="sortDragPlaceholder"/>').css({width:$item.outerWidth()+"px",height:$item.outerHeight()+"px",marginTop:$item.css("marginTop"),marginRight:$item.css("marginRight"),marginBottom:$item.css("marginBottom"),marginLeft:$item.css("marginLeft")})},_getOverSortBox:function($item){var op=$item.offset(),y=op.top,x=op.left+$item.width()/2,op=$.extend({},_op,$item.data("op"));return $(op.sortBoxs).filter(":visible").filter(function(){var $sortBox=$(this);return!$sortBox.data("accept")||-1<$sortBox.data("accept").split(",").indexOf($item.data("type"))}).filter(function(){var sortBoxW=$(this),sortBoxPos=sortBoxW.offset(),sortBoxH=sortBoxW.height(),sortBoxW=sortBoxW.width();return JUI.isOver(y,x,sortBoxPos.top,sortBoxPos.left,sortBoxH,sortBoxW)})}},$.fn.sortDrag=function(options){return this.each(function(){var op=$.extend({},_op,options),$sortBox=$(this);$sortBox.attr("selector")&&(op.selector=$sortBox.attr("selector")),$sortBox.find(op.items).each(function(i){var $item=$(this),$selector=$item;op.selector&&($selector=$item.find(op.selector).css({cursor:op.cursor})),op.refresh&&$selector.off("mousedown touchstart"),$selector.on("mousedown touchstart",function(event){$sortBox.hasClass("disabled")||$(event.target).is("input")||$(event.target).is("a")||(JUI.sortDrag.start($sortBox,$item,event,op),event.touchs||event.preventDefault())})}),$sortBox.find(".close").one("mousedown touchstart",function(event){return $(this).parent().remove(),!1})})}}(jQuery),function($){JUI.miscDrag={start:function($sortBox,$item,event,op){var $helper=$item.clone(),position=$item.position();return $helper.addClass("sortDragHelper").css({position:"absolute",top:position.top+$sortBox.scrollTop(),left:position.left,zIndex:op.zIndex,minWidth:$item.width()+"px",height:$item.height()+"px"}).jDrag({drag:this.drag,stop:this.stop,event:event}),$helper.data("$sortBox",$sortBox),$item.before($helper),!1},drag:function(el,event){},stop:function(el,event){var $dragBox,id,sequence,overBoxPos,$helper=$(el),rel=$helper.data("$sortBox"),dragBoxPos=JUI.miscDrag._getOverSortBox($helper);0 div").length,overBoxPos=dragBoxPos.position(),dragBoxPos=$dragBox.position(),$dragBox.css({height:"auto",top:dragBoxPos.top-overBoxPos.top+"px",left:dragBoxPos.left-overBoxPos.left+"px"}),(rel=rel.attr("rel"))&&$('
'+sequence+"
").appendTo(rel)):$helper.remove()},_getOverSortBox:function($item){var op=$item.offset(),y=op.top+$item.height()/2,x=op.left+$item.width()/2,op=$item.data("op");return $(op.sortBoxs).filter(":visible").filter(function(){var $sortBox=$(this);return!$sortBox.data("accept")||-1<$sortBox.data("accept").split(",").indexOf($item.data("type"))}).filter(function(){var sortBoxW=$(this),sortBoxPos=sortBoxW.offset(),sortBoxH=sortBoxW.height(),sortBoxW=sortBoxW.width();return JUI.isOver(y,x,sortBoxPos.top,sortBoxPos.left,sortBoxH,sortBoxW)})},_createPlaceholder:function($item){return $("<"+$item[0].nodeName+' class="sortDragPlaceholder"/>').css({height:$item.outerHeight()+"px",marginTop:$item.css("marginTop"),marginRight:$item.css("marginRight"),marginBottom:$item.css("marginBottom"),marginLeft:$item.css("marginLeft")})},startSortDrag:function($sortBox,$item,event,op){var $placeholder=this._createPlaceholder($item),$helper=$item.clone(),position=$item.position();return $helper.data("$sortBox",$sortBox).data("op",op).data("$item",$item).data("$placeholder",$placeholder),$helper.addClass("sortDragHelper").css({position:"absolute",top:position.top+$sortBox.scrollTop(),left:position.left,zIndex:op.zIndex,width:$item.width()+"px",height:$item.height()+"px"}).jDrag({drag:this.dragSortDrag,stop:this.stopSortDrag,event:event}),$item.before($helper).before($placeholder),!1},dragSortDrag:function(el,event){var $helper=$(el),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$overBox=$helper.parents(".unitBox:first"),position=$helper.position();$helper.css({top:position.top+$overBox.scrollTop()});$overBox=JUI.miscDrag._getOverSortBox($helper);if(0<$overBox.length&&$overBox[0]!=$sortBox[0]){var $items=$overBox.find(">.dragItem").filter(":visible").filter(":not(.sortDragPlaceholder, .sortDragHelper)");if($items.length){helperPos=$helper.offset();for(var i=0;i<$items.length;i++){var $this=$items.eq(i),position=$this.offset();if(helperPos.top>position.top+10)$this.after($placeholder);else if(helperPos.top<=position.top||helperPos.left<=position.left){$this.before($placeholder);break}}}else $placeholder.appendTo($overBox)}},stopSortDrag:function(){var $destBox,$result,$helper=$(arguments[0]),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$item=$helper.data("$item");$placeholder&&$placeholder.is(":visible")?($destBox=$placeholder.parents(".sortDrag:first"),$result=$helper.html(),($result=$(''+$result+"
")).attr("data-id",$helper.data("id")),$result.attr("data-type",$helper.data("type")),$result.insertAfter($placeholder).show(),"function"==typeof initLink&&initLink($result),$placeholder.remove(),$helper.remove(),1!=$sortBox.data("duplicate")&&$item.remove(),$.fn.sortDrag&&$destBox.sortDrag({refresh:!0})):($placeholder.remove(),$helper.remove())}},$.fn.extend({miscDrag:function(options){var op=$.extend({cursor:"move",sortBoxs:"div.miscDrag",items:"> dt .dragBox",zIndex:1e3},options);return this.each(function(){var $box=$(this);$box.find(op.items).each(function(i){var $item=$(this);$item.on("mousedown touchstart",function(event){JUI.miscDrag.start($box,$item,event,op),event.touchs||event.preventDefault()})})})},miscDragData:function(){for(var $miscDrag=$(this),$miscSortDrag=$($miscDrag.attr("rel")),$dragBoxList=$miscDrag.find("dd .dragBox"),$sortDragList=$miscSortDrag.find(".sortDrag"),data=[],i=0;i<$dragBoxList.length;i++){var $dragBox=$dragBoxList.eq(i),$sortDrag=$sortDragList.eq(i),$dragBoxPos=$dragBox.position(),dataItem={id:$dragBox.data("id"),top:parseInt($dragBoxPos.top),left:parseInt($dragBoxPos.left),items:[]};$sortDrag.find(".dragItem").each(function(index){var $dragItem=$(this);$dragItem.position();dataItem.items.push({id:$dragItem.data("id")})}),data.push(dataItem)}return data},miscSortDragData:function(){var $miscSortDrag=$(this);return function fillData($sortDragList){for(var data=[],i=0;i<$sortDragList.length;i++){var $sortDrag=$sortDragList.eq(i),dataItem={items:[]};$sortDrag.data("id")&&(dataItem.id=$sortDrag.data("id")),$sortDrag.find(">.dragItem").each(function(){var $dragItem=$(this),itemData={id:$dragItem.data("id")};$dragItem.find(">.ctl-label>:input").each(function(){var $lable=$(this),lableName=$lable.data("name");lableName&&("checkbox"==$lable.attr("type")?itemData[lableName]=$lable.is(":checked"):itemData[lableName]=$lable.val())}),$dragItemSortDragList=$dragItem.find(">.ctl-label .sortDrag"),$dragItemSortDragList.length&&(itemData.items=fillData($dragItemSortDragList)),dataItem.items.push(itemData)}),data.push(dataItem)}return data}($miscSortDrag.find(".sortDrag[data-parent="+$miscSortDrag.data("id")+"]"))},miscSortDrag:function(options){var op=$.extend({cursor:"move",sortBoxs:"dl.miscSortDrag .sortDrag",items:"> dt .dragItem",zIndex:1e3},options);return this.each(function(){var $sortBox=$(this);$sortBox.find(op.items).each(function(i){var $item=$(this);$item.on("mousedown touchstart",function(event){JUI.miscDrag.startSortDrag($sortBox,$item,event,op),event.touchs||event.preventDefault()})})})}})}(jQuery),function($){$.extend($.fn,{jTree:function(options){var op=$.extend({checkFn:null,selected:"selected",exp:"expandable",coll:"collapsable",firstExp:"first_expandable",firstColl:"first_collapsable",lastExp:"last_expandable",lastColl:"last_collapsable",folderExp:"folder_expandable",folderColl:"folder_collapsable",endExp:"end_expandable",endColl:"end_collapsable",file:"file",ck:"checked",unck:"unchecked",async:"_src"},options);return this.each(function(){var $this=$(this),cnum=$this.children().length;$(">li",$this).each(function(){var $li=$(this),first=!$li.prev()[0],last=!$li.next()[0];$li.genTree({root:$this,icon:$this.hasClass("treeFolder"),ckbox:$this.hasClass("treeCheck"),excludeParent:$this.hasClass("excludeParent"),options:op,level:0,exp:1 '),$("#"+sTarget,$this).val($li.attr("rel"))),$(".ckbox",parent).trigger("click"),event.stopPropagation(),$(document).trigger("click"),!$(this).attr("target"))return!1})},1)})},subTree:function(op,level){return this.each(function(){$(">li",this).each(function(){var $this=$(this),isLast=!$this.next()[0];$this.genTree({root:op.root,icon:op.icon,ckbox:op.ckbox,excludeParent:op.excludeParent,exp:isLast?op.options.lastExp:op.options.exp,coll:isLast?op.options.lastColl:op.options.coll,options:op.options,level:level,space:isLast?null:op.space,showSub:op.showSub,isLast:isLast})})})},genTree:function(options){var op=$.extend({root:options.root,icon:options.icon,ckbox:options.ckbox,excludeParent:options.excludeParent,exp:"",coll:"",showSub:!1,level:0,options:null,isLast:!1},options);return this.each(function(){var node=$(this),tree=$(">ul",node),showIcon=node.parent().prev(),checked="unchecked";op.ckbox&&$(">.checked",showIcon).length<0&&(checked="checked"),0"),showIcon=op.icon&&!tree.hasClass("noFolder"),$(">div",node).prepend((op.ckbox?'
':"")+(showIcon?'
':'
')),0div>div."+op.options.folderColl+",>div>div."+op.options.folderExp+",>div>a",node).click(function(){if(node.attr(op.options.async)&&($.ajax({type:"get",url:node.attr(op.options.async),async:!1,data:{},success:function(response){node.append(response),initLink(tree=$(">ul",node).hide()),$("a",tree).click(function(event){$("div."+op.options.selected,op.root).removeClass(op.options.selected);var parent=$(this).parent().addClass(op.options.selected),$li=$(this).parents("li:first"),sTarget=$li.attr("target");if(sTarget&&(0==$("#"+sTarget,op.root).length&&op.root.prepend(' '),$("#"+sTarget,op.root).val($li.attr("rel"))),$(".ckbox",parent).trigger("click"),event.stopPropagation(),$(document).trigger("click"),!$(this).attr("target"))return!1}),node.removeAttr(op.options.async)},error:JUI.ajaxError}),node.attr(op.options.async)))return!1;$(">li:first",tree).children(":first").isTag("a")&&tree.subTree(op,op.level+1);var isA=$(this).isTag("a"),$this=$(">div>div."+op.coll+",>div>div."+op.exp,node);return isA&&!tree.is(":hidden")||($this.toggleClass(op.exp).toggleClass(op.coll),op.icon&&$(">div>div",node).last().toggleClass(op.options.folderExp).toggleClass(op.options.folderColl)),tree.is(":hidden")?tree.slideDown(100):isA||tree.slideUp(100),!1}),addSpace(op.level,node),op.showSub&&tree.subTree(op,op.level+1)):(node.children().wrap("
"),$(">div",node).prepend((op.ckbox?'
':"")+(op.icon?'
':'
')),op.icon&&$(">div>div."+op.options.file,node).click(function(){return $(this).next().click(),!1}),addSpace(op.level,node)),op.ckbox&&node._check(op),$.support.leadingWhitespace||$(">div",node).click(function(){return $("a",this).trigger("click"),!1})});function addSpace(level,node){if(0';if(1div>div",parent).filter(":first"),prev="";1',next=next.next(),level--;plist=prev+plist}$(">div",node).prepend(plist)}}},_check:function(op){var node=$(this),ckbox=$(">div>.ckbox",node),$input=node.find("a"),tname=$input.attr("tname"),tvalue=$input.attr("tvalue"),attrs="";tname&&(attrs+='name="'+tname+'" '),tvalue&&(attrs+='value="'+tvalue+'" '),ckbox.append(' ").click(function(){var cked=ckbox.hasClass("checked"),aClass=cked?"unchecked":"checked",rClass=cked?"checked":"unchecked";return ckbox.removeClass(rClass).removeClass(cked?"":"indeterminate").addClass(aClass),$("input",ckbox).prop("checked",!cked),$(">ul",node).find("li").each(function(){$("div.ckbox",this).removeClass(rClass).removeClass(cked?"":"indeterminate").addClass(aClass).find("input").prop("checked",!cked)}),$(node)._checkParent(op.excludeParent),!1}),$input.attr("checked")&&(ckbox.find("input").prop("checked",!0),ckbox.removeClass("unchecked").addClass("checked"),$(node)._checkParent(op.excludeParent))},_checkParent:function(excludeParent){var parent,ckbox,aClass,$checkbox;$(this).parent().hasClass("tree")||(parent=$(this).parent().parent(),ckbox=(aClass=$(">ul",parent)).find(">li>a").length+aClass.find("div.ckbox").length,aClass=($checkbox=aClass.find("div.checked").length)==ckbox?"checked":0!=$checkbox?"indeterminate":"unchecked",$checkbox=$checkbox!=ckbox&&0!=$checkbox?"checked":"indeterminate",$(">div>.ckbox",parent).removeClass("unchecked").removeClass("checked").removeClass($checkbox).addClass(aClass),$checkbox=$(":checkbox",parent),"checked"==aClass?($checkbox.prop("checked",!0),$(">div>.ckbox",parent).find("input").prop("checked",!0)):"unchecked"==aClass?$checkbox.removeAttr("checked"):"indeterminate"!=aClass||excludeParent||$(">div>.ckbox",parent).find("input").prop("checked",!0),parent._checkParent(excludeParent))}})}(jQuery),function($){var jmenus={};function completed(cancel){var options;$.data(this,"jui-accordion")&&((options=$.data(this,"jui-accordion").options).running=cancel?0:--options.running,options.running||(options.clearStyle&&options.toShow.add(options.toHide).css({height:"",overflow:""}),$(this).triggerHandler("change.jui-accordion",[options.data],options.change)))}function toggle(toShow,toHide,complete,clickedActive,down){var options=$.data(this,"jui-accordion").options;options.toShow=toShow,options.toHide=toHide,options.data=complete;var callback,scope,complete=(callback=completed,scope=this,function(){return callback.apply(scope,arguments)});options.running=(0==toHide.length?toShow:toHide).length,options.animated?!options.alwaysOpen&&clickedActive?$.jui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoheight:options.autoheight}):$.jui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoheight:options.autoheight}):(!options.alwaysOpen&&clickedActive?toShow.toggle():(toHide.hide(),toShow.show()),complete(!0))}function clickHandler(down){var options=$.data(this,"jui-accordion").options;if(options.disabled)return!1;if(!down.target&&!options.alwaysOpen){options.active.find("h2").toggleClass(options.selectedClass),options.active.find("h2 .icon").toggleClass(options.selectedIconClass);var toHide=options.active.next(),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=options.active=$([]);return toggle.call(this,toShow,toHide,data),!1}var clicked=$(down.target);if(clicked.parents(options.header).length)for(;!clicked.is(options.header);)clicked=clicked.parent();var clickedActive=clicked[0]==options.active[0];if(options.running||options.alwaysOpen&&clickedActive)return!1;if(clicked.is(options.header)){options.active.find("h2").toggleClass(options.selectedClass),options.active.find("h2 .icon").toggleClass(options.selectedIconClass),clickedActive||(clicked.find("h2").addClass(options.selectedClass),clicked.find("h2 .icon").toggleClass(options.selectedIconClass));toShow=clicked.next(),toHide=options.active.next(),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);return options.active=clickedActive?$([]):clicked,toggle.call(this,toShow,toHide,data,clickedActive,down),!1}}function findActive(headers,selector){return null!=selector?"number"==typeof selector?headers.eq(selector):headers.not(headers.not(selector)):!1===selector?$([]):headers.eq(0)}$.jui=$.jui||{},$.fn.extend({accordion:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){var accordion;options.fillSpace&&(jmenus[options.fillSpace]=this),"string"==typeof options?(accordion=$.data(this,"jui-accordion"))[options].apply(accordion,args):$(this).is(".jui-accordion")||$.data(this,"jui-accordion",new $.jui.accordion(this,options))})},activate:function(index){return this.accordion("activate",index)}}),$.jui.accordion=function(container,options){var maxHeight,parent,height,os,obj;this.options=options=$.extend({},$.jui.accordion.defaults,options),this.element=container,$(container).addClass("jui-accordion"),options.headers=$(container).find(options.header),options.active=findActive(options.headers,options.active),options.fillSpace?(parent=options.fillSpace,(obj=jmenus[parent])&&(parent=$(obj).parent(),height=parent.height()-$(".accordionHeader",obj).length*$(".accordionHeader:first-child",obj).outerHeight(),os=parent.children().not(obj),$.each(os,function(i){height-=$(os[i]).outerHeight()}),$(".accordionContent",obj).height(height)),options.autoheight=!0):options.autoheight&&(maxHeight=0,options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight())}).height(maxHeight)),options.headers.not(options.active||"").next().hide(),options.active.find("h2").addClass(options.selectedClass),options.active.find("h2 .icon").addClass(options.selectedIconClass),options.event&&$(container).on(options.event+".jui-accordion",null,null,clickHandler)},$.jui.accordion.prototype={activate:function(index){clickHandler.call(this.element,{target:findActive(this.options.headers,index)[0]})},enable:function(){this.options.disabled=!1},disable:function(){this.options.disabled=!0},destroy:function(){this.options.headers.next().css("display",""),(this.options.fillSpace||this.options.autoheight)&&this.options.headers.next().css("height",""),$.removeData(this.element,"jui-accordion"),$(this.element).removeClass("jui-accordion").off(".jui-accordion")}},$.extend($.jui.accordion,{defaults:{selectedClass:"collapsable",selectedIconClass:"icon-chevron-down",alwaysOpen:!0,animated:"slide",event:"click",header:".accordionHeader",autoheight:!1,running:0},animations:{slide:function(options,additions){var hideHeight,difference;(options=$.extend({easing:"swing",duration:100},options,additions)).toHide.length?(hideHeight=options.toHide.height(),difference=options.toShow.height()/hideHeight,options.toShow.css({height:"0px"}).show(),options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(current){current=(hideHeight-current)*difference;$.support.leadingWhitespace||(current=Math.ceil(current)),options.toShow.height(current)},duration:options.duration,easing:options.easing,complete:function(){options.autoheight||options.toShow.css({height:"auto"}),options.toShow.css({overflow:"auto"}),options.complete()}})):options.toShow.animate({height:"show"},options)},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?200:100})},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:100})}}})}(jQuery),function($){$.fn.navMenu=function(){return this.each(function(){var $box=$(this);$box.find("li>a").click(function(){var $a=$(this);return $a.is("[href^=javascript]")||$("#sidebar #menu").ajaxUrl({type:"get",url:$a.attr("href"),callback:function(response){$box.find("li").removeClass("selected"),$a.parent().addClass("selected")}}),!1})})}}(jQuery),function($){var menu,hash;function hide(){menu.hide()}$.fn.extend({contextMenu:function(id,op){op=$.extend({bindings:{},ctrSub:null},op);menu=menu||$('').appendTo("body").hide(),(hash=hash||[]).push({id:id,bindings:op.bindings||{},ctrSub:op.ctrSub});var index=hash.length-1;return $(this).on("contextmenu",null,null,function(e){return function(posX,trigger,posY){var cur=hash[posX],posX=$(JUI.frag[cur.id]);posX.find("li"),menu.html(posX),$.each(cur.bindings,function(id,func){$('[rel="'+id+'"]',menu).on("click",null,null,function(e){hide(),func($(trigger),$("#"+cur.id))})});posX=posY.pageX,posY=posY.pageY;$(window).width() '),jThemeLi=$(this).find(">li");return jThemeLi.each(function(index){var $this=$(this),themeName=$this.attr("class");themeName==op.defaultTheme&&($this.addClass("selected"),$(".theme").prop("class","theme "+themeName)),$this.addClass(themeName).click(function(){setTheme(themeName)})}),"function"==typeof $.cookie&&$.cookie("dwz_theme")&&setTheme($.cookie("dwz_theme")),$themeItem.appendTo($("head")),this}})}(jQuery);var navTab={componentBox:null,_tabBox:null,_prevBut:null,_nextBut:null,_panelBox:null,_moreBut:null,_moreBox:null,_currentIndex:0,_op:{id:"navTab",step:4,stTabBox:".navTab-tab",stPanelBox:".navTab-panel",mainTabId:"main",close$:"a.close",prevClass:"tabsLeft",nextClass:"tabsRight",stMore:".tabsMore",stMoreLi:"ul.tabsMoreList"},init:function(options){$.History&&$.History.init();var $this=this;$.extend(this._op,options),this.componentBox=$("#"+this._op.id),this.step=this._op.step,this._tabBox=this.componentBox.find(this._op.stTabBox),this._panelBox=this.componentBox.find(this._op.stPanelBox),this._prevBut=this.componentBox.find("."+this._op.prevClass),this._nextBut=this.componentBox.find("."+this._op.nextClass),this._moreBut=this.componentBox.find(this._op.stMore),this._moreBox=this.componentBox.find(this._op.stMoreLi),this._prevBut.click(function(event){$this._scrollPrev()}),this._nextBut.click(function(event){$this._scrollNext()}),this._moreBut.click(function(){return $this._moreBox.show(),!1}),$(document).click(function(){$this._moreBox.hide()}),this._contextmenu(this._tabBox),this._contextmenu(this._getTabs()),this._init(),this._ctrlScrollBut()},_init:function(){var $this=this;this._getTabs().each(function(iTabIndex){$(this).off("click").click(function(event){$this._switchTab(iTabIndex)}),$(this).find(navTab._op.close$).off("click").click(function(){$this._closeTab(iTabIndex)})}),this._getMoreLi().each(function(iTabIndex){$(this).find(">a").off("click").click(function(event){$this._switchTab(iTabIndex)})}),this._switchTab(this._currentIndex)},_contextmenu:function($obj){var $this=this;$obj.contextMenu("navTabCM",{bindings:{reload:function(t,m){$this._reload(t,!0)},closeCurrent:function(tabId,m){tabId=tabId.attr("tabid");tabId?$this.closeTab(tabId):$this.closeCurrentTab()},closeOther:function(index,m){index=$this._indexTabId(index.attr("tabid"));$this._closeOtherTab(0 li")},_getPanels:function(){return this._panelBox.find("> div")},_getMoreLi:function(){return this._moreBox.find("> li")},_getTab:function(index){index=this._indexTabId(index);if(0<=index)return this._getTabs().eq(index)},getPanel:function(index){index=this._indexTabId(index);if(0<=index)return this._getPanels().eq(index)},_getTabsW:function(iStart,iEnd){return this._tabsW(this._getTabs().slice(iStart,iEnd))},_tabsW:function($tabs){var iW=0;return $tabs.each(function(){iW+=$(this).outerWidth(!0)}),iW},_indexTabId:function(tabid){if(!tabid)return-1;var iOpenIndex=-1;return this._getTabs().each(function(index){$(this).attr("tabid")==tabid&&(iOpenIndex=index)}),iOpenIndex},_getLeft:function(){return this._tabBox.position().left},_getScrollBarW:function(){return this.componentBox.width()-90},_visibleStart:function(){for(var iLeft=this._getLeft(),iW=0,$tabs=this._getTabs(),i=0;i<$tabs.length;i++){if(0<=iW+iLeft)return i;iW+=$tabs.eq(i).outerWidth(!0)}return 0},_visibleEnd:function(){for(var iLeft=this._getLeft(),iW=0,$tabs=this._getTabs(),i=0;i<$tabs.length;i++)if((iW+=$tabs.eq(i).outerWidth(!0))+iLeft>this._getScrollBarW())return i;return $tabs.length},_scrollPrev:function(){var iStart=this._visibleStart();iStart>=this.step?this._scrollTab(-this._getTabsW(0,iStart-this.step)):0=this._visibleEnd()&&this._scrollTab(this._getScrollBarW()-this._getTabs().eq(this._currentIndex).outerWidth(!0)-this._getTabsW(0,this._currentIndex))},_ctrlScrollBut:function(){var iW=this._tabsW(this._getTabs());this._getScrollBarW()>iW?(this._prevBut.hide(),this._nextBut.hide(),this._tabBox.parent().removeClass("tabsPageHeaderMargin")):(this._prevBut.show().removeClass("tabsLeftDisabled"),this._nextBut.show().removeClass("tabsRightDisabled"),this._tabBox.parent().addClass("tabsPageHeaderMargin"),0<=this._getLeft()?this._prevBut.addClass("tabsLeftDisabled"):this._getLeft()<=this._getScrollBarW()-iW+.5&&this._nextBut.addClass("tabsRightDisabled"))},_switchTab:function(iTabIndex){var $tab=this._getTabs().removeClass("selected").eq(iTabIndex).addClass("selected");this._getPanels().each(function(){$(".iframe-box",$(this)).length?$(this).css("visibility","hidden").height(0):$(this).hide()});var currentPanel=this._getPanels().eq(iTabIndex);"hidden"===currentPanel.css("visibility")?currentPanel.css("visibility","visible").css("height","auto"):currentPanel.show(),this._getMoreLi().removeClass("selected").eq(iTabIndex).addClass("selected"),this._currentIndex=iTabIndex,this._scrollCurrent(),this._reload($tab)},_closeTab:function(index,openIndex){this._getTabs().eq(index).remove(),this._getPanels().eq(index).trigger(JUI.eventType.pageClear).remove(),this._getMoreLi().eq(index).remove(),this._currentIndex>=index&&this._currentIndex--,!openIndex||0<(openIndex=this._indexTabId(openIndex))&&(this._currentIndex=openIndex),this._init(),this._scrollCurrent(),this._reload(this._getTabs().eq(this._currentIndex))},closeTab:function(index){index=this._indexTabId(index);0'),this._getTabs().eq(this._currentIndex).after($(' ').attr("tabid",tabid).prepend($(' ').attr("title",op.title).text(op.title))),this._getMoreLi().eq(this._currentIndex).after($(" ").append($(' ').attr("title",op.title).text(op.title))),$tab=($tabs=this._getTabs()).eq(this._currentIndex+1),$panel=this._getPanels().eq(this._currentIndex+1),op.external||url.isExternalUrl()?($tab.addClass("external"),navTab.openExternal(url,$panel)):($tab.removeClass("external"),$panel.ajaxUrl({type:"GET",url:url,data:op.data,callback:function(){navTab._loadUrlCallback($panel)}})),$.History&&setTimeout(function(){$.History.addHistory(tabid,function(i){i=navTab._indexTabId(i);0<=i&&navTab._switchTab(i)},tabid)},10),this._currentIndex=this._currentIndex+1,this._contextmenu($tabs.eq(this._currentIndex))),this._init(),this._scrollCurrent(),this._getTabs().eq(this._currentIndex).attr("url",url)}};!function($){$.fn.extend({tabs:function(options){var op=$.extend({reverse:!1,eventType:"click",currentIndex:0,stTabHeader:"> .tabsHeader",stTab:">.tabsHeaderContent>ul",stTabPanel:"> .tabsContent",ajaxClass:"j-ajax",closeClass:"close",prevClass:"tabsLeft",nextClass:"tabsRight"},options);return this.each(function(){!function initTab(jT){var jSelector=jT.add($("> *",jT));var jTabHeader=$(op.stTabHeader,jSelector);var jTabs=$(op.stTab+" li",jTabHeader);var jGroups=$(op.stTabPanel+" > *",jSelector);jTabs.off().find("a").off();jTabHeader.find("."+op.prevClass).off();jTabHeader.find("."+op.nextClass).off();jTabs.each(function(iTabIndex){op.currentIndex==iTabIndex?$(this).addClass("selected"):$(this).removeClass("selected"),"hover"==op.eventType?$(this).on("mouseenter",function(event){switchTab(jT,iTabIndex)}):$(this).click(function(event){switchTab(jT,iTabIndex)}),$("a",this).each(function(){$(this).hasClass(op.ajaxClass)?$(this).click(function(event){var jGroup=jGroups.eq(iTabIndex);this.href&&!jGroup.attr("loaded")&&jGroup.loadUrl(this.href,{},function(){jGroup.find("[layoutH]").layoutH(),jGroup.attr("loaded",!0)}),event.preventDefault()}):$(this).hasClass(op.closeClass)&&$(this).click(function(event){return jTabs.eq(iTabIndex).remove(),jGroups.eq(iTabIndex).remove(),iTabIndex==op.currentIndex?op.currentIndex=iTabIndex+1 *",jTabs)),jGroups=$(op.stTabHeader,jTab),jTabs=$(op.stTab+" li",jGroups),jGroups=$(op.stTabPanel+" > *",jTab),jTab=jTabs.eq(iTabIndex);jGroups.eq(iTabIndex);op.reverse&&jTab.hasClass("selected")?(jTabs.removeClass("selected"),jGroups.hide()):(op.currentIndex=iTabIndex,jTabs.removeClass("selected"),jTab.addClass("selected"),jGroups.hide().eq(op.currentIndex).show())}}})}(jQuery),$.setRegional("alertMsg",{title:{error:"Error",info:"Information",warn:"Warning",correct:"Successful",confirm:"Confirmation"},butMsg:{ok:"OK",yes:"Yes",no:"No",cancel:"Cancel"}});var alertMsg={_boxId:"#alertMsgBox",_bgId:"#alertBackground",_closeTimer:null,_types:{error:"error",info:"info",warn:"warn",correct:"correct",confirm:"confirm"},_getTitle:function(key){return $.regional.alertMsg.title[key]},_keydownOk:function(event){if(event.keyCode==JUI.keyCode.ENTER||event.keyCode==JUI.keyCode.BACKSPACE)return event.data.target.trigger("click"),!1},_keydownEsc:function(event){event.keyCode==JUI.keyCode.ESC&&event.data.target.trigger("click")},_open:function(type,boxHtml,buttons){$(this._boxId).remove();var butsHtml="";if(buttons)for(var i=0;i',document,!0)).appendTo("body")),form.target="callbackframe",_iframeResponse($iframe[0],callback||JUI.ajaxDone)}function _iframeResponse(iframe,callback){var $iframe=$(iframe),$document=$(document);$document.trigger("ajaxStart"),$iframe.on("load",null,null,function(event){if($iframe.off("load"),$document.trigger("ajaxStop"),'javascript:"%3Chtml%3E%3C/html%3E";'!=iframe.src&&'javascript:"";'!=iframe.src){var response,doc=iframe.contentDocument||iframe.document;if(!(doc.readyState&&"complete"!=doc.readyState||doc.body&&"false"==doc.body.innerHTML)){if(doc.XMLDocument)response=doc.XMLDocument;else if(doc.body)try{response=$iframe.contents().find("body").text(),response=JSON.parse(response)}catch(e){response=doc.body.innerHTML}else response=doc;callback(response)}}})}function navTabAjaxDone(json){var $pagerForm;JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&(json.navTabId?"page"==json.rel?navTab.reloadFlag(json.navTabId,2):navTab.reloadFlag(json.navTabId):0!=($pagerForm=$(".pagerForm",navTab.getCurrentPanel())).length&&$pagerForm.submit(),"closeCurrent"==json.callbackType?setTimeout(function(){navTab.closeCurrentTab(json.navTabId)},100):"forward"==json.callbackType?json.navTabId?navTab.reload(json.forwardUrl,{navTabId:json.navTabId}):navTab.reload(json.forwardUrl):"forwardConfirm"==json.callbackType&&alertMsg.confirm(json.confirmMsg||JUI.msg("forwardConfirmMsg"),{okCall:function(){navTab.reload(json.forwardUrl)},cancelCall:function(){navTab.closeCurrentTab(json.navTabId)}}))}function dialogAjaxDone(json){var $pagerForm;JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&(json.navTabId?navTab.reload(json.forwardUrl,{navTabId:json.navTabId}):(navTab.getCurrentPanel(),0!=($pagerForm=$(".pagerForm",navTab.getCurrentPanel())).length&&$pagerForm.submit()),"closeCurrent"==json.callbackType&&$.pdialog.closeCurrent())}function navTabSearch($form,navTabId){$form=$($form);return navTab.reload($form.attr("action"),{data:$form.serializeArray(),navTabId:navTabId}),!1}function dialogSearch(form){var $form=$(form);return form[JUI.pageInfo.pageNum]&&(form[JUI.pageInfo.pageNum].value=1),$.pdialog.reload($form.attr("action"),{data:$form.serializeArray()}),!1}function divSearch(form,rel){var $box,$form=$(form);return form[JUI.pageInfo.pageNum]&&(form[JUI.pageInfo.pageNum].value=1),rel&&($box=$("#"+rel)).ajaxUrl({type:"POST",url:$form.attr("action"),data:$form.serializeArray(),callback:function(){$box.find("[layoutH]").layoutH()}}),!1}function _getPagerForm(form,args){form=$(".pagerForm",form).get(0);return form&&(args.pageNum&&(form[JUI.pageInfo.pageNum].value=args.pageNum),args.numPerPage&&(form[JUI.pageInfo.numPerPage].value=args.numPerPage),args.orderField&&(form[JUI.pageInfo.orderField].value=args.orderField),args.orderDirection&&form[JUI.pageInfo.orderDirection]&&(form[JUI.pageInfo.orderDirection].value=args.orderDirection)),form}function dwzPageBreak(params){var $box,form,op=$.extend({targetType:"navTab",rel:"",data:{pageNum:"",numPerPage:"",orderField:"",orderDirection:""},callback:null},params),params="dialog"==op.targetType?$.pdialog.getCurrent():navTab.getCurrentPanel();op.rel?(form=_getPagerForm($box=params.find("#"+op.rel),op.data))&&$box.ajaxUrl({type:"POST",url:$(form).attr("action"),data:$(form).serializeArray(),callback:function(){$box.find("[layoutH]").layoutH()}}):(form=_getPagerForm(params,op.data),params=$(form).serializeArray(),"dialog"==op.targetType?form&&$.pdialog.reload($(form).attr("action"),{data:params,callback:op.callback}):form&&navTab.reload($(form).attr("action"),{data:params,callback:op.callback}))}function navTabPageBreak(args,rel){dwzPageBreak({targetType:"navTab",rel:rel,data:args})}function dialogPageBreak(args,rel){dwzPageBreak({targetType:"dialog",rel:rel,data:args})}function ajaxTodo(url,callback){var $callback=callback||navTabAjaxDone;"function"!=typeof $callback&&($callback=eval("("+callback+")")),$.ajax({type:"POST",url:url,dataType:"json",cache:!1,success:$callback,error:JUI.ajaxError})}function uploadifyQueueComplete(queueData){var msg="The total number of files uploaded: "+queueData.uploadsSuccessful+" The total number of errors while uploading: "+queueData.uploadsErrored+" The total number of bytes uploaded: "+queueData.queueBytesUploaded+" The average speed of all uploaded files: "+queueData.averageSpeed;queueData.uploadsErrored?alertMsg.error(msg):alertMsg.correct(msg)}function uploadifySuccess(file,data,response){alert(data)}function uploadifyError(file,errorCode,errorMsg){alertMsg.error(errorCode+": "+errorMsg)}function uploadifyError(event,queueId,fileObj,errorObj){alert("event:"+event+"\nqueueId:"+queueId+"\nfileObj.name:"+fileObj.name+"\nerrorObj.type:"+errorObj.type+"\nerrorObj.info:"+errorObj.info)}!function($){$.pdialog={_op:{height:500,width:850,minH:40,minW:50,total:20,max:!1,mask:!1,resizable:!0,drawable:!0,maxable:!0,minable:!0,focusNewWindow:!1,fresh:!0},_current:null,_zIndex:42,getCurrent:function(){return this._current},reload:function(url,options){var jDContent,op=$.extend({data:{},dialogId:"",callback:null},options),dialog=op.dialogId&&$("body").data(op.dialogId)||this._current;dialog&&(jDContent=dialog.find(".dialogContent")).ajaxUrl({type:"POST",url:url,data:op.data,callback:function(response){jDContent.find("[layoutH]").layoutH(jDContent),$(":button.close",dialog).click(function(){return $.pdialog.close(dialog),!1}),"function"==typeof op.callback&&op.callback(response)}})},open:function(url,dlgid,title,options){var jDContent,op=$.extend({},$.pdialog._op,options),dialog=$("body").data(dlgid);dialog&&!op.focusNewWindow?(dialog.is(":hidden")&&dialog.show(),op.max&&($.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy")),!op.fresh&&url==dialog.data("url")||(dialog.data("url",url),dialog.find(".dialogHeader").find("h1").text(title),this.switchDialog(dialog),(jDContent=dialog.find(".dialogContent")).loadUrl(url,{},function(){jDContent.find("[layoutH]").layoutH(jDContent),$("button.close").click(function(){return $.pdialog.close(dialog),!1})}))):(op.focusNewWindow&&(dlgid+=Math.round(1e7*Math.random())),dialog=$($.parseHTML(JUI.frag.dialogFrag,document,!0)).appendTo($("body")),(dialog=$(dialog)).data("id",dlgid),dialog.data("url",url),options.close&&dialog.data("close",options.close),options.param&&dialog.data("param",options.param),dialog.find(".dialogHeader").find("h1").text(title),dialog.css("zIndex",$.pdialog._zIndex+=2),$.pdialog._init(dialog,options),dialog.click(function(){$.pdialog.switchDialog(dialog)}),op.resizable&&dialog.jresize(),op.drawable&&dialog.dialogDrag(),$("a.close",dialog).click(function(event){return $.pdialog.close(dialog),!1}),op.maxable?$("a.maximize",dialog).show().click(function(event){return $.pdialog.switchDialog(dialog),$.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy"),!1}):$("a.maximize",dialog).hide(),$("a.restore",dialog).click(function(event){return $.pdialog.restore(dialog),dialog.jresize().dialogDrag(),!1}),op.minable?$("a.minimize",dialog).show().click(function(event){return $.pdialog.minimize(dialog),!1}):$("a.minimize",dialog).hide(),$("div.dialogHeader a",dialog).mousedown(function(){return!1}),$("div.dialogHeader",dialog).dblclick(function(){($("a.restore",dialog).is(":hidden")?$("a.maximize",dialog):$("a.restore",dialog)).trigger("click")}),op.max&&($.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy")),$("body").data(dlgid,dialog),$.pdialog._current=dialog,(jDContent=$(".dialogContent",dialog)).loadUrl(url,{},function(){jDContent.find("[layoutH]").layoutH(jDContent),$("button.close").click(function(){return $.pdialog.close(dialog),!1})})),op.mask?(dialog.css("zIndex",1e3),$("a.minimize",dialog).hide(),dialog.data("mask",!0),$("#dialogBackground").show()):op.minable&&$.taskBar.addDialog(dlgid,title)},switchDialog:function(dialog){var cindex,index=dialog.css("zIndex");$.pdialog._current&&(cindex=$($.pdialog._current).css("zIndex"),$.pdialog._current.css("zIndex",index),dialog.css("zIndex",cindex),$.pdialog._current=dialog),$.taskBar.switchTask(dialog.data("id"))},_init:function(dialog,height){var iTop=$.extend({},this._op,height),height=iTop.height>iTop.minH?iTop.height<$(document).height()?iTop.height:$(document).height():iTop.minH,iTop=iTop.width>iTop.minW?iTop.width<$(document).width()?iTop.width:$(document).width():iTop.minW;(isNaN(dialog.height())||dialog.height()=$(window).height()-$(".dialogHeader",$(height.options.dialog)).outerHeight())return!1;var target=height.options.target,width=current.owidth,height=current.oheight;return"n"!=target&&"s"!=target&&(width+=0<=target.indexOf("w")?-lmove:lmove),width>=$.pdialog._op.minW&&(0<=target.indexOf("w")&&(current.el.style.left=current.oleft+lmove+"px"),"n"!=target&&"s"!=target&&(current.el.style.width=width+"px")),"w"!=target&&"e"!=target&&(height+=0<=target.indexOf("n")?-tmove:tmove),height>=$.pdialog._op.minH&&(0<=target.indexOf("n")&&(current.el.style.top=current.otop+tmove+"px"),"w"!=target&&"e"!=target&&(current.el.style.height=height+"px")),$.layerdrag.preventEvent(e)},stop:function(e){var current=$.layerdrag.current,data=$.data(current.el,"layer-drag");return $(document).off("mousemove",null,$.layerdrag.drag),$(document).off("mouseup",null,$.layerdrag.stop),data.options.stop&&data.options.stop.apply(current.el,[current.el]),$.layerdrag.current=null,$.layerdrag.preventEvent(e)},preventEvent:function(e){return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}}}(jQuery),function($){$.fn.jTable=function(options){return this.each(function(){for(var $table=$(this),nowrapTD=$table.attr("nowrapTD"),tlength=$table.width(),aStyles=[],$tc=$table.parent().addClass("j-resizeGrid"),oldThs=$table.find("thead>tr:last-child").find("th"),i=0,l=oldThs.length;i');var $grid=$table.parent().html($table.html()),thead=$grid.find("thead");thead.wrap('');var ths=$(">tr:last-child",thead),ths=$(">th",ths);$("th",thead).each(function(){var $th=$(this);$th.html(''+$th.html()+"
")}),ths.each(function(style){var $th=$(this),style=aStyles[style];$th.addClass(style[1]).removeAttr("align").removeAttr("width").width(style[0])}).filter("[orderField]").orderBy({targetType:$table.attr("targetType"),rel:$table.attr("rel"),asc:$table.attr("asc")||"asc",desc:$table.attr("desc")||"desc",orderField:$table.attr("orderField"),orderType:$table.attr("orderType")});var tbody=$grid.find(">tbody");tbody.wrap('');var ftr=$(">tr:first-child",tbody);tbody.find(">tr").each(function(){for(var $tr=$(this),$ftds=$(">td",this),i=0;i<$ftds.length;i++){var $ftd=$($ftds[i]);"false"!=nowrapTD&&$ftd.html(""+$ftd.html()+"
"),itr.selected").removeClass("selected"),$tr.addClass("selected");var sTarget=$tr.attr("target");sTarget&&(0==$("#"+sTarget,$grid).length&&$grid.prepend(' '),$("#"+sTarget,$grid).val($tr.attr("rel")))}),$(".edit",$tr).length?$tr.dblclick(function(){$(".edit",$tr).eq(0).click()}):$(".icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).length&&$tr.dblclick(function(){$(".icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).eq(0).parent().click()})}),$(">td",ftr).each(function(i){i
');var scroller=$(".gridScroller",$grid);scroller.scroll(function(event){var scroll,header=$(".gridThead",$grid);return 0tr",thead).each(function(){$(">th",this).each(function(i){var th=this,$th=$(this);$th.mouseover(function(offset){offset=$.jTableTool.getOffset(th,offset).offsetX;return $th.outerWidth()-offset<5?$th.css("cursor","col-resize").mousedown(function(event){$(".resizeProxy",$grid).show().css({left:$.jTableTool.getRight(th)-$(".gridScroller",$grid).scrollLeft(),top:$.jTableTool.getTop(th),height:$.jTableTool.getHeight(th,$grid),cursor:"col-resize"}),$(".resizeMarker",$grid).show().css({left:$.jTableTool.getLeft(th)+1-$(".gridScroller",$grid).scrollLeft(),top:$.jTableTool.getTop(th),height:$.jTableTool.getHeight(th,$grid)}),$(".resizeProxy",$grid).jDrag($.extend(options,{scop:!0,cellMinW:20,relObj:$(".resizeMarker",$grid)[0],move:"horizontal",event:event,stop:function(){var newW=$(".resizeProxy",$grid).position().left-$(".resizeMarker",$grid).position().left-$th.outerWidth()-9,$table2=($.jTableTool.getColspan($th),$.jTableTool.getCellNum($th)),oldW=$th.width(),newW=$th.width()+newW,$table2=$(">td",ftr).eq($table2-1);$th.width(newW+"px"),$table2.width(newW+"px");$table2=$(thead).parent();$table2.width($table2.width()-oldW+newW+"px");$table2=$(tbody).parent();$table2.width($table2.width()-oldW+newW+"px"),$(".resizeMarker,.resizeProxy",$grid).hide()}}))}):($th.css("cursor",$th.attr("orderField")?"pointer":"default"),$th.off("mousedown")),!1})})}),$(window).off(JUI.eventType.resizeGrid).on("resizeGrid",null,null,function(){$("div.j-resizeGrid").each(function(){var width=$(this).innerWidth();width&&($("div.gridScroller",this).width(width+"px"),width-20>$("div.gridHeader>.gridThead>table",this).width()&&($("div.gridHeader>.gridThead>table",this).width(width-20+"px"),$("div.gridScroller>.gridTbody>table",this).width(width-20+"px")))})})})},$.jTableTool={getLeft:function(obj){var width=0;return $(obj).prevAll().each(function(){width+=$(this).outerWidth()}),width-1},getRight:function(obj){var width=0;return $(obj).prevAll().addBack().each(function(){width+=$(this).outerWidth()}),width-1},getTop:function(obj){var height=0;return $(obj).parent().prevAll().each(function(){height+=$(this).outerHeight()}),height},getHeight:function(obj,parent){var height=0;return $(obj).parent().nextAll().addBack().each(function(){height+=$(this).outerHeight()}),$(".gridTbody",parent).children().each(function(){height+=$(this).outerHeight()}),height},getCellNum:function(obj){return $(obj).prevAll().addBack().length},getColspan:function(obj){return $(obj).attr("colspan")||1},getStart:function(obj){var start=1;return $(obj).prevAll().each(function(){start+=parseInt($(this).attr("colspan")||1)}),start},getPageCoord:function(element){for(var coord={x:0,y:0};element;)coord.x+=element.offsetLeft,coord.y+=element.offsetTop,element=element.offsetParent;return coord},getOffset:function(evtset_offsetX,eventCoord_y){if(/msie/.test(navigator.userAgent.toLowerCase())){var pageCoord=$(evtset_offsetX).offset(),evtset_offsetX=eventCoord_y.pageX||eventCoord_y.screenX,eventCoord_x=eventCoord_y.pageY||eventCoord_y.screenY;return{offsetX:evtset_offsetX-pageCoord.left,offsetY:eventCoord_x-pageCoord.top}}eventCoord_x=eventCoord_y.target;null==eventCoord_x.offsetLeft&&(eventCoord_x=eventCoord_x.parentNode);pageCoord=$.jTableTool.getPageCoord(eventCoord_x),eventCoord_x=window.pageXOffset+eventCoord_y.clientX,eventCoord_y=window.pageYOffset+eventCoord_y.clientY;return{offsetX:eventCoord_x-pageCoord.x,offsetY:eventCoord_y-pageCoord.y}}}}(jQuery),function($){$.fn.extend({cssTable:function(options){return this.each(function(){var $this=$(this),$trs=$this.find("tbody>tr"),$grid=$this.parent();$trs.each(function(index){var $tr=$(this);$tr.click(function(){$this.find("tbody>tr.selected").removeClass("selected"),$tr.addClass("selected");var sTarget=$tr.attr("target");sTarget&&(0==$("#"+sTarget,$grid).length&&$grid.prepend(' '),$("#"+sTarget,$grid).val($tr.attr("rel")))}),$(".edit",$tr).length?$tr.dblclick(function(){$(".edit",$tr).eq(0).click()}):$(".panelBar .icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).length&&$tr.dblclick(function(){$(".panelBar .icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).eq(0).parent().click()})}),$this.find("thead [orderField]").orderBy({targetType:$this.attr("targetType"),rel:$this.attr("rel"),asc:$this.attr("asc")||"asc",desc:$this.attr("desc")||"desc",orderField:$this.attr("orderField"),orderType:$this.attr("orderType")})})}})}(jQuery),function($){$.fn.extend({orderBy:function(options){var op=$.extend({targetType:"navTab",rel:"",asc:"asc",desc:"desc",orderType:"",orderField:""},options);return this.each(function(){var $this=$(this).click(function(){var orderField=$this.attr("orderField"),orderDirection=$this.hasClass(op.asc)?op.desc:op.asc;dwzPageBreak({targetType:op.targetType,rel:op.rel,data:{orderField:orderField,orderDirection:orderDirection}})});op.orderField==$this.attr("orderField")?op.asc==op.orderType?$this.addClass(op.asc):op.desc==op.orderType?$this.addClass(op.desc):$this.addClass("order"):$this.addClass("order")})}})}(jQuery),function($){$.fn.extend({jTask:function(options){return this.each(function(){var $task=$(this),id=$task.attr("id");$task.click(function(e){var dialog=$("body").data(id);return $task.hasClass("selected")?$("a.minimize",dialog).trigger("click"):$(dialog).is(":hidden")?$.taskBar.restoreDialog(dialog):$(dialog).trigger("click"),$.taskBar.scrollCurrent($(this)),!1}),$("div.close",$task).click(function(e){return $.pdialog.close(id),!1})})}}),$.taskBar={_taskBar:null,_taskBox:null,_prevBut:null,_nextBut:null,_op:{id:"taskbar",taskBox:"div.taskbarContent",prevBut:".taskbarLeft",prevDis:"taskbarLeftDisabled",nextBut:".taskbarRight",nextDis:"taskbarRightDisabled",selected:"selected",boxMargin:"taskbarMargin"},init:function(options){var $this=this;$.extend(this._op,options),this._taskBar=$("#"+this._op.id),0==this._taskBar.length&&(this._taskBar=$($.parseHTML(JUI.frag.taskbar,document,!0)).appendTo($("body")),this._taskBar.find(".taskbarLeft"),this._taskBar.find(".taskbarRight")),this._taskBox=this._taskBar.find(this._op.taskBox),this._taskList=this._taskBox.find(">ul"),this._prevBut=this._taskBar.find(this._op.prevBut),this._nextBut=this._taskBar.find(this._op.nextBut),this._prevBut.click(function(e){$this.scrollLeft()}),this._nextBut.click(function(e){$this.scrollRight()}),this._contextmenu(this._taskBox)},_contextmenu:function(obj){$(obj).contextMenu("dialogCM",{bindings:{closeCurrent:function(obj,m){obj=obj.isTag("li")?obj:$.taskBar._getCurrent();$("div.close",obj).trigger("click")},closeOther:function(selector,m){var selector=selector.isTag("li")?"#"+selector.attr("id"):".selected",tasks=$.taskBar._taskList.find(">li:not(:"+selector+")");tasks.each(function(i){$("div.close",tasks[i]).trigger("click")})},closeAll:function(t,m){var tasks=$.taskBar._getTasks();tasks.each(function(i){$("div.close",tasks[i]).trigger("click")})}},ctrSub:function(t,mOther){var mCur=mOther.find('[rel="closeCurrent"]'),mOther=mOther.find('[rel="closeOther"]');$.taskBar._getCurrent()[0]?1==$.taskBar._getTasks().length&&mOther.addClass("disabled"):(mCur.addClass("disabled"),mOther.addClass("disabled"))}})},_scrollCurrent:function(){var $this,left;this._tasksW(this._getTasks())>this._getTaskBarW()?(left=$(">li:last-child",($this=this)._taskList),left=this._getTaskBarW()-left.position().left-left.outerWidth(!0),this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()})):this._ctrlScrollBut()},_getTaskBarW:function(){return this._taskBox.width()-(this._prevBut.is(":hidden")?this._prevBut.width()+2:0)-(this._nextBut.is(":hidden")?this._nextBut.width()+2:0)},_scrollTask:function(task){var left,$this=this;task.position().left+this._getLeft()+task.outerWidth()>this._getBarWidth()?(left=this._getTaskBarW()-task.position().left-task.outerWidth(!0)-2,this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()})):task.position().left+this._getLeft()<0&&(left=this._getLeft()-(task.position().left+this._getLeft()),this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()}))},_ctrlScrollBut:function(){var iW=this._tasksW(this._getTasks());this._getTaskBarW()>iW?(this._taskBox.removeClass(this._op.boxMargin),this._nextBut.hide(),this._prevBut.hide(),this._getTasks().eq(0)[0]&&this._scrollTask(this._getTasks().eq(0))):(this._taskBox.addClass(this._op.boxMargin),this._nextBut.show().removeClass(this._op.nextDis),this._prevBut.show().removeClass(this._op.prevDis),0<=this._getLeft()&&this._prevBut.addClass(this._op.prevDis),this._getLeft()<=this._getTaskBarW()-iW&&this._nextBut.addClass(this._op.nextDis))},_getLeft:function(){return this._taskList.position().left},_visibleStart:function(){for(var iLeft=this._getLeft(),jTasks=this._getTasks(),i=0;ithis._getBarWidth())return jTasks.eq(i);return jTasks.eq(jTasks.length-1)},_getTasks:function(){return this._taskList.find(">li")},_tasksW:function(jTasks){var iW=0;return jTasks.each(function(){iW+=$(this).outerWidth(!0)}),iW},_getBarWidth:function(){return this._taskBar.innerWidth()},addDialog:function(id,title){this.show();var task=$("#"+id,this._taskList);task[0]?$(">div.taskbutton",task).text(title):(this._taskList.append('#title#
'.replace("#taskid#",id).replace("#title#",title)),(task=$("#"+id,this._taskList)).jTask()),this._contextmenu(task),this.switchTask(id),this._scrollTask(task)},closeDialog:function(obj){("string"==typeof obj?$("#"+obj,this._taskList):obj).remove(),0==this._getTasks().length&&this.hide(),this._scrollCurrent()},restoreDialog:function(task){var dialog="string"==typeof task?$("body").data(task):task,id="string"==typeof task?task:dialog.data("id"),task=$.taskBar.getTask(id);$(".resizable").css({top:$(window).height()-60,left:$(task).position().left,height:$(task).outerHeight(),width:$(task).outerWidth()}).show().animate({top:$(dialog).css("top"),left:$(dialog).css("left"),width:$(dialog).css("width"),height:$(dialog).css("height")},250,function(){$(this).hide(),$(dialog).show(),$.pdialog._current=dialog}),$.taskBar.switchTask(id)},inactive:function(id){$("#"+id,this._taskList).removeClass("selected")},scrollLeft:function(){var task=this._visibleStart();this._scrollTask(task)},scrollRight:function(){var task=this._visibleEnd();this._scrollTask(task)},scrollCurrent:function(task){this._scrollTask(task)},switchTask:function(id){this._getCurrent().removeClass("selected"),this.getTask(id).addClass("selected")},_getCurrent:function(){return this._taskList.find(">.selected")},getTask:function(id){return $("#"+id,this._taskList)},show:function(){this._taskBar.is(":hidden")&&(this._taskBar.css("top",$(window).height()-34+this._taskBar.outerHeight()).show(),this._taskBar.animate({top:$(window).height()-this._taskBar.outerHeight()},500))},hide:function(){this._taskBar.animate({top:$(window).height()-29+this._taskBar.outerHeight(!0)},500,function(){$.taskBar._taskBar.hide()})}}}(jQuery),function($){$.extend({History:{_hash:new Array,_currentHash:"",_callback:void 0,init:function(iframe){$.History._callback=iframe;var current_hash=location.hash.replace(/\?.*$/,"");$.History._currentHash=current_hash,$.support.leadingWhitespace||(""==$.History._currentHash&&($.History._currentHash="#"),$("body").append(''),(iframe=(iframe=$("#jQuery_history")[0]).contentDocument||iframe.contentWindow.document).open(),iframe.close(),iframe.location.hash=current_hash),"function"==typeof this._callback&&$.History._callback(current_hash.skipChar("#")),setInterval($.History._historyCheck,100)},_historyCheck:function(){var current_hash="";(current_hash=($.support.leadingWhitespace?location:$("#jQuery_history")[0].contentWindow.location).hash.skipChar("#").replace(/\?.*$/,""))!=$.History._currentHash&&($.History._currentHash=current_hash,$.History.loadHistory(current_hash))},addHistory:function(hash,fun,iframe){$.History._currentHash=hash,$.History._hash.push([hash,fun,iframe]),$.support.leadingWhitespace||((iframe=(iframe=$("#jQuery_history")[0]).contentDocument||iframe.contentWindow.document).open(),iframe.close(),iframe.location.hash=hash.replace(/\?.*$/,"")),location.hash=hash.replace(/\?.*$/,"")},loadHistory:function(hash){$.support.leadingWhitespace||(location.hash=hash);for(var i=0;i<$.History._hash.length;i+=1)if($.History._hash[i][0]==hash)return void $.History._hash[i][1]($.History._hash[i][2])}}})}(jQuery),$.fn.extend({ajaxTodo:function(){return this.each(function(){var $this=$(this);$this.click(function(event){var url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox").first());if(JUI.debug(url),!url.isFinishedTm())return alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1;var title=$this.attr("title");title?alertMsg.confirm(title,{okCall:function(){ajaxTodo(url,$this.attr("callback"))}}):ajaxTodo(url,$this.attr("callback")),event.preventDefault()})})},dwzExport:function(){function _doExport(url){var $form="dialog"==url.attr("targetType")?$.pdialog.getCurrent():navTab.getCurrentPanel(),$form=$(".pagerForm",$form),url=url.attr("href");window.location=url+(-1==url.indexOf("?")?"?":"&")+$form.serialize()}return this.each(function(){var $this=$(this);$this.click(function(event){var title=$this.attr("title");title?alertMsg.confirm(title,{okCall:function(){_doExport($this)}}):_doExport($this),event.preventDefault()})})}}),function($){var _lookup={currentGroup:"",suffix:"",$target:null,pk:"id",nextButton:null},_util={_lookupPrefix:function(key){var strDot=_lookup.currentGroup?".":"";return _lookup.currentGroup+strDot+key},lookupPk:function(key){return this._lookupPrefix(key)},lookupSuffix:function(){return _lookup.suffix}};function suggest(args,key,$input){""!==_util.lookupSuffix()&&$input.attr("suffix")!==_util.lookupSuffix()||($input.hasClass("editor")?"ckeditor"==$input.attr("editorType")?CKEDITOR.instances[$input.data("id")].setData(args[key]):("tinymce"==$input.attr("editorType")?tinymce.get($input.data("id")):UE.instants[$input.data("id")]).setContent(args[key]):$input.hasClass("code")?JUI.instances[$(this).data("id")].setValue(args[key]):$input.val(args[key]).trigger("change"))}$.extend({bringBackSuggest:function(args,keys){var $box=_lookup.$target.parents(".unitBox").first();if(keys)$.each(keys,function(n,key){$box.find(":input[name="+escapeJquery(_util.lookupPk(key))+"]").each(function(){for(var k in args)_lookup.suffix=k,suggest(args,k,$(this))})});else for(var key in args)$box.find(":input[name="+escapeJquery(_util.lookupPk(key))+"]").each(function(){suggest(args,key,$(this))})},bringBack:function(json){json[JUI.keys.statusCode]==JUI.statusCode.error?json[JUI.keys.message]&&alertMsg.error(json[JUI.keys.message]):json[JUI.keys.statusCode]==JUI.statusCode.timeout?alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}}):($.bringBackSuggest(json),$.pdialog.closeCurrent())},batchBringBack:function(args,keys){if(_lookup.nextButton){if(args[JUI.keys.statusCode]==JUI.statusCode.timeout)alertMsg.error(args[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}});else for(var row in args){if(_lookup.nextButton.click(),args[row][JUI.keys.statusCode]==JUI.statusCode.error){args[row][JUI.keys.message]&&alertMsg.error(args[row][JUI.keys.message]);break}$.bringBackSuggest(args[row],keys)}_lookup.nextButton=null}$.pdialog.closeCurrent()}}),$.fn.extend({lookup:function(){return this.each(function(){var $this=$(this),options={mask:!0,width:$this.attr("width")||820,height:$this.attr("height")||500,maxable:eval($this.attr("maxable")||"true"),resizable:eval($this.attr("resizable")||"true")};$this.click(function(url){_lookup=$.extend(_lookup,{currentGroup:$this.attr("lookupGroup")||"",suffix:$this.attr("suffix")||"",$target:$this,pk:$this.attr("lookupPk")||""});url=$this.attr("href").replaceTmById($(url.target).parents(".unitBox").first());return url.isFinishedTm()?$.pdialog.open(url,"_blank",$this.attr("title")||$this.text(),options):alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1})})},multLookup:function(){return this.each(function(){var $this=$(this),args={};$this.click(function(event){return $this.parents(".unitBox").first().find('[name="'+$this.attr("multLookup")+'"]').filter(":checked").each(function(){var key,_args=JUI.jsonEval($(this).val());for(key in _args){var value=args[key]?args[key]+",":"";args[key]=value+_args[key]}}),$.isEmptyObject(args)?alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")):$.bringBack(args),!1})})},suggest:function(){var op_suggest$="#suggest",selectedIndex=-1;return this.each(function(){var callbackFields,$input=$(this).attr("autocomplete","off").keydown(function(event){if(event.keyCode==JUI.keyCode.ENTER&&$(op_suggest$).is(":visible"))return!1}),suggestFields=$input.attr("suggestFields").split(",");function _show(event){var url=$input.offset(),postData=url.top+this.offsetHeight,$suggest=$(op_suggest$);($suggest=0==$suggest.length?$('
').appendTo($("body")):$suggest).css({left:url.left+"px",top:postData+"px"}).show(),_lookup=$.extend(_lookup,{currentGroup:$input.attr("lookupGroup")||"",suffix:$input.attr("suffix")||"",$target:$input,pk:$input.attr("lookupPk")||""});url=$input.attr("suggestUrl").replaceTmById($(event.target).parents(".unitBox").first());if(!url.isFinishedTm())return alertMsg.error($input.attr("warn")||JUI.msg("alertSelectMsg")),!1;postData={};return postData[$input.attr("postField")||"inputValue"]=$input.val(),$.ajax({global:!1,type:"POST",dataType:"json",url:url,cache:!1,data:postData,success:function($lis){if($lis){var html="";$.each($lis,function(i){for(var key,liAttr="",liLabel="",i=0;i'+liLabel+""});$lis=$suggest.html("").find("li");if($lis.click(function(){_select($(this),callbackFields),$input.next().hasClass("suggestButton")&&$input.next().click()}),0==$lis.length){$suggest.hide();for(var jsonStr="",i=0;i=$items.length-1?selectedIndex=-1:selectedIndex++;break;case JUI.keyCode.UP:selectedIndex<0?selectedIndex=$items.length-1:selectedIndex--;break;default:_show(event)}$items.removeClass("selected"),0<=selectedIndex&&_select($items.eq(selectedIndex).addClass("selected"),callbackFields)})})},itemDetail:function(){return this.each(function(){var $table=$(this).css("clear","both"),$tbody=$table.find("tbody"),fields=[];$table.find("thead th[type]").each(function(i){var field=$(this),field={type:field.attr("type")||"text",patternDate:field.attr("dateFmt")||"yyyy-MM-dd",name:field.attr("name")||"",suffix:field.attr("suffix")||"",defaultVal:escapeHtml(field.attr("defaultVal")||""),size:field.attr("size")||"12",enumUrl:field.attr("enumUrl")||"",lookupGroup:field.attr("lookupGroup")||"",lookupUrl:field.attr("lookupUrl")||"",lookupPk:field.attr("lookupPk")||"id",suggestUrl:field.attr("suggestUrl"),suggestFields:field.attr("suggestFields"),postField:field.attr("postField")||"",fieldClass:field.attr("fieldClass")||"",fieldAttrs:field.attr("fieldAttrs")||"",title:field.text(),pkValue:field.attr("pkValue")};fields.push(field)}),$tbody.find("a.btnDel").click(function(){var $btnDel=$(this);return $btnDel.is("[href^=javascript]")?($btnDel.parents("tr").first().remove(),initSuffix($tbody)):$btnDel.attr("title")?alertMsg.confirm($btnDel.attr("title"),{okCall:delDbData}):delDbData(),!1;function delDbData(){$.ajax({type:"POST",dataType:"json",url:$btnDel.attr("href"),cache:!1,success:function(){$btnDel.parents("tr").first().remove(),initSuffix($tbody)},error:JUI.ajaxError})}});var $caption,$addBut,batchUrl,$rowNum,trTm,batchButtonTxt=$table.attr("addButton")||"Add New";batchButtonTxt&&($caption=$(" ").appendTo($table),$addBut=$(''+batchButtonTxt+" ").appendTo($caption).find("button"),batchButtonTxt=$table.attr("batchButton")||"Batch upload",(batchUrl=$table.attr("batchUrl"))?$(''+batchButtonTxt+" ").initUI().appendTo($caption).find("a").click(function(){_lookup=$.extend(_lookup,{nextButton:$addBut})}):$rowNum=$(' ').appendTo($caption).find("input"),trTm="",$addBut.click(function(){trTm=trTm||function(fields){var html="";return $(fields).each(function(){html+=function(field){var html="",suffixFrag=field.suffix?' suffix="'+field.suffix+'"':"",attrFrag="";if(field.fieldAttrs){var key,attrs=JUI.jsonEval(field.fieldAttrs);for(key in attrs)attrFrag+=key+'="'+attrs[key]+'" '}switch(field.type){case"del":html=' ';break;case"lookup":var strDot,suggestFrag="";field.suggestFields&&(suggestFrag='autocomplete="off" lookupGroup="'+field.lookupGroup+'"'+suffixFrag+' lookupPk="'+field.lookupPk+'" suggestUrl="'+field.suggestUrl+'" suggestFields="'+field.suggestFields+'" postField="'+field.postField+'"'),field.lookupPk&&(strDot=field.lookupGroup?".":"",html+=' '),html+='"+field.title+" ";break;case"attach":html='"+field.title+" ";break;case"enum":$.ajax({type:"POST",dataType:"html",async:!1,url:field.enumUrl,data:{inputName:field.name,lookupPk:field.lookupPk,pkValue:field.pkValue},success:function(response){html=response}});break;case"date":html=' ";break;case"checkbox":html=' ";break;case"textarea":html='";break;case"number":html=' ";break;default:html=' "}return""+html+" "}(this)}),''+html+" "}(fields);var rowNum=1;if(!batchUrl)try{rowNum=parseInt($rowNum.val())}catch(e){}for(var i=0;itr.selected").removeClass("selected"),$tr.addClass("selected")})}initSuffix($tbody);var $batch=$tr.find(".btnAttach");$batch.length?_lookup=$.extend(_lookup,{currentGroup:$batch.attr("lookupGroup")||"",suffix:$batch.attr("suffix")||"",$target:$batch,pk:$batch.attr("lookupPk")||""}):!_lookup.nextButton||($batch=$tr.find("[batchGroup]")).length&&(_lookup=$.extend(_lookup,{currentGroup:$batch.attr("batchGroup")||"",suffix:$batch.attr("suffix")||"",$target:$batch,pk:$batch.attr("lookupPk")||""}))}))});function initSuffix($tbody){$tbody.find(">tr").each(function(i){$(":input, a.btnLook, a.btnAttach",this).each(function(){var $this=$(this),suffix=$this.attr("name"),val=$this.val();suffix&&$this.attr("name",suffix.replaceSuffix(i));suffix=$this.attr("lookupGroup");suffix&&$this.attr("lookupGroup",suffix.replaceSuffix(i));suffix=$this.attr("batchGroup");suffix&&$this.attr("batchGroup",suffix.replaceSuffix(i));suffix=$this.attr("suffix");suffix&&$this.attr("suffix",suffix.replaceSuffix(i)),val&&0<=val.indexOf("#index#")&&$this.val(val.replace("#index#",i+1))})})}},selectedTodo:function(){function _getIds(selectedIds,targetType){var ids="";return("dialog"==targetType?$.pdialog.getCurrent():navTab.getCurrentPanel()).find("input:checked").filter('[name="'+selectedIds+'"]').each(function(i){var val=$(this).val();ids+=0==i?val:","+val}),ids}return this.each(function(){var $this=$(this),selectedIds=$this.attr("rel")||"ids",postType=$this.attr("postType")||"map";$this.click(function(){var targetType=$this.attr("targetType"),ids=_getIds(selectedIds,targetType);if(!ids)return alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1;var _callback=$this.attr("callback")||("dialog"==targetType?dialogAjaxDone:navTabAjaxDone);function _doPost(){$.ajax({type:"POST",url:$this.attr("href"),dataType:"json",cache:!1,data:function(){if("map"==postType)return $.map(ids.split(","),function(val,i){return{name:selectedIds,value:val}});var _data={};return _data[selectedIds]=ids,_data}(),success:_callback,error:JUI.ajaxError})}"function"!=typeof _callback&&(_callback=eval("("+_callback+")"));var title=$this.attr("title");return title?alertMsg.confirm(title,{okCall:_doPost}):_doPost(),!1})})}})}(jQuery),function($){function _onchange(event){var $ref=$("select[name="+escapeJquery(event.data.$this.attr("ref"))+"]");if(0==$ref.length)return!1;event.data.$this.attr("index")&&($ref=$ref.eq(event.data.$this.attr("index"))),$.ajax({type:"POST",dataType:"json",url:event.data.$this.attr("refUrl").replace("{value}",encodeURIComponent(event.data.$this.val())),cache:!1,data:{},success:function(json){var $refCombox;json&&($ref.empty(),$.each(json,function(i){json[i]&&1").attr("value",json[i][0]).text(json[i][1]).appendTo($ref)}),$refCombox=$ref.parents("div.combox:first"),$ref.insertAfter($refCombox),$refCombox.remove(),$ref.trigger("change").combox())},error:JUI.ajaxError})}var allSelectBox=[],killAllBox=function(bid){$.each(allSelectBox,function(i){allSelectBox[i]!=bid&&($("#"+allSelectBox[i])[0]?$("#op_"+allSelectBox[i]).css({height:"",width:""}).hide():$("#op_"+allSelectBox[i]).remove(),$("#"+allSelectBox[i]).children("a").removeClass("expand"),$(document).off("click",null,killAllBox))})};$.extend($.fn,{comboxSelect:function(options){var op=$.extend({selector:">a"},options);return this.each(function(){var box=$(this),selector=$(op.selector,box);allSelectBox.push(box.attr("id")),$(op.selector,box).click(function(){var top,left,options=$("#op_"+box.attr("id")),optionlist=$("ul",options);return options.is(":hidden")?(box.children("a").addClass("expand"),600$(window).height()-20&&(top=top-box.outerHeight(!0)-options.outerHeight(!0)-1),(left=box.offset().left)+options.outerWidth(!0)>$(window).width()&&(left=$(window).width()-options.outerWidth(!0)-1),options.css({top:top,left:left}).show(),$("a.selected",options).length&&0==optionlist.scrollTop()&&optionlist.stop().animate({scrollTop:$("a.selected",optionlist).offset().top+60-options.height()-optionlist.offset().top},500),$(".search input",options).focus().keyup(function(){var val=$(this).val();val?($("li",optionlist).hide(),$("li a:contains("+escapeJquery(val)+")",optionlist).parent().show(),$("li a",optionlist).each(function(){-1<$(this).attr("value").indexOf(val)&&$(this).parent().show()})):$("li",optionlist).show(),$("li.disabled",optionlist).hide()}).click(function(){return!1}).val(""),$("li",optionlist).show(),$("li.disabled",optionlist).hide(),killAllBox(box.attr("id")),$(document).click(killAllBox)):($(document).off("click",null,killAllBox),killAllBox()),!1}),$("#op_"+box.attr("id")).find(" li").comboxOption(selector,box)})},comboxOption:function(selector,box){return this.each(function(){$(">a",this).click(function(){var $this=$(this);$this.parent().parent().find(".selected").removeClass("selected"),$this.addClass("selected"),selector.text($this.text()),$("select",box).val()!=$this.attr("value")&&$("select",box).val($this.attr("value")).trigger("change")})})},combox:function(){var _selectBox=[];return $.each(allSelectBox,function(i){$("#"+allSelectBox[i])[0]?_selectBox.push(allSelectBox[i]):$("#op_"+allSelectBox[i]).remove()}),allSelectBox=_selectBox,this.each(function(i){var $this=$(this).removeClass("combox"),select=$this.parents("div.combox:first");select.length&&($this.insertAfter(select),select.remove()),$this.hasClass("requiredIfNotEmpty")&&(0==$("option",$this).length||1==$("option",$this).length&&!$("option",$this).val()?$this.removeClass("required"):$this.addClass("required"));var name=$this.attr("name"),value=$this.val(),label="";void 0!==value&&value?label=$("option[value="+escapeJquery(value)+"]",$this).text():""==value&&(label=$('option[value=""]',$this).text());var ref=$this.attr("ref"),refUrl=$this.attr("refUrl")||"",cid=$this.attr("id")||Math.round(1e7*Math.random()),select='";var options='",$("body").append(options),$this.after(select),$("div.select",$this.next()).comboxSelect().append($this),ref&&refUrl&&$this.off("change",null,_onchange).on("change",null,{$this:$this},_onchange)})},comboxDisable:function(){return this.each(function(){$(this).parents(".combox .select:first").addClass("disabled")})},comboxEnable:function(){return this.each(function(){$(this).parents(".combox .select:first").removeClass("disabled")})},comboxVal:function(val){return this.each(function(){var $box=$(this).parents(".combox .select:first");$("#op_"+$box.attr("id")).find('li a[value="'+escapeJquery(val)+'"]').trigger("click")})}})}(jQuery),function($){$.fn.extend({checkboxCtrl:function(parent){return this.each(function(){var $trigger=$(this);$trigger.click(function(){var type,group=$trigger.attr("group");$trigger.is(":checkbox")?(type=$trigger.is(":checked")?"all":"none",group&&$.checkbox.select(group,type,parent)):group&&$.checkbox.select(group,$trigger.attr("selectType")||"all",parent)})})}}),$.checkbox={selectAll:function(_name,_parent){this.select(_name,"all",_parent)},unSelectAll:function(_name,_parent){this.select(_name,"none",_parent)},selectInvert:function(_name,_parent){this.select(_name,"invert",_parent)},select:function(_name,_type,_parent){switch($parent=$(_parent||document),$checkboxLi=$parent.find(':checkbox[name="'+_name+'"]'),_type){case"invert":$checkboxLi.each(function(){$checkbox=$(this),$checkbox.prop("checked",!$checkbox.is(":checked"))});break;case"none":$checkboxLi.prop("checked",!1);break;default:$checkboxLi.prop("checked",!0)}}}}(jQuery),function($){$.validator&&($.validator.addMethod("alphanumeric",function(value,element){return this.optional(element)||/^\w+$/i.test(value)},"Letters, numbers or underscores only please"),$.validator.addMethod("nocommas",function(value,element){return this.optional(element)||/^[^,]+$/i.test(value)},"Cannot contain commas"),$.validator.addMethod("lettersonly",function(value,element){return this.optional(element)||/^[a-z]+$/i.test(value)},"Letters only please"),$.validator.addMethod("letterstart",function(value,element){return this.optional(element)||/^[a-z]+\w+$/i.test(value)},"Letters, numbers or underscores only please,The first character must be letter"),$.validator.addMethod("phone",function(value,element){return this.optional(element)||/^[0-9 \(\)]{7,30}$/.test(value)},"Please specify a valid phone number"),$.validator.addMethod("postcode",function(value,element){return this.optional(element)||/^[0-9 A-Za-z]{5,20}$/.test(value)},"Please specify a valid postcode"),$.validator.addMethod("domain",function(value,element){return this.optional(element)||/^((((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(\[?((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\]?)|(localhost)|(loopback)|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)*)?$/i.test(value)},"Please specify a valid domain"),$.validator.addMethod("date",function(value,element){if(value=value.replace(/\s+/g,""),String.prototype.parseDate){var $input=$(element),pattern=$input.attr("dateFmt")||"yyyy-MM-dd";return!$input.val()||$input.val().parseDate(pattern)}return this.optional(element)||value.match(/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/)},"Please enter a valid date."),$.validator.addMethod("customvalid",function(value,element,params){try{return eval("("+params+")")}catch(e){return!1}},"Please fix this field."),$.validator.addClassRules({date:{date:!0},alphanumeric:{alphanumeric:!0},lettersonly:{lettersonly:!0},phone:{phone:!0},postcode:{postcode:!0}}),$.validator.setDefaults({errorElement:"span"}),$.validator.autoCreateRanges=!0)}(jQuery),function($){function readAsDataURL(img,file){var aImg,reader=new FileReader;reader.onload=(aImg=img,function(e){aImg.src=e.target.result}),reader.readAsDataURL(file)}function editImg($uploadWrap,img,fileName,callback){var $this=$uploadWrap.parent().find(".image-editor");$this.length?$this.data("id")&&delete JUI.instances[$this.data("id")]:($uploadWrap.after('
'),$this=$uploadWrap.parent().find(".image-editor"));var dataId="imageEditor_"+window.imageEditor.index++,widthInput=$uploadWrap.find("input[name=width]"),heightInput=$uploadWrap.find("input[name=height]");function initSize(imageEditor,width,height){width&&height&&imageEditor&&imageEditor.render({Crop:{autoResize:!0,presetsItems:[{titleKey:"custom",descriptionKey:width+"*"+height,width:width,height:height,disableManualResize:!0}]}})}function init(editor,dataId,img,fileName){filerobotImageEditorConfig.source=img,filerobotImageEditorConfig.defaultSavedImageName=fileName,JUI.instances[dataId]=new FilerobotImageEditor(editor[0],filerobotImageEditorConfig),JUI.instances[dataId].render({onSave:function(imageData,imageDesignState){$.isFunction(callback)&&callback(imageData.imageBase64,imageData.fullName)},onClose:function(closingReason,haveNotSavedChanges){delete JUI.instances[dataId]}}),initSize(JUI.instances[dataId],parseInt(widthInput.val()),parseInt(heightInput.val()))}widthInput.change(function(){JUI.instances[$this.data("id")]&&initSize(JUI.instances[$this.data("id")],parseInt(widthInput.val()),parseInt(heightInput.val()))}),heightInput.change(function(){JUI.instances[$this.data("id")]&&initSize(JUI.instances[$this.data("id")],parseInt(widthInput.val()),parseInt(heightInput.val()))}),window.imageEditor.initd?init($this,dataId,img,fileName):loadScripts(window.imageEditor.resources,function(){window.imageEditor.initd=!0,init($this,dataId,img,fileName)}),$this.attr("data-id",dataId)}$.fn.extend({editImg:function(options){$uploadWrap=$(this);var $previewElem=$uploadWrap.find(".thumbnail");0==$previewElem.length&&($previewElem=$('
').appendTo($uploadWrap));var img=document.createElement("img");img.src=options.imgUrl,$previewElem.empty().append(img),0==$previewElem.find(".del-icon").length&&$(' ').appendTo($previewElem).click(function(){$previewElem.remove(),$uploadWrap.find("input[type=file]").val("")}),editImg($(this),options.imgUrl,options.imgName,function(dataURL,fileName){dataURL&&(img.src=dataURL,$uploadWrap.find("input[name=base64File]").val(dataURL.substring(dataURL.indexOf("base64,")+7)),$uploadWrap.find("input[name=originalFilename]").val(fileName),$uploadWrap.find("input[type=file]").val(""),0!=$previewElem.find(".del-icon").length&&$previewElem.find(".del-icon").click(function(){$previewElem.remove(),$uploadWrap.find("input[name=base64File]").val(""),$uploadWrap.find("input[name=originalFilename]").val("")}))})}}),$.fn.extend({previewUploadImg:function(options){var op=$.extend({maxW:80},options);return this.each(function(){var $uploadWrap=$(this);$uploadWrap.find("input[type=file]").each(function(index){$(this).css({left:op.maxW*index+"px"}).on("change",function(){var files=this.files;(this.multiple?function(rel,files){var rel=rel.attr("rel"),$previewElem=$(rel);$previewElem.empty();for(var index=0;index'),img=document.createElement("img");img.file=file,$thumb.append(img),$previewElem.append($thumb),readAsDataURL(img,file)}}:function($uploadWrap,files){var $previewElem=$('
').appendTo($uploadWrap),file=files[0];if(file){if(!file.type.match(/image.*/))throw"File Type must be an image";var img=document.createElement("img");img.file=file,$previewElem.empty().append(img),0==$previewElem.find(".del-icon").length&&$(' ').appendTo($previewElem).click(function(){$previewElem.remove(),$uploadWrap.find("input[type=file]").val("")}),0==$previewElem.find(".edit-icon").length&&$uploadWrap.find("input[name=base64File]").length&&$(' ').appendTo($previewElem).click(function(){editImg($uploadWrap,img,file.name,function(dataURL,fileName){dataURL&&(img.src=dataURL,$uploadWrap.find("input[name=base64File]").val(dataURL.substring(dataURL.indexOf("base64,")+7)),$uploadWrap.find("input[name=originalFilename]").val(fileName),$uploadWrap.find("input[type=file]").val(""))})}),readAsDataURL(img,file)}})($uploadWrap,files)})});var $delIcon=$uploadWrap.find(".del-icon");$delIcon&&$delIcon.click(function(){return $.ajax({type:"GET",url:$delIcon.attr("href"),dataType:"json",cache:!1,success:function(json){JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&($uploadWrap.find("div.thumbnail").remove(),$uploadWrap.find("input[type=file]").val(""))},error:JUI.ajaxError}),!1})})}}),JUI.regPlugins.push(function($p){$("div.upload-wrap",$p).previewUploadImg({maxW:300})})}(jQuery);
\ No newline at end of file
+var JUI={version:"1.7.0",regPlugins:[],keyCode:{ENTER:13,ESC:27,END:35,HOME:36,SHIFT:16,TAB:9,LEFT:37,RIGHT:39,UP:38,DOWN:40,DELETE:46,BACKSPACE:8,CHAR_S:83},eventType:{pageClear:"pageClear",editorSync:"editorSync",resizeGrid:"resizeGrid",resizeChart:"resizeChart",initEnvAfter:"initEnvAfter"},isOverAxis:function(x,reference,size){return referenceHttp status: "+xhr.status+" "+xhr.statusText+"ajaxOptions: "+ajaxOptions+"
thrownError: "+thrownError+"
"):alert("Http status: "+xhr.status+" "+xhr.statusText+"\najaxOptions: "+ajaxOptions+"\nthrownError:"+thrownError)},ajaxDone:function(json){json[JUI.keys.statusCode]==JUI.statusCode.error?(json[JUI.keys.message]&&alertMsg&&alertMsg.error(json[JUI.keys.message]),json.fields&&$.each(json.fields.split(","),function(index,field){$("[name="+escapeJquery(field)+"]",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).addClass("error")})):json[JUI.keys.statusCode]==JUI.statusCode.timeout?alertMsg?alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:JUI.loadLogin}):JUI.loadLogin():json[JUI.keys.statusCode]==JUI.statusCode.okAndRefresh?json[JUI.keys.message]&&alertMsg&&alertMsg.correct(json[JUI.keys.message],{callback:function(){window.location.reload()}}):json[JUI.keys.message]&&alertMsg&&alertMsg.correct(json[JUI.keys.message])},init:function(_doc,options){var op=$.extend({loginUrl:"login.html",loginTitle:null,callback:null,debug:!1,statusCode:{}},options);this._set.loginUrl=op.loginUrl,this._set.loginTitle=op.loginTitle,this._set.debug=op.debug,$.extend(JUI.statusCode,op.statusCode),$.extend(JUI.keys,op.keys),$.extend(JUI.pageInfo,op.pageInfo),$.ajax({type:"GET",url:_doc,dataType:"html",cache:!1,error:function(xhr){alert(xhr.statusText)},success:function(html){$($.parseHTML(html,document,!0)).each(function(){var fragId=$(this).attr("id");fragId&&(JUI.frag[fragId]=$(this).text())}),"function"==typeof op.callback&&op.callback()}}),$(window).isBind(JUI.eventType.resizeChart)||$(window).on(JUI.eventType.resizeChart,null,null,function(){$(".chart").each(function(){$chart=$(this),$chart.data("id")&&window[$chart.data("id")]&&"function"==typeof window[$chart.data("id")].resize&&window[$chart.data("id")].resize()})});_doc=$(document);_doc.isBind(JUI.eventType.editorSync)||_doc.on(JUI.eventType.editorSync,null,null,function($box){$box=$box.target,$box=$($box);$("textarea.editor",$box).each(function(){"ckeditor"==$(this).attr("editorType")?CKEDITOR.instances[$(this).data("id")]&&CKEDITOR.instances[$(this).data("id")].updateElement():"tinymce"==$(this).attr("editorType")?tinymce.get($(this).data("id"))&&tinymce.get($(this).data("id")).save():UE.instants[$(this).data("id")]&&UE.instants[$(this).data("id")].sync()}),$("textarea.code",$box).each(function(){JUI.instances[$(this).data("id")]&&JUI.instances[$(this).data("id")].save()}),$(".miscSortDrag",$box).each(function(){var $sortBox=$(this);$sortBox.data("result")&&$sortBox.find($sortBox.data("result")).val(JUI.obj2str($sortBox.miscSortDragData($sortBox)))})}),_doc.isBind(JUI.eventType.pageClear)||_doc.on(JUI.eventType.pageClear,null,null,function($box){$box=$box.target,$box=$($box);$("textarea.editor",$box).each(function(){"ckeditor"==$(this).attr("editorType")?CKEDITOR.instances[$(this).data("id")]&&CKEDITOR.instances[$(this).data("id")].destroy():"tinymce"==$(this).attr("editorType")?tinymce.remove("#"+$(this).data("id")):UE.instants[$(this).data("id")]&&UE.instants[$(this).data("id")].destroy()}),$("textarea.code",$box).each(function(){JUI.instances[$(this).data("id")]&&(JUI.instances[$(this).data("id")].toTextArea(),delete JUI.instances[$(this).data("id")])}),$(".image-editor",$box).each(function(){JUI.instances[$(this).data("id")]&&delete JUI.instances[$(this).data("id")]}),$("[close-url]",$box).each(function(){$.getJSON($(this).attr("close-url"),function(data){})})})}};function html2Escape(sHtml){return Base64.encode(sHtml)}function escapeJquery(srcString){for(var escapseResult=srcString,jsSpecialChars=["\\","^","$","*","?",".","+","(",")","[","]","|","{","}"],jquerySpecialChars=["~","`","@","#","%","&","=","'",'"'," ",":",";","<",">",",","/"],i=0;i]*>/gi,""),tabid=$this.attr("rel")||"_blank",fresh=eval($this.attr("fresh")||"true"),external=eval($this.attr("external")||"false"),url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox:first")),newWindow=navigator.platform.match("Mac")?event.metaKey:event.ctrlKey;return(JUI.debug(url),url.isFinishedTm())?(navTab.openTab(tabid,url,{title:title,fresh:fresh,external:external,focusNewWindow:newWindow}),!1):(alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1)})}),$("a[target=dialog]",$p).each(function(){$(this).click(function(event){var $this=$(this),title=$this.attr("title")||$this.text(),rel=$this.attr("rel")||"_blank",options={},w=$this.attr("width"),h=$this.attr("height");w&&(options.width=w),h&&(options.height=h),options.max=eval($this.attr("max")||"false"),options.mask=eval($this.attr("mask")||"false"),options.maxable=eval($this.attr("maxable")||"true"),options.minable=eval($this.attr("minable")||"true"),options.fresh=eval($this.attr("fresh")||"true"),options.resizable=eval($this.attr("resizable")||"true"),options.drawable=eval($this.attr("drawable")||"true"),options.close=eval($this.attr("close")||""),options.param=$this.attr("param")||"",options.focusNewWindow=navigator.platform.match("Mac")?event.metaKey:event.ctrlKey;var url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox:first"));return(JUI.debug(url),url.isFinishedTm())?($.pdialog.open(url,rel,title,options),!1):(alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1)})}),$("a[target=ajax]",$p).each(function(){$(this).click(function(){var $rel,$this=$(this),rel=$this.attr("rel");return rel&&($rel=$("#"+rel)).loadUrl($this.attr("href"),{},function(){$rel.find("[layoutH]").layoutH()}),!1})}),$.fn.ajaxTodo&&$("a[target=ajaxTodo]",$p).ajaxTodo(),$.fn.dwzExport&&$("a[target=dwzExport]",$p).dwzExport(),$.fn.lookup&&$("a[lookupGroup]",$p).lookup(),$.fn.selectedTodo&&$("a[target=selectedTodo]",$p).selectedTodo()}!function($){$.setRegional=function(key,value){$.regional||($.regional={}),$.regional[key]=value},$.setMessage=function(key,value){JUI._msg[key]=value},$.fn.extend({ajaxUrl:function(op){var $this=$(this);$this.trigger(JUI.eventType.pageClear),$.ajax({type:op.type||"GET",url:op.url,data:op.data,cache:!1,success:function(response){var json=JUI.jsonEval(response);json[JUI.keys.statusCode]==JUI.statusCode.error?json[JUI.keys.message]&&alertMsg.error(json[JUI.keys.message]):json[JUI.keys.statusCode]==JUI.statusCode.timeout?($this.html(response),$.pdialog&&$.pdialog.checkTimeout(),navTab&&navTab.checkTimeout(),alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}})):($this.html(response).initUI(),"function"==typeof op.callback&&op.callback(response))},error:JUI.ajaxError,statusCode:{503:function(xhr,ajaxOptions,thrownError){alert(JUI.msg("statusCode_503")||thrownError)}}})},loadUrl:function(url,data,callback){$(this).ajaxUrl({url:url,data:data,callback:callback})},initUI:function(){return this.each(function(){"function"==typeof initUI&&initUI(this)})},layoutH:function($refBox){return this.each(function(){var $this=$(this),iH=($refBox=$refBox||$this.parents("div.layoutBox").first()).height(),iLayoutH=0;0!=$this.parents(".rightPageContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".rightPageContent")):0!=$this.parents(".leftPageContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".leftPageContent")):0!=$this.parents(".pageFormContent").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".pageFormContent"))+30:0!=$this.parents(".page").length?iLayoutH=$this.getSiblingsElemsH($this.parents(".page")):0!=$this.parents(".dialogContent").length&&(iLayoutH=$this.getSiblingsElemsH($this.parents(".dialogContent")));iH=50'):$this.outerHeight(iH).css("overflow","auto")})},getSiblingsElemsH:function(tabsHeaderH){var $page=tabsHeaderH,headerH=this.getElemsH($page,".pageHeader"),formBarH=this.getElemsH($page,".formBar"),contentTitleH=this.getElemsH($page,".contentTitle"),gridHeaderH=this.getElemsH($page,".gridHeader"),tabsHeaderH=this.getElemsH($page,".tabsHeader");return headerH+this.getElemsH($page,".pageBar.panelBar")+gridHeaderH+this.getElemsH($page,".panelBar:not(.pageBar)")+formBarH+tabsHeaderH+contentTitleH},getElemsH:function($elem,elem){var h=0,$elem=$elem.find(elem),isSilbinsElem=!0;if(0!=$elem.length&&0==this.find(elem).length){for(var $silbingsElems=this.siblings(),i=0;i<$silbingsElems.length;i++)if(0!=$silbingsElems.eq(i).find(elem).length){isSilbinsElem=!1;break}isSilbinsElem&&(h=$elem.outerHeight(!0))}return h},isTag:function(tn){return!(!tn||null==$(this)[0])&&$(this)[0].tagName.toLowerCase()==tn},isBind:function(type){var _events=$(this).data("events");return _events&&type&&_events[type]}}),$.extend(String.prototype,{isPositiveInteger:function(){return new RegExp(/^[1-9]\d*$/).test(this)},isInteger:function(){return new RegExp(/^\d+$/).test(this)},isNumber:function(value,element){return new RegExp(/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/).test(this)},trimstr:function(){return this.replace(/(^\s*)|(\s*$)|\r|\n/g,"")},startsWith:function(pattern){return 0===this.indexOf(pattern)},endsWith:function(pattern){var d=this.length-pattern.length;return 0<=d&&this.lastIndexOf(pattern)===d},replaceSuffix:function(index){var i=this.lastIndexOf("[");return this.substring(0,i)+this.substring(i).replace(/\[[0-9]+\]/,"["+index+"]").replace("#index#",index)},encodeTXT:function(){return this.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll(" "," ")},replaceAll:function(os,ns){return this.replace(new RegExp(os,"gm"),ns)},replaceTm:function(data){return data?this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){return data[$1.replace(/[{}]+/g,"")]}):this},replaceTmById:function(_box){var $parent=_box||$(document);return this.replace(RegExp("({[A-Za-z_]+[A-Za-z0-9_]*})","g"),function($1){var $input=$parent.find("#"+$1.replace(/[{}]+/g,""));return $input.val()?$input.val():$1})},isFinishedTm:function(){return!new RegExp("{[A-Za-z_]+[A-Za-z0-9_]*}").test(this)},skipChar:function(ch){return this&&0!==this.length?this.charAt(0)===ch?this.substring(1).skipChar(ch):this:""},isValidPwd:function(){return new RegExp(/^([_]|[a-zA-Z0-9]){6,32}$/).test(this)},isValidMail:function(){return new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.trimstr())},isUrl:function(){return new RegExp(/^([a-zA-z]+:)?\/\/([a-zA-Z0-9\-\.]+)([-\w .\/?%&=:]*)$/).test(this)},isExternalUrl:function(){var domain=document.domain;return""==domain&&(domain="localhost"),this.isUrl()&&-1==this.indexOf("//"+domain)}})}(jQuery),function(){var MONTH_NAMES=new Array("January","February","March","April","May","June","July","August","September","October","November","December","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"),DAY_NAMES=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sun","Mon","Tue","Wed","Thu","Fri","Sat");function LZ(x){return(x<0||9'+t+""}for(t=1;t<=dw.days;t++){var _ctrClass=minDate<=(_date=new Date(dw.year,dw.month-1,t))&&_date<=maxDate?"":"disabled";t==dw.day?dayStr+=''+t+" ":dayStr+=''+t+" "}for(var _date,t=1;t<=42-startDay-dw.days;t++)dayStr+=''+t+" ";var $hour,$minute,$second,$inputs,$days=$(setting.days$).html(dayStr).find("dd");$days.not(".disabled").click(function(){var $day=$(this);dp.hasTime()?($days.removeClass("slt"),$day.addClass("slt")):($this.val(dp.formatDate(dp.changeDay($day.attr("day"),$day.attr("chMonth")))),closeCalendar())}),dp.hasDate()||$(setting.main$).addClass("nodate"),dp.hasTime()&&($("#calendar .time").show(),$hour=dw.hour,$minute=dw.minute,$second=dw.second,dp.opts.defaultTime&&!$this.val()&&(timeStr=dp.opts.defaultTime.split(":"),$hour=parseInt(timeStr[0]),$minute=parseInt(timeStr[1]),$second=parseInt(timeStr[2])),$minute=parseInt($minute/dp.opts.mmStep)*dp.opts.mmStep,$second=dp.hasSecond()?$second:0,$hour=$(setting.hour$).val($hour).focus(function(){changeTmMenu("hh")}),$minute=$(setting.minute$).val($minute).attr("step",dp.opts.mmStep).focus(function(){changeTmMenu("mm")}),$second=$(setting.second$).val($second).attr("step",dp.opts.ssStep).focus(function(){changeTmMenu("ss")}),$hour.add($minute).add($second).click(function(){return!1}),clickTmMenu($hour,"hh"),clickTmMenu($minute,"mm"),clickTmMenu($second,"ss"),$(setting.box$).click(function(){changeTmMenu()}),($inputs=$(setting.tmInputs$)).keydown(keydownInt).each(function(){var $input=$(this);$input.keyup(function(){changeTm($input,0)})}),$(setting.tmUp$).click(function(){$inputs.filter(".slt").each(function(){changeTm($(this),1)})}),$(setting.tmDown$).click(function(){$inputs.filter(".slt").each(function(){changeTm($(this),-1)})}),dp.hasHour()||$hour.attr("disabled",!0),dp.hasMinute()||$minute.attr("disabled",!0),dp.hasSecond()||$second.attr("disabled",!0))}function closeCalendar(){$(setting.box$).remove(),$(document).off("click",null,closeCalendar)}$this.click(function(event){closeCalendar();var dp=new Datepicker($this.val(),opts),offset=$this.offset(),iTop=offset.top+this.offsetHeight;$($.parseHTML(JUI.frag.calendarFrag,document,!0)).appendTo("body").css({left:offset.left+"px",top:iTop+"px"}).show().click(function(event){event.stopPropagation()});var dayNames="";$.each($.regional.datepicker.dayNames,function(i,v){dayNames+=""+v+" "}),$(setting.dayNames$).html(dayNames);var dw=dp.getDateWrap(),$year=$(setting.year$),iBoxH=dp.getMinDate().getFullYear(),yearend=dp.getMaxDate().getFullYear();for(y=iBoxH;y<=yearend;y++)$year.append('"+y+" ");var $month=$(setting.month$);$.each($.regional.datepicker.monthNames,function(m,v){m+=1;$month.append('"+v+" ")}),generateCalendar(dp),$year.add($month).change(function(){dp.changeDate($year.val(),$month.val()),generateCalendar(dp)});iBoxH=$(setting.box$).outerHeight(!0);return iBoxH$(window).height()-iBoxH&&$(setting.box$).css("top",offset.top-iBoxH),$(setting.close$).click(function(){closeCalendar()}),$(setting.clearBut$).click(function(){$this.val(""),closeCalendar()}),$(setting.okBut$).click(function(){var date=$(setting.days$).find("dd.slt");if(date.hasClass("disabled"))return!1;date=dp.changeDay(date.attr("day"),date.attr("chMonth"));dp.hasTime()&&(date.setHours(parseInt($(setting.hour$).val())),date.setMinutes(parseInt($(setting.minute$).val())),date.setSeconds(parseInt($(setting.second$).val()))),$this.val(dp.formatDate(date)),closeCalendar()}),$(document).on("click",null,null,closeCalendar),!1}),$this.next().is(setting.calIcon$)&&$this.next().click(function(){return $this.trigger("click"),!1})})};var Datepicker=function(sDate,now){this.opts=$.extend({pattern:"yyyy-MM-dd",minDate:"1970-01-01",maxDate:"2099-12-31",mmStep:1,ssStep:1},now);now=new Date;this.opts.minDate=now.formatDateTm(this.opts.minDate),this.opts.maxDate=now.formatDateTm(this.opts.maxDate),this.sDate=sDate.trimstr()};$.extend(Datepicker.prototype,{get:function(name){return this.opts[name]},_getDays:function(y,m){return 2==m?y%4||!(y%100)&&y%400?28:29:/4|6|9|11/.test(m)?30:31},_minMaxDate:function(sDate){var _count=sDate.split("-").length-1,_format="y-M-d";return 1==_count?_format="y-M":0==_count&&(_format="y"),sDate.parseDate(_format)},getMinDate:function(){return this._minMaxDate(this.opts.minDate)},getMaxDate:function(){var _day=this.opts.maxDate,_count=_day.split("-").length-1,_date=this._minMaxDate(_day);return _count<2&&(_day=this._getDays(_date.getFullYear(),_date.getMonth()+1),_date.setDate(_day),0==_count&&_date.setMonth(11)),_date},getDateWrap:function(date){var y=(date=date||(this.parseDate(this.sDate)||new Date)).getFullYear(),m=date.getMonth()+1,days=this._getDays(y,m);return{year:y,month:m,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds(),days:days,date:date}},changeDate:function(y,m,date){date=new Date(y,m-1,date||1);return this.sDate=this.formatDate(date),date},changeDay:function(day,chMonth){chMonth=chMonth||0;var dw=this.getDateWrap();return this.changeDate(dw.year,dw.month+parseInt(chMonth),day)},parseDate:function(sDate){return sDate?sDate.parseDate(this.opts.pattern):null},formatDate:function(date){return date.formatDate(this.opts.pattern)},hasHour:function(){return-1!=this.opts.pattern.indexOf("H")},hasMinute:function(){return-1!=this.opts.pattern.indexOf("m")},hasSecond:function(){return-1!=this.opts.pattern.indexOf("s")},hasTime:function(){return this.hasHour()||this.hasMinute()||this.hasSecond()},hasDate:function(){for(var _dateKeys=["y","M","d","E"],i=0;i<_dateKeys.length;i++)if(-1!=this.opts.pattern.indexOf(_dateKeys[i]))return!0;return!1}})}(jQuery),function($){$.scrollPosParents=function($el){var $el=$($el),scrollPos={top:0,left:0};return $el.parents().each(function(){var $p=$(this);scrollPos.top+=$p.scrollTop(),scrollPos.left+=$p.scrollLeft()}),scrollPos},$.fn.jDrag=function(options){return"string"==typeof options&&"destroy"==options?this.each(function(){$(this).off("mousedown",$.rwdrag.start),$.data(this,"pp-rwdrag",null)}):this.each(function(){var select=$(this);$.data($.rwdrag,"pp-rwdrag",{options:$.extend({el:select,obj:select},options)}),options.event?$.rwdrag.start(options.event):(select=options.selector,$(select,obj).on("mousedown",$.rwdrag.start))})},$.rwdrag={start:function(e){document.onselectstart=function(e){return!1};var me=$.data(this,"pp-rwdrag"),el=me.options.el[0];$.data(el,"pp-rwdrag",{options:me.options}),$.rwdrag.current||((me=e).touches&&(me=me.touches[0]),$.rwdrag.current={el:el,oleft:parseInt(el.style.left)||0,otop:parseInt(el.style.top)||0,ox:me.pageX||me.screenX,oy:me.pageY||me.screenY},e.touches?$(document).on("touchend",$.rwdrag.stop).on("touchmove",$.rwdrag.drag):$(document).on("mouseup",$.rwdrag.stop).on("mousemove",$.rwdrag.drag))},drag:function(e){e=e||window.event;var current=$.rwdrag.current,data=$.data(current.el,"pp-rwdrag");me=e,me.touches&&(me=me.touches[0]);var selector,left=current.oleft+(me.pageX||me.clientX)-current.ox,top=current.otop+(me.pageY||me.clientY)-current.oy;return"horizontal"==data.options.move?(data.options.minW&&left>=$(data.options.obj).cssv("left")+data.options.minW&&data.options.maxW&&left<=$(data.options.obj).cssv("left")+data.options.maxW||data.options.scop&&(!data.options.relObj||left-parseInt(data.options.relObj.style.left)>data.options.cellMinW))&&(current.el.style.left=left+"px"):"vertical"==data.options.move?current.el.style.top=top+"px":left>=2*-(selector=data.options.selector?$(data.options.selector,data.options.obj):$(data.options.obj)).outerWidth()/3&&left+selector.outerWidth()/3<$(window).width()&&top+selector.outerHeight()<$(window).height()&&(current.el.style.left=left+"px",current.el.style.top=top+"px"),data.options.drag&&data.options.drag.apply(current.el,[current.el,e]),$.rwdrag.preventEvent(e)},stop:function(e){var current=$.rwdrag.current,data=$.data(current.el,"pp-rwdrag");return e.touches?$(document).off("touchmove",$.rwdrag.drag).off("touchend",$.rwdrag.stop):$(document).off("mousemove",$.rwdrag.drag).off("mouseup",$.rwdrag.stop),data.options.stop&&data.options.stop.apply(current.el,[current.el,e]),$.rwdrag.current=null,document.onselectstart=function(e){return!0},$.rwdrag.preventEvent(e)},preventEvent:function(e){return e.stopPropagation&&e.stopPropagation(),!!e.touches||(e.preventDefault&&e.preventDefault(),!1)}}}(jQuery),function($){var _op={cursor:"move",sortBoxs:"div.sortDrag",items:">.dragItem",selector:"",zIndex:1e3};JUI.sortDrag={_onDrag:!1,start:function($sortBox,$item,event,op){var me=this;if(me._onDrag)return setTimeout(function(){me._onDrag=!1},500),!1;me._onDrag=!0;var $placeholder=this._createPlaceholder($item),$helper=$item.clone(),position=$item.position();$.scrollPosParents($sortBox);return $helper.data("$sortBox",$sortBox).data("op",op).data("$item",$item).data("$placeholder",$placeholder),$helper.addClass("sortDragHelper").css({position:"absolute",top:position.top,left:position.left,zIndex:op.zIndex,width:$item.width()+"px",height:$item.height()+"px"}).jDrag({selector:op.selector,drag:this.drag,stop:this.stop,event:event}),$item.before($placeholder).before($helper).hide(),!1},drag:function(el,event){var $helper=$(el),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$items=$sortBox.find($helper.data("op").items).filter(":visible").filter(":not(.sortDragPlaceholder, .sortDragHelper)"),helperPos=$helper.position(),$overBox=JUI.sortDrag._getOverSortBox($helper);if(1==$sortBox.data("over-sort")&&0<$overBox.length&&$overBox[0]!=$sortBox[0])$placeholder.appendTo($overBox),$helper.data("$sortBox",$overBox);else if($items.length)for(var i=0;i<$items.length;i++){var $this=$items.eq(i),position=$this.position();if(helperPos.top>position.top+10)$this.after($placeholder);else if(helperPos.top<=position.top||helperPos.left<=position.left){$this.before($placeholder);break}}},stop:function(){var $helper=$(arguments[0]),$item=$helper.data("$item"),$placeholder=$helper.data("$placeholder");$item.insertAfter($placeholder).show(),$placeholder.remove(),$helper.remove(),JUI.sortDrag._onDrag=!1},_createPlaceholder:function($item){return $("<"+$item[0].nodeName+' class="sortDragPlaceholder"/>').css({width:$item.outerWidth()+"px",height:$item.outerHeight()+"px",marginTop:$item.css("marginTop"),marginRight:$item.css("marginRight"),marginBottom:$item.css("marginBottom"),marginLeft:$item.css("marginLeft")})},_getOverSortBox:function($item){var op=$item.offset(),y=op.top,x=op.left+$item.width()/2,op=$.extend({},_op,$item.data("op"));return $(op.sortBoxs).filter(":visible").filter(function(){var $sortBox=$(this);return!$sortBox.data("accept")||-1<$sortBox.data("accept").split(",").indexOf($item.data("type"))}).filter(function(){var sortBoxW=$(this),sortBoxPos=sortBoxW.offset(),sortBoxH=sortBoxW.height(),sortBoxW=sortBoxW.width();return JUI.isOver(y,x,sortBoxPos.top,sortBoxPos.left,sortBoxH,sortBoxW)})}},$.fn.sortDrag=function(options){return this.each(function(){var op=$.extend({},_op,options),$sortBox=$(this);$sortBox.attr("selector")&&(op.selector=$sortBox.attr("selector")),$sortBox.find(op.items).each(function(i){var $item=$(this),$selector=$item;op.selector&&($selector=$item.find(op.selector).css({cursor:op.cursor})),op.refresh&&$selector.off("mousedown touchstart"),$selector.on("mousedown touchstart",function(event){$sortBox.hasClass("disabled")||$(event.target).is("input")||$(event.target).is("a")||(JUI.sortDrag.start($sortBox,$item,event,op),event.touchs||event.preventDefault())})}),$sortBox.find(".close").one("mousedown touchstart",function(event){return $(this).parent().remove(),!1})})}}(jQuery),function($){JUI.miscDrag={start:function($sortBox,$item,event,op){var $helper=$item.clone(),position=$item.position();return $helper.addClass("sortDragHelper").css({position:"absolute",top:position.top+$sortBox.scrollTop(),left:position.left,zIndex:op.zIndex,minWidth:$item.width()+"px",height:$item.height()+"px"}).jDrag({drag:this.drag,stop:this.stop,event:event}),$helper.data("$sortBox",$sortBox),$item.before($helper),!1},drag:function(el,event){},stop:function(el,event){var $dragBox,id,sequence,overBoxPos,$helper=$(el),rel=$helper.data("$sortBox"),dragBoxPos=JUI.miscDrag._getOverSortBox($helper);0 div").length,overBoxPos=dragBoxPos.position(),dragBoxPos=$dragBox.position(),$dragBox.css({height:"auto",top:dragBoxPos.top-overBoxPos.top+"px",left:dragBoxPos.left-overBoxPos.left+"px"}),(rel=rel.attr("rel"))&&$('
'+sequence+" ").appendTo(rel)):$helper.remove()},_getOverSortBox:function($item){var op=$item.offset(),y=op.top+$item.height()/2,x=op.left+$item.width()/2,op=$item.data("op");return $(op.sortBoxs).filter(":visible").filter(function(){var $sortBox=$(this);return!$sortBox.data("accept")||-1<$sortBox.data("accept").split(",").indexOf($item.data("type"))}).filter(function(){var sortBoxW=$(this),sortBoxPos=sortBoxW.offset(),sortBoxH=sortBoxW.height(),sortBoxW=sortBoxW.width();return JUI.isOver(y,x,sortBoxPos.top,sortBoxPos.left,sortBoxH,sortBoxW)})},_createPlaceholder:function($item){return $("<"+$item[0].nodeName+' class="sortDragPlaceholder"/>').css({height:$item.outerHeight()+"px",marginTop:$item.css("marginTop"),marginRight:$item.css("marginRight"),marginBottom:$item.css("marginBottom"),marginLeft:$item.css("marginLeft")})},startSortDrag:function($sortBox,$item,event,op){var $placeholder=this._createPlaceholder($item),$helper=$item.clone(),position=$item.position();return $helper.data("$sortBox",$sortBox).data("op",op).data("$item",$item).data("$placeholder",$placeholder),$helper.addClass("sortDragHelper").css({position:"absolute",top:position.top+$sortBox.scrollTop(),left:position.left,zIndex:op.zIndex,width:$item.width()+"px",height:$item.height()+"px"}).jDrag({drag:this.dragSortDrag,stop:this.stopSortDrag,event:event}),$item.before($helper).before($placeholder),!1},dragSortDrag:function(el,event){var $helper=$(el),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$overBox=$helper.parents(".unitBox:first"),position=$helper.position();$helper.css({top:position.top+$overBox.scrollTop()});$overBox=JUI.miscDrag._getOverSortBox($helper);if(0<$overBox.length&&$overBox[0]!=$sortBox[0]){var $items=$overBox.find(">.dragItem").filter(":visible").filter(":not(.sortDragPlaceholder, .sortDragHelper)");if($items.length){helperPos=$helper.offset();for(var i=0;i<$items.length;i++){var $this=$items.eq(i),position=$this.offset();if(helperPos.top>position.top+10)$this.after($placeholder);else if(helperPos.top<=position.top||helperPos.left<=position.left){$this.before($placeholder);break}}}else $placeholder.appendTo($overBox)}},stopSortDrag:function(){var $destBox,$result,$helper=$(arguments[0]),$sortBox=$helper.data("$sortBox"),$placeholder=$helper.data("$placeholder"),$item=$helper.data("$item");$placeholder&&$placeholder.is(":visible")?($destBox=$placeholder.parents(".sortDrag:first"),$result=$helper.html(),($result=$(''+$result+"
")).attr("data-id",$helper.data("id")),$result.attr("data-type",$helper.data("type")),$result.insertAfter($placeholder).show(),"function"==typeof initLink&&initLink($result),$placeholder.remove(),$helper.remove(),1!=$sortBox.data("duplicate")&&$item.remove(),$.fn.sortDrag&&$destBox.sortDrag({refresh:!0})):($placeholder.remove(),$helper.remove())}},$.fn.extend({miscDrag:function(options){var op=$.extend({cursor:"move",sortBoxs:"div.miscDrag",items:"> dt .dragBox",zIndex:1e3},options);return this.each(function(){var $box=$(this);$box.find(op.items).each(function(i){var $item=$(this);$item.on("mousedown touchstart",function(event){JUI.miscDrag.start($box,$item,event,op),event.touchs||event.preventDefault()})})})},miscDragData:function(){for(var $miscDrag=$(this),$miscSortDrag=$($miscDrag.attr("rel")),$dragBoxList=$miscDrag.find("dd .dragBox"),$sortDragList=$miscSortDrag.find(".sortDrag"),data=[],i=0;i<$dragBoxList.length;i++){var $dragBox=$dragBoxList.eq(i),$sortDrag=$sortDragList.eq(i),$dragBoxPos=$dragBox.position(),dataItem={id:$dragBox.data("id"),top:parseInt($dragBoxPos.top),left:parseInt($dragBoxPos.left),items:[]};$sortDrag.find(".dragItem").each(function(index){var $dragItem=$(this);$dragItem.position();dataItem.items.push({id:$dragItem.data("id")})}),data.push(dataItem)}return data},miscSortDragData:function(){var $miscSortDrag=$(this);return function fillData($sortDragList){for(var data=[],i=0;i<$sortDragList.length;i++){var $sortDrag=$sortDragList.eq(i),dataItem={items:[]};$sortDrag.data("id")&&(dataItem.id=$sortDrag.data("id")),$sortDrag.find(">.dragItem").each(function(){var $dragItem=$(this),itemData={id:$dragItem.data("id")};$dragItem.find(">.ctl-label>:input").each(function(){var $lable=$(this),lableName=$lable.data("name");lableName&&("checkbox"==$lable.attr("type")?itemData[lableName]=$lable.is(":checked"):itemData[lableName]=$lable.val())}),$dragItemSortDragList=$dragItem.find(">.ctl-label .sortDrag"),$dragItemSortDragList.length&&(itemData.items=fillData($dragItemSortDragList)),dataItem.items.push(itemData)}),data.push(dataItem)}return data}($miscSortDrag.find(".sortDrag[data-parent="+$miscSortDrag.data("id")+"]"))},miscSortDrag:function(options){var op=$.extend({cursor:"move",sortBoxs:"dl.miscSortDrag .sortDrag",items:"> dt .dragItem",zIndex:1e3},options);return this.each(function(){var $sortBox=$(this);$sortBox.find(op.items).each(function(i){var $item=$(this);$item.on("mousedown touchstart",function(event){JUI.miscDrag.startSortDrag($sortBox,$item,event,op),event.touchs||event.preventDefault()})})})}})}(jQuery),function($){$.extend($.fn,{jTree:function(options){var op=$.extend({checkFn:null,selected:"selected",exp:"expandable",coll:"collapsable",firstExp:"first_expandable",firstColl:"first_collapsable",lastExp:"last_expandable",lastColl:"last_collapsable",folderExp:"folder_expandable",folderColl:"folder_collapsable",endExp:"end_expandable",endColl:"end_collapsable",file:"file",ck:"checked",unck:"unchecked",async:"_src"},options);return this.each(function(){var $this=$(this),cnum=$this.children().length;$(">li",$this).each(function(){var $li=$(this),first=!$li.prev()[0],last=!$li.next()[0];$li.genTree({root:$this,icon:$this.hasClass("treeFolder"),ckbox:$this.hasClass("treeCheck"),excludeParent:$this.hasClass("excludeParent"),options:op,level:0,exp:1 '),$("#"+sTarget,$this).val($li.attr("rel"))),$(".ckbox",parent).trigger("click"),event.stopPropagation(),$(document).trigger("click"),!$(this).attr("target"))return!1})},1)})},subTree:function(op,level){return this.each(function(){$(">li",this).each(function(){var $this=$(this),isLast=!$this.next()[0];$this.genTree({root:op.root,icon:op.icon,ckbox:op.ckbox,excludeParent:op.excludeParent,exp:isLast?op.options.lastExp:op.options.exp,coll:isLast?op.options.lastColl:op.options.coll,options:op.options,level:level,space:isLast?null:op.space,showSub:op.showSub,isLast:isLast})})})},genTree:function(options){var op=$.extend({root:options.root,icon:options.icon,ckbox:options.ckbox,excludeParent:options.excludeParent,exp:"",coll:"",showSub:!1,level:0,options:null,isLast:!1},options);return this.each(function(){var node=$(this),tree=$(">ul",node),showIcon=node.parent().prev(),checked="unchecked";op.ckbox&&$(">.checked",showIcon).length<0&&(checked="checked"),0"),showIcon=op.icon&&!tree.hasClass("noFolder"),$(">div",node).prepend((op.ckbox?'
':"")+(showIcon?'
':'
')),0div>div."+op.options.folderColl+",>div>div."+op.options.folderExp+",>div>a",node).click(function(){if(node.attr(op.options.async)&&($.ajax({type:"get",url:node.attr(op.options.async),async:!1,data:{},success:function(response){node.append(response),initLink(tree=$(">ul",node).hide()),$("a",tree).click(function(event){$("div."+op.options.selected,op.root).removeClass(op.options.selected);var parent=$(this).parent().addClass(op.options.selected),$li=$(this).parents("li:first"),sTarget=$li.attr("target");if(sTarget&&(0==$("#"+sTarget,op.root).length&&op.root.prepend(' '),$("#"+sTarget,op.root).val($li.attr("rel"))),$(".ckbox",parent).trigger("click"),event.stopPropagation(),$(document).trigger("click"),!$(this).attr("target"))return!1}),node.removeAttr(op.options.async)},error:JUI.ajaxError}),node.attr(op.options.async)))return!1;$(">li:first",tree).children(":first").isTag("a")&&tree.subTree(op,op.level+1);var isA=$(this).isTag("a"),$this=$(">div>div."+op.coll+",>div>div."+op.exp,node);return isA&&!tree.is(":hidden")||($this.toggleClass(op.exp).toggleClass(op.coll),op.icon&&$(">div>div",node).last().toggleClass(op.options.folderExp).toggleClass(op.options.folderColl)),tree.is(":hidden")?tree.slideDown(100):isA||tree.slideUp(100),!1}),addSpace(op.level,node),op.showSub&&tree.subTree(op,op.level+1)):(node.children().wrap("
"),$(">div",node).prepend((op.ckbox?'
':"")+(op.icon?'
':'
')),op.icon&&$(">div>div."+op.options.file,node).click(function(){return $(this).next().click(),!1}),addSpace(op.level,node)),op.ckbox&&node._check(op),$.support.leadingWhitespace||$(">div",node).click(function(){return $("a",this).trigger("click"),!1})});function addSpace(level,node){if(0';if(1div>div",parent).filter(":first"),prev="";1',next=next.next(),level--;plist=prev+plist}$(">div",node).prepend(plist)}}},_check:function(op){var node=$(this),ckbox=$(">div>.ckbox",node),$input=node.find("a"),tname=$input.attr("tname"),tvalue=$input.attr("tvalue"),attrs="";tname&&(attrs+='name="'+tname+'" '),tvalue&&(attrs+='value="'+tvalue+'" '),ckbox.append(' ").click(function(){var cked=ckbox.hasClass("checked"),aClass=cked?"unchecked":"checked",rClass=cked?"checked":"unchecked";return ckbox.removeClass(rClass).removeClass(cked?"":"indeterminate").addClass(aClass),$("input",ckbox).prop("checked",!cked),$(">ul",node).find("li").each(function(){$("div.ckbox",this).removeClass(rClass).removeClass(cked?"":"indeterminate").addClass(aClass).find("input").prop("checked",!cked)}),$(node)._checkParent(op.excludeParent),!1}),$input.attr("checked")&&(ckbox.find("input").prop("checked",!0),ckbox.removeClass("unchecked").addClass("checked"),$(node)._checkParent(op.excludeParent))},_checkParent:function(excludeParent){var parent,ckbox,aClass,$checkbox;$(this).parent().hasClass("tree")||(parent=$(this).parent().parent(),ckbox=(aClass=$(">ul",parent)).find(">li>a").length+aClass.find("div.ckbox").length,aClass=($checkbox=aClass.find("div.checked").length)==ckbox?"checked":0!=$checkbox?"indeterminate":"unchecked",$checkbox=$checkbox!=ckbox&&0!=$checkbox?"checked":"indeterminate",$(">div>.ckbox",parent).removeClass("unchecked").removeClass("checked").removeClass($checkbox).addClass(aClass),$checkbox=$(":checkbox",parent),"checked"==aClass?($checkbox.prop("checked",!0),$(">div>.ckbox",parent).find("input").prop("checked",!0)):"unchecked"==aClass?$checkbox.removeAttr("checked"):"indeterminate"!=aClass||excludeParent||$(">div>.ckbox",parent).find("input").prop("checked",!0),parent._checkParent(excludeParent))}})}(jQuery),function($){var jmenus={};function completed(cancel){var options;$.data(this,"jui-accordion")&&((options=$.data(this,"jui-accordion").options).running=cancel?0:--options.running,options.running||(options.clearStyle&&options.toShow.add(options.toHide).css({height:"",overflow:""}),$(this).triggerHandler("change.jui-accordion",[options.data],options.change)))}function toggle(toShow,toHide,complete,clickedActive,down){var options=$.data(this,"jui-accordion").options;options.toShow=toShow,options.toHide=toHide,options.data=complete;var callback,scope,complete=(callback=completed,scope=this,function(){return callback.apply(scope,arguments)});options.running=(0==toHide.length?toShow:toHide).length,options.animated?!options.alwaysOpen&&clickedActive?$.jui.accordion.animations[options.animated]({toShow:jQuery([]),toHide:toHide,complete:complete,down:down,autoheight:options.autoheight}):$.jui.accordion.animations[options.animated]({toShow:toShow,toHide:toHide,complete:complete,down:down,autoheight:options.autoheight}):(!options.alwaysOpen&&clickedActive?toShow.toggle():(toHide.hide(),toShow.show()),complete(!0))}function clickHandler(down){var options=$.data(this,"jui-accordion").options;if(options.disabled)return!1;if(!down.target&&!options.alwaysOpen){options.active.find("h2").toggleClass(options.selectedClass),options.active.find("h2 .icon").toggleClass(options.selectedIconClass);var toHide=options.active.next(),data={instance:this,options:options,newHeader:jQuery([]),oldHeader:options.active,newContent:jQuery([]),oldContent:toHide},toShow=options.active=$([]);return toggle.call(this,toShow,toHide,data),!1}var clicked=$(down.target);if(clicked.parents(options.header).length)for(;!clicked.is(options.header);)clicked=clicked.parent();var clickedActive=clicked[0]==options.active[0];if(options.running||options.alwaysOpen&&clickedActive)return!1;if(clicked.is(options.header)){options.active.find("h2").toggleClass(options.selectedClass),options.active.find("h2 .icon").toggleClass(options.selectedIconClass),clickedActive||(clicked.find("h2").addClass(options.selectedClass),clicked.find("h2 .icon").toggleClass(options.selectedIconClass));toShow=clicked.next(),toHide=options.active.next(),data={instance:this,options:options,newHeader:clicked,oldHeader:options.active,newContent:toShow,oldContent:toHide},down=options.headers.index(options.active[0])>options.headers.index(clicked[0]);return options.active=clickedActive?$([]):clicked,toggle.call(this,toShow,toHide,data,clickedActive,down),!1}}function findActive(headers,selector){return null!=selector?"number"==typeof selector?headers.eq(selector):headers.not(headers.not(selector)):!1===selector?$([]):headers.eq(0)}$.jui=$.jui||{},$.fn.extend({accordion:function(options,data){var args=Array.prototype.slice.call(arguments,1);return this.each(function(){var accordion;options.fillSpace&&(jmenus[options.fillSpace]=this),"string"==typeof options?(accordion=$.data(this,"jui-accordion"))[options].apply(accordion,args):$(this).is(".jui-accordion")||$.data(this,"jui-accordion",new $.jui.accordion(this,options))})},activate:function(index){return this.accordion("activate",index)}}),$.jui.accordion=function(container,options){var maxHeight,parent,height,os,obj;this.options=options=$.extend({},$.jui.accordion.defaults,options),this.element=container,$(container).addClass("jui-accordion"),options.headers=$(container).find(options.header),options.active=findActive(options.headers,options.active),options.fillSpace?(parent=options.fillSpace,(obj=jmenus[parent])&&(parent=$(obj).parent(),height=parent.height()-$(".accordionHeader",obj).length*$(".accordionHeader:first-child",obj).outerHeight(),os=parent.children().not(obj),$.each(os,function(i){height-=$(os[i]).outerHeight()}),$(".accordionContent",obj).height(height)),options.autoheight=!0):options.autoheight&&(maxHeight=0,options.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).outerHeight())}).height(maxHeight)),options.headers.not(options.active||"").next().hide(),options.active.find("h2").addClass(options.selectedClass),options.active.find("h2 .icon").addClass(options.selectedIconClass),options.event&&$(container).on(options.event+".jui-accordion",null,null,clickHandler)},$.jui.accordion.prototype={activate:function(index){clickHandler.call(this.element,{target:findActive(this.options.headers,index)[0]})},enable:function(){this.options.disabled=!1},disable:function(){this.options.disabled=!0},destroy:function(){this.options.headers.next().css("display",""),(this.options.fillSpace||this.options.autoheight)&&this.options.headers.next().css("height",""),$.removeData(this.element,"jui-accordion"),$(this.element).removeClass("jui-accordion").off(".jui-accordion")}},$.extend($.jui.accordion,{defaults:{selectedClass:"collapsable",selectedIconClass:"icon-chevron-down",alwaysOpen:!0,animated:"slide",event:"click",header:".accordionHeader",autoheight:!1,running:0},animations:{slide:function(options,additions){var hideHeight,difference;(options=$.extend({easing:"swing",duration:100},options,additions)).toHide.length?(hideHeight=options.toHide.height(),difference=options.toShow.height()/hideHeight,options.toShow.css({height:"0px"}).show(),options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate({height:"hide"},{step:function(current){current=(hideHeight-current)*difference;$.support.leadingWhitespace||(current=Math.ceil(current)),options.toShow.height(current)},duration:options.duration,easing:options.easing,complete:function(){options.autoheight||options.toShow.css({height:"auto"}),options.toShow.css({overflow:"auto"}),options.complete()}})):options.toShow.animate({height:"show"},options)},bounceslide:function(options){this.slide(options,{easing:options.down?"bounceout":"swing",duration:options.down?200:100})},easeslide:function(options){this.slide(options,{easing:"easeinout",duration:100})}}})}(jQuery),function($){$.fn.navMenu=function(){return this.each(function(){var $box=$(this);$box.find("li>a").click(function(){var $a=$(this);return $a.is("[href^=javascript]")||$("#sidebar #menu").ajaxUrl({type:"get",url:$a.attr("href"),callback:function(response){$box.find("li").removeClass("selected"),$a.parent().addClass("selected")}}),!1})})}}(jQuery),function($){var menu,hash;function hide(){menu.hide()}$.fn.extend({contextMenu:function(id,op){op=$.extend({bindings:{},ctrSub:null},op);menu=menu||$('').appendTo("body").hide(),(hash=hash||[]).push({id:id,bindings:op.bindings||{},ctrSub:op.ctrSub});var index=hash.length-1;return $(this).on("contextmenu",null,null,function(e){return function(posX,trigger,posY){var cur=hash[posX],posX=$(JUI.frag[cur.id]);posX.find("li"),menu.html(posX),$.each(cur.bindings,function(id,func){$('[rel="'+id+'"]',menu).on("click",null,null,function(e){hide(),func($(trigger),$("#"+cur.id))})});posX=posY.pageX,posY=posY.pageY;$(window).width() '),jThemeLi=$(this).find(">li");return jThemeLi.each(function(index){var $this=$(this),themeName=$this.attr("class");themeName==op.defaultTheme&&($this.addClass("selected"),$(".theme").prop("class","theme "+themeName)),$this.addClass(themeName).click(function(){setTheme(themeName)})}),"function"==typeof $.cookie&&$.cookie("dwz_theme")&&setTheme($.cookie("dwz_theme")),$themeItem.appendTo($("head")),this}})}(jQuery);var navTab={componentBox:null,_tabBox:null,_prevBut:null,_nextBut:null,_panelBox:null,_moreBut:null,_moreBox:null,_currentIndex:0,_op:{id:"navTab",step:4,stTabBox:".navTab-tab",stPanelBox:".navTab-panel",mainTabId:"main",close$:"a.close",prevClass:"tabsLeft",nextClass:"tabsRight",stMore:".tabsMore",stMoreLi:"ul.tabsMoreList"},init:function(options){$.History&&$.History.init();var $this=this;$.extend(this._op,options),this.componentBox=$("#"+this._op.id),this.step=this._op.step,this._tabBox=this.componentBox.find(this._op.stTabBox),this._panelBox=this.componentBox.find(this._op.stPanelBox),this._prevBut=this.componentBox.find("."+this._op.prevClass),this._nextBut=this.componentBox.find("."+this._op.nextClass),this._moreBut=this.componentBox.find(this._op.stMore),this._moreBox=this.componentBox.find(this._op.stMoreLi),this._prevBut.click(function(event){$this._scrollPrev()}),this._nextBut.click(function(event){$this._scrollNext()}),this._moreBut.click(function(){return $this._moreBox.show(),!1}),$(document).click(function(){$this._moreBox.hide()}),this._contextmenu(this._tabBox),this._contextmenu(this._getTabs()),this._init(),this._ctrlScrollBut()},_init:function(){var $this=this;this._getTabs().each(function(iTabIndex){$(this).off("click").click(function(event){$this._switchTab(iTabIndex)}),$(this).find(navTab._op.close$).off("click").click(function(){$this._closeTab(iTabIndex)})}),this._getMoreLi().each(function(iTabIndex){$(this).find(">a").off("click").click(function(event){$this._switchTab(iTabIndex)})}),this._switchTab(this._currentIndex)},_contextmenu:function($obj){var $this=this;$obj.contextMenu("navTabCM",{bindings:{reload:function(t,m){$this._reload(t,!0)},closeCurrent:function(tabId,m){tabId=tabId.attr("tabid");tabId?$this.closeTab(tabId):$this.closeCurrentTab()},closeOther:function(index,m){index=$this._indexTabId(index.attr("tabid"));$this._closeOtherTab(0 li")},_getPanels:function(){return this._panelBox.find("> div")},_getMoreLi:function(){return this._moreBox.find("> li")},_getTab:function(index){index=this._indexTabId(index);if(0<=index)return this._getTabs().eq(index)},getPanel:function(index){index=this._indexTabId(index);if(0<=index)return this._getPanels().eq(index)},_getTabsW:function(iStart,iEnd){return this._tabsW(this._getTabs().slice(iStart,iEnd))},_tabsW:function($tabs){var iW=0;return $tabs.each(function(){iW+=$(this).outerWidth(!0)}),iW},_indexTabId:function(tabid){if(!tabid)return-1;var iOpenIndex=-1;return this._getTabs().each(function(index){$(this).attr("tabid")==tabid&&(iOpenIndex=index)}),iOpenIndex},_getLeft:function(){return this._tabBox.position().left},_getScrollBarW:function(){return this.componentBox.width()-90},_visibleStart:function(){for(var iLeft=this._getLeft(),iW=0,$tabs=this._getTabs(),i=0;i<$tabs.length;i++){if(0<=iW+iLeft)return i;iW+=$tabs.eq(i).outerWidth(!0)}return 0},_visibleEnd:function(){for(var iLeft=this._getLeft(),iW=0,$tabs=this._getTabs(),i=0;i<$tabs.length;i++)if((iW+=$tabs.eq(i).outerWidth(!0))+iLeft>this._getScrollBarW())return i;return $tabs.length},_scrollPrev:function(){var iStart=this._visibleStart();iStart>=this.step?this._scrollTab(-this._getTabsW(0,iStart-this.step)):0=this._visibleEnd()&&this._scrollTab(this._getScrollBarW()-this._getTabs().eq(this._currentIndex).outerWidth(!0)-this._getTabsW(0,this._currentIndex))},_ctrlScrollBut:function(){var iW=this._tabsW(this._getTabs());this._getScrollBarW()>iW?(this._prevBut.hide(),this._nextBut.hide(),this._tabBox.parent().removeClass("tabsPageHeaderMargin")):(this._prevBut.show().removeClass("tabsLeftDisabled"),this._nextBut.show().removeClass("tabsRightDisabled"),this._tabBox.parent().addClass("tabsPageHeaderMargin"),0<=this._getLeft()?this._prevBut.addClass("tabsLeftDisabled"):this._getLeft()<=this._getScrollBarW()-iW+.5&&this._nextBut.addClass("tabsRightDisabled"))},_switchTab:function(iTabIndex){var $tab=this._getTabs().removeClass("selected").eq(iTabIndex).addClass("selected");this._getPanels().each(function(){$(".iframe-box",$(this)).length?$(this).css("visibility","hidden").height(0):$(this).hide()});var currentPanel=this._getPanels().eq(iTabIndex);"hidden"===currentPanel.css("visibility")?currentPanel.css("visibility","visible").css("height","auto"):currentPanel.show(),this._getMoreLi().removeClass("selected").eq(iTabIndex).addClass("selected"),this._currentIndex=iTabIndex,this._scrollCurrent(),this._reload($tab)},_closeTab:function(index,openIndex){this._getTabs().eq(index).remove(),this._getPanels().eq(index).trigger(JUI.eventType.pageClear).remove(),this._getMoreLi().eq(index).remove(),this._currentIndex>=index&&this._currentIndex--,!openIndex||0<(openIndex=this._indexTabId(openIndex))&&(this._currentIndex=openIndex),this._init(),this._scrollCurrent(),this._reload(this._getTabs().eq(this._currentIndex))},closeTab:function(index){index=this._indexTabId(index);0'),this._getTabs().eq(this._currentIndex).after($(' ').attr("tabid",tabid).prepend($(' ').attr("title",op.title).text(op.title))),this._getMoreLi().eq(this._currentIndex).after($(" ").append($(' ').attr("title",op.title).text(op.title))),$tab=($tabs=this._getTabs()).eq(this._currentIndex+1),$panel=this._getPanels().eq(this._currentIndex+1),op.external||url.isExternalUrl()?($tab.addClass("external"),navTab.openExternal(url,$panel)):($tab.removeClass("external"),$panel.ajaxUrl({type:"GET",url:url,data:op.data,callback:function(){navTab._loadUrlCallback($panel)}})),$.History&&setTimeout(function(){$.History.addHistory(tabid,function(i){i=navTab._indexTabId(i);0<=i&&navTab._switchTab(i)},tabid)},10),this._currentIndex=this._currentIndex+1,this._contextmenu($tabs.eq(this._currentIndex))),this._init(),this._scrollCurrent(),this._getTabs().eq(this._currentIndex).attr("url",url)}};!function($){$.fn.extend({tabs:function(options){var op=$.extend({reverse:!1,eventType:"click",currentIndex:0,stTabHeader:"> .tabsHeader",stTab:">.tabsHeaderContent>ul",stTabPanel:"> .tabsContent",ajaxClass:"j-ajax",closeClass:"close",prevClass:"tabsLeft",nextClass:"tabsRight"},options);return this.each(function(){!function initTab(jT){var jSelector=jT.add($("> *",jT));var jTabHeader=$(op.stTabHeader,jSelector);var jTabs=$(op.stTab+" li",jTabHeader);var jGroups=$(op.stTabPanel+" > *",jSelector);jTabs.off().find("a").off();jTabHeader.find("."+op.prevClass).off();jTabHeader.find("."+op.nextClass).off();jTabs.each(function(iTabIndex){op.currentIndex==iTabIndex?$(this).addClass("selected"):$(this).removeClass("selected"),"hover"==op.eventType?$(this).on("mouseenter",function(event){switchTab(jT,iTabIndex)}):$(this).click(function(event){switchTab(jT,iTabIndex)}),$("a",this).each(function(){$(this).hasClass(op.ajaxClass)?$(this).click(function(event){var jGroup=jGroups.eq(iTabIndex);this.href&&!jGroup.attr("loaded")&&jGroup.loadUrl(this.href,{},function(){jGroup.find("[layoutH]").layoutH(),jGroup.attr("loaded",!0)}),event.preventDefault()}):$(this).hasClass(op.closeClass)&&$(this).click(function(event){return jTabs.eq(iTabIndex).remove(),jGroups.eq(iTabIndex).remove(),iTabIndex==op.currentIndex?op.currentIndex=iTabIndex+1 *",jTabs)),jGroups=$(op.stTabHeader,jTab),jTabs=$(op.stTab+" li",jGroups),jGroups=$(op.stTabPanel+" > *",jTab),jTab=jTabs.eq(iTabIndex);jGroups.eq(iTabIndex);op.reverse&&jTab.hasClass("selected")?(jTabs.removeClass("selected"),jGroups.hide()):(op.currentIndex=iTabIndex,jTabs.removeClass("selected"),jTab.addClass("selected"),jGroups.hide().eq(op.currentIndex).show())}}})}(jQuery),$.setRegional("alertMsg",{title:{error:"Error",info:"Information",warn:"Warning",correct:"Successful",confirm:"Confirmation"},butMsg:{ok:"OK",yes:"Yes",no:"No",cancel:"Cancel"}});var alertMsg={_boxId:"#alertMsgBox",_bgId:"#alertBackground",_closeTimer:null,_types:{error:"error",info:"info",warn:"warn",correct:"correct",confirm:"confirm"},_getTitle:function(key){return $.regional.alertMsg.title[key]},_keydownOk:function(event){if(event.keyCode==JUI.keyCode.ENTER||event.keyCode==JUI.keyCode.BACKSPACE)return event.data.target.trigger("click"),!1},_keydownEsc:function(event){event.keyCode==JUI.keyCode.ESC&&event.data.target.trigger("click")},_open:function(type,boxHtml,buttons){$(this._boxId).remove();var butsHtml="";if(buttons)for(var i=0;i',document,!0)).appendTo("body")),form.target="callbackframe",_iframeResponse($iframe[0],callback||JUI.ajaxDone)}function _iframeResponse(iframe,callback){var $iframe=$(iframe),$document=$(document);$document.trigger("ajaxStart"),$iframe.on("load",null,null,function(event){if($iframe.off("load"),$document.trigger("ajaxStop"),'javascript:"%3Chtml%3E%3C/html%3E";'!=iframe.src&&'javascript:"";'!=iframe.src){var response,doc=iframe.contentDocument||iframe.document;if(!(doc.readyState&&"complete"!=doc.readyState||doc.body&&"false"==doc.body.innerHTML)){if(doc.XMLDocument)response=doc.XMLDocument;else if(doc.body)try{response=$iframe.contents().find("body").text(),response=JSON.parse(response)}catch(e){response=doc.body.innerHTML}else response=doc;callback(response)}}})}function navTabAjaxDone(json){var $pagerForm;JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&(json.navTabId?"page"==json.rel?navTab.reloadFlag(json.navTabId,2):navTab.reloadFlag(json.navTabId):0!=($pagerForm=$(".pagerForm",navTab.getCurrentPanel())).length&&$pagerForm.submit(),"closeCurrent"==json.callbackType?setTimeout(function(){navTab.closeCurrentTab(json.navTabId)},100):"forward"==json.callbackType?json.navTabId?navTab.reload(json.forwardUrl,{navTabId:json.navTabId}):navTab.reload(json.forwardUrl):"forwardConfirm"==json.callbackType&&alertMsg.confirm(json.confirmMsg||JUI.msg("forwardConfirmMsg"),{okCall:function(){navTab.reload(json.forwardUrl)},cancelCall:function(){navTab.closeCurrentTab(json.navTabId)}}))}function dialogAjaxDone(json){var $pagerForm;JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&(json.navTabId?navTab.reload(json.forwardUrl,{navTabId:json.navTabId}):(navTab.getCurrentPanel(),0!=($pagerForm=$(".pagerForm",navTab.getCurrentPanel())).length&&$pagerForm.submit()),"closeCurrent"==json.callbackType&&$.pdialog.closeCurrent())}function navTabSearch($form,navTabId){$form=$($form);return navTab.reload($form.attr("action"),{data:$form.serializeArray(),navTabId:navTabId}),!1}function dialogSearch(form){var $form=$(form);return form[JUI.pageInfo.pageNum]&&(form[JUI.pageInfo.pageNum].value=1),$.pdialog.reload($form.attr("action"),{data:$form.serializeArray()}),!1}function divSearch(form,rel){var $box,$form=$(form);return form[JUI.pageInfo.pageNum]&&(form[JUI.pageInfo.pageNum].value=1),rel&&($box=$("#"+rel)).ajaxUrl({type:"POST",url:$form.attr("action"),data:$form.serializeArray(),callback:function(){$box.find("[layoutH]").layoutH()}}),!1}function _getPagerForm(form,args){form=$(".pagerForm",form).get(0);return form&&(args.pageNum&&(form[JUI.pageInfo.pageNum].value=args.pageNum),args.numPerPage&&(form[JUI.pageInfo.numPerPage].value=args.numPerPage),args.orderField&&(form[JUI.pageInfo.orderField].value=args.orderField),args.orderDirection&&form[JUI.pageInfo.orderDirection]&&(form[JUI.pageInfo.orderDirection].value=args.orderDirection)),form}function dwzPageBreak(params){var $box,form,op=$.extend({targetType:"navTab",rel:"",data:{pageNum:"",numPerPage:"",orderField:"",orderDirection:""},callback:null},params),params="dialog"==op.targetType?$.pdialog.getCurrent():navTab.getCurrentPanel();op.rel?(form=_getPagerForm($box=params.find("#"+op.rel),op.data))&&$box.ajaxUrl({type:"POST",url:$(form).attr("action"),data:$(form).serializeArray(),callback:function(){$box.find("[layoutH]").layoutH()}}):(form=_getPagerForm(params,op.data),params=$(form).serializeArray(),"dialog"==op.targetType?form&&$.pdialog.reload($(form).attr("action"),{data:params,callback:op.callback}):form&&navTab.reload($(form).attr("action"),{data:params,callback:op.callback}))}function navTabPageBreak(args,rel){dwzPageBreak({targetType:"navTab",rel:rel,data:args})}function dialogPageBreak(args,rel){dwzPageBreak({targetType:"dialog",rel:rel,data:args})}function ajaxTodo(url,callback){var $callback=callback||navTabAjaxDone;"function"!=typeof $callback&&($callback=eval("("+callback+")")),$.ajax({type:"POST",url:url,dataType:"json",cache:!1,success:$callback,error:JUI.ajaxError})}function uploadifyQueueComplete(queueData){var msg="The total number of files uploaded: "+queueData.uploadsSuccessful+" The total number of errors while uploading: "+queueData.uploadsErrored+" The total number of bytes uploaded: "+queueData.queueBytesUploaded+" The average speed of all uploaded files: "+queueData.averageSpeed;queueData.uploadsErrored?alertMsg.error(msg):alertMsg.correct(msg)}function uploadifySuccess(file,data,response){alert(data)}function uploadifyError(file,errorCode,errorMsg){alertMsg.error(errorCode+": "+errorMsg)}function uploadifyError(event,queueId,fileObj,errorObj){alert("event:"+event+"\nqueueId:"+queueId+"\nfileObj.name:"+fileObj.name+"\nerrorObj.type:"+errorObj.type+"\nerrorObj.info:"+errorObj.info)}!function($){$.pdialog={_op:{height:500,width:850,minH:40,minW:50,total:20,max:!1,mask:!1,resizable:!0,drawable:!0,maxable:!0,minable:!0,focusNewWindow:!1,fresh:!0},_current:null,_zIndex:42,getCurrent:function(){return this._current},reload:function(url,options){var jDContent,op=$.extend({data:{},dialogId:"",callback:null},options),dialog=op.dialogId&&$("body").data(op.dialogId)||this._current;dialog&&(jDContent=dialog.find(".dialogContent")).ajaxUrl({type:"POST",url:url,data:op.data,callback:function(response){jDContent.find("[layoutH]").layoutH(jDContent),$(":button.close",dialog).click(function(){return $.pdialog.close(dialog),!1}),"function"==typeof op.callback&&op.callback(response)}})},open:function(url,dlgid,title,options){var jDContent,op=$.extend({},$.pdialog._op,options),dialog=$("body").data(dlgid);dialog&&!op.focusNewWindow?(dialog.is(":hidden")&&dialog.show(),op.max&&($.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy")),!op.fresh&&url==dialog.data("url")||(dialog.data("url",url),dialog.find(".dialogHeader").find("h1").text(title),this.switchDialog(dialog),(jDContent=dialog.find(".dialogContent")).loadUrl(url,{},function(){jDContent.find("[layoutH]").layoutH(jDContent),$("button.close").click(function(){return $.pdialog.close(dialog),!1})}))):(op.focusNewWindow&&(dlgid+=Math.round(1e7*Math.random())),dialog=$($.parseHTML(JUI.frag.dialogFrag,document,!0)).appendTo($("body")),(dialog=$(dialog)).data("id",dlgid),dialog.data("url",url),options.close&&dialog.data("close",options.close),options.param&&dialog.data("param",options.param),dialog.find(".dialogHeader").find("h1").text(title),dialog.css("zIndex",$.pdialog._zIndex+=2),$.pdialog._init(dialog,options),dialog.click(function(){$.pdialog.switchDialog(dialog)}),op.resizable&&dialog.jresize(),op.drawable&&dialog.dialogDrag(),$("a.close",dialog).click(function(event){return $.pdialog.close(dialog),!1}),op.maxable?$("a.maximize",dialog).show().click(function(event){return $.pdialog.switchDialog(dialog),$.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy"),!1}):$("a.maximize",dialog).hide(),$("a.restore",dialog).click(function(event){return $.pdialog.restore(dialog),dialog.jresize().dialogDrag(),!1}),op.minable?$("a.minimize",dialog).show().click(function(event){return $.pdialog.minimize(dialog),!1}):$("a.minimize",dialog).hide(),$("div.dialogHeader a",dialog).mousedown(function(){return!1}),$("div.dialogHeader",dialog).dblclick(function(){($("a.restore",dialog).is(":hidden")?$("a.maximize",dialog):$("a.restore",dialog)).trigger("click")}),op.max&&($.pdialog.maxsize(dialog),dialog.jresize("destroy").dialogDrag("destroy")),$("body").data(dlgid,dialog),$.pdialog._current=dialog,(jDContent=$(".dialogContent",dialog)).loadUrl(url,{},function(){jDContent.find("[layoutH]").layoutH(jDContent),$("button.close").click(function(){return $.pdialog.close(dialog),!1})})),op.mask?(dialog.css("zIndex",1e3),$("a.minimize",dialog).hide(),dialog.data("mask",!0),$("#dialogBackground").show()):op.minable&&$.taskBar.addDialog(dlgid,title)},switchDialog:function(dialog){var cindex,index=dialog.css("zIndex");$.pdialog._current&&(cindex=$($.pdialog._current).css("zIndex"),$.pdialog._current.css("zIndex",index),dialog.css("zIndex",cindex),$.pdialog._current=dialog),$.taskBar.switchTask(dialog.data("id"))},_init:function(dialog,height){var iTop=$.extend({},this._op,height),height=iTop.height>iTop.minH?iTop.height<$(document).height()?iTop.height:$(document).height():iTop.minH,iTop=iTop.width>iTop.minW?iTop.width<$(document).width()?iTop.width:$(document).width():iTop.minW;(isNaN(dialog.height())||dialog.height()=$(window).height()-$(".dialogHeader",$(height.options.dialog)).outerHeight())return!1;var target=height.options.target,width=current.owidth,height=current.oheight;return"n"!=target&&"s"!=target&&(width+=0<=target.indexOf("w")?-lmove:lmove),width>=$.pdialog._op.minW&&(0<=target.indexOf("w")&&(current.el.style.left=current.oleft+lmove+"px"),"n"!=target&&"s"!=target&&(current.el.style.width=width+"px")),"w"!=target&&"e"!=target&&(height+=0<=target.indexOf("n")?-tmove:tmove),height>=$.pdialog._op.minH&&(0<=target.indexOf("n")&&(current.el.style.top=current.otop+tmove+"px"),"w"!=target&&"e"!=target&&(current.el.style.height=height+"px")),$.layerdrag.preventEvent(e)},stop:function(e){var current=$.layerdrag.current,data=$.data(current.el,"layer-drag");return $(document).off("mousemove",null,$.layerdrag.drag),$(document).off("mouseup",null,$.layerdrag.stop),data.options.stop&&data.options.stop.apply(current.el,[current.el]),$.layerdrag.current=null,$.layerdrag.preventEvent(e)},preventEvent:function(e){return e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),!1}}}(jQuery),function($){$.fn.jTable=function(options){return this.each(function(){for(var $table=$(this),nowrapTD=$table.attr("nowrapTD"),tlength=$table.width(),aStyles=[],$tc=$table.parent().addClass("j-resizeGrid"),oldThs=$table.find("thead>tr:last-child").find("th"),i=0,l=oldThs.length;i');var $grid=$table.parent().html($table.html()),thead=$grid.find("thead");thead.wrap('');var ths=$(">tr:last-child",thead),ths=$(">th",ths);$("th",thead).each(function(){var $th=$(this);$th.html(''+$th.html()+"
")}),ths.each(function(style){var $th=$(this),style=aStyles[style];$th.addClass(style[1]).removeAttr("align").removeAttr("width").width(style[0])}).filter("[orderField]").orderBy({targetType:$table.attr("targetType"),rel:$table.attr("rel"),asc:$table.attr("asc")||"asc",desc:$table.attr("desc")||"desc",orderField:$table.attr("orderField"),orderType:$table.attr("orderType")});var tbody=$grid.find(">tbody");tbody.wrap('');var ftr=$(">tr:first-child",tbody);tbody.find(">tr").each(function(){for(var $tr=$(this),$ftds=$(">td",this),i=0;i<$ftds.length;i++){var $ftd=$($ftds[i]);"false"!=nowrapTD&&$ftd.html(""+$ftd.html()+"
"),itr.selected").removeClass("selected"),$tr.addClass("selected");var sTarget=$tr.attr("target");sTarget&&(0==$("#"+sTarget,$grid).length&&$grid.prepend(' '),$("#"+sTarget,$grid).val($tr.attr("rel")))}),$(".edit",$tr).length?$tr.dblclick(function(){$(".edit",$tr).eq(0).click()}):$(".icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).length&&$tr.dblclick(function(){$(".icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).eq(0).parent().click()})}),$(">td",ftr).each(function(i){i
');var scroller=$(".gridScroller",$grid);scroller.scroll(function(event){var scroll,header=$(".gridThead",$grid);return 0tr",thead).each(function(){$(">th",this).each(function(i){var th=this,$th=$(this);$th.mouseover(function(offset){offset=$.jTableTool.getOffset(th,offset).offsetX;return $th.outerWidth()-offset<5?$th.css("cursor","col-resize").mousedown(function(event){$(".resizeProxy",$grid).show().css({left:$.jTableTool.getRight(th)-$(".gridScroller",$grid).scrollLeft(),top:$.jTableTool.getTop(th),height:$.jTableTool.getHeight(th,$grid),cursor:"col-resize"}),$(".resizeMarker",$grid).show().css({left:$.jTableTool.getLeft(th)+1-$(".gridScroller",$grid).scrollLeft(),top:$.jTableTool.getTop(th),height:$.jTableTool.getHeight(th,$grid)}),$(".resizeProxy",$grid).jDrag($.extend(options,{scop:!0,cellMinW:20,relObj:$(".resizeMarker",$grid)[0],move:"horizontal",event:event,stop:function(){var newW=$(".resizeProxy",$grid).position().left-$(".resizeMarker",$grid).position().left-$th.outerWidth()-9,$table2=($.jTableTool.getColspan($th),$.jTableTool.getCellNum($th)),oldW=$th.width(),newW=$th.width()+newW,$table2=$(">td",ftr).eq($table2-1);$th.width(newW+"px"),$table2.width(newW+"px");$table2=$(thead).parent();$table2.width($table2.width()-oldW+newW+"px");$table2=$(tbody).parent();$table2.width($table2.width()-oldW+newW+"px"),$(".resizeMarker,.resizeProxy",$grid).hide()}}))}):($th.css("cursor",$th.attr("orderField")?"pointer":"default"),$th.off("mousedown")),!1})})}),$(window).off(JUI.eventType.resizeGrid).on("resizeGrid",null,null,function(){$("div.j-resizeGrid").each(function(){var width=$(this).innerWidth();width&&($("div.gridScroller",this).width(width+"px"),width-20>$("div.gridHeader>.gridThead>table",this).width()&&($("div.gridHeader>.gridThead>table",this).width(width-20+"px"),$("div.gridScroller>.gridTbody>table",this).width(width-20+"px")))})})})},$.jTableTool={getLeft:function(obj){var width=0;return $(obj).prevAll().each(function(){width+=$(this).outerWidth()}),width-1},getRight:function(obj){var width=0;return $(obj).prevAll().addBack().each(function(){width+=$(this).outerWidth()}),width-1},getTop:function(obj){var height=0;return $(obj).parent().prevAll().each(function(){height+=$(this).outerHeight()}),height},getHeight:function(obj,parent){var height=0;return $(obj).parent().nextAll().addBack().each(function(){height+=$(this).outerHeight()}),$(".gridTbody",parent).children().each(function(){height+=$(this).outerHeight()}),height},getCellNum:function(obj){return $(obj).prevAll().addBack().length},getColspan:function(obj){return $(obj).attr("colspan")||1},getStart:function(obj){var start=1;return $(obj).prevAll().each(function(){start+=parseInt($(this).attr("colspan")||1)}),start},getPageCoord:function(element){for(var coord={x:0,y:0};element;)coord.x+=element.offsetLeft,coord.y+=element.offsetTop,element=element.offsetParent;return coord},getOffset:function(evtset_offsetX,eventCoord_y){if(/msie/.test(navigator.userAgent.toLowerCase())){var pageCoord=$(evtset_offsetX).offset(),evtset_offsetX=eventCoord_y.pageX||eventCoord_y.screenX,eventCoord_x=eventCoord_y.pageY||eventCoord_y.screenY;return{offsetX:evtset_offsetX-pageCoord.left,offsetY:eventCoord_x-pageCoord.top}}eventCoord_x=eventCoord_y.target;null==eventCoord_x.offsetLeft&&(eventCoord_x=eventCoord_x.parentNode);pageCoord=$.jTableTool.getPageCoord(eventCoord_x),eventCoord_x=window.pageXOffset+eventCoord_y.clientX,eventCoord_y=window.pageYOffset+eventCoord_y.clientY;return{offsetX:eventCoord_x-pageCoord.x,offsetY:eventCoord_y-pageCoord.y}}}}(jQuery),function($){$.fn.extend({cssTable:function(options){return this.each(function(){var $this=$(this),$trs=$this.find("tbody>tr"),$grid=$this.parent();$trs.each(function(index){var $tr=$(this);$tr.click(function(){$this.find("tbody>tr.selected").removeClass("selected"),$tr.addClass("selected");var sTarget=$tr.attr("target");sTarget&&(0==$("#"+sTarget,$grid).length&&$grid.prepend(' '),$("#"+sTarget,$grid).val($tr.attr("rel")))}),$(".edit",$tr).length?$tr.dblclick(function(){$(".edit",$tr).eq(0).click()}):$(".panelBar .icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).length&&$tr.dblclick(function(){$(".panelBar .icon-edit",$.pdialog.getCurrent()?$.pdialog.getCurrent():navTab.getCurrentPanel()).eq(0).parent().click()})}),$this.find("thead [orderField]").orderBy({targetType:$this.attr("targetType"),rel:$this.attr("rel"),asc:$this.attr("asc")||"asc",desc:$this.attr("desc")||"desc",orderField:$this.attr("orderField"),orderType:$this.attr("orderType")})})}})}(jQuery),function($){$.fn.extend({orderBy:function(options){var op=$.extend({targetType:"navTab",rel:"",asc:"asc",desc:"desc",orderType:"",orderField:""},options);return this.each(function(){var $this=$(this).click(function(){var orderField=$this.attr("orderField"),orderDirection=$this.hasClass(op.asc)?op.desc:op.asc;dwzPageBreak({targetType:op.targetType,rel:op.rel,data:{orderField:orderField,orderDirection:orderDirection}})});op.orderField==$this.attr("orderField")?op.asc==op.orderType?$this.addClass(op.asc):op.desc==op.orderType?$this.addClass(op.desc):$this.addClass("order"):$this.addClass("order")})}})}(jQuery),function($){$.fn.extend({jTask:function(options){return this.each(function(){var $task=$(this),id=$task.attr("id");$task.click(function(e){var dialog=$("body").data(id);return $task.hasClass("selected")?$("a.minimize",dialog).trigger("click"):$(dialog).is(":hidden")?$.taskBar.restoreDialog(dialog):$(dialog).trigger("click"),$.taskBar.scrollCurrent($(this)),!1}),$("div.close",$task).click(function(e){return $.pdialog.close(id),!1})})}}),$.taskBar={_taskBar:null,_taskBox:null,_prevBut:null,_nextBut:null,_op:{id:"taskbar",taskBox:"div.taskbarContent",prevBut:".taskbarLeft",prevDis:"taskbarLeftDisabled",nextBut:".taskbarRight",nextDis:"taskbarRightDisabled",selected:"selected",boxMargin:"taskbarMargin"},init:function(options){var $this=this;$.extend(this._op,options),this._taskBar=$("#"+this._op.id),0==this._taskBar.length&&(this._taskBar=$($.parseHTML(JUI.frag.taskbar,document,!0)).appendTo($("body")),this._taskBar.find(".taskbarLeft"),this._taskBar.find(".taskbarRight")),this._taskBox=this._taskBar.find(this._op.taskBox),this._taskList=this._taskBox.find(">ul"),this._prevBut=this._taskBar.find(this._op.prevBut),this._nextBut=this._taskBar.find(this._op.nextBut),this._prevBut.click(function(e){$this.scrollLeft()}),this._nextBut.click(function(e){$this.scrollRight()}),this._contextmenu(this._taskBox)},_contextmenu:function(obj){$(obj).contextMenu("dialogCM",{bindings:{closeCurrent:function(obj,m){obj=obj.isTag("li")?obj:$.taskBar._getCurrent();$("div.close",obj).trigger("click")},closeOther:function(selector,m){var selector=selector.isTag("li")?"#"+selector.attr("id"):".selected",tasks=$.taskBar._taskList.find(">li:not(:"+selector+")");tasks.each(function(i){$("div.close",tasks[i]).trigger("click")})},closeAll:function(t,m){var tasks=$.taskBar._getTasks();tasks.each(function(i){$("div.close",tasks[i]).trigger("click")})}},ctrSub:function(t,mOther){var mCur=mOther.find('[rel="closeCurrent"]'),mOther=mOther.find('[rel="closeOther"]');$.taskBar._getCurrent()[0]?1==$.taskBar._getTasks().length&&mOther.addClass("disabled"):(mCur.addClass("disabled"),mOther.addClass("disabled"))}})},_scrollCurrent:function(){var $this,left;this._tasksW(this._getTasks())>this._getTaskBarW()?(left=$(">li:last-child",($this=this)._taskList),left=this._getTaskBarW()-left.position().left-left.outerWidth(!0),this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()})):this._ctrlScrollBut()},_getTaskBarW:function(){return this._taskBox.width()-(this._prevBut.is(":hidden")?this._prevBut.width()+2:0)-(this._nextBut.is(":hidden")?this._nextBut.width()+2:0)},_scrollTask:function(task){var left,$this=this;task.position().left+this._getLeft()+task.outerWidth()>this._getBarWidth()?(left=this._getTaskBarW()-task.position().left-task.outerWidth(!0)-2,this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()})):task.position().left+this._getLeft()<0&&(left=this._getLeft()-(task.position().left+this._getLeft()),this._taskList.animate({left:left+"px"},200,function(){$this._ctrlScrollBut()}))},_ctrlScrollBut:function(){var iW=this._tasksW(this._getTasks());this._getTaskBarW()>iW?(this._taskBox.removeClass(this._op.boxMargin),this._nextBut.hide(),this._prevBut.hide(),this._getTasks().eq(0)[0]&&this._scrollTask(this._getTasks().eq(0))):(this._taskBox.addClass(this._op.boxMargin),this._nextBut.show().removeClass(this._op.nextDis),this._prevBut.show().removeClass(this._op.prevDis),0<=this._getLeft()&&this._prevBut.addClass(this._op.prevDis),this._getLeft()<=this._getTaskBarW()-iW&&this._nextBut.addClass(this._op.nextDis))},_getLeft:function(){return this._taskList.position().left},_visibleStart:function(){for(var iLeft=this._getLeft(),jTasks=this._getTasks(),i=0;ithis._getBarWidth())return jTasks.eq(i);return jTasks.eq(jTasks.length-1)},_getTasks:function(){return this._taskList.find(">li")},_tasksW:function(jTasks){var iW=0;return jTasks.each(function(){iW+=$(this).outerWidth(!0)}),iW},_getBarWidth:function(){return this._taskBar.innerWidth()},addDialog:function(id,title){this.show();var task=$("#"+id,this._taskList);task[0]?$(">div.taskbutton",task).text(title):(this._taskList.append('#title#
'.replace("#taskid#",id).replace("#title#",title)),(task=$("#"+id,this._taskList)).jTask()),this._contextmenu(task),this.switchTask(id),this._scrollTask(task)},closeDialog:function(obj){("string"==typeof obj?$("#"+obj,this._taskList):obj).remove(),0==this._getTasks().length&&this.hide(),this._scrollCurrent()},restoreDialog:function(task){var dialog="string"==typeof task?$("body").data(task):task,id="string"==typeof task?task:dialog.data("id"),task=$.taskBar.getTask(id);$(".resizable").css({top:$(window).height()-60,left:$(task).position().left,height:$(task).outerHeight(),width:$(task).outerWidth()}).show().animate({top:$(dialog).css("top"),left:$(dialog).css("left"),width:$(dialog).css("width"),height:$(dialog).css("height")},250,function(){$(this).hide(),$(dialog).show(),$.pdialog._current=dialog}),$.taskBar.switchTask(id)},inactive:function(id){$("#"+id,this._taskList).removeClass("selected")},scrollLeft:function(){var task=this._visibleStart();this._scrollTask(task)},scrollRight:function(){var task=this._visibleEnd();this._scrollTask(task)},scrollCurrent:function(task){this._scrollTask(task)},switchTask:function(id){this._getCurrent().removeClass("selected"),this.getTask(id).addClass("selected")},_getCurrent:function(){return this._taskList.find(">.selected")},getTask:function(id){return $("#"+id,this._taskList)},show:function(){this._taskBar.is(":hidden")&&(this._taskBar.css("top",$(window).height()-34+this._taskBar.outerHeight()).show(),this._taskBar.animate({top:$(window).height()-this._taskBar.outerHeight()},500))},hide:function(){this._taskBar.animate({top:$(window).height()-29+this._taskBar.outerHeight(!0)},500,function(){$.taskBar._taskBar.hide()})}}}(jQuery),function($){$.extend({History:{_hash:new Array,_currentHash:"",_callback:void 0,init:function(iframe){$.History._callback=iframe;var current_hash=location.hash.replace(/\?.*$/,"");$.History._currentHash=current_hash,$.support.leadingWhitespace||(""==$.History._currentHash&&($.History._currentHash="#"),$("body").append(''),(iframe=(iframe=$("#jQuery_history")[0]).contentDocument||iframe.contentWindow.document).open(),iframe.close(),iframe.location.hash=current_hash),"function"==typeof this._callback&&$.History._callback(current_hash.skipChar("#")),setInterval($.History._historyCheck,100)},_historyCheck:function(){var current_hash="";(current_hash=($.support.leadingWhitespace?location:$("#jQuery_history")[0].contentWindow.location).hash.skipChar("#").replace(/\?.*$/,""))!=$.History._currentHash&&($.History._currentHash=current_hash,$.History.loadHistory(current_hash))},addHistory:function(hash,fun,iframe){$.History._currentHash=hash,$.History._hash.push([hash,fun,iframe]),$.support.leadingWhitespace||((iframe=(iframe=$("#jQuery_history")[0]).contentDocument||iframe.contentWindow.document).open(),iframe.close(),iframe.location.hash=hash.replace(/\?.*$/,"")),location.hash=hash.replace(/\?.*$/,"")},loadHistory:function(hash){$.support.leadingWhitespace||(location.hash=hash);for(var i=0;i<$.History._hash.length;i+=1)if($.History._hash[i][0]==hash)return void $.History._hash[i][1]($.History._hash[i][2])}}})}(jQuery),$.fn.extend({ajaxTodo:function(){return this.each(function(){var $this=$(this);$this.click(function(event){var url=$this.attr("href").replaceTmById($(event.target).parents(".unitBox").first());if(JUI.debug(url),!url.isFinishedTm())return alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1;var title=$this.attr("title");title?alertMsg.confirm(title,{okCall:function(){ajaxTodo(url,$this.attr("callback"))}}):ajaxTodo(url,$this.attr("callback")),event.preventDefault()})})},dwzExport:function(){function _doExport(url){var $form="dialog"==url.attr("targetType")?$.pdialog.getCurrent():navTab.getCurrentPanel(),$form=$(".pagerForm",$form),url=url.attr("href");window.location=url+(-1==url.indexOf("?")?"?":"&")+$form.serialize()}return this.each(function(){var $this=$(this);$this.click(function(event){var title=$this.attr("title");title?alertMsg.confirm(title,{okCall:function(){_doExport($this)}}):_doExport($this),event.preventDefault()})})}}),function($){var _lookup={currentGroup:"",suffix:"",$target:null,pk:"id",nextButton:null},_util={_lookupPrefix:function(key){var strDot=_lookup.currentGroup?".":"";return _lookup.currentGroup+strDot+key},lookupPk:function(key){return this._lookupPrefix(key)},lookupSuffix:function(){return _lookup.suffix}};function suggest(args,key,$input){""!==_util.lookupSuffix()&&$input.attr("suffix")!==_util.lookupSuffix()||($input.hasClass("editor")?"ckeditor"==$input.attr("editorType")?CKEDITOR.instances[$input.data("id")].setData(args[key]):("tinymce"==$input.attr("editorType")?tinymce.get($input.data("id")):UE.instants[$input.data("id")]).setContent(args[key]):$input.hasClass("code")?JUI.instances[$(this).data("id")].setValue(args[key]):$input.val(args[key]).trigger("change"))}$.extend({bringBackSuggest:function(args,keys){var $box=_lookup.$target.parents(".unitBox").first();if(keys)$.each(keys,function(n,key){$box.find(":input[name="+escapeJquery(_util.lookupPk(key))+"]").each(function(){for(var k in args)_lookup.suffix=k,suggest(args,k,$(this))})});else for(var key in args)$box.find(":input[name="+escapeJquery(_util.lookupPk(key))+"]").each(function(){suggest(args,key,$(this))})},bringBack:function(json){json[JUI.keys.statusCode]==JUI.statusCode.error?json[JUI.keys.message]&&alertMsg.error(json[JUI.keys.message]):json[JUI.keys.statusCode]==JUI.statusCode.timeout?alertMsg.error(json[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}}):($.bringBackSuggest(json),$.pdialog.closeCurrent())},batchBringBack:function(args,keys){if(_lookup.nextButton){if(args[JUI.keys.statusCode]==JUI.statusCode.timeout)alertMsg.error(args[JUI.keys.message]||JUI.msg("sessionTimout"),{okCall:function(){JUI.loadLogin()}});else for(var row in args){if(_lookup.nextButton.click(),args[row][JUI.keys.statusCode]==JUI.statusCode.error){args[row][JUI.keys.message]&&alertMsg.error(args[row][JUI.keys.message]);break}$.bringBackSuggest(args[row],keys)}_lookup.nextButton=null}$.pdialog.closeCurrent()}}),$.fn.extend({lookup:function(){return this.each(function(){var $this=$(this),options={mask:!0,width:$this.attr("width")||820,height:$this.attr("height")||500,maxable:eval($this.attr("maxable")||"true"),resizable:eval($this.attr("resizable")||"true")};$this.click(function(url){_lookup=$.extend(_lookup,{currentGroup:$this.attr("lookupGroup")||"",suffix:$this.attr("suffix")||"",$target:$this,pk:$this.attr("lookupPk")||""});url=$this.attr("href").replaceTmById($(url.target).parents(".unitBox").first());return url.isFinishedTm()?$.pdialog.open(url,"_blank",$this.attr("title")||$this.text(),options):alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1})})},multLookup:function(){return this.each(function(){var $this=$(this),args={};$this.click(function(event){return $this.parents(".unitBox").first().find('[name="'+$this.attr("multLookup")+'"]').filter(":checked").each(function(){var key,_args=JUI.jsonEval($(this).val());for(key in _args){var value=args[key]?args[key]+",":"";args[key]=value+_args[key]}}),$.isEmptyObject(args)?alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")):$.bringBack(args),!1})})},suggest:function(){var op_suggest$="#suggest",selectedIndex=-1;return this.each(function(){var callbackFields,$input=$(this).attr("autocomplete","off").keydown(function(event){if(event.keyCode==JUI.keyCode.ENTER&&$(op_suggest$).is(":visible"))return!1}),suggestFields=$input.attr("suggestFields").split(",");function _show(event){var url=$input.offset(),postData=url.top+this.offsetHeight,$suggest=$(op_suggest$);($suggest=0==$suggest.length?$('
').appendTo($("body")):$suggest).css({left:url.left+"px",top:postData+"px"}).show(),_lookup=$.extend(_lookup,{currentGroup:$input.attr("lookupGroup")||"",suffix:$input.attr("suffix")||"",$target:$input,pk:$input.attr("lookupPk")||""});url=$input.attr("suggestUrl").replaceTmById($(event.target).parents(".unitBox").first());if(!url.isFinishedTm())return alertMsg.error($input.attr("warn")||JUI.msg("alertSelectMsg")),!1;postData={};return postData[$input.attr("postField")||"inputValue"]=$input.val(),$.ajax({global:!1,type:"POST",dataType:"json",url:url,cache:!1,data:postData,success:function($lis){if($lis){var html="";$.each($lis,function(i){for(var key,liAttr="",liLabel="",i=0;i'+liLabel+""});$lis=$suggest.html("").find("li");if($lis.click(function(){_select($(this),callbackFields),$input.next().hasClass("suggestButton")&&$input.next().click()}),0==$lis.length){$suggest.hide();for(var jsonStr="",i=0;i=$items.length-1?selectedIndex=-1:selectedIndex++;break;case JUI.keyCode.UP:selectedIndex<0?selectedIndex=$items.length-1:selectedIndex--;break;default:_show(event)}$items.removeClass("selected"),0<=selectedIndex&&_select($items.eq(selectedIndex).addClass("selected"),callbackFields)})})},itemDetail:function(){return this.each(function(){var $table=$(this).css("clear","both"),$tbody=$table.find("tbody"),fields=[];$table.find("thead th[type]").each(function(i){var field=$(this),field={type:field.attr("type")||"text",patternDate:field.attr("dateFmt")||"yyyy-MM-dd",name:field.attr("name")||"",suffix:field.attr("suffix")||"",defaultVal:escapeHtml(field.attr("defaultVal")||""),size:field.attr("size")||"12",enumUrl:field.attr("enumUrl")||"",lookupGroup:field.attr("lookupGroup")||"",lookupUrl:field.attr("lookupUrl")||"",lookupPk:field.attr("lookupPk")||"id",suggestUrl:field.attr("suggestUrl"),suggestFields:field.attr("suggestFields"),postField:field.attr("postField")||"",fieldClass:field.attr("fieldClass")||"",fieldAttrs:field.attr("fieldAttrs")||"",title:field.text(),pkValue:field.attr("pkValue")};fields.push(field)}),$tbody.find("a.btnDel").click(function(){var $btnDel=$(this);return $btnDel.is("[href^=javascript]")?($btnDel.parents("tr").first().remove(),initSuffix($tbody)):$btnDel.attr("title")?alertMsg.confirm($btnDel.attr("title"),{okCall:delDbData}):delDbData(),!1;function delDbData(){$.ajax({type:"POST",dataType:"json",url:$btnDel.attr("href"),cache:!1,success:function(){$btnDel.parents("tr").first().remove(),initSuffix($tbody)},error:JUI.ajaxError})}});var $caption,$addBut,batchUrl,$rowNum,trTm,batchButtonTxt=$table.attr("addButton")||"Add New";batchButtonTxt&&($caption=$(" ").appendTo($table),$addBut=$(''+batchButtonTxt+" ").appendTo($caption).find("button"),batchButtonTxt=$table.attr("batchButton")||"Batch upload",(batchUrl=$table.attr("batchUrl"))?$(''+batchButtonTxt+" ").initUI().appendTo($caption).find("a").click(function(){_lookup=$.extend(_lookup,{nextButton:$addBut})}):$rowNum=$(' ').appendTo($caption).find("input"),trTm="",$addBut.click(function(){trTm=trTm||function(fields){var html="";return $(fields).each(function(){html+=function(field){var html="",suffixFrag=field.suffix?' suffix="'+field.suffix+'"':"",attrFrag="";if(field.fieldAttrs){var key,attrs=JUI.jsonEval(field.fieldAttrs);for(key in attrs)attrFrag+=key+'="'+attrs[key]+'" '}switch(field.type){case"del":html=' ';break;case"lookup":var strDot,suggestFrag="";field.suggestFields&&(suggestFrag='autocomplete="off" lookupGroup="'+field.lookupGroup+'"'+suffixFrag+' lookupPk="'+field.lookupPk+'" suggestUrl="'+field.suggestUrl+'" suggestFields="'+field.suggestFields+'" postField="'+field.postField+'"'),field.lookupPk&&(strDot=field.lookupGroup?".":"",html+=' '),html+='"+field.title+" ";break;case"attach":html='"+field.title+" ";break;case"enum":$.ajax({type:"POST",dataType:"html",async:!1,url:field.enumUrl,data:{inputName:field.name,lookupPk:field.lookupPk,pkValue:field.pkValue},success:function(response){html=response}});break;case"date":html=' ";break;case"checkbox":html=' ";break;case"textarea":html='";break;case"number":html=' ";break;default:html=' "}return""+html+" "}(this)}),''+html+" "}(fields);var rowNum=1;if(!batchUrl)try{rowNum=parseInt($rowNum.val())}catch(e){}for(var i=0;itr.selected").removeClass("selected"),$tr.addClass("selected")})}initSuffix($tbody);var $batch=$tr.find(".btnAttach");$batch.length?_lookup=$.extend(_lookup,{currentGroup:$batch.attr("lookupGroup")||"",suffix:$batch.attr("suffix")||"",$target:$batch,pk:$batch.attr("lookupPk")||""}):!_lookup.nextButton||($batch=$tr.find("[batchGroup]")).length&&(_lookup=$.extend(_lookup,{currentGroup:$batch.attr("batchGroup")||"",suffix:$batch.attr("suffix")||"",$target:$batch,pk:$batch.attr("lookupPk")||""}))}))});function initSuffix($tbody){$tbody.find(">tr").each(function(i){$(":input, a.btnLook, a.btnAttach",this).each(function(){var $this=$(this),suffix=$this.attr("name"),val=$this.val();suffix&&$this.attr("name",suffix.replaceSuffix(i));suffix=$this.attr("lookupGroup");suffix&&$this.attr("lookupGroup",suffix.replaceSuffix(i));suffix=$this.attr("batchGroup");suffix&&$this.attr("batchGroup",suffix.replaceSuffix(i));suffix=$this.attr("suffix");suffix&&$this.attr("suffix",suffix.replaceSuffix(i)),val&&0<=val.indexOf("#index#")&&$this.val(val.replace("#index#",i+1))})})}},selectedTodo:function(){function _getIds(selectedIds,targetType){var ids="";return("dialog"==targetType?$.pdialog.getCurrent():navTab.getCurrentPanel()).find("input:checked").filter('[name="'+selectedIds+'"]').each(function(i){var val=$(this).val();ids+=0==i?val:","+val}),ids}return this.each(function(){var $this=$(this),selectedIds=$this.attr("rel")||"ids",postType=$this.attr("postType")||"map";$this.click(function(){var targetType=$this.attr("targetType"),ids=_getIds(selectedIds,targetType);if(!ids)return alertMsg.error($this.attr("warn")||JUI.msg("alertSelectMsg")),!1;var _callback=$this.attr("callback")||("dialog"==targetType?dialogAjaxDone:navTabAjaxDone);function _doPost(){$.ajax({type:"POST",url:$this.attr("href"),dataType:"json",cache:!1,data:function(){if("map"==postType)return $.map(ids.split(","),function(val,i){return{name:selectedIds,value:val}});var _data={};return _data[selectedIds]=ids,_data}(),success:_callback,error:JUI.ajaxError})}"function"!=typeof _callback&&(_callback=eval("("+_callback+")"));var title=$this.attr("title");return title?alertMsg.confirm(title,{okCall:_doPost}):_doPost(),!1})})}})}(jQuery),function($){function _onchange(event){var $ref=$("select[name="+escapeJquery(event.data.$this.attr("ref"))+"]");if(0==$ref.length)return!1;event.data.$this.attr("index")&&($ref=$ref.eq(event.data.$this.attr("index"))),$.ajax({type:"POST",dataType:"json",url:event.data.$this.attr("refUrl").replace("{value}",encodeURIComponent(event.data.$this.val())),cache:!1,data:{},success:function(json){var $refCombox;json&&($ref.empty(),$.each(json,function(i){json[i]&&1").attr("value",json[i][0]).text(json[i][1]).appendTo($ref)}),$refCombox=$ref.parents("div.combox:first"),$ref.insertAfter($refCombox),$refCombox.remove(),$ref.trigger("change").combox())},error:JUI.ajaxError})}var allSelectBox=[],killAllBox=function(bid){$.each(allSelectBox,function(i){allSelectBox[i]!=bid&&($("#"+allSelectBox[i])[0]?$("#op_"+allSelectBox[i]).css({height:"",width:""}).hide():$("#op_"+allSelectBox[i]).remove(),$("#"+allSelectBox[i]).children("a").removeClass("expand"),$(document).off("click",null,killAllBox))})};$.extend($.fn,{comboxSelect:function(options){var op=$.extend({selector:">a"},options);return this.each(function(){var box=$(this),selector=$(op.selector,box);allSelectBox.push(box.attr("id")),$(op.selector,box).click(function(){var top,left,options=$("#op_"+box.attr("id")),optionlist=$("ul",options);return options.is(":hidden")?(box.children("a").addClass("expand"),600$(window).height()-20&&(top=top-box.outerHeight(!0)-options.outerHeight(!0)-1),(left=box.offset().left)+options.outerWidth(!0)>$(window).width()&&(left=$(window).width()-options.outerWidth(!0)-1),options.css({top:top,left:left}).show(),$("a.selected",options).length&&0==optionlist.scrollTop()&&optionlist.stop().animate({scrollTop:$("a.selected",optionlist).offset().top+60-options.height()-optionlist.offset().top},500),$(".search input",options).focus().keyup(function(){var val=$(this).val();val?($("li",optionlist).hide(),$("li a:contains("+escapeJquery(val)+")",optionlist).parent().show(),$("li a",optionlist).each(function(){-1<$(this).attr("value").indexOf(val)&&$(this).parent().show()})):$("li",optionlist).show(),$("li.disabled",optionlist).hide()}).click(function(){return!1}).val(""),$("li",optionlist).show(),$("li.disabled",optionlist).hide(),killAllBox(box.attr("id")),$(document).click(killAllBox)):($(document).off("click",null,killAllBox),killAllBox()),!1}),$("#op_"+box.attr("id")).find(" li").comboxOption(selector,box)})},comboxOption:function(selector,box){return this.each(function(){$(">a",this).click(function(){var $this=$(this);$this.parent().parent().find(".selected").removeClass("selected"),$this.addClass("selected"),selector.text($this.text()),$("select",box).val()!=$this.attr("value")&&$("select",box).val($this.attr("value")).trigger("change")})})},combox:function(){var _selectBox=[];return $.each(allSelectBox,function(i){$("#"+allSelectBox[i])[0]?_selectBox.push(allSelectBox[i]):$("#op_"+allSelectBox[i]).remove()}),allSelectBox=_selectBox,this.each(function(i){var $this=$(this).removeClass("combox"),select=$this.parents("div.combox:first");select.length&&($this.insertAfter(select),select.remove()),$this.hasClass("requiredIfNotEmpty")&&(0==$("option",$this).length||1==$("option",$this).length&&!$("option",$this).val()?$this.removeClass("required"):$this.addClass("required"));var name=$this.attr("name"),value=$this.val(),label="";void 0!==value&&value?label=$("option[value="+escapeJquery(value)+"]",$this).text():""==value&&(label=$('option[value=""]',$this).text());var ref=$this.attr("ref"),refUrl=$this.attr("refUrl")||"",cid=$this.attr("id")||Math.round(1e7*Math.random()),select='";var options='",$("body").append(options),$this.after(select),$("div.select",$this.next()).comboxSelect().append($this),ref&&refUrl&&$this.off("change",null,_onchange).on("change",null,{$this:$this},_onchange)})},comboxDisable:function(){return this.each(function(){$(this).parents(".combox .select:first").addClass("disabled")})},comboxEnable:function(){return this.each(function(){$(this).parents(".combox .select:first").removeClass("disabled")})},comboxVal:function(val){return this.each(function(){var $box=$(this).parents(".combox .select:first");$("#op_"+$box.attr("id")).find('li a[value="'+escapeJquery(val)+'"]').trigger("click")})}})}(jQuery),function($){$.fn.extend({checkboxCtrl:function(parent){return this.each(function(){var $trigger=$(this);$trigger.click(function(){var type,group=$trigger.attr("group");$trigger.is(":checkbox")?(type=$trigger.is(":checked")?"all":"none",group&&$.checkbox.select(group,type,parent)):group&&$.checkbox.select(group,$trigger.attr("selectType")||"all",parent)})})}}),$.checkbox={selectAll:function(_name,_parent){this.select(_name,"all",_parent)},unSelectAll:function(_name,_parent){this.select(_name,"none",_parent)},selectInvert:function(_name,_parent){this.select(_name,"invert",_parent)},select:function(_name,_type,_parent){switch($parent=$(_parent||document),$checkboxLi=$parent.find(':checkbox[name="'+_name+'"]'),_type){case"invert":$checkboxLi.each(function(){$checkbox=$(this),$checkbox.prop("checked",!$checkbox.is(":checked"))});break;case"none":$checkboxLi.prop("checked",!1);break;default:$checkboxLi.prop("checked",!0)}}}}(jQuery),function($){$.validator&&($.validator.addMethod("alphanumeric",function(value,element){return this.optional(element)||/^\w+$/i.test(value)},"Letters, numbers or underscores only please"),$.validator.addMethod("nocommas",function(value,element){return this.optional(element)||/^[^,]+$/i.test(value)},"Cannot contain commas"),$.validator.addMethod("lettersonly",function(value,element){return this.optional(element)||/^[a-z]+$/i.test(value)},"Letters only please"),$.validator.addMethod("letterstart",function(value,element){return this.optional(element)||/^[a-z]+\w+$/i.test(value)},"Letters, numbers or underscores only please,The first character must be letter"),$.validator.addMethod("phone",function(value,element){return this.optional(element)||/^[0-9 \(\)]{7,30}$/.test(value)},"Please specify a valid phone number"),$.validator.addMethod("postcode",function(value,element){return this.optional(element)||/^[0-9 A-Za-z]{5,20}$/.test(value)},"Please specify a valid postcode"),$.validator.addMethod("domain",function(value,element){return this.optional(element)||/^((((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(\[?((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\]?)|(localhost)|(loopback)|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)*)?$/i.test(value)},"Please specify a valid domain"),$.validator.addMethod("date",function(value,element){if(value=value.replace(/\s+/g,""),String.prototype.parseDate){var $input=$(element),pattern=$input.attr("dateFmt")||"yyyy-MM-dd";return!$input.val()||$input.val().parseDate(pattern)}return this.optional(element)||value.match(/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/)},"Please enter a valid date."),$.validator.addMethod("customvalid",function(value,element,params){try{return eval("("+params+")")}catch(e){return!1}},"Please fix this field."),$.validator.addClassRules({date:{date:!0},alphanumeric:{alphanumeric:!0},lettersonly:{lettersonly:!0},phone:{phone:!0},postcode:{postcode:!0}}),$.validator.setDefaults({errorElement:"span"}),$.validator.autoCreateRanges=!0)}(jQuery),function($){function readAsDataURL(img,file){var aImg,reader=new FileReader;reader.onload=(aImg=img,function(e){aImg.src=e.target.result}),reader.readAsDataURL(file)}function editImg($uploadWrap,img,fileName,callback){var $this=$uploadWrap.parent().find(".image-editor");$this.length?$this.data("id")&&delete JUI.instances[$this.data("id")]:($uploadWrap.after('
'),$this=$uploadWrap.parent().find(".image-editor")),$this.on("click","button",function(){return!1});var dataId="imageEditor_"+window.imageEditor.index++,widthInput=$uploadWrap.find("input[name=width]"),heightInput=$uploadWrap.find("input[name=height]");function initSize(imageEditor,width,height){width&&height&&imageEditor&&imageEditor.render({Crop:{autoResize:!0,presetsItems:[{titleKey:"custom",descriptionKey:width+"*"+height,width:width,height:height,disableManualResize:!0}]}})}function init(editor,dataId,img,fileName){filerobotImageEditorConfig.source=img,filerobotImageEditorConfig.defaultSavedImageName=fileName,JUI.instances[dataId]=new FilerobotImageEditor(editor[0],filerobotImageEditorConfig),JUI.instances[dataId].render({onSave:function(imageData,imageDesignState){$.isFunction(callback)&&callback(imageData.imageBase64,imageData.fullName)},onClose:function(closingReason,haveNotSavedChanges){delete JUI.instances[dataId]}}),initSize(JUI.instances[dataId],parseInt(widthInput.val()),parseInt(heightInput.val()))}widthInput.change(function(){JUI.instances[$this.data("id")]&&initSize(JUI.instances[$this.data("id")],parseInt(widthInput.val()),parseInt(heightInput.val()))}),heightInput.change(function(){JUI.instances[$this.data("id")]&&initSize(JUI.instances[$this.data("id")],parseInt(widthInput.val()),parseInt(heightInput.val()))}),window.imageEditor.initd?init($this,dataId,img,fileName):loadScripts(window.imageEditor.resources,function(){window.imageEditor.initd=!0,init($this,dataId,img,fileName)}),$this.attr("data-id",dataId)}$.fn.extend({editImg:function(options){$uploadWrap=$(this);var $previewElem=$uploadWrap.find(".thumbnail");0==$previewElem.length&&($previewElem=$('
').appendTo($uploadWrap));var img=document.createElement("img");img.src=options.imgUrl,$previewElem.empty().append(img),0==$previewElem.find(".del-icon").length&&$(' ').appendTo($previewElem).click(function(){$previewElem.remove(),$uploadWrap.find("input[type=file]").val("")}),editImg($(this),options.imgUrl,options.imgName,function(dataURL,fileName){dataURL&&(img.src=dataURL,$uploadWrap.find("input[name=base64File]").val(dataURL.substring(dataURL.indexOf("base64,")+7)),$uploadWrap.find("input[name=originalFilename]").val(fileName),$uploadWrap.find("input[type=file]").val(""),0!=$previewElem.find(".del-icon").length&&$previewElem.find(".del-icon").click(function(){$previewElem.remove(),$uploadWrap.find("input[name=base64File]").val(""),$uploadWrap.find("input[name=originalFilename]").val("")}))})}}),$.fn.extend({previewUploadImg:function(options){var op=$.extend({maxW:80},options);return this.each(function(){var $uploadWrap=$(this);$uploadWrap.find("input[type=file]").each(function(index){$(this).css({left:op.maxW*index+"px"}).on("change",function(){var files=this.files;(this.multiple?function(rel,files){var rel=rel.attr("rel"),$previewElem=$(rel);$previewElem.empty();for(var index=0;index'),img=document.createElement("img");img.file=file,$thumb.append(img),$previewElem.append($thumb),readAsDataURL(img,file)}}:function($uploadWrap,files){var $previewElem=$('
').appendTo($uploadWrap),file=files[0];if(file){if(!file.type.match(/image.*/))throw"File Type must be an image";var img=document.createElement("img");img.file=file,$previewElem.empty().append(img),0==$previewElem.find(".del-icon").length&&$(' ').appendTo($previewElem).click(function(){$previewElem.remove(),$uploadWrap.find("input[type=file]").val("")}),0==$previewElem.find(".edit-icon").length&&$uploadWrap.find("input[name=base64File]").length&&$(' ').appendTo($previewElem).click(function(){editImg($uploadWrap,img,file.name,function(dataURL,fileName){dataURL&&(img.src=dataURL,$uploadWrap.find("input[name=base64File]").val(dataURL.substring(dataURL.indexOf("base64,")+7)),$uploadWrap.find("input[name=originalFilename]").val(fileName),$uploadWrap.find("input[type=file]").val(""))})}),readAsDataURL(img,file)}})($uploadWrap,files)})});var $delIcon=$uploadWrap.find(".del-icon");$delIcon&&$delIcon.click(function(){return $.ajax({type:"GET",url:$delIcon.attr("href"),dataType:"json",cache:!1,success:function(json){JUI.ajaxDone(json),json[JUI.keys.statusCode]==JUI.statusCode.ok&&($uploadWrap.find("div.thumbnail").remove(),$uploadWrap.find("input[type=file]").val(""))},error:JUI.ajaxError}),!1})})}}),JUI.regPlugins.push(function($p){$("div.upload-wrap",$p).previewUploadImg({maxW:300})})}(jQuery);
\ No newline at end of file
diff --git a/publiccms-parent/publiccms/src/main/webapp/resource/js/jui/file.js b/publiccms-parent/publiccms/src/main/webapp/resource/js/jui/file.js
index 701ad759a..cfc473abc 100644
--- a/publiccms-parent/publiccms/src/main/webapp/resource/js/jui/file.js
+++ b/publiccms-parent/publiccms/src/main/webapp/resource/js/jui/file.js
@@ -58,6 +58,9 @@
$uploadWrap.after("
");
$this = $uploadWrap.parent().find(".image-editor");
}
+ $this.on("click","button",function(){
+ return false;
+ });
var index = window.imageEditor.index++;
var dataId = "imageEditor_"+index;
var widthInput=$uploadWrap.find("input[name=width]");
diff --git a/publiccms-parent/publiccms/src/main/webapp/resource/js/loadscripts.config.js b/publiccms-parent/publiccms/src/main/webapp/resource/js/loadscripts.config.js
index 77c806c42..79f805022 100644
--- a/publiccms-parent/publiccms/src/main/webapp/resource/js/loadscripts.config.js
+++ b/publiccms-parent/publiccms/src/main/webapp/resource/js/loadscripts.config.js
@@ -26,7 +26,7 @@
index: 0
};
window.imageEditor = {
- resources: [window.LOADSCRIPTS_BASE + "/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js"],
+ resources: [window.LOADSCRIPTS_BASE + "/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js",window.LOADSCRIPTS_BASE + "/resource/plugins/filerobot-image-editor/config.js",window.LOADSCRIPTS_BASE + "/resource/plugins/filerobot-image-editor/lang/" + window.LANGUAGE+".js"],
initd: false,
index: 0
};
diff --git a/publiccms-parent/publiccms/src/main/webapp/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js b/publiccms-parent/publiccms/src/main/webapp/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js
index 8c96742e3..4d00ad43d 100644
--- a/publiccms-parent/publiccms/src/main/webapp/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js
+++ b/publiccms-parent/publiccms/src/main/webapp/resource/plugins/filerobot-image-editor/filerobot-image-editor.min.js
@@ -1,8 +1,8 @@
/**
- * filerobot-image-editor v4.5.0
+ * filerobot-image-editor v4.8.1
* https://github.com/scaleflex/filerobot-image-editor
* Copyright (c) 2019 Scaleflex
* Released under the MIT license
- * Date: 2023-06-09T12:35:22.501Z
+ * Date: 2024-05-16T15:01:14.937Z
*/
-!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).FilerobotImageEditor=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(t){return t=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return String(t);if("object"!==e(r=r.call(t,n)))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string"),"symbol"===e(t)?t:String(t)}function n(e,n){for(var r=0;r>>1,i=e[r];if(!(0>>1;rt)||e&&!we());){var r,i=U.callback;"function"==typeof i?(U.callback=null,X=U.priorityLevel,r=i(U.expirationTime<=t),t=H.unstable_now(),"function"==typeof r?U.callback=r:U===pe(W)&&ge(W),ve(t)):ge(W),U=pe(W)}var o;return null!==U||(null!==(o=pe(G))&&Ee(ye,o.startTime-t),!1)}finally{U=null,X=n,Y=!1}}function we(){return!(H.unstable_now()-ae")?i.replace("",e.displayName):i}while(1<=l&&0<=s);break}}}finally{rt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nt(e):""}function ot(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return function e(t){if(null!=t){if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case Be:return"Fragment";case Fe:return"Portal";case We:return"Profiler";case Ve:return"StrictMode";case Xe:return"Suspense";case Ye:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case Ze:return(t.displayName||"Context")+".Consumer";case Ge:return(t._context.displayName||"Context")+".Provider";case Ue:var n=t.render;return(t=t.displayName)||(""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef");case qe:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case $e:n=t._payload,t=t._init;try{return e(t(n))}catch(r){}}}return null}(t);case 8:return t===Ve?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function at(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function lt(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function st(e){e._valueTracker||(e._valueTracker=function(e){var t,n,r=lt(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),o=""+e[r];if(!e.hasOwnProperty(r)&&void 0!==i&&"function"==typeof i.get&&"function"==typeof i.set)return t=i.get,n=i.set,Object.defineProperty(e,r,{configurable:!0,get:function(){return t.call(this)},set:function(e){o=""+e,n.call(this,e)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return o},setValue:function(e){o=""+e},stopTracking:function(){e._valueTracker=null,delete e[r]}}}(e))}function ct(e){var t,n,r;if(e)return(t=e._valueTracker)?(n=t.getValue(),r="",(e=r=e?lt(e)?e.checked?"true":"false":e.value:r)!==n&&(t.setValue(e),1)):1}function ut(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function dt(e,t){var n=t.checked;return tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ft(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=at(null!=t.value?t.value:n);e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function ht(e,t){null!=(t=t.checked)&&Ne(e,"checked",t,!1)}function pt(e,t){ht(e,t);var n=at(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?mt(e,t.type,n):t.hasOwnProperty("defaultValue")&&mt(e,t.type,at(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function gt(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function mt(e,t,n){"number"===t&&ut(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vt=Array.isArray;function yt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ot.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}};var Ot,kt,Pt="undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return kt(e,t)}))}:kt;function _t(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Lt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tt=["Webkit","ms","Moz","O"];function It(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Lt.hasOwnProperty(e)&&Lt[e]?(""+t).trim():t+"px"}function Mt(e,t){for(var n in e=e.style,t){var r,i;t.hasOwnProperty(n)&&(r=0===n.indexOf("--"),i=It(n,t[n],r),"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i)}}Object.keys(Lt).forEach((function(e){Tt.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Lt[t]=Lt[e]}))}));var jt=tt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rt(e,t){if(t){if(jt[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Oe(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Oe(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Oe(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Oe(62))}}function Dt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var At=null;function zt(e){return 3===(e=(e=e.target||e.srcElement||window).correspondingUseElement?e.correspondingUseElement:e).nodeType?e.parentNode:e}var Nt=null,Ht=null,Ft=null;function Bt(e){if(e=wo(e)){if("function"!=typeof Nt)throw Error(Oe(280));var t=e.stateNode;t&&(t=xo(t),Nt(e.stateNode,e.type,t))}}function Vt(e){Ht?Ft?Ft.push(e):Ft=[e]:Ht=e}function Wt(){if(Ht){var e=Ht,t=Ft;if(Ft=Ht=null,Bt(e),t)for(e=0;e>>=0)?32:31-(xn(e)/En|0)|0},xn=Math.log,En=Math.LN2,Sn=64,On=4194304;function kn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pn(e,t){var n=e.pendingLanes;if(0===n)return 0;var r,i=0,o=e.suspendedLanes,a=e.pingedLanes,l=268435455&n;if(0!=l?0!=(r=l&~o)?i=kn(r):0!=(a&=l)&&(i=kn(a)):0!=(l=n&~o)?i=kn(l):0!==a&&(i=kn(a)),0===i)return 0;if(0!==t&&t!==i&&0==(t&o)&&((a=t&-t)<=(o=i&-i)||16===o&&0!=(4194240&a)))return t;if(0!=(4&i)&&(i|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=i;0>=r,o-=r,Ko=1<<32-Cn(t)+o|n<S?(O=E,E=null):O=E.sibling;var k=f(v,E,b[S],w);if(null===k){null===E&&(E=O);break}e&&E&&null===k.alternate&&t(v,E),y=o(k,y,S),null===x?C=k:x.sibling=k,x=k,E=O}if(S===b.length)n(v,E);else if(null===E)for(;SR?(D=j,j=null):D=j.sibling;var z=f(P,j,A.value,T);if(null===z){null===j&&(j=D);break}e&&j&&null===z.alternate&&t(P,j),_=o(z,_,R),null===M?I=z:M.sibling=z,M=z,j=D}if(A.done)n(P,j);else if(null===j)for(;!A.done;R++,A=L.next())null!==(A=d(P,A.value,T))&&(_=o(A,_,R),null===M?I=A:M.sibling=A,M=A);else{for(j=r(P,j);!A.done;R++,A=L.next())null!==(A=h(j,P,R,A.value,T))&&(e&&null!==A.alternate&&j.delete(null===A.key?R:A.key),_=o(A,_,R),null===M?I=A:M.sibling=A,M=A);e&&j.forEach((function(e){return t(P,e)}))}return oa&&Jo(P,R),I}Ya(0,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,(c=null!==c&&6===c.tag?(n(s,c.sibling),i(c,u)):(n(s,c),Cu(u,s.mode,p))).return=s,a(s=c)):n(s,c)}}var Ka=$a(!0),Qa=$a(!1),Ja={},el=Oo(Ja),tl=Oo(Ja),nl=Oo(Ja);function rl(e){if(e===Ja)throw Error(Oe(174));return e}function il(e,t){switch(Po(nl,t),Po(tl,e),Po(el,Ja),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:St(null,"");break;default:t=St(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ko(el),Po(el,t)}function ol(){ko(el),ko(tl),ko(nl)}function al(e){rl(nl.current);var t=rl(el.current),n=St(t,e.type);t!==n&&(Po(tl,e),Po(el,n))}function ll(e){tl.current===e&&(ko(el),ko(tl))}var sl=Oo(0);function cl(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t=(t.child.return=t).child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ul=[];function dl(){for(var e=0;e<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ho]=t,e[po]=r,Bs(e,t),t.stateNode=e;e:{switch(a=Dt(n,r),n){case"dialog":Fi("cancel",e),Fi("close",e),o=r;break;case"iframe":case"object":case"embed":Fi("load",e),o=r;break;case"video":case"audio":for(o=0;oIc&&(t.flags|=128,Hs(s,!(r=!0)),t.lanes=4194304)}else{if(!r)if(null!==(e=cl(a))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Hs(s,!0),null===s.tail&&"hidden"===s.tailMode&&!a.alternate&&!oa)return Fs(t),null}else 2*fn()-s.renderingStartTime>Ic&&1073741824!==n&&(t.flags|=128,Hs(s,!(r=!0)),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(null!==(n=s.last)?n.sibling=a:t.child=a,s.last=a)}if(null!==s.tail)return t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=fn(),t.sibling=null,n=sl.current,Po(sl,r?1&n|2:1&n),t}return Fs(t),null;case 22:case 23:return eu(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&Cc)&&(Fs(t),6&t.subtreeFlags)&&(t.flags|=8192):Fs(t),null;case 24:case 25:return null}throw Error(Oe(156,t.tag))}(n,t,Cc)))return void(bc=n)}else{if(null!==(n=function(e,t){switch(na(t),t.tag){case 1:return jo(t.type)&&Ro(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return ol(),ko(To),ko(Lo),dl(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ll(t),null;case 13:if(ko(sl),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(Oe(340));pa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return ko(sl),null;case 4:return ol(),null;case 10:return Ea(t.type._context),null;case 22:case 23:return eu(),null;default:return null}}(n,t)))return n.flags&=32767,void(bc=n);if(null===e)return Ec=6,void(bc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(bc=t)}while(bc=t=e,null!==t);0===Ec&&(Ec=5)}function su(e,t,n){var r=jn,i=mc.transition;try{mc.transition=null,jn=1;for(var o=e,a=t,l=n,s=r;cu(),null!==zc;);if(0!=(6&vc))throw Error(Oe(327));l=o.finishedWork;var c=o.finishedLanes;if(null!==l){if(o.finishedWork=null,o.finishedLanes=0,l===o.current)throw Error(Oe(177));o.callbackNode=null,o.callbackPriority=0;var u,d,f=l.lanes|l.childLanes;if(function(e,t){var n=e.pendingLanes&~t,r=(e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements,e.eventTimes);for(e=e.expirationTimes;0=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;i<=e;)(i<<=1)<0&&Bd(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e]))for(var n=this.groupSizes[e],r=(e=this.indexOfGroup(e))+n,i=e;i>>0),t.hasNameForId(r,a)||(o=n(o,"."+a,void 0,r),t.insertRules(r,a,o)),i.push(a),this.staticRulesId=a);else{for(var o,a,l=this.rules.length,s=pf(this.baseHash,n.hash),c="",u=0;u>>0),t.hasNameForId(r,o)||(a=n(c,"."+o,void 0,r),t.insertRules(r,o,a)),i.push(o))}return i.join(" ")},Cf),bf=/^\s*\/\/.*$/gm,wf=[":","[",".","#"];function Cf(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&mf(e),this.componentId=t,this.baseHash=pf(vf,t),this.baseStyle=n,af.registerId(t)}var xf,Ef,Sf,Of,kf,Pf,_f,Lf=ue.createContext(),Tf=(Lf.Consumer,ue.createContext()),If=(Tf.Consumer,new af),Mf=(y=void 0===(y=(mg=void 0===mg?Rd:mg).options)?Rd:y,mg=void 0===(mg=mg.plugins)?jd:mg,Pf=new function(e){function t(e,t,r){var i=t.trim().split(p),o=(t=i).length,a=e.length;switch(a){case 0:case 1:var l=0;for(e=0===a?"":e[0]+" ";l?@[\\\]^`{|}~-]+/g,Kf=/(^-|-$)/g;function Qf(e){return e.replace($f,"-").replace(Kf,"")}var Jf=function(e){return hf(gf(e)>>>0)};function eh(e){return"string"==typeof e&&!0}var th=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},nh=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function rh(e){for(var t=arguments.length,n=new Array(1e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=i.xs&&e<=i.sm?t?n(o.xs):o.xs:e>=i.sm&&e=i.md&&e=i.lg&&e=i.xl?t?n(o.xl):o.xl:t?n(o.md):o.md},up:t,down:function(e){return e=i[e],"@media (max-width:".concat(e).concat("px",")")},between:n,only:function(e){return a.indexOf(e)+1jg.angleDeg?e*Ig:e,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>jg.DD.isDragging,isDragReady:()=>!!jg.DD.node,releaseCanvasOnDestroy:!0,document:Mg.document,_injectGlobal(e){Mg.Konva=e}};mg=e=>{jg[e.prototype.getClassName()]=e},jg._injectGlobal(jg);class Rg{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new Rg(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=(e=Math.sin(e),this.m[0]*t+this.m[2]*e),r=this.m[1]*t+this.m[3]*e,i=this.m[0]*-e+this.m[2]*t;e=this.m[1]*-e+this.m[3]*t;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=e,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=(t=this.m[1]+this.m[3]*t,this.m[2]+this.m[0]*e);e=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=t,this.m[2]=r,this.m[3]=e,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],i=this.m[1]*e.m[2]+this.m[3]*e.m[3],o=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4];e=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=o,this.m[5]=e,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,i=this.m[0]*e,o=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]);e*=this.m[1]*this.m[4]-this.m[0]*this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=o,this.m[5]=e,this}getMatrix(){return this.m}decompose(){var e,t=this.m[0],n=this.m[1],r=this.m[2],i=this.m[3],o=t*i-n*r,a={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};return 0!=t||0!=n?(e=Math.sqrt(t*t+n*n),a.rotation=0!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector:e=>"string"==typeof e&&("#"===(e=e[0])||"."===e||e===e.toUpperCase()),_sign:e=>0===e||0document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=Vg.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb:e=>(e=e.replace("#",""),{r:(e=parseInt(e,16))>>16&255,g:e>>8&255,b:255&e}),getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in Ng?{r:(t=Ng[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=Hg.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:e=>(e=e||"black",Vg._namedColorToRBA(e)||Vg._hex3ColorToRGBA(e)||Vg._hex4ColorToRGBA(e)||Vg._hex6ColorToRGBA(e)||Vg._hex8ColorToRGBA(e)||Vg._rgbColorToRGBA(e)||Vg._rgbaColorToRGBA(e)||Vg._hslColorToRGBA(e)),_namedColorToRBA:e=>(e=Ng[e.toLowerCase()])?{r:e[0],g:e[1],b:e[2],a:1}:null,_rgbColorToRGBA(e){if(0===e.indexOf("rgb("))return{r:(e=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number))[0],g:e[1],b:e[2],a:1}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba("))return{r:(e=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e))))[0],g:e[1],b:e[2],a:e[3]}},_hex8ColorToRGBA(e){if("#"===e[0]&&9===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if("#"===e[0]&&5===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var[,...e]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),t=Number(e[0])/360,n=Number(e[1])/100;e=Number(e[2])/100;let o,a,l;if(0==n)return l=255*e,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};var r=2*e-(o=e<.5?e*(1+n):e+n-e*n),i=[0,0,0];for(let e=0;e<3;e++)(a=t+1/3*-(e-1))<0&&a++,1!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*Dg,radToDeg:e=>e*Ag,_degToRad:e=>(Vg.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Vg.degToRad(e)),_radToDeg:e=>(Vg.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Vg.radToDeg(e)),_getRotation:e=>jg.angleDeg?Vg.radToDeg(e):e,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(zg+e)},error(e){console.error(zg+e)},warn(e){jg.showWarnings&&console.warn("Konva warning: "+e)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&et.length&&(i=t,t=e,e=i),r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...e){jg.releaseCanvasOnDestroy&&e.forEach((e=>{e.width=0,e.height=0}))},drawRoundedRectPath(e,t,n,r){let i=0,o=0,a=0,l=0;"number"==typeof r?i=o=a=l=Math.min(r,t/2,n/2):(i=Math.min(r[0]||0,t/2,n/2),o=Math.min(r[1]||0,t/2,n/2),l=Math.min(r[2]||0,t/2,n/2),a=Math.min(r[3]||0,t/2,n/2)),e.moveTo(i,0),e.lineTo(t-o,0),e.arc(t-o,o,o,3*Math.PI/2,0,!1),e.lineTo(t,n-l),e.arc(t-l,n-l,l,0,Math.PI/2,!1),e.lineTo(a,n),e.arc(a,n-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,i),e.arc(i,i,i,Math.PI,3*Math.PI/2,!1)}};function Wg(e){return Vg._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||Vg._isBoolean(e)?e:Object.prototype.toString.call(e)}function Gg(e){return 255('+e+")"),t}}function Xg(){if(jg.isUnminified)return function(e,t){return Vg._isNumber(e)||"auto"===e||Vg.warn(Wg(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}function Yg(){if(jg.isUnminified)return function(e,t){return Vg._isString(e)||Vg.warn(Wg(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}function qg(){if(jg.isUnminified)return function(e,t){var n=Vg._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||Vg.warn(Wg(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}function $g(){if(jg.isUnminified)return function(e,t){return!0===e||!1===e||Vg.warn(Wg(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}var Kg="get",Qg="set";const Jg={addGetterSetter(e,t,n,r,i){Jg.addGetter(e,t,n),Jg.addSetter(e,t,r,i),Jg.addOverloadedGetterSetter(e,t)},addGetter(e,t,n){var r=Kg+Vg._capitalize(t);e.prototype[r]=e.prototype[r]||function(){var e=this.attrs[t];return void 0===e?n:e}},addSetter(e,t,n,r){var i=Qg+Vg._capitalize(t);e.prototype[i]||Jg.overWriteSetter(e,t,n,r)},overWriteSetter(e,t,n,r){var i=Qg+Vg._capitalize(t);e.prototype[i]=function(e){return n&&null!=e&&(e=n.call(this,e,t)),this._setAttr(t,e),r&&r.call(this),this}},addComponentsGetterSetter(e,t,n,r,i){var o,a,l=n.length,s=Vg._capitalize,c=Kg+s(t),u=Qg+s(t),d=(e.prototype[c]=function(){var e={};for(o=0;o{this._setAttr(t+s(e),void 0)})),this._fireChangeEvent(t,a,e),i&&i.call(this),this},Jg.addOverloadedGetterSetter(e,t)},addOverloadedGetterSetter(e,t){var n=Vg._capitalize(t),r=Qg+n,i=Kg+n;e.prototype[t]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(e,t,n,r){Vg.error("Adding deprecated "+t);var i=Kg+Vg._capitalize(t),o=t+" property is deprecated and will be removed soon. Look at Konva change log for more information.";e.prototype[i]=function(){Vg.error(o);var e=this.attrs[t];return void 0===e?n:e},Jg.addSetter(e,t,r,(function(){Vg.error(o)})),Jg.addOverloadedGetterSetter(e,t)},backCompat(e,t){Vg.each(t,(function(t,n){var r=e.prototype[n],i=Kg+Vg._capitalize(t),o=Qg+Vg._capitalize(t);function a(){r.apply(this,arguments),Vg.error('"'+t+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}e.prototype[t]=a,e.prototype[i]=a,e.prototype[o]=a}))},afterSetFilter(){this._filterUpToDate=!1}};var em,tm=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class nm{constructor(e){this.canvas=e,jg.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){for(var n,r,i,o=this.traceArr,a=o.length,l="",s=0;s"number"==typeof e?Math.floor(e):e)):i).join(",")+")"):(l+=n.property,e||(l+="="+n.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),100<=t.length&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(+e,0,0,+e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){(e=e.attrs.lineCap)&&this.setAttr("lineCap",e)}_applyOpacity(e){1!==(e=e.getAbsoluteOpacity())&&this.setAttr("globalAlpha",e)}_applyLineJoin(e){(e=e.attrs.lineJoin)&&this.setAttr("lineJoin",e)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,i,o){this._context.arc(e,t,n,r,i,o)}arcTo(e,t,n,r,i){this._context.arcTo(e,t,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,i,o){this._context.bezierCurveTo(e,t,n,r,i,o)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,i,o){return this._context.createRadialGradient(e,t,n,r,i,o)}drawImage(e,t,n,r,i,o,a,l,s){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,i):9===c.length&&u.drawImage(e,t,n,r,i,o,a,l,s)}ellipse(e,t,n,r,i,o,a,l){this._context.ellipse(e,t,n,r,i,o,a,l)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,i,o){this._context.setTransform(e,t,n,r,i,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,i,o){this._context.transform(e,t,n,r,i,o)}translate(e,t){this._context.translate(e,t)}_enableTrace(){for(var e,t=this,n=tm.length,r=this.setAttr,i=function(n){var r,i=t[n];t[n]=function(){return e=function(e){for(var t,n=[],r=e.length,i=Vg,o=0;o{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return sm._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const t=[];sm._dragElements.forEach(((n,r)=>{var i,o=n.node;if(i=((i=o.getStage()).setPointersPositions(e),void 0===n.pointerId&&(n.pointerId=Vg._getFirstPointerId(e)),i._changedPointerPositions.find((e=>e.id===n.pointerId)))){if("dragging"!==n.dragStatus){var a=o.dragDistance();if(Math.max(Math.abs(i.x-n.startPointerPos.x),Math.abs(i.y-n.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(e){const t=[];sm._dragElements.forEach((n=>{var r=(r=n.node).getStage();(r=(e&&r.setPointersPositions(e),r._changedPointerPositions.find((e=>e.id===n.pointerId))))&&("dragging"!==n.dragStatus&&"stopped"!==n.dragStatus||(sm.justDragged=!0,jg._mouseListenClick=!1,jg._touchListenClick=!1,jg._pointerListenClick=!1,n.dragStatus="stopped"),r=n.node.getLayer()||n.node instanceof jg.Stage&&n.node)&&-1===t.indexOf(r)&&t.push(r)})),t.forEach((e=>{e.draw()}))},_endDragAfter(e){sm._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&sm._dragElements.delete(n)}))}};jg.isBrowser&&(window.addEventListener("mouseup",sm._endDragBefore,!0),window.addEventListener("touchend",sm._endDragBefore,!0),window.addEventListener("mousemove",sm._drag),window.addEventListener("touchmove",sm._drag),window.addEventListener("mouseup",sm._endDragAfter,!1),window.addEventListener("touchend",sm._endDragAfter,!1));var cm="absoluteOpacity",um="allEventListeners",dm="absoluteTransform",fm="absoluteScale",hm="canvas",pm="listening",gm="mouseenter",mm="mouseleave",vm="transform",ym="visible";p=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(" ");let bm=1;class wm{constructor(e){this._id=bm++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==vm&&e!==dm||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===vm||e===dm)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){return this._attachedDepsListeners.get(e)||(t=t.map((e=>e+"Change.konva")).join(" "),this.on(t,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)),this._getCache(e,n)}_getCanvasCache(){return this._cache.get(hm)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===dm&&this.fire("absoluteTransformChange")}clearCache(){var e,t,n;return this._cache.has(hm)&&(({scene:e,filter:t,hit:n}=this._cache.get(hm)),Vg.releaseCanvas(e,t,n),this._cache.delete(hm)),this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t,n,r={},i=(void 0!==(e=e||{}).x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()})),Math.ceil(e.width||r.width)),o=Math.ceil(e.height||r.height),a=e.pixelRatio,l=void 0===e.x?Math.floor(r.x):e.x,s=(r=void 0===e.y?Math.floor(r.y):e.y,e.offset||0),c=e.drawBorder||!1,u=e.hitCanvasPixelRatio||1;if(i&&o)return l-=s,r-=s,s=new am({pixelRatio:a,width:i+=2*s+1,height:o+=2*s+1}),a=new am({pixelRatio:a,width:0,height:0}),u=new lm({pixelRatio:u,width:i,height:o}),t=s.getContext(),n=u.getContext(),u.isCache=!0,s.isCache=!0,this._cache.delete(hm),(this._filterUpToDate=!1)===e.imageSmoothingEnabled&&(s.getContext()._context.imageSmoothingEnabled=!1,a.getContext()._context.imageSmoothingEnabled=!1),t.save(),n.save(),t.translate(-l,-r),n.translate(-l,-r),this._isUnderCache=!0,this._clearSelfAndDescendantCache(cm),this._clearSelfAndDescendantCache(fm),this.drawScene(s,this),this.drawHit(u,this),this._isUnderCache=!1,t.restore(),n.restore(),c&&(t.save(),t.beginPath(),t.rect(0,0,i,o),t.closePath(),t.setAttr("strokeStyle","red"),t.setAttr("lineWidth",5),t.stroke(),t.restore()),this._cache.set(hm,{scene:s,filter:a,hit:u,x:l,y:r}),this._requestDraw(),this;Vg.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")}isCached(){return this._cache.has(hm)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,t){e=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];var n,r,i,o,a=this.getAbsoluteTransform(t);return e.forEach((function(e){e=a.point(e),void 0===n&&(n=i=e.x,r=o=e.y),n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),o=Math.max(o,e.y)})),{x:n,y:r,width:i-n,height:o-r}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);var t=this._getCanvasCache(),n=(t=(e.translate(t.x,t.y),this._getCachedSceneCanvas())).pixelRatio;e.drawImage(t._canvas,0,0,t.width/n,t.height/n),e.restore()}_drawCachedHitCanvas(e){var t=this._getCanvasCache(),n=t.hit;e.save(),e.translate(t.x,t.y),e.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e,t,n,r,i,o=this.filters(),a=(i=this._getCanvasCache()).scene,l=(i=i.filter).getContext();if(o){if(!this._filterUpToDate){var s=a.pixelRatio;i.setSize(a.width/a.pixelRatio,a.height/a.pixelRatio);try{for(e=o.length,l.clear(),l.drawImage(a._canvas,0,0,a.getWidth()/s,a.getHeight()/s),t=l.getImageData(0,0,i.getWidth(),i.getHeight()),n=0;n{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+Vg._capitalize(t),Vg._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(pm,this._isListening)}_isListening(e){var t;return!!this.listening()&&(!(t=this.getParent())||t===e||this===e||t._isListening(e))}isVisible(){return this._getCache(ym,this._isVisible)}_isVisible(e){var t;return!!this.visible()&&(!(t=this.getParent())||t===e||this===e||t._isVisible(e))}shouldDrawHit(e,t=!1){var n,r;return e?this._isVisible(e)&&this._isListening(e):(n=this.getLayer(),r=!1,sm._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"!==e.node.nodeType&&e.node.getLayer()!==n||(r=!0))})),e=!t&&!jg.hitOnDragEnabled&&r,this.isListening()&&this.isVisible()&&!e)}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,n,r,i=this.getDepth(),o=this,a=0;return"Stage"!==o.nodeType&&function l(s){for(e=[],t=s.length,n=0;n{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){var e,t;return this.getStage()&&(e=this.getStage().getPointerPosition())?((t=this.getAbsoluteTransform().copy()).invert(),t.point(e)):null}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);e=this.getAbsoluteTransform(e).getMatrix();var r=new Rg,i=this.offset();return r.m=e.slice(),r.translate(i.x,i.y),r.getTranslation()}setAbsolutePosition(e){var t=this._clearTransform(),n=(this.attrs.x=t.x,this.attrs.y=t.y,delete t.x,delete t.y,this._clearCache(vm),this._getAbsoluteTransform().copy());return n.invert(),n.translate(e.x,e.y),e={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(t),this.setPosition({x:e.x,y:e.y}),this._clearCache(vm),this._clearSelfAndDescendantCache(dm),this}_setTransform(e){for(var t in e)this.attrs[t]=e[t]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var t=e.x,n=(e=e.y,this.x()),r=this.y();return void 0!==t&&(n+=t),void 0!==e&&(r+=e),this.setPosition({x:n,y:r}),this}_eachAncestorReverse(e,t){var n,r,i=[],o=this.getParent();if(!t||t._id!==this._id){for(i.unshift(this);o&&(!t||o._id!==t._id);)i.unshift(o),o=o.parent;for(n=i.length,r=0;r=this.parent.children.length)&&Vg.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+"."),t=this.index,this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices()):Vg.warn("Node has no parent. zIndex parameter is ignored."),this}getAbsoluteOpacity(){return this._getCache(cm,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r={},i=this.getAttrs();for(e in r.attrs={},i)t=i[e],Vg.isObject(t)&&!Vg._isPlainObject(t)&&!Vg._isArray(t)||(n="function"==typeof this[e]&&this[e],delete i[e],(n?n.call(this):null)!==(i[e]=t)&&(r.attrs[e]=t));return r.className=this.getClassName(),Vg._prepareToStringify(r)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){for(var r=[],i=(t&&this._isMatch(e)&&r.push(this),this.parent);i;){if(i===n)return r;i._isMatch(e)&&r.push(i),i=i.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(e){if("function"==typeof e)return e(this);for(var t,n=e.replace(/ /g,"").split(","),r=n.length,i=0;i{try{const n=null==e?void 0:e.callback;n&&delete e.callback,Vg._urlToImage(this.toDataURL(e),(function(e){t(e),null!=n&&n(e)}))}catch(r){n(r)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null!=n&&n(e)}))}catch(r){n(r)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():jg.dragDistance}_off(e,t,n){for(var r,i,o=this.eventListeners[e],a=0;a{this.isAncestorOf(e.node)&&(t=!0)})),t)||this._createDragElement(e)}))}_dragChange(){var e,t;this.attrs.draggable?this._listenDrag():(this._dragCleanup(),this.getStage()&&(e=(t=sm._dragElements.get(this._id))&&"dragging"===t.dragStatus,t=t&&"ready"===t.dragStatus,e?this.stopDrag():t&&sm._dragElements.delete(this._id)))}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){var t=this.getStage();return!!t&&(t={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y},Vg.haveIntersection(t,this.getClientRect()))}static create(e,t){return Vg._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,i=wm.prototype.getClassName.call(e),o=e.children;t&&(e.attrs.container=t),jg[i]||(Vg.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");var a=new jg[i](e.attrs);if(o)for(n=o.length,r=0;r{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(0!==e.length)if(1{var i=r._isMatch(e);return i&&n.push(r),!(!i||!t)})),n}_descendants(e){for(const t of this.getChildren()){if(e(t))return!0;if(t.hasChildren()&&t._descendants(e))return!0}return!1}toObject(){var e=wm.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=wm.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((function(n){n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null!=(t=this.children)&&t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null!=(e=this.children)&&e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t){var n=this.getLayer(),r=(n=(e=e||n&&n.getCanvas())&&e.getContext(),(r=this._getCanvasCache())&&r.scene),i=e&&e.isCache;return(this.isVisible()||i)&&(r?(n.save(),i=this.getAbsoluteTransform(t).getMatrix(),n.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._drawCachedSceneCanvas(n),n.restore()):this._drawChildren("drawScene",e,t)),this}drawHit(e,t){var n,r;return this.shouldDrawHit(t)&&(n=this.getLayer(),n=(e=e||n&&n.hitCanvas)&&e.getContext(),(r=this._getCanvasCache())&&r.hit?(n.save(),r=this.getAbsoluteTransform(t).getMatrix(),n.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._drawCachedHitCanvas(n),n.restore()):this._drawChildren("drawHit",e,t)),this}_drawChildren(e,t,n){var r,i,o,a=t&&t.getContext(),l=this.clipWidth(),s=this.clipHeight(),c=this.clipFunc(),u=l&&s||c,d=n===this;(c=(u&&(a.save(),i=(r=this.getAbsoluteTransform(n)).getMatrix(),a.transform(i[0],i[1],i[2],i[3],i[4],i[5]),a.beginPath(),c?c.call(this,a,this):(c=this.clipX(),o=this.clipY(),a.rect(c,o,l,s)),a.clip(),i=r.copy().invert().getMatrix(),a.transform(i[0],i[1],i[2],i[3],i[4],i[5])),!d&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e))&&(a.save(),a._applyGlobalCompositeOperation(this)),null!=(o=this.children)&&o.forEach((function(r){r[e](t,n)})),c&&a.restore(),u&&a.restore()}getClientRect(e){for(var t,n,r,i,o,a,l=(e=e||{}).skipTransform,s=e.relativeTo,c=this,u=(null!=(t=this.children)&&t.forEach((function(t){!t.visible()||0===(t=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke})).width&&0===t.height||(o=void 0===n?(n=t.x,r=t.y,i=t.x+t.width,t.y+t.height):(n=Math.min(n,t.x),r=Math.min(r,t.y),i=Math.max(i,t.x+t.width),Math.max(o,t.y+t.height)))})),this.find("Shape")),d=!1,f=0;f0<=e.indexOf("pointer")?"pointer":0<=e.indexOf("touch")?"touch":"mouse",Dm=e=>"pointer"===(e=Rm(e))?jg.pointerEventsEnabled&&jm.pointer:"touch"===e?jm.touch:"mouse"===e?jm.mouse:void 0;function Am(e={}){return(e.clipFunc||e.clipWidth||e.clipHeight)&&Vg.warn("Stage does not support clipping. Please use clip for Layers or Groups."),e}const zm=[];class Nm extends Cm{constructor(e){super(Am(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),zm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{Am(this.attrs)})),this._checkVisibility()}_validateAdd(e){var t="Layer"===e.getType();e="FastLayer"===e.getType();t||e||Vg.throw("You may only add layers to the stage.")}_checkVisibility(){var e;this.content&&(e=this.visible()?"":"none",this.content.style.display=e)}setContainer(e){var t,n;if("string"==typeof e&&!(e="."===e.charAt(0)?(t=e.slice(1),document.getElementsByClassName(t)[0]):(n="#"!==e.charAt(0)?e:e.slice(1),document.getElementById(n))))throw"Can not find container in document with id "+n;return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){for(var e=this.children,t=e.length,n=0;nt.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new am({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){t.isVisible()&&(t=t._toKonvaCanvas(e),n.drawImage(t._canvas,e.x,e.y,t.getWidth()/t.getPixelRatio(),t.getHeight()/t.getPixelRatio()))})),t}getIntersection(e){if(e)for(var t=this.children,n=t.length-1;0<=n;n--){var r=t[n].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e){if(1{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);var t=Dm(e.type);this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);var t=Dm(e.type);this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()?null:t}_pointerleave(e){var t,n,r=Dm(e.type),i=Rm(e.type);r&&(this.setPointersPositions(e),t=this._getTargetShape(i),n=!sm.isDragging||jg.hitOnDragEnabled,t&&n?(t._fireAndBubble(r.pointerout,{evt:e}),t._fireAndBubble(r.pointerleave,{evt:e}),this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this[i+"targetShape"]=null):n&&(this._fire(r.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(r.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[])}_pointerdown(e){const t=Dm(e.type),n=Rm(e.type);var r;t&&(this.setPointersPositions(e),r=!1,this._changedPointerPositions.forEach((i=>{var o=this.getIntersection(i),a=(sm.justDragged=!1,jg["_"+n+"ListenClick"]=!0,o&&o.isListening());a&&(jg.capturePointerEventsEnabled&&o.setPointerCapture(i.id),(this[n+"ClickStartShape"]=o)._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),r=!0,a=0<=e.type.indexOf("touch"),o.preventDefault())&&e.cancelable&&a&&e.preventDefault()})),r||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id}))}_pointermove(e){const t=Dm(e.type),n=Rm(e.type);if(t&&(sm.isDragging&&sm.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!sm.isDragging||jg.hitOnDragEnabled)){var r={};let o=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{var l=Sm(a.id)||this.getIntersection(a),s=(a=a.id,{evt:e,pointerId:a}),c=i!==l;if(c&&i&&(i._fireAndBubble(t.pointerout,Object.assign({},s),l),i._fireAndBubble(t.pointerleave,Object.assign({},s),l)),l){if(r[l._id])return;r[l._id]=!0}l&&l.isListening()?(o=!0,c&&(l._fireAndBubble(t.pointerover,Object.assign({},s),i),l._fireAndBubble(t.pointerenter,Object.assign({},s),i),this[n+"targetShape"]=l),l._fireAndBubble(t.pointermove,Object.assign({},s))):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:a}),this[n+"targetShape"]=null)})),o||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}}_pointerup(e){const t=Dm(e.type),n=Rm(e.type);if(t){this.setPointersPositions(e);const i=this[n+"ClickStartShape"],o=this[n+"ClickEndShape"];var r={};let a=!1;this._changedPointerPositions.forEach((l=>{var s=Sm(l.id)||this.getIntersection(l);if(s){if(s.releaseCapture(l.id),r[s._id])return;r[s._id]=!0}l=l.id;var c={evt:e,pointerId:l};let u=!1;jg["_"+n+"InDblClickWindow"]?(u=!0,clearTimeout(this[n+"DblTimeout"])):sm.justDragged||(jg["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){jg["_"+n+"InDblClickWindow"]=!1}),jg.dblClickWindow),s&&s.isListening()?(a=!0,(this[n+"ClickEndShape"]=s)._fireAndBubble(t.pointerup,Object.assign({},c)),jg["_"+n+"ListenClick"]&&i&&i===s&&(s._fireAndBubble(t.pointerclick,Object.assign({},c)),u)&&o&&o===s&&s._fireAndBubble(t.pointerdblclick,Object.assign({},c))):(this[n+"ClickEndShape"]=null,jg["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:l}),u&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:l}))})),a||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),jg["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Tm,{evt:e}):this._fire(Tm,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Im,{evt:e}):this._fire(Im,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);var t=Sm(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Lm,Om(e)),_m(e.pointerId)}_lostpointercapture(e){_m(e.pointerId)}setPointersPositions(e){var t,n,r=this._getContentPosition();void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-r.left)/r.scaleX,y:(e.clientY-r.top)/r.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-r.left)/r.scaleX,y:(e.clientY-r.top)/r.scaleY})}))):(t=(e.clientX-r.left)/r.scaleX,n=(e.clientY-r.top)/r.scaleY,this.pointerPos={x:t,y:n},this._pointerPositions=[{x:t,y:n,id:Vg._getFirstPointerId(e)}],this._changedPointerPositions=[{x:t,y:n,id:Vg._getFirstPointerId(e)}])}_setPointerPosition(e){Vg.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){var e;return this.content&&this.content.getBoundingClientRect?{top:(e=this.content.getBoundingClientRect()).top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}:{top:0,left:0,scaleX:1,scaleY:1}}_buildDOM(){if(this.bufferCanvas=new am({width:this.width(),height:this.height()}),this.bufferHitCanvas=new lm({pixelRatio:1,width:this.width(),height:this.height()}),jg.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}cache(){return Vg.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}Nm.prototype.nodeType="Stage",mg(Nm),Jg.addGetterSetter(Nm,"container");var Hm="hasShadow",Fm="shadowRGBA",Bm="patternImage",Vm="linearGradient",Wm="radialGradient";let Gm;function Zm(){return Gm=Gm||Vg.createCanvasElement().getContext("2d")}const Um={};class Xm extends wm{constructor(e){let t;for(super(e);!(t=Vg.getRandomColor())||t in Um;);this.colorKey=t,Um[t]=this}getContext(){return Vg.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return Vg.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(Hm,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Bm,this.__getFillPattern)}__getFillPattern(){var e,t;if(this.fillPatternImage())return(e=Zm().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat"))&&e.setTransform&&((t=new Rg).translate(this.fillPatternX(),this.fillPatternY()),t.rotate(jg.getAngle(this.fillPatternRotation())),t.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),t.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY()),t=t.getMatrix(),t="undefined"==typeof DOMMatrix?{a:t[0],b:t[1],c:t[2],d:t[3],e:t[4],f:t[5]}:new DOMMatrix(t),e.setTransform(t)),e}_getLinearGradient(){return this._getCache(Vm,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var t=Zm(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=t.createLinearGradient(n.x,n.y,r.x,r.y),o=0;othis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){var e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage().bufferHitCanvas;return t.getContext().clear(),this.drawHit(t,null,!0),0{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let o=0;othis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class ov{constructor(e){var t,n=this,r=(l=e.node)._id,i=e.easing||av.Linear,o=!!e.yoyo,a=void 0===e.duration?.3:0===e.duration?.001:e.duration,l=(this.node=l,this._id=nv++,l.getLayer()||(l instanceof jg.Stage?l.getLayers():null));for(t in l||Vg.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ev((function(){n.tween.onEnterFrame()}),l),this.tween=new iv(t,(function(e){n._tweenFunc(e)}),i,0,1,1e3*a,o),this._addListeners(),ov.attrs[r]||(ov.attrs[r]={}),ov.attrs[r][this._id]||(ov.attrs[r][this._id]={}),ov.tweens[r]||(ov.tweens[r]={}),e)void 0===tv[t]&&this._addAttr(t,e[t]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,t){var n,r,i,o,a,l,s,c,u=this.node,d=u._id,f=ov.tweens[d][e];if(f&&delete ov.attrs[d][f][e],n=u.getAttr(e),Vg._isArray(t))if(r=[],o=Math.max(t.length,n.length),"points"===e&&t.length!==n.length&&(t.length>n.length?(l=n,n=Vg._prepareArrayForTween(n,t,u.closed())):(a=t,t=Vg._prepareArrayForTween(t,n,u.closed()))),0===e.indexOf("fill"))for(i=0;i{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=ov.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=ov.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=ov.tweens[t];for(e in this.pause(),r)delete ov.tweens[t][e];delete ov.attrs[t][n]}}ov.attrs={},ov.tweens={},wm.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new ov(e).play()};const av={BackEaseIn:(e,t,n,r)=>n*(e/=r)*e*(2.70158*e-1.70158)+t,BackEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t,BackEaseInOut(e,t,n,r){var i=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},ElasticEaseIn(e,t,n,r,i,o){var a=0;return 0===e?t:1==(e/=r)?t+n:(o=o||.3*r,a=!i||i(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-av.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t},lv=Vg._assign(jg,{Util:Vg,Transform:Rg,Node:wm,Container:Cm,Stage:Nm,stages:zm,Layer:$m,FastLayer:Km,Group:Qm,DD:sm,Shape:Xm,shapes:Um,Animation:ev,Tween:ov,Easings:av,Context:nm,Canvas:om});class sv extends Xm{_sceneFunc(e){var t=jg.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){var e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=jg.getAngle(n?360-this.angle():this.angle()),i=Math.cos(Math.min(r,Math.PI)),o=(o=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)))*(0i;r-=o){var a=fv.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);n.push(a.x,a.y)}else for(let r=t+o;rthis.dataArray[n].pathLength;)e-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(t=this.dataArray[n-1].points.slice(-2))[0],y:t[1]};if(e<.01)return{x:(t=this.dataArray[n].points.slice(0,2))[0],y:t[1]};var i=this.dataArray[n],o=i.points;switch(i.command){case"L":return fv.getPointOnLine(e,i.start.x,i.start.y,o[0],o[1]);case"C":return fv.getPointOnCubicBezier(e/i.pathLength,i.start.x,i.start.y,o[0],o[1],o[2],o[3],o[4],o[5]);case"Q":return fv.getPointOnQuadraticBezier(e/i.pathLength,i.start.x,i.start.y,o[0],o[1],o[2],o[3]);case"A":var a=o[0],l=o[1],s=o[2],c=o[3],u=o[4],d=o[5],f=o[6];return u+=d*e/i.pathLength,fv.getPointOnEllipticalArc(a,l,s,c,u,f)}}return null}static getLineLength(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}static getPointOnLine(e,t,n,r,i,o,a){void 0===o&&(o=t),void 0===a&&(a=n);var l,s=(i-n)/(r-t+1e-8),c=Math.sqrt(e*e/(1+s*s)),u=(r{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){var e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){var t,n,r=this.getWidth(),i=this.getHeight(),o=this.cornerRadius(),a=this.attrs.image;let l;a&&(t=this.attrs.cropWidth,n=this.attrs.cropHeight,l=t&&n?[a,this.cropX(),this.cropY(),t,n,0,0,r,i]:[a,0,0,r,i]),(this.hasFill()||this.hasStroke()||o)&&(e.beginPath(),o?Vg.drawRoundedRectPath(e,r,i,o):e.rect(0,0,r,i),e.closePath(),e.fillStrokeShape(this)),a&&(o&&e.clip(),e.drawImage.apply(e,l))}_hitFunc(e){var t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?Vg.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e;return null!=(e=this.attrs.width)?e:null==(e=this.image())?void 0:e.width}getHeight(){var e;return null!=(e=this.attrs.height)?e:null==(e=this.image())?void 0:e.height}static fromURL(e,t,n=null){var r=Vg.createImageElement();r.onload=function(){var e=new mv({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}mv.prototype.className="Image",mg(mv),Jg.addGetterSetter(mv,"cornerRadius",0,Ug(4)),Jg.addGetterSetter(mv,"image"),Jg.addComponentsGetterSetter(mv,"crop",["x","y","width","height"]),Jg.addGetterSetter(mv,"cropX",0,Zg()),Jg.addGetterSetter(mv,"cropY",0,Zg()),Jg.addGetterSetter(mv,"cropWidth",0,Zg()),Jg.addGetterSetter(mv,"cropHeight",0,Zg());var vv=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],yv="right",bv="down",wv="left",Cv=vv.length;class xv extends Qm{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){for(var t=this,n=function(){t._sync()},r=0;r{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.y)})),{x:t,y:r,width:n-t,height:i-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Ov.prototype.className="RegularPolygon",Ov.prototype._centroid=!0,Ov.prototype._attrsAffectingSize=["radius"],mg(Ov),Jg.addGetterSetter(Ov,"radius",0,Zg()),Jg.addGetterSetter(Ov,"sides",0,Zg());var kv=2*Math.PI;class Pv extends Xm{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,kv,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),kv,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Pv.prototype.className="Ring",Pv.prototype._centroid=!0,Pv.prototype._attrsAffectingSize=["innerRadius","outerRadius"],mg(Pv),Jg.addGetterSetter(Pv,"innerRadius",0,Zg()),Jg.addGetterSetter(Pv,"outerRadius",0,Zg());class _v extends Xm{constructor(e){super(e),this._updated=!0,this.anim=new ev((()=>{var e=this._updated;return this._updated=!1,e})),this.on("animationChange.konva",(function(){this.frameIndex(0)})),this.on("frameIndexChange.konva",(function(){this._updated=!0})),this.on("frameRateChange.konva",(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())}))}_sceneFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],o=this.frameOffsets(),a=i[0+r],l=i[1+r],s=i[2+r];i=i[3+r],r=this.image();(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,s,i),e.closePath(),e.fillStrokeShape(this)),r&&(o?(o=o[t],e.drawImage(r,a,l,s,i,o[0+(t=2*n)],o[1+t],s,i)):e.drawImage(r,a,l,s,i,0,0,s,i))}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[t],o=this.frameOffsets(),a=i[2+r];i=i[3+r];e.beginPath(),o?(r=o[t],e.rect(r[0+(o=2*n)],r[1+o],a,i)):e.rect(0,0,a,i),e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){var e;this.isRunning()||(e=this.getLayer(),this.anim.setLayers(e),this._setInterval(),this.anim.start())}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e{var t=0<=(e=e.trim()).indexOf(" "),n=0<=e.indexOf('"')||0<=e.indexOf("'");return t&&!n?`"${e}"`:e})).join(", ")}_addTextLine(e){this.align()===jv&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return Av().measureText(e).width+(n?t*(n-1):0)}_setTextData(){for(var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,i=this.attrs.width,o=this.attrs.height,a=i!==Mv&&void 0!==i,l=o!==Mv&&void 0!==o,s=this.padding(),c=i-2*s,u=o-2*s,d=0,f="char"!==(i=this.wrap())&&"none"!==i,h=(o=this.ellipsis(),this.textArr=[],Av().font=this._getContextFont(),o?this._getTextWidth("…"):0),p=0,g=e.length;p>>1,S=m.slice(0,1+E),O=this._getTextWidth(S)+h;O<=c?(b=1+E,C=S,x=O):w=E}if(!C)break;if(f&&0<(y=(" "===(y=m[C.length])||"-"===y)&&x<=c?C.length:Math.max(C.lastIndexOf(" "),C.lastIndexOf("-"))+1)&&(b=y,C=C.slice(0,b),x=this._getTextWidth(C)),C=C.trimRight(),this._addTextLine(C),n=Math.max(n,x),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if(0<(m=(m=m.slice(b)).trimLeft()).length&&(v=this._getTextWidth(m))<=c){this._addTextLine(m),d+=r,n=Math.max(n,v);break}}else this._addTextLine(m),d+=r,n=Math.max(n,v),this._shouldHandleEllipsis(d)&&pi?c=fv.getPointOnLine(i,s.x,s.y,u.points[0],u.points[1],s.x,s.y):u=void 0;break;case"A":var v=u.points[4],y=u.points[5],b=u.points[4]+y;0===p?p=v+1e-8:lu.pathLength?1e-8:i/u.pathLength:le+"."+Bv)).join(" "),Wv="nodesRect",Gv=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Zv={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Uv="ontouchstart"in jg._global;var Xv=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Yv(e,t,n){var r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t);n=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:n})}class qv extends Qm{constructor(e){super(e),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Vv,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return Vg.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return Bv+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();var t=e.filter((e=>!e.isAncestorOf(this)||(Vg.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1)));return this._nodes=e=t,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{var t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(Gv.map((e=>e+"."+this._getEventNamespace())).join(" "),t),e.on("absoluteTransformChange."+this._getEventNamespace(),t),this._proxyDrag(e)})),this._resetTransformCache(),!this.findOne(".top-left")||this.update(),this}_proxyDrag(e){let t;e.on("dragstart."+this._getEventNamespace(),(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on("dragmove."+this._getEventNamespace(),(n=>{if(t){var r=e.getAbsolutePosition();const i=r.x-t.x,o=r.y-t.y;this.nodes().forEach((t=>{var r;t===e||t.isDragging()||(r=t.getAbsolutePosition(),t.setAbsolutePosition({x:r.x+i,y:r.y+o}),t.startDrag(n))})),t=null}}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Wv),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Wv,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=e.getAbsoluteScale(n),o=(n=e.getAbsolutePosition(n),r.x*i.x-e.offsetX()*i.x),a=r.y*i.y-e.offsetY()*i.y;e=(jg.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return Yv({x:n.x+o*Math.cos(e)+a*Math.sin(-e),y:n.y+a*Math.cos(e)+o*Math.sin(e),width:r.width*i.x,height:r.height*i.y,rotation:e},-jg.getAngle(t),{x:0,y:0})}__getNodeRect(){var e,t,n,r;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const i=[],o=(this.nodes().map((e=>{var t=[{x:(t=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()})).x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=e.getAbsoluteTransform();t.forEach((function(e){e=n.point(e),i.push(e)}))})),new Rg);o.rotate(-jg.getAngle(this.rotation())),i.forEach((function(i){i=o.point(i),void 0===e&&(e=n=i.x,t=r=i.y),e=Math.min(e,i.x),t=Math.min(t,i.y),n=Math.max(n,i.x),r=Math.max(r,i.y)})),o.invert();var a=o.point({x:e,y:t});return{x:a.x,y:a.y,width:n-e,height:r-t,rotation:jg.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Xv.forEach(function(e){this._createAnchor(e)}.bind(this)),this._createAnchor("rotater")}_createAnchor(e){var t=new Sv({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Uv?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n,r=jg.getAngle(this.rotation());r="rotater"===(n=e)?"crosshair":(r+=Vg.degToRad(Zv[n]||0),n=(Vg.radToDeg(r)%360+360)%360,Vg._inRange(n,337.5,360)||Vg._inRange(n,0,22.5)?"ns-resize":Vg._inRange(n,22.5,67.5)?"nesw-resize":Vg._inRange(n,67.5,112.5)?"ew-resize":Vg._inRange(n,112.5,157.5)?"nwse-resize":Vg._inRange(n,157.5,202.5)?"ns-resize":Vg._inRange(n,202.5,247.5)?"nesw-resize":Vg._inRange(n,247.5,292.5)?"ew-resize":Vg._inRange(n,292.5,337.5)?"nwse-resize":(Vg.error("Transformer has unknown angle for cursor detection: "+n),"pointer"));t.getStage().content&&(t.getStage().content.style.cursor=r),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new Xm({name:"back",width:0,height:0,draggable:!0,sceneFunc(e){var t=this.getParent(),n=t.padding();e.beginPath(),e.rect(-n,-n,this.width()+2*n,this.height()+2*n),e.moveTo(this.width()/2,-n),t.rotateEnabled()&&e.lineTo(this.width()/2,-t.rotateAnchorOffset()*Vg._sign(this.height())-n),e.fillStrokeShape(this)},hitFunc:(e,t)=>{var n;this.shouldOverdrawWholeArea()&&(n=this.padding(),e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t))}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=(n=this._getNodeRect()).width,n=n.height,r=Math.sqrt(Math.pow(t,2)+Math.pow(n,2));this.sin=Math.abs(n/r),this.cos=Math.abs(t/r),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0,n=e.target.getAbsolutePosition(),t=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:t.x-n.x,y:t.y-n.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t=this.findOne("."+this._movingAnchorName);let n={x:(r=((r=t.getStage()).setPointersPositions(e),r.getPointerPosition())).x-this._anchorDragOffset.x,y:r.y-this._anchorDragOffset.y};var r=t.getAbsolutePosition(),i=(this.anchorDragBoundFunc()&&(n=this.anchorDragBoundFunc()(r,n,e)),t.setAbsolutePosition(n),t.getAbsolutePosition());if(r.x!==i.x||r.y!==i.y)if("rotater"===this._movingAnchorName){r=this._getNodeRect();var o=t.x()-r.width/2,a=-t.y()+r.height/2;let n=Math.atan2(-a,o)+Math.PI/2;r.height<0&&(n-=Math.PI);i=jg.getAngle(this.rotation())+n;var l=jg.getAngle(this.rotationSnapTolerance());i=function(e,t){var n={x:(n=e).x+n.width/2*Math.cos(n.rotation)+n.height/2*Math.sin(-n.rotation),y:n.y+n.height/2*Math.cos(n.rotation)+n.width/2*Math.sin(n.rotation)};return Yv(e,t,n)}(r,function(e,t,n){let r=t;for(let a=0;af.x?-1:1,d=this.findOne(".top-left").y()>f.y?-1:1,o=u*this.cos*c,a=u*this.sin*d,this.findOne(".top-left").x(f.x-o),this.findOne(".top-left").y(f.y-a)):"top-center"===this._movingAnchorName?this.findOne(".top-left").y(t.y()):"top-right"===this._movingAnchorName?(l&&(f=r?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()},u=Math.sqrt(Math.pow(t.x()-f.x,2)+Math.pow(f.y-t.y(),2)),c=this.findOne(".top-right").x()f.y?-1:1,o=u*this.cos*c,a=u*this.sin*d,this.findOne(".top-right").x(f.x+o),this.findOne(".top-right").y(f.y-a)),s=t.position(),this.findOne(".top-left").y(s.y),this.findOne(".bottom-right").x(s.x)):"middle-left"===this._movingAnchorName?this.findOne(".top-left").x(t.x()):"middle-right"===this._movingAnchorName?this.findOne(".bottom-right").x(t.x()):"bottom-left"===this._movingAnchorName?(l&&(f=r?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()},u=Math.sqrt(Math.pow(f.x-t.x(),2)+Math.pow(t.y()-f.y,2)),c=f.x{t._fire("transformend",{evt:e,target:t})})),this._movingAnchorName=null)}_fitNodesInto(e,t){var n=this._getNodeRect();if(Vg._inRange(e.width,2*-this.padding()-1,1))this.update();else if(Vg._inRange(e.height,2*-this.padding()-1,1))this.update();else{var r=this.flipEnabled(),i=new Rg;if(i.rotate(jg.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&0<=this._movingAnchorName.indexOf("left")){var o=i.point({x:2*-this.padding(),y:0});if(e.x+=o.x,e.y+=o.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,!r)return void this.update()}else if(this._movingAnchorName&&e.width<0&&0<=this._movingAnchorName.indexOf("right")&&(o=i.point({x:2*this.padding(),y:0}),this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,e.width+=2*this.padding(),!r))return void this.update();if(this._movingAnchorName&&e.height<0&&0<=this._movingAnchorName.indexOf("top")){if(o=i.point({x:0,y:2*-this.padding()}),e.x+=o.x,e.y+=o.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,e.height+=2*this.padding(),!r)return void this.update()}else if(this._movingAnchorName&&e.height<0&&0<=this._movingAnchorName.indexOf("bottom")&&(o=i.point({x:0,y:2*this.padding()}),this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=o.x,this._anchorDragOffset.y-=o.y,e.height+=2*this.padding(),!r))return void this.update();this.boundBoxFunc()&&((i=this.boundBoxFunc()(n,e))?e=i:Vg.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")),(o=new Rg).translate(n.x,n.y),o.rotate(n.rotation),o.scale(n.width/1e7,n.height/1e7),(r=new Rg).translate(e.x,e.y),r.rotate(e.rotation),r.scale(e.width/1e7,e.height/1e7);const a=r.multiply(o.invert());this._nodes.forEach((e=>{var n=e.getParent().getAbsoluteTransform(),r=e.getTransform().copy(),i=(r.translate(e.offsetX(),e.offsetY()),new Rg);i.multiply(n.copy().invert()).multiply(a).multiply(n).multiply(r),n=i.decompose();e.setAttrs(n),this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e}),null!=(r=e.getLayer())&&r.batchDraw()})),this.rotation(Vg._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e=this._getNodeRect(),t=(this.rotation(Vg._getRotation(e.rotation)),e.width),n=(e=e.height,this.enabledAnchors()),r=this.resizeEnabled(),i=this.padding(),o=this.anchorSize();this.find("._anchor").forEach((e=>{e.setAttrs({width:o,height:o,offsetX:o/2,offsetY:o/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:o/2+i,offsetY:o/2+i,visible:r&&0<=n.indexOf("top-left")}),this._batchChangeChild(".top-center",{x:t/2,y:0,offsetY:o/2+i,visible:r&&0<=n.indexOf("top-center")}),this._batchChangeChild(".top-right",{x:t,y:0,offsetX:o/2-i,offsetY:o/2+i,visible:r&&0<=n.indexOf("top-right")}),this._batchChangeChild(".middle-left",{x:0,y:e/2,offsetX:o/2+i,visible:r&&0<=n.indexOf("middle-left")}),this._batchChangeChild(".middle-right",{x:t,y:e/2,offsetX:o/2-i,visible:r&&0<=n.indexOf("middle-right")}),this._batchChangeChild(".bottom-left",{x:0,y:e,offsetX:o/2+i,offsetY:o/2-i,visible:r&&0<=n.indexOf("bottom-left")}),this._batchChangeChild(".bottom-center",{x:t/2,y:e,offsetY:o/2-i,visible:r&&0<=n.indexOf("bottom-center")}),this._batchChangeChild(".bottom-right",{x:t,y:e,offsetX:o/2-i,offsetY:o/2-i,visible:r&&0<=n.indexOf("bottom-right")}),this._batchChangeChild(".rotater",{x:t/2,y:-this.rotateAnchorOffset()*Vg._sign(e)-i,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:t,height:e,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null!=(r=this.getLayer())&&r.batchDraw()}isTransforming(){return this._transforming}stopTransform(){var e;this._transforming&&(this._removeEvents(),e=this.findOne("."+this._movingAnchorName))&&e.stopDrag()}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Qm.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return wm.prototype.toObject.call(this)}clone(e){return wm.prototype.clone.call(this,e)}getClientRect(){return 0>F,0!==E?(k[a]=(s*H>>F)*(E=255/E),k[a+1]=(c*H>>F)*E,k[a+2]=(u*H>>F)*E):k[a]=k[a+1]=k[a+2]=0,s-=f,c-=h,u-=p,d-=g,f-=z.r,h-=z.g,p-=z.b,g-=z.a,i=l+((i=n+O+1)>F,0>F)*(E=255/E),k[i+1]=(c*H>>F)*E,k[i+2]=(u*H>>F)*E):k[i]=k[i+1]=k[i+2]=0,s-=f,c-=h,u-=p,d-=g,f-=z.r,h-=z.g,p-=z.b,g-=z.a,i=n+((i=r+M)")?i.replace("",e.displayName):i}while(1<=l&&0<=s);break}}}finally{et=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Je(e):""}var nt=Object.prototype.hasOwnProperty,rt=[],it=-1;function ot(e){return{current:e}}function at(e){it<0||(e.current=rt[it],rt[it]=null,it--)}function lt(e,t){rt[++it]=e.current,e.current=t}var st={},ct=ot(st),ut=ot(!1),dt=st;function ft(e,t){var n=e.type.contextTypes;if(!n)return st;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ht(e){return null!=e.childContextTypes}function pt(){at(ut),at(ct)}function gt(e,t,n){if(ct.current!==st)throw Error(o(168));lt(ct,t),lt(ut,n)}function mt(e,t,n){var r,a=e.stateNode;if(t=t.childContextTypes,"function"!=typeof a.getChildContext)return n;for(r in a=a.getChildContext())if(!(r in t))throw Error(o(108,function(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return E(t);case 8:return t===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}(e)||"Unknown",r));return i({},n,a)}function vt(e){e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||st,dt=ct.current,lt(ct,e),lt(ut,ut.current)}function yt(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=mt(e,t,dt),r.__reactInternalMemoizedMergedChildContext=e,at(ut),at(ct),lt(ct,e)):at(ut),lt(ut,n)}var bt=Math.clz32||function(e){return 0==(e>>>=0)?32:31-(wt(e)/Ct|0)|0},wt=Math.log,Ct=Math.LN2,xt=64,Et=4194304;function St(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ot(e,t){var n=e.pendingLanes;if(0===n)return 0;var r,i=0,o=e.suspendedLanes,a=e.pingedLanes,l=268435455&n;if(0!=l?0!=(r=l&~o)?i=St(r):0!=(a&=l)&&(i=St(a)):0!=(l=n&~o)?i=St(l):0!==a&&(i=St(a)),0===i)return 0;if(0!==t&&t!==i&&0==(t&o)&&((a=t&-t)<=(o=i&-i)||16===o&&0!=(4194240&a)))return t;if(0!=(4&i)&&(i|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=i;0>=r,o-=r,rn=1<<32-bt(t)+o|n<I?(M=T,T=null):M=T.sibling;var j=m(E,T,O[I],k);if(null===j){null===T&&(T=M);break}e&&T&&null===j.alternate&&t(E,T),S=a(j,S,I),null===_?P=j:_.sibling=j,_=j,T=M}if(I===O.length)n(E,T);else if(null===T)for(;IB?(V=F,F=null):V=F.sibling;var G=m(R,F,W.value,z);if(null===G){null===F&&(F=V);break}e&&F&&null===G.alternate&&t(R,F),D=a(G,D,B),null===H?N=G:H.sibling=G,H=G,F=V}if(W.done)n(R,F);else if(null===F)for(;!W.done;B++,W=A.next())null!==(W=g(R,W.value,z))&&(D=a(W,D,B),null===H?N=W:H.sibling=W,H=W);else{for(F=r(R,F);!W.done;B++,W=A.next())null!==(W=v(F,R,B,W.value,z))&&(e&&null!==W.alternate&&F.delete(null===W.key?B:W.key),D=a(W,D,B),null===H?N=W:H.sibling=W,H=W);e&&F.forEach((function(e){return t(R,e)}))}return fn&&an(R,B),N}ir(0,p)}return"string"==typeof p&&""!==p||"number"==typeof p?(p=""+p,(h=null!==h&&6===h.tag?(n(f,h.sibling),i(h,p)):(n(f,h),Xa(p,f.mode,y))).return=f,s(f=h)):n(f,h)}}var lr=ar(!0),sr=ar(!1),cr={},ur=ot(cr),dr=ot(cr),fr=ot(cr);function hr(e){if(e===cr)throw Error(o(174));return e}function pr(e,t){lt(fr,t),lt(dr,e),lt(ur,cr),e=I(t),at(ur),lt(ur,e)}function gr(){at(ur),at(dr),at(fr)}function mr(e){var t=hr(fr.current),n=hr(ur.current);n!==(t=M(n,e.type,t))&&(lt(dr,e),lt(ur,t))}function vr(e){dr.current===e&&(at(ur),at(dr))}var yr=ot(0);function br(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Re(n)||De(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t=(t.child.return=t).child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var wr=[];function Cr(){for(var e=0;e";case Lo:return":has("+(Do(e)||"")+")";case To:return'[role="'+e.value+'"]';case Mo:return'"'+e.value+'"';case Io:return'[data-testname="'+e.value+'"]';default:throw Error(o(365))}}function Ao(e,t){var n=[];e=[e,0];for(var r=0;rna&&(t.flags|=128,no(i,!(r=!0)),t.lanes=4194304)}else{if(!r)if(null!==(e=br(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),no(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!fn)return ro(t),null}else 2*zt()-i.renderingStartTime>na&&1073741824!==n&&(t.flags|=128,no(i,!(r=!0)),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}if(null!==i.tail)return t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=zt(),t.sibling=null,e=yr.current,lt(yr,r?1&e|2:1&e),t}return ro(t),null;case 22:case 23:return ka(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&Uo)&&(ro(t),Z)&&6&t.subtreeFlags&&(t.flags|=8192):ro(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}(n,t,Uo)))return void(Go=n)}else{if(null!==(n=function(e,t){switch(cn(t),t.tag){case 1:return ht(t.type)&&pt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return gr(),at(ut),at(ct),Cr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return vr(t),null;case 13:if(at(yr),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));xn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return at(yr),null;case 4:return gr(),null;case 10:return jn(t.type._context),null;case 22:case 23:return ka(),null;default:return null}}(n,t)))return n.flags&=32767,void(Go=n);if(null===e)return Yo=6,void(Go=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Go=t)}while(Go=t=e,null!==t);0===Yo&&(Yo=5)}function Ra(e,t,n){var r=It,i=Bo.transition;try{Bo.transition=null,It=1;for(var a=e,l=t,s=n,c=r;Da(),null!==ua;);if(0!=(6&Vo))throw Error(o(327));s=a.finishedWork;var u=a.finishedLanes;if(null!==s){if(a.finishedWork=null,a.finishedLanes=0,s===a.current)throw Error(o(177));a.callbackNode=null,a.callbackPriority=0;var d,f,h=s.lanes|s.childLanes;if(function(e,t){var n=e.pendingLanes&~t,r=(e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements,e.eventTimes);for(e=e.expirationTimes;0 ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5!==e.child.tag?e.child.stateNode:T(e.child.stateNode):null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:tl,findFiberByHostInstance:e.findFiberByHostInstance||nl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Vt=t.inject(e),Wt=t}catch(n){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!ee)throw Error(o(363));e=zo(e,t);var i=le(e,n,r).disconnect;return{disconnect:function(){i()}}},t.registerMutableSourceForHydration=function(e,t){var n=(n=t._getVersion)(t._source);null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=It;try{return It=e,t()}finally{It=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var i=t.current,o=ma(),a=va(i);return n=Ka(n),null===t.context?t.context=n:t.pendingContext=n,(t=Gn(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Zn(i,t,a))&&(ya(e,i,a,o),Un(e,i,a)),a},t},f=y.exports;var iy={exports:{}};l={ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};iy.exports=l;const oy={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let ay=!1,ly=!1;const sy=".react-konva-event";let cy=!1;const uy={};function dy(e,t,n=uy){var r,i,o;for(a in!ay&&"zIndex"in t&&(console.warn('ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'),ay=!0),!ly&&t.draggable&&(r=void 0!==t.x||void 0!==t.y,i=t.onDragEnd||t.onDragMove,r)&&!i&&(console.warn("ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n"),ly=!0),n)oy[a]||(l="on"===a.slice(0,2),o=n[a]!==t[a],l&&o&&("content"===(c=a.substr(2).toLowerCase()).substr(0,7)&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,n[a])),t.hasOwnProperty(a)||e.setAttr(a,void 0));var a,l,s,c,u=cy||t._useStrictMode,d={},f=!1,h={};for(a in t)oy[a]||(l="on"===a.slice(0,2),s=n[a]!==t[a],l&&s&&("content"===(c=a.substr(2).toLowerCase()).substr(0,7)&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),t[a])&&(h[c]=t[a]),!l&&(t[a]!==n[a]||u&&t[a]!==e.getAttr(a))&&(f=!0,d[a]=t[a]));for(c in f&&(e.setAttrs(d),fy(e)),h)e.on(c+sy,h[c])}function fy(e){jg.autoDrawEnabled||(e=e.getLayer()||e.getStage())&&e.batchDraw()}const hy={},py={};function gy(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),fy(e)}lv.Node.prototype._applyProps=dy,ug=setTimeout,Og=clearTimeout;p=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:function(e,t){"string"==typeof t?console.error("Do not use plain text as child of Konva.Node. You are using text: "+t):(e.add(t),fy(e))},createInstance:function(e,t,n){let r=lv[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=lv.Group);var i,o={},a={};for(i in t)"on"===i.slice(0,2)?a[i]=t[i]:o[i]=t[i];return dy(e=new r(o),a),e},createTextInstance:function(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)},finalizeInitialChildren:function(e,t,n){return!1},getPublicInstance:function(e){return e},prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return py},resetAfterCommit:function(){},resetTextContent:function(e){},shouldDeprioritizeSubtree:function(e,t){return!1},getRootHostContext:function(){return hy},getChildHostContext:function(){return hy},scheduleTimeout:ug,cancelTimeout:Og,noTimeout:-1,shouldSetTextContent:function(e,t){return!1},isPrimaryRenderer:!1,warnsIfNotActing:!0,supportsMutation:!0,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),fy(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),fy(e)},insertBefore:gy,insertInContainerBefore:function(e,t,n){gy(e,t,n)},removeChild:function(e,t){t.destroy(),t.off(sy),fy(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(sy),fy(e)},commitTextUpdate:function(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)},commitMount:function(e,t,n){},commitUpdate:function(e,t,n,r,i){dy(e,i,r)},hideInstance:function(e){e.hide(),fy(e)},hideTextInstance:function(e){},unhideInstance:function(e,t){null!=t.visible&&!t.visible||e.show()},unhideTextInstance:function(e,t){},clearContainer:function(e){},detachDeletedInstance:function(){},getCurrentEventPriority:()=>iy.exports.DefaultEventPriority,now:fe.exports.unstable_now,idlePriority:fe.exports.unstable_IdlePriority,run:fe.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"}));var my=Object.defineProperty,vy=Object.defineProperties,yy=Object.getOwnPropertyDescriptors,by=Object.getOwnPropertySymbols,wy=Object.prototype.hasOwnProperty,Cy=Object.prototype.propertyIsEnumerable,xy=(e,t,n)=>t in e?my(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ey=(e,t)=>{for(var n in t=t||{})wy.call(t,n)&&xy(e,n,t[n]);if(by)for(var n of by(t))Cy.call(t,n)&&xy(e,n,t[n]);return e};function Sy(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(dD){return e}}const Oy=Sy(s.exports.createContext(null));class ky extends s.exports.Component{render(){return s.exports.createElement(Oy.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:Py,ReactCurrentDispatcher:_y}=s.exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Ly(){const e=function(){var e,t=function(){const e=s.exports.useContext(Oy);if(null===e)throw new Error("its-fine: useFiber must be called within a !");const t=s.exports.useId();return s.exports.useMemo((()=>{for(const r of[null==Py?void 0:Py.current,e,null==e?void 0:e.alternate])if(r){var n=function e(t,n,r){if(t){if(!0===r(t))return t;let o=n?t.return:t.child;for(;o;){var i=e(o,n,r);if(i)return i;o=n?null:o.sibling}}}(r,!1,(e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}}));if(n)return n}}),[e,t])}(),[n]=s.exports.useState((()=>new Map));n.clear();let r=t;for(;r;){var i=null==(i=r.type)?void 0:i._context;i&&i!==Oy&&!n.has(i)&&n.set(i,null==(e=null==_y?void 0:_y.current)?void 0:e.readContext(Sy(i))),r=r.return}return n}();return s.exports.useMemo((()=>Array.from(e.keys()).reduce(((t,n)=>r=>s.exports.createElement(t,null,s.exports.createElement(n.Provider,((e,t)=>vy(e,yy(t)))(Ey({},r),{value:e.get(n)})))),(e=>s.exports.createElement(ky,Ey({},e))))),[e])}const Ty=e=>{const t=ue.useRef(),n=ue.useRef(),r=ue.useRef(),i=function(e){const t=ue.useRef();return ue.useLayoutEffect((()=>{t.current=e})),t.current}(e),o=Ly(),a=t=>{var n=e.forwardedRef;n&&("function"==typeof n?n(t):n.current=t)};return ue.useLayoutEffect((()=>(n.current=new lv.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Dy.createContainer(n.current,iy.exports.LegacyRoot,!1,null),Dy.updateContainer(ue.createElement(o,{},e.children),r.current),()=>{lv.isBrowser&&(a(null),Dy.updateContainer(null,r.current,null),n.current.destroy())})),[]),ue.useLayoutEffect((()=>{a(n.current),dy(n.current,e,i),Dy.updateContainer(ue.createElement(o,{},e.children),r.current,null)})),ue.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Iy="Layer",My="Ellipse",jy="Image",Ry="Transformer",Dy=f(p);Dy.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:ue.version,rendererPackageName:"react-konva"}),Vj=ue.forwardRef(((e,t)=>ue.createElement(ky,{},ue.createElement(Ty,{...e,forwardedRef:t}))));function Ay(e,t,n,r){return Math.min(e/n,t/r)||1}var zy="FIE_root",Ny="FIE_transformers-layer",Hy="FIE_original-image",Fy="FIE_nodes-transformer",By="watermark",Vy="353297d2-40b4-4684-a875-45a2178a8157",Wy={FINETUNE:"Finetune",FILTERS:"Filters",ADJUST:"Adjust",WATERMARK:"Watermark",ANNOTATE:"Annotate",RESIZE:"Resize"},Gy={CROP:"Crop",ROTATE:"Rotate",FLIP_X:"Flip_X",FLIP_Y:"Flip_Y",BRIGHTNESS:"Brightness",CONTRAST:"Contrast",HSV:"HueSaturationValue",WARMTH:"Warmth",BLUR:"Blur",THRESHOLD:"Threshold",POSTERIZE:"Posterize",PIXELATE:"Pixelate",NOISE:"Noise",FILTERS:"Filters",RECT:"Rect",ELLIPSE:"Ellipse",POLYGON:"Polygon",TEXT:"Text",LINE:"Line",IMAGE:"Image",ARROW:"Arrow",WATERMARK:"Watermark",PEN:"Pen",RESIZE:"Resize"},Zy=["png","jpeg","jpg","webp"],Uy=[].concat(Zy,["svg","gif","avif","apng"]),Xy=Zy[0],Yy={DEFAULT:"default",DRAW:"crosshair",SELECT:"pointer",MOVE:"move",DRAG:"GRAB"},qy="original",$y="ellipse",Ky={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",MIDDLE_LEFT:"middle-left",MIDDLE_CENTER:"middle-center",MIDDLE_RIGHT:"middle-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},Qy=14,Jy=14,eb="close-button-clicked",tb="warning",nb="error";function rb(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function ib(e){for(var t,n=1;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=t?255:0,n[i+1]=n[i+1]>=t?255:0,n[i+2]=n[i+2]>=t?255:0)}jw.finetuneName="Warmth",Jg.addGetterSetter(ry.Image,"warmth",0,Zg(),Jg.afterSetFilter),Rw.finetuneName="CustomThreshold",Jg.addGetterSetter(ry.Image,"threshold",0,Zg,Jg.afterSetFilter);var Dw=Object.freeze(Object.defineProperty({__proto__:null,Warmth:jw,CustomThreshold:Rw},Symbol.toStringTag,{value:"Module"})),Aw=function(e){return Array.isArray(e)&&0>>32-t}function Px(e){for(var t="",n=7;0<=n;n--)t+=(15&e>>>4*n).toString(16);return t}function _x(e){for(var t,n,r,i,o,a,l,s,c=e,u=Array(80),d=1732584193,f=4023233417,h=2562383102,p=271733878,g=3285377520,m=(c=function(e){for(var t,n=e.replace(/\r\n/g,"\n"),r="",i=0;i>6):r=(r+=String.fromCharCode(224|t>>12))+String.fromCharCode(128|63&t>>6),r+=String.fromCharCode(128|63&t));return r}(c)).length,v=[],y=0;y>>29),v.push(4294967295&m<<3),t=0;t input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"]),f=c.span.attrs({className:Ap(mg,"label")}).withConfig({componentId:"sc-jjink6-4"})((function(e){var t=e.theme,n=e.open;return Yf(["display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:",";background-color:",";color:#fff;cursor:pointer;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}"],void 0!==n&&n?"translateY(-100%) scale(1)":"translateY(-100%) scale(0)",void 0!==(e=e.disabled)&&e?t.palette[dg.AccentPrimaryDisabled]:t.palette[dg.LinkHover])})),Fp({Slider:y,Rail:l,Track:ug,Thumb:Og,SliderAnnotation:c.div.attrs({className:Ap(mg,"annotation")}).withConfig({componentId:"sc-jjink6-5"})((function(e){return Yf(["display:flex;justify-content:space-between;margin-top:12px;color:",";"],e.theme.palette[dg.TextSecondary])})),LabelTooltip:f})),Yx=["defaultValue","disabled","disableSwap","hideTrack","hideAnnotation","value","min","max","onChange","onMouseDown","onMouseUp","step","labelTooltip","annotation","components","componentsProps"];function qx(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function $x(e){for(var t=1;tg[E]&&(O=XE(O)),XE(O)),E=[];if(i&&E.push(S[C]<=0),o&&E.push(S[O]<=0,S[x]<=0),E.every((function(e){return e}))){y=w,v=!1;break}m.set(w,E)}if(v)for(var k=d?3:1;0u.width||n.height>u.height?CS(u,n):1}})),r()}var n=e.anchorEl,r=e.onClose,i=(e=DC()).dispatch,o=e.t,a=(f=void 0===(f=(void 0===(f=e.adjustments)?{}:f).crop)?{}:f).ratio,l=f.ratioTitleKey,c=f.ratioFolderKey,u=e.shownImageDimensions,d=e.config[Gy.CROP],f=s.exports.useMemo((function(){var e=void 0===(e=d.presetsItems)?[]:e,t=d.presetsFolders;return[].concat(Dp(void 0===t?[]:t),Dp(eO),Dp(e))}),[d]);return ue.createElement(ue.Fragment,null,ue.createElement(mC,{className:"FIE_crop-tool-label FIE_selected-crop-preset-label"},o(l||"cropTool")),ue.createElement(GS,{className:"FIE_crop-presets-opener-button",color:"link",size:"lg"},n?ue.createElement(ue.Fragment,null,"▴"):ue.createElement(ue.Fragment,null,"▾")),ue.createElement(ES,{className:"FIE_crop-presets-menu",anchorEl:n,enableOverlay:!0,onClose:r,open:!!n,position:"top"},f.map((function(e){var n=e.titleKey,r=e.descriptionKey,i=e.ratio,l=e.width,s=e.height,u=e.groups,d=e.icon;e=e.disableManualResize;return u?ue.createElement(HO,{key:n,titleKey:n,groups:u,Icon:d,onItemSelect:t,prefixIconDimensions:ZO,t:o,disableManualResize:e}):ue.createElement(jO,{key:i,ratio:null!=i?i:Rx(l/s),titleKey:n,t:o,description:o(r),Icon:d,isActive:a===(null!=i?i:Rx(l/s))&&!c,width:l,height:s,onClick:t,disableManualResize:e})}))))}function BO(e){var t=e.selectTool,n=(e=e.isSelected,(r=DC()).config),r=r.t,i=Lg(s.exports.useState(),2),o=i[0],a=i[1];return ue.createElement(yC,{className:"FIE_crop-tool",id:Gy.CROP,Icon:oE,onClick:function(e,n){t(e),a(n.currentTarget)},isSelected:e},n[Gy.CROP].noPresets?ue.createElement(mC,{className:"FIE_crop-tool-label"},r("cropTool")):ue.createElement(FO,{anchorEl:o,onClose:function(){a(null)}}))}function VO(e){var t=e.selectTool,n=e.isSelected,r=e.t,i=(e=DC()).dispatch,o=e.adjustments.isFlippedX,a=(e=s.exports.useMemo((function(){return{reverseLabelOfCurrXFlipDir:r(o?"unFlipX":"flipX"),reverseIconOfCurrXFlipDir:function(){return ue.createElement(XO,{style:o?YO:void 0})}}}),[o])).reverseLabelOfCurrXFlipDir,l=(e=e.reverseIconOfCurrXFlipDir,s.exports.useCallback((function(){i({type:uI,payload:{direction:"X"}})}),[])),c=s.exports.useCallback((function(e){t(e),l()}),[]);return ue.createElement(yC,{className:"FIE_flip-x-tool-button",id:Gy.FLIP_X,label:a,Icon:e,onClick:c,isSelected:n})}function WO(e){var t=e.selectTool,n=e.isSelected,r=e.t,i=(e=DC()).dispatch,o=e.adjustments.isFlippedY,a=(e=s.exports.useMemo((function(){return{reverseLabelOfCurrXFlipDir:r(o?"unFlipY":"flipY"),reverseIconOfCurrXFlipDir:function(){return ue.createElement($O,{style:o?KO:void 0})}}}),[o])).reverseLabelOfCurrXFlipDir,l=(e=e.reverseIconOfCurrXFlipDir,s.exports.useCallback((function(){i({type:uI,payload:{direction:"Y"}})}),[])),c=s.exports.useCallback((function(e){t(e),l()}),[]);return ue.createElement(yC,{className:"FIE_flip-y-tool-button",id:Gy.FLIP_Y,label:a,Icon:e,onClick:c,isSelected:n})}function GO(e){var t=e.selectTool,n=e.isSelected;e=e.t;return ue.createElement(yC,{className:"FIE_rotate-tool-button",id:Gy.ROTATE,label:e("rotateTool"),Icon:JO,onClick:t,isSelected:n})}jO.defaultProps={Icon:void 0,width:void 0,height:void 0,disableManualResize:!1},HO.defaultProps={Icon:void 0};var ZO={height:16,width:16},UO=(BO.defaultProps={isSelected:!(FO.defaultProps={anchorEl:null})},["color","size"]),XO=Jw((function(e,t){var n=void 0===(n=e.color)?"currentColor":n,r=void 0===(r=e.size)?14:r;e=Fu(e,UO);return ue.createElement("svg",Tg({ref:t,width:r,height:r,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24.0625 1.93758C24.0625 1.22909 23.5858 0.609274 22.901 0.427427C22.2163 0.245581 21.4949 0.547225 21.1434 1.16237L1.14337 39.2874C0.867028 39.771 0.869012 40.3651 1.14858 40.8468C1.42814 41.3286 1.94302 41.6251 2.5 41.6251H22.5C23.3629 41.6251 24.0625 40.9255 24.0625 40.0626V1.93758ZM20.9375 38.5001H5.19247L20.9375 7.82128V38.5001Z",fill:n}),ue.createElement("path",{d:"M28.8566 1.16237C28.5051 0.547225 27.7837 0.245581 27.099 0.427428C26.4142 0.609274 25.9375 1.22909 25.9375 1.93758V4.12508H26.9504L27.3934 4.9003L28.75 4.12508H29.0625V3.94651L30.1066 3.34986L28.8566 1.16237Z",fill:n}),ue.createElement("path",{d:"M35.1066 12.0999L32.6066 7.72486L29.8934 9.2753L32.3934 13.6503L35.1066 12.0999Z",fill:n}),ue.createElement("path",{d:"M25.9375 8.50008V12.8751H29.0625V8.50008H25.9375Z",fill:n}),ue.createElement("path",{d:"M40.1066 23.9749L37.6066 19.5999L34.8934 21.1503L37.3934 25.5253L40.1066 23.9749Z",fill:n}),ue.createElement("path",{d:"M25.9375 20.3751V24.7501H29.0625V20.3751H25.9375Z",fill:n}),ue.createElement("path",{d:"M45.1066 32.7249L42.6066 28.3499L39.8934 29.9003L42.3934 34.2753L45.1066 32.7249Z",fill:n}),ue.createElement("path",{d:"M25.9375 29.1251V33.5001H29.0625V29.1251H25.9375Z",fill:n}),ue.createElement("path",{d:"M48.8566 39.2874L47.6066 37.0999L45.1562 38.5001H45V38.5894L44.8934 38.6503L45 38.8369V41.6251H47.5C48.057 41.6251 48.5719 41.3286 48.8514 40.8468C49.131 40.3651 49.133 39.771 48.8566 39.2874Z",fill:n}),ue.createElement("path",{d:"M25.9375 37.8751V40.0626C25.9375 40.9255 26.6371 41.6251 27.5 41.6251H30V38.5001H29.0625V37.8751H25.9375Z",fill:n}),ue.createElement("path",{d:"M35 41.6251H40V38.5001H35V41.6251Z",fill:n}))})),YO={transform:"scaleX(-1)"},qO=(VO.defaultProps={isSelected:!1},["color","size"]),$O=Jw((function(e,t){var n=void 0===(n=e.color)?"currentColor":n,r=void 0===(r=e.size)?14:r;e=Fu(e,qO);return ue.createElement("svg",Tg({ref:t,width:r,height:r,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.5001 24.0625C38.2086 24.0625 38.8284 23.5858 39.0102 22.901C39.1921 22.2162 38.8904 21.4948 38.2753 21.1433L3.27531 1.14333C2.79171 0.866989 2.19757 0.868973 1.71583 1.14854C1.23409 1.4281 0.937592 1.94298 0.937592 2.49996V22.5C0.937592 23.3629 1.63715 24.0625 2.50009 24.0625L37.5001 24.0625ZM4.06259 20.9375L4.06259 5.19243L31.6164 20.9375L4.06259 20.9375Z",fill:n}),ue.createElement("path",{d:"M38.2753 28.8566C38.8904 28.5051 39.1921 27.7837 39.0102 27.0989C38.8284 26.4142 38.2086 25.9375 37.5001 25.9375H35.3126V26.9504L34.5374 27.3933L35.3126 28.75V29.0625H35.4912L36.0878 30.1066L38.2753 28.8566Z",fill:n}),ue.createElement("path",{d:"M27.3378 35.1066L31.7128 32.6066L30.1624 29.8933L25.7874 32.3933L27.3378 35.1066Z",fill:n}),ue.createElement("path",{d:"M30.9376 25.9375H26.5626L26.5626 29.0625H30.9376L30.9376 25.9375Z",fill:n}),ue.createElement("path",{d:"M18.5878 40.1066L22.9628 37.6066L21.4124 34.8933L17.0374 37.3933L18.5878 40.1066Z",fill:n}),ue.createElement("path",{d:"M22.1876 25.9375H17.8126V29.0625H22.1876V25.9375Z",fill:n}),ue.createElement("path",{d:"M9.83781 45.1066L14.2128 42.6066L12.6624 39.8933L8.28738 42.3933L9.83781 45.1066Z",fill:n}),ue.createElement("path",{d:"M13.4376 25.9375H9.0626V29.0625H13.4376V25.9375Z",fill:n}),ue.createElement("path",{d:"M3.27531 48.8566L5.46281 47.6066L4.06259 45.1562V45H3.97331L3.91238 44.8933L3.72578 45H0.937592V47.5C0.937592 48.0569 1.23409 48.5718 1.71583 48.8514C2.19758 49.1309 2.79171 49.1329 3.27531 48.8566Z",fill:n}),ue.createElement("path",{d:"M4.6876 25.9375L2.50009 25.9375C1.63715 25.9375 0.937592 26.637 0.937592 27.5V30H4.06259V29.0625H4.6876V25.9375Z",fill:n}),ue.createElement("path",{d:"M0.937592 35V40L4.06259 40V35H0.937592Z",fill:n}))})),KO={transform:"scaleY(-1)"},QO=(WO.defaultProps={isSelected:!1},["color","size"]),JO=Jw((function(e,t){var n=void 0===(n=e.color)?"currentColor":n,r=void 0===(r=e.size)?14:r;e=Fu(e,QO);return ue.createElement("svg",Tg({ref:t,width:r,height:r,viewBox:"0 0 50 50",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),ue.createElement("path",{d:"M2.66029 14.6992L3.59754 14.4432L3.09234 3.93169C3.05919 3.24213 2.47333 2.71 1.78377 2.74314C1.09421 2.77628 0.562076 3.36215 0.595218 4.05171L1.16043 15.8118C1.19357 16.5014 1.77943 17.0335 2.46899 17.0004L14.2291 16.4351C14.9186 16.402 15.4508 15.8161 15.4176 15.1266C15.3845 14.437 14.7986 13.9049 14.1091 13.938L5.48449 14.3525C8.23226 7.41028 15.0052 2.5 22.925 2.5C33.2802 2.5 41.6748 10.8946 41.6748 21.2498C41.6748 22.403 41.5707 23.5319 41.3713 24.6276L43.7968 25.2605C44.0449 23.9617 44.1748 22.6209 44.1748 21.2498C44.1748 9.51386 34.6609 0 22.925 0C15.0467 0 8.16976 4.2873 4.50003 10.6561L2.66029 14.6992Z",fill:n}),ue.createElement("path",{d:"M9.88493 34.7076L8.27775 36.6304C8.82615 37.1534 9.40249 37.6474 10.0043 38.1098L11.5276 36.1275C10.9528 35.6859 10.4044 35.2116 9.88493 34.7076Z",fill:n}),ue.createElement("path",{d:"M12.3142 39.6562C13.9038 40.5759 15.6235 41.2956 17.439 41.7809L18.0846 39.3657C16.4846 38.938 14.9685 38.3036 13.5663 37.4923L12.3142 39.6562Z",fill:n}),ue.createElement("path",{d:"M20.1654 42.3204C21.0738 42.4389 22.0002 42.5001 22.9408 42.5001C23.8815 42.5001 24.8079 42.4389 25.7163 42.3204L25.3929 39.8414C24.5915 39.946 23.7731 40.0001 22.9408 40.0001C22.1086 40.0001 21.2902 39.946 20.4888 39.8414L20.1654 42.3204Z",fill:n}),ue.createElement("path",{d:"M28.4427 41.7809C30.2582 41.2956 31.9779 40.5759 33.5674 39.6562L32.3154 37.4923C30.9132 38.3036 29.3971 38.938 27.7971 39.3657L28.4427 41.7809Z",fill:n}),ue.createElement("path",{d:"M35.8774 38.1098C37.3495 36.9786 38.6692 35.6589 39.8004 34.1868L37.8181 32.6635C36.8193 33.9633 35.6539 35.1287 34.3541 36.1275L35.8774 38.1098Z",fill:n}),ue.createElement("path",{d:"M41.3468 31.8769C42.2665 30.2873 42.9862 28.5676 43.4715 26.7521L41.0563 26.1065C40.6286 27.7065 39.9942 29.2226 39.1829 30.6248L41.3468 31.8769Z",fill:n}))})),ek=(y=(GO.defaultProps={isSelected:!1},"RotationSlider"),Fp({RotationSliderList:c.ul.attrs({className:Ap(y,"list")}).withConfig({componentId:"sc-1xuruq0-0"})(["display:flex;align-items:center;position:relative;padding:0;width:100%;list-style:none;"]),RotationSliderBigDot:c.li.attrs({className:Ap(y,"big-dot")}).withConfig({componentId:"sc-1xuruq0-1"})((function(e){return Yf(["width:8px;height:8px;border-radius:50%;background-color:",";cursor:pointer;"],e.theme.palette[dg.LinkPrimary])})),RotationSliderSmallDotWrapper:c.div.attrs({className:Ap(y,"small-dot-wrapper")}).withConfig({componentId:"sc-1xuruq0-2"})(["padding:2px;"]),RotationSliderSmallDot:c.li.attrs({className:Ap(y,"small-dot")}).withConfig({componentId:"sc-1xuruq0-3"})((function(e){return Yf(["width:2px;height:2px;border-radius:50%;background-color:",";cursor:pointer;"],e.theme.palette[dg.LinkPrimary])})),RotationSliderControl:c.span.attrs({className:Ap(y,"control")}).withConfig({componentId:"sc-1xuruq0-4"})((function(e){return Yf(["display:flex;justify-content:center;align-items:center;position:absolute;height:18px;width:2px;transform:translate(-50%,-50%);top:50%;background-color:",";& > input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"],e.theme.palette[dg.LinkActive])})),RotationSliderMark:c.div.attrs({className:Ap(y,"mark")}).withConfig({componentId:"sc-1xuruq0-5"})(["padding:4px;"]),RotationSliderMarkText:c.span.attrs({className:Ap(y,"mark-text")}).withConfig({componentId:"sc-1xuruq0-6"})((function(e){return Yf(["position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:",";"],e.theme.palette[dg.TextPrimary])}))})),tk=["min","max","angle","onChange","onMouseDown","onMouseUp","step","labelTooltipOptions","annotation","hideMarkText","value","railProps","trackProps","thumbProps","labelTooltipProps","markStyles","markTextStyles"];function nk(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function rk(e){for(var t=1;t .item{margin-right:8px;display:flex;justify-content:center;}"]),ColorItemWrapper:p,Select:c.div.attrs({className:Ap(UP,"select")}).withConfig({componentId:"sc-qj4xo5-12"})((function(e){return Yf(["width:",";"],"rgb"===e.value?"25%":"35%")}))})),YP=(xS=zp((function(e,t){var n=e.value,r=e.onChange,i=e.checked,o=(e=void 0===(e=e.size)?24:e,s.exports.useMemo((function(){return"#ffffff"===n||"rgba(0,0,0,0)"===n?"black":"white"}),[n]));return ue.createElement(XP.ColorItemWrapper,{ref:t,color:n,size:e,stroke:"rgba(0,0,0,0)"===n?"#a8a8a8":"#E9EEF2",value:n},ue.createElement("input",{type:"radio",value:n,checked:i,onChange:r}),i&&ue.createElement(PP,{color:o}))})),xS.defaultProps={},xS.propTypes={value:ce.string.isRequired,checked:ce.bool,onChange:ce.func.isRequired,size:ce.number},xS),qP=["defaultColor","onChange","pinnedColors","showTransparentColor"];function $P(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function KP(e){for(var t=1;tt.factor,i=(n.x-t.x||0)/t.factor,o=(n.y-t.y||0)/t.factor,i={x:n.x-i*n.factor,y:n.y-o*n.factor},a&&1===t.factor||(i.x=Math.min(0,Math.max(i.x,l*(1-t.factor))),i.y=Math.min(0,Math.max(i.y,r*(1-t.factor)))),n.factor<1&&(o=l-l*n.factor,a=r-r*n.factor,i.x+=o/2,i.y+=a/2),yI(yI({},i),{},{factor:n.factor})))).factor===e.zoom.factor&&t.x===e.zoom.x&&t.y===e.zoom.y?e:CI(CI({},e),{},{zoom:CI(CI({},e.zoom),t)})})),r(oC,OI,(function(e,t){var n,r,i,o,a;return e.canvasWidth===t.canvasWidth&&e.canvasHeight===t.canvasHeight?e:(n=void 0===(n=e.initialCanvasWidth)?t.canvasWidth:n,r=void 0===(r=e.initialCanvasHeight)?t.canvasHeight:r,i=(o=Ay(e.initialCanvasWidth,e.initialCanvasHeight,e.originalImage.width,e.originalImage.height))*e.originalImage.width,o*=e.originalImage.height,a=1,n===t.canvasWidth&&r===t.canvasHeight||(i=t.canvasWidth/i,o=t.canvasHeight/o,a=Math.min(i,o)),SI(SI({},e),{},{initialCanvasWidth:n,initialCanvasHeight:r,canvasWidth:t.canvasWidth,canvasHeight:t.canvasHeight,canvasScale:a}))})),r(oC,II,(function(e,t){return TI(TI({},e),{},{shownImageDimensions:TI(TI({},e.shownImageDimensions),t.shownImageDimensions),designLayer:t.designLayer||e.designLayer,previewGroup:t.previewGroup||e.previewGroup})})),r(oC,FI,(function(e,t){return HI(HI({},e),{},{textIdOfEditableContent:t.textIdOfEditableContent||null})})),r(oC,JI,(function(e,t){return KI(KI({},e),{},{latestColors:KI(KI({},e.latestColors),t.latestColors)})})),r(oC,ob,(function(e,t){return ib(ib({},e),{},{isDesignState:!t.dismissHistory,filter:t.filter||null})})),r(oC,VT,(function(e,t){return BT(BT({},e),{},{isDesignState:!t.dismissHistory,finetunes:!t.finetune||e.finetunes.includes(t.finetune)?e.finetunes:[].concat(Dp(e.finetunes),[t.finetune]),finetunesProps:BT(BT({},e.finetunesProps),t.finetuneProps)})})),r(oC,UT,(function(e){var t=(o=1n.x+n.width&&(s.width=n.x+n.width-s.x),s.y+s.height>n.y+n.height&&(s.height=n.y+n.height-s.y),i&&(o=s.width/s.height,a=i,Rx(o)!==Rx(a))&&(o=s.height*i,a=s.width/i,Rx(s.y+a)<=n.y+n.height?s.height=a:s.width=o),(l.minWidth&&s.width<=l.minWidth||l.maxWidth&&s.width>=l.maxWidth)&&(s.width=ZC(s.width,l.minWidth,l.maxWidth),s.x=e.x,s.y=e.y,i)&&(s.height=s.width/i),(l.minHeight&&t.height<=l.minHeight||l.maxHeight&&t.height>=l.maxHeight)&&(s.height=ZC(s.height,l.minHeight,l.maxHeight),s.x=e.x,s.y=e.y,i)&&(s.width=s.height*i),s}function ZM(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function UM(e){for(var t,n=1;n=v.width&&p.height>=v.height;v.width&&v.height&&(nb&&w&&(e.preventDefault(),x(!0),l({type:qT,payload:{pointerCssIcon:Yy.DRAG}}))}function i(e){"Space"===e.code&&(e.preventDefault(),n())}function o(){a.current&&a.current.container().focus()}e=e.children;var a=(function(e){cy=e}(!0),s.exports.useRef()),l=(v=DC()).dispatch,c=v.pointerCssIcon,u=v.tabId,d=v.toolId,f=v.canvasWidth,h=v.canvasHeight,p=v.canvasScale,g=void 0===(y=v.selectionsIds)?[]:y,m=void 0===(y=v.zoom)?{}:y,v=(y=v.config).previewPixelRatio,y=y.disableZooming,b=(ry.pixelRatio=v,1),w=!y&&d!==Gy.CROP,C=(v=Lg(s.exports.useState(u!==Wy.ANNOTATE&&u!==Wy.WATERMARK&&m.factor>b),2))[0],x=v[1];y=s.exports.useMemo((function(){return{cursor:c===Yy.DEFAULT&&u===Wy.ANNOTATE?Yy.DRAW:c}}),[u,c]),d=s.exports.useCallback((function(e){var t,n;e.evt.preventDefault(),null!=(t=(n=e.currentTarget).container)&&t.call(n).focus(),e.target instanceof ry.Stage&&0b),a.current&&((e=a.current.container()).addEventListener("mouseenter",o),e.addEventListener("keydown",r),e.addEventListener("keyup",i)),function(){e&&(e.removeEventListener("mouseenter",o),e.removeEventListener("keydown",r),e.removeEventListener("keyup",i))}}),[u,m.factor,b]),v=p*(w&&m.factor||b);return ue.createElement(aj,{className:"FIE_canvas-node",tabIndex:-1,ref:a,width:f,height:h,scaleX:v,scaleY:v,x:w&&m.x||null,y:w&&m.y||null,zoomFactor:w&&m.factor||b,onWheel:w?function(e){e.evt.preventDefault();var n=(m.factor||b)+-.006*e.evt.deltaY;t(sj(sj({},e=e.currentTarget.getPointerPosition()),{},{factor:n}))}:void 0,onTap:d,onClick:d,onTouchMove:w?function(e){return function(e,t){e.evt.preventDefault();var n,r,i,o,a,l,s=e.evt.touches[0],c=e.evt.touches[1];s&&c&&((e=e.currentTarget).isDragging()&&e.stopDrag(),s={x:s.clientX,y:s.clientY},c={x:c.clientX,y:c.clientY},nj?(n=tj(s,c),a=s,l=c,l=Math.sqrt(Math.pow(l.x-a.x,2)+Math.pow(l.y-a.y,2)),rj=rj||l,a=(n.x-e.x())/e.scaleX(),r=(n.y-e.y())/e.scaleX(),e=e.scaleX()*(l/rj),i=n.x-nj.x,o=n.y-nj.y,a={x:n.x-a*e+i,y:n.y-r*e+o},rj=l,nj=n,t(ej(ej({},a),{},{factor:e,preparedDimensions:!0}))):nj=tj(s,c))}(e,t)}:void 0,onDragStart:function(e){1<(null==(e=e.evt.touches)?void 0:e.length)&&x(!1)},onTouchEnd:w?function(){var e;rj=0,nj=null,"function"==typeof(e=n)&&e()}:void 0,dragBoundFunc:function(e){return{x:Math.min(0,Math.max(e.x,f*(1-m.factor))),y:Math.min(0,Math.max(e.y,h*(1-m.factor)))}},draggable:w&&C,onDragEnd:function(e){e.currentTarget.draggable()&&"stage"===e.target.nodeType.toLowerCase()&&w&&C&&t({factor:m.factor,x:e.target.x(),y:e.target.y(),preparedDimensions:!0})},style:y},e)})),dj=c.div.withConfig({componentId:"sc-etsyb6-0"})(["display:inline-block;height:",";width:",";border-radius:1px;background:#dfe7ed;"],(function(e){return e.height}),(function(e){return e.width})),fj=function(e){var t=e.height;e=e.width;return ue.createElement(dj,{height:t,width:e})},hj=(fj.defaultProps={height:"11px",width:"1px"},c.div.withConfig({componentId:"sc-21g986-0"})(["padding:12px 12px 8px 12px;box-sizing:border-box;position:relative;width:100%;display:flex;align-items:center;justify-content:space-between;",";[data-phone='true'] &{padding:6px 6px 4px 6px;}overflow:auto;"],(function(e){return e.reverseDirection?"flex-direction: row-reverse":""}))),pj=c.div.withConfig({componentId:"sc-21g986-1"})(["display:flex;margin:0 4px;column-gap:4px;align-items:center;"]),gj=c(JL).withConfig({componentId:"sc-21g986-2"})(["margin:",";display:flex;justify-content:center;align-items:center;width:16px;height:16px;padding:2px;"],(function(e){return null!=(e=e.margin)?e:"0 4px"})),mj=c(fC).withConfig({componentId:"sc-21g986-3"})(["flex-shrink:0;"]),vj=c(JL).withConfig({componentId:"sc-21g986-4"})(["width:20px;height:20px;margin:0 ",";padding:4px;"],(function(e){return null!=(e=e.horizontalMargin)?e:"4px"})),yj=c.div.withConfig({componentId:"sc-21g986-5"})(["display:flex;align-items:center;",";"],(function(e){return e.reverseDirection?"flex-direction: row-reverse":""})),bj=c(fC).withConfig({componentId:"sc-21g986-6"})(["cursor:pointer;"]),wj=c.span.withConfig({componentId:"sc-21g986-7"})(["font-size:11px;line-height:12px;"]),Cj=c(JL).withConfig({componentId:"sc-21g986-8"})(["padding:0;z-index:111;"]),xj=(c(WS).withConfig({componentId:"sc-21g986-9"})(["padding:4px 12px;"]),c(WP).withConfig({componentId:"sc-21g986-10"})(["width:200px;"])),Ej=c(BP).withConfig({componentId:"sc-21g986-11"})(["width:60px;margin-left:4px;"]),Sj=c.div.withConfig({componentId:"sc-21g986-12"})(["width:100%;margin-top:8px;"]),Oj=c.div.withConfig({componentId:"sc-21g986-13"})(["margin-top:8px;width:100%;"]),kj=function(){var e=DC(),t=e.haveNotSavedChanges,n=e.config.onClose;return"function"==typeof n?ue.createElement(Cj,{className:"FIE_topbar-close-button",color:"link",size:"sm",onClick:function(){n(eb,t)}},n&&ue.createElement(RL,null)):ue.createElement("span",null)},Pj={Xs:"xs",Sm:"sm",Md:"md",Lg:"lg",Xl:"xl"},_j=s.exports.createContext({modalOpened:!1}),Lj=(r(Og={},Pj.Xs,Yf(["max-width:300px;"])),r(Og,Pj.Sm,Yf(["max-width:600px;"])),r(Og,Pj.Md,Yf(["max-width:960px;"])),r(Og,Pj.Lg,Yf(["max-width:1280px;"])),r(Og,Pj.Xl,Yf(["max-width:1920px;"])),Og),Tj=(Jy="Modal",lC=c.div.attrs({className:Ap(Jy,"Wrapper")}).withConfig({componentId:"sc-80m07l-0"})((function(e){return Yf(["position:fixed;right:0px;bottom:0px;top:0px;left:0px;z-index:1200;visibility:",";"],e.open?"visible":"hidden")})),p=c.div.attrs({className:Ap(Jy,"Overlay")}).withConfig({componentId:"sc-80m07l-1"})((function(e){return Yf(["position:fixed;right:0px;bottom:0px;top:0px;left:0px;background-color:rgba(0,0,0,0.5);z-index:-1;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms;opacity:",";"],e.open?"1":"0")})),xS=c.div.attrs({className:Ap(Jy,"Container")}).withConfig({componentId:"sc-80m07l-2"})((function(e){var t=e.theme,n=void 0!==(n=e.open)&&n,r=e.fullWidth;e=void 0===(e=e.maxWidth)?Pj.Sm:e;return Yf(["position:absolute;overflow-x:hidden;overflow-y:auto;transition:opacity 251ms cubic-bezier(0.4,0,0.2,1) 0ms,transform 167ms cubic-bezier(0.4,0,0.2,1) 0ms;outline:0;border-radius:",";background-color:",";box-shadow:0px 2px 4px ",";visibility:",";opacity:",";display:flex;max-height:calc(100% - 64px);flex-direction:column;"," "," top:50%;left:50%;transform:translate(-50%,-50%);"],t.shape.borderRadius[hg.Md],t.palette[dg.BackgroundSecondary],t.palette[dg.LightShadow],n?"visible":"hidden",n?"1":"0",void 0!==r&&r&&Yf(["width:calc(100% - 64px);"]),Lj[e])})),Fp({Modal:c.div.attrs({className:Ap(Jy,"root")}).withConfig({componentId:"sc-80m07l-3"})((function(){return Yf(["position:relative;padding-top:8px;padding-bottom:8px;margin:0;padding:0;outline:0;display:flex;flex-direction:column;"])})),Wrapper:lC,Overlay:p,Container:xS})),Ij=["children","open","onClose","maxWidth","fullWidth"];function Mj(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}oC=zp((function(e,t){function n(){"function"==typeof a&&a()}var i=e.children,o=e.open,a=e.onClose,l=e.maxWidth,c=e.fullWidth,u=(e=Fu(e,Ij),(u=i)&&s.exports.isValidElement(u)&&1===ue.Children.count(u)&&u.type===ue.Fragment?i.props.children:i);i=document.querySelector("body");return s.exports.useEffect((function(){return o?document.body.classList.add("Modal-open"):document.body.classList.remove("Modal-open"),function(){document.body.classList.remove("Modal-open")}}),[o]),s.exports.useEffect((function(){function e(e){"Escape"===e.key&&n()}return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}})),de.exports.createPortal(ue.createElement(_j.Provider,{value:{modalOpened:Boolean(o)}},ue.createElement(Tj.Wrapper,{open:Boolean(o),ref:t},ue.createElement(Tj.Overlay,{onClick:n,open:Boolean(o)}),ue.createElement(Tj.Container,Tg({},e,{maxWidth:l,fullWidth:c,open:Boolean(o)}),ue.createElement(Tj.Modal,null,ue.Children.map(u,(function(e){return s.exports.isValidElement(e)&&"ModalTitle"===e.type.displayName?ue.cloneElement(e,function(e){for(var t=1;t *:not(:first-child){margin-left:8px;}"],(e=void 0===(e=e.align)?Rj.Center:e)===Rj.Right?"flex-end":e)}))}),Aj=["children"],zj=(aC=zp((function(e,t){var n=e.children;e=Fu(e,Aj);return ue.createElement(Dj.ModalActions,Tg({},e,{ref:t}),n)})),aC.defaultProps={align:Rj.Center},aC.propTypes={children:ce.node.isRequired,align:ce.oneOf(Hp(Rj))},aC.displayName="ModalActions",aC),Nj=Fp({ModalContent:c.div.attrs({className:Ap("ModalContent","root")}).withConfig({componentId:"sc-1ng1w0v-0"})((function(){return Yf(["position:relative;padding:15px 16px;"])}))}),Hj=["children"],Fj=(l=zp((function(e,t){var n=e.children;e=Fu(e,Hj);return ue.createElement(Nj.ModalContent,Tg({},e,{ref:t}),n)})),l.defaultProps={},l.propTypes={children:ce.node.isRequired},l.displayName="ModalContent",l),Bj={Default:"default",WithIcon:"with-icon"},Vj=(y="ModalTitle",dC=c.div.attrs({className:Ap(y,"Icon")}).withConfig({componentId:"sc-l3tf49-0"})((function(e){return Yf(["display:flex;margin-bottom:8px;padding:12.5px;border-radius:50%;background:",";color:",";"],(e=e.theme.palette)[dg.BackgroundPrimary],e[dg.AccentPrimary])})),c.div.attrs({className:Ap(y,"LabelPrimary")}).withConfig({componentId:"sc-l3tf49-1"})((function(){return Yf(["font-size:16px;line-height:18px;"])}))),Wj=(Og=c.div.attrs({className:Ap(y,"LabelSecondary")}).withConfig({componentId:"sc-l3tf49-2"})(["font-size:12px;line-height:14px;margin-top:4px;"]),Jy=c.div.attrs({className:Ap(y,"Close")}).withConfig({componentId:"sc-l3tf49-3"})((function(e){var t=void 0===(t=e.variant)?Bj.Default:t;e=e.theme.palette;return Yf(["position:absolute;display:flex;top:","px;right:","px;color:",";&:hover{color:",";}cursor:pointer;"],t===Bj.WithIcon?12:16,t===Bj.WithIcon?12:16,e[dg.IconsSecondary],e[dg.IconsPrimary])})),Fp({ModalTitle:c.div.attrs({className:Ap(y,"root")}).withConfig({componentId:"sc-l3tf49-4"})((function(e){var t=void 0===(n=e.variant)?Bj.Default:n,n=(e=(n=e.theme).palette,n.shape.borderRadius);return Yf(["position:relative;color:",";border-radius:","px ","px 0px 0px;"," "," ",""],e[dg.TextPrimary],n[hg.Md],n[hg.Md],(function(){var e=t===Bj.WithIcon?12:11;return Yf(["padding:","px ","px ","px ","px;"],e,t===Bj.WithIcon?18:40,e,18)}),t===Bj.Default&&Yf(["background:",";border-bottom:1px solid ",";"],e[dg.BackgroundPrimary],e[dg.BordersSecondary]),t===Bj.WithIcon&&Yf(["display:flex;align-items:center;flex-direction:column;"]))})),LabelPrimary:Vj,LabelSecondary:Og,Close:Jy,Icon:dC})),Gj=["secondary","onClose"],Zj=(lC=zp((function(e,t){var n=e.secondary,r=e.onClose;e=Fu(e,Gj);return ue.createElement(Wj.ModalTitle,Tg({},e,{ref:t}),e.icon&&ue.createElement(Wj.Icon,{iconShadow:Boolean(e.iconShadow)},e.icon),ue.createElement(Wj.LabelPrimary,null,e.primary),e.variant===Bj.WithIcon&&n&&ue.createElement(Wj.LabelSecondary,null,n),ue.createElement(Wj.Close,{variant:e.variant,onClick:r},ue.createElement(LP,{size:11})))})),p=(lC.defaultProps={iconShadow:!0,variant:Bj.Default},lC.propTypes={primary:ce.node.isRequired,secondary:ce.node,icon:ce.node,iconShadow:ce.bool,onClose:ce.func,variant:ce.oneOf(Hp(Bj))},lC.displayName="ModalTitle",lC),{Happy:"happy",Neutral:"neutral",Sad:"sad",Worried:"worried"}),Uj=Fp({Robot:c.span.attrs({className:Ap("Robot","root")}).withConfig({componentId:"sc-q3dl9f-0"})((function(){return Yf(["display:flex;"])}))}),Xj=["status"],Yj=(xS=zp((function(e,t){var n=e.status;e=Fu(e,Xj);return ue.createElement(Uj.Robot,Tg({},e,{ref:t}),function(e){switch(e){case Zj.Worried:return ue.createElement(OP,null);case Zj.Sad:return ue.createElement(EP,null);case Zj.Neutral:return ue.createElement(CP,null);default:return ue.createElement(bP,null)}}(n))})),h={status:Zj.Happy},oC=(xS.defaultProps=h,{status:ce.oneOf(Hp(Zj))}),xS.propTypes=oC,xS),qj=(aC="PopupContent",l=c.span.attrs({className:Ap(aC,"Label")}).withConfig({componentId:"sc-njbmnt-0"})((function(e){var t=(e=e.theme).palette;e=e.shape;return Yf(["display:flex;flex-grow:1;margin-left:31px;padding:8px 8px 8px 39px;background:",";border-radius:",";min-height:41px;"],t[dg.ButtonPrimaryText],e.borderRadius[hg.Sm])})),y=c.span.attrs({className:Ap(aC,"Label")}).withConfig({componentId:"sc-njbmnt-1"})((function(e){var t=(e=e.theme).palette;e=e.typography.font;return Yf(["display:flex;align-items:center;color:",";",""],t[dg.TextSecondary],e[fg.LabelSmall])})),Fp({PopupContent:c.div.attrs({className:Ap(aC,"PopupContent")}).withConfig({componentId:"sc-njbmnt-2"})(["position:relative;display:flex;align-items:center;width:256px;filter:drop-shadow(0px 4px 4px rgba(0,0,0,0.25));"]),Robot:c.div.attrs({className:Ap(aC,"Robot")}).withConfig({componentId:"sc-njbmnt-3"})((function(e){return Yf(["position:absolute;left:0;display:flex;z-index:1;border-radius:50%;background:",";border:1px solid ",";box-sizing:border-box;"],(e=e.theme.palette)[dg.ButtonPrimaryText],e[dg.BackgroundSecondary])})),LabelWrapper:l,Label:y})),$j=["message","status"];function Kj(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function Qj(e){for(var t=1;t svg:not([color]){color:",'}:disabled,[aria-disabled="true"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}'],zy,zy,(function(e){return e.theme.palette["icons-primary"]})),rD=(JR.defaultProps={useCloudimage:!1,cloudimage:{},img:void 0},s.exports.memo(JR));function iD(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function oD(e){for(var t,n=1;n>>1,o=e[r];if(!(0>>1;rt)||e&&!ye());){var r,o=U.callback;"function"==typeof o?(U.callback=null,G=U.priorityLevel,r=o(U.expirationTime<=t),t=R.unstable_now(),"function"==typeof r?U.callback=r:U===fe(B)&&he(B),ge(t)):he(B),U=fe(B)}var i;return null!==U||(null!==(i=fe(V))&&xe(me,i.startTime-t),!1)}finally{U=null,G=n,Z=!1}}function ye(){return!(R.unstable_now()-oe")?o.replace("",e.displayName):o}while(1<=l&&0<=s);break}}}finally{tt=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?et(e):""}function rt(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return function e(t){if(null!=t){if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case Fe:return"Fragment";case De:return"Portal";case Be:return"Profiler";case He:return"StrictMode";case Ge:return"Suspense";case Ze:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case We:return(t.displayName||"Context")+".Consumer";case Ve:return(t._context.displayName||"Context")+".Provider";case Ue:var n=t.render;return(t=t.displayName)||(""!==(t=n.displayName||n.name||"")?"ForwardRef("+t+")":"ForwardRef");case Xe:return null!==(n=t.displayName||null)?n:e(t.type)||"Memo";case Ye:n=t._payload,t=t._init;try{return e(t(n))}catch(r){}}}return null}(t);case 8:return t===He?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function ot(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function it(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function at(e){e._valueTracker||(e._valueTracker=function(e){var t,n,r=it(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),i=""+e[r];if(!e.hasOwnProperty(r)&&void 0!==o&&"function"==typeof o.get&&"function"==typeof o.set)return t=o.get,n=o.set,Object.defineProperty(e,r,{configurable:!0,get:function(){return t.call(this)},set:function(e){i=""+e,n.call(this,e)}}),Object.defineProperty(e,r,{enumerable:o.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[r]}}}(e))}function lt(e){var t,n,r;if(e)return(t=e._valueTracker)?(n=t.getValue(),r="",(e=r=e?it(e)?e.checked?"true":"false":e.value:r)!==n&&(t.setValue(e),1)):1}function st(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function ct(e,t){var n=t.checked;return Je({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ut(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ot(null!=t.value?t.value:n);e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function dt(e,t){null!=(t=t.checked)&&ze(e,"checked",t,!1)}function ft(e,t){dt(e,t);var n=ot(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?pt(e,t.type,n):t.hasOwnProperty("defaultValue")&&pt(e,t.type,ot(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ht(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function pt(e,t,n){"number"===t&&st(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var gt=Array.isArray;function mt(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=St.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}};var St,Et,Ot="undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction((function(){return Et(e,t)}))}:Et;function kt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var Pt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_t=["Webkit","ms","Moz","O"];function Lt(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Pt.hasOwnProperty(e)&&Pt[e]?(""+t).trim():t+"px"}function It(e,t){for(var n in e=e.style,t){var r,o;t.hasOwnProperty(n)&&(r=0===n.indexOf("--"),o=Lt(n,t[n],r),"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o)}}Object.keys(Pt).forEach((function(e){_t.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pt[t]=Pt[e]}))}));var Tt=Je({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mt(e,t){if(t){if(Tt[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Se(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Se(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Se(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Se(62))}}function jt(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var At=null;function Nt(e){return 3===(e=(e=e.target||e.srcElement||window).correspondingUseElement?e.correspondingUseElement:e).nodeType?e.parentNode:e}var zt=null,Rt=null,Dt=null;function Ft(e){if(e=yi(e)){if("function"!=typeof zt)throw Error(Se(280));var t=e.stateNode;t&&(t=wi(t),zt(e.stateNode,e.type,t))}}function Ht(e){Rt?Dt?Dt.push(e):Dt=[e]:Rt=e}function Bt(){if(Rt){var e=Rt,t=Dt;if(Dt=Rt=null,Ft(e),t)for(e=0;e>>=0)?32:31-(wn(e)/xn|0)|0},wn=Math.log,xn=Math.LN2,Cn=64,Sn=4194304;function En(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function On(e,t){var n=e.pendingLanes;if(0===n)return 0;var r,o=0,i=e.suspendedLanes,a=e.pingedLanes,l=268435455&n;if(0!=l?0!=(r=l&~i)?o=En(r):0!=(a&=l)&&(o=En(a)):0!=(l=n&~i)?o=En(l):0!==a&&(o=En(a)),0===o)return 0;if(0!==t&&t!==o&&0==(t&i)&&((a=t&-t)<=(i=o&-o)||16===i&&0!=(4194240&a)))return t;if(0!=(4&o)&&(o|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=o;0>=r,i-=r,Ki=1<<32-bn(t)+i|n<E?(O=S,S=null):O=S.sibling;var k=f(v,S,b[E],w);if(null===k){null===S&&(S=O);break}e&&S&&null===k.alternate&&t(v,S),y=i(k,y,E),null===C?x=k:C.sibling=k,C=k,S=O}if(E===b.length)n(v,S);else if(null===S)for(;EA?(N=j,j=null):N=j.sibling;var R=f(P,j,z.value,I);if(null===R){null===j&&(j=N);break}e&&j&&null===R.alternate&&t(P,j),_=i(R,_,A),null===M?T=R:M.sibling=R,M=R,j=N}if(z.done)n(P,j);else if(null===j)for(;!z.done;A++,z=L.next())null!==(z=d(P,z.value,I))&&(_=i(z,_,A),null===M?T=z:M.sibling=z,M=z);else{for(j=r(P,j);!z.done;A++,z=L.next())null!==(z=h(j,P,A,z.value,I))&&(e&&null!==z.alternate&&j.delete(null===z.key?A:z.key),_=i(z,_,A),null===M?T=z:M.sibling=z,M=z);e&&j.forEach((function(e){return t(P,e)}))}return ra&&$i(P,A),T}Za(0,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,(c=null!==c&&6===c.tag?(n(s,c.sibling),o(c,u)):(n(s,c),bu(u,s.mode,p))).return=s,a(s=c)):n(s,c)}}var Ka=Ya(!0),qa=Ya(!1),$a={},Qa=Si($a),Ja=Si($a),el=Si($a);function tl(e){if(e===$a)throw Error(Se(174));return e}function nl(e,t){switch(Oi(el,t),Oi(Ja,e),Oi(Qa,$a),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ct(null,"");break;default:t=Ct(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Ei(Qa),Oi(Qa,t)}function rl(){Ei(Qa),Ei(Ja),Ei(el)}function ol(e){tl(el.current);var t=tl(Qa.current),n=Ct(t,e.type);t!==n&&(Oi(Ja,e),Oi(Qa,n))}function il(e){Ja.current===e&&(Ei(Qa),Ei(Ja))}var al=Si(0);function ll(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t=(t.child.return=t).child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sl=[];function cl(){for(var e=0;e<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),"select"===n&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[di]=t,e[fi]=r,Fs(e,t),t.stateNode=e;e:{switch(a=jt(n,r),n){case"dialog":Fo("cancel",e),Fo("close",e),i=r;break;case"iframe":case"object":case"embed":Fo("load",e),i=r;break;case"video":case"audio":for(i=0;iLc&&(t.flags|=128,Rs(s,!(r=!0)),t.lanes=4194304)}else{if(!r)if(null!==(e=ll(a))){if(t.flags|=128,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),Rs(s,!0),null===s.tail&&"hidden"===s.tailMode&&!a.alternate&&!ra)return Ds(t),null}else 2*un()-s.renderingStartTime>Lc&&1073741824!==n&&(t.flags|=128,Rs(s,!(r=!0)),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(null!==(n=s.last)?n.sibling=a:t.child=a,s.last=a)}if(null!==s.tail)return t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=un(),t.sibling=null,n=al.current,Oi(al,r?1&n|2:1&n),t}return Ds(t),null;case 22:case 23:return Qc(),r=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(1073741824&bc)&&(Ds(t),6&t.subtreeFlags)&&(t.flags|=8192):Ds(t),null;case 24:case 25:return null}throw Error(Se(156,t.tag))}(n,t,bc)))return void(vc=n)}else{if(null!==(n=function(e,t){switch(ea(t),t.tag){case 1:return Ti(t.type)&&Mi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return rl(),Ei(_i),Ei(Pi),cl(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return il(t),null;case 13:if(Ei(al),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(Se(340));fa()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Ei(al),null;case 4:return rl(),null;case 10:return xa(t.type._context),null;case 22:case 23:return Qc(),null;default:return null}}(n,t)))return n.flags&=32767,void(vc=n);if(null===e)return xc=6,void(vc=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(vc=t)}while(vc=t=e,null!==t);0===xc&&(xc=5)}function au(e,t,n){var r=Tn,o=pc.transition;try{pc.transition=null,Tn=1;for(var i=e,a=t,l=n,s=r;lu(),null!==Nc;);if(0!=(6&gc))throw Error(Se(327));l=i.finishedWork;var c=i.finishedLanes;if(null!==l){if(i.finishedWork=null,i.finishedLanes=0,l===i.current)throw Error(Se(177));i.callbackNode=null,i.callbackPriority=0;var u,d,f=l.lanes|l.childLanes;if(function(e,t){var n=e.pendingLanes&~t,r=(e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements,e.eventTimes);for(e=e.expirationTimes;0=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;o<=e;)(o<<=1)<0&&Fd(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e]))for(var n=this.groupSizes[e],r=(e=this.indexOfGroup(e))+n,o=e;o>>0),t.hasNameForId(r,a)||(i=n(i,"."+a,void 0,r),t.insertRules(r,a,i)),o.push(a),this.staticRulesId=a);else{for(var i,a,l=this.rules.length,s=ff(this.baseHash,n.hash),c="",u=0;u>>0),t.hasNameForId(r,i)||(a=n(c,"."+i,void 0,r),t.insertRules(r,i,a)),o.push(i))}return o.join(" ")},bf),vf=/^\s*\/\/.*$/gm,yf=[":","[",".","#"];function bf(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&pf(e),this.componentId=t,this.baseHash=ff(gf,t),this.baseStyle=n,rf.registerId(t)}var wf,xf,Cf,Sf,Ef,Of,kf,Pf=se.createContext(),_f=(Pf.Consumer,se.createContext()),Lf=(_f.Consumer,new rf),If=(m=void 0===(m=(Mg=void 0===Mg?Md:Mg).options)?Md:m,Mg=void 0===(Mg=Mg.plugins)?Td:Mg,Of=new function(e){function t(e,t,r){var o=t.trim().split(p),i=(t=o).length,a=e.length;switch(a){case 0:case 1:var l=0;for(e=0===a?"":e[0]+" ";l?@[\\\]^`{|}~-]+/g,Kf=/(^-|-$)/g;function qf(e){return e.replace(Yf,"-").replace(Kf,"")}var $f=function(e){return df(hf(e)>>>0)};function Qf(e){return"string"==typeof e&&!0}var Jf=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},eh=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function th(e){for(var t=arguments.length,n=new Array(1e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=o.xs&&e=o.sm&&e=o.md&&e=o.lg&&e=o.xl&&e=o.xxl&&e=o.xxxl?t?n(i.xxxl):i.xxxl:t?n(i.md):i.md},up:t,down:function(e){return e=o[e],"@media (max-width:".concat(e).concat("px",")")},between:n,only:function(e){return a.indexOf(e)+1Hg.Konva.angleDeg?t*e:t,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>Hg.Konva.DD.isDragging,isTransforming(){var e;return null==(e=Hg.Konva.Transformer)?void 0:e.isTransforming()},isDragReady:()=>!!Hg.Konva.DD.node,releaseCanvasOnDestroy:!0,document:Hg.glob.document,_injectGlobal(e){Hg.glob.Konva=e}},Hg._registerNode=e=>{Hg.Konva[e.prototype.getClassName()]=e},Hg.Konva._injectGlobal(Hg.Konva)}{var Bg=Ky={};Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.Util=Bg.Transform=void 0;const e=Fg;Bg.Transform=class e{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new e(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var t=this.m;return{x:t[0]*e.x+t[2]*e.y+t[4],y:t[1]*e.x+t[3]*e.y+t[5]}}translate(e,t){return this.m[4]+=this.m[0]*e+this.m[2]*t,this.m[5]+=this.m[1]*e+this.m[3]*t,this}scale(e,t){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=t,this.m[3]*=t,this}rotate(e){var t=Math.cos(e),n=(e=Math.sin(e),this.m[0]*t+this.m[2]*e),r=this.m[1]*t+this.m[3]*e,o=this.m[0]*-e+this.m[2]*t;e=this.m[1]*-e+this.m[3]*t;return this.m[0]=n,this.m[1]=r,this.m[2]=o,this.m[3]=e,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,t){var n=this.m[0]+this.m[2]*t,r=(t=this.m[1]+this.m[3]*t,this.m[2]+this.m[0]*e);e=this.m[3]+this.m[1]*e;return this.m[0]=n,this.m[1]=t,this.m[2]=r,this.m[3]=e,this}multiply(e){var t=this.m[0]*e.m[0]+this.m[2]*e.m[1],n=this.m[1]*e.m[0]+this.m[3]*e.m[1],r=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],i=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4];e=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=e,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),t=this.m[3]*e,n=-this.m[1]*e,r=-this.m[2]*e,o=this.m[0]*e,i=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]);e*=this.m[1]*this.m[4]-this.m[0]*this.m[5];return this.m[0]=t,this.m[1]=n,this.m[2]=r,this.m[3]=o,this.m[4]=i,this.m[5]=e,this}getMatrix(){return this.m}decompose(){var e,t=this.m[0],n=this.m[1],r=this.m[2],o=this.m[3],i=t*o-n*r,a={x:this.m[4],y:this.m[5],rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};return 0!=t||0!=n?(e=Math.sqrt(t*t+n*n),a.rotation=0!(!e||1!=e.nodeType),_isFunction:e=>!!(e&&e.constructor&&e.call&&e.apply),_isPlainObject:e=>!!e&&e.constructor===Object,_isArray:e=>"[object Array]"===Object.prototype.toString.call(e),_isNumber:e=>"[object Number]"===Object.prototype.toString.call(e)&&!isNaN(e)&&isFinite(e),_isString:e=>"[object String]"===Object.prototype.toString.call(e),_isBoolean:e=>"[object Boolean]"===Object.prototype.toString.call(e),isObject:e=>e instanceof Object,isValidSelector:e=>"string"==typeof e&&("#"===(e=e[0])||"."===e||e===e.toUpperCase()),_sign:e=>0===e||0document.createElement("img"),_isInDocument(e){for(;e=e.parentNode;)if(e==document)return!0;return!1},_urlToImage(e,t){var n=Bg.Util.createImageElement();n.onload=function(){t(n)},n.src=e},_rgbToHex:(e,t,n)=>((1<<24)+(e<<16)+(t<<8)+n).toString(16).slice(1),_hexToRgb:e=>(e=e.replace("#",""),{r:(e=parseInt(e,16))>>16&255,g:e>>8&255,b:255&e}),getRandomColor(){for(var e=(16777215*Math.random()<<0).toString(16);e.length<6;)e="0"+e;return"#"+e},getRGB(e){var t;return e in Gg?{r:(t=Gg[e])[0],g:t[1],b:t[2]}:"#"===e[0]?this._hexToRgb(e.substring(1)):"rgb("===e.substr(0,4)?(t=Zg.exec(e.replace(/ /g,"")),{r:parseInt(t[1],10),g:parseInt(t[2],10),b:parseInt(t[3],10)}):{r:0,g:0,b:0}},colorToRGBA:e=>Bg.Util._namedColorToRBA(e=e||"black")||Bg.Util._hex3ColorToRGBA(e)||Bg.Util._hex4ColorToRGBA(e)||Bg.Util._hex6ColorToRGBA(e)||Bg.Util._hex8ColorToRGBA(e)||Bg.Util._rgbColorToRGBA(e)||Bg.Util._rgbaColorToRGBA(e)||Bg.Util._hslColorToRGBA(e),_namedColorToRBA:e=>(e=Gg[e.toLowerCase()])?{r:e[0],g:e[1],b:e[2],a:1}:null,_rgbColorToRGBA(e){if(0===e.indexOf("rgb("))return{r:(e=(e=e.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number))[0],g:e[1],b:e[2],a:1}},_rgbaColorToRGBA(e){if(0===e.indexOf("rgba("))return{r:(e=(e=e.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map(((e,t)=>"%"===e.slice(-1)?3===t?parseInt(e)/100:parseInt(e)/100*255:Number(e))))[0],g:e[1],b:e[2],a:e[3]}},_hex8ColorToRGBA(e){if("#"===e[0]&&9===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:parseInt(e.slice(7,9),16)/255}},_hex6ColorToRGBA(e){if("#"===e[0]&&7===e.length)return{r:parseInt(e.slice(1,3),16),g:parseInt(e.slice(3,5),16),b:parseInt(e.slice(5,7),16),a:1}},_hex4ColorToRGBA(e){if("#"===e[0]&&5===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:parseInt(e[4]+e[4],16)/255}},_hex3ColorToRGBA(e){if("#"===e[0]&&4===e.length)return{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16),a:1}},_hslColorToRGBA(e){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(e)){var[,...e]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(e),t=Number(e[0])/360,n=Number(e[1])/100;e=Number(e[2])/100;let i,a,l;if(0==n)return l=255*e,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};var r=2*e-(i=e<.5?e*(1+n):e+n-e*n),o=[0,0,0];for(let e=0;e<3;e++)(a=t+1/3*-(e-1))<0&&a++,1!(t.x>e.x+e.width||t.x+t.widthe.y+e.height||t.y+t.heighte.slice(0),degToRad:e=>e*Vg,radToDeg:e=>e*Wg,_degToRad:e=>(Bg.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),Bg.Util.degToRad(e)),_radToDeg:e=>(Bg.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),Bg.Util.radToDeg(e)),_getRotation:t=>e.Konva.angleDeg?Bg.Util.radToDeg(t):t,_capitalize:e=>e.charAt(0).toUpperCase()+e.slice(1),throw(e){throw new Error(Ug+e)},error(e){console.error(Ug+e)},warn(t){e.Konva.showWarnings&&console.warn("Konva warning: "+t)},each(e,t){for(var n in e)t(n,e[n])},_inRange:(e,t,n)=>t<=e&&et.length&&(o=t,t=e,e=o),r=0;re.touches?e.changedTouches[0].identifier:e.pointerId||999,releaseCanvas(...t){e.Konva.releaseCanvasOnDestroy&&t.forEach((e=>{e.width=0,e.height=0}))},drawRoundedRectPath(e,t,n,r){let o=0,i=0,a=0,l=0;"number"==typeof r?o=i=a=l=Math.min(r,t/2,n/2):(o=Math.min(r[0]||0,t/2,n/2),i=Math.min(r[1]||0,t/2,n/2),l=Math.min(r[2]||0,t/2,n/2),a=Math.min(r[3]||0,t/2,n/2)),e.moveTo(o,0),e.lineTo(t-i,0),e.arc(t-i,i,i,3*Math.PI/2,0,!1),e.lineTo(t,n-l),e.arc(t-l,n-l,l,0,Math.PI/2,!1),e.lineTo(a,n),e.arc(a,n-a,a,Math.PI/2,Math.PI,!1),e.lineTo(0,o),e.arc(o,o,o,Math.PI,3*Math.PI/2,!1)}}}f={},m={},dg={},Object.defineProperty(dg,"__esModule",{value:!0}),dg.getComponentValidator=dg.getBooleanValidator=dg.getNumberArrayValidator=dg.getFunctionValidator=dg.getStringOrGradientValidator=dg.getStringValidator=dg.getNumberOrAutoValidator=dg.getNumberOrArrayOfNumbersValidator=Mg=dg.getNumberValidator=dg.alphaComponent=dg.RGBComponent=void 0;const Yg=Fg,Kg=Ky;function qg(e){return Kg.Util._isString(e)?'"'+e+'"':"[object Number]"===Object.prototype.toString.call(e)||Kg.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}dg.RGBComponent=function(e){return 255('+e+")"),t}},dg.getNumberOrAutoValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){return Kg.Util._isNumber(e)||"auto"===e||Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}},dg.getStringValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){return Kg.Util._isString(e)||Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}},dg.getStringOrGradientValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){var n=Kg.Util._isString(e),r="[object CanvasGradient]"===Object.prototype.toString.call(e)||e&&e.addColorStop;return n||r||Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}},dg.getFunctionValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){return Kg.Util._isFunction(e)||Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}},dg.getNumberArrayValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){var n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(Kg.Util._isArray(e)?e.forEach((function(e){Kg.Util._isNumber(e)||Kg.Util.warn('"'+t+'" attribute has non numeric element '+e+". Make sure that all elements are numbers.")})):Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}},dg.getBooleanValidator=function(){if(Yg.Konva.isUnminified)return function(e,t){return!0===e||!1===e||Kg.Util.warn(qg(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}},dg.getComponentValidator=function(e){if(Yg.Konva.isUnminified)return function(t,n){return null==t||Kg.Util.isObject(t)||Kg.Util.warn(qg(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}};{var $g=m;Object.defineProperty($g,"__esModule",{value:!0}),$g.Factory=void 0;const e=Ky,t=dg;$g.Factory={addGetterSetter(e,t,n,r,o){$g.Factory.addGetter(e,t,n),$g.Factory.addSetter(e,t,r,o),$g.Factory.addOverloadedGetterSetter(e,t)},addGetter(t,n,r){var o="get"+e.Util._capitalize(n);t.prototype[o]=t.prototype[o]||function(){var e=this.attrs[n];return void 0===e?r:e}},addSetter(t,n,r,o){var i="set"+e.Util._capitalize(n);t.prototype[i]||$g.Factory.overWriteSetter(t,n,r,o)},overWriteSetter(t,n,r,o){var i="set"+e.Util._capitalize(n);t.prototype[i]=function(e){return r&&null!=e&&(e=r.call(this,e,n)),this._setAttr(n,e),o&&o.call(this),this}},addComponentsGetterSetter(n,r,o,i,a){var l,s,c=o.length,u=e.Util._capitalize,d="get"+u(r),f="set"+u(r),h=(n.prototype[d]=function(){var e={};for(l=0;l{this._setAttr(r+u(e),void 0)})),this._fireChangeEvent(r,n,e),a&&a.call(this),this},$g.Factory.addOverloadedGetterSetter(n,r)},addOverloadedGetterSetter(t,n){var r=e.Util._capitalize(n),o="set"+r,i="get"+r;t.prototype[n]=function(){return arguments.length?(this[o](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,n,r,o){e.Util.error("Adding deprecated "+n);var i="get"+e.Util._capitalize(n),a=n+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){e.Util.error(a);var t=this.attrs[n];return void 0===t?r:t},$g.Factory.addSetter(t,n,o,(function(){e.Util.error(a)})),$g.Factory.addOverloadedGetterSetter(t,n)},backCompat(t,n){e.Util.each(n,(function(n,r){var o=t.prototype[r],i="get"+e.Util._capitalize(n),a="set"+e.Util._capitalize(n);function l(){o.apply(this,arguments),e.Util.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+r+'" instead.')}t.prototype[n]=l,t.prototype[i]=l,t.prototype[a]=l}))},afterSetFilter(){this._filterUpToDate=!1}}}o={};var Qg={};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.HitContext=Qg.SceneContext=Qg.Context=void 0;const Jg=Ky,em=Fg;var tm=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class nm{constructor(e){this.canvas=e,em.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,t){for(var n,r,o,i=this.traceArr,a=i.length,l="",s=0;s"number"==typeof e?Math.floor(e):e)):o).join(",")+")"):(l+=n.property,e||(l+="="+n.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr;t.push(e),100<=t.length&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(+e,0,0,+e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){(e=e.attrs.lineCap)&&this.setAttr("lineCap",e)}_applyOpacity(e){1!==(e=e.getAbsoluteOpacity())&&this.setAttr("globalAlpha",e)}_applyLineJoin(e){(e=e.attrs.lineJoin)&&this.setAttr("lineJoin",e)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,o,i){this._context.arc(e,t,n,r,o,i)}arcTo(e,t,n,r,o){this._context.arcTo(e,t,n,r,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,o,i){this._context.bezierCurveTo(e,t,n,r,o,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;return 2===n.length?this._context.createImageData(e,t):1===n.length?this._context.createImageData(e):void 0}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,o,i){return this._context.createRadialGradient(e,t,n,r,o,i)}drawImage(e,t,n,r,o,i,a,l,s){var c=arguments,u=this._context;3===c.length?u.drawImage(e,t,n):5===c.length?u.drawImage(e,t,n,r,o):9===c.length&&u.drawImage(e,t,n,r,o,i,a,l,s)}ellipse(e,t,n,r,o,i,a,l){this._context.ellipse(e,t,n,r,o,i,a,l)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,o){this._context.roundRect(e,t,n,r,o)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,t,n,r,o,i){this._context.setTransform(e,t,n,r,o,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,o,i){this._context.transform(e,t,n,r,o,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){for(var e,t=this,n=tm.length,r=this.setAttr,o=function(n){var r,o=t[n];t[n]=function(){return e=function(e){for(var t,n=[],r=e.length,o=Jg.Util,i=0;i{"dragging"===t.dragStatus&&(e=!0)})),e},justDragged:!1,get node(){var e;return um.DD._dragElements.forEach((t=>{e=t.node})),e},_dragElements:new Map,_drag(e){const n=[];um.DD._dragElements.forEach(((r,o)=>{var i,a=r.node;if(i=((i=a.getStage()).setPointersPositions(e),void 0===r.pointerId&&(r.pointerId=t.Util._getFirstPointerId(e)),i._changedPointerPositions.find((e=>e.id===r.pointerId)))){if("dragging"!==r.dragStatus){var l=a.dragDistance();if(Math.max(Math.abs(i.x-r.startPointerPos.x),Math.abs(i.y-r.startPointerPos.y)){t.fire("dragmove",{type:"dragmove",target:t,evt:e},!0)}))},_endDragBefore(t){const n=[];um.DD._dragElements.forEach((r=>{var o=(o=r.node).getStage();(o=(t&&o.setPointersPositions(t),o._changedPointerPositions.find((e=>e.id===r.pointerId))))&&("dragging"!==r.dragStatus&&"stopped"!==r.dragStatus||(um.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,r.dragStatus="stopped"),o=r.node.getLayer()||r.node instanceof e.Konva.Stage&&r.node)&&-1===n.indexOf(o)&&n.push(o)})),n.forEach((e=>{e.draw()}))},_endDragAfter(e){um.DD._dragElements.forEach(((t,n)=>{"stopped"===t.dragStatus&&t.node.fire("dragend",{type:"dragend",target:t.node,evt:e},!0),"dragging"!==t.dragStatus&&um.DD._dragElements.delete(n)}))}},e.Konva.isBrowser&&(window.addEventListener("mouseup",um.DD._endDragBefore,!0),window.addEventListener("touchend",um.DD._endDragBefore,!0),window.addEventListener("mousemove",um.DD._drag),window.addEventListener("touchmove",um.DD._drag),window.addEventListener("mouseup",um.DD._endDragAfter,!1),window.addEventListener("touchend",um.DD._endDragAfter,!1))}Object.defineProperty(f,"__esModule",{value:!0}),f.Node=void 0;const dm=Ky;sm=m;const fm=o,hm=Fg,pm=lm;var gm=dg,mm="absoluteOpacity",vm="allEventListeners",ym="absoluteTransform",bm="absoluteScale",wm="canvas",xm="listening",Cm="mouseenter",Sm="mouseleave",Em="transform",Om="visible",km=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(" ");let Pm=1;class _m{constructor(e){this._id=Pm++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){e!==Em&&e!==ym||!this._cache.get(e)?e?this._cache.delete(e):this._cache.clear():this._cache.get(e).dirty=!0}_getCache(e,t){var n=this._cache.get(e);return(void 0===n||(e===Em||e===ym)&&!0===n.dirty)&&(n=t.call(this),this._cache.set(e,n)),n}_calculate(e,t,n){return this._attachedDepsListeners.get(e)||(t=t.map((e=>e+"Change.konva")).join(" "),this.on(t,(()=>{this._clearCache(e)})),this._attachedDepsListeners.set(e,!0)),this._getCache(e,n)}_getCanvasCache(){return this._cache.get(wm)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ym&&this.fire("absoluteTransformChange")}clearCache(){var e,t,n;return this._cache.has(wm)&&(({scene:e,filter:t,hit:n}=this._cache.get(wm)),dm.Util.releaseCanvas(e,t,n),this._cache.delete(wm)),this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var t,n={},r=(void 0!==(e=e||{}).x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0})),Math.ceil(e.width||n.width)),o=Math.ceil(e.height||n.height),i=e.pixelRatio,a=void 0===e.x?Math.floor(n.x):e.x,l=void 0===e.y?Math.floor(n.y):e.y,s=e.offset||0,c=e.drawBorder||!1,u=e.hitCanvasPixelRatio||1;if(r&&o)return r+=2*s+(.5{var t,n;if(!e)return this;for(t in e)"children"!==t&&(n="set"+dm.Util._capitalize(t),dm.Util._isFunction(this[n])?this[n](e[t]):this._setAttr(t,e[t]))})),this}isListening(){return this._getCache(xm,this._isListening)}_isListening(e){var t;return!!this.listening()&&(!(t=this.getParent())||t===e||this===e||t._isListening(e))}isVisible(){return this._getCache(Om,this._isVisible)}_isVisible(e){var t;return!!this.visible()&&(!(t=this.getParent())||t===e||this===e||t._isVisible(e))}shouldDrawHit(e,t=!1){var n,r;return e?this._isVisible(e)&&this._isListening(e):(n=this.getLayer(),r=!1,pm.DD._dragElements.forEach((e=>{"dragging"===e.dragStatus&&("Stage"!==e.node.nodeType&&e.node.getLayer()!==n||(r=!0))})),e=!t&&!hm.Konva.hitOnDragEnabled&&(r||hm.Konva.isTransforming()),this.isListening()&&this.isVisible()&&!e)}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e,t,n,r,o=this.getDepth(),i=this,a=0,l=this.getStage();return"Stage"!==i.nodeType&&l&&function l(s){for(e=[],t=s.length,n=0;n{this.x(e.x),this.y(e.y)})),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){var e,t=this.getStage();return(t=t&&t.getPointerPosition())?((e=this.getAbsoluteTransform().copy()).invert(),e.point(t)):null}getAbsolutePosition(e){let t=!1,n=this.parent;for(;n;){if(n.isCached()){t=!0;break}n=n.parent}t&&!e&&(e=!0);e=this.getAbsoluteTransform(e).getMatrix();var r=new dm.Transform,o=this.offset();return r.m=e.slice(),r.translate(o.x,o.y),r.getTranslation()}setAbsolutePosition(e){const{x:t,y:n,...r}=this._clearTransform();this.attrs.x=t,this.attrs.y=n,this._clearCache(Em);var o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(r),this.setPosition({x:e.x,y:e.y}),this._clearCache(Em),this._clearSelfAndDescendantCache(ym),this}_setTransform(e){for(var t in e)this.attrs[t]=e[t]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var t=e.x,n=(e=e.y,this.x()),r=this.y();return void 0!==t&&(n+=t),void 0!==e&&(r+=e),this.setPosition({x:n,y:r}),this}_eachAncestorReverse(e,t){var n,r,o=[],i=this.getParent();if(!t||t._id!==this._id){for(o.unshift(this);i&&(!t||i._id!==t._id);)o.unshift(i),i=i.parent;for(n=o.length,r=0;r=this.parent.children.length)&&dm.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+"."),t=this.index,this.parent.children.splice(t,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices()):dm.Util.warn("Node has no parent. zIndex parameter is ignored."),this}getAbsoluteOpacity(){return this._getCache(mm,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),t=this.getParent();return t&&!t._isUnderCache&&(e*=t.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e,t,n,r=this.getAttrs(),o={attrs:{},className:this.getClassName()};for(e in r)t=r[e],dm.Util.isObject(t)&&!dm.Util._isPlainObject(t)&&!dm.Util._isArray(t)||(n="function"==typeof this[e]&&this[e],delete r[e],(n?n.call(this):null)!==(r[e]=t)&&(o.attrs[e]=t));return dm.Util._prepareToStringify(o)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,t,n){for(var r=[],o=(t&&this._isMatch(e)&&r.push(this),this.parent);o;){if(o===n)return r;o._isMatch(e)&&r.push(o),o=o.parent}return r}isAncestorOf(e){return!1}findAncestor(e,t,n){return this.findAncestors(e,t,n)[0]}_isMatch(e){if(e){if("function"==typeof e)return e(this);for(var t,n=e.replace(/ /g,"").split(","),r=n.length,o=0;o{try{const n=null==e?void 0:e.callback;n&&delete e.callback,dm.Util._urlToImage(this.toDataURL(e),(function(e){t(e),null!=n&&n(e)}))}catch(r){n(r)}}))}toBlob(e){return new Promise(((t,n)=>{try{const n=null==e?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob((e=>{t(e),null!=n&&n(e)}),null==e?void 0:e.mimeType,null==e?void 0:e.quality)}catch(r){n(r)}}))}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():hm.Konva.dragDistance}_off(e,t,n){for(var r,o,i=this.eventListeners[e],a=0;a{this.isAncestorOf(e.node)&&(t=!0)})),t)||this._createDragElement(e)}))}_dragChange(){var e,t;this.attrs.draggable?this._listenDrag():(this._dragCleanup(),this.getStage()&&(e=(t=pm.DD._dragElements.get(this._id))&&"dragging"===t.dragStatus,t=t&&"ready"===t.dragStatus,e?this.stopDrag():t&&pm.DD._dragElements.delete(this._id)))}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){var t=this.getStage();return!!t&&(t={x:-e.x,y:-e.y,width:t.width()+2*e.x,height:t.height()+2*e.y},dm.Util.haveIntersection(t,this.getClientRect()))}static create(e,t){return dm.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,t)}static _createNode(e,t){var n,r,o=_m.prototype.getClassName.call(e),i=e.children;t&&(e.attrs.container=t),hm.Konva[o]||(dm.Util.warn('Can not find a node with class name "'+o+'". Fallback to "Shape".'),o="Shape");var a=new hm.Konva[o](e.attrs);if(i)for(n=i.length,r=0;r{e.parent=null,e.index=0,e.remove()})),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach((e=>{e.parent=null,e.index=0,e.destroy()})),this.children=[],this._requestDraw(),this}add(...e){if(0!==e.length)if(1{var o=r._isMatch(e);return o&&n.push(r),!(!o||!t)})),n}_descendants(e){for(const t of this.getChildren()){if(e(t))return!0;if(t.hasChildren()&&t._descendants(e))return!0}return!1}toObject(){var e=Lm.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach((t=>{e.children.push(t.toObject())})),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=Lm.Node.prototype.clone.call(this,e);return this.getChildren().forEach((function(e){t.add(e.clone())})),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach((n=>{n.isVisible()&&n.intersects(e)&&t.push(n)})),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),this.isCached()||null!=(t=this.children)&&t.forEach((function(t){t._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;null!=(e=this.children)&&e.forEach((function(e,t){e.index=t})),this._requestDraw()}drawScene(e,t,n){var r=this.getLayer(),o=(r=(e=e||r&&r.getCanvas())&&e.getContext(),(o=this._getCanvasCache())&&o.scene),i=e&&e.isCache;return(this.isVisible()||i)&&(o?(r.save(),i=this.getAbsoluteTransform(t).getMatrix(),r.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._drawCachedSceneCanvas(r),r.restore()):this._drawChildren("drawScene",e,t,n)),this}drawHit(e,t){var n,r;return this.shouldDrawHit(t)&&(n=this.getLayer(),n=(e=e||n&&n.hitCanvas)&&e.getContext(),(r=this._getCanvasCache())&&r.hit?(n.save(),r=this.getAbsoluteTransform(t).getMatrix(),n.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._drawCachedHitCanvas(n),n.restore()):this._drawChildren("drawHit",e,t)),this}_drawChildren(e,t,n,r){var o=t&&t.getContext(),i=this.clipWidth(),a=this.clipHeight(),l=this.clipFunc(),s="number"==typeof i&&"number"==typeof a||l,c=n===this;if(s){o.save();var u,d=this.getAbsoluteTransform(n),f=d.getMatrix();let e;o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath(),l?e=l.call(this,o,this):(l=this.clipX(),u=this.clipY(),o.rect(l||0,u||0,i,a)),o.clip.apply(o,e),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}(l=!c&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===e)&&(o.save(),o._applyGlobalCompositeOperation(this)),null!=(u=this.children)&&u.forEach((function(o){o[e](t,n,r)})),l&&o.restore(),s&&o.restore()}getClientRect(e={}){for(var t,n,r,o,i,a,l=e.skipTransform,s=e.relativeTo,c=this,u=(null!=(t=this.children)&&t.forEach((function(t){!t.visible()||0===(t=t.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke})).width&&0===t.height||(i=void 0===n?(n=t.x,r=t.y,o=t.x+t.width,t.y+t.height):(n=Math.min(n,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x+t.width),Math.max(i,t.y+t.height)))})),this.find("Shape")),d=!1,f=0;f0<=e.indexOf("pointer")?"pointer":0<=e.indexOf("touch")?"touch":"mouse",u=e=>"pointer"===(e=c(e))?r.Konva.pointerEventsEnabled&&s.pointer:"touch"===e?s.touch:"mouse"===e?s.mouse:void 0;zm.stages=[];class d extends n.Container{constructor(t){super(e(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),zm.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",(()=>{e(this.attrs)})),this._checkVisibility()}_validateAdd(e){var n="Layer"===e.getType();e="FastLayer"===e.getType();n||e||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){var e;this.content&&(e=this.visible()?"":"none",this.content.style.display=e)}setContainer(e){var t,n;if("string"==typeof e&&!(e="."===e.charAt(0)?(t=e.slice(1),document.getElementsByClassName(t)[0]):(n="#"!==e.charAt(0)?e:e.slice(1),document.getElementById(n))))throw"Can not find container in document with id "+n;return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){for(var e=this.children,t=e.length,n=0;nt.id===e))}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){(e=e||{}).x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var t=new i.SceneCanvas({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),n=t.getContext()._context,r=this.children;return(e.x||e.y)&&n.translate(-1*e.x,-1*e.y),r.forEach((function(t){t.isVisible()&&(t=t._toKonvaCanvas(e),n.drawImage(t._canvas,e.x,e.y,t.getWidth()/t.getPixelRatio(),t.getHeight()/t.getPixelRatio()))})),t}getIntersection(e){if(e)for(var t=this.children,n=t.length-1;0<=n;n--){var r=t[n].getIntersection(e);if(r)return r}return null}_resizeDOM(){var e=this.width(),t=this.height();this.content&&(this.content.style.width=e+"px",this.content.style.height=t+"px"),this.bufferCanvas.setSize(e,t),this.bufferHitCanvas.setSize(e,t),this.children.forEach((n=>{n.setSize({width:e,height:t}),n.draw()}))}add(e){if(1{this.content.addEventListener(e,(e=>{this[t](e)}),{passive:!1})}))}_pointerenter(e){this.setPointersPositions(e);var t=u(e.type);t&&this._fire(t.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);var t=u(e.type);t&&this._fire(t.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let t=this[e+"targetShape"];return t&&!t.getStage()?null:t}_pointerleave(e){var t,n,o=u(e.type),i=c(e.type);o&&(this.setPointersPositions(e),t=this._getTargetShape(i),n=!(r.Konva.isDragging()||r.Konva.isTransforming())||r.Konva.hitOnDragEnabled,t&&n?(t._fireAndBubble(o.pointerout,{evt:e}),t._fireAndBubble(o.pointerleave,{evt:e}),this._fire(o.pointerleave,{evt:e,target:this,currentTarget:this}),this[i+"targetShape"]=null):n&&(this._fire(o.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(o.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[])}_pointerdown(e){const t=u(e.type),n=c(e.type);var o;t&&(this.setPointersPositions(e),o=!1,this._changedPointerPositions.forEach((i=>{var l=this.getIntersection(i);a.DD.justDragged=!1,r.Konva["_"+n+"ListenClick"]=!0,l&&l.isListening()&&(r.Konva.capturePointerEventsEnabled&&l.setPointerCapture(i.id),(this[n+"ClickStartShape"]=l)._fireAndBubble(t.pointerdown,{evt:e,pointerId:i.id}),o=!0,i=0<=e.type.indexOf("touch"),l.preventDefault())&&e.cancelable&&i&&e.preventDefault()})),o||this._fire(t.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id}))}_pointermove(e){const t=u(e.type),n=c(e.type);if(t&&(r.Konva.isDragging()&&a.DD.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e),!r.Konva.isDragging()&&!r.Konva.isTransforming()||r.Konva.hitOnDragEnabled)){var o={};let r=!1;var i=this._getTargetShape(n);this._changedPointerPositions.forEach((a=>{var s=l.getCapturedShape(a.id)||this.getIntersection(a),c=(a=a.id,{evt:e,pointerId:a}),u=i!==s;if(u&&i&&(i._fireAndBubble(t.pointerout,{...c},s),i._fireAndBubble(t.pointerleave,{...c},s)),s){if(o[s._id])return;o[s._id]=!0}s&&s.isListening()?(r=!0,u&&(s._fireAndBubble(t.pointerover,{...c},i),s._fireAndBubble(t.pointerenter,{...c},i),this[n+"targetShape"]=s),s._fireAndBubble(t.pointermove,{...c})):i&&(this._fire(t.pointerover,{evt:e,target:this,currentTarget:this,pointerId:a}),this[n+"targetShape"]=null)})),r||this._fire(t.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}}_pointerup(e){const t=u(e.type),n=c(e.type);if(t){this.setPointersPositions(e);const i=this[n+"ClickStartShape"],s=this[n+"ClickEndShape"];var o={};let c=!1;this._changedPointerPositions.forEach((u=>{var d=l.getCapturedShape(u.id)||this.getIntersection(u);if(d){if(d.releaseCapture(u.id),o[d._id])return;o[d._id]=!0}u=u.id;var f={evt:e,pointerId:u};let h=!1;r.Konva["_"+n+"InDblClickWindow"]?(h=!0,clearTimeout(this[n+"DblTimeout"])):a.DD.justDragged||(r.Konva["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout((function(){r.Konva["_"+n+"InDblClickWindow"]=!1}),r.Konva.dblClickWindow),d&&d.isListening()?(c=!0,(this[n+"ClickEndShape"]=d)._fireAndBubble(t.pointerup,{...f}),r.Konva["_"+n+"ListenClick"]&&i&&i===d&&(d._fireAndBubble(t.pointerclick,{...f}),h)&&s&&s===d&&d._fireAndBubble(t.pointerdblclick,{...f})):(this[n+"ClickEndShape"]=null,r.Konva["_"+n+"ListenClick"]&&this._fire(t.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:u}),h&&this._fire(t.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:u}))})),c||this._fire(t.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),r.Konva["_"+n+"ListenClick"]=!1,e.cancelable&&"touch"!==n&&e.preventDefault()}}_contextmenu(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble(Fm,{evt:e}):this._fire(Fm,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var t=this.getIntersection(this.getPointerPosition());t&&t.isListening()?t._fireAndBubble("wheel",{evt:e}):this._fire("wheel",{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);var t=l.getCapturedShape(e.pointerId)||this.getIntersection(this.getPointerPosition());t&&t._fireAndBubble(Dm,l.createEvent(e)),l.releaseCapture(e.pointerId)}_lostpointercapture(e){l.releaseCapture(e.pointerId)}setPointersPositions(e){var n,r,o=this._getContentPosition();void 0!==(e=e||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,(e=>{this._pointerPositions.push({id:e.identifier,x:(e.clientX-o.left)/o.scaleX,y:(e.clientY-o.top)/o.scaleY})})),Array.prototype.forEach.call(e.changedTouches||e.touches,(e=>{this._changedPointerPositions.push({id:e.identifier,x:(e.clientX-o.left)/o.scaleX,y:(e.clientY-o.top)/o.scaleY})}))):(n=(e.clientX-o.left)/o.scaleX,r=(e.clientY-o.top)/o.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:t.Util._getFirstPointerId(e)}],this._changedPointerPositions=[{x:n,y:r,id:t.Util._getFirstPointerId(e)}])}_setPointerPosition(e){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){var e;return this.content&&this.content.getBoundingClientRect?{top:(e=this.content.getBoundingClientRect()).top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}:{top:0,left:0,scaleX:1,scaleY:1}}_buildDOM(){if(this.bufferCanvas=new i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),r.Konva.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach((function(e){e.batchDraw()})),this}}(zm.Stage=d).prototype.nodeType="Stage",(0,Rm._registerNode)(d),Tm.Factory.addGetterSetter(d,"container")}nk={};{let e=function(){return i=i||n.Util.createCanvasElement().getContext("2d")};var Bm=BS={};Object.defineProperty(Bm,"__esModule",{value:!0}),Bm.Shape=Bm.shapes=void 0;const t=Fg,n=Ky,r=(ob=m,f),o=(Fv=dg,mb=Fg,gm);var Vm="shadowRGBA",Wm="patternImage",Um="linearGradient",Gm="radialGradient";let i;Bm.shapes={};class a extends r.Node{constructor(e){let t;for(super(e);!(t=n.Util.getRandomColor())||t in Bm.shapes;);this.colorKey=t,Bm.shapes[t]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache("hasShadow",this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Wm,this.__getFillPattern)}__getFillPattern(){var r,o;if(this.fillPatternImage())return(r=e().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat"))&&r.setTransform&&((o=new n.Transform).translate(this.fillPatternX(),this.fillPatternY()),o.rotate(t.Konva.getAngle(this.fillPatternRotation())),o.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),o.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY()),o=o.getMatrix(),o="undefined"==typeof DOMMatrix?{a:o[0],b:o[1],c:o[2],d:o[3],e:o[4],f:o[5]}:new DOMMatrix(o),r.setTransform(o)),r}_getLinearGradient(){return this._getCache(Um,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var n=e(),r=this.fillLinearGradientStartPoint(),o=this.fillLinearGradientEndPoint(),i=n.createLinearGradient(r.x,r.y,o.x,o.y),a=0;athis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops())))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],(()=>this.strokeEnabled()&&this.strokeWidth()&&!(!this.stroke()&&!this.strokeLinearGradientColorStops())))}hasHitStroke(){var e=this.hitStrokeWidth();return"auto"===e?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var t=this.getStage();return!!t&&((t=t.bufferHitCanvas).getContext().clear(),this.drawHit(t,void 0,!0),0{this.draw(),this._waitingForDraw=!1}))),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let i=0;ithis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return void 0===e&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var e=this.getTimer()-this._startTime;2===this.state?this.setTime(e):3===this.state&&this.setTime(this.duration-e)}pause(){this.state=1,this.fire("onPause")}getTimer(){return(new Date).getTime()}}class o{constructor(i){var a,l=this,s=(f=i.node)._id,c=i.easing||cv.Easings.Linear,u=!!i.yoyo,d=void 0===i.duration?.3:0===i.duration?.001:i.duration,f=(this.node=f,this._id=dv++,f.getLayer()||(f instanceof n.Konva.Stage?f.getLayers():null));for(a in f||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new t.Animation((function(){l.tween.onEnterFrame()}),f),this.tween=new r(a,(function(e){l._tweenFunc(e)}),c,0,1,1e3*d,u),this._addListeners(),o.attrs[s]||(o.attrs[s]={}),o.attrs[s][this._id]||(o.attrs[s][this._id]={}),o.tweens[s]||(o.tweens[s]={}),i)void 0===uv[a]&&this._addAttr(a,i[a]);this.reset(),this.onFinish=i.onFinish,this.onReset=i.onReset,this.onUpdate=i.onUpdate}_addAttr(t,n){var r,i,a,l,s,c,u,d,f=this.node,h=f._id,p=o.tweens[h][t];if(p&&delete o.attrs[h][p][t],r=f.getAttr(t),e.Util._isArray(n))if(i=[],l=Math.max(n.length,r.length),"points"===t&&n.length!==r.length&&(n.length>r.length?(c=r,r=e.Util._prepareArrayForTween(r,n,f.closed())):(s=n,n=e.Util._prepareArrayForTween(n,r,f.closed()))),0===t.indexOf("fill"))for(a=0;a{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,t=o.attrs[e._id][this._id];t.points&&t.points.trueEnd&&e.setAttr("points",t.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,t=o.attrs[e._id][this._id];t.points&&t.points.trueStart&&e.points(t.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(1e3*e),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e,t=this.node._id,n=this._id,r=o.tweens[t];for(e in this.pause(),r)delete o.tweens[t][e];delete o.attrs[t][n]}}(cv.Tween=o).attrs={},o.tweens={},mb.Node.prototype.to=function(e){var t=e.onFinish;e.node=this,e.onFinish=function(){this.destroy(),t&&t()},new o(e).play()},cv.Easings={BackEaseIn:(e,t,n,r)=>n*(e/=r)*e*(2.70158*e-1.70158)+t,BackEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*(2.70158*e+1.70158)+1)+t,BackEaseInOut(e,t,n,r){var o=1.70158;return(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t},ElasticEaseIn(e,t,n,r,o,i){var a=0;return 0===e?t:1==(e/=r)?t+n:(i=i||.3*r,a=!o||o(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t,BounceEaseIn:(e,t,n,r)=>n-cv.Easings.BounceEaseOut(r-e,0,n,r)+t,BounceEaseInOut:(e,t,n,r)=>en*(e/=r)*e+t,EaseOut:(e,t,n,r)=>-n*(e/=r)*(e-2)+t,EaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t,StrongEaseIn:(e,t,n,r)=>n*(e/=r)*e*e*e*e+t,StrongEaseOut:(e,t,n,r)=>n*((e=e/r-1)*e*e*e*e+1)+t,StrongEaseInOut:(e,t,n,r)=>(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t,Linear:(e,t,n,r)=>n*e/r+t}}Fv=d,Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.Konva=void 0,ob=Fg,Fv.Konva=Ky.Util._assign(ob.Konva,{Util:Ky.Util,Transform:Ky.Transform,Node:f.Node,Container:km.Container,Stage:sm.Stage,stages:sm.stages,Layer:nk.Layer,FastLayer:lk.FastLayer,Group:py.Group,DD:lm.DD,Shape:BS.Shape,shapes:BS.shapes,Animation:Tm.Animation,Tween:gm.Tween,Easings:gm.Easings,Context:Qg.Context,Canvas:o.Canvas}),Fv.default=Fv.Konva,$m={},Object.defineProperty($m,"__esModule",{value:!0}),$m.Arc=void 0,Pv=m;const hv=Fg;_v=dg,nb=Fg;class pv extends BS.Shape{_sceneFunc(e){var t=hv.Konva.getAngle(this.angle()),n=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,t,n),e.arc(0,0,this.innerRadius(),t,0,!n),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){var e=this.innerRadius(),t=this.outerRadius(),n=this.clockwise(),r=hv.Konva.getAngle(n?360-this.angle():this.angle()),o=Math.cos(Math.min(r,Math.PI)),i=(i=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)))*(0{var o;let i;var a,l,s,c=r/2;for(let u=i=0;u<20;u++)o=c*yv.tValues[20][u]+c,i+=yv.cValues[20][u]*(l=n,l=(a=e(1,s=o,a=t))*a+(s=e(1,s,l))*s,Math.sqrt(l));return c*i},yv.getQuadraticArcLength=(e,t,n)=>{void 0===n&&(n=1);var r=e[0]-2*e[1]+e[2],o=t[0]-2*t[1]+t[2],i=2*e[1]-2*e[0],a=2*t[1]-2*t[0],l=4*(r*r+o*o);r=4*(r*i+o*a),o=i*i+a*a;return 0==l?n*Math.sqrt(Math.pow(e[2]-e[0],2)+Math.pow(t[2]-t[0],2)):(t=0<(a=n+(i=r/(2*l)))*a+(e=o/l-i*i)?Math.sqrt(a*a+e):0,n=0{var o,i=r.length-1;let a;if(0==i)return 0;if(0===t){for(let e=a=0;e<=i;e++)a+=yv.binomialCoefficients[i][e]*Math.pow(1-n,i-e)*Math.pow(n,e)*r[e];return a}o=new Array(i);for(let e=0;e{let r=1,o=e/t,i=(e-n(o))/t,a=0;for(;.001o;r-=i){var a=wv.getPointOnEllipticalArc(e.points[0],e.points[1],e.points[2],e.points[3],r,0);n.push(a.x,a.y)}else for(let r=t+i;rt[r].pathLength;)e-=t[r].pathLength,++r;if(r===o)return{x:(n=t[r-1].points.slice(-2))[0],y:n[1]};if(e<.01)return{x:(n=t[r].points.slice(0,2))[0],y:n[1]};var i=t[r],a=i.points;switch(i.command){case"L":return wv.getPointOnLine(e,i.start.x,i.start.y,a[0],a[1]);case"C":return wv.getPointOnCubicBezier((0,bv.t2length)(e,wv.getPathLength(t),(e=>(0,bv.getCubicArcLength)([i.start.x,a[0],a[2],a[4]],[i.start.y,a[1],a[3],a[5]],e))),i.start.x,i.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return wv.getPointOnQuadraticBezier((0,bv.t2length)(e,wv.getPathLength(t),(e=>(0,bv.getQuadraticArcLength)([i.start.x,a[0],a[2]],[i.start.y,a[1],a[3]],e))),i.start.x,i.start.y,a[0],a[1],a[2],a[3]);case"A":var l=a[0],s=a[1],c=a[2],u=a[3],d=a[4],f=a[5],h=a[6];return d+=f*e/i.pathLength,wv.getPointOnEllipticalArc(l,s,c,u,d,h)}}return null}static getPointOnLine(e,t,n,r,o,i,a){void 0===i&&(i=t),void 0===a&&(a=n);var l,s=(o-n)/(r-t+1e-8),c=Math.sqrt(e*e/(1+s*s)),u=(r{this._setImageLoad()})),this._setImageLoad()}_setImageLoad(){var e=this.image();e&&e.complete||e&&4===e.readyState||e&&e.addEventListener&&e.addEventListener("load",(()=>{this._requestDraw()}))}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){var t,n,r=this.getWidth(),o=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;let l;a&&(t=this.attrs.cropWidth,n=this.attrs.cropHeight,l=t&&n?[a,this.cropX(),this.cropY(),t,n,0,0,r,o]:[a,0,0,r,o]),(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?Ov.Util.drawRoundedRectPath(e,r,o,i):e.rect(0,0,r,o),e.closePath(),e.fillStrokeShape(this)),a&&(i&&e.clip(),e.drawImage.apply(e,l))}_hitFunc(e){var t=this.width(),n=this.height(),r=this.cornerRadius();e.beginPath(),r?Ov.Util.drawRoundedRectPath(e,t,n,r):e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e;return null!=(e=this.attrs.width)?e:null==(e=this.image())?void 0:e.width}getHeight(){var e;return null!=(e=this.attrs.height)?e:null==(e=this.image())?void 0:e.height}static fromURL(e,t,n=null){var r=Ov.Util.createImageElement();r.onload=function(){var e=new kv({image:r});t(e)},r.onerror=n,r.crossOrigin="Anonymous",r.src=e}}(lm.Image=kv).prototype.className="Image",(0,o._registerNode)(kv),Fv.Factory.addGetterSetter(kv,"cornerRadius",0,(0,Qg.getNumberOrArrayOfNumbersValidator)(4)),Fv.Factory.addGetterSetter(kv,"image"),Fv.Factory.addComponentsGetterSetter(kv,"crop",["x","y","width","height"]),Fv.Factory.addGetterSetter(kv,"cropX",0,(0,Qg.getNumberValidator)()),Fv.Factory.addGetterSetter(kv,"cropY",0,(0,Qg.getNumberValidator)()),Fv.Factory.addGetterSetter(kv,"cropWidth",0,(0,Qg.getNumberValidator)()),Fv.Factory.addGetterSetter(kv,"cropHeight",0,(0,Qg.getNumberValidator)());sm={};var Pv=(Object.defineProperty(sm,"__esModule",{value:!0}),sm.Tag=sm.Label=void 0,m),_v=BS,Lv=(gm=dg,km=Fg,["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"]),Iv="right",Tv="down",Mv="left",jv=Lv.length;class Av extends py.Group{constructor(e){super(e),this.on("add.konva",(function(e){this._addListeners(e.child),this._sync()}))}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){for(var t=this,n=function(){t._sync()},r=0;r{t=Math.min(t,e.x),n=Math.max(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.y)})),{x:t,y:r,width:n-t,height:o-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}(_v.RegularPolygon=Dv).prototype.className="RegularPolygon",Dv.prototype._centroid=!0,Dv.prototype._attrsAffectingSize=["radius"],(0,gm._registerNode)(Dv),km.Factory.addGetterSetter(Dv,"radius",0,(0,Pv.getNumberValidator)()),km.Factory.addGetterSetter(Dv,"sides",0,(0,Pv.getNumberValidator)());var Fv={},Hv=(o=(Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.Ring=void 0,m),Qg=dg,gm=Fg,2*Math.PI);class Bv extends BS.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,Hv,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),Hv,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}(Fv.Ring=Bv).prototype.className="Ring",Bv.prototype._centroid=!0,Bv.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,gm._registerNode)(Bv),o.Factory.addGetterSetter(Bv,"innerRadius",0,(0,Qg.getNumberValidator)()),o.Factory.addGetterSetter(Bv,"outerRadius",0,(0,Qg.getNumberValidator)()),km={},Object.defineProperty(km,"__esModule",{value:!0}),km.Sprite=void 0,Pv=m;const Vv=Tm;gm=dg,o=Fg;class Wv extends BS.Shape{constructor(e){super(e),this._updated=!0,this.anim=new Vv.Animation((()=>{var e=this._updated;return this._updated=!1,e})),this.on("animationChange.konva",(function(){this.frameIndex(0)})),this.on("frameIndexChange.konva",(function(){this._updated=!0})),this.on("frameRateChange.konva",(function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())}))}_sceneFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[0+r],l=o[1+r],s=o[2+r];o=o[3+r],r=this.image();(this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,s,o),e.closePath(),e.fillStrokeShape(this)),r&&(i?(i=i[t],e.drawImage(r,a,l,s,o,i[0+(t=2*n)],i[1+t],s,o)):e.drawImage(r,a,l,s,o,0,0,s,o))}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=4*n,o=this.animations()[t],i=this.frameOffsets(),a=o[2+r];o=o[3+r];e.beginPath(),i?(r=i[t],e.rect(r[0+(i=2*n)],r[1+i],a,o)):e.rect(0,0,a,o),e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval((function(){e._updateIndex()}),1e3/this.frameRate())}start(){var e;this.isRunning()||(e=this.getLayer(),this.anim.setLayers(e),this._setInterval(),this.anim.start())}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),t=this.animation();e{var t=0<=(e=e.trim()).indexOf(" "),n=0<=e.indexOf('"')||0<=e.indexOf("'");return t&&!n?`"${e}"`:e})).join(", ")}_addTextLine(e){this.align()===$v&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return ey().measureText(e).width+(n?t*(n-1):0)}_setTextData(){for(var e=this.text().split("\n"),t=+this.fontSize(),n=0,r=this.lineHeight()*t,o=this.attrs.width,i=this.attrs.height,a=o!==Kv&&void 0!==o,l=i!==Kv&&void 0!==i,s=this.padding(),c=o-2*s,u=i-2*s,d=0,f="char"!==(o=this.wrap())&&"none"!==o,h=(i=this.ellipsis(),this.textArr=[],ey().font=this._getContextFont(),i?this._getTextWidth("…"):0),p=0,g=e.length;p>>1,E=m.slice(0,1+S),O=this._getTextWidth(E)+h;O<=c?(b=1+S,x=E,C=O):w=S}if(!x)break;if(f&&0<(y=(" "===(y=m[x.length])||"-"===y)&&C<=c?x.length:Math.max(x.lastIndexOf(" "),x.lastIndexOf("-"))+1)&&(b=y,x=x.slice(0,b),C=this._getTextWidth(x)),x=x.trimRight(),this._addTextLine(x),n=Math.max(n,C),d+=r,this._shouldHandleEllipsis(d)){this._tryToAddEllipsisToLastLine();break}if(0<(m=(m=m.slice(b)).trimLeft()).length&&(v=this._getTextWidth(m))<=c){this._addTextLine(m),d+=r,n=Math.max(n,v);break}}else this._addTextLine(m),d+=r,n=Math.max(n,v),this._shouldHandleEllipsis(d)&&pe+"."+gy)).join(" "),vy="nodesRect",yy=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],by={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const wy="ontouchstart"in hy.Konva._global;var xy=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function Cy(e,t,n){var r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t);n=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:n}}let Sy=0;class Ey extends fy.Group{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(my,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return sy.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return gy+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();var t=e.filter((e=>!e.isAncestorOf(this)||(sy.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1)));return this._nodes=e=t,1===e.length&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach((e=>{var t=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=e._attrsAffectingSize.map((e=>e+"Change."+this._getEventNamespace())).join(" ");e.on(n,t),e.on(yy.map((e=>e+"."+this._getEventNamespace())).join(" "),t),e.on("absoluteTransformChange."+this._getEventNamespace(),t),this._proxyDrag(e)})),this._resetTransformCache(),!this.findOne(".top-left")||this.update(),this}_proxyDrag(e){let t;e.on("dragstart."+this._getEventNamespace(),(n=>{t=e.getAbsolutePosition(),this.isDragging()||e===this.findOne(".back")||this.startDrag(n,!1)})),e.on("dragmove."+this._getEventNamespace(),(n=>{if(t){var r=e.getAbsolutePosition();const o=r.x-t.x,i=r.y-t.y;this.nodes().forEach((t=>{var r;t===e||t.isDragging()||(r=t.getAbsolutePosition(),t.setAbsolutePosition({x:r.x+o,y:r.y+i}),t.startDrag(n))})),t=null}}))}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach((e=>{e.off("."+this._getEventNamespace())})),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(vy),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(vy,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(n),i=(n=e.getAbsolutePosition(n),r.x*o.x-e.offsetX()*o.x),a=r.y*o.y-e.offsetY()*o.y;e=(hy.Konva.getAngle(e.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return Cy({x:n.x+i*Math.cos(e)+a*Math.sin(-e),y:n.y+a*Math.cos(e)+i*Math.sin(e),width:r.width*o.x,height:r.height*o.y,rotation:e},-hy.Konva.getAngle(t),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const e=[],t=(this.nodes().map((t=>{var n=[{x:(n=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()})).x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}],r=t.getAbsoluteTransform();n.forEach((function(t){t=r.point(t),e.push(t)}))})),new sy.Transform);t.rotate(-hy.Konva.getAngle(this.rotation()));var n=1/0,r=1/0,o=-1/0,i=-1/0,a=(e.forEach((function(e){e=t.point(e),void 0===n&&(n=o=e.x,r=i=e.y),n=Math.min(n,e.x),r=Math.min(r,e.y),o=Math.max(o,e.x),i=Math.max(i,e.y)})),t.invert(),t.point({x:n,y:r}));return{x:a.x,y:a.y,width:o-n,height:i-r,rotation:hy.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),xy.forEach((e=>{this._createAnchor(e)})),this._createAnchor("rotater")}_createAnchor(e){var t=new dy.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:wy?10:"auto"}),n=this;t.on("mousedown touchstart",(function(e){n._handleMouseDown(e)})),t.on("dragstart",(e=>{t.stopDrag(),e.cancelBubble=!0})),t.on("dragend",(e=>{e.cancelBubble=!0})),t.on("mouseenter",(()=>{var n=hy.Konva.getAngle(this.rotation()),r=this.rotateAnchorCursor(),o="rotater"===(o=e)?r:(n+=sy.Util.degToRad(by[o]||0),r=(sy.Util.radToDeg(n)%360+360)%360,sy.Util._inRange(r,337.5,360)||sy.Util._inRange(r,0,22.5)?"ns-resize":sy.Util._inRange(r,22.5,67.5)?"nesw-resize":sy.Util._inRange(r,67.5,112.5)?"ew-resize":sy.Util._inRange(r,112.5,157.5)?"nwse-resize":sy.Util._inRange(r,157.5,202.5)?"ns-resize":sy.Util._inRange(r,202.5,247.5)?"nesw-resize":sy.Util._inRange(r,247.5,292.5)?"ew-resize":sy.Util._inRange(r,292.5,337.5)?"nwse-resize":(sy.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer"));t.getStage().content&&(t.getStage().content.style.cursor=o),this._cursorChange=!0})),t.on("mouseout",(()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1})),this.add(t)}_createBack(){var e=new uy.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(e,t){var n=t.getParent(),r=n.padding();e.beginPath(),e.rect(-r,-r,t.width()+2*r,t.height()+2*r),e.moveTo(t.width()/2,-r),n.rotateEnabled()&&n.rotateLineVisible()&&e.lineTo(t.width()/2,-n.rotateAnchorOffset()*sy.Util._sign(t.height())-r),e.fillStrokeShape(t)},hitFunc:(e,t)=>{var n;this.shouldOverdrawWholeArea()&&(n=this.padding(),e.beginPath(),e.rect(-n,-n,t.width()+2*n,t.height()+2*n),e.fillStrokeShape(t))}});this.add(e),this._proxyDrag(e),e.on("dragstart",(e=>{e.cancelBubble=!0})),e.on("dragmove",(e=>{e.cancelBubble=!0})),e.on("dragend",(e=>{e.cancelBubble=!0})),this.on("dragmove",(e=>{this.update()}))}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var t=(n=this._getNodeRect()).width,n=n.height,r=Math.sqrt(Math.pow(t,2)+Math.pow(n,2));this.sin=Math.abs(n/r),this.cos=Math.abs(t/r),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0,n=e.target.getAbsolutePosition(),t=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:t.x-n.x,y:t.y-n.y},Sy++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach((t=>{t._fire("transformstart",{evt:e.evt,target:t})}))}_handleMouseMove(e){var t=this.findOne("."+this._movingAnchorName);let n={x:(r=((r=t.getStage()).setPointersPositions(e),r.getPointerPosition())).x-this._anchorDragOffset.x,y:r.y-this._anchorDragOffset.y};var r=t.getAbsolutePosition(),o=(this.anchorDragBoundFunc()&&(n=this.anchorDragBoundFunc()(r,n,e)),t.setAbsolutePosition(n),t.getAbsolutePosition());if(r.x!==o.x||r.y!==o.y)if("rotater"===this._movingAnchorName){r=this._getNodeRect();var i=t.x()-r.width/2,a=-t.y()+r.height/2;let n=Math.atan2(-a,i)+Math.PI/2;r.height<0&&(n-=Math.PI);o=hy.Konva.getAngle(this.rotation())+n;var l=hy.Konva.getAngle(this.rotationSnapTolerance());o=function(e,t){var n={x:(n=e).x+n.width/2*Math.cos(n.rotation)+n.height/2*Math.sin(-n.rotation),y:n.y+n.height/2*Math.cos(n.rotation)+n.width/2*Math.sin(n.rotation)};return Cy(e,t,n)}(r,function(e,t,n){let r=t;for(let a=0;af.x?-1:1,d=this.findOne(".top-left").y()>f.y?-1:1,i=u*this.cos*c,a=u*this.sin*d,this.findOne(".top-left").x(f.x-i),this.findOne(".top-left").y(f.y-a)):"top-center"===this._movingAnchorName?this.findOne(".top-left").y(t.y()):"top-right"===this._movingAnchorName?(r&&(f=o?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()},u=Math.sqrt(Math.pow(t.x()-f.x,2)+Math.pow(f.y-t.y(),2)),c=this.findOne(".top-right").x()f.y?-1:1,i=u*this.cos*c,a=u*this.sin*d,this.findOne(".top-right").x(f.x+i),this.findOne(".top-right").y(f.y-a)),s=t.position(),this.findOne(".top-left").y(s.y),this.findOne(".bottom-right").x(s.x)):"middle-left"===this._movingAnchorName?this.findOne(".top-left").x(t.x()):"middle-right"===this._movingAnchorName?this.findOne(".bottom-right").x(t.x()):"bottom-left"===this._movingAnchorName?(r&&(f=o?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()},u=Math.sqrt(Math.pow(f.x-t.x(),2)+Math.pow(t.y()-f.y,2)),c=f.x{t._fire("transformend",{evt:e,target:t}),null!=(t=t.getLayer())&&t.batchDraw()})),this._movingAnchorName=null)}_fitNodesInto(e,t){var n=this._getNodeRect();if(sy.Util._inRange(e.width,2*-this.padding()-1,1))this.update();else if(sy.Util._inRange(e.height,2*-this.padding()-1,1))this.update();else{var r=((o=new sy.Transform).rotate(hy.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&0<=this._movingAnchorName.indexOf("left")?(r=o.point({x:2*-this.padding(),y:0}),e.x+=r.x,e.y+=r.y,e.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=r.x,this._anchorDragOffset.y-=r.y):this._movingAnchorName&&e.width<0&&0<=this._movingAnchorName.indexOf("right")&&(r=o.point({x:2*this.padding(),y:0}),this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=r.x,this._anchorDragOffset.y-=r.y,e.width+=2*this.padding()),this._movingAnchorName&&e.height<0&&0<=this._movingAnchorName.indexOf("top")?(r=o.point({x:0,y:2*-this.padding()}),e.x+=r.x,e.y+=r.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=r.x,this._anchorDragOffset.y-=r.y,e.height+=2*this.padding()):this._movingAnchorName&&e.height<0&&0<=this._movingAnchorName.indexOf("bottom")&&(r=o.point({x:0,y:2*this.padding()}),this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=r.x,this._anchorDragOffset.y-=r.y,e.height+=2*this.padding()),this.boundBoxFunc()&&((o=this.boundBoxFunc()(n,e))?e=o:sy.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")),new sy.Transform),o=(r.translate(n.x,n.y),r.rotate(n.rotation),r.scale(n.width/1e7,n.height/1e7),new sy.Transform),i=(n=e.width/1e7,e.height/1e7);!1===this.flipEnabled()?(o.translate(e.x,e.y),o.rotate(e.rotation),o.translate(e.width<0?e.width:0,e.height<0?e.height:0),o.scale(Math.abs(n),Math.abs(i))):(o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(n,i));const a=o.multiply(r.invert());this._nodes.forEach((e=>{var t=e.getParent().getAbsoluteTransform(),n=e.getTransform().copy(),r=(n.translate(e.offsetX(),e.offsetY()),new sy.Transform);r.multiply(t.copy().invert()).multiply(a).multiply(t).multiply(n),t=r.decompose();e.setAttrs(t),null!=(n=e.getLayer())&&n.batchDraw()})),this.rotation(sy.Util._getRotation(e.rotation)),this._nodes.forEach((e=>{this._fire("transform",{evt:t,target:e}),e._fire("transform",{evt:t,target:e})})),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e=this._getNodeRect(),t=(this.rotation(sy.Util._getRotation(e.rotation)),e.width),n=(e=e.height,this.enabledAnchors()),r=this.resizeEnabled(),o=this.padding(),i=this.anchorSize(),a=this.find("._anchor");a.forEach((e=>{e.setAttrs({width:i,height:i,offsetX:i/2,offsetY:i/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})})),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:i/2+o,offsetY:i/2+o,visible:r&&0<=n.indexOf("top-left")}),this._batchChangeChild(".top-center",{x:t/2,y:0,offsetY:i/2+o,visible:r&&0<=n.indexOf("top-center")}),this._batchChangeChild(".top-right",{x:t,y:0,offsetX:i/2-o,offsetY:i/2+o,visible:r&&0<=n.indexOf("top-right")}),this._batchChangeChild(".middle-left",{x:0,y:e/2,offsetX:i/2+o,visible:r&&0<=n.indexOf("middle-left")}),this._batchChangeChild(".middle-right",{x:t,y:e/2,offsetX:i/2-o,visible:r&&0<=n.indexOf("middle-right")}),this._batchChangeChild(".bottom-left",{x:0,y:e,offsetX:i/2+o,offsetY:i/2-o,visible:r&&0<=n.indexOf("bottom-left")}),this._batchChangeChild(".bottom-center",{x:t/2,y:e,offsetY:i/2-o,visible:r&&0<=n.indexOf("bottom-center")}),this._batchChangeChild(".bottom-right",{x:t,y:e,offsetX:i/2-o,offsetY:i/2-o,visible:r&&0<=n.indexOf("bottom-right")}),this._batchChangeChild(".rotater",{x:t/2,y:-this.rotateAnchorOffset()*sy.Util._sign(e)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:t,height:e,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const l=this.anchorStyleFunc();l&&a.forEach((e=>{l(e)})),null!=(r=this.getLayer())&&r.batchDraw()}isTransforming(){return this._transforming}stopTransform(){var e;this._transforming&&(this._removeEvents(),e=this.findOne("."+this._movingAnchorName))&&e.stopDrag()}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),fy.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return cy.Node.prototype.toObject.call(this)}clone(e){return cy.Node.prototype.clone.call(this,e)}getClientRect(){return 00>H,0!==S?(k[a]=(s*F>>H)*(S=255/S),k[a+1]=(c*F>>H)*S,k[a+2]=(u*F>>H)*S):k[a]=k[a+1]=k[a+2]=0,s-=f,c-=h,u-=p,d-=g,f-=R.r,h-=R.g,p-=R.b,g-=R.a,o=l+((o=n+O+1)>H,0>H)*(S=255/S),k[o+1]=(c*F>>H)*S,k[o+2]=(u*F>>H)*S):k[o]=k[o+1]=k[o+2]=0,s-=f,c-=h,u-=p,d-=g,f-=R.r,h-=R.g,p-=R.b,g-=R.a,o=n+((o=r+M)")?o.replace("",e.displayName):o}while(1<=l&&0<=s);break}}}finally{et=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Je(e):""}var nt=Object.prototype.hasOwnProperty,rt=[],ot=-1;function it(e){return{current:e}}function at(e){ot<0||(e.current=rt[ot],rt[ot]=null,ot--)}function lt(e,t){rt[++ot]=e.current,e.current=t}var st={},ct=it(st),ut=it(!1),dt=st;function ft(e,t){var n=e.type.contextTypes;if(!n)return st;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ht(e){return null!=e.childContextTypes}function pt(){at(ut),at(ct)}function gt(e,t,n){if(ct.current!==st)throw Error(i(168));lt(ct,t),lt(ut,n)}function mt(e,t,n){var r,a=e.stateNode;if(t=t.childContextTypes,"function"!=typeof a.getChildContext)return n;for(r in a=a.getChildContext())if(!(r in t))throw Error(i(108,function(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return S(t);case 8:return t===d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}(e)||"Unknown",r));return o({},n,a)}function vt(e){e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||st,dt=ct.current,lt(ct,e),lt(ut,ut.current)}function yt(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=mt(e,t,dt),r.__reactInternalMemoizedMergedChildContext=e,at(ut),at(ct),lt(ct,e)):at(ut),lt(ut,n)}var bt=Math.clz32||function(e){return 0==(e>>>=0)?32:31-(wt(e)/xt|0)|0},wt=Math.log,xt=Math.LN2,Ct=64,St=4194304;function Et(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ot(e,t){var n=e.pendingLanes;if(0===n)return 0;var r,o=0,i=e.suspendedLanes,a=e.pingedLanes,l=268435455&n;if(0!=l?0!=(r=l&~i)?o=Et(r):0!=(a&=l)&&(o=Et(a)):0!=(l=n&~i)?o=Et(l):0!==a&&(o=Et(a)),0===o)return 0;if(0!==t&&t!==o&&0==(t&i)&&((a=t&-t)<=(i=o&-o)||16===i&&0!=(4194240&a)))return t;if(0!=(4&o)&&(o|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=o;0>=r,i-=r,rn=1<<32-bt(t)+i|n<T?(M=I,I=null):M=I.sibling;var j=m(S,I,O[T],k);if(null===j){null===I&&(I=M);break}e&&I&&null===j.alternate&&t(S,I),E=a(j,E,T),null===_?P=j:_.sibling=j,_=j,I=M}if(T===O.length)n(S,I);else if(null===I)for(;TB?(V=H,H=null):V=H.sibling;var U=m(A,H,W.value,R);if(null===U){null===H&&(H=V);break}e&&H&&null===U.alternate&&t(A,H),N=a(U,N,B),null===F?D=U:F.sibling=U,F=U,H=V}if(W.done)n(A,H);else if(null===H)for(;!W.done;B++,W=z.next())null!==(W=g(A,W.value,R))&&(N=a(W,N,B),null===F?D=W:F.sibling=W,F=W);else{for(H=r(A,H);!W.done;B++,W=z.next())null!==(W=v(H,A,B,W.value,R))&&(e&&null!==W.alternate&&H.delete(null===W.key?B:W.key),N=a(W,N,B),null===F?D=W:F.sibling=W,F=W);e&&H.forEach((function(e){return t(A,e)}))}return fn&&an(A,B),D}Pn(0,p)}return"string"==typeof p&&""!==p||"number"==typeof p?(p=""+p,(h=null!==h&&6===h.tag?(n(f,h.sibling),o(h,p)):(n(f,h),Za(p,f.mode,y))).return=f,l(f=h)):n(f,h)}}var In=Ln(!0),Tn=Ln(!1),Mn=it(null),jn=null,An=null,Nn=null;function zn(){Nn=An=jn=null}function Rn(e,t,n){U?(lt(Mn,t._currentValue),t._currentValue=n):(lt(Mn,t._currentValue2),t._currentValue2=n)}function Dn(e){var t=Mn.current;at(Mn),U?e._currentValue=t:e._currentValue2=t}function Fn(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hn(e,t){(Nn=An=null)!==(e=(jn=e).dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Po=!0),e.firstContext=null)}function Bn(e){var t=U?e._currentValue:e._currentValue2;if(Nn!==e)if(e={context:e,memoizedValue:t,next:null},null===An){if(null===jn)throw Error(i(308));An=e,jn.dependencies={lanes:0,firstContext:e}}else An=An.next=e;return t}var Vn=null;function Wn(e){null===Vn?Vn=[e]:Vn.push(e)}function Un(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,Wn(t)):(n.next=o.next,o.next=n),t.interleaved=n,Gn(e,r)}function Gn(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),e=(n=e).return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),e=(n=e).return;return 3===n.tag?n.stateNode:null}var Zn=!1;function Xn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function qn(e,t,n){var r,o=e.updateQueue;return null===o?null:(o=o.shared,0!=(2&Bi)?(null===(r=o.pending)?t.next=t:(t.next=r.next,r.next=t),o.pending=t):(null===(r=o.interleaved)?(t.next=t,Wn(o)):(t.next=r.next,r.next=t),o.interleaved=t),Gn(e,n))}function $n(e,t,n){var r;null!==(t=t.updateQueue)&&(t=t.shared,0!=(4194240&n))&&(r=t.lanes,r&=e.pendingLanes,It(e,t.lanes=n|=r))}function Qn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null}}while(null===i?o=i=a:i=i.next=a,null!==(n=n.next));null===i?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n}else null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Jn(e,t,n,r){var i,a,l=e.updateQueue,s=(Zn=!1,l.firstBaseUpdate),c=l.lastBaseUpdate;if(null!==(f=l.shared.pending)&&(l.shared.pending=null,a=(i=f).next,(i.next=null)===c?s=a:c.next=a,c=i,null!==(d=e.alternate))&&(f=(d=d.updateQueue).lastBaseUpdate)!==c&&(null===f?d.firstBaseUpdate=a:f.next=a,d.lastBaseUpdate=i),null!==s){for(var u=l.baseState,d=(c=0,a=i=null),f=s;;){var h=f.lane,p=f.eventTime;if((r&h)===h){null!==d&&(d=d.next={eventTime:p,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var g=e,m=f;h=t,p=n;switch(m.tag){case 1:if("function"==typeof(g=m.payload)){u=g.call(p,u,h);break e}u=g;break e;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(h="function"==typeof(g=m.payload)?g.call(p,u,h):g))break e;u=o({},u,h);break e;case 2:Zn=!0}}null!==f.callback&&0!==f.lane&&(e.flags|=64,null===(h=l.effects)?l.effects=[f]:h.push(f))}else p={eventTime:p,lane:h,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===d?(a=d=p,i=u):d=d.next=p,c|=h;if(null===(f=f.next)){if(null===(f=l.shared.pending))break;f=(h=f).next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}if(null===d&&(i=u),l.baseState=i,l.firstBaseUpdate=a,l.lastBaseUpdate=d,null!==(t=l.shared.interleaved))for(l=t;c|=l.lane,(l=l.next)!==t;);else null===s&&(l.shared.lanes=0);Ki|=c,e.lanes=c,e.memoizedState=u}}function er(e,t,n){if(e=t.effects,(t.effects=null)!==e)for(t=0;t";case _i:return":has("+(Ai(e)||"")+")";case Li:return'[role="'+e.value+'"]';case Ti:return'"'+e.value+'"';case Ii:return'[data-testname="'+e.value+'"]';default:throw Error(i(365))}}function Ni(e,t){var n=[];e=[e,0];for(var r=0;rta&&(t.flags|=128,ni(o,!(r=!0)),t.lanes=4194304)}else{if(!r)if(null!==(e=dr(a))){if(t.flags|=128,r=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),ni(o,!0),null===o.tail&&"hidden"===o.tailMode&&!a.alternate&&!fn)return ri(t),null}else 2*Rt()-o.renderingStartTime>ta&&1073741824!==n&&(t.flags|=128,ni(o,!(r=!0)),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=o.last)?e.sibling=a:t.child=a,o.last=a)}if(null!==o.tail)return t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Rt(),t.sibling=null,e=ur.current,lt(ur,r?1&e|2:1&e),t}return ri(t),null;case 22:case 23:return Oa(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!=(1&t.mode)?0!=(1073741824&Gi)&&(ri(t),G)&&6&t.subtreeFlags&&(t.flags|=8192):ri(t),null;case 24:case 25:return null}throw Error(i(156,t.tag))}(n,t,Gi)))return void(Wi=n)}else{if(null!==(n=function(e,t){switch(cn(t),t.tag){case 1:return ht(t.type)&&pt(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return lr(),at(ut),at(ct),hr(),0!=(65536&(e=t.flags))&&0==(128&e)?(t.flags=-65537&e|128,t):null;case 5:return cr(t),null;case 13:if(at(ur),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));Cn()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return at(ur),null;case 4:return lr(),null;case 10:return Dn(t.type._context),null;case 22:case 23:return Oa(),null;default:return null}}(n,t)))return n.flags&=32767,void(Wi=n);if(null===e)return Xi=6,void(Wi=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Wi=t)}while(Wi=t=e,null!==t);0===Xi&&(Xi=5)}function ja(e,t,n){var r=Tt,o=Hi.transition;try{Hi.transition=null,Tt=1;for(var a=e,l=t,s=n,c=r;Aa(),null!==ca;);if(0!=(6&Bi))throw Error(i(327));s=a.finishedWork;var u=a.finishedLanes;if(null!==s){if(a.finishedWork=null,a.finishedLanes=0,s===a.current)throw Error(i(177));a.callbackNode=null,a.callbackPriority=0;var d,f,h=s.lanes|s.childLanes;if(function(e,t){var n=e.pendingLanes&~t,r=(e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements,e.eventTimes);for(e=e.expirationTimes;0 ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},t.getPublicRootInstance=function(e){return(e=e.current).child?5!==e.child.tag?e.child.stateNode:I(e.child.stateNode):null},t.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:el,findFiberByHostInstance:e.findFiberByHostInstance||tl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)e=!0;else{try{Vt=t.inject(e),Wt=t}catch(n){}e=!!t.checkDCE}}return e},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(e,t,n,r){if(!ee)throw Error(i(363));e=zi(e,t);var o=le(e,n,r).disconnect;return{disconnect:function(){o()}}},t.registerMutableSourceForHydration=function(e,t){var n=(n=t._getVersion)(t._source);null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},t.runWithPriority=function(e,t){var n=Tt;try{return Tt=e,t()}finally{Tt=n}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(e,t,n,r){var o=t.current,i=ga(),a=ma(o);return n=qa(n),null===t.context?t.context=n:t.pendingContext=n,(t=Kn(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=qn(o,t,a))&&(va(e,o,a,i),$n(e,o,a)),a},t},Rm.exports),rb={exports:{}},ob={ConcurrentRoot:1,ContinuousEventPriority:4,DefaultEventPriority:16,DiscreteEventPriority:1,IdleEventPriority:536870912,LegacyRoot:0};rb.exports=ob;const ib={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let ab=!1,lb=!1;const sb=".react-konva-event";let cb=!1;const ub={};function db(e,t,n=ub){var r,o,i;for(a in!ab&&"zIndex"in t&&(console.warn('ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'),ab=!0),!lb&&t.draggable&&(r=void 0!==t.x||void 0!==t.y,o=t.onDragEnd||t.onDragMove,r)&&!o&&(console.warn("ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n"),lb=!0),n)ib[a]||(l="on"===a.slice(0,2),i=n[a]!==t[a],l&&i&&("content"===(c=a.substr(2).toLowerCase()).substr(0,7)&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),e.off(c,n[a])),t.hasOwnProperty(a)||e.setAttr(a,void 0));var a,l,s,c,u=cb||t._useStrictMode,d={},f=!1,h={};for(a in t)ib[a]||(l="on"===a.slice(0,2),s=n[a]!==t[a],l&&s&&("content"===(c=a.substr(2).toLowerCase()).substr(0,7)&&(c="content"+c.substr(7,1).toUpperCase()+c.substr(8)),t[a])&&(h[c]=t[a]),!l&&(t[a]!==n[a]||u&&t[a]!==e.getAttr(a))&&(f=!0,d[a]=t[a]));for(c in f&&(e.setAttrs(d),fb(e)),h)e.on(c+sb,h[c])}function fb(e){Fg.Konva.autoDrawEnabled||(e=e.getLayer()||e.getStage())&&e.batchDraw()}const hb={},pb={};function gb(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),fb(e)}tb.Node.prototype._applyProps=db,lm=setTimeout,sm=clearTimeout;var mb=Object.freeze(Object.defineProperty({__proto__:null,appendInitialChild:function(e,t){"string"==typeof t?console.error("Do not use plain text as child of Konva.Node. You are using text: "+t):(e.add(t),fb(e))},createInstance:function(e,t,n){let r=tb[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=tb.Group);var o,i={},a={};for(o in t)"on"===o.slice(0,2)?a[o]=t[o]:i[o]=t[o];return db(e=new r(i),a),e},createTextInstance:function(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)},finalizeInitialChildren:function(e,t,n){return!1},getPublicInstance:function(e){return e},prepareForCommit:function(){return null},preparePortalMount:function(){return null},prepareUpdate:function(e,t,n,r){return pb},resetAfterCommit:function(){},resetTextContent:function(e){},shouldDeprioritizeSubtree:function(e,t){return!1},getRootHostContext:function(){return hb},getChildHostContext:function(){return hb},scheduleTimeout:lm,cancelTimeout:sm,noTimeout:-1,shouldSetTextContent:function(e,t){return!1},isPrimaryRenderer:!1,warnsIfNotActing:!0,supportsMutation:!0,appendChild:function(e,t){t.parent===e?t.moveToTop():e.add(t),fb(e)},appendChildToContainer:function(e,t){t.parent===e?t.moveToTop():e.add(t),fb(e)},insertBefore:gb,insertInContainerBefore:function(e,t,n){gb(e,t,n)},removeChild:function(e,t){t.destroy(),t.off(sb),fb(e)},removeChildFromContainer:function(e,t){t.destroy(),t.off(sb),fb(e)},commitTextUpdate:function(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)},commitMount:function(e,t,n){},commitUpdate:function(e,t,n,r,o){db(e,o,r)},hideInstance:function(e){e.hide(),fb(e)},hideTextInstance:function(e){},unhideInstance:function(e,t){null!=t.visible&&!t.visible||e.show()},unhideTextInstance:function(e,t){},clearContainer:function(e){},detachDeletedInstance:function(){},getCurrentEventPriority:()=>rb.exports.DefaultEventPriority,now:ue.exports.unstable_now,idlePriority:ue.exports.unstable_IdlePriority,run:ue.exports.unstable_runWithPriority},Symbol.toStringTag,{value:"Module"})),vb=Object.defineProperty,yb=Object.defineProperties,bb=Object.getOwnPropertyDescriptors,wb=Object.getOwnPropertySymbols,xb=Object.prototype.hasOwnProperty,Cb=Object.prototype.propertyIsEnumerable,Sb=(e,t,n)=>t in e?vb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eb=(e,t)=>{for(var n in t=t||{})xb.call(t,n)&&Sb(e,n,t[n]);if(wb)for(var n of wb(t))Cb.call(t,n)&&Sb(e,n,t[n]);return e};function Ob(e){try{return Object.defineProperties(e,{_currentRenderer:{get:()=>null,set(){}},_currentRenderer2:{get:()=>null,set(){}}})}catch(LD){return e}}"undefined"!=typeof window&&(null!=(nk=window.document)&&nk.createElement||"ReactNative"===(null==(lk=window.navigator)?void 0:lk.product))?a.exports.useLayoutEffect:a.exports.useEffect;const kb=console.error,Pb=(console.error=function(){var e=[...arguments].join("");if(null==e||!e.startsWith("Warning:")||!e.includes("useContext"))return kb.apply(this,arguments);console.error=kb},Ob(a.exports.createContext(null)));class _b extends a.exports.Component{render(){return a.exports.createElement(Pb.Provider,{value:this._reactInternals},this.props.children)}}function Lb(){const e=function(){var e,t=function(){const e=a.exports.useContext(Pb);if(null===e)throw new Error("its-fine: useFiber must be called within a !");const t=a.exports.useId();return a.exports.useMemo((()=>{for(const r of[e,null==e?void 0:e.alternate])if(r){var n=function e(t,n,r){if(t){if(!0===r(t))return t;let i=n?t.return:t.child;for(;i;){var o=e(i,n,r);if(o)return o;i=n?null:i.sibling}}}(r,!1,(e=>{let n=e.memoizedState;for(;n;){if(n.memoizedState===t)return!0;n=n.next}}));if(n)return n}}),[e,t])}(),[n]=a.exports.useState((()=>new Map));n.clear();let r=t;for(;r;)r.type&&"object"==typeof r.type&&(e=void 0===r.type._context&&r.type.Provider===r.type?r.type:r.type._context)&&e!==Pb&&!n.has(e)&&n.set(e,a.exports.useContext(Ob(e))),r=r.return;return n}();return a.exports.useMemo((()=>Array.from(e.keys()).reduce(((t,n)=>r=>a.exports.createElement(t,null,a.exports.createElement(n.Provider,((e,t)=>yb(e,bb(t)))(Eb({},r),{value:e.get(n)})))),(e=>a.exports.createElement(_b,Eb({},e))))),[e])}const Ib=e=>{const t=se.useRef(),n=se.useRef(),r=se.useRef(),o=function(e){const t=se.useRef();return se.useLayoutEffect((()=>{t.current=e})),t.current}(e),i=Lb(),a=t=>{var n=e.forwardedRef;n&&("function"==typeof n?n(t):n.current=t)};return se.useLayoutEffect((()=>(n.current=new tb.Stage({width:e.width,height:e.height,container:t.current}),a(n.current),r.current=Nb.createContainer(n.current,rb.exports.LegacyRoot,!1,null),Nb.updateContainer(se.createElement(i,{},e.children),r.current),()=>{tb.isBrowser&&(a(null),Nb.updateContainer(null,r.current,null),n.current.destroy())})),[]),se.useLayoutEffect((()=>{a(n.current),db(n.current,e,o),Nb.updateContainer(se.createElement(i,{},e.children),r.current,null)})),se.createElement("div",{ref:t,accessKey:e.accessKey,className:e.className,role:e.role,style:e.style,tabIndex:e.tabIndex,title:e.title})},Tb="Layer",Mb="Ellipse",jb="Image",Ab="Transformer",Nb=nb(mb);Nb.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:se.version,rendererPackageName:"react-konva"}),_v=se.forwardRef(((e,t)=>se.createElement(_b,{},se.createElement(Ib,{...e,forwardedRef:t}))));function zb(e,t,n,r){return Math.min(e/n,t/r)||1}var Rb="FIE_root",Db="FIE_transformers-layer",Fb="FIE_original-image",Hb="FIE_nodes-transformer",Bb="watermark",Vb="353297d2-40b4-4684-a875-45a2178a8157",Wb={FINETUNE:"Finetune",FILTERS:"Filters",ADJUST:"Adjust",WATERMARK:"Watermark",ANNOTATE:"Annotate",RESIZE:"Resize"},Ub={CROP:"Crop",ROTATE:"Rotate",FLIP_X:"Flip_X",FLIP_Y:"Flip_Y",BRIGHTNESS:"Brightness",CONTRAST:"Contrast",HSV:"HueSaturationValue",WARMTH:"Warmth",BLUR:"Blur",THRESHOLD:"Threshold",POSTERIZE:"Posterize",PIXELATE:"Pixelate",NOISE:"Noise",FILTERS:"Filters",RECT:"Rect",ELLIPSE:"Ellipse",POLYGON:"Polygon",TEXT:"Text",LINE:"Line",IMAGE:"Image",ARROW:"Arrow",WATERMARK:"Watermark",PEN:"Pen",RESIZE:"Resize"},Gb=["png","jpeg","jpg","webp"],Zb=[].concat(Gb,["svg","gif","avif","apng"]),Xb=Gb[0],Yb={DEFAULT:"default",DRAW:"crosshair",SELECT:"pointer",MOVE:"move",DRAG:"GRAB"},Kb="Crop",qb="ellipse",$b={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",MIDDLE_LEFT:"middle-left",MIDDLE_CENTER:"middle-center",MIDDLE_RIGHT:"middle-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},Qb=(Fv=14,km=14,"after-saving"),Jb="close-button-clicked",ew="warning",tw="error",nw={top:"north",bottom:"south",left:"west",center:"center",right:"east"},rw={northwest:"top-left",northcenter:"top-center",northeast:"top-right",centerwest:"center-left",centercenter:"center-center",centereast:"center-right",southwest:"bottom-left",southcenter:"bottom-center",southeast:"bottom-right"};function ow(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function iw(e){for(var t,n=1;n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hw(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=t?255:0,n[o+1]=n[o+1]>=t?255:0,n[o+2]=n[o+2]>=t?255:0)}Ax.finetuneName="Warmth",m.Factory.addGetterSetter(eb.Image,"warmth",0,Mg(),m.Factory.afterSetFilter),Nx.finetuneName="CustomThreshold",m.Factory.addGetterSetter(eb.Image,"threshold",0,Mg,m.Factory.afterSetFilter);var zx=Object.freeze(Object.defineProperty({__proto__:null,Warmth:Ax,CustomThreshold:Nx},Symbol.toStringTag,{value:"Module"})),Rx=function(e){return Array.isArray(e)&&0>>32-t}function fS(e){for(var t="",n=7;0<=n;n--)t+=(15&e>>>4*n).toString(16);return t}function hS(e){for(var t,n,r,o,i,a,l,s,c=e,u=Array(80),d=1732584193,f=4023233417,h=2562383102,p=271733878,g=3285377520,m=(c=function(e){for(var t,n=e.replace(/\r\n/g,"\n"),r="",o=0;o>6):r=(r+=String.fromCharCode(224|t>>12))+String.fromCharCode(128|63&t>>6),r+=String.fromCharCode(128|63&t));return r}(c)).length,v=[],y=0;y>>29),v.push(4294967295&m<<3),t=0;t input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"]),Ty=l.span.attrs({className:zp(Zv,"label")}).withConfig({componentId:"sc-jjink6-4"})((function(e){var t=e.theme,n=e.open;return Zf(["display:flex;align-items:center;justify-content:center;padding:6px 6px;border-radius:2px;position:absolute;top:-10px;font-size:10px;z-index:1;white-space:nowrap;transition:transform 150ms cubic-bezier(0.4,0,0.2,1) 0ms;transform-origin:bottom center;transform:",";background-color:",";color:#fff;cursor:pointer;transition:all 100ms ease-out;&::before{position:absolute;content:'';background-color:inherit;width:8px;height:8px;bottom:0px;left:50%;transform:translate(-50%,50%) rotate(45deg);}"],void 0!==n&&n?"translateY(-100%) scale(1)":"translateY(-100%) scale(0)",void 0!==(e=e.disabled)&&e?t.palette[ug.AccentPrimaryDisabled]:t.palette[ug.LinkStateless])})),Fp({Slider:Ay,Rail:My,Track:Ny,Thumb:Ry,SliderAnnotation:l.div.attrs({className:zp(Zv,"annotation")}).withConfig({componentId:"sc-jjink6-5"})((function(e){return Zf(["display:flex;justify-content:space-between;margin-top:12px;color:",";"],e.theme.palette[ug.TextSecondary])})),LabelTooltip:Ty})),nE=["defaultValue","disabled","disableSwap","hideTrack","hideAnnotation","value","min","max","onChange","onMouseDown","onMouseUp","step","labelTooltip","annotation","components","componentsProps"];function rE(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function oE(e){for(var t=1;tg[S]&&(O=zO(O)),zO(O)),S=[];if(o&&S.push(E[x]<=0),i&&S.push(E[O]<=0,E[C]<=0),S.every((function(e){return e}))){y=w,v=!1;break}m.set(w,S)}if(v)for(var k=d?3:1;0 svg{path{fill:",";}}color:",";"],r.palette[ug.ButtonDisabledText],r.palette[ug.ButtonDisabledText]))})),MenuPrefix:l.div.attrs({className:zp(Qg,"prefix")}).withConfig({componentId:"sc-rrzye0-5"})((function(){return Zf(["display:flex;"])})),MenuContent:l.div.attrs({className:zp(Qg,"content")}).withConfig({componentId:"sc-rrzye0-6"})((function(){return Zf(["flex-grow:1;line-height:16px;"])})),MenuSuffix:l.div.attrs({className:zp(Qg,"suffix")}).withConfig({componentId:"sc-rrzye0-7"})((function(){return Zf(["display:flex;margin-left:8px;"])})),Label:gm,Icon:Mg,Actions:m})),vk=["list","depth","children","disableHover","noOptionsText","disabled","enableScrollIntoView"];function yk(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function bk(e){switch(e){case zS.Lg:return 18;case zS.Md:return 16;case zS.Sm:return 14;case zS.Xs:return 12;default:return 16}}var wk=Rp((function(e,t){var n=e.list,o=void 0===(o=e.depth)?0:o,i=e.children,l=e.disableHover,s=e.noOptionsText,c=e.disabled,u=e.enableScrollIntoView,d=Du(e,vk),f=a.exports.useRef(null),h=(e=zg(se.useState(null),2))[0],p=e[1],g=(e=zg(se.useState([]),2))[0],m=e[1],v=function(e){p(e.currentTarget)};return a.exports.useEffect((function(){var e;d.active&&u&&null!=(e=f.current)&&e.scrollIntoView({behavior:"auto",block:"nearest"})}),[d.active]),n?se.createElement(se.Fragment,null,function(e){var n=1 .item{margin-right:8px;display:flex;justify-content:center;}"]),ColorItemWrapper:Vy,Select:l.div.attrs({className:zp(BL,"select")}).withConfig({componentId:"sc-qj4xo5-12"})((function(e){return Zf(["width:",";"],"rgb"===e.value?"25%":"35%")})),SelectWrapper:l.div.withConfig({componentId:"sc-qj4xo5-13"})({display:"flex",alignItems:"center",gap:"12px"})})),WL=(nk=Rp((function(e,t){var n=e.value,r=e.onChange,o=e.checked,i=(e=void 0===(e=e.size)?24:e,a.exports.useMemo((function(){return"#ffffff"===n||"rgba(0,0,0,0)"===n?"black":"white"}),[n]));return se.createElement(VL.ColorItemWrapper,{ref:t,color:n,size:e,stroke:"rgba(0,0,0,0)"===n?"#a8a8a8":"#E9EEF2",value:n},se.createElement("input",{type:"radio",value:n,checked:o,onChange:r}),o&&se.createElement(zE,{color:i}))})),nk.defaultProps={},nk.propTypes={value:le.string.isRequired,checked:le.bool,onChange:le.func.isRequired,size:le.number},nk),UL=["defaultColor","onChange","pinnedColors","showTransparentColor","hidePinIcon","containerProps"];function GL(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function ZL(e){for(var t=1;te.clientHeight&&M({paddingRight:c===pk.Md?"4px":"0px"})}),[null==(l=_.current)?void 0:l.scrollHeight,c]),a.exports.useEffect((function(){setTimeout((function(){return A(!1)}),2e3)}),[j]),a.exports.useEffect((function(){z(u)}),[u]),se.createElement(iI.Textarea,{size:c,value:N,onMouseEnter:function(){setTimeout((function(){I(!0)}),150)},onMouseLeave:function(){setTimeout((function(){I(!1)}),200)},readOnly:d,disabled:f,fullWidth:Boolean(s),error:h,autoSize:Boolean(p)||Boolean(g)},se.createElement(iI.Base,Rg({},e,{value:N,ref:t,size:c,onChange:function(e){z(e.target.value),P&&P(e)},readOnly:d,disabled:f,style:function(e){for(var t=1;t input{border:0px;clip:rect(0px,0px,0px,0px);height:100%;margin:-1px;overflow:hidden;padding:0px;position:absolute;white-space:nowrap;width:100%;direction:ltr;}&::before{position:absolute;content:'';border-radius:inherit;width:100%;height:100%;box-shadow:0px 3px 1px -2px rgb(0 0 0 / 20%),0px 2px 2px 0px rgb(0 0 0 / 14%),0px 1px 5px 0px rgb(0 0 0 / 12%);}&::after{position:absolute;content:'';border-radius:50%;width:42px;height:42px;top:50%;left:50%;transform:translate(-50%,-50%);}"],e.theme.palette[ug.LinkActive])})),RotationSliderMark:l.div.attrs({className:zp(Ny,"mark")}).withConfig({componentId:"sc-1xuruq0-5"})(["padding:4px;"]),RotationSliderMarkText:l.span.attrs({className:zp(Ny,"mark-text")}).withConfig({componentId:"sc-1xuruq0-6"})((function(e){return Zf(["position:absolute;top:20px;font-size:14px;transform:translateX(-10%);color:",";"],e.theme.palette[ug.TextPrimary])}))})),qI=["min","max","angle","onChange","onMouseDown","onMouseUp","step","labelTooltipOptions","annotation","hideMarkText","showCurrentMarkText","value","railProps","trackProps","thumbProps","labelTooltipProps","markStyles","markTextStyles"];function $I(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function QI(e){for(var t=1;t *{color:",";}}",""],n?"none":"flex",t[ug.BackgroundActive],t[ug.AccentStateless],e&&Zf(["background-color:",";& > *{color:"," !important;}"],t[ug.BackgroundActive],t[ug.AccentStateless]))})),Qg=l.div.attrs({className:zp(nb,"text")}).withConfig({componentId:"sc-1riasfx-8"})((function(e){var t=(n=e.theme).palette,n=n.typography.font,r=e.font;e=e.isCollapsed;return Zf(["flex:1 1 auto;color:",";",";transition:color 100ms ease-out;display:",";user-select:none;"],t[ug.TextPrimary],n[r||gg.LabelLarge],e&&"none")})),mb=l.div.attrs({className:zp(nb,"icon")}).withConfig({componentId:"sc-1riasfx-9"})((function(e){var t=e.theme.palette;e=e.isCollapsed;return Zf(["display:flex;flex-shrink:0;color:",";margin-right:",";transition:color 100ms ease-out;"],t[ug.IconsPrimary],e?"0px":"12px")})),Mg=l.div.attrs({className:zp(nb,"item-button")}).withConfig({componentId:"sc-1riasfx-10"})((function(e){var t=e.theme.palette,n=e.isCollapsed;e=e.selected;return Zf(["display:flex;justify-content:",";align-items:center;border-radius:4px;box-sizing:border-box;text-align:left;padding:",";width:",";margin-bottom:8px;margin:",";transition:background-color 150ms cubic-bezier(0.4,0,0.2,1) 0ms;cursor:pointer;&:hover{background-color:",";& > *{color:",";}}",""],n?"center":"flex-start",n?"12px 0px":"13px 16px",n&&"56px",n&&"8px auto",t[ug.BackgroundActive],t[ug.AccentStateless],e&&Zf(["background-color:",";& > *{color:",";}"],t[ug.BackgroundActive],t[ug.AccentStateless]))})),o=l(Mg).attrs({className:zp(nb,"item-button")}).withConfig({componentId:"sc-1riasfx-11"})((function(e){return Zf(["",""],!e.isCollapsed&&Zf(["padding:13px 16px;"]))})),Fp({TemporaryDrawer:Ay,PersistentDrawer:Fv,Drawer:lk,Header:m,Body:sm,Footer:Jy,List:km,Item:gm,ItemButton:Mg,Icon:mb,ItemText:Qg,DrawerAccordion:l(qy).attrs({className:zp(nb,"accordion")}).withConfig({componentId:"sc-1riasfx-12"})((function(e){var t=(n=e.theme).palette,n=n.typography.font;e=e.selected;return Zf(["","{padding:13px 16px;transition:background-color 100ms ease-out;","{",";color:",";}&:hover{background-color:",";& > *{color:",";}}","}","{padding:0px 16px;}"],mE.Header,mE.Label,n[gg.LabelLargeEmphasis],t[ug.TextPrimary],t[ug.BackgroundActive],t[ug.AccentStateless],e&&Zf(["","{color:",";}"],mE.Label,t[ug.AccentStateless]),wE.AccordionDetails)})),CollapsedButton:o})),aT=a.exports.createContext({isCollapsed:!1,size:20}),lT=["children","font"],sT=(My=Rp((function(e,t){var n=e.children,r=e.font,o=(e=Du(e,lT),a.exports.useContext(aT).isCollapsed);return se.createElement(iT.ItemText,Rg({font:r,isCollapsed:o},e,{ref:t}),n)})),My.defaultProps={},My.propTypes={font:le.oneOf(Dp(gg))},My),cT=["children","size"],uT=(Ny=Rp((function(e,t){var n=e.children,r=e.size,o=(e=Du(e,cT),(i=a.exports.useContext(aT)).isCollapsed),i=i.size;return se.createElement(iT.Icon,Rg({},e,{isCollapsed:o,ref:t}),n&&"function"==typeof n?n({size:i||r}):n)})),Ny.defaultProps={size:20},Ny.propTypes={size:le.number,children:le.oneOfType([le.node,le.func]).isRequired},Ny),dT={Auto:"auto",Temporary:"temporary",Persistent:"persistent"},fT=["children","open","iconsSize","collapsed","top","hideBackdrop","disablePortal","collapseButtonLabel","persistentDrawerStyles","temproryDrawerStyles","variant","onClose","onCollapse","onCollapseClick"];function hT(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function pT(e){for(var t=1;tu.width||n.height>u.height?gT(u,n):1}})),r()}var n=e.anchorEl,r=e.onClose,o=(e=bC()).dispatch,i=e.t,l=(d=void 0===(d=(void 0===(d=e.adjustments)?{}:d).crop)?{}:d).ratio,s=d.ratioTitleKey,c=d.ratioFolderKey,u=e.shownImageDimensions,d=e.config,f=e.theme,h=d[Ub.CROP];e=sS(),d=a.exports.useMemo((function(){var e=void 0===(e=h.presetsItems)?[]:e,t=void 0===(t=h.presetsFolders)?[]:t,n=h.lockCropAreaAt,r=n?TT.filter((function(e){var t;return!(null!=(t=e.hide)&&t.call(e,{lockCropAreaAt:n}))})):TT;return[].concat(Np(t),Np(r),Np(e))}),[h]);return se.createElement(se.Fragment,null,se.createElement(MT,null,se.createElement(KS,{className:"FIE_crop-tool-label FIE_selected-crop-preset-label",isPhoneScreen:e},i(s||"cropTool")),se.createElement(jT,{className:"FIE_crop-presets-opener-button",color:"link-secondary",size:"lg"},n?se.createElement(yL,{size:10}):se.createElement(mL,{size:10}))),se.createElement(hk,{className:"FIE_crop-presets-menu",anchorEl:n,enableOverlay:!0,onClose:r,open:!!n,position:"top",popperOptions:{modifiers:[{name:"offset",options:{offset:[0,4]}}]},maxHeight:"100%"},se.createElement(zT,null,d.map((function(e){var n=e.titleKey,r=e.descriptionKey,o=e.ratio,a=e.width,s=e.height,u=e.groups,d=e.icon,h=e.disableManualResize;e=e.noEffect;return u?se.createElement(ZT,{key:n,titleKey:n,groups:u,Icon:d,theme:f,onItemSelect:t,t:i,disableManualResize:h}):se.createElement(HT,{key:o,ratio:null!=o?o:bS(a/s),titleKey:n,t:i,description:i(r),Icon:d,isActive:(l||Kb)===(null!=o?o:bS(a/s))&&!c,theme:f,width:a,height:s,onClick:t,disableManualResize:h,noEffect:e})})))))}function YT(e){var t=e.selectTool,n=(e=e.isSelected,(r=bC()).config),r=r.t,o=zg(a.exports.useState(),2),i=o[0],l=o[1];return se.createElement($S,{className:"FIE_crop-tool",id:Ub.CROP,Icon:fP,onClick:function(e,n){t(e),l(n.currentTarget)},isSelected:e},n[Ub.CROP].noPresets?se.createElement(KS,{className:"FIE_crop-tool-label"},r("cropTool")):se.createElement(XT,{anchorEl:i,onClose:function(){l(null)}}))}function KT(e){var t=e.selectTool,n=e.isSelected,r=e.t,o=(e=bC()).dispatch,i=e.adjustments.isFlippedX,l=sS(320),s=(e=a.exports.useMemo((function(){return{reverseLabelOfCurrXFlipDir:r(i?"unFlipX":"flipX"),reverseIconOfCurrXFlipDir:function(){return se.createElement($P,{size:l?20:16,style:i?uM:void 0})}}}),[i])).reverseLabelOfCurrXFlipDir,c=(e=e.reverseIconOfCurrXFlipDir,a.exports.useCallback((function(){o({type:ZA,payload:{direction:"X"}})}),[])),u=a.exports.useCallback((function(e){t(e),c()}),[]);return se.createElement($S,{className:"FIE_flip-x-tool-button",id:Ub.FLIP_X,label:s,Icon:e,onClick:u,isSelected:n})}function qT(e){var t=e.selectTool,n=e.isSelected,r=e.t,o=(e=bC()).dispatch,i=e.adjustments.isFlippedY,l=sS(320),s=(e=a.exports.useMemo((function(){return{reverseLabelOfCurrXFlipDir:r(i?"unFlipY":"flipY"),reverseIconOfCurrXFlipDir:function(){return se.createElement(KP,{size:l?20:16,style:i?dM:void 0})}}}),[i])).reverseLabelOfCurrXFlipDir,c=(e=e.reverseIconOfCurrXFlipDir,a.exports.useCallback((function(){o({type:ZA,payload:{direction:"Y"}})}),[])),u=a.exports.useCallback((function(e){t(e),c()}),[]);return se.createElement($S,{className:"FIE_flip-y-tool-button",id:Ub.FLIP_Y,label:s,Icon:e,onClick:u,isSelected:n})}function $T(e){var t=e.selectTool,n=e.isSelected;e=e.t;return se.createElement($S,{className:"FIE_rotate-tool-button",id:Ub.ROTATE,label:e("rotateTool"),Icon:LP,onClick:t,isSelected:n})}function QT(e){var t=e.selectTool,n=e.isSelected;e=e.t;return se.createElement($S,{className:"FIE_contrast-tool-button",id:Ub.CONTRAST,label:e("contrastTool"),Icon:H_,onClick:t,isSelected:n})}function JT(e){var t=e.selectTool,n=e.isSelected;e=e.t;return se.createElement($S,{className:"FIE_hsv-tool-button",id:Ub.HSV,label:e("hsvTool"),Icon:W_,onClick:t,isSelected:n})}function eM(e){var t=e.selectTool,n=e.isSelected;e=e.t;return se.createElement($S,{className:"FIE_blur-tool-button",id:Ub.BLUR,label:e("blurTool"),Icon:Z_,onClick:t,isSelected:n})}function tM(e){var t=e.selectTool,n=e.isSelected;e=e.t;return se.createElement($S,{className:"FIE_warmth-tool-button",id:Ub.WARMTH,label:e("warmthTool"),Icon:D_,onClick:t,isSelected:n})}function nM(e){function t(e,t){var n=e.findIndex((function(e){return e.classList.contains("FIE_carousel-item")}));-1!==n&&(e[n].scrollIntoView({inline:t,behavior:"smooth",block:"nearest"}),setTimeout((function(){p()}),500))}function n(e){var t;l.current=((null==(t=e.touches)?void 0:t[0])||e).pageX,document.addEventListener("mousemove",g),document.addEventListener("mouseup",m),document.addEventListener("touchmove",g),document.addEventListener("touchcancel",m),document.addEventListener("touchend",m)}var r=e.children,o=e.style,i=e.className,l=a.exports.useRef(!1),s=a.exports.useRef(),c=zg(lS(),1)[0],u=(e=zg(a.exports.useState(!1),2))[0],d=e[1],f=(e=zg(a.exports.useState(!1),2))[0],h=e[1],p=(e=a.exports.Children.toArray(r),function(){var e,t,n;s.current&&(t=(e=s.current).scrollWidth,n=e.offsetWidth,e=e.scrollLeft,t=Math.round(t-n),n=Math.round(t-e),d(0l.factor,o=(n.x-l.x||0)/l.factor,i=(n.y-l.y||0)/l.factor,o={x:n.x-o*n.factor,y:n.y-i*n.factor},a&&1===l.factor||(o.x=Math.min(0,Math.max(o.x,t*(1-l.factor))),o.y=Math.min(0,Math.max(o.y,r*(1-l.factor)))),n.factor<1&&(i=t-t*n.factor,a=r-r*n.factor,o.x+=i/2,o.y+=a/2),eN(eN({},o),{},{factor:n.factor})))).factor===e.zoom.factor&&l.x===e.zoom.x&&l.y===e.zoom.y?e:rN(rN({},e),{},{zoom:rN(rN({},e.zoom),l)})})),lN,(function(e,t){var n,r,o,i,a;return e.canvasWidth===t.canvasWidth&&e.canvasHeight===t.canvasHeight?e:(n=void 0===(n=e.initialCanvasWidth)?t.canvasWidth:n,r=void 0===(r=e.initialCanvasHeight)?t.canvasHeight:r,o=(i=zb(e.initialCanvasWidth,e.initialCanvasHeight,e.originalImage.width,e.originalImage.height))*e.originalImage.width,i*=e.originalImage.height,a=1,n===t.canvasWidth&&r===t.canvasHeight||(o=t.canvasWidth/o,i=t.canvasHeight/i,a=Math.min(o,i)),aN(aN({},e),{},{initialCanvasWidth:n,initialCanvasHeight:r,canvasWidth:t.canvasWidth,canvasHeight:t.canvasHeight,canvasScale:a}))})),hN,(function(e,t){return fN(fN({},e),{},{shownImageDimensions:fN(fN({},e.shownImageDimensions),t.shownImageDimensions),designLayer:t.designLayer||e.designLayer,previewGroup:t.previewGroup||e.previewGroup})})),CN,(function(e,t){return xN(xN({},e),{},{textIdOfEditableContent:t.textIdOfEditableContent||null})})),AN,(function(e,t){return jN(jN({},e),{},{latestColors:jN(jN({},e.latestColors),t.latestColors)})})),DN,(function(e,t){return zN(zN({},e),{},{showTabsMenu:t.opened})})),aw,(function(e,t){return iw(iw({},e),{},{isDesignState:!t.dismissHistory,filter:t.filter||null})})),EA,(function(e,t){return SA(SA({},e),{},{isDesignState:!t.dismissHistory,finetunes:!t.finetune||e.finetunes.includes(t.finetune)?e.finetunes:[].concat(Np(e.finetunes),[t.finetune]),finetunesProps:SA(SA({},e.finetunesProps),t.finetuneProps)})})),_A,(function(e){var t=(i=1n.x+n.width&&(s.width=n.x+n.width-s.x),s.y+s.height>n.y+n.height&&(s.height=n.y+n.height-s.y),"number"==typeof o&&(a=s.width/s.height,i=o,bS(a)!==bS(i))&&(a=s.height*o,i=s.width/o,bS(s.y+i)<=n.y+n.height?s.height=i:s.width=a),(l.minWidth&&s.width<=l.minWidth||l.maxWidth&&s.width>=l.maxWidth)&&(s.width=LC(s.width,l.minWidth,l.maxWidth),s.x=e.x,s.y=e.y,"number"==typeof o)&&(s.height=s.width/o),(l.minHeight&&t.height<=l.minHeight||l.maxHeight&&t.height>=l.maxHeight)&&(s.height=LC(s.height,l.minHeight,l.maxHeight),s.x=e.x,s.y=e.y,"number"==typeof o)&&(s.width=s.height*o),"string"==typeof l.lockCropAreaAt&&(a=n,t=s,e=(i=zg((i=l.lockCropAreaAt).split("-"),2))[0],i=i[1],o={x:0,y:0},"center"===e?o.y=a.height/2-t.height/2:"bottom"===e&&(o.y=a.height-t.height),"center"===i?o.x=a.width/2-t.width/2:"right"===i&&(o.x=a.width-t.width),l=o.y,s.x=o.x,s.y=l),s}function Iz(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function Tz(e){for(var t,n=1;n=v.width&&p.height>=v.height;v.width&&v.height&&(nb&&w&&(e.preventDefault(),C(!0),s({type:TA,payload:{pointerCssIcon:Yb.DRAG}}))}function o(e){"Space"===e.code&&(e.preventDefault(),n())}function i(){l.current&&l.current.container().focus()}e=e.children;var l=(function(e){cb=e}(!0),a.exports.useRef()),s=(v=bC()).dispatch,c=v.pointerCssIcon,u=v.tabId,d=v.toolId,f=v.canvasWidth,h=v.canvasHeight,p=v.canvasScale,g=void 0===(y=v.selectionsIds)?[]:y,m=void 0===(y=v.zoom)?{}:y,v=(y=v.config).previewPixelRatio,y=y.disableZooming,b=(eb.pixelRatio=v,1),w=!y&&d!==Ub.CROP,x=(v=zg(a.exports.useState(u!==Wb.ANNOTATE&&u!==Wb.WATERMARK&&m.factor>b),2))[0],C=v[1];y=a.exports.useMemo((function(){return{cursor:c===Yb.DEFAULT&&u===Wb.ANNOTATE?Yb.DRAW:c}}),[u,c]),d=a.exports.useCallback((function(e){var t,n;e.evt.preventDefault(),null!=(t=(n=e.currentTarget).container)&&t.call(n).focus(),e.target instanceof eb.Stage&&0b),l.current&&((e=l.current.container()).addEventListener("mouseenter",i),e.addEventListener("keydown",r),e.addEventListener("keyup",o)),function(){e&&(e.removeEventListener("mouseenter",i),e.removeEventListener("keydown",r),e.removeEventListener("keyup",o))}}),[u,m.factor,b]),v=p*(w&&m.factor||b);return se.createElement(Xz,{className:"FIE_canvas-node",tabIndex:-1,ref:l,width:f,height:h,scaleX:v,scaleY:v,x:w&&m.x||null,y:w&&m.y||null,zoomFactor:w&&m.factor||b,onWheel:w?function(e){e.evt.preventDefault();var n=(m.factor||b)+-.006*e.evt.deltaY;t(Kz(Kz({},e=e.currentTarget.getPointerPosition()),{},{factor:n}))}:void 0,onTap:d,onClick:d,onTouchMove:w?function(e){return function(e,t){e.evt.preventDefault();var n,r,o,i,a,l,s=e.evt.touches[0],c=e.evt.touches[1];s&&c&&((e=e.currentTarget).isDragging()&&e.stopDrag(),s={x:s.clientX,y:s.clientY},c={x:c.clientX,y:c.clientY},Wz?(n=Vz(s,c),a=s,l=c,l=Math.sqrt(Math.pow(l.x-a.x,2)+Math.pow(l.y-a.y,2)),Uz=Uz||l,a=e.attrs.zoomFactor||1,i=(n.x-e.x())/a,e=(n.y-e.y())/a,a=(a||1)*(l/Uz),r=n.x-Wz.x,o=n.y-Wz.y,i={x:n.x-i*a+r,y:n.y-e*a+o},Uz=l,Wz=n,t(Bz(Bz({},i),{},{factor:a,preparedDimensions:!0}))):Wz=Vz(s,c))}(e,t)}:void 0,onDragStart:function(e){1<(null==(e=e.evt.touches)?void 0:e.length)&&C(!1)},onTouchEnd:w?function(){var e;Uz=0,Wz=null,"function"==typeof(e=n)&&e()}:void 0,dragBoundFunc:function(e){return{x:Math.min(0,Math.max(e.x,f*(1-m.factor))),y:Math.min(0,Math.max(e.y,h*(1-m.factor)))}},draggable:w&&x,onDragEnd:function(e){e.currentTarget.draggable()&&"stage"===e.target.nodeType.toLowerCase()&&w&&x&&t({factor:m.factor,x:e.target.x(),y:e.target.y(),preparedDimensions:!0})},style:y},e)})),Jz=l.div.withConfig({componentId:"sc-etsyb6-0"})(["display:inline-block;height:",";width:",";border-radius:1px;background:",";"],(function(e){return e.height}),(function(e){return e.width}),(function(e){return e.theme.palette[ug.BordersSecondary]})),eR=function(e){var t=e.height;e=e.width;return se.createElement(Jz,{height:t,width:e})},tR=(eR.defaultProps={height:"24px",width:"1px"},l.div.withConfig({componentId:"sc-21g986-0"})(["padding:16px;box-sizing:border-box;position:relative;width:100%;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;border-bottom:1px solid ",";[data-phone='true'] &{padding:6px 6px 4px 6px;","}"],(function(e){return e.theme.palette[ug.BordersSecondary]}),(function(e){return e.isPhoneScreen&&"\n padding: 12px 12px 0px;\n gap: 12px;\n "}))),nR=l.div.withConfig({componentId:"sc-21g986-1"})(["display:flex;align-items:center;order:1;"]),rR=l.div.withConfig({componentId:"sc-21g986-2"})(["display:flex;align-items:center;order:3;gap:4px;"]),oR=l(nI).withConfig({componentId:"sc-21g986-3"})(["margin:",";svg{color:",";}"],(function(e){return null!=(e=e.margin)?e:"0 4px"}),(function(e){var t=e.theme.palette;return e.disabled?t[ug.IconsMuted]:t[ug.IconsPrimary]})),iR=l.div.withConfig({componentId:"sc-21g986-4"})(["display:flex;align-items:center;gap:2px;"]),aR=l(GS).withConfig({componentId:"sc-21g986-5"})(["flex-shrink:0;color:",";",";"],(function(e){return e.theme.palette[ug.TextPlaceholder]}),(function(e){return e.theme.typography.font[gg.LabelMedium]})),lR=l(nI).withConfig({componentId:"sc-21g986-6"})(["padding:8px;svg{color:",";}"],(function(e){var t=e.theme.palette;return e.showBackButton?t[ug.IconsPrimary]:t[ug.IconsMuted]})),sR=l.div.withConfig({componentId:"sc-21g986-7"})(["width:",";height:32px;display:block;width:100%;order:4;",";@media (min-width:761px){display:flex;align-items:center;justify-content:center;width:fit-content;order:2;}"],(function(e){return e.showBackButton?"318px":"384px"}),(function(e){return e.reverseDirection?"flex-direction: row-reverse":""})),cR=l(GS).withConfig({componentId:"sc-21g986-8"})(["cursor:pointer;color:",";",";"],(function(e){return e.theme.palette[ug.TextPrimary]}),(function(e){return e.theme.typography.font[gg.InputMd]})),uR=l.span.withConfig({componentId:"sc-21g986-9"})(["",";"],(function(e){return e.theme.typography.font[gg.ButtonMdEmphasis]})),dR=l(TL).withConfig({componentId:"sc-21g986-10"})(["padding:8px;z-index:111;"]),fR=(l(tP).withConfig({componentId:"sc-21g986-11"})(["padding:4px 12px;"]),l(py).withConfig({componentId:"sc-21g986-12"})([""])),hR=l(Vy).withConfig({componentId:"sc-21g986-13"})(["margin-top:16px;"]),pR=l.div.withConfig({componentId:"sc-21g986-14"})(["width:100%;margin-top:16px;"]),gR=l.div.withConfig({componentId:"sc-21g986-15"})(["margin-top:16px;width:100%;"]),mR=l(GS).withConfig({componentId:"sc-21g986-16"})(["margin-bottom:4px;"]),vR=l.div.withConfig({componentId:"sc-21g986-17"})(["display:flex;gap:6px;"]),yR=l.div.withConfig({componentId:"sc-21g986-18"})(["display:flex;gap:12px;justify-content:",";"],(function(e){return e.isPhoneScreen?"space-between":"center"})),bR=l(nI).withConfig({componentId:"sc-21g986-19"})(["@media (min-width:761px){display:none;}"]),wR=l.div.withConfig({componentId:"sc-21g986-20"})(["display:flex;gap:12px;align-items:center;"]),xR=l(Ry).withConfig({componentId:"sc-kpjpf5-0"})(["width:",";max-width:unset;"],(function(e){return e.width||"300px"})),CR=l(LI).withConfig({componentId:"sc-kpjpf5-1"})((function(e){var t=e.theme;return Zf(["padding-bottom:0;.SfxModalTitle-Icon{background-color:",";}.SfxModalTitle-LabelPrimary{margin-bottom:24px;",";}.SfxModalTitle-LabelSecondary{",";text-align:center;}"],e.isWarning&&t.palette[ug.Orange_0_1_Overlay],t.typography.font[gg.TitleH3],t.typography.font[gg.TextLarge])})),SR=l(Ty).withConfig({componentId:"sc-kpjpf5-2"})(["gap:12px;padding:24px;.SfxButton-root{flex:1;margin:0;height:40px;}"]),ER=function(e){var t=e.title,n=e.hint,r=e.Icon,o=e.onDone,i=e.onCancel,a=e.doneLabel,l=e.cancelLabel,s=e.isOpened,c=e.doneButtonStyle,u=void 0===(u=e.doneButtonColor)?"basic":u,d=void 0===(d=e.cancelButtonColor)?"basic":d,f=e.children,h=e.areButtonsDisabled,p=e.zIndex,g=e.className,m=e.width;e=e.isWarning;return se.createElement(xR,{className:g,open:s,onClose:i,style:{zIndex:p},onKeyUp:function(e){"Enter"===e.key&&o(e)},width:m},se.createElement(CR,{icon:se.createElement(r,{size:25}),iconShadow:!0,isWarning:e,onClose:i,primary:t,secondary:n,variant:"with-icon"}),f&&se.createElement(OI,null,f),se.createElement(SR,{align:"center"},se.createElement(tP,{color:d,onClick:i,size:"md",disabled:h},l),se.createElement(tP,{color:u,onClick:o,size:"md",warning:e,style:c,disabled:h},a)))},OR=(ER.defaultProps={hint:"",isOpened:!1,doneLabel:"Yes",cancelLabel:"No",doneButtonStyle:void 0,doneButtonColor:"basic",cancelButtonColor:"basic",children:void 0,areButtonsDisabled:!1,zIndex:void 0,className:void 0,width:"",isWarning:!1},function(e){var t,n,r=e.children,o=e.isReset,i=(e=bC()).t,l=e.theme,s=e.config,c=e.dispatch,u=e.isResetted,d=e.haveNotSavedChanges,f=e.config.onClose,h=(e=zg(a.exports.useState(!1),2))[0],p=e[1];return"function"==typeof f||o?(t=function(){p(!1)},n=a.exports.useCallback((function(){c({type:Xx,payload:{config:s}}),t()}),[s]),e=function(){o||(f(Jb,d),n())},se.createElement(se.Fragment,null,se.cloneElement(r,{onClick:void 0===u||u?e:function(){p(!0)}}),h&&se.createElement(ER,{title:i(o?"warning":"discardChanges"),hint:i(o?"changesLoseWarningHint":"discardChangesWarningHint"),isOpened:h,onCancel:t,onDone:o?n:e,Icon:function(){return se.createElement(VP,{color:l.palette.warning,size:25})},doneLabel:i("confirm"),doneButtonColor:"warning-primary",cancelLabel:i("cancel"),width:"400px",isWarning:!0}))):se.createElement("span",null)}),kR=(OR.defaultProps={isReset:!1},function(e){return e<=0||1 svg:not([color]){color:",'}:disabled,[aria-disabled="true"]{cursor:not-allowed;}&::-webkit-scrollbar{width:4px;height:4px;}&::-webkit-scrollbar-track{background:rgba(203,211,218,0.35);}&::-webkit-scrollbar-thumb{background:rgba(203,211,218,1);border-radius:10px;}}'],Rb,Rb,(function(e){return e.theme.palette["icons-primary"]})),bD=(gD.defaultProps={useCloudimage:!1,cloudimage:{}},a.exports.memo(gD));function wD(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)),r}function xD(e){for(var t,n=1;n