function MillimetersToPixels(n){var t=PixelsPerMm();return n*t}function MillimetersFromPixels(n){var t=PixelsPerMm();return n/t}function PixelsPerMm(){var t=96,n=document.createElement("div"),i;return n.style.position="absolute",n.style.display="hidden",n.style.width=t+"mm",n.style.height=t+"mm",document.body.appendChild(n),i=n.clientWidth/t,document.body.removeChild(n),PixelsPerMm=function(){return i},PixelsPerMm()}function StandardizeEventMousePos(n){n.pageX==null&&n.clientX!=null&&(eventDoc=n.target&&n.target.ownerDocument||document,doc=eventDoc.documentElement,body=eventDoc.body,n.pageX=n.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0),n.pageY=n.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0))}function IsNameQuirk(){var t=document.createElement("div"),n=document.createElement("input"),i;return n.type="hidden",n.name="testName",t.appendChild(n),i=t.innerHTML.indexOf("test")==-1,IsNameQuirk=function(){return i},IsNameQuirk()}function hasOwnProperty(n,t){var i=n.__proto__||n.constructor.prototype;return t in n&&(!(t in i)||i[t]!==n[t])}function CKEditorHelper(n,t){this.DomElement=n;this.BrixElement=t;this.Allow={Source:!0,Links:!0,Formats:!0,Fonts:!0,FontSize:!0,TextColor:!0,Justification:!0,Indention:!0,Lists:!0,Bold:!0,Italic:!0,Underline:!0,Strike:!0,Images:!0,Tables:!0,BrixVariables:!0,NoClasses:!0,OnlyText:!0,BackgroundColor:!0,CopyFormatting:!0}}function SetupCKEditorContents(n){var t=n.document.getElementsByTag("span"),r=t.count(),i,u,f;for(t=n.document.find("*"),r=t.count(),i=0;i<r;i++)u=t.getItem(i),f=u.$.tagName}function CKEditorMenuInjection(n){this.Editor=n;this.IconPath=this.path+"images/icon.png"}function CheckEmailFieldInput(n,t){var r=$("#"+n),i=$("#"+n+"hint");r.on("blur",function(){i.css("display","none");$(this).mailcheck({suggested:function(n,r){var r=t+" <span class='suggestion'><span class='address'>"+r.address+"<\/span>@<a href='#' class='domain'>"+r.domain+"<\/a><\/span>?";i.html(r).fadeIn(150)},empty:function(){i.html()}})});i.on("click",".domain",function(){return r.val($(".suggestion").text()),i.fadeOut(200,function(){$(this).empty()}),!1})}function ThrowException(n,t,i){var r=i?". \n"+i:"";throw new Error(n+r+"");}function Size(n,t,i){this.Fill=-1;this.Width=n||0;this.Height=t||0;this.Unit=i}function OnPopState(){for(var n=0;n<BRIX.OnNavigate.length;n++)BRIX.OnNavigate[n]()}function LoadJsFile(n){var i="["+n+"]",t;BRIX.LoadedJs.indexOf(i)===-1&&(BRIX.LoadedJs+=i,t=document.createElement("script"),t.setAttribute("type","text/javascript"),t.setAttribute("src",n),document.getElementsByTagName("head")[0].appendChild(t))}function DecodeHtml(n){var t=document.createElement("div");return t.innerHTML=n,t.textContent||t.innerText||""}function GetNewId(){return _idTrail++,_idTrail===1248&&(_idTrail=_idTrail),"e"+_idTrail}function GetRootUrl(){return BRIX.DomainName}function GetHttpsRootUrl(){return BRIX.HttpsDomainName}function FindTopWindow(){return BRIX.WindowStack.length===0?null:BRIX.WindowStack[BRIX.WindowStack.length-1]}function GetVisibleTextColor(n,t){var i=t.toLowerCase();if(window.getComputedStyle){var r=function(n){var i=window.getComputedStyle(n),t=i.getPropertyValue("background-color");return t==="transparent"&&n.parentNode&&(t=r(n.parentNode)),t},u=r(n),f=function(n){return n==="#ffffff"||n==="#fff"||n==="white"||n==="rgb(255, 255, 255)"},e=function(n){return n==="#000000"||n==="#000"||n==="black"||n==="rgb(0, 0, 0)"};f(i)&&f(u)?i="#000000":e(i)&&e(u)&&(i="#ffffff")}return i}function AddCssClass(n,t){if(n.className){var i=n.className.split(" ");i.indexOf(t)===-1&&(i.push(t),n.className=i.join(" "))}else n.className=t}function RemoveCssClass(n,t){var i=n.className.split(" "),r=i.indexOf(t);r!==-1&&(i.splice(r,1),n.className=i.join(" "))}function IsDefined(n){return n!==null&&typeof n!="undefined"&&n!==""}function IsFunction(n){return n!==null&&typeof n=="function"}function FullTrim(n){return n.trim().replace(/(\r\n|\n|\r)/gm,"")}function CreateLoadingIcon(){var i=16,r=11,n=document.createElement("div"),t;return n.style.position="absolute",n.style.width=i+"px",n.style.height=r+"px",n.style.top="50%",n.style.left="50%",t=CreateImage(GraphicsBasePath+"loading.gif"),t.style.position="absolute",t.style.height=r+"px",t.style.width=i+"px",t.style.left=i/-2+"px",t.style.top=r/-2+"px",n.appendChild(t),n}function GetInnerText(n){return n.textContent!==null?n.textContent:n.innerText}function GetIFrameXml(n){var i=n.body.innerHTML,t=null,r;if(window.DOMParser?(r=new DOMParser,t=r.parseFromString(i,"text/xml")):(t=new ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(i)),t&&t.nodeType===9&&t.firstChild)for(t=t.firstChild;t.nodeType!==1;)if(t=n.nextSibling,t===null)break;return t}function SetInnerText(n,t){n.textContent!==null?n.textContent=t:n.innerText=t}function FindElementByName(){}function ClickEventBubbling(){this.IsBubbling=!1;this.TopElement=null;this.Reset=function(){this.IsBubbling=!1;this.TopElement=null};this.Bubble=function(n){this.IsBubbling||(this.TopElement=n,this.IsBubbling=!0)}}function InstallClickEventBubbling(){document.body.ClickEventBubble=new ClickEventBubbling;document.body.onclick=function(){document.body.ClickEventBubble.Reset()}}function SetFloatStyle(n,t){n.style.styleFloat!==null?n.style.styleFloat=t:n.style.cssFloat!==null&&(n.style.cssFloat=t)}function DecimalToHex(n,t){var i=n.toString(16);if(t)if(i.length<t)i=("000000"+i).slice(i.length+6-t);else if(i.length>t)throw new Error("Overflow");return i}function HexToDecimal(n){return parseInt(n,16)}function SetOpacity(n,t){var i=n.style.visibility;t===0&&i!=="hidden"?n.style.visibility="hidden":t>0&&i==="hidden"&&(n.style.visibility="");n.style.opacity=t/10;n.style.filter="alpha(opacity="+t*10+")"}function SetTransparency(n,t){var i=10;t>0&&(i=10-t/10);SetOpacity(n,i)}function EventInfo(n){this.event=window.event?window.event:n;this.event||(this.event=window.top.event);this.Target=this.event.srcElement?this.event.srcElement:this.event.target;this.event.x&&!this.event.clientX&&(this.event.clientX=this.event.x,this.event.clientY=this.event.y);this.Top=this.event.clientY;this.Left=this.event.clientX;this.Event=this.event}function LayerPosition(n){var t=n.getBoundingClientRect();this.Left=t.left;this.Top=t.top}function LayerAbsoluteScreenPosition(n){var s,r=0,u=0,f=0,e=0,i=LayerAbsoluteScreenPosition.offsetBase,t,o;return!i&&document.body&&(i=LayerAbsoluteScreenPosition.offsetBase=document.createElement("div"),i.style.cssText="position:absolute;left:0;top:0",document.body.appendChild(i)),n&&n.ownerDocument===document&&"getBoundingClientRect"in n&&i&&(t=n.getBoundingClientRect(),o=i.getBoundingClientRect(),s=!0,r=t.left-o.left,u=t.top-o.top,f=t.right-t.left,e=t.bottom-t.top),{Found:s,Left:r,Top:u,Width:f,Height:e,Right:r+f,Bottom:u+e}}function LayerScreenPosition(n){var t=n.getBoundingClientRect();return{Left:t.left,Top:t.top}}function LayerSize(n){if(!n)throw new Error("Missing parameter");var t=n===document.body?document:n;this.Width=$(t).outerWidth();this.Height=$(t).outerHeight()}function LayerScrollSize(n){var r=GetStyle(n,"overflow"),t,i;return n.style.overflow="scroll",t=n.scrollWidth?n.scrollWidth:n.offsetWidth?n.offsetWidth:n.clientWidth,i=n.scrollHeight?n.scrollHeight:n.offsetHeight?n.offsetHeight:n.clientHeight,n.style.overflow=r,{Width:t,Height:i}}function LayerCoordinates(n){var i=LayerScrollSize(n),t;this.Height=i.Height;this.Width=i.Width;t=LayerAbsoluteScreenPosition(n);this.Left=t.Left;this.Top=t.Top;this.Right=t.Left+this.Width;this.Bottom=t.Top+this.Height}function GetStyle(n,t){var i;return n.currentStyle?i=n.currentStyle[t]:window.getComputedStyle&&(i=document.defaultView.getComputedStyle(n,null).getPropertyValue(t)),i}function CreateIframe(n){var t=null,i=n?n:"";return IsNameQuirk()?t=document.createElement('<iframe name="'+i+'">'):(t=document.createElement("iframe"),t.name=i),t}function GetCDataValue(n,t){var i=t?n.selectSingleNode(t):n;return IsDefined(i)?i.firstChild.nodeValue:""}function GetTranslation(n,t){return this.GetCDataValue(n,t+"/translation")}function CreateDimmerElement(){var n=document.createElement("div");return n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.height="100%",n.style.width="100%",n.style.zIndex=1,n.style.background="transparent url("+GraphicsBasePath+"transparent.png)",n}function FindParentWindow(n){for(var t=n.Parent;t;){if(t.IsWindow===!0)break;t=t.Parent}return t}function GetSuitableParentForProgressBar(n){for(var i=null,t=n.Parent;t;){if(t.ShowLoadingInProgress&&t.HideLoadingInProgress){i=t;break}t=t.Parent}return i}function RemoveSelection(){var n,t;window.getSelection?(n=window.getSelection(),n.removeAllRanges()):document.selection.createRange&&(t=document.selection.createRange(),document.selection.empty())}function MakeUnselectable(n){n.onselectstart=function(){return!1}}function GetNextAmountValue(n,t){var i;return n<20?i=n+1:n<100?(i=n+5,i>t&&(i=t)):n<200?(i=n+10,i>t&&(i=t)):(i=n+50,i>t&&(i=t)),i}function getElementAbsolutePos(n){var t={},i,r,u;if(t.x=0,t.y=0,n!==null)if(n.getBoundingClientRect){var f=document.documentElement,e=n.getBoundingClientRect(),o=f.scrollLeft,s=f.scrollTop;t.x=e.left+o;t.y=e.top+s}else for(t.x=n.offsetLeft,t.y=n.offsetTop,i=n.parentNode,r=null;offsetParent!==null;){if(t.x+=offsetParent.offsetLeft,t.y+=offsetParent.offsetTop,u=offsetParent.tagName.toLowerCase(),(__isIEOld&&u!=="table"||(__isFireFoxNew||__isChrome)&&u==="td")&&(r=kGetBorderWidth(offsetParent),t.x+=r.left,t.y+=r.top),offsetParent!==document.body&&offsetParent!==document.documentElement&&(t.x-=offsetParent.scrollLeft,t.y-=offsetParent.scrollTop),!__isIE&&!__isOperaOld||__isIENew)while(offsetParent!==i&&i!==null)t.x-=i.scrollLeft,t.y-=i.scrollTop,(__isFireFoxOld||__isWebKit)&&(r=kGetBorderWidth(i),t.x+=r.left,t.y+=r.top),i=i.parentNode;i=offsetParent.parentNode;offsetParent=offsetParent.offsetParent}return t}function GetScrollBarSize(){var n=document.createElement("div"),t;return n.style.position="absolute",n.style.top="-9999px",n.style.width="100px",n.style.height="100px",n.style.overflow="scroll",document.body.appendChild(n),t=n.offsetWidth-n.clientWidth,document.body.removeChild(n),GetScrollBarSize=function(){return t},GetScrollBarSize()}function CreateClickableIcon(n,t,i,r,u){var f=n.Create();return AddCssClass(f,"ClickableIcon"),f.EventTracker=new EventTracking(null,f),f.EventTracker.AddCallback("click",t,i,!0,r,u),f}function AktiveraTalandeWebb(){window._baTheme=0;window._baMode="Aktivera Talande Webb";window._baUseCookies=!0;window._baHideOnLoad=!0;var n=document.createElement("script");n.src="//www.browsealoud.com/plus/scripts/ba.js";document.body.appendChild(n)}function RemoveAllChildrenClasses(n){if(n.classList=[],n.children!==null&&n.children!==undefined)for(var t=0;t<n.children.length;t++)RemoveAllChildrenClasses(n.children[t])}function FontIcon(n){this.Name=n}function FakeXml(n){this.childNodes=[];this.Attributes={};this.nodeName=n;this.childNodes=[];this.selectSingleNode=function(){return null};this.selectNodes=function(){var n={};return n.length=0,n};this.getElementsByTagName=function(){return this.childNodes};this.setAttribute=function(n,t){this.Attributes[n]=t};this.getAttribute=function(n){return this.Attributes[n]}}function RequestEntry(n,t){this.Http=n;this.Key=t;this.ReturnObject=null;this.ReturnMethodName="";this.FailureObject=null;this.FailureMethodName="";this.MacroCallbackKey=null;this.SetReturnMethod=function(n,t){this.ReturnObject=n;this.ReturnMethodName=t};this.HaveReturnMethod=function(){return this.ReturnObject};this.SetMacroCallback=function(n){this.MacroCallbackKey=n};this.MacroCallback=function(n){return this.MacroCallbackKey&&window.CurrentMacroCallbackIndex.MacroResponse(this.MacroCallbackKey,n),this.MacroCallbackKey};this.CallReturnMethod=function(){this.ReturnObject[this.ReturnMethodName](n.responseXML)};this.SetFailureMethod=function(n,t){this.FailureObject=n;this.FailureMethodName=t};this.HaveFailureMethod=function(){return this.FailureObject};this.CallFailureMethod=function(){this.FailureObject[this.FailureMethodName](n.responseXML)}}function RequestIndex(){this.Index=new Hashtable;this.Trail=0;this.GetRequest=function(n){return this.Index.get(n)};this.AddRequest=function(n){var t="key"+Math.random()+"-"+this.Trail,i=new RequestEntry(n,t);return n.Key=t,this.Index.put(t,i),this.Trail++,t};this.AbortAll=function(){var n=this;this.Index.each(function(t){n.AbortRequest(t)})};this.ClearRequest=function(n){this.Index.remove(n)};this.AbortRequest=function(n){try{var t=this.Index.get(n);t&&(t.http.abort(),t.http=null,t=null,this.ClearRequest(n))}catch(i){}};this.KeyExist=function(n){return this.Index.containsKey(n)}}function getUniqueString(){return Math.random()}function DefaultAjaxResponse(n){if(!n)throw new Error("Invalid response");var t=new XmlError(n);if(t.isError()){alert(t.errorDescription());return}}function MakeHttpRequest(n,t,i,r,u){var c=t?t:DefaultAjaxResponse,f,e,l;if(window.onbeforeunload||(window.onbeforeunload=function(){requestIndex.AbortAll()}),f=getXmlHttp(),e=requestIndex.AddRequest(f),!f)return alert("Unfortunately your browser doesn't support this feature."),!1;f.onreadystatechange=function(){var n;return f.readyState!==4?!1:f.status!=200?(n=requestIndex.GetRequest(f.Key),n.HaveFailureMethod()?n.CallFailureMethod():u&&u(f.status),requestIndex.ClearRequest(e),!1):(n=requestIndex.GetRequest(f.Key),n.MacroCallback(f.responseXML)||(n.HaveReturnMethod()?n.CallReturnMethod():c(f.responseXML)),requestIndex.ClearRequest(e),c=null,!0)};var s=n,o=null,h=n.indexOf("?");h>-1?(s=n.slice(0,h)+"?unique="+Math.random(),o=n.slice(h+1)):s+="?unique="+Math.random();l="POST";f.open(l,s,!0);try{f.responseType="msxml-document"}catch(a){}return requestIndex.KeyExist(e)&&(o!=null&&(f.setRequestHeader("Content-type","application/x-www-form-urlencoded"),f.setRequestHeader("Content-length",o.length),f.setRequestHeader("Cache-control","no-cache"),f.setRequestHeader("Connection","close")),f.send(o)),e}function GetXmlRootNode(n){var t,i,r;if(!n)return null;if(t=null,n.nodeType==9){for(i=0;i<n.childNodes.length;i++)if(r=n.childNodes[i],r.tagName){t=r;break}}else t=n;return t}function XmlError(n){this.xmlDoc=n;this.errorNode=n.nodeName=="error"?n:n.getElementsByTagName("error")[0]}function getXmlHttp(){var n=null,t=["MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];if(window.XMLHttpRequest)n=new XMLHttpRequest,n.overrideMimeType&&n.overrideMimeType("text/xml");else if(window.ActiveXObject)for(i=0;i<t.length;i++)try{n=new ActiveXObject(t[i])}catch(r){}return n}function CreateXmlParser(n){var t;return window.DOMParser?(parser=new DOMParser,t=parser.parseFromString(n,"text/xml")):(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(n)),t.childNodes.length?t.childNodes[t.childNodes.length-1]:null}function PreloadImage(n){var t=new Image;t.src=n}function CreateBoxedImage(n,t,i){var r=document.createElement("span"),u;return r.style.position="relative",r.style.display="inline-block",r.style.verticalAlign="middle",r.style.width=t+"px",r.style.height=i+"px",r.Width=t,r.Height=i,u=CreateImage(n),u.style.position="absolute",u.style.align="absmiddle",u.align="absmiddle",u.style.top="0px",u.style.left="0px",u.style.width=t+"px",u.style.height=i+"px",r.Image=u,r.appendChild(u),r}function CreateImage(n,t){return CreatePng(n,t)}function CreatePng(n,t){var r=t?t:window,i=null,u,e,f;return!n||n.toLowerCase().indexOf(".png")==-1?(i=r.document.createElement("img"),i.src=n,i):(u=!1,document.all&&(e=navigator.appVersion.split("MSIE"),f=parseFloat(e[1]),u=f<7&&f>=5.5&&tdoc.body.filters),u?(i=r.document.createElement("span"),i.style.fontSize="1px",i.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n+"',  sizingMethod='scale')"):(i=r.document.createElement("img"),i.src=n),i)}function WrapImage(n){var t=document.createElement("div");return n.style.width="100%",n.style.height="100%",t.appendChild(n),t}function CreateGlowLayer(){var t=GraphicsBasePath+"button_effect2.png",n=CreateImage(t);return n.style.position="absolute",n.style.height="100%",n.style.width="100%",n.style.left="0px",n.style.top="0px",SetOpacity(n,2),n}function CreateCheckInputSetResponsive(n,t,i,r,u,f,e){var c=t+"_"+i,o=CreateInput(t,f),s,h;return o.type=n,o.name=t,o.id=c,o.value=r,o.checked=f,e&&(o.disabled=!0),s=document.createElement("label"),s.appendChild(o),s.setAttribute("for",c),u&&s.appendChild(document.createTextNode(u)),h=document.createElement("div"),AddCssClass(h,n),h.appendChild(s),{Container:h,Input:o}}function CreateCheckInputSet3(n,t,i,r,u,f,e,o,s){var y=i+"_"+r,h=CreateInput(i,s),c,a,l,v;return h.type=t,h.name=i,h.id=y,h.value=e,h.checked=s,c=document.createElement("label"),c.setAttribute("for",y),a=document.createElement("span"),a.appendChild(document.createTextNode(o)),c.appendChild(a),u!=null&&u!=0&&(r+1)%u==0&&r+1<f&&(c.style.paddingRight=0),l=document.createElement("span"),l.style.whiteSpace="nowrap",l.appendChild(h),l.appendChild(c),n.appendChild(l),u!=null&&u!=0&&(r+1)%u==0&&r+1<f&&(v=document.createElement("div"),v.style.display="block",n.appendChild(v)),n.appendChild(document.createTextNode(" ")),h}function SetupNumericInput(n,t,i,r,u,f){var o=function(n){var t=n,i=t%r,u;return i!=0&&(u=Math.round(i*1e4)/1e4,t-=u,t!=0&&(t=Math.round(t*1e3)/1e3)),t},l=/[^\d.-]/g,s,h;n.type="number";s=new String(o(Math.abs(Math.round(i))+.511111111111));n.size=s.length+1;h=function(n){return n.replace(l,"")};n.GetNumericValue=function(){var i=new Number(h(n.value)).valueOf();return isNaN(i)&&(i=t),i.valueOf()};n.GetValidNumericValue=function(){var r=n.GetNumericValue();return r=o(r),r<t?r=t:r>i&&(r=i),r};n.IsValid=function(){return!isNaN(new Number(n.value).valueOf())&&n.GetNumericValue()==n.GetValidNumericValue()};AddCssClass(n,"Numeric");var c=function(){return n.IsValid()?(RemoveCssClass(n,"Invalid"),!0):(AddCssClass(n,"Invalid"),!1)},e=0,a=function(){e&&(window.clearTimeout(e),e=0);u?u(n)&&f&&f(n.value):c()?(n.value=n.GetValidNumericValue(),RemoveCssClass(n,"Invalid"),f&&f(n.value)):(n.value=n.GetValidNumericValue(),e=window.setTimeout(function(){RemoveCssClass(n,"Invalid")},2e3))},v=function(){c()};n.onchange=a;n.onkeyup=v;n.onfocus=function(){n.select()}}function CreateInput(n,t){var i=null,r=n?n:"",u;return IsNameQuirk()?(u=t?" checked ":"",i=document.createElement('<input name="'+r+'"'+u+">")):(i=document.createElement("input"),i.name=r,i.checked=t),i.setAttribute("maxlength","255"),i}function CreateCheckInputSet2(n,t,i,r,u,f,e){var l=i+"_"+r,o=CreateInput(i,e),h,c,s;return o.type=t,o.name=i,o.id=l,o.value=u,o.checked=e,h=document.createElement("label"),h.setAttribute("for",l),c=document.createElement("span"),c.appendChild(document.createTextNode(f)),h.appendChild(c),s=document.createElement("span"),s.style.whiteSpace="nowrap",s.appendChild(o),s.appendChild(h),n.appendChild(s),n.appendChild(document.createTextNode(" ")),o}function CreateCheckInputSet(n,t,i,r,u){var o=document.createElement("div"),f,e;return AddCssClass(o,"InputWrapper"),f=CreateInput(t,u),f.type=n,f.id=t,f.value=i,o.appendChild(f),f.checked=u,e=document.createElement("label"),e.className="TextElement_Caption",e.setAttribute("for",t),e.appendChild(document.createTextNode(r)),o.appendChild(e),o}function Language(n){this.Code=n?n.getAttribute("code"):"";this.Name=n?n.firstChild.nodeValue:""}function Languages(n){var i,t,r;for(this.Items={},i=n.selectNodes("Language"),t=0;t<i.length;t++)r=new Language(i[t]),this.Items[r.Code]=r}function QueryParameters(){this.Parameters=new Hashtable;this.ContainsKey=function(n){return this.Parameters.containsKey(n)};this.AddParameters=function(n){IsDefined(n)&&this.Parameters.putAll(n)};this.Remove=function(n){this.Parameters.containsKey(n)&&this.Parameters.remove(n)};this.Update=function(n,t){this.Parameters.containsKey(n)&&this.Parameters.remove(n);this.Add(n,t)};this.Add=function(n,t){var i,u,r;if(t==""||IsDefined(t))if(this.Parameters.containsKey(n)){for(i=this.Parameters.get(n).split(","),u=!1,r=0;r<i.length;r++)if(i[r]==t){u=!0;break}u||this.Parameters.put(n,i+","+t)}else this.Parameters.put(n,t)};this.GetDictionary=function(){var n={};return this.Parameters.each(function(t,i){n[t]=i}),n};this.GetQuery=function(){var n="";return this.Parameters.each(function(t,i){var r=(n.length>0?"&":"")+t;n+=r+"="+i}),n}}function TestFunction(){alert("Test function triggered")}function SetFocus(n,t){for(var r=t.getElementsByTagName("td"),i=0;i<r.length;i++)r[i].style.backgroundColor="#336699"}function ReleaseFocus(n,t){for(var r=t.getElementsByTagName("td"),i=0;i<r.length;i++)r[i].style.backgroundColor="transparent"}function ReloadSection(n){var i=ElementIndex.Get(n),t;return i?(t=FindHavenSection(i),!t)?!1:(t.LoadUrl(),!0):!1}function GetParentWindowOfElement(n){var t=function(n){var i=n.Parent;return i==null?null:i.IsWindow?i:t(i)};return t(n)}function CloseWindow(n){var t=GetParentWindowOfElement(n);return t?(t.Close(),!0):!1}function CloseSection(n){var i=document.getElementById(n),t=FindPageOfDomElement(i);if(t.IsDialogLayer)return t.Close(),!0;throw new Error("Not implemented");}function FindPageOfDomElement(n){for(var t=n;!t.PageElement;)if((t=t.parentNode,!t)||t.WindowElement||t==null)return null;return t.PageElement}function FindDialogLayer(n){if(n==null)return null;if(n.IsDialogLayer)return n;var t=n.Parent;return FindDialogLayer(t)}function FindHavenSection(n){if(n==null)return null;if(n.AjaxUrl)return n;var t=n.Parent;return FindHavenSection(t)}function BorderController(n,t,i,r,u,f){this.Loaded=!1;this.Type=t||WhiteBorderStyle;this.IsEmpty=!0;for(var e in this.Type){this.IsEmpty=!1;break}this.BaseId=n;this.Size={};this.Size.Top=u==null?this.Type.Size:u;this.Size.Right=r==null?this.Type.Size:r;this.Size.Bottom=f==null?this.Type.Size:f;this.Size.Left=i==null?this.Type.Size:i;this.TopRightCornerSizeOffset=this.Size.Top==0||this.Size.Right?this.Type.CornerSizeOffset:0;this.TopLeftCornerSizeOffset=this.Size.Top==0||this.Size.Left?this.Type.CornerSizeOffset:0;this.BottomRightCornerSizeOffset=this.Size.Bottom==0||this.Size.Right?this.Type.CornerSizeOffset:0;this.BottomLeftCornerSizeOffset=this.Size.Bottom==0||this.Size.Left?this.Type.CornerSizeOffset:0}function Position2D(n,t,i){this.X=n||0;this.Y=t||0;this.Unit=i}function Triangle(n,t,i){this.Pos1=n;this.Pos2=t;this.Pos3=i}function IsInsideTriangle(n,t){var r=t,u=n.Pos1,f=n.Pos2,i=n.Pos3,s=(f.Y-i.Y)*(u.X-i.X)+(i.X-f.X)*(u.Y-i.Y),e=((f.Y-i.Y)*(r.X-i.X)+(i.X-f.X)*(r.Y-i.Y))/s,o,h;return e<=0?!1:(o=((i.Y-u.Y)*(r.X-i.X)+(u.X-i.X)*(r.Y-i.Y))/s,h=1-e-o,e>0&&o>0&&h>0)}function PositionAnchor(n,t){this.Vertical=n||new VerticalAnchor;this.Horizontal=t||new HorizontalAnchor}function VerticalAnchor(n,t,i){this.Top=n||!1;this.Center=t||!1;this.Bottom=i||!1}function HorizontalAnchor(n,t,i){this.Left=n||!1;this.Center=t||!1;this.Right=i||!1}function Coordinates(n,t,i){this.Position=n||new Position2D;this.Size=t||new Size;this.Anchor=i||new PositionAnchor;this.Update()}function ScrollJobs(){this.Interval=10;this.Jobs={};this.Index=0;this.PerformingJobs=!1;this.PerformJobs=function(){var n=[],r=0,u,t,i;for(u in this.Jobs)t=this.Jobs[u],t.Perform(),t.IsComplete?n[n.length]=t:r++;for(i=0;i<n.length;i++)this.RemoveJob(n[i]);r?(this.PerformingJobs=!0,window.setTimeout("window.ActiveScrollJobs.PerformJobs();",this.Interval)):this.PerformingJobs=!1};this.AddJob=function(n,t){var i=this.GetJob(n);i&&this.RemoveJob(i);this.Jobs[this.Index]=new ScrollJob(n,t,this.Index);this.Index++;this.PerformingJobs||this.PerformJobs()};this.GetJob=function(n){var t=null;for(var i in this.Index)if(this.Index[i]==n){t=this.Index[i];break}return t};this.RemoveJob=function(n){n.Cancel();delete this.Jobs[n.Index]}}function ScrollJob(n,t,i){this.Element=n;var r=this.CurrentPosition();this.DirectionUp=t<0;this.DirectionDown=t>0;this.Goal=r+(this.DirectionUp?-t:t);this.Index=i;this.StepLength=10;this.IsComplete=!1}function AttachEvent(n,t,i){if(n.addEventListener)n.addEventListener(t,i);else if(n.attachEvent)n.attachEvent(t,i);else throw new Error("Operation is not supported by your browser");}function Table(){this.Rows=[];this.HeadRows=[];this.Element=document.createElement("table");AddCssClass(this.Element,"table table-responsive");this.Element.cellSpacing=0;this.Element.cellPadding=0;this.Element.Element=this;this.Header=null;this.Body=document.createElement("tbody");this.Element.appendChild(this.Body);this.Destroy=function(){this.Clear();this.Body.parentNode.removeChild(this.Body);this.Body=null;delete this.Body;this.Element.parentNode.removeChild(this.Element);this.Element=null;delete this.Element};this.AddHeaderRow=function(){this.Header||(this.Header=document.createElement("thead"),this.Element.insertBefore(this.Header,this.Body));var n=new TableRow(this,!1,!0);return this.HeadRows[this.HeadRows.length]=n,n};this.AddRow=function(){var n=new TableRow(this);return this.Rows[this.Rows.length]=n,n};this.InsertRow=function(){var n=new TableRow(this,!0);return this.Rows[this.Rows.length]=n,n};this.GetRow=function(n){for(var t in this.Rows)if(this.Rows[t].Element.id==n)return this.Rows[t];return null};this.AddCell=function(){var n;return n=this.Rows.length==0?this.Addrow():this.Rows[this.Rows.length-1],n.AddCell()};this.RemoveRow=function(n){for(var i=n.Cells.length,t=0;t<i;t++)n.RemoveCell(n.Cells[0]);for(t=0;t<this.Rows.length;t++)if(this.Rows[t].Element==n.Element){this.Rows.splice(t,1);break}if(!this.Body.contains||this.Body.contains(n.Element))try{this.Body.removeChild(n.Element)}catch(r){}};this.ClearAll=function(){this.ClearHeader();this.Clear()};this.ClearHeader=function(){for(var t=this.HeadRows.length,n=0;n<t;n++)this.Header.removeChild(this.HeadRows[n].Element);this.HeadRows.splice(0,t)};this.Clear=function(){for(var t=this.Rows.length,n=0;n<t;n++)this.RemoveRow(this.Rows[0]);this.Rows=[]}}function TableRow(n,t,i){this.Cells=[];this.Element=document.createElement("tr");this.Element.Element=this;this.Table=n;this.IsHeader=i;this.Container=this.IsHeader?n.Header:n.Body;t?this.Container.insertBefore(this.Element,this.Container.firstChild):this.Container.appendChild(this.Element);this.currentCell=null;this.AddHeaderCell=function(){var n=new TableCell(this,!0);return this.Cells[this.Cells.length]=n,n};this.AddCell=function(){var n=new TableCell(this,this.IsHeader);return this.Cells[this.Cells.length]=n,n};this.Clear=function(){for(var n in this.Cells)this.RemoveCell(this.Cells[n])};this.RemoveCell=function(n){for(var t=0;t<this.Cells.length;t++)if(this.Cells[t].Element==n.Element){this.Cells.splice(t,1);break}if(!this.Element.contains||this.Element.contains(n.Element))try{this.Element.removeChild(n.Element)}catch(i){}}}function TableCell(n,t){this.Element=document.createElement(t?"th":"td");this.Element.Element=this;this.Row=n;this.Row.Element.appendChild(this.Element);this.AddText=function(n){var t=document.createTextNode(n);this.Element.appendChild(t)};this.SetText=function(n){this.Element.appendChild(document.createTextNode(n))};this.SetHtml=function(n){this.Element.innerHTML=n};this.AddElement=function(n){this.Element.appendChild(n)}}function IconDefinition(n){this.Url="";this.Size=0;n&&(this.Url=n.getAttribute("url"),this.Size=new Number(n.getAttribute("size")))}function ColorScheme(n){var t="transparent";n?(this.Background=new Color(n.getAttribute("background"),t),this.Foreground=new Color(n.getAttribute("foreground"),"#000000")):(this.Background=new Color(t),this.Foreground=new Color("#000000"));this.BackgroundHighlight=this.Background.CreateAdjusted(32);this.BackgroundLowlight=this.Background.CreateAdjusted(-32)}function Color(n,t){n||(n=t);this.IsTransparent=n=="transparent";var i=this.IsTransparent?"000000":n.replace("#","");i.length!=6&&(i=(i+"000000").slice(0,6));this.Red=i.slice(0,2);this.Green=i.slice(2,4);this.Blue=i.slice(4,6)}function HoverElement(n,t,i){if(CurrentEditorHover!=null){if(CurrentEditorHover.Element.Id==n.Id){i.Event.cancelBubble=!0;return}CurrentEditorHover.Destroy()}var r=n.Name=="RootLayoutContainer";n.OnResize();CurrentEditorHover=new EditorHover(n,t);i.Event.cancelBubble=!0}function EditorHover(n,t){this.Element=n;var i=document.createElement("div");i.style.position="absolute";i.style.top="0px";i.style.left="0px";i.style.width="100%";i.style.height="100%";i.ParentHoverElement=this;i.style.backgroundColor="#43577b";SetOpacity(i,4);this.Dimmer=i;t.appendChild(i);this.Dimmer.onmouseover=function(n){window.event?(window.event.returnValue=!1,window.event.cancelBubble=!0):n&&(n.cancelBubble=!0)};this.Dimmer.oncontextmenu=function(n){var t=this.ParentHoverElement;return t&&t.Element.Menu&&t.Element.Menu.ShowAtPointer(n),t.Destroy(),window.event?(window.event.returnValue=!1,window.event.cancelBubble=!0):n&&(n.cancelBubble=!0),!1}}function IsDate(n){return Object.prototype.toString.call(n)==="[object Date]"}function DateSpan(n,t){this.Start=n;this.End=t;this.StartValue=this.Start?this.Start.valueOf():0;this.EndValue=this.End?this.End.valueOf():0;this.GetDays=function(){var n=this.End.getTime()-this.Start.getTime();return n==0?0:n/864e5};this.SetStart=function(n){this.Start=n;this.Save()};this.SetEnd=function(n){this.End=n;this.Save()};this.Save=function(){this.StartValue=this.Start?this.Start.valueOf():0;this.EndValue=this.End?this.End.valueOf():0};this.RangeStartOutside=function(n){return n.StartValue<this.StartValue};this.RangeEndOutside=function(n){return n.EndValue>this.EndValue};this.IsRangeWithin=function(n){return n.StartValue<this.EndValue&&n.EndValue>this.StartValue};this.IsWithin=function(n){var t=n.valueOf();return t>=this.StartValue&&t<=this.EndValue}}function DateFormat(n){this.FormatString=n;this.YearChar="y";this.MonthChar="M";this.DayChar="d";this.HourChar="H";this.MinuteChar="m";this.SecondChar="s";this.MillisecondChar="f";var t=function(n,t){this.First=t.indexOf(n);this.Last=t.lastIndexOf(n)+1};this.Elements={};this.AddElement=function(i,r){var u={};u.Char=i;u.RetrievalFunctionName=r;u.Position=new t(i,n);this.Elements[i]=u};this.AddElement(this.YearChar,"getFullYear");this.AddElement(this.MonthChar,"GetFullMonth");this.AddElement(this.DayChar,"getDate");this.AddElement(this.HourChar,"getHours");this.AddElement(this.MinuteChar,"getMinutes");this.AddElement(this.SecondChar,"getSeconds");this.AddElement(this.MillisecondChar,"getMilliseconds")}function DateToString(n,t){return DateTimeToString(n,t).slice(0,10)}function TimeToString(n,t){return DateTimeToString(n,t).slice(11)}function DateTimeToString(n,t){var r=DateFormats.GetFormat(t),e=function(n,t){var i="0000".slice(4-t)+n;return i.slice(i.length-t)},o=function(n,t){var i="xxxx".replace(/x/g,n);return i.slice(4-t)},u;result=t;for(u in r.Elements){var i=r.Elements[u],f=i.Position.Last-i.Position.First,s=e(n[i.RetrievalFunctionName](),f),h=o(i.Char,f);result=result.replace(h,s)}return result}function DateParser(n,t){var i=DateFormats.GetFormat(t),r=function(t){return new Number(n.substring(t.Position.First,t.Position.Last))};return new Date(r(i.Elements[i.YearChar]),r(i.Elements[i.MonthChar])-1,r(i.Elements[i.DayChar]),0,0)}function DateTimeParser(n,t){var i=DateFormats.GetFormat(t),r=function(t){return new Number(n.substring(t.Position.First,t.Position.Last))};return new Date(r(i.Elements[i.YearChar]),r(i.Elements[i.MonthChar])-1,r(i.Elements[i.DayChar]),r(i.Elements[i.HourChar]),r(i.Elements[i.MinuteChar]),r(i.Elements[i.SecondChar]),r(i.Elements[i.MillisecondChar]))}function CalendarController(n){this.CalendarRange=new DateSpan;this.MonthRange=new DateSpan;var t=new Date(n.getFullYear(),n.getMonth(),1,n.getHours(),n.getMinutes(),0);this.CalendarRange.Start=t.CreateClone();this.MonthRange.Start=t.CreateClone();this.CalendarRange.Start.setDate(-(this.CalendarRange.Start.GetWeekday()-2));this.CalendarRange.End=t.CreateClone();this.MonthRange.End=new Date(this.CalendarRange.End.setMonth(this.CalendarRange.End.getMonth()+1,0));this.CalendarRange.End.setDate(this.CalendarRange.End.getDate()+(7-this.CalendarRange.End.GetWeekday()));this.CalendarRange.Save();this.MonthRange.Save();this.SetCurrentDate(this.CalendarRange.Start);this.StepForward=function(){this.CurrentDate++};this.GetCurrentDate=function(){return new Date(this.CurrentYear,this.CurrentMonth,this.CurrentDate,this.CurrentHours,this.CurrentMinutes,0)};this.IsInsideMonth=function(n){return this.MonthRange.IsWithin(n)};this.IsInsideCalendar=function(n){return this.CalendarRange.IsWithin(n)}}function DaysInMonth(n,t){var i=parseInt(n)+1,r=new Date(t,i,0);return r.getDate()}function DayToBeSetInMonth(n,t){var i=DaysInMonth(t.getMonth(),t.getFullYear()),r=t.getDate(),u=DaysInMonth(n,t.getFullYear()),f=r;return r==i&&u<i&&(f=u),f}function DayToBeSetInYear(n,t){var e=t.getMonth(),u=t.getDate(),f=u,i,r;return e==1&&(i=DaysInMonth(t.getMonth(),t.getFullYear()),r=DaysInMonth(t.getMonth(),n),u==i&&r<i&&(f=r)),f}function DayToKeepWeekInYear(n,t){var i=GetWeekNumber(t)[1],r;return i===53&&(r=WeeksInYear(n),r<53&&(i=r)),GetDateOfISOWeek(i,n)}function GetDateOfISOWeek(n,t){var i=new Date(t,0,1+(n-1)*7),u=i.getDay(),r=i;return u<=4?r.setDate(i.getDate()-i.getDay()+1):r.setDate(i.getDate()+8-i.getDay()),r}function GetWeekNumber(n){n=new Date(+n);n.setHours(0,0,0);n.setDate(n.getDate()+4-(n.getDay()||7));var t=new Date(n.getFullYear(),0,1),i=Math.ceil(((n-t)/864e5+1)/7);return[n.getFullYear(),i]}function WeeksInYear(n){var t=new Date(n,11,31),i=GetWeekNumber(t)[1];return i==1?GetWeekNumber(t.setDate(24))[1]:i}function ElementModificator(n,t){this.Element=t;this.Workspace=this.GetWorkspaceCoordinates(this.Element.Floor);this.FixedWorkspaceSize=this.Element.Floor.ForPrinting||!1;this.Coordinates=t.GetModificatorCoordinates();this.Coordinates.SetAnchorLeft(this.Workspace.Size);this.Coordinates.SetAnchorTop(this.Workspace.Size);this.Coordinates.Update();this.Coordinates.Modified=!1;this.Movable=!0;this.VerticalCenterSize=100;this.HorizontalCenterSize=100;this.ResizeControlSize=16;this.Create();n.appendChild(this.Body);this.UpdateBodyPosition()}function AppendChild(n){return n.Parent=this,n.PreviousSibling=this.LastChild,this.LastChild!=null&&(this.LastChild.NextSibling=n),this.LastChild=n,this.FirstChild==null&&(this.FirstChild=n),this.ChildCount++}function InsertAfter(n,t){n.PreviousSibling=t;n.NextSibling=t.NextSibling;n.NextSibling?n.NextSibling.PreviousSibling=n:this.LastChild=n;n.Parent=this;t.NextSibling=n}function InsertBefore(n,t){n.PreviousSibling=t.PreviousSibling;n.PreviousSibling||(this.FirstChild=n);n.NextSibling=t;n.Parent=this;t.PreviousSibling=n}function RemoveChild(n){for(var i=0,t=this.FirstChild;t;)i++,t=t.NextSibling;return n.PreviousSibling?n.PreviousSibling.NextSibling=n.NextSibling:this.FirstChild=n.NextSibling,n.NextSibling?n.NextSibling.PreviousSibling=n.PreviousSibling:this.LastChild=n.PreviousSibling,n.Delete&&n.Delete(),this.ChildCount--}function Tooltip(n){var i,t,r,u;for(this.Items=[],i=n.selectNodes("./Tooltip/Item"),t=0;t<i.length;t++)r=i[t],u=new TooltipItem(r),this.Items.push(u)}function TooltipItem(n){this.Style=n.getAttribute("style");this.Text=GetCDataValue(n,"Text");this.Icon=ActiveIconArchive.GetFromNode(n)}function GetDashboard(){if(BRIX.UIAction&&BRIX.UIAction.LatestWorkspace){var n=BRIX.UIAction.LatestWorkspace;return{ShowWorkspaceFold:function(){},ReplaceToolbar:function(){return{Id:0}}}}return ElementIndex.GetByClassName("DashboardElement")[0]}function CreateWorkspaceFoldEntry(n,t){var i=n.CreateInstance(null,"ToolboxEntryElement");return i.Caption=t,i}function IndicatorBoard(n){var i=n.selectNodes("./Indicator"),t,r;for(this.Indicators=[],t=0;t<i.length;t++)r=new Indicator(i[t]),this.Indicators.push(r)}function Indicator(n){this.Icon=ActiveIconArchive.GetFromNode(n);this.IsDisabled=n.getAttribute("disabled")=="true";this.IsInherited=n.getAttribute("inherited")=="true"}function ElementBase(){this.MyClassName="ElementBase";this.ElementNodeInterface=!0;this.PreviousSibling=null;this.FirstChild=null;this.LastChild=null;this.NextSibling=null;this.ChildCount=0;this.Parent=null;this.HoverPadding=50;this.NormalPadding=0;this.CurrentVerticalTransition=this.NormalPadding;this.VerticalTransitionSpeed=3;this.TargetVerticalTransition=this.CurrentVerticalTransition}function CssElement(n,t){this.Constructor(n,t)}function JavascriptElement(n,t){this.Constructor(n,t)}function PositionedElement(n,t){this.Constructor(n,t)}function SectionElement(n,t){this.Constructor(n,t)}function PageLayerElement(n,t){this.IsPageLayer=!0;this.Constructor(n,t)}function PageElement(n,t){this.IsContextEndpoint=!0;this.Constructor(n,t)}function addGoogleTag(n){jQuery("head").prepend("<!-- Google Tag Manager --><script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','"+n+"');<\/script><!-- End Google Tag Manager -->");jQuery("body").prepend('<!-- Google Tag Manager (noscript) --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id='+n+'"height="0" width="0" style="display:none;visibility:hidden"><\/iframe><\/noscript><!-- End Google Tag Manager (noscript) -->')}function ElementNodeXmlFailedToLoad(n){alert("Could not load page ("+n+").")}function InitializePage(){InstallClickEventBubbling();window.Page=new PageElement(null,new FakeXml("response"));window.Page.Initialize();window.Page.OnResize()}function LoadPage(n){InitializePage();var t=new MacroElement;t.Guid=n;t.Id="rootmacro";ElementIndex.Add(t);window.Page.AppendChild(t);t.RunMacro()}function LoadMacro(n,t){var i,r;InitializePage();i=new MacroElement;i.InitializeMembers();i.Id="rootmacro";IsDefined(t)||(r=BRIX.Utilities.Location.GetHash(),t={_hash:r});ElementIndex.Add(i);window.Page.AppendChild(i);i.RunByGuid(n,t)}function ElementNodeXmlResponse(n){var i=new XmlError(n),t,r;if(i.isError()){alert(i.errorDescription());return}(t=GetXmlRootNode(n),t!=null)&&(r=t.getAttribute(WorkflowValueName.ElementId),r||(window.Page.CreateChildNodes(t),window.Page.Initialize()))}function BackgroundElement(n,t){this.Constructor(n,t)}function FormElement(n,t){this.Constructor(n,t)}function DataElement(n,t){this.IsDataElement=!0;this.Constructor(n,t);this.OriginalLabelWidth=-1;this.LabelRatio=4;this.InputRatio=8}function TextInputDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function LargeTextDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function EmailElement(n,t){this.Constructor(n,t);this.IsEmail=!0}function NumericElement(n,t){this.Constructor(n,t);this.IsNumeric=!0}function DoubleNumericElement(n,t){this.Constructor(n,t);this.IsNumeric=!0;this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function ListDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function FieldOption(n){this.Value=n.getAttribute("alias")||n.getAttribute("value")||"";this.Selected=n.getAttribute("selected")=="true";this.Caption=GetCDataValue(n,"Caption");this.Hidden=n.getAttribute("hidden")=="true";this.Disabled=n.getAttribute("disabled")=="true";this.Deleted=n.getAttribute("deleted")=="true"}function ListboxDataElement(n,t){this.Constructor(n,t)}function CheckboxDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function CheckboxElement(n,t){this.Constructor(n,t)}function RadioButtonDataElement(n,t){this.Constructor(n,t)}function RadioButtonElement(n,t){this.Constructor(n,t)}function UploadDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function UploadboxElement(n,t){this.Constructor(n,t)}function getExtension(n){var t=n.split(/[\\/]/).pop(),i=t.lastIndexOf(".");return t===""||i<1?"":t.slice(i+1)}function HtmlElement(n,t){this.Constructor(n,t)}function HtmlDataElement(n,t){this.Constructor(n,t)}function TextElement(n,t){this.Constructor(n,t)}function TextboxElement(n,t){this.Constructor(n,t);this.IsValid=!0;this.ValuePlaceholder=""}function TextareaElement(n,t){this.Constructor(n,t);this.IsValid=!0;this.ValuePlaceholder=""}function ListboxElement(n,t){this.Constructor(n,t);this.Options=[]}function DnDContainerElement(n,t){this.Constructor(n,t)}function ColorDataElement(n,t){this.Constructor(n,t)}function ContentAreaElement(n,t){this.Constructor(n,t);this.LEFT=0;this.RIGHT=1;this.TOP=2;this.BOTTOM=3}function ImageElement(n,t){this.Constructor(n,t)}function MessageElement(n,t){this.Constructor(n,t)}function CommentElement(n,t){this.Constructor(n,t)}function PhoneDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function CountryListDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function OrganizationNumberDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function VATNumberDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function AddToCalendarElement(n,t){this.MyClassName="AddToCalendarElement";this.Constructor(n,t)}function TimezonelistDataElement(n,t){this.MyClassName="TimezonelistDataElement";this.Constructor(n,t)}function ContainerElement(n,t){this.Constructor(n,t)}function ContainerColumnElement(n,t){this.Constructor(n,t)}function DateTimePickerElement(n,t){this.Constructor(n,t)}function DateTimeDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function DateTimeSpanDataElement(n,t){this.Constructor(n,t);this.ExplanatoryOpened=!1;this.Floor=null;this.Dimmer=null;this.Icon=null;this.ExplanatoryDialog=null}function DatePicker(n,t,i,r){this.Reference=n;this.CallbackName=t;this.Value=r.CreateClone();this.CurrentValue=r.CreateClone();this.ParentElement=i;this.Zoom=TimeZoomDay;this.Floor=null;this.Dimmer=null}function TimePicker(n,t,i,r,u){this.Reference=n;this.CallbackName=t;this.Value=r.CreateClone();this.CurrentValue=r.CreateClone();this.ParentElement=i;this.Interval=u||30}function DropdownPicker(n,t,i,r,u,f,e,o,s){if(!IsDate(n))throw new Error("Invalid argument: minTime is not a Date type");if(!IsDate(t))throw new Error("Invalid argument: maxTime is not a Date type");if(!IsDate(i))throw new Error("Invalid argument: currentTime is not a Date type");if(isNaN(r))throw new Error("Invalid argument: minutesInterval is not a Number type");if(n>t)throw new Error("Argument out of range: minTime must be less than maxTime");this.MinTime=n.CreateClone();this.MaxTime=t.CreateClone();var h=i;h<n||h>t&&(h=t);this.CurrentTime=h.CreateClone();this.MinutesInterval=r;this.OnChangeCallback=u;this.YearTitle=f||"Year";this.MonthTitle=e||"Month";this.DayTitle=o||"Day";this.TimeTitle=s||"Time";this.NoTime=this.MinutesInterval>=1440;this.Year=0;this.Month=0;this.Day=0;this.Hour=0;this.Minute=0}function TimePortionBox(n,t,i,r,u,f,e,o){this.Time=n;this.Portion=t;this.SetTime=i;this.DefaultValue=r;this.Items=u;this.Min=f;this.Max=e;this.Next=null;this.PortionValue=null;this.UpdateCallback=o?o:function(){}}function SeatElement(n,t){this.Constructor(n,t)}function EmbeddedReportElement(n,t){this.Constructor(n,t)}function ReportDeserializer(n,t,i){this.Columns=[];this.Rows=[];this.DeserializeColumns(n,t);this.DeserializeRows(n,t);i&&(this.Columns.length==0&&this.Columns.push({Title:"Lorem ipsum"}),this.Rows.push({Id:1,Columns:[{Value:"Lorem ipsum dolor sit amet"}]}))}function ListBuilder(n,t){this.Columns=n.Columns;this.Rows=n.Rows;this.IsEmpty=this.Rows.length==0;this.Connector=t}function FormConnectorElement(n,t){this.Constructor(n,t);this.IsButtonContainer=!0}function ReservationManagerElement(n,t){this.Constructor(n,t)}function ResourcesDeserializer(n){this.Columns=[];this.Rows=[];this.DeserializeColumns(n);this.DeserializeRows(n)}function ResourceListBuilder(n,t,i,r){this.UniqueId=window.BRIX.ResourceListBuilderIndex|0;window.BRIX.ResourceListBuilderIndex=this.UniqueId+1;this.Columns=n.Columns;this.Rows=n.Rows;this.IsEmpty=this.Rows.length==0;this.Entries=[];this.FullResourceCaption=n.FullResourceCaption;this.HideFullResources=n.HideFullResources;this.FreeAmount=t;this.SingleOnly=i;this.FreeRadio=[];this.ReservationManager=r}function PopOverElement(n,t){this.Constructor(n,t)}function PopOverItemElement(n,t){this.Constructor(n,t)}function PopOverContainer(n,t){this.ContainerBody=n;this.TwistBody=t}function WorkspaceWindowElement(n,t){this.MyClassName="WorkspaceWindowElement";this.IsWindow=!0;this.IsButtonContainer=!0;this.Menu=null;this.Constructor(n,t)}function WindowElement(n,t){this.MyClassName="WindowElement";this.IsWindow=!0;this.IsButtonContainer=!0;this.Menu=null;this.Constructor(n,t)}function ContextWindowElement(n,t){this.MyClassName="ContextWindowElement";this.IsWindow=!0;this.IsContextEndpoint=!0;this.IsButtonContainer=!0;this.Constructor(n,t)}function CreateMacroCallback(n){var t=window.CurrentMacroCallbackIndex.GetActiveMacro(n);return t?t:window.CurrentMacroCallbackIndex.AddMacro(n)}function MacroCallbackEntry(n){this.MacroElement=n;this.Id=n.Id;this.Key="_i"+n.Id;this.Feedback=function(n,t){this.FeedbackKey=n;this.FeedbackValue=t}}function MacroCallbackIndex(){this.Index=new Hashtable}function ClientOperations(n){var i,t,r;for(this.Operations=[],this.Count=0,i=n.selectNodes(ClientOperationNodeName),t=0;t<i.length;t++)this.Count++,r=new ClientOperation(i[t]),this.Operations[t]=r;this.IsEmpty=function(){return this.Count===0};this.GetFirstResponseNode=function(){var n=null;return this.Operations.each(function(t){if(n=t.GetContentNode(),n)throw $break;}),n}}function PromptLogin(n,t){var r,i;n&&(r=new ElementBase,window.LoginMacro=r.CreateChildNode(n));i=document.getElementById("LoginPage");window.LoginAwayHandle&&window.clearTimeout(window.LoginAwayHandle);t&&AddCssClass(i,"Failed");RemoveCssClass(i,"Hidden");RemoveCssClass(i,"Away");window.Page.RemoveChildren()}function Login(){var n,t,i;if(!window.LoginMacro){window.location.reload();return}n=document.getElementById("LoginPage");AddCssClass(n,"Hidden");RemoveCssClass(n,"Failed");window.LoginAwayHandle=window.setTimeout(function(){AddCssClass(n,"Away");window.LoginAwayHandle=null},1e3);t=document.getElementById("username").value;i=document.getElementById("password").value;window.LoginMacro.AddClientArgument("username",t);window.LoginMacro.AddClientArgument("password",i);window.LoginMacro.PerformAction();window.LoginMacro.ClearClientArguments()}function ClientOperation(n){this.OperationNode=n;this.Type=n.getAttribute("type");this.PreferedOpenTarget=this.GetAttribute("preferedopentarget")}function OpenUrlOperation(n,t,i,r){r=r||"_blank";var u=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)},f=function(){var t=n.indexOf("?")==-1?t=n+"?"+i:n;window.open(t,r)},e=function(){var t=document.createElement("form"),e,f,o;for(t.method="POST",t.action=n,document.body.appendChild(t),e=i.split("&"),f=0;f<e.length;f++)if(o=e[f].split("="),o.length==2)u(t,o[0],o[1]);else{var s=o[0],h=e[f].length,c=s.length+1,l=e[f].substring(c,h);u(t,s,l)}t.target=r;t.submit();document.body.removeChild(t)};t=="GET"?f():t=="POST"&&e()}function MacroElement(n,t){IsDefined(t)&&t.IsJSON&&BRIX.Utilities.MakeXmlNodeCompatible(t);this.MyClassName="MacroElement";this.Constructor(n,t);this.IsMacroElement=!0;this.FocusWithServer=!1}function ButtonElement(n,t){this.MyClassName="ButtonElement";this.Constructor(n,t)}function IconButtonElement(n,t){this.MyClassName="IconButtonElement";this.Constructor(n,t);this.Margin=5}function MenuButtonElement(n,t){this.MyClassName="MenuButtonElement";this.Constructor(n,t)}function ThumbnailButtonElement(n,t){this.MyClassName="ThumbnailButtonElement";this.Constructor(n,t);this.Margin=5}function DragableElementDescription(n,t){this.Element=n;this.Icon=ActiveIconArchive.GetFromNode(t,64);this.Headline=GetCDataValue(t,"Headline");this.Description=GetCDataValue(t,"Description");var i=t.selectSingleNode("DragableElementId");this.Type=i.getAttribute("type");this.Id=i.getAttribute("id");this.Class=i.getAttribute("class")||"";this.Tag=i.getAttribute("tag")}function DragBox(n){this.Description=n;this.IconSize=64;this.Body=null;this.X=100;this.Y=100}function DnDContainerElementAttributes(n,t){var o,e,r,u,h,i,l,f;for(this.ParentElement=t,this.Parent=t,this.Areas={},this.Rejections=[],o=n.selectNodes("Allowance"),i=0;i<o.length;i++){var s=o[i],f=s.getAttribute("type"),c=s.getAttribute("areas").split(","),a=s.selectSingleNode("DropMacro"),v=new MacroElement(this,a.firstChild);for(e=0;e<c.length;e++)r=c[e],this.Areas[r]||(this.Areas[r]={}),u={},u.Type=f,u.Areas=r,u.Macro=v,this.Areas[r][f]=u}for(h=n.selectNodes("Rejection"),i=0;i<h.length;i++)l=h[i],f=l.getAttribute("type"),this.Rejections.push(f)}function DragableElementSetupHelper(n,t,i){var r=n.AddCallback("mouse down",t,"DragAndDropMouseDown");return t.CancelDnD=function(){t.DndHoverCheck&&t.DndHoverCheck.FinishHovering();window.Page.EventTracker.RemoveCallback(t.DragAndDropMoveHandle);window.Page.EventTracker.RemoveCallback(t.DragAndDropUpHandle);t.DragAndDropOutHandle&&window.Page.EventTracker.RemoveCallback(t.DragAndDropOutHandle);t.DragAndDropOverHandle&&window.Page.EventTracker.RemoveCallback(t.DragAndDropOverHandle);t.DragAndDropMoveHandle=null;t.DragAndDropUpHandle=null;t.DragAndDropOutHandle=null;t.DragAndDropOverHandle=null;t.DndHoverCheck=null;t.DnDStartPosition=null;this.DragAndDropBox&&(this.DragAndDropBox.EndDrag(),this.DragAndDropBox=null);this.DragAndDropPending=!1},t.DragAndDropMouseDown=function(n,i,r){if(!t.PreventDnD){t.DragAndDropMoveHandle=window.Page.EventTracker.AddCallback("mouse move",t,"DragAndDropMouseMove");t.DragAndDropUpHandle=window.Page.EventTracker.AddCallback("mouse up",t,"DragAndDropDropped");t.DnDStartPosition=new Position2D(i,r);this.DragAndDropPending=!0;var u=new EventInfo(n),f=u.Target;f.ondragstart=function(){return!1};document.body.focus()}return!1},t.DragAndDropMouseMove=function(n,r,u){var e,o,f,s;return this.DragAndDropPending?(e=new Position2D(r,u),o=t.DnDStartPosition.Distance(e),o>10&&(this.DragAndDropBox=new DragBox(i),this.DragAndDropBox.BeginDrag(r,u),t.DndHoverCheck=new IsDropableOverValidContainerHelper(i,t),t.DragAndDropOutHandle=window.Page.EventTracker.AddCallback("mouse out",t,"DragAndDropCanceled"),t.DragAndDropOverHandle=window.Page.EventTracker.AddCallback("mouse over",t,null),this.DragAndDropPending=!1)):this.DragAndDropBox&&(this.DragAndDropBox.Move(r,u),f=t.DndHoverCheck.GetAnyHoveredContainer(r,u),this.DragAndDropBox.HoveredElement!=null&&f!=this.DragAndDropBox.HoveredElement&&this.DragAndDropBox.HoveredElement.DnDHoverOut(),f?(this.DragAndDropBox.HoveredElement=f,s=f.GetAreaOfPosition(r,u,this.DragableDescription.Class),f.DnDHoverIn(s,this.DragableDescription.Class),this.DragAndDropBox.HoveringInOnValidContainer()):this.DragAndDropBox.IsHovered&&this.DragAndDropBox.HoveringOutFromValidContainer(r,u)),!0},t.DragAndDropDropped=function(n,r,u){var f,e;t.DragAndDropMoveHandle&&(t.DndHoverCheck&&(f=t.DndHoverCheck.GetAnyHoveredContainer(r,u),f&&(e=f.GetAreaOfPosition(r,u,this.DragableDescription.Class),f.DropElementOnMe(i,e,r,u))),t.CancelDnD())},t.DragAndDropCanceled=function(){t.DragAndDropMoveHandle&&t.CancelDnD()},r}function IsDropableOverValidContainerHelper(n){var r;this.DragableDescription=n;var t=[],i=function(i){i.IsDragAndDropContainer&&i.DnDContainerAttributes.IsTypeAllowed(n)&&(t.push(i),i.DnDHoverReactionOn())},u=BRIX.WindowStack.length>0&&(BRIX.WindowStack>1||BRIX.WindowStack[0].MyClassName!=="WorkspaceWindowElement");u?(r=BRIX.WindowStack[BRIX.WindowStack.length-1],r.OnEach(function(n){return i(n),OnEachResult.Continue})):ElementIndex.Index.each(function(n,t){i(t)});this.Containers=t}function EventTracking(n,t){this.ElementId=n;this.Element=t||null;this.GetElement=function(){return this.Element||document.getElementById(this.ElementId)};this.Events={};this.Events["context menu"]=new EventCallbacks(this,"oncontextmenu","contextmenu","OnContextMenu");this.Events["mouse over"]=new EventCallbacks(this,"onmouseover","mouseover","OnMouseOver");this.Events["mouse out"]=new EventCallbacks(this,"onmouseout","mouseout","OnMouseOut");this.Events["mouse move"]=new EventCallbacks(this,"onmousemove","mousemove","OnMouseMove");this.Events["mouse down"]=new EventCallbacks(this,"onmousedown","mousedown","OnMouseDown");this.Events["mouse up"]=new EventCallbacks(this,"onmouseup","mouseup","OnMouseUp");this.Events.change=new EventCallbacks(this,"onchange","change","OnChange");this.Events.focus=new EventCallbacks(this,"onfocus","focus","OnFocus");this.Events.blur=new EventCallbacks(this,"onblur","blur","OnBlur");this.Events.resize=new EventCallbacks(this,"onresize","resize","OnResize");this.Events.click=new EventCallbacks(this,"onclick","onclick","OnClick");this.Events["double click"]=new EventCallbacks(this,"ondblclick","dblclick","OnDoubleClick");this.Events["key press"]=new EventCallbacks(this,"onkeypress","keypress","OnKeyPress");this.Events["key down"]=new EventCallbacks(this,"onkeydown","keydown","OnKeyDown");this.Events["key up"]=new EventCallbacks(this,"onkeyup","keyup","OnKeyUp");this.Handles=[];this.IsMouseOver=!1;this.GlobalIndex=GlobalMouseTrackingIndex.Add(this);this.TimerHandle=null;this.OverTimerHandle=null;this.UniqueIndex=0}function StopPropagation(n){n=n||event;n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function EventCallbacks(n,t,i,r){this.Tracker=n;this.BrowserEventName=t;this.DOMEventName=i;this.TrackerEventName=r;this.Callbacks={};this.CallbackCount=0;this.HandleIndex=0}function EventCollection(n,t){this.ParentElement=n;this.Events=[];var i=t.selectSingleNode?t.selectSingleNode("./Events"):null;i!=null&&this.LoadEvents(i)}function CustomEvent(n,t){this.Trigger=new EventTrigger(t);this.Action=new EventAction(n,t)}function EventTrigger(n){this.Name=n.getAttribute("trigger")}function EventAction(n,t){var i,r,u,f;this.Parent=n;i=t.selectSingleNode("Action");this.Type=i.getAttribute("action");this.NameOrId=i.getAttribute("nameorid");this.Color=i.getAttribute("color");this.ColorReset=i.getAttribute("colorReset");this.ColorResetText=i.getAttribute("colorResetText");this.Value=i.getAttribute("value");this.CallbackArgumentName1=i.getAttribute("callback_argument_name1");this.CallbackArgumentName2=i.getAttribute("callback_argument_name2");this.CallbackArgumentName3=i.getAttribute("callback_argument_name3");r=i.selectSingleNode("ContextMenu");r&&(this.ContextMenu=new ContextMenu(this,r),this.ContextMenu.CreateChildNodes(r));u=i.selectSingleNode("CallableMacro");u&&(this.CallableMacro=new MacroElement(this.Parent,u.firstChild));f=i.selectSingleNode("SaveMacro");f&&(this.SaveMacro=new MacroElement(this.Parent,f.firstChild))}function TableElement(n,t){this.Constructor(n,t)}function TableCellElement(n,t){this.Constructor(n,t)}function TableRowElement(n,t){this.Constructor(n,t);this.HoverPadding=80;this.NormalPadding=5;this.IsSelected=!1;this.CurrentVerticalTransition=this.NormalPadding;this.VerticalTransitionSpeed=3;this.TargetVerticalTransition=this.CurrentVerticalTransition}function TableColumn(n){this.Cells={};this.Name=n.getAttribute("name");this.IsSelected=n.getAttribute("selected")}function MenuItem(n,t){this.Icon=null;this.Caption="";this.Body=null;this.Parent=null;this.MyClassName="MenuItem";this.Constructor(n,t);this.IconSize=32}function MenuMacro(n,t){this.MyClassName="MenuMacro";this.Constructor(n,t)}function EventMenuItem(n,t){this.MyClassName="EventMenuItem";this.Constructor(n,t)}function Menu(n,t){this.MyClassName="Menu";this.Constructor(n,t)}function ContextMenu(n,t,i){this.MyClassName="ContextMenu";this.IsManualMenu=i?!0:!1;this.Constructor(n,t);this.IsRootMenu=!0}function TemplateElement(n,t){this.MyClassName="TemplateElement";this.Constructor(n,t)}function PoweredByElement(n,t){this.MyClassName="PoweredByElement";this.Constructor(n,t)}function LanguageElement(n,t){this.MyClassName="LanguageElement";this.Constructor(n,t)}function ConvertToISO(n){var t="en";switch(n){case"english":t="en";break;case"swedish":t="sv";break;case"norwegian":t="no";break;case"german":t="de";break;case"polish":t="pl";break;case"finnish":t="fi";break;case"danish":t="da";break;case"french":t="fr";break;case"spanish":t="es";break;case"russian":t="ru";break;case"dutch":t="nl";break;case"chinese":t="zh";break;case"portuguese":t="pt";break;case"italian":t="it";break;default:t="en"}return t}function EditorFloorElement(n,t){this.MyClassName="EditorFloorElement";this.Constructor(n,t);this.IsAbsPosFloor=!0}function ColorTemplateElement(n,t){this.MyClassName="ColorTemplateElement";this.Constructor(n,t)}function FormTemplateElement(n,t){this.MyClassName="FormTemplateElement";this.Constructor(n,t)}function ImageTemplateElement(n,t){this.MyClassName="ImageTemplateElement";this.Constructor(n,t)}function TextTemplateElement(n,t){this.MyClassName="TextTemplateElement";this.Constructor(n,t)}function BackgroundTemplateElement(n,t){this.MyClassName="BackgroundTemplateElement";this.Constructor(n,t)}function QrCodeTemplateElement(n,t){this.MyClassName="QrCodeTemplateElement";this.Constructor(n,t)}function ColorPickerHelper(n,t,i,r,u){this.ChangeCallback=n;this.SaveCallback=t;this.DefaultColor=i||"336699";this.Color=this.DefaultColor;this.ResetColor=r;this.ResetColorText=u}function FileProperty(n){this.Initialize(n)}function ImageProperty(n){this.Initialize(n)}function ReportBrowserElement(n,t){this.MyClassName="ReportBrowserElement";this.Constructor(n,t)}function handleDragStart(n){srcDragElem=this;n.dataTransfer.setData("text","anything")}function handleDragOver(n){return n.preventDefault&&n.preventDefault(),n.dataTransfer.dropEffect="move",!1}function handleDragEnter(n){n.preventDefault&&n.preventDefault();this.classList.add("over")}function handleDragLeave(n){n.preventDefault&&n.preventDefault();this.classList.remove("over")}function handleDrop(n){if(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),srcDragElem!==null&&srcDragElem.ColumnName!==this.ColumnName){var t={Action:"move",From:srcDragElem.ColumnName,To:this.ColumnName},i=JSON.stringify(t);this.parent.MoveColumnMacro.AddClientArgument("_colsToMove",i);this.parent.MoveColumnMacro.PerformAction()}return!1}function handleDragEnd(n){n.preventDefault&&n.preventDefault();var t=document.querySelectorAll("[draggable=true]");[].forEach.call(t,function(n){n.classList.remove("over")})}function ListGroup(n,t,i){this.ExpandedIconName=CollapseIconName;this.CollapsedIconName=ExpandIconName;this.Id=GetNewId();this.Browser=n;this.Height=i;this.IconSize=this.Height>32?32:16;this.IconMargin=10;this.IconWidth=this.IconSize+this.IconMargin;this.Parent=null;this.Name=t.getAttribute("name");this.Value=t.getAttribute("value")||"";this.Count=t.getAttribute("count");this.Title=GetCDataValue(t,"Title");this.Expandable=t.getAttribute("expandable")=="true"}function DashboardElement(n,t){this.Constructor(n,t);this.IsDashboard=!0}function ToolbarElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0;this.IsToolbarElement=!0;this.IsButtonContainer=!0}function ToolboxEntryElement(n,t){this.Constructor(n,t)}function UserControlElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0}function BreadcrumbElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0}function BreadcrumbNavigatorElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0}function NavigatorElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0}function NavigatorItemAdd(n){n.PreviousSibling=this.LastChild;this.LastChild!=null&&(this.LastChild.NextSibling=n);this.LastChild=n;this.FirstChild==null&&(this.FirstChild=n)}function NavigatorItem(n,t){n&&this.Initialize(n,t)}function ContextBarElement(n,t){this.Constructor(n,t);this.IsDashboardElement=!0}function ContextItem(n,t){this.Initialize(n,t)}function TreeBranchElement(n,t){this.Constructor(n,t)}function ReceiptElement(n,t){this.Constructor(n,t)}function AllotmentManagerElement(n,t){this.Constructor(n,t)}function ResourceListElement(n,t){this.Constructor(n,t)}function ResourceEntry(n,t){this.Parent=n;this.Id=t.getAttribute("id");this.Description=GetCDataValue(t,"Description");this.Parent.IsFreeAmount&&(this.CurrentAmount=new Number(t.getAttribute("amount")),this.AvailableAmount=new Number(t.getAttribute("available_amount")))}function CalendarElement(n,t){this.Constructor(n,t)}function CalendarEntry(n,t){this.Calendar=n;this.Title=GetCDataValue(t,"Title");this.Description=GetCDataValue(t,"Description");this.Start=DateTimeParser(t.getAttribute("start"),this.Calendar.Format);this.End=DateTimeParser(t.getAttribute("end"),this.Calendar.Format);this.BgColor=t.getAttribute("bgcolor");this.TextColor=t.getAttribute("textcolor");this.Tooltip=new Tooltip(t);this.Resource=t.getAttribute("resource");this.Count=t.getAttribute("count");this.SectionGroup=t.getAttribute("section")||0}function CalendarSection(n,t){this.Index=t;this.Lines=new Array(n);this.IsSpanOccupied=function(n,t){for(var r=!1,i=n;i<t;i++)if(this.Lines[i]){r=!0;break}return r};this.OccupySpan=function(n,t){for(var i=n;i<t;i++)this.Lines[i]=!0}}function CalendarSectionArranger(n){this.LineCount=n;this.Sections=[]}function CalColItem(n,t){this.From=n;this.To=t}function TestCalCol(){var n=new CalendarSectionArranger(7);n.GetSuitableSection(2,4);n.GetSuitableSection(2,3);n.GetSuitableSection(3,5);n.GetSuitableSection(5,6)}function CalendarView(){}function MonthCalendarView(n){this.Sections=[];this.Calendar=n;this.CellIndex=null;this.DayCount=7;this.ContentSections=1;this.FixedContentSection=1;this.Scrollable=!1}function DayCalendarView(n){this.Sections=[];this.Calendar=n;this.DayCount=1;this.ContentSections=null;this.Scrollable=!0}function WeekCalendarView(n){this.Sections=[];this.Calendar=n;this.DayCount=7;this.ContentSections=null}function QrCodeElement(n,t){this.Constructor(n,t)}function PaperElement(n,t){this.Constructor(n,t)}function PagePreviewElement(n,t){this.LEFT=0;this.RIGHT=1;this.TOP=2;this.BOTTOM=3;this.PORTRAIT=0;this.LANDSCAPE=1;this.SCALE=1;this.Constructor(n,t)}function AuthorListElement(n,t){this.Constructor(n,t)}function TextFromElsewhereElement(n,t){this.Constructor(n,t)}function DocumentPreviewElement(n,t){this.Constructor(n,t)}function DocumentPageCountElement(n,t){this.Constructor(n,t)}function HtmlEditorElement(n,t){this.Constructor(n,t)}function BoolAlgebraElement(n,t){this.Constructor(n,t)}function BoolNode(n,t,i){this.Element=n;this.Children=0;this.Width=BoolNode.Width;this.Top=0;this.Left=0;t?(this.Height=BoolNode.ConcreteHeight,this.IsRoot=!1,this.Id=t.getAttribute("id"),this.Source=GetCDataValue(t,"Source"),this.Operator=GetCDataValue(t,"Operator"),this.Value=GetCDataValue(t,"Value"),this.LoadChildren(t)):i?(this.IsVirtual=!0,this.VirtualType=i,this.Height=BoolNode.VirtualHeight,this.Title=""):(this.IsRoot=!0,this.Height=BoolNode.ConcreteHeight)}function TreeArranger(){this.Rows=[]}function AlgebraTable(n,t){this.Element=n;this.DepthLimit=5;this.RootNode=new BoolNode(this.Element);this.RootNode.Width=0;this.RootNode.LoadChildren(t.selectSingleNode("BoolNode"))}function VisibilityUpdater(n){var t=n.getAttribute(WorkflowValueName.VisibilityRootId);this.RootElement=ElementIndex.Get(t);this.HiddenNodes=n.selectNodes("./Hidden/Node");this.VisibleNodes=n.selectNodes("./Visible/Node");this.ButtonsNode=n.selectSingleNode("./Buttons")}function ButtonsUpdater(n){this.ButtonsNode=n.selectSingleNode("./Buttons")}function SearchElement(n,t){this.Constructor(n,t)}function HtmlThumbnailElement(n,t){this.Constructor(n,t)}function DIBSElement(n,t){this.Constructor(n,t)}function ShoppingCartElement(n,t){this.Constructor(n,t)}function ShoppingCartTemplateElement(n,t){this.Constructor(n,t)}function PayExElement(n,t){this.Constructor(n,t)}function SwedbankPayElement(n,t){this.Constructor(n,t)}function NetsEasyElement(n,t){this.Constructor(n,t)}function NetaxeptElement(n,t){this.Constructor(n,t)}function ComponentPickerElement(n,t){this.Constructor(n,t)}function ComponentEnumerator(n,t,i,r,u,f){var o,e;this.GlobalNumbering=!0;this.Size=40;this.MarginTop=30;this.Margins=5;this.NumSize=16;this.ScrollWidth=20;this.Color="#e3e6e9";this.TextColor="#000";this.HighlightColor="#99ccaa";this.Canvas=n;this.Data=t;this.ActiveItems=[];e=this;this.Scroll=0;this.OnOpenCallback=i;this.OnCloseCallback=r;this.OnChangeCallback=u;this.OnSelectCallback=f;this.Categories=[];o="";e=this;this.ScanData([],function(n){var t="{"+n.Category+"}";return o.indexOf(t)==-1&&(o+=t,e.Categories.push(n.Category)),n.Controller=e,!1});this.Categories.length<=1&&(this.MarginTop=this.Margins)}function DesignerElement(n,t){this.Constructor(n,t)}function FabricInitialization(n){if(typeof fabric=="object"){n();fabric.Canvas.prototype._fireOverOutEvents=function(n,t){n?this._hoveredTarget!==n&&(this.fire("mouse:over",{target:n,e:t}),n.fire("mouseover",t),this._hoveredTarget&&(this.fire("mouse:out",{target:this._hoveredTarget,e:t}),this._hoveredTarget.fire("mouseout",t)),this._hoveredTarget=n):this._hoveredTarget&&(this.fire("mouse:out",{target:this._hoveredTarget,e:t}),this._hoveredTarget.fire("mouseout",t),this._hoveredTarget=null)};return}LoadJsFile("Scripts/fabric.js");window.setTimeout(function(){FabricInitialization(n)},100)}function ComponentController(n){this.OnMouseOverCallbacks=[];this.OnMouseOutCallbacks=[];this.OnScaledCallbacks=[];this.Item=n;var t=this;this.OnScaled=function(n){this.OnScaledCallbacks.map(function(i){i(t,n)});this.Item.Properties.SubItems.map(function(t){t.Controller.OnScaled&&t.Controller.OnScaled(n)})};this.Build=function(){var u=t.Item.Properties.SubItems,r,n,o,s,i,f,e;if(u.length==0)return new fabric.Rect;for(r=[],n=0;n<u.length;n++)o=DesignerItemController.Get(u[n],this.Container,this.Mode),s=o.Build(u[n]),r.push(s);for(i=new fabric.Group(r),i.hasControls=i.selectable=this.Mode==DesignerItemController.DesignMode,n=0;n<r.length;n++)f=r[n],e=f.DesignerController,e.ComponentOffset={X:e.Item.Pos.Left-(f.left+i.width/2),Y:e.Item.Pos.Top-(f.top+i.height/2)};return DesignerItemController.SetProperties(t.Item,i),t.CanvasItem=i,i};this.Transformer=function(){var n=t.CanvasItem;n.angle=BRIX.RoundAngle(n.angle);DesignerItemController.UniformPosition(n);DesignerItemController.UniformSize(n)};this.OnMouseOver=function(){var n=t.CanvasItem;BRIX.LastCanvasHover!=n&&(BRIX.LastCanvasHover&&t.OnOut&&t.OnOut(BRIX.LastCanvasHover.DesignerController.Item),t.OnOver&&t.OnOver(t.Item),BRIX.LastCanvasHover=n)};this.GetControllerProperties=function(){return{OtherId:t.Item.Properties.OtherId,Number:t.Item.Properties.Number}};this.Highlight=function(n){var t=this.Container.Canvas;this.CanvasItem.setFill(n?"#336699":"#ffffff");t.renderAll()}}function RectangleController(n){this.Item=n;var t=this;this.Build=function(){var i=t.Item,n=new fabric.Rect({fill:"white",width:i.Properties.Width,height:i.Properties.Height});return DesignerItemController.SetProperties(i,n),n.hasControls=n.selectable=this.Mode==DesignerItemController.DesignMode,t.CanvasItem=n,n};this.Transformer=function(){var n=t.CanvasItem;n.width=n.width*n.scaleX;n.height=n.height*n.scaleY;n.scaleX=1;n.scaleY=1;n.angle=BRIX.RoundAngle(n.angle);DesignerItemController.UniformPosition(n);DesignerItemController.UniformSize(n)};this.GetControllerProperties=function(n){return{Width:Math.round(t.CanvasItem.width/n),Height:Math.round(t.CanvasItem.height/n)}}}function CircleController(n){this.Item=n;var t=this;this.Transformer=function(){var n=t.CanvasItem;n.left=DesignerItemController.SnapCoordinate(n.left);n.top=DesignerItemController.SnapCoordinate(n.top)};this.Build=function(){var i=t.Item,n=new fabric.Circle({fill:"white",radius:i.Properties.Diameter/2});DesignerItemController.SetProperties(i,n);n.on("scaling",function(){n.scaleY!=1?n.scaleX=n.scaleY:n.scaleX!=1&&(n.scaleY=n.scaleX)});return n.hasControls=n.selectable=this.Mode==DesignerItemController.DesignMode,t.CanvasItem=n,n};this.Transformer=function(){var i=t.CanvasItem,n;i.radius=i.radius*i.scaleX;i.width=i.width*i.scaleX;i.height=i.height*i.scaleY;i.scaleX=1;i.scaleY=1;n=t.CanvasItem;n.radius=n.radius*i.scaleX;n.width=n.width*n.scaleX;n.height=n.height*n.scaleY;n.scaleX=1;n.scaleY=1;DesignerItemController.UniformPosition(n);n.radius=DesignerItemController.SnapCoordinate(n.radius*2)/2};this.GetControllerProperties=function(n){return{Diameter:t.CanvasItem.radius*2/n}}}function EnumerationElement(n,t){this.Constructor(n,t)}function LayoutElement(n,t){this.Constructor(n,t)}function AirSpaceBooking(n,t,i,r,u){this.BookingId=n;this.ItemId=t;this.Color=new Color(u,"#ffffff");this.Color.IsTransparent&&(this.Color=new Color("#ffffff"));this.Title=DecodeHtml(i).trim();this.Popup=new AirSpacePopup(this.Title,r);this.CanvasObject=null;this.CanvasContainer=null;this.Draggable=!1;this.DropPayload=""}function AirSpacePopup(n,t){this.Title=n;this.Html=t;this.GhostContainer=null;this.MapFunctions=null;this.Draggable=!1;this.DraggableContent=null}function AirWorkspace(n,t,i,r,u){this.Bookings=n.slice();this.OnDragStartCallback=i;this.OnDragEndCallback=r;this.OnDraggingCallback=u;this.SetRules=function(){t()};this.CheckboxName="aschk"+GetNewId();this.Container=null;this.PanelHead=null;this.PanelContent=null;this.Toolbar=null;this.ToolbarSelectionGroup=null;this.MoveallButton=null}function ChartDesignerElement(n,t){this.Constructor(n,t)}function EventAssignerElement(n,t){this.Constructor(n,t)}function AirSeatsBooking(n,t,i,r,u){this.BookingId=n;this.ItemId=t;this.Color=new Color(u,"#ffffff");this.Color.IsTransparent&&(this.Color=new Color("#ffffff"));this.Title=DecodeHtml(i).trim();this.Popup=new AirSpacePopup(this.Title,r);this.CanvasObject=null;this.CanvasContainer=null;this.Draggable=!1;this.DropPayload=""}function AirSeatsWorkspace(n,t,i,r,u,f,e,o,s,h,c){this.Bookings=n.slice();this.SetRules=function(){t()};this.Release=function(){i()};this.ConfirmAssign=function(){r()};this.ShowSeat=function(n){s(n)};this.ClicAndClic=function(){o()};this.ClicAndClicEnabled=e;this.ShowReleaseButton=u;this.ShowConfirmAssignButton=f;this.CheckboxName="aschk"+GetNewId();this.Container=null;this.PanelHead=null;this.PanelContent=null;this.Toolbar=null;this.ToolbarSelectionGroup=null;this.ToolbarToolsGroup=null;this.MoveallButton=null;this.BookingsSelected=[];this.SeatsSelected=[];this.ReleaseCaption=h;this.ConfirmCaption=c}function FindWithAttr(n,t,i){for(var r=0;r<n.length;r+=1)if(n[r][t]===i)return r;return-1}function GridRowElement(n,t){this.Constructor(n,t)}function GridColumnElement(n,t){this.Constructor(n,t)}function TabGroupElement(n,t){this.Constructor(n,t)}function TabElement(n,t){this.Constructor(n,t)}function PanelGroupElement(n,t){this.Constructor(n,t)}function PanelElement(n,t){this.Constructor(n,t);this.IsCollapsible=!0}function ProgressElement(n,t){this.Constructor(n,t)}function BsTableElement(n,t){this.Constructor(n,t)}function ConditionEditorElement(n,t){this.Constructor(n,t)}function ConditionEditorScope(n,t){this.Properties=n;this.Scope=t}function ScopeCondition(n,t,i){this.Container=n;this.Properties=t;this.Condition=i}function TimeoutElement(n,t){this.Constructor(n,t)}function ContextMenu(n,t,i){this.MyClassName="ContextMenu";this.IsManualMenu=i?!0:!1;this.Constructor(n,t);this.IsRootMenu=!0}var ReportCommons,Hashtable,CKCount,CKIdIndex,Mailcheck,popdbg,OnPopStateOldIE,WinDoc,_idTrail,requestIndex,jQueryXPathSelectorConvert,ActiveIconArchive,NoBorder,BlackBorderStyle,WhiteBorderStyle,SpaceBorderStyle,gx,sx,src,CurrentEditorHover,DateFormats,CountryCodes,ElementIndex,IntendedUsage,TimeZoomDay,TimeZoomMonth,ClientResponseParameterName,GlobalMouseTrackingIndex,testX,ActionTypes,srcDragElem,CanvasController,DesignerItemController,BoolEditor;if(window.BrixResponsive=!0,MillimetersToPixels.ToUnitName="Pixels",MillimetersFromPixels.ToUnitName="Millimeters",Object.prototype.hasOwnProperty){function hasOwnProperty(n,t){return n.hasOwnProperty(t)}}Array.prototype.indexOf||(Array.prototype.indexOf=function(n,t){if(this===undefined||this===null)throw new TypeError('"this" is null or not defined');var i=this.length>>>0;for(t=+t||0,Math.abs(t)===Infinity&&(t=0),t<0&&(t+=i,t<0&&(t=0));t<i;t++)if(this[t]===n)return t;return-1});ReportCommons={};ReportCommons.SelectedReportCount=0;Document.prototype.createElementInnerHtml=function(n,t){var i=this.createElement(n);return i.innerHTML=t,i};Document.prototype.createElementIdClass=function(n,t,i){var r=this.createElement(n);return r.id=t,r.addClass(i),r};HTMLElement.prototype.appendNewElementIdClass=function(n,t,i){var r=document.createElementIdClass(n,t,i);return this.appendChild(r),this[t]=r,r};HTMLElement.prototype.appendChildAndGet=function(n){return this.appendChild(n),n};HTMLElement.prototype.hasClass=function(n){return this.className.indexOf(n)!=-1};HTMLElement.prototype.addClass=function(n){if(this.className){var t=this.className.split(" ");t.indexOf(n)===-1&&(t.push(n),this.className=t.join(" "))}else this.className=n};Hashtable=function(){function e(t){var i;if(typeof t=="string")return t;if(typeof t.hashCode==n)return i=t.hashCode(),typeof i=="string"?i:e(i);if(typeof t.toString==n)return t.toString();try{return String(t)}catch(r){return Object.prototype.toString.call(t)}}function y(n,t){return n.equals(t)}function p(t,i){return typeof i.equals==n?i.equals(t):t===i}function o(n){return function(t){if(t===null)throw new Error("null is not a valid "+n);else if(typeof t=="undefined")throw new Error(n+" must not be undefined");}}function r(n,t,i,r){this[0]=n;this.entries=[];this.addEntry(t,i);r!==null&&(this.getEqualityFunction=function(){return r})}function u(n){return function(t){for(var r=this.entries.length,i,u=this.getEqualityFunction(t);r--;)if(i=this.entries[r],u(t,i[0]))switch(n){case h:return!0;case c:return i;case l:return[r,i[1]]}return!1}}function a(n){return function(t){for(var r=t.length,i=0,u=this.entries.length;i<u;++i)t[r+i]=this.entries[i][n]}}function w(n,t){for(var i=n.length,r;i--;)if(r=n[i],t===r[0])return i;return null}function i(n,t){var i=n[t];return i&&i instanceof r?i:null}function v(u,o){var l=this,h=[],c={},a=typeof u==n?u:e,p=typeof o==n?o:null,y;this.put=function(n,u){t(n);s(u);var o=a(n),f,e,l=null;return f=i(c,o),f?(e=f.getEntryForKey(n),e?(l=e[1],e[1]=u):f.addEntry(n,u)):(f=new r(o,n,u,p),h[h.length]=f,c[o]=f),l};this.get=function(n){var f,r,u;return(t(n),f=a(n),r=i(c,f),r&&(u=r.getEntryForKey(n),u))?u[1]:null};this.containsKey=function(n){t(n);var u=a(n),r=i(c,u);return r?r.containsKey(n):!1};this.containsValue=function(n){s(n);for(var t=h.length;t--;)if(h[t].containsValue(n))return!0;return!1};this.clear=function(){h.length=0;c={}};this.isEmpty=function(){return!h.length};y=function(n){return function(){for(var t=[],i=h.length;i--;)h[i][n](t);return t}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(n){t(n);var r=a(n),o,u=null,e=i(c,r);return e&&(u=e.removeEntryForKey(n),u!==null&&(e.entries.length||(o=w(h,r),f(h,o),delete c[r]))),u};this.size=function(){for(var n=0,t=h.length;t--;)n+=h[t].entries.length;return n};this.each=function(n){for(var i=l.entries(),r=i.length,t;r--;)t=i[r],n(t[0],t[1])};this.putAll=function(t,i){for(var e=t.entries(),f,r,u,o,s=e.length,h=typeof i==n;s--;)f=e[s],r=f[0],u=f[1],h&&(o=l.get(r))&&(u=i(r,o,u)),l.put(r,u)};this.clone=function(){var n=new v(u,o);return n.putAll(l),n}}var n="function",f=typeof Array.prototype.splice==n?function(n,t){n.splice(t,1)}:function(n,t){var r,i,u;if(t===n.length-1)n.length=t;else for(r=n.slice(t+1),n.length=t,i=0,u=r.length;i<u;++i)n[t+i]=r[i]},t=o("key"),s=o("value"),h=0,c=1,l=2;return r.prototype={getEqualityFunction:function(t){return typeof t.equals==n?y:p},getEntryForKey:u(c),getEntryAndIndexForKey:u(l),removeEntryForKey:function(n){var t=this.getEntryAndIndexForKey(n);return t?(f(this.entries,t[0]),t[1]):null},addEntry:function(n,t){this.entries[this.entries.length]=[n,t]},keys:a(0),values:a(1),getEntries:function(n){for(var i=n.length,t=0,r=this.entries.length;t<r;++t)n[i+t]=this.entries[t].slice(0)},containsKey:u(h),containsValue:function(n){for(var t=this.entries.length;t--;)if(n===this.entries[t][1])return!0;return!1}},v}();Hashtable.prototype.ForEach=function(n){this.each(function(t,i){n.call(this,t,i)})};CKCount=0;CKIdIndex=1;CKEditorHelper.prototype.CreateToolbar=function(){var r=[],t,u,n,i,f;return this.Allow.BrixLinks=!0,this.Allow.Source&&r.push(["Source"]),this.Allow.Links&&r.push(["Link"]),r.push(["Cut","Copy","PasteText","PasteFromWord","-","Undo","Redo"]),t=[],this.Allow.Bold&&t.push("Bold"),this.Allow.Italic&&t.push("Italic"),this.Allow.Underline&&t.push("Underline"),this.Allow.Strike&&t.push("Strike"),t.push("Subscript"),t.push("Superscript"),t.push("-"),this.Allow.CopyFormatting&&t.push("CopyFormatting"),t.push("RemoveFormat"),r.push(t),u=[],this.Allow.Images&&u.push("Image"),this.Allow.Tables&&u.push("Table"),u.length&&r.push(u),n=[],this.Allow.Lists?(n.push("NumberedList"),n.push("BulletedList"),n.push("-")):CKEDITOR.config.disallowedContent="ol ul li",this.Allow.Indention&&(n.push("Outdent"),n.push("Indent"),n.push("-")),this.Allow.Justification&&(n.push("JustifyLeft"),n.push("JustifyCenter"),n.push("JustifyRight"),n.push("JustifyBlock")),n.length&&r.push(n),i=[],this.Allow.Formats&&i.push("Format"),this.Allow.Fonts&&i.push("Font"),this.Allow.FontSize&&i.push("FontSize"),this.Allow.TextColor&&(i.length>0&&i.push("-"),i.push("TextColor")),this.Allow.BackgroundColor&&i.push("BGColor"),i.length>0&&r.push(i),f=[],this.Allow.BrixLinks&&f.push("BrixLinks"),this.Allow.BrixVariables&&f.push("BrixVariables"),f.length>0&&r.push(f),r};CKEditorHelper.prototype.SetupConfig=function(n){if(n.contentsCss="/Content/css/CustomContentsEditor.css",n.resize_enabled=!1,n.removePlugins="elementspath",this.Allow.OnlyText)n.forcePasteAsPlainText=!0,n.toolbar=[["BrixVariables"]],this.BrixElement.CharacterCounter&&n.toolbar[0].push("brixcharcounter");else{var t=this.CreateToolbar();n.toolbar=t}n.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px;100/100px;130/130px;";n.font_names="Arial/Arial, Helvetica, sans-serif;Calibri/Calibri, Verdana, Geneva, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";n.fillEmptyBlocks=!0;n.startupFocus=!0;this.Allow.NoClasses?(n.allowedContent=!1,n.extraAllowedContent="td{*}[*](*);th{*}[*](*);span[*](!AirSource);p{line-height};*(*)[id];*(*)[data-*];"):(n.allowedContent=!1,n.extraAllowedContent="td{*}[*](*);th{*}[*](*);span[*](!AirSource);p{line-height};*(*);audio[*](*);source[*](*);video[*](*);*(*)[id];*(*)[data-*];");n.disableNativeSpellChecker=!1;this.BrixElement.HideTableShadowLines&&(n.startupShowBorders=!1)};CKEditorHelper.prototype.StartCKEditFrame=function(n,t){var f=this.DomElement,u=this.BrixElement,i=null,r;if(!f.IsBeingEdited){if(CKEDITOR.addCss("p{\tmargin: 8px 0px;}"),CKEDITOR.plugins.addExternal("brixlinks",Script3rdPartyBasePath+"ckeditor/plugins/brixlinks/plugin.js"),CKEDITOR.plugins.addExternal("brixvariables",Script3rdPartyBasePath+"ckeditor/plugins/brixvariables/plugin.js"),CKEDITOR.plugins.addExternal("limitcontentsize",Script3rdPartyBasePath+"ckeditor/plugins/limitcontentsize/plugin.js"),CKEDITOR.plugins.addExternal("brixcharcounter",Script3rdPartyBasePath+"ckeditor/plugins/brixcharcounter/plugin.js"),i=CKEDITOR.replace(f,{filebrowserUploadUrl:"CKEditor/Upload"}),this.SetupConfig(i.config),r=[],u.PickVariable&&r.push("brixvariables"),u.Links&&u.Links.length>0&&r.push("brixlinks"),r.push("limitcontentsize"),u.CharacterCounter&&r.push("brixcharcounter"),u.BackgroundColor&&r.push("colorbutton"),i.config.extraPlugins=r.join(","),i.BrixElement=u,t)i.on("instanceReady",function(){t()});CKEDITOR.on("dialogDefinition",function(n){n.data.name=="link"&&(n.data.definition.getContents("target").get("linkTargetType")["default"]="_blank")});i.on("blur",function(){});i.on("destroy",function(){n&&n()});i.on("resize",function(){var n=new LayerSize(i.container.$),t;f.style.height=n.Height+"px";t=i})}return i};CKEditorMenuInjection.prototype.InjectSourcePicker=function(n){var u=this.IconPath,t=this.Editor,r,i;t.contextMenu&&(t.addMenuGroup("air"),r={},this.AppendItemCollection(r,n),i={},i[n.Id]=CKEDITOR.TRISTATE_ON,t.contextMenu&&t.contextMenu.addListener(function(){return i}))};CKEditorMenuInjection.prototype.WalkMenuTree=function(n,t,i){for(var r=i.FirstChild;r;)r.MyClassName=="EventMenuItem"&&this.AppendItem(t,r),r.MyClassName=="Menu"&&this.AppendItemCollection(t,r),r=r.NextSibling};CKEditorMenuInjection.prototype.AppendItem=function(n,t){var f=t.Events.GetEventByActionType(ActionTypes.PickValue),r=t.Id,u="airInsertSource_"+r,i;n[r]=CKEDITOR.TRISTATE_ON;i={};i.label=t.Caption;i.icon=this.IconPath;i.group="air";i.command=u;this.Editor.addMenuItem(r,i);this.Editor.addCommand(u,{exec:function(n){var i=document.createElement("span"),r;i.className="AirSource";i.setAttribute("airsource",f.Action.Value);i.appendChild(document.createTextNode(t.Caption));r=new CKEDITOR.dom.element(i);n.insertElement(r)}})};CKEditorMenuInjection.prototype.AppendItemCollection=function(n,t){var r=t.Id,u={},i;n[r]=CKEDITOR.TRISTATE_ON;i={};i.label=t.Caption;i.icon=this.IconPath;i.group="air";i.getItems=function(){return u};this.Editor.addMenuItem(r,i);this.WalkMenuTree(r,u,t)};typeof JSON!="object"&&(JSON={}),function(){"use strict";function i(n){return n<10?"0"+n:n}function o(n){return u.lastIndex=0,u.test(n)?'"'+n.replace(u,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function e(i,r){var s,l,h,a,v=n,c,u=r[i];u&&typeof u=="object"&&typeof u.toJSON=="function"&&(u=u.toJSON(i));typeof t=="function"&&(u=t.call(r,i,u));switch(typeof u){case"string":return o(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(n+=f,c=[],Object.prototype.toString.apply(u)==="[object Array]"){for(a=u.length,s=0;s<a;s+=1)c[s]=e(s,u)||"null";return h=c.length===0?"[]":n?"[\n"+n+c.join(",\n"+n)+"\n"+v+"]":"["+c.join(",")+"]",n=v,h}if(t&&typeof t=="object")for(a=t.length,s=0;s<a;s+=1)typeof t[s]=="string"&&(l=t[s],h=e(l,u),h&&c.push(o(l)+(n?": ":":")+h));else for(l in u)Object.prototype.hasOwnProperty.call(u,l)&&(h=e(l,u),h&&c.push(o(l)+(n?": ":":")+h));return h=c.length===0?"{}":n?"{\n"+n+c.join(",\n"+n)+"\n"+v+"}":"{"+c.join(",")+"}",n=v,h}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var r,u,n,f,s,t;typeof JSON.stringify!="function"&&(u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(i,r,u){var o;if(n="",f="",typeof u=="number")for(o=0;o<u;o+=1)f+=" ";else typeof u=="string"&&(f=u);if(t=r,r&&typeof r!="function"&&(typeof r!="object"||typeof r.length!="number"))throw new Error("JSON.stringify");return e("",{"":i})});typeof JSON.parse!="function"&&(r=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,JSON.parse=function(text,reviver){function walk(n,t){var r,u,i=n[t];if(i&&typeof i=="object")for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(u=walk(i,r),u!==undefined?i[r]=u:delete i[r]);return reviver.call(n,t,i)}var j;if(text=String(text),r.lastIndex=0,r.test(text)&&(text=text.replace(r,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse");})}();!function(){var o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this||{},dt=o._,l=Array.prototype,p=Object.prototype,it="undefined"!=typeof Symbol?Symbol.prototype:null,gt=l.push,s=l.slice,h=p.toString,rt=p.hasOwnProperty,ni=Array.isArray,ut=Object.keys,ft=Object.create,w=function(){},n=function(t){return t instanceof n?t:this instanceof n?void(this._wrapped=t):new n(t)},et,e,t,k,c,ht,f,d,g,nt,a,v,vt,yt,pt,kt,y;"undefined"==typeof exports||exports.nodeType?o._=n:("undefined"!=typeof module&&!module.nodeType&&module.exports&&(exports=module.exports=n),exports._=n);n.VERSION="1.9.0";e=function(n,t,i){if(void 0===t)return n;switch(null==i?3:i){case 1:return function(i){return n.call(t,i)};case 3:return function(i,r,u){return n.call(t,i,r,u)};case 4:return function(i,r,u,f){return n.call(t,i,r,u,f)}}return function(){return n.apply(t,arguments)}};t=function(t,i,r){return n.iteratee!==et?n.iteratee(t,i):null==t?n.identity:n.isFunction(t)?e(t,i,r):n.isObject(t)&&!n.isArray(t)?n.matcher(t):n.property(t)};n.iteratee=et=function(n,i){return t(n,i,1/0)};var r=function(n,t){return t=null==t?n.length-1:+t,function(){for(var u,f=Math.max(arguments.length-t,0),r=Array(f),i=0;i<f;i++)r[i]=arguments[i+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r);case 2:return n.call(this,arguments[0],arguments[1],r)}for(u=Array(t+1),i=0;i<t;i++)u[i]=arguments[i];return u[t]=r,n.apply(this,u)}},ot=function(t){if(!n.isObject(t))return{};if(ft)return ft(t);w.prototype=t;var i=new w;return w.prototype=null,i},st=function(n){return function(t){if(null!=t)return t[n]}},b=function(n,t){for(var r=t.length,i=0;i<r;i++){if(null==n)return;n=n[t[i]]}if(r)return n},ti=Math.pow(2,53)-1,u=st("length"),i=function(n){var t=u(n);return"number"==typeof t&&0<=t&&t<=ti};n.each=n.forEach=function(t,r,u){var f,o,s;if(r=e(r,u),i(t))for(f=0,o=t.length;f<o;f++)r(t[f],f,t);else for(s=n.keys(t),f=0,o=s.length;f<o;f++)r(t[s[f]],s[f],t);return t};n.map=n.collect=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,c=Array(h),e=0;e<h;e++)s=o?o[e]:e,c[e]=u(r[s],s,r);return c};k=function(t){return function(r,u,f,o){var s=3<=arguments.length;return function(r,u,f,e){var s=!i(r)&&n.keys(r),c=(s||r).length,o=0<t?0:c-1,h;for(e||(f=r[s?s[o]:o],o+=t);0<=o&&o<c;o+=t)h=s?s[o]:o,f=u(f,r[h],h,r);return f}(r,e(u,o,4),f,s)}};n.reduce=n.foldl=n.inject=k(1);n.reduceRight=n.foldr=k(-1);n.find=n.detect=function(t,r,u){var f=(i(t)?n.findIndex:n.findKey)(t,r,u);if(void 0!==f&&-1!==f)return t[f]};n.filter=n.select=function(i,r,u){var f=[];return r=t(r,u),n.each(i,function(n,t,i){r(n,t,i)&&f.push(n)}),f};n.reject=function(i,r,u){return n.filter(i,n.negate(t(r)),u)};n.every=n.all=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;e<h;e++)if(s=o?o[e]:e,!u(r[s],s,r))return!1;return!0};n.some=n.any=function(r,u,f){var s;u=t(u,f);for(var o=!i(r)&&n.keys(r),h=(o||r).length,e=0;e<h;e++)if(s=o?o[e]:e,u(r[s],s,r))return!0;return!1};n.contains=n.includes=n.include=function(t,r,u,f){return i(t)||(t=n.values(t)),("number"!=typeof u||f)&&(u=0),0<=n.indexOf(t,r,u)};n.invoke=r(function(t,i,r){var u,f;return n.isFunction(i)?f=i:n.isArray(i)&&(u=i.slice(0,-1),i=i[i.length-1]),n.map(t,function(n){var t=f;if(!t){if(u&&u.length&&(n=b(n,u)),null==n)return;t=n[i]}return null==t?t:t.apply(n,r)})});n.pluck=function(t,i){return n.map(t,n.property(i))};n.where=function(t,i){return n.filter(t,n.matcher(i))};n.findWhere=function(t,i){return n.find(t,n.matcher(i))};n.max=function(r,u,f){var h,o,e=-1/0,c=-1/0,s,l;if(null==u||"number"==typeof u&&"object"!=typeof r[0]&&null!=r)for(s=0,l=(r=i(r)?r:n.values(r)).length;s<l;s++)null!=(h=r[s])&&e<h&&(e=h);else u=t(u,f),n.each(r,function(n,t,i){o=u(n,t,i);(c<o||o===-1/0&&e===-1/0)&&(e=n,c=o)});return e};n.min=function(r,u,f){var s,h,e=1/0,c=1/0,o,l;if(null==u||"number"==typeof u&&"object"!=typeof r[0]&&null!=r)for(o=0,l=(r=i(r)?r:n.values(r)).length;o<l;o++)null!=(s=r[o])&&s<e&&(e=s);else u=t(u,f),n.each(r,function(n,t,i){((h=u(n,t,i))<c||h===1/0&&e===1/0)&&(e=n,c=h)});return e};n.shuffle=function(t){return n.sample(t,1/0)};n.sample=function(t,r,f){var e,s,c,o,h,l;if(null==r||f)return i(t)||(t=n.values(t)),t[n.random(t.length-1)];for(e=i(t)?n.clone(t):n.values(t),s=u(e),r=Math.max(Math.min(r,s),0),c=s-1,o=0;o<r;o++)h=n.random(o,c),l=e[o],e[o]=e[h],e[h]=l;return e.slice(0,r)};n.sortBy=function(i,r,u){var f=0;return r=t(r,u),n.pluck(n.map(i,function(n,t,i){return{value:n,index:f++,criteria:r(n,t,i)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;if(i!==r){if(r<i||void 0===i)return 1;if(i<r||void 0===r)return-1}return n.index-t.index}),"value")};c=function(i,r){return function(u,f,e){var o=r?[[],[]]:{};return f=t(f,e),n.each(u,function(n,t){var r=f(n,t,u);i(o,n,r)}),o}};n.groupBy=c(function(t,i,r){n.has(t,r)?t[r].push(i):t[r]=[i]});n.indexBy=c(function(n,t,i){n[i]=t});n.countBy=c(function(t,i,r){n.has(t,r)?t[r]++:t[r]=1});ht=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;n.toArray=function(t){return t?n.isArray(t)?s.call(t):n.isString(t)?t.match(ht):i(t)?n.map(t,n.identity):n.values(t):[]};n.size=function(t){return null==t?0:i(t)?t.length:n.keys(t).length};n.partition=c(function(n,t,i){n[i?0:1].push(t)},!0);n.first=n.head=n.take=function(t,i,r){if(!(null==t||t.length<1))return null==i||r?t[0]:n.initial(t,t.length-i)};n.initial=function(n,t,i){return s.call(n,0,Math.max(0,n.length-(null==t||i?1:t)))};n.last=function(t,i,r){if(!(null==t||t.length<1))return null==i||r?t[t.length-1]:n.rest(t,Math.max(0,t.length-i))};n.rest=n.tail=n.drop=function(n,t,i){return s.call(n,null==t||i?1:t)};n.compact=function(t){return n.filter(t,Boolean)};f=function(t,r,e,o){for(var s,l,a,h=(o=o||[]).length,c=0,v=u(t);c<v;c++)if(s=t[c],i(s)&&(n.isArray(s)||n.isArguments(s)))if(r)for(l=0,a=s.length;l<a;)o[h++]=s[l++];else f(s,r,e,o),h=o.length;else e||(o[h++]=s);return o};n.flatten=function(n,t){return f(n,t,!1)};n.without=r(function(t,i){return n.difference(t,i)});n.uniq=n.unique=function(i,r,f,e){var o,c;n.isBoolean(r)||(e=f,f=r,r=!1);null!=f&&(f=t(f,e));for(var s=[],l=[],h=0,a=u(i);h<a;h++)o=i[h],c=f?f(o,h,i):o,r&&!f?(h&&l===c||s.push(o),l=c):f?n.contains(l,c)||(l.push(c),s.push(o)):n.contains(s,o)||s.push(o);return s};n.union=r(function(t){return n.uniq(f(t,!0,!0))});n.intersection=function(t){for(var r,i,f=[],o=arguments.length,e=0,s=u(t);e<s;e++)if(r=t[e],!n.contains(f,r)){for(i=1;i<o&&n.contains(arguments[i],r);i++);i===o&&f.push(r)}return f};n.difference=r(function(t,i){return i=f(i,!0,!0),n.filter(t,function(t){return!n.contains(i,t)})});n.unzip=function(t){for(var r=t&&n.max(t,u).length||0,f=Array(r),i=0;i<r;i++)f[i]=n.pluck(t,i);return f};n.zip=r(n.unzip);n.object=function(n,t){for(var r={},i=0,f=u(n);i<f;i++)t?r[n[i]]=t[i]:r[n[i][0]]=n[i][1];return r};d=function(n){return function(i,r,f){r=t(r,f);for(var o=u(i),e=0<n?0:o-1;0<=e&&e<o;e+=n)if(r(i[e],e,i))return e;return-1}};n.findIndex=d(1);n.findLastIndex=d(-1);n.sortedIndex=function(n,i,r,f){for(var o,h=(r=t(r,f,1))(i),e=0,s=u(n);e<s;)o=Math.floor((e+s)/2),r(n[o])<h?e=o+1:s=o;return e};g=function(t,i,r){return function(f,e,o){var c=0,h=u(f);if("number"==typeof o)0<t?c=0<=o?o:Math.max(o+h,c):h=0<=o?Math.min(o+1,h):o+h+1;else if(r&&o&&h)return f[o=r(f,e)]===e?o:-1;if(e!=e)return 0<=(o=i(s.call(f,c,h),n.isNaN))?o+c:-1;for(o=0<t?c:h-1;0<=o&&o<h;o+=t)if(f[o]===e)return o;return-1}};n.indexOf=g(1,n.findIndex,n.sortedIndex);n.lastIndexOf=g(-1,n.findLastIndex);n.range=function(n,t,i){null==t&&(t=n||0,n=0);i||(i=t<n?-1:1);for(var u=Math.max(Math.ceil((t-n)/i),0),f=Array(u),r=0;r<u;r++,n+=i)f[r]=n;return f};n.chunk=function(n,t){if(null==t||t<1)return[];for(var r=[],i=0,u=n.length;i<u;)r.push(s.call(n,i,i+=t));return r};nt=function(t,i,r,u,f){if(!(u instanceof i))return t.apply(r,f);var e=ot(t.prototype),o=t.apply(e,f);return n.isObject(o)?o:e};n.bind=r(function(t,i,u){if(!n.isFunction(t))throw new TypeError("Bind must be called on a function");var f=r(function(n){return nt(t,f,i,this,u.concat(n))});return f});n.partial=r(function(t,i){var u=n.partial.placeholder,r=function(){for(var f=0,o=i.length,e=Array(o),n=0;n<o;n++)e[n]=i[n]===u?arguments[f++]:i[n];for(;f<arguments.length;)e.push(arguments[f++]);return nt(t,r,this,this,e)};return r});(n.partial.placeholder=n).bindAll=r(function(t,i){var r=(i=f(i,!1,!1)).length,u;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;)u=i[r],t[u]=n.bind(t[u],t)});n.memoize=function(t,i){var r=function(u){var f=r.cache,e=""+(i?i.apply(this,arguments):u);return n.has(f,e)||(f[e]=t.apply(this,arguments)),f[e]};return r.cache={},r};n.delay=r(function(n,t,i){return setTimeout(function(){return n.apply(null,i)},t)});n.defer=n.partial(n.delay,n,1);n.throttle=function(t,i,r){var u,f,e,s,o=0,c,h;return r||(r={}),c=function(){o=!1===r.leading?0:n.now();u=null;s=t.apply(f,e);u||(f=e=null)},h=function(){var l=n.now(),h;return o||!1!==r.leading||(o=l),h=i-(l-o),f=this,e=arguments,h<=0||i<h?(u&&(clearTimeout(u),u=null),o=l,s=t.apply(f,e),u||(f=e=null)):u||!1===r.trailing||(u=setTimeout(c,h)),s},h.cancel=function(){clearTimeout(u);o=0;u=f=e=null},h};n.debounce=function(t,i,u){var f,e,o=function(n,i){f=null;i&&(e=t.apply(n,i))},s=r(function(r){if(f&&clearTimeout(f),u){var s=!f;f=setTimeout(o,i);s&&(e=t.apply(this,r))}else f=n.delay(o,i,this,r);return e});return s.cancel=function(){clearTimeout(f);f=null},s};n.wrap=function(t,i){return n.partial(i,t)};n.negate=function(n){return function(){return!n.apply(this,arguments)}};n.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,i=n[t].apply(this,arguments);r--;)i=n[r].call(this,i);return i}};n.after=function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}};n.before=function(n,t){var i;return function(){return 0<--n&&(i=t.apply(this,arguments)),n<=1&&(t=null),i}};n.once=n.partial(n.before,2);n.restArguments=r;var ct=!{toString:null}.propertyIsEnumerable("toString"),lt=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],at=function(t,i){var u=lt.length,f=t.constructor,e=n.isFunction(f)&&f.prototype||p,r="constructor";for(n.has(t,r)&&!n.contains(i,r)&&i.push(r);u--;)(r=lt[u])in t&&t[r]!==e[r]&&!n.contains(i,r)&&i.push(r)};n.keys=function(t){var i,r;if(!n.isObject(t))return[];if(ut)return ut(t);i=[];for(r in t)n.has(t,r)&&i.push(r);return ct&&at(t,i),i};n.allKeys=function(t){var i,r;if(!n.isObject(t))return[];i=[];for(r in t)i.push(r);return ct&&at(t,i),i};n.values=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;i<u;i++)f[i]=t[r[i]];return f};n.mapObject=function(i,r,u){var f;r=t(r,u);for(var o=n.keys(i),h=o.length,s={},e=0;e<h;e++)f=o[e],s[f]=r(i[f],f,i);return s};n.pairs=function(t){for(var r=n.keys(t),u=r.length,f=Array(u),i=0;i<u;i++)f[i]=[r[i],t[r[i]]];return f};n.invert=function(t){for(var u={},r=n.keys(t),i=0,f=r.length;i<f;i++)u[t[r[i]]]=r[i];return u};n.functions=n.methods=function(t){var i=[];for(var r in t)n.isFunction(t[r])&&i.push(r);return i.sort()};a=function(n,t){return function(i){var e=arguments.length,r,u;if(t&&(i=Object(i)),e<2||null==i)return i;for(r=1;r<e;r++)for(var o=arguments[r],s=n(o),h=s.length,f=0;f<h;f++)u=s[f],t&&void 0!==i[u]||(i[u]=o[u]);return i}};n.extend=a(n.allKeys);n.extendOwn=n.assign=a(n.keys);n.findKey=function(i,r,u){r=t(r,u);for(var f,o=n.keys(i),e=0,s=o.length;e<s;e++)if(r(i[f=o[e]],f,i))return f};yt=function(n,t,i){return t in i};n.pick=r(function(t,i){var s={},r=i[0],u,c,o,h;if(null==t)return s;for(n.isFunction(r)?(1<i.length&&(r=e(r,i[1])),i=n.allKeys(t)):(r=yt,i=f(i,!1,!1),t=Object(t)),u=0,c=i.length;u<c;u++)o=i[u],h=t[o],r(h,o,t)&&(s[o]=h);return s});n.omit=r(function(t,i){var u,r=i[0];return n.isFunction(r)?(r=n.negate(r),1<i.length&&(u=i[1])):(i=n.map(f(i,!1,!1),String),r=function(t,r){return!n.contains(i,r)}),n.pick(t,r,u)});n.defaults=a(n.allKeys,!0);n.create=function(t,i){var r=ot(t);return i&&n.extendOwn(r,i),r};n.clone=function(t){return n.isObject(t)?n.isArray(t)?t.slice():n.extend({},t):t};n.tap=function(n,t){return t(n),n};n.isMatch=function(t,i){var e=n.keys(i),o=e.length,f,r,u;if(null==t)return!o;for(f=Object(t),r=0;r<o;r++)if(u=e[r],i[u]!==f[u]||!(u in f))return!1;return!0};v=function(n,t,i,r){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return!1;if(n!=n)return t!=t;var u=typeof n;return("function"===u||"object"===u||"object"==typeof t)&&vt(n,t,i,r)};vt=function(t,i,r,u){var s,l,e,o,f,c,a;if(t instanceof n&&(t=t._wrapped),i instanceof n&&(i=i._wrapped),s=h.call(t),s!==h.call(i))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+t==""+i;case"[object Number]":return+t!=+t?+i!=+i:0==+t?1/+t==1/i:+t==+i;case"[object Date]":case"[object Boolean]":return+t==+i;case"[object Symbol]":return it.valueOf.call(t)===it.valueOf.call(i)}if(l="[object Array]"===s,!l&&("object"!=typeof t||"object"!=typeof i||(e=t.constructor,o=i.constructor,e!==o&&!(n.isFunction(e)&&e instanceof e&&n.isFunction(o)&&o instanceof o)&&"constructor"in t&&"constructor"in i)))return!1;for(u=u||[],f=(r=r||[]).length;f--;)if(r[f]===t)return u[f]===i;if(r.push(t),u.push(i),l){if((f=t.length)!==i.length)return!1;for(;f--;)if(!v(t[f],i[f],r,u))return!1}else{if(a=n.keys(t),f=a.length,n.keys(i).length!==f)return!1;for(;f--;)if(c=a[f],!n.has(i,c)||!v(t[c],i[c],r,u))return!1}return r.pop(),u.pop(),!0};n.isEqual=function(n,t){return v(n,t)};n.isEmpty=function(t){return null==t||(i(t)&&(n.isArray(t)||n.isString(t)||n.isArguments(t))?0===t.length:0===n.keys(t).length)};n.isElement=function(n){return!(!n||1!==n.nodeType)};n.isArray=ni||function(n){return"[object Array]"===h.call(n)};n.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n};n.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){n["is"+t]=function(n){return h.call(n)==="[object "+t+"]"}});n.isArguments(arguments)||(n.isArguments=function(t){return n.has(t,"callee")});pt=o.document&&o.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof pt&&(n.isFunction=function(n){return"function"==typeof n||!1});n.isFinite=function(t){return!n.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))};n.isNaN=function(t){return n.isNumber(t)&&isNaN(t)};n.isBoolean=function(n){return!0===n||!1===n||"[object Boolean]"===h.call(n)};n.isNull=function(n){return null===n};n.isUndefined=function(n){return void 0===n};n.has=function(t,i){var u,r,f;if(!n.isArray(i))return null!=t&&rt.call(t,i);for(u=i.length,r=0;r<u;r++){if(f=i[r],null==t||!rt.call(t,f))return!1;t=t[f]}return!!u};n.noConflict=function(){return o._=dt,this};n.identity=function(n){return n};n.constant=function(n){return function(){return n}};n.noop=function(){};n.property=function(t){return n.isArray(t)?function(n){return b(n,t)}:st(t)};n.propertyOf=function(t){return null==t?function(){}:function(i){return n.isArray(i)?b(t,i):t[i]}};n.matcher=n.matches=function(t){return t=n.extendOwn({},t),function(i){return n.isMatch(i,t)}};n.times=function(n,t,i){var u=Array(Math.max(0,n)),r;for(t=e(t,i,1),r=0;r<n;r++)u[r]=t(r);return u};n.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};n.now=Date.now||function(){return(new Date).getTime()};var wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},ii=n.invert(wt),bt=function(t){var r=function(n){return t[n]},i="(?:"+n.keys(t).join("|")+")",u=RegExp(i),f=RegExp(i,"g");return function(n){return n=null==n?"":""+n,u.test(n)?n.replace(f,r):n}};n.escape=bt(wt);n.unescape=bt(ii);n.result=function(t,i,r){var e,f,u;if(n.isArray(i)||(i=[i]),e=i.length,!e)return n.isFunction(r)?r.call(t):r;for(f=0;f<e;f++)u=null==t?void 0:t[i[f]],void 0===u&&(u=r,f=e),t=n.isFunction(u)?u.call(t):u;return t};kt=0;n.uniqueId=function(n){var t=++kt+"";return n?n+t:t};n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var tt=/(.)^/,ri={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ui=/\\|'|\r|\n|\u2028|\u2029/g,fi=function(n){return"\\"+ri[n]};n.template=function(t,i,r){var f,s;!i&&r&&(i=r);i=n.defaults({},i,n.templateSettings);var e,h=RegExp([(i.escape||tt).source,(i.interpolate||tt).source,(i.evaluate||tt).source].join("|")+"|$","g"),o=0,u="__p+='";t.replace(h,function(n,i,r,f,e){return u+=t.slice(o,e).replace(ui,fi),o=e+n.length,i?u+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":r?u+="'+\n((__t=("+r+"))==null?'':__t)+\n'":f&&(u+="';\n"+f+"\n__p+='"),n});u+="';\n";i.variable||(u="with(obj||{}){\n"+u+"}\n");u="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+u+"return __p;\n";try{e=new Function(i.variable||"obj","_",u)}catch(i){throw i.source=u,i;}return f=function(t){return e.call(this,t,n)},s=i.variable||"obj",f.source="function("+s+"){\n"+u+"}",f};n.chain=function(t){var i=n(t);return i._chain=!0,i};y=function(t,i){return t._chain?n(i).chain():i};n.mixin=function(t){return n.each(n.functions(t),function(i){var r=n[i]=t[i];n.prototype[i]=function(){var t=[this._wrapped];return gt.apply(t,arguments),y(this,r.apply(n,t))}}),n};n.mixin(n);n.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var i=l[t];n.prototype[t]=function(){var n=this._wrapped;return i.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],y(this,n)}});n.each(["concat","join","slice"],function(t){var i=l[t];n.prototype[t]=function(){return y(this,i.apply(this._wrapped,arguments))}});n.prototype.value=function(){return this._wrapped};n.prototype.valueOf=n.prototype.toJSON=n.prototype.value;n.prototype.toString=function(){return String(this._wrapped)};"function"==typeof define&&define.amd&&define("underscore",[],function(){return n})}();Mailcheck={domainThreshold:4,topLevelThreshold:3,defaultDomains:"yahoo.com google.com hotmail.com gmail.com me.com aol.com mac.com live.com comcast.net googlemail.com msn.com hotmail.co.uk yahoo.co.uk facebook.com verizon.net sbcglobal.net att.net gmx.com mail.com outlook.com icloud.com".split(" "),defaultTopLevelDomains:"co.jp co.uk com net org info edu gov mil ca".split(" "),run:function(n){n.domains=n.domains||Mailcheck.defaultDomains;n.topLevelDomains=n.topLevelDomains||Mailcheck.defaultTopLevelDomains;n.distanceFunction=n.distanceFunction||Mailcheck.sift3Distance;var t=function(n){return n},i=n.suggested||t,t=n.empty||t;return(n=Mailcheck.suggest(Mailcheck.encodeEmail(n.email),n.domains,n.topLevelDomains,n.distanceFunction))?i(n):t()},suggest:function(n,t,i,r){if(n=n.toLowerCase(),n=this.splitEmail(n),t=this.findClosestDomain(n.domain,t,r,this.domainThreshold)){if(t!=n.domain)return{address:n.address,domain:t,full:n.address+"@"+t}}else if(i=this.findClosestDomain(n.topLevelDomain,i,r,this.topLevelThreshold),n.domain&&i&&i!=n.topLevelDomain)return r=n.domain,t=r.substring(0,r.lastIndexOf(n.topLevelDomain))+i,{address:n.address,domain:t,full:n.address+"@"+t};return!1},findClosestDomain:function(n,t,i,r){var o,f,e,u;if(r=r||this.topLevelThreshold,f=99,e=null,!n||!t)return!1;for(i||(i=this.sift3Distance),u=0;u<t.length;u++){if(n===t[u])return n;o=i(n,t[u]);o<f&&(f=o,e=t[u])}return f<=r&&null!==e?e:!1},sift3Distance:function(n,t){var r;if(null==n||0===n.length)return null==t||0===t.length?0:t.length;if(null==t||0===t.length)return n.length;for(var i=0,u=0,f=0,e=0;i+u<n.length&&i+f<t.length;){if(n.charAt(i+u)==t.charAt(i+f))e++;else for(r=f=u=0;5>r;r++){if(i+r<n.length&&n.charAt(i+r)==t.charAt(i)){u=r;break}if(i+r<t.length&&n.charAt(i)==t.charAt(i+r)){f=r;break}}i++}return(n.length+t.length)/2-e},splitEmail:function(n){var t;if(n=n.trim().split("@"),2>n.length)return!1;for(t=0;t<n.length;t++)if(""===n[t])return!1;var u=n.pop(),i=u.split("."),r="";if(0==i.length)return!1;if(1==i.length)r=i[0];else{for(t=1;t<i.length;t++)r+=i[t]+".";2<=i.length&&(r=r.substring(0,r.length-1))}return{topLevelDomain:r,domain:u,address:n.join("@")}},encodeEmail:function(n){return n=encodeURI(n),n.replace("%20"," ").replace("%25","%").replace("%5E","^").replace("%60","`").replace("%7B","{").replace("%7C","|").replace("%7D","}")}};"undefined"!=typeof module&&module.exports&&(module.exports=Mailcheck);"undefined"!=typeof window&&window.jQuery&&function(n){n.fn.mailcheck=function(n){var t=this,i,r;n.suggested&&(i=n.suggested,n.suggested=function(n){i(t,n)});n.empty&&(r=n.empty,n.empty=function(){r.call(null,t)});n.email=this.val();Mailcheck.run(n)}}(jQuery);Mailcheck.defaultDomains.push("live.se","hotmail.se","hm.com");Mailcheck.defaultTopLevelDomains.push("se","no");Size.prototype.Copy=function(){return new Size(this.Width,this.Height,this.Unit)};Size.prototype.ResizeIncrementally=function(n,t){this.Width+=n;this.Height+=t;this.Width<32&&(this.Width=32);this.Height<32&&(this.Height=32)};Size.prototype.Serialize=function(n){n["coordinates.size.width"]=Math.round(this.Width);n["coordinates.size.height"]=Math.round(this.Height);this.Unit&&(n["coordinates.position.unit"]=this.Unit)};Size.prototype.Deserialize=function(n){var t=n.selectSingleNode("Size");this.Width=new Number(t.getAttribute("width")||0);this.Height=new Number(t.getAttribute("height")||0);this.Unit=t.getAttribute("unit")};Size.prototype.ConvertToUnits=function(n){n.ToUnitName&&n.ToUnitName!=this.Unit&&(this.Width=n(this.Width),this.Height=n(this.Height),this.Unit=n.ToUnitName)};Size.prototype.FillsWidth=function(){return this.Width==this.Fill};Size.prototype.FillsHeight=function(){return this.Height==this.Fill};Size.prototype.SetDomSize=function(n){n.style.width=this.GetDomWidth();n.style.height=this.GetDomHeight()};Size.prototype.GetDomWidth=function(){return this.FillsWidth()?"100%":this.Width+"px"};Size.prototype.GetDomHeight=function(){return this.FillsHeight()?"100%":this.Height+"px"};var RootPath="/",ResourceBasePath=RootPath+"Content/",CssBasePath=ResourceBasePath+"css/",ScriptBasePath=RootPath+"Scripts/Brix/",Script3rdPartyBasePath=ScriptBasePath+"3rd-party/",GraphicsBasePath=ResourceBasePath+"graphics/",MacroBasePath=RootPath+"Macro/Start/",UploadBasePath=RootPath+"api/upload/",LoadingImagePath=GraphicsBasePath+"loading2.gif",ClientOperationNodeName="ClientOperation",ClientOperationContentNodeName="Content",OnEachResult={Continue:0,BreakBranch:1,BreakTree:2},WorkflowValueName={};WorkflowValueName.TriggerElementId="_trg_elm_id";WorkflowValueName.ElementClass="_element_class";WorkflowValueName.ElementName="_element_name";WorkflowValueName.Source="_source";WorkflowValueName.Block="_block_id";WorkflowValueName.Language="_language";WorkflowValueName.Offset="_offset";WorkflowValueName.Content="_content";WorkflowValueName.DroppedOnObjectType="_dropped_on_object_type";WorkflowValueName.DroppedOnObjectId="_dropped_on_object_id";WorkflowValueName.DroppedOnObjectTag="_dropped_on_object_tag";WorkflowValueName.DroppedObjectType="_dropped_object_type";WorkflowValueName.DroppedObjectId="_dropped_object_id";WorkflowValueName.DroppedObjectTag="_dropped_object_tag";WorkflowValueName.DroppedArea="_dnd_area";WorkflowValueName.ElementId="_element_id";WorkflowValueName.CallingElement="_calling_element";WorkflowValueName.MacroCallbackKey="_macro_callback";WorkflowValueName.SelectedCells="_entry";WorkflowValueName.CancelMacro="_cancelmacro";WorkflowValueName.MacroInstance="_macroinstance";WorkflowValueName.SequenceTrack="_sequence_track";WorkflowValueName.SequenceTrackType="_sequence_track_type";WorkflowValueName.CreatedElement="_created_element";WorkflowValueName.CreatedSubElement="_created_sub_element";WorkflowValueName.OptionsName="_options_name";WorkflowValueName.ResumeFromPause="_resume";WorkflowValueName.ElementTag="_element_tag";WorkflowValueName.ContextElementId="context_element_id";WorkflowValueName.ContextElementName="context_element_name";WorkflowValueName.PickedValue="_picked_value";WorkflowValueName.Url="_url";WorkflowValueName.Selections="_selections";WorkflowValueName.SelectedReportCount="_selected_report_count";WorkflowValueName.RelayElementId="_relay_element_id";WorkflowValueName.RelayElementName="_relay_element_name";WorkflowValueName.CalendarId="_calendar_id";WorkflowValueName.ReportId="_report_id";WorkflowValueName.ReportEntry="_report_entry";WorkflowValueName.ReportAdditionalInfo="_report_additonal_info";WorkflowValueName.ChildBlock="_child_block";WorkflowValueName.Date="_date";WorkflowValueName.EntryDate="_entry_date";WorkflowValueName.CalendarView="_cal_view";WorkflowValueName.Node="_node";WorkflowValueName.ParentNode="_parentnode";WorkflowValueName.VisibilityRootId="_vis_root";WorkflowValueName.VisibleElements="_visible";WorkflowValueName.SelectAll="_select_all";WorkflowValueName.DateNavigation="_date_navigation";WorkflowValueName.TestMode="testMode";WorkflowValueName.TestModeMessage="_test_mode_message";WorkflowValueName.ScrollInto="_scroll_into";var CssTextClassNameBase="TextElement_",CssTextCaptionClassName=CssTextClassNameBase+"Caption",CssTextBodyClassName=CssTextClassNameBase+"Body",CssTextExplanationClassName=CssTextClassNameBase+"Explanation",DataTableCellContentType={};DataTableCellContentType.Text="text";DataTableCellContentType.Numeric="numeric";DataTableCellContentType.DateTime="datetime";var ConfirmIconName="icon-checkmark",CancelIconName="icon-close",UndoIconName="icon-undo-3",GroupsIconName="icon-explorerwindow",ExpandIconName="icon-right",CollapseIconName="icon-down",AddIconName="icon-plus",RemoveIconName="icon-minus",DeleteIconName="icon-remove",SettingsIcon="icon-cog",SortAscendingIcon="icon-sortbysizeascending",SortDescendingIcon="icon-sortbysizedescending",CheckmarkIcon="icon-checkmark",CheckedIcon="icon-checkbox-checked-2",UncheckedIcon="icon-checkbox-unchecked-3",SearchIconName="icon-search-3",UploadIconName="icon-cloud-upload",RotateIconName="icon-rotateclockwise",ExcelIconName="icon-file-excel",PreviewIconName="icon-preview",RefreshIconName="icon-refresh",SelectAllIconName="icon-list",ShoppingCartIconName="icon-cart-6",RequiredFieldInvalidIconName="icon-star-4",RequiredFieldValidIconName="icon-star-6",MoveIconName="icon-move",DistributionRulesIconName="icon-users-4",InfoIconName="icon-info-3",VisibleIconName="icon-eye",HiddenIconName="icon-eye-blocked",PositionIconName="icon-place",ElementSizeFill=-1,ExplanatoryCaptionIconName="icon-question-4",ReleaseIconName="icon-undo-3",ConfirmAssignIconName="icon-checkmark",RightArea="Right",LeftArea="Left",TopArea="Top",BottomArea="Bottom",AllArea="All",SHIFTKEY=16,CTRLKEY=17,ESCKEY=46,GREENCOLOR="#80ad45";typeof BRIX!="object"&&(BRIX={});BRIX.AwaitingActions=[];BRIX.OnNavigate=[];BRIX.MacroStorageParameter="MACROSTORAGE";BRIX.MacroStorage={};BRIX.Timer={};BRIX.Utilities={};BRIX.Timer.Start=function(){return(new Date).getTime()};BRIX.Timer.Stop=function(n){return(new Date).getTime()-n};BRIX.Memory=[];BRIX.WindowStack=[];BRIX.Crypt={};BRIX.Preserve=[];BRIX.Crypt.Base64={Decode:function(n){var t=window.atob||function(n){for(var f={},r=0,e,i,u=0,o,s="",c=String.fromCharCode,h=n.length,t=0;t<64;t++)f["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(i=0;i<h;i++)for(e=f[n.charAt(i)],r=(r<<6)+e,u+=6;u>=8;)((o=r>>>(u-=8)&255)||i<h-2)&&(s+=c(o));return s};return decodeURIComponent(escape(t(n)))}};BRIX.Utilities.MakeXmlNodeCompatible=function(n){n.childNodes=[];n.getAttribute=function(n){return this[n]};n.selectSingleNode=function(){return null}};BRIX.Utilities.Location={SetHash:function(n){OnPopStateOldIE.Hash=n;window.location.hash=n},GetHash:function(){return window.location.hash.replace("#","")}};BRIX.Utilities.GetClassName=function(n){if(typeof n!="object")throw Error("Invalid argument. Must be an object");var t=n.constructor.toString();return t=t.slice(t.indexOf("function")+8),t.substr(0,t.indexOf("(")).trim()};popdbg=null;OnPopStateOldIE={Hash:null,Handle:null,Update:function(){var n=BRIX.Utilities.Location.GetHash();OnPopStateOldIE.Hash!==n&&(OnPopStateOldIE.Hash!==null&&n!==""&&OnPopState(),OnPopStateOldIE.Hash=n);OnPopStateOldIE.Handle=window.setTimeout(OnPopStateOldIE.Update,300)},StopUpdating:function(){OnPopStateOldIE.Handle&&window.clearTimeout(OnPopStateOldIE.Handle)}};OnPopStateOldIE.Update();window.onpopstate=function(){};BRIX.Markup=function(n,t){var i=document.createElement(t||"div"),r;return IsDefined(n)&&(r=typeof n=="string"?[n]:n,AddCssClass(i,r.join(" "))),i};BRIX.LoadedJs="";BRIX.Storage={Set:function(n,t){if(typeof Storage!="undefined"){try{localStorage.setItem(n,t)}catch(i){return!1}return!0}return!1},Get:function(n){var t=null;if(typeof Storage!="undefined")try{t=localStorage.getItem(n)}catch(i){}return t}};BRIX.RoundAngle=function(n,t,i){var r=n,e,o,u,f;if(r===0||r===360)return 0;for(e=t||2.5,o=i||45,r=(r/360-Math.floor(r/360))*360,u=0;u<=360/o;u++)if(f=u*o,r>f-e&&r<f+e)return f;return n};document.ondragstart&&(document.ondragstart=function(){return!1});WinDoc=window.document;_idTrail=1e3;Number.prototype.Format=function(n,t,i,r){var f="\\d(?=(\\d{"+(t||3)+"})+"+(n>0?"\\D":"$")+")",u=this.toFixed(Math.max(0,~~n));return(r?u.replace(".",r):u).replace(new RegExp(f,"g"),"$&"+(i||","))};Function.prototype.InheritsFrom=function(n){return n.constructor===Function?(this.prototype=new n,this.prototype.constructor=this,this.prototype.parent=n.prototype):(this.prototype=n,this.prototype.constructor=this,this.prototype.parent=n),this.prototype.IsInheritedFrom=function(n){var u=function(n){var t=n.constructor.toString();return t=t.slice(0,t.indexOf("(")),t.slice(t.indexOf(" ")+1)},t=this,i=!1,r;do{if(r=u(t),r===n){i=!0;break}t=t.parent}while(t);return i},this};String.prototype.ReplaceAll=function(searchTerm,replaceWith,ignoreCase){var regex=new RegExp(searchTerm,"g");return ignoreCase&&(regex+="i"),this.replace(eval(regex),replaceWith)};typeof String.prototype.trim!="function"&&(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});LayerSize.InheritsFrom(Size);Array.prototype.ForEach=function(n){for(var t=0;t<this.length;t++)n.call(this,t,this[t])};FontIcon.prototype.Create=function(n){var i=this.Name,t=document.createElement("i");return AddCssClass(t,i),AddCssClass(t,"icon-large Icon"),t.ChangeIcon=function(n){RemoveCssClass(t,i);AddCssClass(t,n);i=n},n&&(t.style.cursor=n),t};requestIndex=new RequestIndex;XmlError.prototype.isError=function(){return this.errorNode!=null};XmlError.prototype.errorDescription=function(){var n,u,t,i;if(!this.isError())return"";var e=this.errorNode.getElementsByTagName("message")[0].firstChild.nodeValue,f=this.errorNode.getElementsByTagName("log"),r="";for(n=0;n<f.length;n++)for(r+="\n",u=f[n],t=0;t<u.childNodes.length;t++)i=u.childNodes[t],i.nodeType==1&&(r+="\n"+i.tagName+": "+i.firstChild.nodeValue);return e+r};(!window.ActiveXObject&&window.Element||window.ActiveXObject&&window.Element)&&(jQueryXPathSelectorConvert=function(n){var t=function(n,t,i){while(n.indexOf(t)!=-1)n=n.replace(t,i);return n},i=t(n,"./","/");return i=t(i,"/",">"),t(i,"[@","[")},Element.prototype.selectNodes=function(n){var t=jQueryXPathSelectorConvert(n);return $(this).find(t)},Element.prototype.selectSingleNode=function(n){var t=jQueryXPathSelectorConvert(n),i;return i=t.slice(0,1)=="@"?$(this).attr(t.slice(1)):$(this).find(t),i==null?null:i[0]});ActiveIconArchive={};ActiveIconArchive.TryGetFromNode=function(n,t){var i=this.GetIconNode(n);return i==null?null:this.GetFromNode(i,t)};ActiveIconArchive.GetIconNode=function(n){return n.nodeName=="ActiveIcon"?n:n.selectSingleNode("./ActiveIcon")};ActiveIconArchive.Get=function(n){return new FontIcon(n)};ActiveIconArchive.GetFromNode=function(n){var t=this.GetIconNode(n),i;return t!=null?(i=t.getAttribute("name"),new FontIcon(i)):null};BRIX.Inputs={ValidateNumericInput:function(n){var i=!0,t;return n.value&&(t=n.value.ReplaceAll(" ",""),t=t.indexOf(",")<t.indexOf(".")?t.ReplaceAll(",",""):t.ReplaceAll(".",""),t=new Number(t),isNaN(t)&&(t="",i=!1)),i},CreateTextInput:function(n,t,i,r){var u=CreateInput(n);return u.type=i?"password":"text",u.value=t,u.placeholder=IsDefined(r)?r:"",u},CreateNumericInput:function(n,t,i,r){t=t.replace(",",".");t=t.replace(" ","").replace(String.fromCharCode(160),"");var u=BRIX.Inputs.CreateTextInput(n,t,i,r);return u.type="number",u.pattern="[0-9]+([.,][0-9]+)?",u.step="any",u},CreateEmailInput:function(n,t,i,r){var u=BRIX.Inputs.CreateTextInput(n,t,i,r);return u.type="email",u}};NoBorder={};NoBorder.Size=0;BlackBorderStyle={};BlackBorderStyle.Bottom=GraphicsBasePath+"border/black/b.png";BlackBorderStyle.BottomLeft=GraphicsBasePath+"border/black/bl.png";BlackBorderStyle.BottomRight=GraphicsBasePath+"border/black/br.png";BlackBorderStyle.Left=GraphicsBasePath+"border/black/l.png";BlackBorderStyle.Right=GraphicsBasePath+"border/black/r.png";BlackBorderStyle.Top=GraphicsBasePath+"border/black/t.png";BlackBorderStyle.TopLeft=GraphicsBasePath+"border/black/tl.png";BlackBorderStyle.TopRight=GraphicsBasePath+"border/black/tr.png";BlackBorderStyle.LeftArrow=GraphicsBasePath+"border/white/left_arrow.png";BlackBorderStyle.RightArrow=GraphicsBasePath+"border/white/right_arrow.png";BlackBorderStyle.ArrowWidth=50;BlackBorderStyle.ArrowHeight=40;BlackBorderStyle.Size=11;BlackBorderStyle.CornerSizeOffset=-1;WhiteBorderStyle={};WhiteBorderStyle.Bottom=GraphicsBasePath+"border/white/b.png";WhiteBorderStyle.BottomLeft=GraphicsBasePath+"border/white/bl.png";WhiteBorderStyle.BottomRight=GraphicsBasePath+"border/white/br.png";WhiteBorderStyle.Left=GraphicsBasePath+"border/white/l.png";WhiteBorderStyle.Right=GraphicsBasePath+"border/white/r.png";WhiteBorderStyle.Top=GraphicsBasePath+"border/white/t.png";WhiteBorderStyle.TopLeft=GraphicsBasePath+"border/white/tl.png";WhiteBorderStyle.TopRight=GraphicsBasePath+"border/white/tr.png";WhiteBorderStyle.LeftArrow=GraphicsBasePath+"border/white/left_arrow.png";WhiteBorderStyle.RightArrow=GraphicsBasePath+"border/white/right_arrow.png";WhiteBorderStyle.ArrowWidth=50;WhiteBorderStyle.ArrowHeight=40;WhiteBorderStyle.Size=11;WhiteBorderStyle.CornerSizeOffset=-1;SpaceBorderStyle={};for(gx in WhiteBorderStyle)src=WhiteBorderStyle[gx],typeof src=="string"&&src.indexOf(".png")!=-1;for(sx in BlackBorderStyle)src=BlackBorderStyle[sx],typeof src=="string"&&src.indexOf(".png")!=-1;BorderController.prototype.Load=function(n){var t,i;if(!this.IsEmpty){if(!n)throw new Error("You must define a parent element");this.Loaded||(this.Loaded=!0,t=null,this.Size.Top&&(this.TopImg=CreateImage(this.Type.Top),this.TopImg.style.position="absolute",this.TopImg.style.height=this.Size.Top+"px",n.appendChild(this.TopImg)),this.Size.Bottom&&(t=CreateImage(this.Type.Bottom),t.style.position="absolute",n.appendChild(t),t.style.height=this.Size.Bottom+"px",this.BottomImg=t),this.Size.Left&&(t=CreateImage(this.Type.Left),t.style.position="absolute",n.appendChild(t),t.style.width=this.Size.Left+"px",this.LeftImg=t),this.Size.Right&&(t=CreateImage(this.Type.Right),t.style.position="absolute",n.appendChild(t),t.style.width=this.Size.Right+"px",this.RightImg=t),i=this.Type.CornerSizeOffset*2,this.Size.Top&&this.Size.Left&&(t=CreateImage(this.Type.TopLeft),t.style.position="absolute",n.appendChild(t),t.style.height=this.Size.Top*2+i+"px",t.style.width=this.Size.Left*2+i+"px",this.TopLeftImg=t),this.Size.Top&&this.Size.Right&&(t=CreateImage(this.Type.TopRight),t.style.position="absolute",n.appendChild(t),t.style.height=this.Size.Top*2+i+"px",t.style.width=this.Size.Right*2+i+"px",this.TopRightImg=t),this.Size.Bottom&&this.Size.Left&&(t=CreateImage(this.Type.BottomLeft),t.style.position="absolute",n.appendChild(t),t.style.height=this.Size.Bottom*2+i+"px",t.style.width=this.Size.Left*2+i+"px",this.BottomLeftImg=t),this.Size.Bottom&&this.Size.Right&&(t=CreateImage(this.Type.BottomRight),t.style.position="absolute",n.appendChild(t),t.style.height=this.Size.Bottom*2+i+"px",t.style.width=this.Size.Right*2+i+"px",this.BottomRightImg=t))}};BorderController.prototype.Resize=function(n,t,i,r){var u,e,f,o;this.Loaded&&(u=null,e=0,this.TopImg&&(f=this.TopRightCornerSizeOffset+this.TopLeftCornerSizeOffset,this.TopImg.style.top=n+"px",this.TopImg.style.left=t+this.Size.Left*2+f+"px",o=i-(this.Size.Left*2+this.Size.Right*2)-f*2,this.TopImg.style.width=(o>-1?o:0)+"px"),this.BottomImg&&(f=this.BottomRightCornerSizeOffset+this.BottomLeftCornerSizeOffset,u=this.BottomImg,u.style.top=n+r-this.Size.Bottom+"px",u.style.left=t+this.Size.Left*2+f+"px",e=i-(this.Size.Left*2+this.Size.Right*2)-f*2,u.style.width=(e>-1?e:0)+"px"),this.LeftImg&&(f=this.BottomLeftCornerSizeOffset+this.TopLeftCornerSizeOffset,u=this.LeftImg,u.style.top=n+this.Size.Top*2+f+"px",u.style.left=t+"px",e=r-(this.Size.Top*2+this.Size.Bottom*2)-f*2,u.style.height=(e>-1?e:0)+"px"),this.RightImg&&(f=this.BottomRightCornerSizeOffset+this.TopRightCornerSizeOffset,u=this.RightImg,u.style.top=n+this.Size.Top*2+f+"px",u.style.left=t+i-this.Size.Right+"px",e=r-(this.Size.Top*2+this.Size.Bottom*2)-f*2,u.style.height=(e>-1?e:0)+"px"),this.TopLeftImg&&(u=this.TopLeftImg,u.style.top=n+"px",u.style.left=t+"px"),this.TopRightImg&&(u=this.TopRightImg,u.style.top=n+"px",u.style.left=t+(i-this.Size.Right*2+2)+"px"),this.BottomLeftImg&&(u=this.BottomLeftImg,u.style.top=n+(r-this.Size.Bottom*2+2)+"px",u.style.left=t+"px"),this.BottomRightImg&&(u=this.BottomRightImg,u.style.top=n+(r-this.Size.Bottom*2+2)+"px",u.style.left=t+(i-this.Size.Right*2+2)+"px"))};BorderController.prototype.Unload=function(){var i,t,n;if(this.Loaded)for(this.Loaded=!1,i=["Top","Left","Bottom","Right","TopLeft","TopRight","BottomLeft","BottomRight"],t=0;t<i.length;t++)n=i[t]+"Img",this[n]&&(this[n].parentNode.removeChild(this[n]),this[n]=null,delete this[n])};Position2D.prototype.Copy=function(){return new Position2D(this.X,this.Y,this.Unit)};Position2D.prototype.Serialize=function(n){n["coordinates.position.x"]=Math.round(this.X);n["coordinates.position.y"]=Math.round(this.Y);this.Unit&&(n["coordinates.position.unit"]=this.Unit)};Position2D.prototype.Deserialize=function(n){var t=n.selectSingleNode("Position2D");this.X=new Number(t.getAttribute("x")||0);this.Y=new Number(t.getAttribute("y")||0);this.Unit=t.getAttribute("unit")};Position2D.prototype.ConvertToUnits=function(n){n.ToUnitName&&n.ToUnitName!=this.Unit&&(this.X=n(this.X),this.Y=n(this.Y),this.Unit=n.ToUnitName)};Position2D.prototype.Distance=function(n){var i=this.X-n.X,t;return i<0&&(i*=-1),t=this.Y-n.Y,t<0&&(t*=-1),Math.sqrt(i*i+t*t)};Position2D.prototype.SubtractPosition=function(n){return new Position2D(this.X-n.X,this.Y-n.Y)};Position2D.prototype.AddPosition=function(n){return new Position2D(this.X+n.X,this.Y+n.Y)};Position2D.prototype.MoveIncrementally=function(n,t){this.X+=n;this.Y+=t};PositionAnchor.prototype.Copy=function(){return new PositionAnchor(this.Vertical.Copy(),this.Horizontal.Copy())};PositionAnchor.prototype.Serialize=function(n){n["coordinates.anchor.horizontal"]=this.Horizontal.ToString();n["coordinates.anchor.vertical"]=this.Vertical.ToString()};PositionAnchor.prototype.Deserialize=function(n){var t=n.selectSingleNode("Anchor");this.Vertical=new VerticalAnchor;this.Horizontal=new HorizontalAnchor;this.Vertical[t.getAttribute("vertical_anchor")||"Top"]=!0;this.Horizontal[t.getAttribute("horizontal_anchor")||"Left"]=!0};VerticalAnchor.prototype.Copy=function(){return new VerticalAnchor(this.Top,this.Center,this.Bottom)};VerticalAnchor.prototype.ToString=function(){return this.Top?"Top":this.Center?"Center":"Bottom"};HorizontalAnchor.prototype.Copy=function(){return new HorizontalAnchor(this.Left,this.Center,this.Right)};HorizontalAnchor.prototype.ToString=function(){return this.Left?"Left":this.Center?"Center":"Right"};Coordinates.prototype.Copy=function(){return new Coordinates(this.Position.Copy(),this.Size.Copy(),this.Anchor.Copy())};Coordinates.prototype.ConvertToUnits=function(n){this.Position.ConvertToUnits(n);this.Size.ConvertToUnits(n)};Coordinates.prototype.SetAnchorTop=function(n){this.Anchor.Vertical.Center?this.Position.Y+=n.Height/2-this.Height/2:this.Anchor.Vertical.Bottom&&(this.Position.Y=n.Height-this.Position.Y-this.Size.Height);this.Anchor.Vertical=new VerticalAnchor(!0,!1,!1)};Coordinates.prototype.SetAnchorVerticalCenter=function(n){this.Anchor.Vertical.Top?this.Position.Y=this.Position.Y+this.Size.Height/2-n.Height/2:this.Anchor.Vertical.Bottom&&(this.Position.Y=this.Top+this.Size.Height/2-n.Height/2);this.Anchor.Vertical=new VerticalAnchor(!1,!0,!1)};Coordinates.prototype.SetAnchorBottom=function(n){this.Anchor.Vertical.Center?this.Position.Y=n.Height-(this.Position.Y+n.Height/2-this.Size.Height/2):this.Anchor.Vertical.Top&&(this.Position.Y=n.Height-this.Position.Y-this.Size.Height);this.Anchor.Vertical=new VerticalAnchor(!1,!1,!0)};Coordinates.prototype.SetAnchorLeft=function(n){this.Anchor.Horizontal.Center?this.Position.X=this.Position.X+n.Width/2-this.Size.Width/2:this.Anchor.Horizontal.Right&&(this.Position.X=n.Width-this.Position.X-this.Size.Width);this.Anchor.Horizontal=new HorizontalAnchor(!0,!1,!1)};Coordinates.prototype.SetAnchorHorizontalCenter=function(n){this.Anchor.Horizontal.Left?this.Position.X=this.Position.X+this.Size.Width/2-n.Width/2:this.Anchor.Horizontal.Right&&(this.Position.X=this.Left+this.Size.Width/2-n.Width/2);this.Anchor.Horizontal=new HorizontalAnchor(!1,!0,!1)};Coordinates.prototype.SetAnchorRight=function(n){this.Anchor.Horizontal.Center?this.Position.X=n.Width-(this.Position.X+n.Width/2-this.Size.Width/2):this.Anchor.Horizontal.Left&&(this.Position.X=n.Width-this.Position.X-this.Size.Width);this.Anchor.Horizontal=new HorizontalAnchor(!1,!1,!0)};Coordinates.prototype.MoveIncrementally=function(n,t){this.Position.MoveIncrementally(n,t);this.Update()};Coordinates.prototype.ResizeIncrementally=function(n,t,i){var r=i=="left"?-n:i=="right"?n:0,u=i=="top"?-t:i=="bottom"?t:0,f=i=="left"?n:0,e=i=="top"?t:0;this.Size.ResizeIncrementally(r,u);this.Position.MoveIncrementally(f,e);this.Update()};Coordinates.prototype.MoveWithinCoordinates=function(n){var t=!1;this.Left<n.Left&&(this.SetLeft(n.Left),t=!0);this.Right>n.Right&&(this.SetRight(n.Right),t=!0);this.Top<n.Top&&(this.SetTop(n.Top),t=!0);this.Bottom>n.Bottom&&(this.SetBottom(n.Bottom),t=!0);t&&this.Update()};Coordinates.prototype.GetAbsoluteSides=function(n){var t={};this.GetAbsoluteHorizontalSides(t,n);this.GetAbsoluteVerticalSides(t,n)};Coordinates.prototype.GetAbsoluteHorizontalSides=function(n,t){if(this.Size.FillsWidth())n.Left=0,n.Right=t.Width;else if(this.Anchor.Horizontal.Left)n.Left=this.Position.X,n.Right=this.Position.X+this.Size.Width;else if(this.Anchor.Horizontal.Right)n.Left=this.Position.X-this.Size.Width,n.Right=this.Position.X;else{var i=t.Width/2,r=this.Size.Width/2;n.Left=i-r;n.Right=i+r}};Coordinates.prototype.GetAbsoluteVerticalSides=function(n,t){if(this.Size.FillsHeight())n.Top=0,n.Bottom=t.Height;else if(this.Anchor.Vertical.Top)n.Top=this.Position.Y,n.Bottom=this.Position.Y+this.Size.Height;else if(this.Anchor.Vertical.Bottom)n.Top=this.Position.Y-this.Size.Height,n.Bottom=this.Position.Y;else{var i=t.Height/2,r=this.Size.Height/2;n.Top=i-r;n.Bottom=i+r}};Coordinates.prototype.CalculateSize=function(n){var t=new LayerSize(n);this.Size.Height=t.Height;this.Size.Width=t.Width;this.Update()};Coordinates.prototype.SetDomCoordinates=function(n,t,i){this.Size.Width==0&&this.Size.Height==0&&this.CalculateSize(n);t||this.Size.SetDomSize(n);this.SetDomVerticalPosition(n,i);this.SetDomHorizontalPosition(n,i)};Coordinates.prototype.SetDomVerticalPosition=function(n,t){var i=null,r=null;if(this.Size.FillsHeight())i=0,r=null;else if(this.Anchor.Vertical.Top)i=Math.round(this.Position.Y),r=null;else if(this.Anchor.Vertical.Bottom)i=null,r=Math.round(this.Position.Y);else if(this.Anchor.Vertical.Center){var u=new LayerSize(n.parentNode),f=u.Height/2,e=this.Size.Height/2;i=Math.round(f-e+this.Position.Y);r=null}t&&(i!=null&&i<0&&(i=0),r!=null&&r<0&&(r=0));n.style.top=i==null?"":i+"px";n.style.bottom=r==null?"":r+"px"};Coordinates.prototype.SetDomHorizontalPosition=function(n,t){var i=null,r=null;if(this.Size.FillsWidth())n.style.left="0px";else if(this.Anchor.Horizontal.Left)i=Math.round(this.Position.X),r=null;else if(this.Anchor.Horizontal.Right)i=null,r=Math.round(this.Position.X);else if(this.Anchor.Horizontal.Center){var u=n.parentNode.clientWidth,f=this.Size.Width/2,e=u/2;i=Math.round(e-f+this.Position.X);r=null}t&&(i!=null&&i<0&&(i=0),r!=null&&r<0&&(r=0));n.style.left=i==null?"":i+"px";n.style.right=r==null?"":r+"px"};Coordinates.prototype.Serialize=function(){var arguments={};return this.Position.Serialize(arguments),this.Size.Serialize(arguments),this.Anchor.Serialize(arguments),arguments};Coordinates.prototype.Deserialize=function(n){var t=n.selectSingleNode("Coordinates");this.Position.Deserialize(t);this.Size.Deserialize(t);this.Anchor.Deserialize(t);this.Update()};Coordinates.prototype.Update=function(){this.Top=this.Position.Y;this.Left=this.Position.X;this.Width=this.Size.Width;this.Height=this.Size.Height;this.Right=this.Left+this.Width;this.Bottom=this.Top+this.Height};Coordinates.prototype.MoveIncrementally=function(n,t){this.Position.MoveIncrementally(n,t);this.Update()};Coordinates.prototype.SetLeft=function(n){this.Position.X=n;this.Update()};Coordinates.prototype.SetRight=function(n){this.Position.X=n-this.Size.Width;this.Update()};Coordinates.prototype.SetTop=function(n){this.Position.Y=n;this.Update()};Coordinates.prototype.SetBottom=function(n){this.Position.Y=n-this.Size.Height;this.Update()};ScrollJob.prototype.CurrentPosition=function(){return this.Element.scrollTop};ScrollJob.prototype.Perform=function(){var t=this.CurrentPosition(),n;this.DirectionUp?(n=t-this.StepLength,n<this.Goal&&(n=this.Goal,this.IsComplete=!0)):this.DirectionDown&&(n=t+this.StepLength,n>this.Goal&&(n=this.Goal,this.IsComplete=!0));this.Element.scrollTop=n;this.Element.scrollTop!=n&&(this.IsComplete=!0)};ScrollJob.prototype.Cancel=function(){};window.ActiveScrollJobs=new ScrollJobs;IconDefinition.prototype.CreateImage=function(){var n=CreateImage(this.Url);return n.style.width=this.Size+"px",n.style.height=this.Size+"px",n};Color.prototype.CreateCodeWithAlphaChannel=function(n){var t=HexToDecimal(this.Red),i=HexToDecimal(this.Green),r=HexToDecimal(this.Blue);return"rgba("+t+", "+i+", "+r+", "+n+")"};Color.prototype.CreateAdjusted=function(n){var t=new Color(this.Code());return t.Adjust(n),t};Color.prototype.Adjust=function(n){this.Red=this.AdjustColor(this.Red,n);this.Green=this.AdjustColor(this.Green,n);this.Blue=this.AdjustColor(this.Blue,n)};Color.prototype.AdjustColor=function(n,t){var i=HexToDecimal(n);return i+=t,i<0?i=0:i>255&&(i=255),DecimalToHex(i,2)};Color.prototype.Code=function(){return this.IsTransparent?"transparent":"#"+(this.Red+this.Green+this.Blue).toLowerCase()};Color.prototype.toString=function(){return this.Code()};CurrentEditorHover=null;EditorHover.prototype.Destroy=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Element=null;CurrentEditorHover=null};Date.prototype.CreateClone=function(n,t,i,r,u){return new Date(this.getFullYear()+(n?n:0),this.getMonth()+(t?t:0),this.getDate()+(i?i:0),this.getHours()+(r?r:0),this.getMinutes()+(u?u:0),0)};Date.prototype.GetWeekday=function(){var n=this.getDay();return n==0?7:n};Date.prototype.IsStartOfWeek=function(){return this.GetWeekday()==1};Date.prototype.IsEndOfWeek=function(){return this.GetWeekday()==7};Date.prototype.GetFullMonth=function(){return this.getMonth()+1};Date.prototype.GetWeek=function(){var n=new Date(this.getTime()),t;return n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7),t=new Date(n.getFullYear(),0,4),1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)};Date.prototype.AddDays=function(n){var t=new Date(this.valueOf());return t.setDate(t.getDate()+n),t};DateFormats={};DateFormats.Formats={};DateFormats.GetFormat=function(n){var t=this.Formats[n];return t||(t=new DateFormat(n),this.Formats[n]=t),t};CalendarController.prototype.GetWeeks=function(){for(var t=1,n=this.MonthRange.Start.CreateClone(0,0,1);n<=this.MonthRange.End;)n.IsStartOfWeek()&&t++,n.setDate(n.getDate()+1);return t};CalendarController.prototype.SetCurrentDate=function(n){this.CurrentYear=n.getFullYear();this.CurrentMonth=n.getMonth();this.CurrentDate=n.getDate();this.CurrentHours=n.getHours();this.CurrentMinutes=n.getMinutes()};BRIX.Utilities.NTP={_Offset:null,GetDate:function(n){var t,i;BRIX.Utilities.NTP._Offset===null?(t=Date.now(),BRIX.Utilities.NTP._SendStamp(function(i){var r=Date.now(),f=(r-t)/2,u;BRIX.Utilities.NTP._Offset=i+f-r;u=BRIX.Utilities.NTP._GetOffsetTime();n(u)})):(i=BRIX.Utilities.NTP._GetOffsetTime(),n(i))},_GetOffsetTime:function(){return new Date(Date.now()+BRIX.Utilities.NTP._Offset)},_SendStamp:function(n){$.ajax({cache:!1,url:"/NTP",dataType:"json",success:function(t){var i=DateTimeParser(t.t1,"yyyy-MM-dd HH:mm:ss.fff");n(i.getTime())}})}};ElementModificator.prototype.UpdateBodyPosition=function(){var n=this.Coordinates.Copy(),t,i;n.Position=n.Position.AddPosition(this.Workspace.Position);n.SetDomCoordinates(this.Body);this.Element.Resizable&&(this.Element.ProportionsLocked||(this.Element.ResizableHorizontal&&(t=this.Coordinates.Size.Height/2-this.ResizeControlSize/2,this.ResizeLeftIcon.style.top=t+"px",this.ResizeRightIcon.style.top=t+"px"),this.Element.ResizableVertical&&(i=this.Coordinates.Size.Width/2-this.ResizeControlSize/2,this.ResizeTopIcon.style.left=i+"px",this.ResizeBottomIcon.style.left=i+"px")))};ElementModificator.prototype.GetWorkspaceCoordinates=function(n){var t=new LayerSize(n.GetBodyElement());return new Coordinates(new Position2D(n.Margins,n.Margins),new Size(t.Width,t.Height))};ElementModificator.prototype.AttachEvents=function(){this.EventTracker=new EventTracking(this.Element.Floor.Overlay.id);this.Element.IsMovable&&(this.EventTracker.AddCallback("mouse down",this,"StartMove",!1),this.MouseUpEventHandle=window.Page.EventTracker.AddCallback("mouse up",this,"EndMove",!1));this.AttachResizeEvents()};ElementModificator.prototype.DetachEvents=function(){this.EventTracker&&this.EventTracker.RemoveAllCallbacks();this.MouseUpEventHandle&&window.Page.EventTracker.RemoveCallback(this.MouseUpEventHandle)};ElementModificator.prototype.UpdateElementCoordinates=function(){var t=this.Coordinates.Copy();t.Position=t.Position.SubtractPosition(this.Workspace.Position);this.Element.AdjustCoordinatesBeforeUpdate(t);this.Element.Coordinates=t;var i=this.Workspace.Size.Width/2,r=this.Coordinates.Position.X+this.Coordinates.Size.Width/2,u=this.Workspace.Size.Height/2,f=this.Coordinates.Position.Y+this.Coordinates.Size.Height/2,n="";this.FixedWorkspaceSize||r<i-this.HorizontalCenterSize?(n="Left",this.Element.Coordinates.SetAnchorLeft(this.Workspace.Size)):r>i+this.HorizontalCenterSize?(n="Right",this.Element.Coordinates.SetAnchorRight(this.Workspace.Size)):(n="Center",this.Element.Coordinates.SetAnchorHorizontalCenter(this.Workspace.Size));this.FixedWorkspaceSize||f<u-this.VerticalCenterSize?(n+=", Top",this.Element.Coordinates.SetAnchorTop(this.Workspace.Size)):f>u+this.VerticalCenterSize?(n+=", Bottom",this.Element.Coordinates.SetAnchorBottom(this.Workspace.Size)):(n+=", Center",this.Element.Coordinates.SetAnchorVerticalCenter(this.Workspace.Size));this.Element.Coordinates.Update();this.Element.OnResize();this.Element.UpdateCoordinates()};ElementModificator.prototype.Moved=function(n,t,i){var r=new Position2D(t,i),u;r=r.AddPosition(this.Workspace.Position);this.PendingMoving?(u=this.StartingMovePosition.Distance(r),u>10&&(this.PendingMoving=!1,this.IsMoving=!0)):this.IsMoving&&this.MoveElement(r)};ElementModificator.prototype.MoveElement=function(n){var t=n.SubtractPosition(this.TailMovePosition);this.Coordinates.MoveIncrementally(t.X,t.Y);this.Coordinates.MoveWithinCoordinates(this.Workspace);this.TailMovePosition=n;this.Coordinates.SetDomCoordinates(this.Body)};ElementModificator.prototype.StartMove=function(n,t,i){this.StartingMovePosition=new Position2D(t,i);this.TailMovePosition=new Position2D(t,i);this.PendingMoving=!0;this.IsMoving=!1;this.MoveEventHandle=this.EventTracker.AddCallback("mouse move",this,"Moved",!1)};ElementModificator.prototype.EndMove=function(){this.PendingMoving=!1;this.MoveEventHandle&&this.EventTracker.RemoveCallback(this.MoveEventHandle);this.IsMoving&&(this.IsMoving=!1,this.UpdateElementCoordinates())};ElementModificator.prototype.Create=function(){this.Body=this.CreateBody();this.Element.Resizable&&this.CreateResizeControls();this.AttachEvents()};ElementModificator.prototype.CreateBody=function(){var n=document.createElement("div"),t;return n.style.position="absolute",n.id=this.Element.Id+"_modificator_body",n.style.backgroundImage="url("+GraphicsBasePath+"transparent.png)",n.style.top="0px",n.style.left="0px",n.style.width="0px",n.style.height="0px",this.Element.IsMovable&&(n.style.cursor="move"),n.appendChild(this.CreateFillLayer()),t=this.CreateFillLayer(),t.style.left="0px",t.style.top="0px",t.style.border="1px dashed #000000",n.appendChild(t),n};ElementModificator.prototype.CreateFillLayer=function(){var n=document.createElement("div");return n.style.position="absolute",n.style.top="-1px",n.style.left="-1px",n.style.width="100%",n.style.height="100%",n.style.border="1px dashed #FFFFFF",n.style.zIndex=1,n};ElementModificator.prototype.Remove=function(){this.DetachEvents();this.Body.parentNode.removeChild(this.Body)};ElementModificator.prototype.AttachResizeEvents=function(){this.Element.Resizable&&(this.Element.ResizableHorizontal&&(this.ResizeLeftControl.EventTracker.AddCallback("mouse down",this,"StartResizeLeft",!0),this.ResizeRightControl.EventTracker.AddCallback("mouse down",this,"StartResizeRight",!0)),this.Element.ResizableVertical&&(this.ResizeTopControl.EventTracker.AddCallback("mouse down",this,"StartResizeTop",!0),this.ResizeBottomControl.EventTracker.AddCallback("mouse down",this,"StartResizeBottom",!0)),this.MouseUpEventHandle=window.Page.EventTracker.AddCallback("mouse up",this,"EndResize",!1))};ElementModificator.prototype.StartResizeLeft=function(n,t,i){return this.ResizeDirection="left",this.StartResize(n,t,i)};ElementModificator.prototype.StartResizeRight=function(n,t,i){return this.ResizeDirection="right",this.StartResize(n,t,i)};ElementModificator.prototype.StartResizeTop=function(n,t,i){return this.ResizeDirection="top",this.StartResize(n,t,i)};ElementModificator.prototype.StartResizeBottom=function(n,t,i){return this.ResizeDirection="bottom",this.StartResize(n,t,i)};ElementModificator.prototype.Resized=function(n,t,i){var r=new Position2D(t,i),u;this.PendingResizing?(u=this.StartingResizePosition.Distance(r),u>0&&(this.PendingResizing=!1,this.IsResizing=!0)):this.IsResizing&&this.ResizeElement(r)};ElementModificator.prototype.ResizeElement=function(n){var i=n.SubtractPosition(this.TailResizePosition),t;this.Coordinates.ResizeIncrementally(i.X,i.Y,this.ResizeDirection);this.Coordinates.MoveWithinCoordinates(this.Workspace);this.TailResizePosition=n;t=this.Coordinates.Copy();t.Position=t.Position.AddPosition(this.Workspace.Position);t.SetDomCoordinates(this.Body)};ElementModificator.prototype.StartResize=function(n,t,i){var r=new EventInfo(n),u=r.Target;return u.ondragstart=function(){return!1},this.StartingResizePosition=new Position2D(t,i),this.StartingResizePosition=new Position2D(t,i),this.TailResizePosition=this.StartingResizePosition.Copy(),this.PendingResizing=!0,this.IsResizing=!1,this.ResizeEventHandle=this.EventTracker.AddCallback("mouse move",this,"Resized",!1),!1};ElementModificator.prototype.EndResize=function(){this.PendingResizing=!1;this.ResizeEventHandle&&this.EventTracker.RemoveCallback(this.ResizeEventHandle);this.IsResizing&&(this.IsResizing=!1,this.Coordinates.Position=this.Coordinates.Position.AddPosition(this.Workspace.Position),this.UpdateElementCoordinates())};ElementModificator.prototype.CreateResizeControls=function(){this.Element.ProportionsLocked||(this.Element.ResizableHorizontal&&(this.ResizeLeftControl=ActiveIconArchive.Get("icon-arrow-left-3",this.ResizeControlSize),this.ResizeLeftIcon=this.ResizeLeftControl.Create("W-resize"),this.ResizeLeftControl.EventTracker=new EventTracking(null,this.ResizeLeftIcon),AddCssClass(this.ResizeLeftIcon,"ResizeControl"),this.Body.appendChild(this.ResizeLeftIcon),this.ResizeRightControl=ActiveIconArchive.Get("icon-arrow-right-4",this.ResizeControlSize),this.ResizeRightIcon=this.ResizeRightControl.Create("E-resize"),this.ResizeRightControl.EventTracker=new EventTracking(null,this.ResizeRightIcon),AddCssClass(this.ResizeRightIcon,"ResizeControl"),this.ResizeRightIcon.style.right="0px",this.Body.appendChild(this.ResizeRightIcon)),this.Element.ResizableVertical&&(this.ResizeTopControl=ActiveIconArchive.Get("icon-arrow-up-3",this.ResizeControlSize),this.ResizeTopIcon=this.ResizeTopControl.Create("N-resize"),this.ResizeTopControl.EventTracker=new EventTracking(null,this.ResizeTopIcon),AddCssClass(this.ResizeTopIcon,"ResizeControl"),this.ResizeTopIcon.style.right="0px",this.Body.appendChild(this.ResizeTopIcon),this.ResizeBottomControl=ActiveIconArchive.Get("icon-arrow-down-3",this.ResizeControlSize),this.ResizeBottomIcon=this.ResizeBottomControl.Create("S-resize"),this.ResizeBottomControl.EventTracker=new EventTracking(null,this.ResizeBottomIcon),AddCssClass(this.ResizeBottomIcon,"ResizeControl"),this.ResizeBottomIcon.style.bottom="0px",this.Body.appendChild(this.ResizeBottomIcon)))};Tooltip.prototype.Build=function(n,t){var i,r,u;for(AddCssClass(n,"TooltipContainer"),t=="left"?AddCssClass(n,"ShowTooltipLeft"):t=="below"?AddCssClass(n,"ShowTooltipBelow"):AddCssClass(n,"ShowTooltipAbove"),i=document.createElement("div"),AddCssClass(i,"Tooltip"),n.appendChild(i),r=0;r<this.Items.length;r++)u=this.Items[r],u.Build(i)};TooltipItem.prototype.Build=function(n){var t=document.createElement("div"),i;AddCssClass(t,"Item");AddCssClass(t,"TooltipItem_"+this.Style);this.Icon&&(i=this.Icon.Create(),t.appendChild(i));t.appendChild(document.createTextNode(this.Text));n.appendChild(t)};IndicatorBoard.prototype.Build=function(){var t=document.createElement("div"),n,i;for(AddCssClass(t,"IndicatorBoard"),n=0;n<this.Indicators.length;n++)i=this.Indicators[n].Build(),t.appendChild(i);return t};Indicator.prototype.Build=function(){var n=this.Icon.Create();return AddCssClass(n,"Indicator"),this.IsDisabled?AddCssClass(n,"Disabled"):this.IsInherited?AddCssClass(n,"Inherited"):AddCssClass(n,"Enabled"),n};CountryCodes=[["Afghanistan","0093"],["Albania","0355"],["Algeria","0213"],["American Samoa","1684"],["Andorra","0376"],["Angola","0244"],["Anguilla","1264"],["Antarctica","0672"],["Antigua and Barbuda","1268"],["Argentina","0054"],["Armenia","0374"],["Aruba","0297"],["Australia","0061"],["Austria","0043"],["Azerbaijan","0994"],["Bahamas","1242"],["Bahrain","0973"],["Bangladesh","0880"],["Barbados","1246"],["Belarus","0375"],["Belgium","0032"],["Belize","0501"],["Benin","0229"],["Bermuda","1441"],["Bhutan","0975"],["Bolivia","0591"],["Bosnia and Herzegovina","0387"],["Botswana","0267"],["Brazil","0055"],["British Virgin Islands","1284"],["Brunei","0673"],["Bulgaria","0359"],["Burkina Faso","0226"],["Burma (Myanmar)","0095"],["Burundi","0257"],["Cambodia","0855"],["Cameroon","0237"],["Canada","0001"],["Cape Verde","0238"],["Cayman Islands","1345"],["Central African Republic","0236"],["Chad","0235"],["Chile","0056"],["China","0086"],["Christmas Island","0061"],["Cocos (Keeling) Islands","0061"],["Colombia","0057"],["Comoros","0269"],["Cook Islands","0682"],["Costa Rica","0506"],["Croatia","0385"],["Cuba","0053"],["Cyprus","0357"],["Czech Republic","0420"],["Democratic Republic of the Congo","0243"],["Denmark","0045"],["Djibouti","0253"],["Dominica","1767"],["Dominican Republic","1809"],["Ecuador","0593"],["Egypt","0020"],["El Salvador","0503"],["Equatorial Guinea","0240"],["Eritrea","0291"],["Estonia","0372"],["Ethiopia","0251"],["Falkland Islands","0500"],["Faroe Islands","0298"],["Fiji","0679"],["Finland","0358"],["France","0033"],["French Polynesia","0689"],["Gabon","0241"],["Gambia","0220"],["Gaza Strip","0970"],["Georgia","0995"],["Germany","049"],["Ghana","0233"],["Gibraltar","0350"],["Greece","0030"],["Greenland","0299"],["Grenada","1473"],["Guam","1671"],["Guatemala","0502"],["Guinea","0224"],["Guinea-Bissau","0245"],["Guyana","0592"],["Haiti","0509"],["Holy See (Vatican City)","0039"],["Honduras","0504"],["Hong Kong","0852"],["Hungary","0036"],["Iceland","0354"],["India","0091"],["Indonesia","0062"],["Iran","0098"],["Iraq","0964"],["Ireland","0353"],["Isle of Man","0044"],["Israel","0972"],["Italy","0039"],["Ivory Coast","0225"],["Jamaica","1876"],["Japan","0081"],["Jordan","0962"],["Kazakhstan","0007"],["Kenya","0254"],["Kiribati","0686"],["Kosovo","0381"],["Kuwait","0965"],["Kyrgyzstan","0996"],["Laos","0856"],["Latvia","0371"],["Lebanon","0961"],["Lesotho","0266"],["Liberia","0231"],["Libya","0218"],["Liechtenstein","0423"],["Lithuania","0370"],["Luxembourg","0352"],["Macau","0853"],["Macedonia","0389"],["Madagascar","0261"],["Malawi","0265"],["Malaysia","0060"],["Maldives","0960"],["Mali","0223"],["Malta","0356"],["Marshall Islands","0692"],["Mauritania","0222"],["Mauritius","0230"],["Mayotte","0262"],["Mexico","0052"],["Micronesia","0691"],["Moldova","0373"],["Monaco","0377"],["Mongolia","0976"],["Montenegro","0382"],["Montserrat","1664"],["Morocco","0212"],["Mozambique","0258"],["Namibia","0264"],["Nauru","0674"],["Nepal","0977"],["Netherlands","0031"],["Netherlands Antilles","0599"],["New Caledonia","0687"],["New Zealand","0064"],["Nicaragua","0505"],["Niger","0227"],["Nigeria","0234"],["Niue","0683"],["Norfolk Island","0672"],["North Korea","0850"],["Northern Mariana Islands","1670"],["Norway","0047"],["Oman","0968"],["Pakistan","0092"],["Palau","0680"],["Panama","0507"],["Papua New Guinea","0675"],["Paraguay","0595"],["Peru","051"],["Philippines","0063"],["Pitcairn Islands","0870"],["Poland","0048"],["Portugal","0351"],["Puerto Rico","0001"],["Qatar","0974"],["Republic of the Congo","0242"],["Romania","0040"],["Russia","0007"],["Rwanda","0250"],["Saint Barthelemy","0590"],["Saint Helena","0290"],["Saint Kitts and Nevis","1869"],["Saint Lucia","1758"],["Saint Martin","1599"],["Saint Pierre and Miquelon","0508"],["Saint Vincent and the Grenadines","1784"],["Samoa","0685"],["San Marino","0378"],["Sao Tome and Principe","0239"],["Saudi Arabia","0966"],["Senegal","0221"],["Serbia","0381"],["Seychelles","0248"],["Sierra Leone","0232"],["Singapore","0065"],["Slovakia","0421"],["Slovenia","0386"],["Solomon Islands","0677"],["Somalia","0252"],["South Africa","0027"],["South Korea","0082"],["Spain","0034"],["Sri Lanka","0094"],["Sudan","0249"],["Suriname","0597"],["Swaziland","0268"],["Sweden","0046"],["Switzerland","0041"],["Syria","0963"],["Taiwan","0886"],["Tajikistan","0992"],["Tanzania","0255"],["Thailand","0066"],["Timor-Leste","0670"],["Togo","0228"],["Tokelau","0690"],["Tonga","0676"],["Trinidad and Tobago","1868"],["Tunisia","0216"],["Turkey","0090"],["Turkmenistan","0993"],["Turks and Caicos Islands","1649"],["Tuvalu","0688"],["Uganda","0256"],["Ukraine","0380"],["United Arab Emirates","0971"],["United Kingdom","0044"],["United States","0001"],["Uruguay","0598"],["US Virgin Islands","1340"],["Uzbekistan","0998"],["Vanuatu","0678"],["Venezuela","0058"],["Vietnam","0084"],["Wallis and Futuna","0681"],["West Bank","0970"],["Yemen","0967"],["Zambia","0260"],["Zimbabwe","0263"]];window.ElementIndex||(ElementIndex={},ElementIndex.Index=new Hashtable);ElementIndex.Add=function(n){this.Index.put(n.Id,n)};ElementIndex.Remove=function(n){n.Id&&this.Index.remove(n.Id)};ElementIndex.Get=function(n){return this.Index.get(n)};ElementIndex.Find=function(n){for(var r=null,i=this.Index.values(),t=0;t<i.length;t++)if(n(i[t])){r=i[t];break}return r};ElementIndex.FindAll=function(n){for(var r=[],i=this.Index.values(),t=0;t<i.length;t++)n(i[t])&&r.push(i[t]);return r};ElementIndex.GetByClassName=function(n){var t=[];return n&&this.Index.each(function(i,r){r.MyClassName==n&&(t[t.length]=r)}),t};ElementIndex.GetByName=function(n){var t=[];return n&&this.Index.each(function(i,r){r.CorrespondsToName(n)&&t.push(r)}),t};ElementIndex.GetFirstByName=function(n){var r=null,i,t;if(n)for(i=this.Index.values(),t=0;t<i.length;t++)if(i[t].Name==n){r=i[t];break}return r};ElementIndex.GetLastByName=function(n){var t=null;return n&&this.Index.each(function(i,r){r.Name==n&&(t=r)}),t};ElementBase.prototype.GetXmlNodeData=function(n){var t,i,r;this.Preserve={};this.Events=new EventCollection(this,n);this.IsInFocus=n.getAttribute("in_focus")=="true";this.Dependencies=(n.getAttribute("dependencies")||"").split(",");this.HasVisibilityConditions=n.getAttribute("has_visibility")=="true";this.HasVisibilityDependencies=n.getAttribute("visibility_dependency")=="true";this.IsVisibilityRoot=n.getAttribute("is_visibility_root")=="true";this.IsVisibilityRoot&&(t=n.selectSingleNode("./UpdateVisibilitiesMacro"),this.UpdateVisibilitiesMacro=new MacroElement(this,t.firstChild),t=n.selectSingleNode("./UpdateButtonsMacro"),this.UpdateButtonsMacro=new MacroElement(this,t.firstChild));this.IsElementForButtonCondition=n.getAttribute("is_button_condition")=="true";i=n.selectSingleNode("./DragableDescription");i?(this.DragableDescription=new DragableElementDescription(this,i),i=null,this.IsDragable=!0):this.IsDragable=!1;r=n.selectSingleNode("./DndAllowances");r?(this.DnDContainerAttributes=new DnDContainerElementAttributes(r,this),this.IsDragAndDropContainer=!0):this.IsDragAndDropContainer=!1;this.IsDesignMode=n.getAttribute("is_design_mode")=="true"};ElementBase.prototype.GetDependencies=function(n){for(var i=[],t=this.Parent,r;t&&!t.IsContextEndpoint;)t=t.Parent;return t&&(r=this,t.OnEach(function(t){return t.DependsOnElement(r,n)&&i.push(t.Name),OnEachResult.Continue})),i};ElementBase.prototype.DependsOnElement=function(n,t){if(this.Dependencies)for(var i=0;i<this.Dependencies.length;i++)if(this.Dependencies[i]==n.Name||this.Dependencies[i]==t)return!0;return!1};ElementBase.prototype.MarkAsInvalid=function(n){var i,r,t;for(this.RemoveMessage(),i=this.Parent;i;)i.IsCollapsible&&IsFunction(i.Expand)&&i.Expand(),i=i.Parent;r=this.BuildMessageContainer();t=document.createElement("div");this.Message=t;t.appendChild(document.createTextNode(n));AddCssClass(t,"InvalidElementMessage");AddCssClass(t,"Hidden");AddCssClass(t,"alert alert-warning");window.setTimeout(function(){RemoveCssClass(t,"Hidden")},100);r.appendChild(t)};ElementBase.prototype.BuildMessageContainer=function(){var n=document.createElement("div"),t;return AddCssClass(n,"InvalidElementMessageContainer"),this.MessageContainer=n,t=this.GetRootElement(),t.insertBefore(n,t.firstChild),n};ElementBase.prototype.RemoveMessage=function(){if(this.MessageContainer){var n=this.MessageContainer;this.MessageContainer=null;AddCssClass(this.Message,"Hidden");this.Message=null;window.setTimeout(function(){try{n.parentNode.removeChild(n)}catch(t){}},1e3)}};ElementBase.prototype.UpdateVisibilities=function(n,t){var i=this.UpdateVisibilitiesMacro,r,u;i.ClearClientArguments();i.AddClientArgument(WorkflowValueName.VisibilityRootId,this.Id);n&&i.AddClientArgument(WorkflowValueName.ElementId,n.Id);r=[];u=function(n){if(n.MyClassName=="BreadcrumbElement")var t=n.Title;return n.HasVisibilityConditions&&r.push(n.Name),OnEachResult.Continue};this.OnEach(u);i.AddClientArgument(WorkflowValueName.VisibleElements,r.join(","));i.PerformAction(null,null,t)};ElementBase.prototype.UpdateButtons=function(n,t){var i=this.UpdateButtonsMacro;i.ClearClientArguments();n&&i.AddClientArgument(WorkflowValueName.ElementId,n.Id);i.PerformAction(null,null,t)};ElementBase.prototype.Find=function(n){var t=null;return this.OnEach(function(i){return n(i)?(t=i,OnEachResult.BreakTree):OnEachResult.Continue}),t};ElementBase.prototype.OnEach=function(n){var i=n(this),t;if(i==OnEachResult.Continue)for(t=this.FirstChild;t;){if(i=t.OnEach(n),i==OnEachResult.BreakTree)break;t=t.NextSibling}return i};ElementBase.prototype.CorrespondsToName=function(n){return this.Name==n};ElementBase.prototype.GetLabelWidth=function(){return-1};ElementBase.prototype.AdjustLabelWidth=function(){};ElementBase.prototype.UpdateContent=function(){throw new Error("Not implemented");};ElementBase.prototype.AttachMeToElement=function(n){n.MyElement=this};ElementBase.prototype.GetSelectionAsQuery=function(){};ElementBase.prototype.GetValuesAsQuery=function(){};ElementBase.prototype.XmlResponse=function(){};ElementBase.prototype.IsReadyToBeProcessed=function(){return!0};ElementBase.prototype.AppendChildElements=function(n){for(var i=function(t){n.push(t);t.AppendChildElements(n);for(var r=t.FirstChild;r;)i(r),r=r.NextSibling},t=this.FirstChild;t;)i(t),t=t.NextSibling};ElementBase.prototype.GetFieldValuesAsQuery=function(n){var t=function(t){return t.GetValuesAsQuery(n),OnEachResult.Continue};this.OnEach(t)};ElementBase.prototype.OnResize=function(){this._mySavedCoordinates=null;for(var n=this.FirstChild;n;)n.OnResize(),n=n.NextSibling};ElementBase.prototype.GetMyCoordinates=function(){if(!this._mySavedCoordinates||!0){var n=this.GetRootElement()||this.GetBodyElement(),t=getElementAbsolutePos(n),i=new LayerSize(n);this._mySavedCoordinates={};this._mySavedCoordinates.Top=t.y;this._mySavedCoordinates.Left=t.x;this._mySavedCoordinates.Width=i.Width;this._mySavedCoordinates.Height=i.Height}return this._mySavedCoordinates};ElementBase.prototype.GetMyPageLayer=function(){for(var t=null,n=this.Parent;n;){if(n.IsPageLayer){t=n;break}n=n.Parent}return t};ElementBase.prototype.GetParentBody=function(){return this.Parent.GetBodyElement(this)};ElementBase.prototype.GetBodyElement=function(){return this._body||(this._body=this.Body?this.Body:document.getElementById(this.Id)),this._body};ElementBase.prototype.GetRootElement=function(){return this._root||(this._root=this.Root?this.Root:document.getElementById(this.Id)),this._root};ElementBase.prototype.RemoveChildren=function(){for(var n=this.FirstChild;n;)this.RemoveChild(n),n=n.NextSibling};ElementBase.prototype.Destroy=function(){var n,t;this.BeforeDestroyed&&this.BeforeDestroyed();this.RemoveChildren();n=this.GetBodyElement();n&&n!=document.body&&(n.parentNode&&n.parentNode.removeChild(n),n=null);t=this.GetRootElement();t&&t.parentNode&&t!=document.body&&(t.parentNode.removeChild(t),t=null);this._root=null;this._body=null;this.Body=null;this.CleanUp&&this.CleanUp()};ElementBase.prototype.Delete=function(){this.Destroy();ElementIndex.Remove(this)};ElementBase.prototype.FadeAway=function(){this.Remove()};ElementBase.prototype.Reveal=function(){var n=this.GetRootElement();AddCssClass(n,"HiddenElement");window.setTimeout(function(){AddCssClass(n,"VisibleElement")},100)};ElementBase.prototype.GetCDataValue=function(n,t){return GetCDataValue(n,t)};ElementBase.prototype.GetTranslation=function(n,t){return GetTranslation(n,t)};ElementBase.prototype.Constructor=function(n,t){(n!=null||t!=null)&&(this.MyClassName=BRIX.Utilities.GetClassName(this),this.Parent=n,this.Id=GetNewId(),ElementIndex.Add(this),t!=null)&&(this.Name=t.getAttribute?t.getAttribute("name")||"":t.name,this.GetXmlNodeData(t))};ElementBase.prototype.Initialize=function(){this.Initialized||(ElementIndex.Add(this),this.InitializeMe(),this.InitializeChildNodes(),window.BrixResponsive==!0&&this.PostInitializedResponsive?this.PostInitializedResponsive():this.PostInitialized&&this.PostInitialized(),this.Initialized=!0)};ElementBase.prototype.InitializeChildNodes=function(){for(var n=this.FirstChild;n;)n.Initialize(),n=n.NextSibling};ElementBase.prototype.InitializeMe=function(){throw new Error("\n"+this.MyClassName+"\nDescendant class must override this member ('InitializeMe')");};ElementBase.prototype.CreateChildNodes=function(n){var r=[],t,i,u;if(n){for(t=0;t<n.childNodes.length;t++)i=n.childNodes[t],u=null,IsFunction(window[i.nodeName])&&IsDefined(window[i.nodeName].prototype.ElementNodeInterface)&&r.push(this.CreateChildNode(i));return r}};ElementBase.prototype.CreateInstance=function(n,t){var i=t?t:n.nodeName;return new window[i](this,n)};ElementBase.prototype.CreateChildNode=function(n,t){var i=this.CreateInstance(n,t);return this.AppendChild(i),i.ElementNodeInterface&&i.CreateChildNodes(n),i};ElementBase.prototype.FindWorkspace=function(){for(var t=null,n=this.FirstChild;n;){if(n.IsWorkspace){t=n;break}else if(t=n.FindWorkspace(),t)break;n=n.NextSibling}return t};ElementBase.prototype.ReloadElementFromNode=function(n){var i,r,e,t,u,f;if(n!=null){if(i=null,r=GetXmlRootNode(n),r.nodeName=="response"?(i=r.selectSingleNode(this.MyClassName),i==null&&(e=new ClientOperations(r),i=e.GetFirstResponseNode())):i=r,t=this,i.nodeName!=this.MyClassName)for(u=this.Parent;u;){if(u.MyClassName==i.nodeName){t=u;break}u=u.Parent}i.nodeName==t.MyClassName?t.ContentReloader?t.ContentReloader(i):(t.Destroy(),f=t.Preserve,t.GetXmlNodeData(i),f&&(t.Preserve=f),t.CreateChildNodes(i),t.InitializeMe(),t.InitializeChildNodes(),t.OnResize()):(t.RemoveChildren(),t.CreateChildNodes(r.parentNode),t.InitializeChildNodes(),t.OnResize(),t.FirstChild||t.Remove());t.Parent&&t.Parent.OnResize()}};ElementBase.prototype.GetDescendantByName=function(n){var t=null,i=function(i){return i.Name==n?(t=i,OnEachResult.BreakTree):OnEachResult.Continue};return this.OnEach(i),t};ElementBase.prototype.GetNextChildByClass=function(n){for(var t=this.FirstChild;t;){if(t.MyClassName==n)break;t=t.NextSibling}return t};ElementBase.prototype.GetLastChildByClass=function(n){for(var t=this.LastChild;t;){if(t.MyClassName==n)break;t=t.PreviousSibling}return t};ElementBase.prototype.GetNextSiblingByClass=function(n){for(var t=this.NextSibling;t;){if(t.MyClassName==n)break;t=t.NextSibling}return t};ElementBase.prototype.GetPreviousSiblingByClass=function(n){for(var t=this.PreviousSibling;t;){if(t.MyClassName==n)break;t=t.PreviousSibling}return t};ElementBase.prototype.FindAncestor=function(n){for(var t=this.Parent;t;){if(n(t))break;t=t.Parent}return t};ElementBase.prototype.GetAncestorByClass=function(n){return this.FindAncestor(function(t){return t.MyClassName==n})};ElementBase.prototype.InsertBefore=InsertBefore;ElementBase.prototype.InsertAfter=InsertAfter;ElementBase.prototype.AppendChild=AppendChild;ElementBase.prototype.RemoveChild=RemoveChild;ElementBase.prototype.Remove=function(){this.Parent?this.Parent.RemoveChild(this):this.Delete()};ElementBase.prototype.IsWithinPosition=function(n,t){var i=this.GetMyCoordinates();return(n>i.Left&&n<i.Left+i.Width)?isWithin=t>i.Top&&t<i.Top+i.Height:!1};ElementBase.prototype.GetAreaOfPosition=function(){return"All"};ElementBase.prototype.DnDHoverReactionOn=function(){var n=this.GetRootElement();n&&AddCssClass(n,"DndHoverReaction")};ElementBase.prototype.DnDHoverReactionOff=function(){var n=this.GetRootElement();n&&RemoveCssClass(n,"DndHoverReaction")};ElementBase.prototype.DnDHoverIn=function(){this.IsHovered=!0;var n=this.GetRootElement();n&&AddCssClass(n,"DndHover")};ElementBase.prototype.DnDHoverOut=function(){this.IsHovered=!1;var n=this.GetRootElement();n&&RemoveCssClass(n,"DndHover")};ElementBase.prototype.DropElementOnMe=function(n,t,i,r,u,f,e,o){var s=this.DnDContainerAttributes.GetMacroByType(n,t),h=this.DragableDescription;s.ClearClientArguments();s.AddClientArgument(WorkflowValueName.DroppedArea,t);s.AddClientArgument(WorkflowValueName.DroppedObjectType,n.Type);s.AddClientArgument(WorkflowValueName.DroppedObjectId,n.Id);s.AddClientArgument(WorkflowValueName.DroppedObjectTag,n.Tag);h&&(s.AddClientArgument(WorkflowValueName.DroppedOnObjectType,h.Type),s.AddClientArgument(WorkflowValueName.DroppedOnObjectId,h.Id),s.AddClientArgument(WorkflowValueName.DroppedOnObjectTag,h.Tag));var a=new Position2D(i,r),v=this.GetBodyPosition(),c=a.SubtractPosition(v),l=u?new Position2D(u(c.X),u(c.Y)):c;s.AddClientArgument("x",Math.round(l.X));s.AddClientArgument("y",Math.round(l.Y));IsDefined(e)&&s.AddClientArgument("_scroll_left",e);IsDefined(o)&&s.AddClientArgument("_scroll_top",o);f&&s.AddClientArgument("unit",f);this.PostDnD&&s.AppendCallbackMacro(this.PostDnD);n.Element.PostDnD&&s.AppendCallbackMacro(n.Element.PostDnD);s.PerformAction()};ElementBase.prototype.GetBodyPosition=function(){var n=LayerScreenPosition(this.GetBodyElement());return new Position2D(n.Left,n.Top)};ElementBase.prototype.MakeRoomAbove=function(){this.TargetVerticalTransition!=this.HoverPadding&&(this.TargetVerticalTransition=this.HoverPadding,this.VerticalTransition())};ElementBase.prototype.RemoveRoomAbove=function(){this.TargetVerticalTransition!=this.NormalPadding&&(this.TargetVerticalTransition=this.NormalPadding,this.VerticalTransition())};ElementBase.prototype.SetVerticalSpacing=function(n){this.GetRootElement().style.paddingTop=n+"px"};ElementBase.prototype.VerticalTransition=function(){var n=!1;this.CurrentVerticalTransition>this.TargetVerticalTransition?(this.CurrentVerticalTransition-=this.VerticalTransitionSpeed,this.CurrentVerticalTransition<this.TargetVerticalTransition&&(this.CurrentVerticalTransition=this.TargetVerticalTransition),n=!0):this.CurrentVerticalTransition<this.TargetVerticalTransition?(this.CurrentVerticalTransition+=this.VerticalTransitionSpeed,this.CurrentVerticalTransition>this.TargetVerticalTransition&&(this.CurrentVerticalTransition=this.TargetVerticalTransition),n=!0):n=!1;n&&(this.SetVerticalSpacing(this.CurrentVerticalTransition),window.setTimeout('var element=ElementIndex.Get("'+this.Id+'"); if(element) element.VerticalTransition();',10))};ElementBase.prototype.EnableInteraction=function(){this.IsDragable&&(this.InitializeTracker(),this.DragAndDropHandle=DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription));this.ContextMenu&&(this.InitializeTracker(),this.ContextMenuHandle=this.EventTracker.AddCallback("click",this,"ShowContextMenu"))};ElementBase.prototype.DisableInteraction=function(){this.IsDragable&&this.DragAndDropHandle&&(this.EventTracker.RemoveCallback(this.DragAndDropHandle),this.DragAndDropHandle=null);this.ContextMenuHandle&&(this.EventTracker&&this.EventTracker.RemoveCallback(this.ContextMenuHandle),this.ContextMenuHandle=null)};ElementBase.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(this.Id))};ElementBase.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};CssElement.InheritsFrom(ElementBase);CssElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Key=n.getAttribute("key");this.Css=GetCDataValue(n,"css");this.Imports=(n.getAttribute("imports")||"").split(",")};CssElement.prototype.InitializeMe=function(){var n=document.createElement("style"),t,i,r;n.setAttribute("type","text/css");t=document.createTextNode(this.Css);n.appendChild(t);i=document.getElementsByTagName("head")[0];i.appendChild(n);this.AddImports();this.Body=n;this.ApplyCssClass();r=this};CssElement.prototype.AddImports=function(){for(var i,n,r=document.getElementsByTagName("head")[0],t=0;t<this.Imports.length;t++)i=this.Imports[t],i&&(n=document.createElement("link"),n.rel="stylesheet",n.type="text/css",n.href=i,r.appendChild(n))};CssElement.prototype.ApplyCssClass=function(){for(var n=this.Parent,t;n;){if(n.IsCssDivider)break;n=n.Parent}n&&(t=n.GetRootElement(),AddCssClass(t,this.Key))};JavascriptElement.InheritsFrom(ElementBase);JavascriptElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Script=GetCDataValue(n,"script")};JavascriptElement.prototype.InitializeMe=function(){try{window.eval(this.Script)}catch(ex){alert(ex)}};JavascriptElement.prototype.ApplyCssClass=function(){for(var n=this.Parent,t;n;){if(n.IsCssDivider)break;n=n.Parent}n&&(t=n.GetRootElement(),AddCssClass(t,this.Key))};PositionedElement.InheritsFrom(ElementBase);PositionedElement.prototype.GetXmlNodeData=function(n){var r,u,f,t,e,i;for(ElementBase.prototype.GetXmlNodeData.call(this,n),this.HeaderHeight=0,this.Columns=!1,this.IsPositionedElement=!0,this.OffsetPosition={},this.OffsetPosition.Top=0,this.OffsetPosition.Left=0,this.HorizontalFillFactor=1,this.VerticalFillFactor=1,this.IsNonFloating=n.getAttribute("nonfloating")=="true",this.IsDesignerElement=n.getAttribute("is_designer_element")=="true",this.Top=Number(n.getAttribute("top"))||0,this.Left=Number(n.getAttribute("left"))||0,this.Top==-1&&(this.Top="center"),this.Left==-1&&(this.Left="center"),this.BorderSize=Number(n.getAttribute("border_size"))||0,this.BorderSizeLeft=Number(n.getAttribute("border_size_left"))||this.BorderSize,this.BorderSizeRight=Number(n.getAttribute("border_size_right"))||this.BorderSize,this.BorderSizeTop=Number(n.getAttribute("border_size_top"))||this.BorderSize,this.BorderSizeBottom=Number(n.getAttribute("border_size_bottom"))||this.BorderSize,this.BorderStyle=window[n.getAttribute("border_style")||"NoBorder"],r=n.getAttribute("width"),this.Width=r==null&&this.Width>0?this.Width:Number(r)||ElementSizeFill,u=n.getAttribute("height"),this.Height=u==null&&this.Height>0?this.Height:Number(u)||ElementSizeFill,this.Height!="fill"&&this.Height!="fit"&&(this.Height=Number(this.Height)),f=n.selectNodes("Menu"),this.Menus={},t=0;t<f.length;t++)e=f[t],i=new Menu(this),i.InitializeFromXml(e),this.Menu||(this.Menu=i),this.Menus[t]=i;this.AjaxUrl=n.getAttribute("url")||null;this.AbsolutePosition=n.getAttribute("absolute")=="true";(this.BorderSize||this.BorderSizeLeft||this.BorderSizeRight||this.BorderSizeTop||this.BorderSizeBottom)&&(this.BorderController=new BorderController(this.Id,this.BorderStyle,this.BorderSizeLeft,this.BorderSizeRight,this.BorderSizeTop,this.BorderSizeBottom));this.GetXmlNodeData_Addon&&this.GetXmlNodeData_Addon(n)};PositionedElement.prototype.OnResize=function(){ElementBase.prototype.OnResize.call(this)};PositionedElement.prototype.GetPixelHeight=function(){return this.GetPixelSize("Height")};PositionedElement.prototype.GetPixelWidth=function(){return this.GetPixelSize("Width")};PositionedElement.prototype.GetAbsolutePosition=function(n){var r=this[n],t=0;if(r=="center"){var u=this.GetMyPageLayer(),f=u.GetRootElement(),e=LayerScrollSize(f),i=n=="Top"?"Height":"Width";t=this[i]==ElementSizeFill?0:e[i]/2-this[i]/2}else t=r;return t};PositionedElement.prototype.GetPositionTop=function(){return this.GetPositionOffset("Top")};PositionedElement.prototype.GetPositionLeft=function(){return this.GetPositionOffset("Left")};PositionedElement.prototype.GetPositionOffset=function(n){var t,r,i;if(this.AbsolutePosition)return this.GetAbsolutePosition(n);if(this.IsNonFloating&&(n=="Top"||n=="Left"))return 0;if(t=n=="Top"?this._cachedTop:this._cachedLeft,t!=null)return t;if(t=0,r=this.Parent?this.Parent.ColumnsEnabled||!1:!1,r&&n=="Top")t=0;else if(r||n!="Left")for(i=this.PreviousSibling;i;)i.IsPositionedElement&&(t+=i.GetPixelSize(n=="Top"?"Height":"Width")),i=i.PreviousSibling;else t=0;return t+=this.OffsetPosition[n],t=t<0?0:t,n=="Top"?this._cachedTop=t:this._cachedLeft=t,t};PositionedElement.prototype.GetPixelSize=function(n){var t=n=="Width"?this._cachedWidth:this._cachedHeight,r,f,e,u,s;if(t=t?0:0,r=this[n],f=this.Parent.ColumnsEnabled||!1,n!="Width"||f||r!=ElementSizeFill)if(n=="Height"&&r=="fit")e=this.BorderSizeTop+this.BorderSizeBottom,u=this.GetBodyElement(),t=(u?LayerScrollSize(u).Height:0)+e;else if(n=="Width"&&r=="fit")e=this.BorderSizeLeft+this.BorderSizeRight,u=this.GetBodyElement(),t=(u?LayerScrollSize(u).Width:0)+e;else if(n=="Height"&&f&&r==ElementSizeFill)t=this.GetParentBodySize(n)*this.VerticalFillFactor;else if(r==ElementSizeFill){for(var c=this.GetParentBodySize(n),h=0,o=1,i=this.Parent.FirstChild;i;)i.IsPositionedElement&&i.Id!=this.Id&&(i[n]==ElementSizeFill?o++:h+=i[n]=="fit"?i.GetPixelSize(n):i[n]),i=i.NextSibling;f&&n=="Height"&&(o=1);s=c-h;t=s==0?0:s/o;t=t*this.HorizontalFillFactor}else t=r;else t=this.GetParentBodySize(n)*this.HorizontalFillFactor;return t=t<0?0:t,n=="Width"?this._cachedWidth=t:this._cachedHeight=t,t};PositionedElement.prototype.GetParentSize=function(n){if(this.Parent.IsPositionedElement)return this.Parent.GetPixelSize(n,!0);var r=this.Parent.GetRootElement(),i=LayerScrollSize(r),t=0;switch(n){case"Height":t=i.Height;break;case"Width":t=i.Width}return t};PositionedElement.prototype.GetParentBodySize=function(n){var t=0,i,r;return this.Parent.IsPositionedElement?t=this.Parent.GetPixelSize(n,!0)-(n=="Height"?this.Parent.BorderSizeTop+this.Parent.BorderSizeBottom+this.Parent.HeaderHeight:this.Parent.BorderSizeLeft+this.Parent.BorderSizeRight):(i=this.Parent.GetBodyElement(),r=new LayerSize(i),t=r[n]),t};PositionedElement.prototype.PostInitialized=function(){this.LoadUrl()};PositionedElement.prototype.LoadUrl=function(n){var i=null,t;return n&&(this.AjaxUrl=n),this.AjaxUrl&&(t=this.AjaxUrl,t+=t.indexOf("?")==-1?"?":"&",i=requestIndex.GetRequest(MakeHttpRequest(t+"&"+WorkflowValueName.ElementId+"="+this.Id,ElementNodeXmlResponse,!0,"GET",ElementNodeXmlFailedToLoad))),i};PositionedElement.prototype.XmlResponse=function(n){this.RemoveChildren();this.CreateChildNodes(n);this.InitializeChildNodes();this.OnResize()};PositionedElement.prototype.IsWithinPosition=function(n,t){var f=this.GetBodyElement(),i=new LayerPosition(f),r=i.Left,u=i.Top,e=this.GetPixelWidth(),o=this.GetPixelHeight();return(n>r&&n<r+e)?t>u&&t<u+o:!1};SectionElement.InheritsFrom(PositionedElement);SectionElement.prototype.GetBodyElement=function(){return this.ContentElement};SectionElement.prototype.CleanUp=function(){this.ContentElement=null};SectionElement.prototype.GetXmlNodeData=function(n){PositionedElement.prototype.GetXmlNodeData.call(this,n);this.ColumnsEnabled=n.getAttribute("columns_enabled")=="true"||!1;this.IsWorkspace=n.getAttribute("isworkspace")=="true"||!1;this.Content=this.GetCDataValue(n,"Content")};SectionElement.prototype.OnResize=function(){var t,n,i;(this._cachedWidth=null,this._cachedHeight=null,this._cachedTop=null,this._cachedLeft=null,this.RootElement)&&(t=this.RootElement,n={},n.top=this.GetPositionOffset("Top"),n.left=this.GetPositionOffset("Left"),n.width=this.GetPixelWidth(),n.height=this.GetPixelHeight(),t.style.top=n.top+"px",t.style.left=n.left+"px",t.style.width=n.width+"px",t.style.height=n.height+"px",this.BorderController&&this.BorderController.Resize(0,0,n.width,n.height),this.HeaderHeight&&(n.height-=this.HeaderHeight),i=this.ContentElement,i.style.top=this.BorderSizeTop+0+"px",i.style.left=this.BorderSizeLeft+"px",i.style.width=this.GetBodyWidth(n.width)+"px",i.style.height=this.GetBodyHeight(n.height)+"px",PositionedElement.prototype.OnResize.call(this))};SectionElement.prototype.GetBodyWidth=function(n){var t=n?n:this.GetPixelWidth();return t-=this.BorderSizeLeft+this.BorderSizeRight,t<0?0:t};SectionElement.prototype.GetBodyHeight=function(n){var t=n?n:this.GetPixelHeight();return t-=this.BorderSizeTop+this.BorderSizeBottom,t<0?0:t};SectionElement.prototype.EditorHover=function(n){HoverElement(this,this.GetBodyElement(),new EventInfo(n))};SectionElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t=document.createElement("div");this.ContentElement=t;this.RootElement=n;this.ContentElement.style.position="relative";this.RootElement.style.position="absolute";this.HeaderElement&&n.appendChild(this.HeaderElement);n.id=this.Id;this.Parent.GetBodyElement().appendChild(n);this.BorderController&&this.BorderController.Load(n);t.style.overflow="auto";this.Content.length>0&&(t.innerHTML=this.Content);t.id=this.Id+"_body";n.appendChild(t);this.IsDesignerElement&&(this.ContentElement.ParentElement=this,this.ContentElement.onmouseover=function(n){this.ParentElement.EditorHover(n)});this.InitializeMe_2&&this.InitializeMe_2()};PageLayerElement.InheritsFrom(ElementBase);PageLayerElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;AddCssClass(n,"PageLayer");n.PageElement=this;t=this.Parent.GetBodyElement();t.appendChild(n);n.id=this.Id;this.InitializeMe_2&&this.InitializeMe_2()};PageLayerElement.prototype.PostInitialized=function(){};PageLayerElement.prototype.Close=function(){this.Remove()};PageLayerElement.prototype.OpenWorkspace=function(n){var t=null,i=this.FindWorkspace();return i?(n+="&"+TargetWorkflowValueName.ElementId+"="+i.Id,t=i.LoadUrl(n)):t=this.OpenDialog(n).LastRequest,t};PageLayerElement.prototype.OpenWorkspaceFromXml=function(n){var t=this.FindWorkspace();return t?t.CreateChildNode(n):t=this.OpenDialogFromXml(n),t};PageLayerElement.prototype.OpenDialogFromXml=function(n,t){var i=this.CreateNewLayer(),r,f,u;return i.IsDialogLayer=!0,r=new FakeXml("BackgroundElement"),r.Attributes.color="#000",r.Attributes.opacity=t||3,f=i.CreateChildNode(r),u=i.CreateChildNode(n),u.IsDialogWindow=!0,i.Initialize(),u};PageLayerElement.prototype.OpenDialog=function(n,t,i,r,u,f){var s=this.CreateNewLayer(),e,h,o;return s.IsDialogLayer=!0,e=new FakeXml("BackgroundElement"),e.Attributes.color="#444444",e.Attributes.opacity=f||2,h=s.CreateChildNode(e),e=new FakeXml("WindowElement"),e.Attributes.top=i||"center",e.Attributes.left=t||"center",e.Attributes.width=r||"320",e.Attributes.height=u||"200",e.Attributes.url=n||"",e.Attributes.border_size=10,o=s.CreateChildNode(e),o.IsDialogWindow=!0,o.AjaxUrl=n+"&"+TargetWorkflowValueName.ElementId+"="+o.Id,s.Initialize(),o};PageLayerElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};PageLayerElement.prototype.CreateNewLayer=function(){var n;return n=new FakeXml("PageLayerElement"),this.CreateChildNode(n)};PageElement.InheritsFrom(PageLayerElement);PageElement.prototype.GetXmlNodeData=function(n){PageLayerElement.prototype.GetXmlNodeData.call(this,n);this.IsPublic=n.getAttribute("public");this.LanguageCode=n.getAttribute("formLanguage");this.AddGoogleTagTracker=n.getAttribute("add_google_tag")==="true";this.GoogleTagTrackerFormId=n.getAttribute("google_tag_id");this.KeysDown=[];this.Name="RootElement";this.IsCssDivider=!0;this.IsTestMode=n.getAttribute(WorkflowValueName.TestMode);this.TestModeMessage=n.getAttribute(WorkflowValueName.TestModeMessage)};PageElement.prototype.InitializeMe=function(){var t=function(n){return n},n;this.AbsPosConversion={FromPixels:t,ToPixels:t};this.IsTestMode&&$("#TestModeMessage").show();n=document.body;$("#TestModeMessageText").html(this.TestModeMessage);n.id=this.Id;AddCssClass(n,"Page");this.IsPublic&&AddCssClass(n,"PublicPage");this.AddGoogleTagTracker&&jQuery(document).ready(addGoogleTag(this.GoogleTagTrackerFormId));window.onresize=this.OnResize;this.EventTracker=new EventTracking(null,n);this.EventTracker.AddCallback("key down",this,"OnKeyDown");this.EventTracker.AddCallback("key up",this,"OnKeyUp");document.documentElement.lang=ConvertToISO(this.LanguageCode)};PageElement.prototype.GetBodyElement=function(){return BRIX.UIAction&&BRIX.UIAction.LatestWorkspace?BRIX.UIAction.LatestWorkspace.ContentNode:document.getElementById(this.Id)!=null?document.getElementById(this.Id):document.body};PageElement.prototype.KeysAdd=function(){};PageElement.prototype.KeysRemove=function(){};PageElement.prototype.IsKeyDown=function(n){var t=this.KeysDown.indexOf(n);return t!=-1};PageElement.prototype.OnKeyDown=function(n){this.KeysAdd(n)};PageElement.prototype.OnKeyUp=function(n){this.KeysRemove(n)};PageElement.prototype.OnResize=function(){if(this.ResizeHandle){var n=this.ResizeHandle;this.ResizeHandle=null;window.clearTimeout(n)}this.ResizeHandle=window.setTimeout(function(){for(var n=window.Page.FirstChild;n;)n.OnResize(),n=n.NextSibling},100)};PageElement.prototype.RunAdHocMacro=function(n){var t=new MacroElement(this,n);t.PerformAction()};PageElement.prototype.GetContextCoordinates=function(){var n=new Size(5,5),t=new Position2D(100,100);return new Coordinates(t,n)};BackgroundElement.InheritsFrom(ElementBase);BackgroundElement.prototype.GetXmlNodeData=function(n){this.Color=n.getAttribute("color")||null;this.Image=n.getAttribute("image")||null;this.VerticalAlignment=n.getAttribute("verticalalign")||"top";this.HorizontalAlignment=n.getAttribute("horizontalalign")||"left";var t=n.getAttribute("repeat")||"";this.RepeatX=t.indexOf("x")!=-1;this.RepeatY=t.indexOf("y")!=-1;this.Opacity=Number(n.getAttribute("opacity"))||null};BackgroundElement.prototype.InitializeMe=function(){var t=this.Parent.GetBodyElement(),n=new Color(this.Color),i=IsDefined(this.Opacity)?this.Opacity/10:1;t.style.backgroundColor="rgba("+n.Red+", "+n.Green+", "+n.Blue+", "+i+")";return};FormElement.InheritsFrom(SectionElement);FormElement.prototype.GetXmlNodeData=function(n){var i,r,t;for(SectionElement.prototype.GetXmlNodeData.call(this,n),this.HiddenFields=[],i=0;i<n.childNodes.length;i++)r=n.childNodes[i],r.nodeName=="HiddenField"&&(t={},t.Name=r.getAttribute("name"),t.Value=t.firstChild.nodeValue,this.HiddenFields[this.HiddenFields.length]=t);this.CellId=n.getAttribute("cellid")||null};FormElement.prototype.InitializeMe=function(){var t=document.createElement("div"),n,r,u,f,i;for(t.style.overflow="auto",t.id=this.Id,this.Parent.GetBodyElement().appendChild(t),n=document.createElement("form"),n.topmargin="0px",n.method="POST",n.FormElement=this,this.FormNode=n,t.appendChild(n),n.id=this.Id+"_form",r=0;r<this.HiddenFields.length;r++)u=this.HiddenFields[r],f=CreateInput(u.Name),f.value=u.Value,n.appendChild(f);i=document.createElement("div");i.style.overflow="auto";i.innerHTML=this.Content;n.appendChild(i);i.id=this.Id+"_body";this.ContentElement=i;this.RootElement=t;this.BorderController&&this.BorderController.Load(t);this.InitializeMe_2&&this.InitializeMe_2()};DataElement.InheritsFrom(ElementBase);DataElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.OriginalLabelWidth=-1;this.IsValid=n.getAttribute("is_invalid")!=="true";this.IsReadMode=n.getAttribute("read_mode")==="true";var t=n.getAttribute("nameprefix")||"";this.ScrollInto=n.getAttribute("scroll_into");this.FieldName=t+this.Name;this.HideCaption=n.getAttribute("hide_caption")==="true";this.Caption=GetCDataValue(n,"Caption");this.IsRequired=n.getAttribute("required")==="true";this.IsRequired&&(this.RequiredValidIcon=ActiveIconArchive.Get(RequiredFieldValidIconName),this.RequiredInvalidIcon=ActiveIconArchive.Get(RequiredFieldInvalidIconName));this.SingleInputId=this.Id+"_inp";this.CaptionCheckEmail=GetCDataValue(n,"CaptionCheckEmail");this.DoubleEmailField=n.getAttribute("double_email_check")==="true";this.CaptionWrongFiles=GetCDataValue(n,"CaptionWrongFiles");this.SecondCaptionCheckEmail=GetCDataValue(n,"SecondCaptionCheckEmail")};DataElement.prototype.InitializeMe=function(){var i=document.createElement("div"),s,r,u,t,f,n,e,o;if(AddCssClass(i,"form-group"),s=this.GetParentBody(),s.appendChild(i),this.Root=i,i.id=this.Id,r="md",!this.HideCaption&&(this.Caption||this.IsDesignMode)?(this.Label=document.createElement("label"),AddCssClass(this.Label,"control-label"),AddCssClass(this.Label,"col-"+r+"-"+this.LabelRatio),AddCssClass(this.Label,"LabelCell"),i.appendChild(this.Label),this.Label.appendChild(document.createTextNode(this.Caption)),u=this.InputRatio):u=12,t=document.createElement("div"),AddCssClass(t,"col-"+r+"-"+u),AddCssClass(t,"ControlCell"),i.appendChild(t),this.Body=t,this.Container=t,this.InputCell=t,this.ScrollInto!==null){for(f=!1,n=this;!f&&n!==null;)n=n.Parent,n!==null&&(f=n.MyClassName=="FormTemplateElement"?!0:!1);e=n!==null?n.GetDescendantByName(this.ScrollInto):null;e!==null&&(o=document.getElementById(e.Id),o!==null&&o.scrollIntoView({block:"center"}))}this.EnableInteraction()};DataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.Label&&(n=this.InputCell.getElementsByTagName("INPUT"),n.length===0&&(n=this.InputCell.getElementsByTagName("SELECT")),n.length===0&&(n=this.InputCell.getElementsByTagName("TEXTAREA")),n.length===1&&this.Label.setAttribute("for",n[0].id))};DataElement.prototype.UpdateRequirementIndicatorResponsive=function(){if(this.IsRequired){RemoveCssClass(this.Root,"has-success");RemoveCssClass(this.Root,"has-warning");RemoveCssClass(this.Root,"has-error");var t=this.Container,n=this.HasContent();n?(AddCssClass(this.Root,"has-success"),AddCssClass(this.RequiredIcon,"has-success")):RemoveCssClass(this.RequiredIcon,"has-success")}};DataElement.prototype.UpdateRequirementIndicator=function(){if(this.IsRequired){if(window.BrixResponsive===!0){this.UpdateRequirementIndicatorResponsive();return}var n=this.Container,t=this.HasContent();t?(RemoveCssClass(n,"RequirementAbsent"),AddCssClass(n,"RequirementChecked"),RemoveCssClass(this.RequiredIcon,"Absent"),AddCssClass(this.RequiredIcon,"Checked")):(RemoveCssClass(n,"RequirementChecked"),AddCssClass(n,"RequirementAbsent"),RemoveCssClass(this.RequiredIcon,"Checked"),AddCssClass(this.RequiredIcon,"Absent"))}};DataElement.prototype.GetLabelWidth=function(){return this.OriginalLabelWidth};DataElement.prototype.AdjustLabelWidth=function(n){window.BrixResponsive||this.Label&&(this.Label.style.width=n+"px",this.Body.style.paddingLeft=n+"px")};DataElement.prototype.GetBodyElement=function(){return this.InputCell};DataElement.prototype.Validate=function(){return!0};DataElement.prototype.HasContent=function(){return this.GetFieldValue?!!this.GetFieldValue():this.GetFieldValues().length>0};DataElement.prototype.OnChange=function(n,t,i){this.RemoveMessage();this.UpdateRequirementIndicator();var r=this,u=function(){var n=r.GetDependencies(i);n.length>0&&r.Events.CallEvent("ondependencyupdate",n.join(","),t||r.Name,r.Parent.Name)};this.Events.CallEvent("onchanged",n,t||this.Name,this.Parent.Name,u)};DataElement.prototype.GetValuesAsQuery=function(n){var t,i;if(!this.IsReadMode){if(!this.Name)return;t=[];this.GetFieldValue?(i=this.GetFieldValue(),i&&(t[t.length]=i)):t=this.GetFieldValues();n.Add(this.Name,t.join(","))}};DataElement.prototype.GetFieldValues=function(){var n=[],t=function(n,i){for(var r=n.FirstChild,u;r;){if(!r.Initialized)break;if(r.IsDataElement)break;if(r.IsDesignMode)break;r.GetFieldValue&&(u=r.GetFieldValue(),u&&(i[i.length]=u));t(r,i);r=r.NextSibling}};return t(this,n),n};TextInputDataElement.InheritsFrom(DataElement);TextInputDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};TextInputDataElement.prototype.GetXmlNodeData=function(n){var i,t;DataElement.prototype.GetXmlNodeData.call(this,n);this.HideInput=n.getAttribute("hide_input")==="true";this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions");this.Value=this.GetCDataValue(n,"Value");this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"";this.IsReadMode?(i=this.CreateChildNode(null,"TextElement"),i.IntendedUsage=IntendedUsage.ValueRepresentation,i.Text=this.Value):(t=this.CreateChildNode(null,"TextboxElement"),t.IsInFocus=this.IsInFocus,t.IsValid=this.IsValid,t.Value=this.Value,t.ValuePlaceholder=this.ValuePlaceholder,t.HideInput=this.HideInput,this.Textbox=t)};TextInputDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};LargeTextDataElement.InheritsFrom(DataElement);LargeTextDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top="-30%"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};LargeTextDataElement.prototype.GetXmlNodeData=function(n){var i,t;DataElement.prototype.GetXmlNodeData.call(this,n);this.Value=this.GetCDataValue(n,"Value");this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"";this.IsExtraLarge=n.getAttribute("extra_large")=="true";this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions");this.IsReadMode?(i=this.CreateChildNode(null,"TextElement"),i.IntendedUsage=IntendedUsage.ValueRepresentation,i.Text=this.Value):(t=this.CreateChildNode(null,"TextareaElement"),t.IsInFocus=this.IsInFocus,t.IsExtraLarge=this.IsExtraLarge,t.IsValid=this.IsValid,t.Value=this.Value,t.ValuePlaceholder=this.ValuePlaceholder);this.IsLargeField=!0};LargeTextDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};EmailElement.InheritsFrom(TextInputDataElement);EmailElement.prototype.GetXmlNodeData=function(n){TextInputDataElement.prototype.GetXmlNodeData.call(this,n);this.ValueSec=n.getAttribute("ValueSecEmail")||""};EmailElement.prototype.GetValuesAsQuery=function(n){if(!this.IsReadMode){if(!this.Name)return;var t=this.FirstChild.Input.value;this.DoubleEmailField&&(t=this.FirstChild.Input.value+";"+this.FirstChild.Input2.value);n.Add(this.Name,t)}};NumericElement.InheritsFrom(TextInputDataElement);NumericElement.prototype.GetXmlNodeData=function(n){TextInputDataElement.prototype.GetXmlNodeData.call(this,n);var t=n.getAttribute("format");typeof d=="undefined"||(this.Format=JSON.parse(t));this.Textbox&&(this.Textbox.GetFieldValue=function(){var n=this.Input.value;return this.Input.validity.valid||(n="error"),encodeURIComponent(n)})};NumericElement.prototype.HasContent=function(){for(var t,r=!1,i=this.GetFieldValues(),n=0;n<i.length;n++)if(typeof i[n]!="undefined"&&(t=i[n].ReplaceAll(" ","").ReplaceAll(",","."),t=new Number(t),!isNaN(t))){r=!0;break}return r};NumericElement.prototype.Validate=function(n){return BRIX.Inputs.ValidateNumericInput(n)};DoubleNumericElement.InheritsFrom(TextInputDataElement);DoubleNumericElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};DoubleNumericElement.prototype.GetXmlNodeData=function(n){var t,i;TextInputDataElement.prototype.GetXmlNodeData.call(this,n);this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions");t=n.getAttribute("format");typeof d=="undefined"||(this.Format=JSON.parse(t));this.Textbox&&(this.Textbox.GetFieldValue=function(){var n=this.Input.value;return this.Input.validity.valid||(n="error"),encodeURIComponent(n)});this.Decimals=n.getAttribute("max_decimals_value");this.Textbox&&(i=new Number(this.Value.ReplaceAll(" ","").ReplaceAll(",",".")).toFixed(this.Decimals),this.Textbox.Value=i)};DoubleNumericElement.prototype.HasContent=function(){for(var t,r=!1,i=this.GetFieldValues(),n=0;n<i.length;n++)if(typeof i[n]!="undefined"&&(t=i[n].ReplaceAll(" ","").ReplaceAll(",","."),t=new Number(t),!isNaN(t))){r=!0;break}return r};DoubleNumericElement.prototype.Validate=function(n){return BRIX.Inputs.ValidateNumericInput(n)};DoubleNumericElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};ListDataElement.InheritsFrom(DataElement);ListDataElement.prototype.GetXmlNodeData=function(n){var r,t,i;for(DataElement.prototype.GetXmlNodeData.call(this,n),this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1,this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions"),this.OptionRows=[],this.Options=[],r=n.selectNodes("Options/Option"),t=0;t<r.length;t++)i=new FieldOption(r[t]),(!i.Hidden||i.Selected)&&(this.Options[this.Options.length]=i);this.Value=this.GetCDataValue(n,"Value");this.MaxOptionsPerRow=n.getAttribute("max_options_per_row");this.UpdateOptionsPerRow()};ListDataElement.prototype.UpdateOptionsPerRow=function(){this.OptionsPerRow=(this.MaxOptionsPerRow||this.Options.length)*1;(this.OptionsPerRow>12||this.OptionsPerRow===0)&&(this.OptionsPerRow=12);this.OptionsPerRow>this.Options.length&&this.Options.length>0&&(this.OptionsPerRow=this.Options.length)};ListDataElement.prototype.RebuildOptions=function(){this.RemoveOptionElements();var n=this.CreateOptionElements();n.map(function(n){n.Initialize()})};ListDataElement.prototype.CreateOptionElements=function(){for(var t,n,r=[],i=0;i<this.Options.length;i++)t=this.Options[i],n=this.CreateChildNode(null,this.OptionElementName),n.OptionIndex=i,n.FieldName=this.Id+"_field",n.Caption=t.Caption,n.Value=t.Value,n.Checked=t.Selected,n.Disabled=t.Disabled,r.push(n);return r};ListDataElement.prototype.RemoveOptionElements=function(){var t=this.OptionElementName,n=[];this.OnEach(function(i){return i.MyClassName===t&&n.push(i),OnEachResult.Continue});n.map(function(n){n.Remove();var t=n.GetRootElement()});this.OptionRows.map(function(n){n.parentNode.removeChild(n)});this.OptionRows=[]};ListDataElement.prototype.InitializeMe=function(){DataElement.prototype.InitializeMe.call(this)};ListDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top=document.getElementById(n.Id).getElementsByClassName("ControlWrapper").item(0)!==null?"-50%":"-100%"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};ListDataElement.prototype.GetOptionBody=function(n){var u,f,i,t,e,r;return this.UpdateOptionsPerRow(),u=this.OptionsPerRow,f=Math.ceil((n+1)/u),this.OptionRows.length<f&&(i=document.createElement("div"),AddCssClass(i,"ControlWrapper"),this.GetBodyElement().appendChild(i),this.OptionRows.push(i)),t=this.OptionRows[f-1],t==null&&(t=document.createElement("div"),AddCssClass(t,"ControlWrapper"),this.GetBodyElement().appendChild(t),this.OptionRows.push(t)),e=Math.floor(12/u),e>2&&e<12,r=document.createElement("div"),AddCssClass(r,"ListItemColumn"),t.appendChild(r),r};ListDataElement.prototype.HideOption=function(n){var t=this.FindOptionElement(n),i;t&&(t.Remove(),i=this.Options.map(function(n){return n.Value}).indexOf(n),this.Options.splice(i,1),this.RebuildOptions())};ListDataElement.prototype.FindOptionElement=function(n){for(var t=this.FirstChild;t;){if(t.MyClassName===this.OptionElementName&&t.Value===n)return t;t=t.NextSibling}return null};ListDataElement.prototype.FindInputOptionElement=function(n){for(var t=this.Body.firstChild;t;){if(t.firstChild&&t.firstChild.value===n)return t;t=t.nextElementSibling}return null};ListDataElement.prototype.AddOption=function(n,t,i){var e=n.firstChild,r=new FieldOption(e),f,u;r.Deleted||(f=n.getAttribute("disabled")=="true",r.Disabled=f,u=this.Options.length,i&&(u=this.Options.map(function(n){return n.Value}).indexOf(i.Value)),this.Options.splice(u,0,r),this.RebuildOptions())};ListDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};ListboxDataElement.InheritsFrom(ListDataElement);ListboxDataElement.prototype.GetXmlNodeData=function(n){ListDataElement.prototype.GetXmlNodeData.call(this,n);this.DefaultOptionText=GetCDataValue(n,"DefaultOptionText");this.CreateOptionElements()};ListboxDataElement.prototype.RebuildOptions=function(){this.RemoveOptionElements();var n=this.CreateOptionElements()};ListboxDataElement.prototype.CreateOptionElements=function(){var u=[],t,r,n,i;for(this.Field=this.CreateChildNode(null,"ListboxElement"),this.Field.Value=this.Value,this.Field.IsDesignMode=this.IsDesignMode,this.DefaultOptionText&&(t=this.DefaultOptionText,t.slice(0,1)!="-"&&(t="- "+t.toLowerCase()+" -"),i=this.Field.AddOption(t,"0"),u.push(i)),r=0;r<this.Options.length;r++)n=this.Options[r],i=this.Field.AddOption(n.Caption,n.Value,n.Selected,n.Hidden,n.Disabled),u.push(i);return u};ListboxDataElement.prototype.RemoveOptionElements=function(){var t=this.FirstChild.MyClassName,n=[];this.OnEach(function(i){return i.MyClassName===t&&n.push(i),OnEachResult.Continue});n.map(function(){})};ListboxDataElement.prototype.HideOption=function(n){var r=this.FindOptionElement(n),t=this.Options.indexOf(r),u=this.DefaultOptionText?t+1:t,i;this.Options.splice(t,1);this.Field.Options.splice(u,1);i=this.FindInputOptionElement(n);i&&this.FirstChild.Input.removeChild(i);this.RebuildOptions()};ListboxDataElement.prototype.FindOptionElement=function(n){for(var t=0;t<this.Options.length;t++)if(this.Options[t].Value===n)return this.Options[t];return this.FindInputOptionElement(n)};ListboxDataElement.prototype.FindInputOptionElement=function(n){for(var t=this.FirstChild.Input.firstChild;t;){if(t.value===n)return t;t=t.nextSibling}return null};ListboxDataElement.prototype.AddOption=function(n,t,i){var u=n.firstChild,e=u.getAttribute("value"),o=GetCDataValue(u,"Caption"),s=u.getAttribute("hidden")==!0,h=u.getAttribute("disabled")=="true",c=new Option(o,e,!1,!1),f,r;i?(f=this.FindInputOptionElement(i.Value),f==null&&(f=this.FindInputOptionElement(i.value)),this.FirstChild.Input.insertBefore(c,f)):this.FirstChild.Input.appendChild(c);this.Field.AddOption(o,e,!1,s,h);r={};r.Text=o;r.Value=e;r.Selected=!1;r.Hidden=s;r.Disabled=h;this.Options[this.Options.length]=r};DataElement.prototype.HasContent=function(){var n;return n=this.GetFieldValue?!!this.GetFieldValue():this.GetFieldValues().length>0,n&&(!this.DefaultOptionText||this.FirstChild.Input.selectedIndex>0)};ListboxDataElement.prototype.UpdateRequirementIndicator=function(){if(this.IsRequired){if(window.BrixResponsive===!0){this.UpdateRequirementIndicatorResponsive();return}var n=this.Container,t=this.HasContent()&&(!this.DefaultOptionText||this.FirstChild.Input.selectedIndex>0);t?(RemoveCssClass(n,"RequirementAbsent"),AddCssClass(n,"RequirementChecked"),RemoveCssClass(this.RequiredIcon,"Absent"),AddCssClass(this.RequiredIcon,"Checked")):(RemoveCssClass(n,"RequirementChecked"),AddCssClass(n,"RequirementAbsent"),RemoveCssClass(this.RequiredIcon,"Checked"),AddCssClass(this.RequiredIcon,"Absent"))}};ListboxDataElement.prototype.InitializeMe=function(){ListDataElement.prototype.InitializeMe.call(this)};CheckboxDataElement.InheritsFrom(ListDataElement);CheckboxDataElement.prototype.GetXmlNodeData=function(n){ListDataElement.prototype.GetXmlNodeData.call(this,n);this.OptionElementName="CheckboxElement";this.Values=this.Value.split(",");this.CreateOptionElements();this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions")};CheckboxDataElement.prototype.HasContent=function(){for(var i=!1,t=this.GetFieldValues(),n=0;n<t.length;n++)if(t[n]&&t[n]!=="0"){i=!0;break}return i};CheckboxDataElement.prototype.GetBodyElement=function(n){return n?this.Body:ListDataElement.prototype.GetBodyElement.call(this)};CheckboxDataElement.prototype.InitializeMe=function(){ListDataElement.prototype.InitializeMe.call(this)};CheckboxDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};CheckboxDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};CheckboxElement.InheritsFrom(ElementBase);CheckboxElement.prototype.GetXmlNodeData=function(n){this.Value=this.GetCDataValue(n,"Value");this.Checked=n.getAttribute("checked")=="true"||!1};CheckboxElement.prototype.GetFieldValue=function(){return this.Input.checked?this.Value:"0"};CheckboxElement.prototype.InitializeMe=function(){var t=this.Parent.GetOptionBody(this.OptionIndex),n=CreateCheckInputSetResponsive("checkbox",this.FieldName,this.OptionIndex,this.Value,this.Caption,this.Checked,this.Disabled);this.Root=n.Container;t.appendChild(n.Container);this.Input=n.Input;this.EventTracker=new EventTracking(null,this.Input);this.EventTracker.AddCallback("change",this,"OnChange")};CheckboxElement.prototype.OnChange=function(){if(this.Parent.OnChange){var n=this.Parent.GetFieldValues();this.Parent.OnChange(n.join(","),null,this.Parent.Name+"_"+this.Value)}};RadioButtonDataElement.InheritsFrom(ListDataElement);RadioButtonDataElement.prototype.GetXmlNodeData=function(n){ListDataElement.prototype.GetXmlNodeData.call(this,n);this.OptionElementName="RadioButtonElement";this.Values=this.Value.split(",");this.CreateOptionElements()};RadioButtonDataElement.prototype.GetBodyElement=function(n){return n?this.Body:ListDataElement.prototype.GetBodyElement.call(this)};RadioButtonDataElement.prototype.InitializeMe=function(){ListDataElement.prototype.InitializeMe.call(this)};RadioButtonElement.InheritsFrom(ElementBase);RadioButtonElement.prototype.GetXmlNodeData=function(n){this.Value=this.GetCDataValue(n,"Value");this.Checked=n.getAttribute("checked")=="true"||!1};RadioButtonElement.prototype.GetFieldValue=function(){return this.Input.checked?this.Value:""};RadioButtonElement.prototype.InitializeMe=function(){var t=this.Parent.GetOptionBody(this.OptionIndex),n=CreateCheckInputSetResponsive("radio",this.FieldName,this.OptionIndex,this.Value,this.Caption,this.Checked,this.Disabled);t.appendChild(n.Container);this.Input=n.Input;this.EventTracker=new EventTracking(null,this.Input);this.EventTracker.AddCallback("change",this,"OnChange")};RadioButtonElement.prototype.OnChange=function(){if(this.Parent.OnChange){var n=this.Parent.GetFieldValues();this.Parent.OnChange(n.join(","))}};UploadDataElement.InheritsFrom(DataElement);UploadDataElement.prototype.GetXmlNodeData=function(n){DataElement.prototype.GetXmlNodeData.call(this,n);this.Title=GetCDataValue(n,"Title");this.Size=n.getAttribute("size");this.Url=n.getAttribute("url");this.IsLocal=n.getAttribute("local");this.Mimes=n.getAttribute("mimes");this.ControllerType=n.getAttribute("controller_type");this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions");var t=n.selectSingleNode("OnUploadMacro");t&&(this.OnUploadMacro=new MacroElement(this,t.firstChild));t=n.selectSingleNode("RemoveFileMacro");t&&(this.RemoveFileMacro=new MacroElement(this,t.firstChild))};UploadDataElement.prototype.RelayedResponse=function(n){this.Title=GetCDataValue(n,"Title");this.Size=n.getAttribute("size");this.Url=n.getAttribute("url");this.IsLocal=n.getAttribute("local");this.RebuildContents(!0)};UploadDataElement.prototype.InitializeMe=function(){DataElement.prototype.InitializeMe.call(this);this.RebuildContents()};UploadDataElement.prototype.RebuildContents=function(n){this.ClearContents(n);this.Url?this.BuildFilePresentation(n):this.BuildUploader(n)};UploadDataElement.prototype.ClearContents=function(){this.UploadContainer&&(this.UploadContainer.parentNode.removeChild(this.UploadContainer),delete this.UploadContainer);for(var n=this.FirstChild;n;)n.MyClassName=="UploadboxElement"&&this.RemoveChild(n),n=n.NextSibling};UploadDataElement.prototype.BuildUploader=function(n){var t=this.CreateChildNode(null,"UploadboxElement");n&&t.Initialize();this.IsRequired&&this.RequiredIcon&&(RemoveCssClass(this.Root,"has-success"),RemoveCssClass(this.Root,"has-warning"),RemoveCssClass(this.Root,"has-error"),RemoveCssClass(this.RequiredIcon,"has-success"))};UploadDataElement.prototype.BuildFilePresentation=function(){var u=this.GetBodyElement(),n=document.createElement("div"),i,t,r;AddCssClass(n,"UploadedContainer");u.appendChild(n);i=this.BuildAnchor();n.appendChild(i);t=ActiveIconArchive.Get(DeleteIconName).Create();AddCssClass(t,"ClickableIcon");r=this;t.onclick=function(){r.RemoveFile()};n.appendChild(t);this.UploadContainer=n;this.IsRequired&&this.RequiredIcon&&(RemoveCssClass(this.Root,"has-success"),RemoveCssClass(this.Root,"has-warning"),RemoveCssClass(this.Root,"has-error"),this.RemoveMessage(),AddCssClass(this.Root,"has-success"),AddCssClass(this.RequiredIcon,"has-success"))};UploadDataElement.prototype.PostInitialized=function(){var i,t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),i=document.createElement("i"),AddCssClass(i,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=i,this.InputCell.appendChild(i));this.HasContent()==!0&&this.RequiredIcon&&(RemoveCssClass(this.Root,"has-success"),RemoveCssClass(this.Root,"has-warning"),RemoveCssClass(this.Root,"has-error"),this.RemoveMessage(),AddCssClass(this.Root,"has-success"),AddCssClass(this.RequiredIcon,"has-success"));this.Label&&(t=this.InputCell.getElementsByTagName("INPUT"),t.length==0&&(t=this.InputCell.getElementsByTagName("SELECT")),t.length==0&&(t=this.InputCell.getElementsByTagName("TEXTAREA")),t.length==1&&this.Label.setAttribute("for",t[0].id));this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left="-22%";t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};UploadDataElement.prototype.RemoveFile=function(){this.RemoveFileMacro.PerformAction()};UploadDataElement.prototype.BuildAnchor=function(){var n=document.createElement("a"),t,i;return n.href=this.Url,n.target="_blank",t=this.Url.lastIndexOf("/")!=-1?this.Url.slice(this.Url.lastIndexOf("/")+1):this.Url,i=this.Size?t+" ("+this.Size+")":t,SetInnerText(n,i),n};UploadDataElement.prototype.GetValuesAsQuery=function(){};UploadDataElement.prototype.HasContent=function(){var n=!1;return this.Url&&(n=!0),n};UploadDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};UploadboxElement.InheritsFrom(ElementBase);UploadboxElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};UploadboxElement.prototype.Upload=function(){this.FileReference="";this.FileSize="";this.FileUrl="";this.FileName="";this.IsSubmitted=!1;this.Check=1;this.WaitForUpload();var n=this,t=getExtension(this.Input.value);this.Input.value!==""&&(this.Input.accept===""||t!==""&&(this.Input.accept.indexOf(FindMIMEType(t))!==-1||this.Input.accept.indexOf(t.toLowerCase())!==-1)?this.SendUpload(this.Input,function(t){n.GetFileProperties(t);n.OnUploaded();GetSuitableParentForProgressBar(n).HideLoadingInProgress();n.LoadingInProgress=!1;n.IsSubmitted=!0},function(t){alert("Upload failed: "+t);GetSuitableParentForProgressBar(n).HideLoadingInProgress();n.LoadingInProgress=!1}):(alert(this.Parent.CaptionWrongFiles),GetSuitableParentForProgressBar(n).HideLoadingInProgress(),n.LoadingInProgress=!1,this.Input.value=""))};UploadboxElement.prototype.SendUpload=function(n,t,i){var r=new FormData,u;r.append("uploadedFile",n.files[0]);this.Parent.IsLocal&&r.append("local",!0);u=UploadBasePath;$.ajax({url:u,data:r,success:function(n){t(n)},error:i,processData:!1,contentType:!1,type:"POST"})};UploadboxElement.prototype.WaitForUpload=function(){var n=GetSuitableParentForProgressBar(this);n&&(n.ShowLoadingInProgress(),this.LoadingInProgress=!0)};UploadboxElement.prototype.GetFileProperties=function(n){var t=n.Files[0];this.FileName=t.FileName;this.FileUrl=t.Url;this.FileSize=t.Size;this.FileLocal=t.LocalPath;this.ImageWidth=t.ImageWidth||0;this.ImageHeight=t.ImageHeight||0};UploadboxElement.prototype.OnUploaded=function(){this.Parent.OnUploadMacro&&(this.Parent.OnUploadMacro.AddClientArgument("controller_type",this.Parent.ControllerType),this.Parent.OnUploadMacro.AddClientArgument("filename",this.FileName),this.Parent.OnUploadMacro.AddClientArgument("file_url",this.FileUrl),this.Parent.OnUploadMacro.AddClientArgument("file_local",this.FileLocal),this.Parent.OnUploadMacro.AddClientArgument("file_size",this.FileSize),this.Parent.OnUploadMacro.AddClientArgument("image_width",this.ImageWidth),this.Parent.OnUploadMacro.AddClientArgument("image_height",this.ImageHeight),this.Parent.OnUploadMacro.PerformAction())};UploadboxElement.prototype.IsReadyToBeProcessed=function(){if(this.Input.value)this.Check==0&&this.Upload();else return!0;return this.IsSubmitted};UploadboxElement.prototype.GetFieldValue=function(){return this.Value};UploadboxElement.prototype.InitializeMe=function(){var f,t,r,n,e,i,o,u;this.IsSubmitted=!1;this.Check=0;this.Value="";f=this.Parent.GetBodyElement();r="f"+Math.floor(Math.random()*99999);t=CreateIframe(r);t.id=r+"id";t.src="";t.style.display="none";t.border="0px solid #fff";t.frameBorder=0;f.appendChild(t);this.Iframe=t;n=document.createElement("form");n.action=UploadBasePath+"request";n.method="POST";n.enctype="multipart/form-data";n.target=r;f.appendChild(n);this.Form=n;this.Input=CreateInput(this.FieldName||"file_upload");AddCssClass(this.Input,"InputBox");AddCssClass(this.Input,"Upload");this.Input.type="file";this.Parent.Mimes&&(this.Input.accept=this.Parent.Mimes);e=this;this.Input.onchange=function(){e.Upload()};i=document.createElement("div");AddCssClass(i,"UploadContainer");o=ActiveIconArchive.Get(UploadIconName).Create();i.appendChild(this.Input);i.appendChild(o);n.appendChild(i);this.Parent.IsLocal&&(u=CreateInput("local"),u.type="hidden",u.value="true",n.appendChild(u))};UploadboxElement.prototype.CleanUp=function(){this.Iframe&&delete this.Iframe;this.Form&&(this.Form.parentNode.removeChild(this.Form),delete this.Form)};FindMIMEType=function(n){var t={},i;return t["323"]="text/h323",t.acx="application/internet-property-stream",t.ai="application/postscript",t.aif="audio/x-aiff",t.aifc="audio/x-aiff",t.aiff="audio/x-aiff",t.asf="video/x-ms-asf",t.asr="video/x-ms-asf",t.asx="video/x-ms-asf",t.au="audio/basic",t.avi="video/x-msvideo",t.axs="application/olescript",t.bas="text/plain",t.bcpio="application/x-bcpio",t.bin="application/octet-stream",t.bmp="image/bmp",t.c="text/plain",t.cat="application/vnd.ms-pkiseccat",t.cdf="application/x-cdf",t.cer="application/x-x509-ca-cert",t["class"]="application/octet-stream",t.clp="application/x-msclip",t.cmx="image/x-cmx",t.cod="image/cis-cod",t.cpio="application/x-cpio",t.crd="application/x-mscardfile",t.crl="application/pkix-crl",t.crt="application/x-x509-ca-cert",t.csh="application/x-csh",t.css="text/css",t.dcr="application/x-director",t.der="application/x-x509-ca-cert",t.dir="application/x-director",t.dll="application/x-msdownload",t.dms="application/octet-stream",t.doc="application/msword",t.dot="application/msword",t.dvi="application/x-dvi",t.dxr="application/x-director",t.eps="application/postscript",t.etx="text/x-setext",t.evy="application/envoy",t.exe="application/octet-stream",t.fif="application/fractals",t.flr="x-world/x-vrml",t.gif="image/gif",t.gtar="application/x-gtar",t.gz="application/x-gzip",t.h="text/plain",t.hdf="application/x-hdf",t.hlp="application/winhlp",t.hqx="application/mac-binhex40",t.hta="application/hta",t.htc="text/x-component",t.htm="text/html",t.html="text/html",t.htt="text/webviewhtml",t.ico="image/x-icon",t.ief="image/ief",t.iii="application/x-iphone",t.ins="application/x-internet-signup",t.isp="application/x-internet-signup",t.jfif="image/pipeg",t.jpe="image/jpeg",t.jpeg="image/jpeg",t.jpg="image/jpeg",t.js="application/x-javascript",t.latex="application/x-latex",t.lha="application/octet-stream",t.lsf="video/x-la-asf",t.lsx="video/x-la-asf",t.lzh="application/octet-stream",t.m13="application/x-msmediaview",t.m14="application/x-msmediaview",t.m3u="audio/x-mpegurl",t.man="application/x-troff-man",t.mdb="application/x-msaccess",t.me="application/x-troff-me",t.mht="message/rfc822",t.mhtml="message/rfc822",t.mid="audio/mid",t.mny="application/x-msmoney",t.mov="video/quicktime",t.movie="video/x-sgi-movie",t.mp2="video/mpeg",t.mp3="audio/mpeg",t.mpa="video/mpeg",t.mpe="video/mpeg",t.mpeg="video/mpeg",t.mpg="video/mpeg",t.mpp="application/vnd.ms-project",t.mpv2="video/mpeg",t.ms="application/x-troff-ms",t.mvb="application/x-msmediaview",t.nws="message/rfc822",t.oda="application/oda",t.p10="application/pkcs10",t.p12="application/x-pkcs12",t.p7b="application/x-pkcs7-certificates",t.p7c="application/x-pkcs7-mime",t.p7m="application/x-pkcs7-mime",t.p7r="application/x-pkcs7-certreqresp",t.p7s="application/x-pkcs7-signature",t.pbm="image/x-portable-bitmap",t.pdf="application/pdf",t.pfx="application/x-pkcs12",t.pgm="image/x-portable-graymap",t.pko="application/ynd.ms-pkipko",t.pma="application/x-perfmon",t.pmc="application/x-perfmon",t.pml="application/x-perfmon",t.pmr="application/x-perfmon",t.pmw="application/x-perfmon",t.pnm="image/x-portable-anymap",t.png="image/png",t["pot,"]="application/vnd.ms-powerpoint",t.ppm="image/x-portable-pixmap",t.pps="application/vnd.ms-powerpoint",t.ppt="application/vnd.ms-powerpoint",t.prf="application/pics-rules",t.ps="application/postscript",t.pub="application/x-mspublisher",t.qt="video/quicktime",t.ra="audio/x-pn-realaudio",t.ram="audio/x-pn-realaudio",t.ras="image/x-cmu-raster",t.rgb="image/x-rgb",t.rmi="audio/mid",t.roff="application/x-troff",t.rtf="application/rtf",t.rtx="text/richtext",t.scd="application/x-msschedule",t.sct="text/scriptlet",t.setpay="application/set-payment-initiation",t.setreg="application/set-registration-initiation",t.sh="application/x-sh",t.shar="application/x-shar",t.sit="application/x-stuffit",t.snd="audio/basic",t.spc="application/x-pkcs7-certificates",t.spl="application/futuresplash",t.src="application/x-wais-source",t.sst="application/vnd.ms-pkicertstore",t.stl="application/vnd.ms-pkistl",t.stm="text/html",t.svg="image/svg+xml",t.sv4cpio="application/x-sv4cpio",t.sv4crc="application/x-sv4crc",t.swf="application/x-shockwave-flash",t.t="application/x-troff",t.tar="application/x-tar",t.tcl="application/x-tcl",t.tex="application/x-tex",t.texi="application/x-texinfo",t.texinfo="application/x-texinfo",t.tgz="application/x-compressed",t.tif="image/tiff",t.tiff="image/tiff",t.tr="application/x-troff",t.trm="application/x-msterminal",t.tsv="text/tab-separated-values",t.txt="text/plain",t.uls="text/iuls",t.ustar="application/x-ustar",t.vcf="text/x-vcard",t.vrml="x-world/x-vrml",t.wav="audio/x-wav",t.wcm="application/vnd.ms-works",t.wdb="application/vnd.ms-works",t.wks="application/vnd.ms-works",t.wmf="application/x-msmetafile",t.wps="application/vnd.ms-works",t.wri="application/x-mswrite",t.wrl="x-world/x-vrml",t.wrz="x-world/x-vrml",t.xaf="x-world/x-vrml",t.xbm="image/x-xbitmap",t.xla="application/vnd.ms-excel",t.xlc="application/vnd.ms-excel",t.xlm="application/vnd.ms-excel",t.xls="application/vnd.ms-excel",t.xlt="application/vnd.ms-excel",t.xlw="application/vnd.ms-excel",t.xml="text/xml",t.xof="x-world/x-vrml",t.xpm="image/x-xpixmap",t.xwd="image/x-xwindowdump",t.z="application/x-compress",t.zip="application/zip",t.json="application/json",i=n.toLowerCase(),t[i]?t[i]:i};HtmlElement.InheritsFrom(ElementBase);HtmlElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Html=FullTrim(GetCDataValue(n,"Html"));this.IntendedUsage=n.getAttribute("intended_usage");this.ScrollInto=n.getAttribute("scroll_into")};HtmlElement.prototype.BuildCKEditorMenu=function(n){var i=new CKEditorMenuInjection(n),t=this.GetNextChildByClass("Menu");t&&i.InjectSourcePicker(t)};HtmlElement.prototype.InitializeMe=function(){var t=document.createElement("div"),f,i,n,r,u;if(t.id=this.Id,f=this.Parent.GetBodyElement(),f.appendChild(t),t.innerHTML=this.IsDesignMode&&(this.Html.length==0||this.Html=="<p>")?"...":this.Html,AddCssClass(t,"HtmlContent"),this.Body=t,t.style.zIndex=2300,this.ScrollInto!==null){for(i=!1,n=this;!i&&n!==null;)n=n.Parent,n!==null&&(i=n.MyClassName=="FormTemplateElement"?!0:!1);r=n!==null?n.GetDescendantByName(this.ScrollInto):null;r!==null&&(u=document.getElementById(r.Id),u!==null&&u.scrollIntoView({block:"center"}))}this.EnableInteraction()};HtmlElement.prototype.EnableInteraction=function(n,t){this.IsDragable&&(this.InitializeTracker(),this.DragAndDropHandle=DragableElementSetupHelper(n||this.EventTracker,this,this.DragableDescription));this.ContextMenu&&(this.InitializeTracker(),this.ContextMenuHandle=(t||this.EventTracker).AddCallback("click",this,"ShowContextMenu"))};HtmlElement.prototype.DisableInteraction=function(){this.IsDragable&&this.DragAndDropHandle&&(this.EventTracker.RemoveCallback(this.DragAndDropHandle),this.DragAndDropHandle=null);this.ContextMenuHandle&&(this.EventTracker.RemoveCallback(this.ContextMenuHandle),this.ContextMenuHandle=null);this.ClickHandle&&(this.EventTracker.RemoveCallback(this.ClickHandle),this.ClickHandle=null)};HtmlElement.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(this.Body.id))};HtmlElement.prototype.StartEdit=function(){this.DisableInteraction();this.DisableParentInteraction();var n=this;StartCKEdit(this.Body,this,function(t){n.UpdateContent(t)},function(){n.EnableInteraction();n.EnableParentInteraction()})};HtmlElement.prototype.DisableParentInteraction=function(){this.Parent.DisableInteraction&&this.Parent.DisableInteraction()};HtmlElement.prototype.EnableParentInteraction=function(){this.Parent.EnableInteraction&&this.Parent.EnableInteraction()};HtmlElement.prototype.UpdateContent=function(n){var t=FullTrim(n),i=this.Html;t!==i&&this.Events.CallEvent("onchanged",t)};HtmlElement.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(this.Body.id))};HtmlElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};HtmlDataElement.InheritsFrom(DataElement);HtmlDataElement.prototype.GetXmlNodeData=function(n){var t,r,i;DataElement.prototype.GetXmlNodeData.call(this,n);this.Html=this.GetCDataValue(n,"html");t=n.getAttribute("max_chars");this.MaxChars=t?t*1:0;t=n.getAttribute("max_words");this.MaxWords=t?t*1:0;this.HtmlFilter=n.getAttribute("html_filter");r=n.getAttribute("filter_def");this.FilterDef=JSON.parse(r);i=n.selectSingleNode("./PickerMacro");this.VariablePickerMacro=i?new MacroElement(this,i.firstChild):null;this.ClickHereText=n.getAttribute("click_here_text");this.IsLargeField=!0;this.IsSourceMode=!1};HtmlDataElement.prototype.PickVariable=function(n){this.CKEditor=n;this.VariablePickerMacro.PerformAction()};HtmlDataElement.prototype.RelayedResponse=function(n){var i,r;if(this.CKEditor){var u=$(n).attr("value"),f=GetCDataValue(n),t=document.createElement("span");t.className="AirSource";t.setAttribute("airsource",u);t.setAttribute("contenteditable","false");t.appendChild(document.createTextNode(f));i=new CKEDITOR.dom.element(t);this.CKEditor.insertElement(i);r=document.createTextNode(" ");i=new CKEDITOR.dom.element(r);this.CKEditor.insertElement(i)}};HtmlDataElement.prototype.GetContextCoordinates=function(){var n,t;return this.CkMouseX&&this.CkMouseY?n={Left:this.CkMouseX,Right:this.CkMouseX+20,Top:this.CkMouseY,Bottom:this.CkMouseY+20}:(t=this.Parent.GetBodyElement(),n=new LayerCoordinates(t)),n};HtmlDataElement.prototype.InitializeMe=function(){var i,t,n,r;DataElement.prototype.InitializeMe.call(this);i=this;t=document.createElement("div");t.id=this.Id+"_editor";AddCssClass(t,"HtmlContent");AddCssClass(t,"HtmlEditor");r=function(){n=document.createElement("div");n.id=i.Id+"_overlay";n.innerHTML=i.ClickHereText;AddCssClass(n,"OverlayEditor");t.appendChild(n);i.IsDesignMode||(n.onclick=function(){n.parentNode.removeChild(n);n=null;t.innerHTML=i.Html;i.StopOtherEditors();i.StartEdit(t)})};r();this.InputCell.appendChild(t);this.StopEdit=function(){this.Editor&&this.IsSourceMode&&(this.Html=this.Editor.getData())}};HtmlDataElement.prototype.StopOtherEditors=function(){for(var t,i=ElementIndex.GetByClassName(this.MyClassName),n=0;n<i.length;n++)t=i[n],t.Id!=this.Id&&t.StopEdit()};HtmlDataElement.prototype.StartEdit=function(n){var e=function(){var n=FindParentWindow(i);n&&n.OnResize()},i=this,r=new CKEditorHelper(n,this),u,f,t;for(d in this.FilterDef)u=this.FilterDef[d],f=(this.HtmlFilter&u)!=0,r.Allow[d]=f;t=r.StartCKEditFrame(null,function(){e()});this.MaxChars&&(t.config.charcount_limit=this.MaxChars);this.MaxWords&&(t.config.wordcount_limit=this.MaxWords);t.on("change",function(){i.ContentChanged=!0;i.Html=this.getData()});t.on("mode",function(){i.IsSourceMode=t.mode=="source";i.IsSourceMode&&(i.ContentChanged=!0)});this.Editor=t};HtmlDataElement.prototype.GetValuesAsQuery=function(n){var t;if(this.ContentChanged){if(this.IsSourceMode&&(this.Html=this.Editor.getData()),t=this.Html,this.IsTextOnlyMode=="True"){var i=new RegExp("<(?!\\/?span)[^>]+>","g"),r=new RegExp("\n","g"),u=new RegExp("&nbsp;","g");t=t.replace(i,"");t=t.replace(r,"");t=t.replace(u," ")}n.Add(this.Name,t)}};IntendedUsage={ValueRepresentation:"ValueRepresentation"};TextElement.InheritsFrom(ElementBase);TextElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Text=GetCDataValue(n,"Text");this.IntendedUsage=n.getAttribute("intended_usage")};TextElement.prototype.InitializeMe=function(){var n,t;this.IntendedUsage==="Headline"?n=document.createElement("h2"):this.IntendedUsage==="SubHeading"?n=document.createElement("h4"):(n=document.createElement("div"),n.className=this.MyClassName+"_"+this.IntendedUsage);n.innerHTML=this.Text;n.id=this.Id;t=this.GetParentBody();t.appendChild(n);this.Body=n;this.ContextMenu&&(this.InitializeTracker(),this.EventTracker.AddCallback("context menu",this,"ShowContextMenu",!1));this.IsDesignMode&&(this.InitializeTracker(),this.EventTracker.AddCallback("mouse down",this,"StartEdit",!1))};TextElement.prototype.StartEdit=function(){var n=this;StartCKEdit(this.Body,function(t){n.UpdateContent(t)})};TextElement.prototype.UpdateContent=function(n){this.Events.CallEvent("onchanged",n)};TextElement.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(this.Body.id))};TextElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};TextboxElement.InheritsFrom(ElementBase);TextboxElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.IsValid=n.getAttribute("is_invalid")!="true";this.Value=this.GetCDataValue(n,"Value")||"";this.HideInput=n.getAttribute("hide_input")=="true"};TextboxElement.prototype.CleanUp=function(){this.Input=null};TextboxElement.prototype.GetFieldValue=function(){return encodeURIComponent(this.Input.value)};TextboxElement.prototype.InitializeMe=function(){var i=this.FieldName?this.FieldName:this.Id+"input",t,n,e,r;if(this.IsNumeric())t=BRIX.Inputs.CreateNumericInput(i,this.Value,this.HideInput,this.ValuePlaceholder);else if(this.IsEmail()){if(t=BRIX.Inputs.CreateEmailInput(i,this.Value,this.HideInput,this.ValuePlaceholder),this.Input=t,this.Input.id=this.Id,this.PlaceholderSupported=typeof this.Input.placeholder!="undefined",AddCssClass(this.Input,"form-control"),AddCssClass(this.Input,this.GetCssClassName()),r=this.Parent.GetBodyElement(),r.appendChild(this.Input),this.Parent.DoubleEmailField){var f="md",o=this.Parent.Root,u=document.createElement("div");AddCssClass(u,"SecEmailDiv");o.appendChild(u);this.Label2=document.createElement("label");AddCssClass(this.Label2,"control-label");AddCssClass(this.Label2,"col-"+f+"-"+this.Parent.LabelRatio);AddCssClass(this.Label2,"LabelCell");AddCssClass(this.Label2,"SecondInputEmailLabel");u.appendChild(this.Label2);this.Label2.appendChild(document.createTextNode(this.Parent.SecondCaptionCheckEmail));this.Label2.setAttribute("for",this.Id+"dub");n=document.createElement("div");AddCssClass(n,"col-"+f+"-"+this.Parent.InputRatio);AddCssClass(n,"ControlCell");AddCssClass(n,"SecondInputEmail");u.appendChild(n);e=BRIX.Inputs.CreateEmailInput(i+"dub",this.Parent.ValueSec,this.HideInput,this.ValuePlaceholder);this.Input2=e;this.Input2.id=this.Id+"dub";AddCssClass(this.Input2,"form-control");AddCssClass(this.Input2,this.GetCssClassName());this.Input2.oncopy=function(){return!1};this.Input2.oncut=function(){return!1};this.Input2.onpaste=function(){return!1};n.appendChild(this.Input2);this.EventTracker2=new EventTracking(null,this.Input2);this.EventTracker2.AddCallback("change",this,"OnChange",!0)}}else t=BRIX.Inputs.CreateTextInput(i,this.Value,this.HideInput,this.ValuePlaceholder);this.IsEmail()||(this.Input=t,this.Input.id=this.Id,this.PlaceholderSupported=typeof this.Input.placeholder!="undefined",AddCssClass(this.Input,"form-control"),AddCssClass(this.Input,this.GetCssClassName()),r=this.Parent.GetBodyElement(),r.appendChild(this.Input));this.IsInFocus&&(this.Input.focus(),this.Input.select());this.EventTracker=new EventTracking(null,this.Input);this.EventTracker.AddCallback("click",this,"OnEnterField",!0);this.EventTracker.AddCallback("change",this,"OnChange",!0);this.Validate()};TextboxElement.prototype.IsNumeric=function(){return this.Parent.IsNumeric};TextboxElement.prototype.IsEmail=function(){return this.Parent.IsEmail};TextboxElement.prototype.IsPercent=function(){return this.Parent.Format=="percent"};TextboxElement.prototype.IsCurrency=function(){return this.Parent.Format=="currency"};TextboxElement.prototype.GetCssClassName=function(){return this.IsNumeric()?"Input_Numeric":"Input_Text"};TextboxElement.prototype.GetInvalidCssClassName=function(){return"Invalid"};TextboxElement.prototype.OnChange=function(){this.Validate();this.Value=this.Input.value;this.Parent.OnChange&&this.Parent.OnChange(this.Value)};TextboxElement.prototype.ValidateResponsive=function(){};TextboxElement.prototype.Validate=function(){if(window.BrixResponsive===!0){this.ValidateResponsive();return}var n=this.GetInvalidCssClassName();this.Parent.Validate(this.Input)?RemoveCssClass(this.Input,n):AddCssClass(this.Input,n)};TextboxElement.prototype.OnEnterField=function(){return this.Input.focus(),this.PlaceholderSupported||this.Input.value==this.ValuePlaceholder&&(this.Input.value=""),!0};TextboxElement.prototype.OnExitField=function(){return this.PlaceholderSupported||(this.Input.value==this.ValuePlaceholder||this.Input.value=="")&&(this.Input.value=this.ValuePlaceholder),!0};TextareaElement.InheritsFrom(TextboxElement);TextareaElement.prototype.InitializeMe=function(){var t=this.FieldName?this.FieldName:this.Id+"input",n;this.Input=document.createElement("textarea");AddCssClass(this.Input,"form-control");this.Input.name=t;this.Input.value=this.Value;this.Input.setAttribute("rows",4);this.Input.placeholder=this.ValuePlaceholder;this.Input.id=this.Id;this.IsExtraLarge&&(AddCssClass(this.Input,"ExtraLarge"),this.Input.setAttribute("rows",20));n=this.Parent.GetBodyElement();n.appendChild(this.Input);this.IsInFocus&&(this.Input.focus(),this.Input.select());this.EventTracker=new EventTracking(null,this.Input);this.EventTracker.AddCallback("change",this,"OnChange",!0);this.Validate()};TextareaElement.prototype.OnEnterField=function(){return!0};TextareaElement.prototype.OnExitField=function(){return!0};ListboxElement.InheritsFrom(ElementBase);ListboxElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};ListboxElement.prototype.GetFieldValue=function(){return this.Input.selectedIndex==-1?"":this.Input.options[this.Input.selectedIndex].value};ListboxElement.prototype.AddOption=function(n,t,i,r,u){var f={};return f.Text=n,f.Value=t,f.Selected=i,f.Hidden=r,f.Disabled=u,this.Options[this.Options.length]=f,f};ListboxElement.prototype.InitializeMe=function(){var n,t;for(this.Input=document.createElement("select"),AddCssClass(this.Input,"form-control"),this.Input.id=this.Id+"_input",this.Parent.GetBodyElement().appendChild(this.Input),this.EventTracker=new EventTracking(this.Input.id),this.EventTracker.AddCallback("change",this,"OnChange"),n=0;n<this.Options.length;n++)t=this.Options[n],this.Input.options[n]=new Option(t.Text,t.Value),this.Input.options[n].selected=t.Selected,this.Input.options[n].disabled=t.Disabled;this.IsDesignMode&&(this.LabelEventTracker=new EventTracking(this.Input.id),this.Parent.SecondaryPropertiesEditor&&this.LabelEventTracker.AddCallback("double click",this.Parent,"OnSecondaryProperties"));this.IsInFocus&&(this.Input.focus(),this.Input.select())};ListboxElement.prototype.OnChange=function(){this.Parent.OnChange&&this.Parent.OnChange(this.Input.options[this.Input.selectedIndex].value)};DnDContainerElement.InheritsFrom(SectionElement);DnDContainerElement.prototype.IsHoveringAbove=!1;DnDContainerElement.prototype.IsHoveringBeside=!1;DnDContainerElement.prototype.GetXmlNodeData=function(n){SectionElement.prototype.GetXmlNodeData.call(this,n)};DnDContainerElement.prototype.CleanUp=function(){this.Dimmer=null;this.Body=null};DnDContainerElement.prototype.CreateDimmer=function(){var n=document.createElement("div");return n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="100%",n.style.height="100%",n.style.backgroundColor="white",SetOpacity(n,2),n.style.visibility="hidden",n};DnDContainerElement.prototype.DnDHoverIn=function(){};DnDContainerElement.prototype.DnDHoverOut=function(){};ColorDataElement.InheritsFrom(DataElement);ColorDataElement.prototype.GetXmlNodeData=function(n){DataElement.prototype.GetXmlNodeData.call(this,n);this.Value=this.GetCDataValue(n,"Value");this.PickerId="c"+this.Id};ColorDataElement.prototype.InitializeMe=function(){};ContentAreaElement.InheritsFrom(ElementBase);ContentAreaElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Coordinates=new Coordinates;this.Coordinates.Deserialize(n);this.Resizable=n.getAttribute("resizable")=="true";this.ProportionsLocked=n.getAttribute("proportions_locked")=="true";this.IsFixedHeight=n.getAttribute("fixed_height")=="true";this.IsFixedWidth=n.getAttribute("fixed_width")=="true";this.BackgroundColor=n.getAttribute("background_color");this.Margins=[(n.getAttribute("margin_left")||0)*1,(n.getAttribute("margin_right")||0)*1,(n.getAttribute("margin_top")||0)*1,(n.getAttribute("margin_bottom")||0)*1]};ContentAreaElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.style.position="relative";n.style.top="0px";n.style.left="0px";n.style.paddingLeft=MillimetersToPixels(this.Margins[this.LEFT])+"px";n.style.paddingRight=MillimetersToPixels(this.Margins[this.RIGHT])+"px";n.style.paddingTop=MillimetersToPixels(this.Margins[this.TOP])+"px";n.style.paddingBottom=MillimetersToPixels(this.Margins[this.BOTTOM])+"px";n.style.boxSizing="border-box";n.style.backgroundColor=this.BackgroundColor;n.id=this.Id;t=this.Parent.GetBodyElement();t.appendChild(n);this.Body=n};ContentAreaElement.prototype.SetColor=function(n){this.BackgroundColor=n;this.Body.style.backgroundColor=n};ContentAreaElement.prototype.OnResize=function(){this.Coordinates.SetDomCoordinates(this.Body);this.IsFixedHeight||(this.Body.style.height="100%");this.IsFixedWidth||(this.Body.left=0,this.Body.style.width="100%");ElementBase.prototype.OnResize.call(this)};ContentAreaElement.prototype.DnDHoverReactionOn=function(){};ContentAreaElement.prototype.DnDHoverReactionOff=function(){};ImageElement.InheritsFrom(ElementBase);ImageElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Image=new ImageProperty(n);this.ScrollInto=n.getAttribute("scroll_into")};ImageElement.prototype.InitializeMe=function(){var t=document.createElement("div"),i,n,r,u;if(t.id=this.Id,t.style.position="relative",this.Body=t,this.Parent.GetBodyElement().appendChild(t),this.Image.FileDefined?this.CreateImage(t):this.CreateDefaultImage(t),this.ContextMenu&&(this.EventTracker=new EventTracking(this.Body.id),this.ContextMenuHandle=this.EventTracker.AddCallback("click",this,"ShowContextMenu")),this.ScrollInto!==null){for(i=!1,n=this;!i&&n!==null;)n=n.Parent,n!==null&&(i=n.MyClassName=="FormTemplateElement"?!0:!1);r=n!==null?n.GetDescendantByName(this.ScrollInto):null;r!==null&&(u=document.getElementById(r.Id),u!==null&&u.scrollIntoView({block:"center"}))}};ImageElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};ImageElement.prototype.CreateImage=function(n){var t=CreateImage(this.Image.Url);t.style.position="relative";this.Image.Width>0&&this.Image.Height>0&&(t.style.width=this.Image.Width+"px",t.style.height=this.Image.Height+"px");n.appendChild(t)};ImageElement.prototype.CreateDefaultImage=function(n){var t=CreateImage(GraphicsBasePath+"backgrounds/dark_bright.png");t.style.position="relative";t.style.width="32px";t.style.height="32px";SetOpacity(t,5);n.appendChild(t)};MessageElement.InheritsFrom(ElementBase);MessageElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Message=GetCDataValue(n,"Message");this.MessageType=n.getAttribute("message_type");this.Icon=ActiveIconArchive.GetFromNode(n)};MessageElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t,i;AddCssClass(n,"alert");n.id=this.Id;this.Icon&&(t=this.Icon.Create(),n.appendChild(t),n.appendChild(document.createTextNode(" ")));this.MessageType=="Waiting"?AddCssClass(n,"alert-info"):this.MessageType=="Warning"?AddCssClass(n,"alert-warning"):this.MessageType=="Negative"?AddCssClass(n,"alert-danger"):this.MessageType=="Positive"?AddCssClass(n,"alert-success"):this.MessageType=="Neutral"||(this.MessageType=="NoPadding"?AddCssClass(n,"noPadding"):AddCssClass(n,"alert-info"));n.appendChild(document.createTextNode(this.Message));i=this.Parent.GetBodyElement();i.appendChild(n);this.Body=n;this.EnableInteraction()};CommentElement.InheritsFrom(ElementBase);CommentElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.HtmlBody=GetCDataValue(n,"html_body");this.Created=n.getAttribute("created");this.Author=n.getAttribute("author");this.Icon=ActiveIconArchive.GetFromNode(n)};CommentElement.prototype.InitializeMe=function(){var n=document.createElement("div"),f,t,e,i,r,u;AddCssClass(n,"Comment");n.id=this.Id;this.Body=n;f=this.GetParentBody();f.appendChild(n);t=document.createElement("div");AddCssClass(t,"Header");n.appendChild(t);this.Icon&&(e=this.Icon.Create(),t.appendChild(e));this.Author&&(i=document.createElement("span"),AddCssClass(i,"Author"),i.appendChild(document.createTextNode(this.Author)),t.appendChild(i));this.Created&&(r=document.createElement("span"),AddCssClass(r,"Date"),r.appendChild(document.createTextNode(this.Created)),t.appendChild(r));u=document.createElement("div");AddCssClass(u,"Content");u.innerHTML=this.HtmlBody;n.appendChild(u)};PhoneDataElement.InheritsFrom(DataElement);PhoneDataElement.prototype.GetXmlNodeData=function(n){if(DataElement.prototype.GetXmlNodeData.call(this,n),this.Value=this.GetCDataValue(n,"Value"),this.DefaultCountry=n.getAttribute("default_country"),this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"",this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1,this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions"),this.SelectOption=GetCDataValue(n,"selectOption"),this.IsReadMode){var t=this.CreateChildNode(null,"TextElement");t.IntendedUsage=IntendedUsage.ValueRepresentation;t.Text=this.Value}this.FavoritesCountryCodesString=n.getAttribute("favoriteCountriesCodes");this.FavoritesCountryCodes=this.FavoritesCountryCodesString!=""&&this.FavoritesCountryCodesString!=null?this.FavoritesCountryCodesString.split(","):[];this.FavoritesCountryNamesString=n.getAttribute("favoriteCountriesNames");this.FavoritesCountryNames=this.FavoritesCountryNamesString!=""&&this.FavoritesCountryNamesString!=null?this.FavoritesCountryNamesString.split(","):[];this.FavoritesCountryNamesTranslationString=n.getAttribute("favoriteCountriesTranslations");this.FavoritesCountryNamesTranslations=this.FavoritesCountryNamesTranslationString!=""&&this.FavoritesCountryNamesTranslationString!=null?this.FavoritesCountryNamesTranslationString.split(";"):[];this.RemainderCountryCodes=n.getAttribute("remainderCountriesCodes").split(",");this.RemainderCountryNames=n.getAttribute("remainderCountriesNames").split(",");this.RemainderCountryNamesTranslations=n.getAttribute("remainderCountriesTranslations").split(";")};PhoneDataElement.prototype.InitializeMe=function(){var t,n;DataElement.prototype.InitializeMe.call(this);this.PhoneField=this.CreateNumberField();this.CountriesField=this.CreateCountriesField();this.CountryCodeField=this.CreateCountryCodeField();t=document.createElement("div");AddCssClass(t,"PhoneFields");t.appendChild(this.CountriesField);AddCssClass(this.CountriesField,"form-control");n=document.createElement("div");AddCssClass(n,"PhoneFields");n.appendChild(this.CountryCodeField);n.appendChild(this.PhoneField);this.InputCell.appendChild(t);this.InputCell.appendChild(n)};PhoneDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top="-50%"):(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened"),n.ExplanatoryDialog.style.top="105%");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};PhoneDataElement.prototype.CreateCountriesField=function(){var e="",r="",u,t,f,n;for(this.Value!=""&&(u=this.Value.split("-"),u.length>0&&(e=u[0],r=u[2])),t=document.createElement("select"),f=this,this.CEventTracker=new EventTracking(null,t),this.CEventTracker.AddCallbackFunction("change",function(){var n=t.options[t.selectedIndex].value;f.CountryCodeField.value=n=="0000"?" ":"+"+parseInt(n).toString();f.OnChange(f.GetFieldValue())}),AddCssClass(t,"Listbox"),n=document.createElement("option"),n.value="0000",n.text=this.SelectOption,n.id=this.SelectOption,t.appendChild(n),i=0;i<this.FavoritesCountryCodes.length;i++)n=document.createElement("option"),n.value=this.FavoritesCountryCodes[i],n.text=this.FavoritesCountryNamesTranslations[i],n.id=this.FavoritesCountryNames[i],this.Value!=""?r&&n.value==e&&n.id==r&&(n.selected=!0):this.DefaultCountry==n.id&&(n.selected=!0),t.appendChild(n);for(this.FavoritesCountryCodes.length>0&&(n=document.createElement("option"),n.disabled="disabled",n.value="0000",n.className="select-dash",n.text="-------",n.id="-------",t.appendChild(n)),i=0;i<this.RemainderCountryCodes.length;i++)n=document.createElement("option"),n.value=this.RemainderCountryCodes[i],n.text=this.RemainderCountryNamesTranslations[i],n.id=this.RemainderCountryNames[i],this.Value!=""?r&&n.value==e&&n.id==r&&(n.selected=!0):this.DefaultCountry==n.id&&(n.selected=!0),t.appendChild(n);return t};PhoneDataElement.prototype.CreateNumberField=function(){var n=CreateInput(this.Name),t,i;return AddCssClass(n,"InputBox"),AddCssClass(n,"Textbox"),n.size=12,n.value=this.Value,n.value!=""&&(t=n.value.split("-"),t.length>0&&(n.value=t[1])),i=this,this.PNEventTracker=new EventTracking(null,n),this.PNEventTracker.AddCallbackFunction("change",function(){i.OnChange(i.GetFieldValue())},!0),n};PhoneDataElement.prototype.CreateCountryCodeField=function(){var n=CreateInput(this.Name),t,i;return n.readOnly="readOnly",AddCssClass(n,"InputBox"),AddCssClass(n,"Textbox"),n.size=5,n.value=" ",t=this.CountriesField.options[this.CountriesField.selectedIndex].value,t!="0000"&&(n.value="+"+parseInt(t).toString()),i=this,this.CCEventTracker=new EventTracking(null,n),this.CCEventTracker.AddCallbackFunction("change",function(){i.OnChange(i.GetFieldValue())},!0),n};PhoneDataElement.prototype.GetFieldValue=function(){var t;if(!this.CountriesField)return!1;var i=this.CountriesField.options[this.CountriesField.selectedIndex].value,n=this.PhoneField.value;return n=n.replace(/\D/g,""),t=this.CountriesField.options[this.CountriesField.selectedIndex].id,n!=""?i+"-"+n+"-"+t:""};PhoneDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};CountryListDataElement.InheritsFrom(DataElement);CountryListDataElement.prototype.GetXmlNodeData=function(n){if(DataElement.prototype.GetXmlNodeData.call(this,n),this.Value=this.GetCDataValue(n,"Value"),this.SelectOption=this.GetCDataValue(n,"selectOption"),this.SelectedCountry=n.getAttribute("selectedCountry"),this.FavoritesCountryIsoCodesString=n.getAttribute("favoriteCountries"),this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1,this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions"),this.FavoritesCountryIsoCodes=this.FavoritesCountryIsoCodesString!=""&&this.FavoritesCountryIsoCodesString!=null?this.FavoritesCountryIsoCodesString.split(","):[],this.FavoritesCountryNamesString=n.getAttribute("favoriteCountriesNames"),this.FavoritesCountryNames=this.FavoritesCountryNamesString!=""&&this.FavoritesCountryNamesString!=null?this.FavoritesCountryNamesString.split(";"):[],this.RemainderCountryIsoCodes=n.getAttribute("remainderCountriesCodes").split(","),this.RemainderCountryNames=n.getAttribute("remainderCountriesNames").split(";"),this.IsReadMode){var t=this.CreateChildNode(null,"TextElement");t.IntendedUsage=IntendedUsage.ValueRepresentation;t.Text=this.Value}this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaption=n.getAttribute("explanatory_caption")};CountryListDataElement.prototype.InitializeMe=function(){DataElement.prototype.InitializeMe.call(this);this.CountriesField=this.CreateCountriesField();var n=document.createElement("div");AddCssClass(this.CountriesField,"form-control");AddCssClass(n,"CountryFields");n.appendChild(this.CountriesField);this.InputCell.appendChild(n)};CountryListDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top="-100%"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};CountryListDataElement.prototype.CreateCountriesField=function(){var t=document.createElement("select"),r=this,n;for(this.EventTracker=new EventTracking(null,t),this.EventTracker.AddCallbackFunction("change",function(){r.OnChange()}),AddCssClass(t,"Listbox"),n=document.createElement("option"),n.value="0000",n.text=this.SelectOption,t.appendChild(n),i=0;i<this.FavoritesCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.FavoritesCountryIsoCodes[i],n.text=this.FavoritesCountryNames[i],this.Value!=""&&this.Value==n.value&&(n.selected=!0),t.appendChild(n);for(this.FavoritesCountryIsoCodes.length>0&&(n=document.createElement("option"),n.disabled="disabled",n.value="0000",n.className="select-dash",n.text="-------",t.appendChild(n)),i=0;i<this.RemainderCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.RemainderCountryIsoCodes[i],n.text=this.RemainderCountryNames[i],this.Value!=""&&this.Value==n.value&&(n.selected=!0),t.appendChild(n);return t};CountryListDataElement.prototype.GetFieldValue=function(){return this.CountriesField?this.CountriesField.options[this.CountriesField.selectedIndex].value!="0000"?this.CountriesField.options[this.CountriesField.selectedIndex].value:null:null};CountryListDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};OrganizationNumberDataElement.InheritsFrom(DataElement);OrganizationNumberDataElement.prototype.GetXmlNodeData=function(n){if(DataElement.prototype.GetXmlNodeData.call(this,n),this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1,this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions"),this.Value=this.GetCDataValue(n,"Value"),this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"",this.SelectOption=GetCDataValue(n,"selectOption"),this.IsReadMode){var t=this.CreateChildNode(null,"TextElement");t.IntendedUsage=IntendedUsage.ValueRepresentation;t.Text=this.Value}this.FavoritesCountryCodesString=n.getAttribute("favoriteCountriesCodes");this.FavoritesCountryIsoCodes=this.FavoritesCountryCodesString!=""&&this.FavoritesCountryCodesString!=null?this.FavoritesCountryCodesString.split(","):[];this.FavoritesCountryNamesString=n.getAttribute("favoriteCountriesNames");this.FavoritesCountryNames=this.FavoritesCountryNamesString!=""&&this.FavoritesCountryNamesString!=null?this.FavoritesCountryNamesString.split(";"):[];this.RemainderCountryIsoCodes=n.getAttribute("remainderCountriesCodes").split(",");this.RemainderCountryNames=n.getAttribute("remainderCountriesNames").split(";");this.SelectedCountry=n.getAttribute("selectedOrgCountry")||"SWE"};OrganizationNumberDataElement.prototype.InitializeMe=function(){DataElement.prototype.InitializeMe.call(this);this.OrgNumberField=this.CreateNumberField();var n=document.createElement("div");AddCssClass(n,"OrgNumberFields");n.appendChild(this.OrgNumberField);this.InputCell.appendChild(n)};OrganizationNumberDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};OrganizationNumberDataElement.prototype.CreateCountriesField=function(){var r="",u,t,f,n;for(this.Value!=""&&(u=this.Value.split(":"),u.length>0&&(r=u[0])),t=document.createElement("select"),f=this,this.EventTracker=new EventTracking(null,t),this.EventTracker.AddCallbackFunction("change",function(){f.OnChange()}),AddCssClass(t,"Listbox"),n=document.createElement("option"),n.value="000",n.text=this.SelectOption,t.appendChild(n),i=0;i<this.FavoritesCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.FavoritesCountryIsoCodes[i],n.text=this.FavoritesCountryNames[i],this.Value!=""&&r==n.value&&(n.selected=!0),t.appendChild(n);for(this.FavoritesCountryIsoCodes.length>0&&(n=document.createElement("option"),n.disabled="disabled",n.value="000",n.className="select-dash",n.text="-------",t.appendChild(n)),i=0;i<this.RemainderCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.RemainderCountryIsoCodes[i],n.text=this.RemainderCountryNames[i],this.Value!=""&&r==n.value&&(n.selected=!0),t.appendChild(n);return t};OrganizationNumberDataElement.prototype.CreateNumberField=function(){var n=CreateInput(this.Name),t,i;return AddCssClass(n,"form-control"),AddCssClass(n,"Input_Text"),n.value=this.Value,n.value!=""&&(t=n.value.split(":"),t.length>0&&(n.value=t[1])),i=this,this.PNEventTracker=new EventTracking(null,n),this.PNEventTracker.AddCallbackFunction("change",function(){i.OnChange(i.GetFieldValue())},!0),n};OrganizationNumberDataElement.prototype.GetFieldValue=function(){var n;if(!this.CountriesField)return n=this.OrgNumberField.value,n!=""?this.SelectedCountry+":"+n:"";var t=this.CountriesField.options[this.CountriesField.selectedIndex].value,n=this.OrgNumberField.value;return n!=""?t+":"+n:""};OrganizationNumberDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};VATNumberDataElement.InheritsFrom(DataElement);VATNumberDataElement.prototype.GetXmlNodeData=function(n){if(DataElement.prototype.GetXmlNodeData.call(this,n),this.Value=this.GetCDataValue(n,"Value"),this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"",this.SelectOption=GetCDataValue(n,"selectOption"),this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1,this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions"),this.IsReadMode){var t=this.CreateChildNode(null,"TextElement");t.IntendedUsage=IntendedUsage.ValueRepresentation;t.Text=this.Value}this.FavoritesCountryCodesString=n.getAttribute("favoriteCountriesCodes");this.FavoritesCountryIsoCodes=this.FavoritesCountryCodesString!=""&&this.FavoritesCountryCodesString!=null?this.FavoritesCountryCodesString.split(","):[];this.FavoritesCountryNamesString=n.getAttribute("favoriteCountriesNames");this.FavoritesCountryNames=this.FavoritesCountryNamesString!=""&&this.FavoritesCountryNamesString!=null?this.FavoritesCountryNamesString.split(";"):[];this.RemainderCountryIsoCodes=n.getAttribute("remainderCountriesCodes").split(",");this.RemainderCountryNames=n.getAttribute("remainderCountriesNames").split(";")};VATNumberDataElement.prototype.InitializeMe=function(){var t,n;DataElement.prototype.InitializeMe.call(this);this.OrgNumberField=this.CreateNumberField();this.CountriesField=this.CreateCountriesField();this.CountryCodeField=this.CreateCountryCodeField();t=document.createElement("div");AddCssClass(t,"OrgNumberFields");t.appendChild(this.CountriesField);AddCssClass(this.CountriesField,"form-control");n=document.createElement("div");AddCssClass(n,"OrgNumberFields");n.appendChild(this.CountryCodeField);n.appendChild(this.OrgNumberField);this.InputCell.appendChild(t);this.InputCell.appendChild(n)};VATNumberDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top="-50%"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};VATNumberDataElement.prototype.CreateCountriesField=function(){var u="",f,t,r,n;for(this.Value!=""&&(f=this.Value.split(":"),f.length>0&&(u=f[0])),t=document.createElement("select"),r=this,this.EventTracker=new EventTracking(null,t),this.EventTracker.AddCallbackFunction("change",function(){var n=t.options[t.selectedIndex].value;r.CountryCodeField.value=n=="00"?" ":n;r.OnChange(r.GetFieldValue())}),AddCssClass(t,"Listbox"),n=document.createElement("option"),n.value="00",n.text=this.SelectOption,t.appendChild(n),i=0;i<this.FavoritesCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.FavoritesCountryIsoCodes[i],n.text=this.FavoritesCountryNames[i],this.Value!=""&&u==n.value&&(n.selected=!0),t.appendChild(n);for(this.FavoritesCountryIsoCodes.length>0&&(n=document.createElement("option"),n.disabled="disabled",n.value="00",n.className="select-dash",n.text="-------",t.appendChild(n)),i=0;i<this.RemainderCountryIsoCodes.length;i++)n=document.createElement("option"),n.value=this.RemainderCountryIsoCodes[i],n.text=this.RemainderCountryNames[i],this.Value!=""&&u==n.value&&(n.selected=!0),t.appendChild(n);return t};VATNumberDataElement.prototype.CreateNumberField=function(){var n=CreateInput(this.Name),t,i;return AddCssClass(n,"InputBox"),AddCssClass(n,"Textbox"),n.size=15,n.value=this.Value,n.value!=""&&(t=n.value.split(":"),t.length>0&&(n.value=t[1])),i=this,this.PNEventTracker=new EventTracking(null,n),this.PNEventTracker.AddCallbackFunction("change",function(){i.OnChange(i.GetFieldValue())},!0),n};VATNumberDataElement.prototype.CreateCountryCodeField=function(){var n=CreateInput(this.Name),t,i;return n.readOnly="readOnly",AddCssClass(n,"InputBox"),AddCssClass(n,"Textbox"),n.size=3,n.value=" ",t=this.CountriesField.options[this.CountriesField.selectedIndex].value,t!="00"&&(n.value=t),i=this,this.CCEventTracker=new EventTracking(null,n),this.CCEventTracker.AddCallbackFunction("change",function(){i.OnChange(i.GetFieldValue())},!0),n};VATNumberDataElement.prototype.GetFieldValue=function(){var n,t;if(!this.CountriesField)return n=this.OrgNumberField.value,n!=""?"SE:"+n:"";var i="",r=this.CountriesField.options[this.CountriesField.selectedIndex].value,n=this.OrgNumberField.value;return n!=""?(t=n,t=t.replace(/[^A-Za-z0-9]/g,""),n=t,i=r+":"+n):i="",i};VATNumberDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");RemoveCssClass(this.Icon,"explanatory-icon-opened");this.ExplanatoryOpened=!1};AddToCalendarElement.InheritsFrom(ElementBase);AddToCalendarElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Title=GetCDataValue(n,"_title");this.Description=GetCDataValue(n,"_description");this.DescriptionHtml=GetCDataValue(n,"_descriptionHtml");this.ButtonCaption=GetCDataValue(n,"_button_caption");this.Location=n.getAttribute("_location");this.Organizer=n.getAttribute("_organizer");this.OrganizerEmail=n.getAttribute("_organizer_email");this.IsNotInit=n.getAttribute("_isNotInit")==="true";this.Format=n.getAttribute("_format");this.StartValue=DateTimeParser(n.getAttribute("_start"),this.Format);this.EndValue=DateTimeParser(n.getAttribute("_end"),this.Format);this.SubcontainerId="subcont_"+this.Id;this.HideCaption=!0;this.Icon=ActiveIconArchive.Get("icon-calendar-2");var t=n.selectSingleNode("OptionsMenu");t&&(this.OptionsMenu=new ContextMenu(this,t.firstChild,!0),this.OptionsMenu.CreateChildNodes(t.firstChild),this.OptionsMenu.InitializeMe(),this.OptionsMenu.InitializeChildNodes())};AddToCalendarElement.prototype.InitializeMe=function(){var t,u,i,n,f,r;(!this.IsNotInit||this.IsDesignMode)&&(t=document.createElement("div"),AddCssClass(t,"form-group"),u=this.GetParentBody(),u.appendChild(t),this.Root=t,i=document.createElement("div"),t.appendChild(i),this.Body=i,i.id=this.Id,n=document.createElement("div"),n.setAttribute("type","button"),AddCssClass(n,"btn-default"),AddCssClass(n,"btn"),f=this.BuildIcon(),n.appendChild(f),this.SetButtonContent(n,this.ButtonCaption),r=document.createElement("div"),AddCssClass(r,"AddToCalendarContainer"),r.appendChild(n),this.Body.appendChild(r),this.IsDesignMode||this.OptionsMenu&&(this.EventTracker=new EventTracking(this.Body.id),this.ContextMenuHandle=this.EventTracker.AddCallback("click",this,"ShowOptionsContextMenu")),this.EnableInteraction())};AddToCalendarElement.prototype.ShowOptionsContextMenu=function(n,t,i){return this.OptionsMenu.CreateMenu(t,i),!1};AddToCalendarElement.prototype.SetButtonContent=function(n,t){var i=document.createElement("span");AddCssClass(i,"text");i.appendChild(document.createTextNode(t));n.appendChild(i)};AddToCalendarElement.prototype.BuildIcon=function(){var n=this.Icon.Create(null,null,!0);return this.ButtonCaption&&(n.style.marginRight="5px"),n};TimezonelistDataElement.InheritsFrom(DataElement);TimezonelistDataElement.prototype.GetXmlNodeData=function(n){if(DataElement.prototype.GetXmlNodeData.call(this,n),this.Value=this.GetCDataValue(n,"Value"),this.SelectOption=this.GetCDataValue(n,"selectOption"),this.SelectedTimezone=n.getAttribute("selectedTimezone"),this.TimezonesNames=n.getAttribute("timezonesName").split(";"),this.TimezonesCodes=n.getAttribute("timezonesCode").split(";"),this.IsReadMode){var t=this.CreateChildNode(null,"TextElement");t.IntendedUsage=IntendedUsage.ValueRepresentation;t.Text=this.Value}};TimezonelistDataElement.prototype.InitializeMe=function(){DataElement.prototype.InitializeMe.call(this);this.TimezonesField=this.CreateTimeZonesField();var n=document.createElement("div");AddCssClass(this.TimezonesField,"form-control");AddCssClass(n,"TimezonesFields");n.appendChild(this.TimezonesField);this.InputCell.appendChild(n)};TimezonelistDataElement.prototype.CreateTimeZonesField=function(){var t=document.createElement("select"),r=this,n;for(this.EventTracker=new EventTracking(null,t),this.EventTracker.AddCallbackFunction("change",function(){r.OnChange()}),AddCssClass(t,"Listbox"),n=document.createElement("option"),n.value="0000",n.text=this.SelectOption,t.appendChild(n),i=0;i<this.TimezonesCodes.length;i++)n=document.createElement("option"),n.value=this.TimezonesCodes[i],n.text=this.TimezonesNames[i],this.Value!=""&&this.Value==n.value&&(n.selected=!0),t.appendChild(n);return t};TimezonelistDataElement.prototype.GetFieldValue=function(){return this.TimezonesField?this.TimezonesField.options[this.TimezonesField.selectedIndex].value!="0000"?this.TimezonesField.options[this.TimezonesField.selectedIndex].value:null:null};ContainerElement.InheritsFrom(ElementBase);ContainerElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};ContainerElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;AddCssClass(n,"row");n.id=this.Id;t=this.GetParentBody(this);t.appendChild(n);this.Body=n};ContainerElement.prototype.DnDHoverReactionOn=function(){};ContainerElement.prototype.DnDHoverReactionOff=function(){};ContainerElement.prototype.GetAreaOfPosition=function(n){var t=this.Body||this.Root,i=LayerScreenPosition(t),r=new LayerSize(this.Body),u=i.Left+r.Width/2;return n<u?"Left":"Right"};ContainerColumnElement.InheritsFrom(ElementBase);ContainerColumnElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Margin=(n.getAttribute("margins")||0)*1;this.HalfMargin=this.Margin==0?0:Math.round(this.Margin/2);this.Padding=(n.getAttribute("padding")||0)*1;this.BackgroundColor=new Color(n.getAttribute("background_color"),"transparent");this.TextColor=new Color(n.getAttribute("text_color"),"000000");this.BorderWidth=0;this.SelectionBorderSize=5;this.NormalPadding=this.Padding;this.ScrollInto=n.getAttribute("scroll_into")};ContainerColumnElement.prototype.SetVerticalSpacing=function(n){this.Body.style.paddingBottom=n+"px"};ContainerColumnElement.prototype.IsEmpty=function(){for(var t=!0,n=this.FirstChild;n;){if(n.MyClassName!="ContextMenu"){t=!1;break}n=n.NextSibling}return t};ContainerColumnElement.prototype.GetColumnCount=function(){for(var t=0,n=this.Parent.FirstChild;n;)n.MyClassName==this.MyClassName&&t++,n=n.NextSibling;return t};ContainerColumnElement.prototype.InitializeMe=function(){var r=this.GetColumnCount(),c=12/r,o=Math.floor(12/r),h=(12/r-o)/2,i=document.createElement("div"),s,t,u,n,f,e;if(AddCssClass(i,"col-sm-"+o+" col-sm-offset-"+h),this.IsDesignMode,this.BackgroundColor.IsTransparent||(i.style.backgroundColor=this.BackgroundColor.Code()),s=this.GetParentBody(this),s.appendChild(i),this.Root=i,t=document.createElement("div"),AddCssClass(t,"form-horizontal"),t.setAttribute("role","form"),i.appendChild(t),t.id=this.Id,this.Body=t,this.IsDesignMode&&this.BuildControls(),this.ScrollInto!==null){for(u=!1,n=this;!u&&n!==null;)n=n.Parent,n!==null&&(u=n.MyClassName=="FormTemplateElement"?!0:!1);f=n!==null?n.GetDescendantByName(this.ScrollInto):null;f!==null&&(e=document.getElementById(f.Id),e!==null&&e.scrollIntoView({block:"center"}))}};ContainerColumnElement.prototype.ReinitializeClass=function(){var i=this.GetColumnCount(),r=Math.floor(12/i),u=(12/i-r)/2,n=document.createElement("div"),t;AddCssClass(n,"col-sm-"+r+" col-sm-offset-"+u);this.BackgroundColor.IsTransparent||(n.style.backgroundColor=this.BackgroundColor.Code());t=document.getElementById(this.Id);t&&(t.parentNode.className=n.className)};ContainerColumnElement.prototype.PostInitialized=function(){this.AlignElements()};ContainerColumnElement.prototype.AlignElements=function(){for(var t=0,n=this.FirstChild,i;n;)i=n.GetLabelWidth(),i>t&&(t=i),n=n.NextSibling;for(n=this.FirstChild;n;)n.AdjustLabelWidth(t),n=n.NextSibling};ContainerColumnElement.prototype.ShowContextMenu=function(n,t,i){this.IsHoverLocked=!0;var r=this,u=function(){r.IsHoverLocked=!1};return this.ContextMenu.CreateMenu(t,i,u),!1};ContainerColumnElement.prototype.BuildControls=function(){AddCssClass(this.Body,"ActiveContentContainer");var n=document.createElement("div");this.Body.appendChild(n);this.BuildToolbar(n)};ContainerColumnElement.prototype.BuildToolbar=function(n){var t=document.createElement("div"),r,i,u;AddCssClass(t,"ContentContainerToolbar");n.appendChild(t);this.SelectionToolbar=t;this.IsDragable&&(i=ActiveIconArchive.Get("icon-move"),r=i.Create("move"),t.appendChild(r),this.DnDEventTracker=new EventTracking(null,r),DragableElementSetupHelper(this.DnDEventTracker,this,this.DragableDescription));this.ContextMenu&&(i=ActiveIconArchive.Get("icon-pencil"),u=i.Create("pointer"),t.appendChild(u),this.MenuEventTracker=new EventTracking(null,u),this.ContextMenuHandle=this.MenuEventTracker.AddCallback("click",this,"ShowContextMenu"))};ContainerColumnElement.prototype.OnResize=function(){ElementBase.prototype.OnResize.call(this);this.AlignElements()};ContainerColumnElement.prototype.SetColor=function(n){this.Color=n;this.Body.style.backgroundColor=n};ContainerColumnElement.prototype.DnDHoverReactionOn=function(){AddCssClass(this.Body,"DnD")};ContainerColumnElement.prototype.DnDHoverReactionOff=function(){RemoveCssClass(this.Body,"DnD")};ContainerColumnElement.prototype.GetAreaOfPosition=function(n,t,i){var r;return i==this.MyClassName?this.TriangulatePosition(n,t):"All"};ContainerColumnElement.prototype.DnDHoverIn=function(n,t){ElementBase.prototype.DnDHoverIn.call(this,n,t);this.ActiveHoverClass&&(RemoveCssClass(this.Root,this.ActiveHoverClass),this.ActiveHoverClass=null);t==this.MyClassName&&n!="All"&&(this.ActiveHoverClass="Hover"+n,AddCssClass(this.Root,this.ActiveHoverClass))};ContainerColumnElement.prototype.DnDHoverOut=function(){ElementBase.prototype.DnDHoverOut.call(this);this.ActiveHoverClass&&(RemoveCssClass(this.Root,this.ActiveHoverClass),this.ActiveHoverClass=null)};ContainerColumnElement.prototype.TriangulatePosition=function(n,t){var u=new Position2D(n,t),i=LayerScreenPosition(this.Body),r=new LayerSize(this.Body),f=new Position2D(i.Left+r.Width/2,i.Top+r.Height/2),e=new Position2D(i.Left,i.Top),o=new Position2D(i.Left+r.Width,i.Top),s=new Position2D(i.Left,i.Top+r.Height),h=new Position2D(i.Left+r.Width,i.Top+r.Height),c=new Triangle(s,e,f),l=new Triangle(h,o,f),a=new Triangle(e,o,f),v=new Triangle(s,h,f);return IsInsideTriangle(c,u)?"Left":IsInsideTriangle(l,u)?"Right":IsInsideTriangle(a,u)?"Top":IsInsideTriangle(v,u)?"Bottom":"All"};DateTimePickerElement.InheritsFrom(ElementBase);DateTimePickerElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.IsStart=!1;this.IsEnd=!1;this.Format=n.getAttribute("format");this.PickerStyle=n.getAttribute("picker_style");this.MinimumValue=DateTimeParser(n.getAttribute("min"),this.Format);this.MaximumValue=DateTimeParser(n.getAttribute("max"),this.Format);var t=n.getAttribute("start");t=t?DateTimeParser(t,this.Format):new Date(0,0);this.Value=t;t.getFullYear()===1900;this.StartValue=t;this.StartValue<this.MinimumValue&&(this.StartValue=DateTimeParser(n.getAttribute("min"),this.Format));this.Interval=new Number(n.getAttribute("interval"));this.WeekdayNames=n.getAttribute("weekday_names").split(",");this.MonthNames=n.getAttribute("month_names").split(",");this.YearName=n.getAttribute("year_name").split(",");this.MonthName=n.getAttribute("month_name").split(",");this.DayName=n.getAttribute("day_name").split(",");this.TimeName=n.getAttribute("time_name").split(",");this.SelectDate=!0;this.SelectTime=this.Interval<1440;this.PickerStyle=n.getAttribute("picker_style")};DateTimePickerElement.prototype.AdjustLabelWidth=function(n){this.Label.style.width=n+"px"};DateTimePickerElement.prototype.GetLabelWidth=function(){var n=-1;return this.Label&&(n=new LayerSize(this.Label).Width),n};DateTimePickerElement.prototype.InitializeMe=function(){this.Body=document.createElement("div");AddCssClass(this.Body,"DateTimePickerContainer");this.Body.id=this.Id;this.PickerStyle=="Compact"?this.InitializeDropdownPickerStyle():this.InitializeTextboxPickerStyle();this.Parent.GetBodyElement().appendChild(this.Body)};DateTimePickerElement.prototype.InitializeDropdownPickerStyle=function(){var i=this,n,t,r;this.Caption&&(n=document.createElement("label"),AddCssClass(n,"Caption"),n.setAttribute("for",this.Id+"_inp"),n.appendChild(document.createTextNode(this.Caption)),this.Body.appendChild(n),this.Label=n);t=new DropdownPicker(this.MinimumValue,this.MaximumValue,this.Value,this.Interval,function(n){i.SetDate(n)},this.YearName,this.MonthName,this.DayName,this.TimeName);r=t.Create();this.Body.appendChild(r);this.DropDownPicker=t;this.UpdatePicker=function(){t.MinTime=i.MinimumValue.CreateClone();t.MaxTime=i.MaximumValue.CreateClone();t.Rebuild()}};DateTimePickerElement.prototype.InitializeTextboxPickerStyle=function(){var t=this.BuildTextbox(this.Body),n=this;this.UpdatePicker=function(){n.UpdateTextbox()};this.UpdatePicker()};DateTimePickerElement.prototype.UpdateTextbox=function(){if(this.Input){var n;n=this.IsDefined()?this.SelectDate&&this.SelectTime?DateTimeToString(this.Value,this.Format):DateToString(this.Value,this.Format):"";this.Input.value=n}};DateTimePickerElement.prototype.TextboxUpdated=function(){var n=this.Input.value,t=this.SelectDate&&this.SelectTime?DateTimeParser(n,this.Format):DateParser(n,this.Format);this.IsDateAvailable(t)?this.SetDate(t):this.UpdateTextbox()};DateTimePickerElement.prototype.OnPickerEnded=function(){this.Picker=null};DateTimePickerElement.prototype.PickDate=function(){var n,t;this.Picker&&(this.Picker.End(),this.Picker=null);this.IsDefined()?n=this.Value:(n=new Date,n<this.MinimumValue?n=this.MinimumValue:n>this.MaximumValue&&(n=this.MaximumValue));t=new DatePicker(this,"SetDate",this.InputBox,n);t.Start();this.Picker=t};DateTimePickerElement.prototype.PickTime=function(){var t,n;this.Picker&&(this.Picker.End(),this.Picker=null);t=this.IsDefined()?this.Value:this.MinimumValue;n=new TimePicker(this,"SetDate",this.InputBox,t,this.Interval);n.Start();this.Picker=n};DateTimePickerElement.prototype.BuildTextbox=function(n){var s=n,i,r,t,f,e,u;this.Caption&&(i=document.createElement("label"),AddCssClass(i,"Caption"),i.setAttribute("for",this.Id+"_inp"),i.appendChild(document.createTextNode(this.Caption)),s.appendChild(i),this.Label=i);r=document.createElement("div");AddCssClass(r,"input-group");this.InputBox=r;t=CreateInput(this.Id+"_inp");t.type="text";AddCssClass(t,"form-control");f=this;t.onchange=function(){f.TextboxUpdated()};this.Input=t;r.appendChild(t);s.appendChild(r);e=document.createElement("span");AddCssClass(e,"input-group-btn");r.appendChild(e);var c=function(){var n=document.createElement("button");return AddCssClass(n,"btn btn-secondary"),n.type="button",e.appendChild(n),n},h=15,f=this,l=this.ContextMenu,a=this.Mode,v=this.IsDesignMode,o;return this.SelectDate&&(u=c(),o=ActiveIconArchive.Get("icon-calendar").Create(),this.IsDesignMode||(u.onclick=function(){f.PickDate()}),h+=10,u.appendChild(o)),this.SelectTime&&(u=c(),o=ActiveIconArchive.Get("icon-clock").Create(),this.IsDesignMode||(u.onclick=function(){f.PickTime()}),h+=5,u.appendChild(o)),t.size=h,s};DateTimePickerElement.prototype.IsDefined=function(){var n=new Date(1,0).valueOf();return this.Value.valueOf()>n};DateTimePickerElement.prototype.GetValue=function(){var n=null;return this.DropDownPicker&&this.DropDownPicker.AllDateFilled()===!1?null:(this.IsDefined()&&(n=this.SelectDate&&this.SelectTime?DateTimeToString(this.Value,this.Format):DateToString(this.Value,this.Format)),n)};DateTimePickerElement.prototype.SetOnValueChanged=function(n,t){this.OnChangeObject=n;this.OnChangeMethod=t};DateTimePickerElement.prototype.IsDateSelected=function(n){var t=!1;return this.Value&&(t=n.getYear()==this.Value.getYear()&&n.getMonth()==this.Value.getMonth()&&n.getDate()==this.Value.getDate()),t};DateTimePickerElement.prototype.IsDateAvailable=function(n){var t=new DateSpan(this.MinimumValue,this.MaximumValue);return t.IsWithin(n)};DateTimePickerElement.prototype.IsDateAvailableNoTime=function(n){var r=new Date(this.MinimumValue),t,i,u,f;return r.setHours(0,0,0,0),t=new Date(this.MaximumValue),t.setHours(0,0,0,0),i=new Date(n),i.setHours(0,0,0,0),u=new DateSpan(r,t),f=u.IsWithin(i),f};DateTimePickerElement.prototype.SetDate=function(n){if(this.Picker&&(this.Picker=null),value=n,value<this.MinimumValue?value=this.MinimumValue:value>this.MaximumValue&&(value=this.MaximumValue),this.StartDate=value,this.Value=this.StartDate.CreateClone(),this.Initialized){if(this.UpdateTextbox(),this.OnChangeObject){if(!this.OnChangeObject[this.OnChangeMethod])throw new Error("Could not invoke event "+this.OnChangeMethod);this.OnChangeObject[this.OnChangeMethod]()}this.Parent.OnChange&&this.Parent.OnChange(this.Value)}};DateTimePickerElement.prototype.Rebuild=function(){this.UpdatePicker()};DateTimeDataElement.InheritsFrom(DataElement);DateTimeDataElement.prototype.OnResize=function(){var t=new LayerCoordinates(this.GetBodyElement()),i=t.Top-t.Top+t.Height,r=0,n;for(t.Left,n=this.FirstChild;n;)n.OnResize&&(n==this.StartPicker?n.OnResize(r,i):n==this.EndPicker?n.OnResize(r+this.EndPicker.Width,i):n.OnResize()),n=n.NextSibling};DateTimeDataElement.prototype.GetXmlNodeData=function(n){DataElement.prototype.GetXmlNodeData.call(this,n);this.StartPicker=this.CreateChildNode(n,"DateTimePickerElement");this.StartPicker.Caption=GetCDataValue(n,"StartCaption");this.StartPicker.Left=0;this.StartPicker.Top=0;this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions")};DateTimeDataElement.prototype.GetValuesAsQuery=function(n){var t=this.StartPicker.GetValue();t&&n.Add(this.Name,t)};DateTimeDataElement.prototype.GetFieldValue=function(){return this.StartPicker.GetValue()};DateTimeDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"):AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};DateTimeDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};DateTimeSpanDataElement.InheritsFrom(DataElement);DateTimeSpanDataElement.prototype.OnResize=function(){for(var t=0,i=0,n=this.FirstChild;n;)n==this.StartPicker?n.OnResize(i,t):n==this.EndPicker?n.OnResize(i+this.EndPicker.Width,t):n.OnResize(),n=n.NextSibling};DateTimeSpanDataElement.prototype.GetXmlNodeData=function(n){var t,i,r,u;DataElement.prototype.GetXmlNodeData.call(this,n);this.Format=n.getAttribute("format");this.ExplanatoryState=n.getAttribute("explanatory_state")==="true"?!0:!1;this.ExplanatoryCaptions=GetCDataValue(n,"explanatory_captions");this.StartValue=DateTimeParser(n.getAttribute("start"),this.Format);this.EndValue=DateTimeParser(n.getAttribute("end"),this.Format);t=GetCDataValue(n,"StartCaption");i=GetCDataValue(n,"EndCaption");this.IsReadMode?(r=this.CreateChildNode(null,"TextElement"),r.IntendedUsage=IntendedUsage.ValueRepresentation,r.Text=t+": "+DateToString(this.StartValue,this.Format),u=this.CreateChildNode(null,"TextElement"),u.IntendedUsage=IntendedUsage.ValueRepresentation,u.Text=i+": "+DateToString(this.EndValue,this.Format)):(this.StartPicker=this.CreateChildNode(n,"DateTimePickerElement"),this.StartPicker.Caption=t,this.StartPicker.IsStart=!0,this.StartPicker.SetOnValueChanged(this,"OnStartChanged"),this.StartPicker.Top=0,this.StartPicker.Left=0,this.EndPicker=this.CreateChildNode(n,"DateTimePickerElement"),this.EndPicker.Caption=i,this.EndPicker.IsEnd=!0,this.EndPicker.SetOnValueChanged(this,"OnEndChanged"),this.EndPicker.Top=0,this.EndPicker.Left=this.StartPicker.Width,this.StartPicker.Value=this.StartValue,this.EndPicker.Value=this.EndValue,this.EndPicker.MinimumValue<this.StartPicker.Value&&(this.EndPicker.MinimumValue=this.StartPicker.Value.CreateClone()))};DateTimeSpanDataElement.prototype.GetValuesAsQuery=function(n){if(!this.IsReadMode){if(!this.Name)return;var t=this.StartPicker.GetValue()+","+this.EndPicker.GetValue();n.Add(this.Name,t)}};DateTimeSpanDataElement.prototype.GetFieldValue=function(){var n=this.StartPicker.GetValue(),t=this.EndPicker.GetValue();return n&&t?n+","+t:null};DateTimeSpanDataElement.prototype.OnStartChanged=function(){this.StartPicker.IsDefined()&&(this.EndPicker.MinimumValue=this.StartPicker.Value.CreateClone(),this.EndPicker.IsDefined()&&this.EndPicker.Value<this.EndPicker.MinimumValue&&(this.EndPicker.Value=this.EndPicker.MinimumValue.CreateClone()),this.EndPicker.Rebuild(),this.OnChange(this.EndPicker.Value,this.EndPicker.Name))};DateTimeSpanDataElement.prototype.OnEndChanged=function(){this.EndPicker.IsDefined()?(this.StartPicker.MaximumValue=this.EndPicker.Value.CreateClone(),this.StartPicker.Rebuild(),this.OnChange(this.StartPicker.Value,this.StartPicker.Name)):(this.StartPicker.MaximumValue=this.EndPicker.MaximumValue.CreateClone(),this.StartPicker.Rebuild())};DateTimeSpanDataElement.prototype.PostInitialized=function(){var t,n;this.IsRequired&&(AddCssClass(this.Root,"has-feedback"),t=document.createElement("i"),AddCssClass(t,"form-control-feedback icon-large Icon icon-star-6"),this.RequiredIcon=t,this.InputCell.appendChild(t),this.UpdateRequirementIndicatorResponsive());this.ExplanatoryState&&this.ExplanatoryCaptions!==""&&(this.Icon=document.createElement("i"),AddCssClass(this.Icon,"explanatory-icon icon-large Icon icon-question-4"),this.InputCell.appendChild(this.Icon),n=this,this.IsDesignMode||(this.Icon.onclick=function(){var i=document.getElementsByClassName("form-group"),r=i.item(i.length-1),u=document.getElementById(n.Id),t;n.ExplanatoryOpened=!0;RemoveCssClass(n.ExplanatoryDialog,"explanatory-text");i.length>1&&u.id===r.id?(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened-over"),n.ExplanatoryDialog.style.top="5%"):(AddCssClass(n.ExplanatoryDialog,"explanatory-text-opened"),n.ExplanatoryDialog.style.top="100%");n.ExplanatoryDialog.style.left=n.InputCell.style.left;t=document.createElement("div");t.style.position="fixed";t.style.bottom="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.backgroundColor="rgba(0, 0, 0, 0.3)";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"RemoveDimmer")}),this.ExplanatoryDialog=document.createElement("div"),this.ExplanatoryDialog.appendChild(document.createTextNode(this.ExplanatoryCaptions)),RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened"),AddCssClass(this.ExplanatoryDialog,"explanatory-text"),this.InputCell.appendChild(this.ExplanatoryDialog))};DateTimeSpanDataElement.prototype.RemoveDimmer=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened");RemoveCssClass(this.ExplanatoryDialog,"explanatory-text-opened-over");AddCssClass(this.ExplanatoryDialog,"explanatory-text");this.ExplanatoryOpened=!1};TimeZoomDay=0;TimeZoomMonth=1;DatePicker.prototype.Rebuild=function(){switch(this.Zoom){case TimeZoomDay:this.BuildDaySelector();break;case TimeZoomMonth:this.BuildMonthSelector();break;default:throw Error("Unexpected zoom");}};DatePicker.prototype.StartMonthBrowser=function(){this.Zoom=TimeZoomMonth;this.Rebuild()};DatePicker.prototype.StartDayBrowser=function(){this.Zoom=TimeZoomDay;this.Rebuild()};DatePicker.prototype.CreateDimmer=function(){var n=this,t=document.createElement("div");t.style.position="absolute";t.style.top="0px";t.style.height="100%";t.style.left="0px";t.style.width="100%";t.style.overflow="hidden";t.style.zIndex="20";n.Floor=t;document.body.appendChild(t);n.Dimmer=CreateDimmerElement();n.Dimmer.id=n.Id+"_dimmer";n.Floor.appendChild(n.Dimmer);n.EventTracker=new EventTracking(n.Dimmer.id);n.EventTracker.AddCallback("click",n,"End")};DatePicker.prototype.CleanBox=function(){for(var n=this.Box.firstChild,t;n;)t=n.nextSibling,n.parentNode.removeChild(n),n=t};DatePicker.prototype.IsDateAvailable=function(n){return this.Reference.IsDateAvailable(n)};DatePicker.prototype.IsDateAvailableNoTime=function(n){return this.Reference.IsDateAvailableNoTime(n)};DatePicker.prototype.IsDateSelected=function(n){var t=!1;return this.CurrentValue&&(t=n.getYear()==this.CurrentValue.getYear()&&n.getMonth()==this.CurrentValue.getMonth()&&n.getDate()==this.CurrentValue.getDate()),t};DatePicker.prototype.Start=function(){var n,i,t;this.Reference.InputBox.style.zIndex="100";this.CreateDimmer();n=document.createElement("div");AddCssClass(n,"PickerBox");AddCssClass(n,"DatePicker");i=new LayerSize(this.ParentElement);t=LayerAbsoluteScreenPosition(this.ParentElement);n.style.top=t.Top+i.Height+3+"px";n.style.left=t.Left+"px";document.body.appendChild(n);this.Box=n;this.Rebuild()};DatePicker.prototype.End=function(){this.Dimmer.parentNode.removeChild(this.Dimmer);this.Dimmer=null;this.Floor.parentNode.removeChild(this.Floor);this.Floor=null;this.Box.parentNode.removeChild(this.Box);this.Reference.InputBox.style.zIndex="";this.Reference.OnPickerEnded()};DatePicker.prototype.NavigateNextMonth=function(){this.Value.setDate(1);this.Value.setMonth(this.Value.getMonth()+1);this.Rebuild()};DatePicker.prototype.NavigatePreviousMonth=function(){this.Value.setDate(1);this.Value.setMonth(this.Value.getMonth()-1);this.Rebuild()};DatePicker.prototype.BuildDaySelector=function(){this.CleanBox();this.Box.appendChild(this.CreateMonthSlider());this.Box.appendChild(this.CreateWeekDayRow());this.BuildDayCalendar()};DatePicker.prototype.BuildDayCalendar=function(){for(var n,e,u=document.getElementsByClassName("Header"),i=0;i<u.length;i++)u[i].style.width="29.73px";var t=new CalendarController(this.Value),o=this,r,f=function(){var n=document.createElement("div");return o.Box.appendChild(n),AddCssClass(n,"Row"),n},s=function(n){var t=document.createElement("div"),i;return AddCssClass(t,"Date"),i=n.getDate()<10?"0"+n.getDate():n.getDate(),t.appendChild(document.createTextNode(i)),r.appendChild(t),t};for(r=f(),n=t.GetCurrentDate();t.IsInsideCalendar(n);)n.GetWeekday()==1&&(r=f()),e=this.IsDateAvailableNoTime(n),cell=s(n),t.IsInsideMonth(n)?e?this.BuildDayCalendarCell(n,cell):SetOpacity(cell,2):SetOpacity(cell,0),t.StepForward(),n=t.GetCurrentDate()};DatePicker.prototype.BuildDayCalendarCell=function(n,t){var i=this,r;AddCssClass(t,this.IsDateSelected(n)?"ActivatedBox":"ActiveBox");typeof t.onselectstart!="undefined"?t.onselectstart=function(){return!1}:typeof t.style.MozUserSelect!="undefined"&&(t.style.MozUserSelect="none");r=n.CreateClone();t.onclick=function(){i.Reference.SetDate(r);i.End()}};DatePicker.prototype.CreateWeekDayRow=function(){var n=document.createElement("div"),r,t,i;for(n.style.whiteSpace="nowrap",AddCssClass(n,"DatePickerHeaders"),r=this.Reference.WeekdayNames,t=0;t<r.length;t++)i=document.createElement("div"),AddCssClass(i,"Header"),i.appendChild(document.createTextNode(r[t].slice(0,2))),n.appendChild(i);return n};DatePicker.prototype.CreateMonthSlider=function(){var u=this,f=this.Reference.MonthNames[this.Value.getMonth()],e=f+" "+this.Value.getFullYear(),r=document.createElement("div"),i,n,t;return r.style.position="relative",r.style.textAlign="center",r.style.verticalAlign="middle",r.style.whiteSpace="nowrap",i=document.createElement("div"),i.style.position="relative",i.style.display="inline-block",i.style.padding="8px 10px 8px 10px",i.style.margin="2px 0px 2px 0px",i.className="ActiveBoxMonth RoundBorders",i.appendChild(document.createTextNode(e)),i.onclick=function(){u.StartMonthBrowser()},r.appendChild(i),n=document.createElement("div"),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.className="ActiveBox RoundBordersTopLeft",n.style.padding="8px",n.style.paddingLeft="5px",n.style.paddingRight="5px",n.appendChild(CreateImage(GraphicsBasePath+"tiny/nav_left_black.png")),r.appendChild(n),n.onclick=function(){u.NavigatePreviousMonth()},t=document.createElement("div"),t.style.position="absolute",t.style.right="0px",t.style.top="0px",t.className="ActiveBox RoundBordersTopRight",t.style.padding="8px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.appendChild(CreateImage(GraphicsBasePath+"tiny/nav_right_black.png")),r.appendChild(t),t.onclick=function(){u.NavigateNextMonth()},r};DatePicker.prototype.NavigateNextYear=function(){this.Value.setFullYear(this.Value.getFullYear()+1);this.Rebuild()};DatePicker.prototype.NavigatePreviousYear=function(){this.Value.setFullYear(this.Value.getFullYear()-1);this.Rebuild()};DatePicker.prototype.BuildMonthSelector=function(){this.CleanBox();this.Box.appendChild(this.CreateYearSlider());this.BuildMonthCalendar()};DatePicker.prototype.BuildMonthCalendar=function(){for(var i,f,s=this.Box,r=this,e=function(){var n=document.createElement("div");return r.Box.appendChild(n),n},u,o=function(n){var t=document.createElement("div"),i,f;return t.style.position="relative",t.style.display="inline-block",t.style.textAlign="center",t.className="RoundBorders",t.style.padding="10px 8px 10px 8px",t.style.margin="2px 2px 2px 2px",i=r.Reference.MonthNames[n.getMonth()],f=n.getDate()<10?"0"+n.getDate():n.getDate(),t.appendChild(document.createTextNode(i)),u.appendChild(t),t},n=new Date(this.Value.getFullYear(),0,this.Value.getDate(),this.Value.getHours(),this.Value.getMinutes(),0),t=0;t<12;t++)t%4==0&&(u=e()),n.setMonth(t),i=o(n),f=this.IsDateAvailable(n),f?this.BuildMonthCalendarCell(n,i):SetOpacity(i,0)};DatePicker.prototype.BuildMonthCalendarCell=function(n,t){var i=this,u=n.getFullYear()==this.CurrentValue.getFullYear()&&n.getMonth()==this.CurrentValue.getMonth(),r;t.className+=" "+(u?"ActivatedBoxMonth":"ActiveBoxMonth");r=n.CreateClone();t.onclick=function(){i.Value=r;i.StartDayBrowser()}};DatePicker.prototype.CreateYearSlider=function(){var f=this.Value.getFullYear(),i=document.createElement("div"),r,u,n,t;return i.style.position="relative",i.style.textAlign="center",i.style.verticalAlign="middle",i.style.whiteSpace="nowrap",r=document.createElement("div"),r.style.position="relative",r.style.display="inline-block",r.style.padding="8px 10px 8px 10px",r.style.margin="2px 0px 2px 0px",r.className="RoundBorders",r.appendChild(document.createTextNode(f)),i.appendChild(r),u=this,n=document.createElement("div"),n.style.position="absolute",n.style.left="0px",n.style.top="0px",n.className="ActiveBox RoundBordersTopLeft",n.style.padding="8px",n.style.paddingLeft="5px",n.style.paddingRight="5px",n.appendChild(CreateImage(GraphicsBasePath+"tiny/nav_left_black.png")),i.appendChild(n),n.onclick=function(){u.NavigatePreviousYear()},t=document.createElement("div"),t.style.position="absolute",t.style.right="0px",t.style.top="0px",t.className="ActiveBox RoundBordersTopRight",t.style.padding="8px",t.style.paddingLeft="5px",t.style.paddingRight="5px",t.appendChild(CreateImage(GraphicsBasePath+"tiny/nav_right_black.png")),i.appendChild(t),t.onclick=function(){u.NavigateNextYear()},i};TimePicker.prototype.FillTimes=function(){var u=this.Interval,n=this.Value.CreateClone(),t,i,r;for(n.setHours(0),n.setMinutes(0),t=0;t<1440;t+=u)i=Math.round(t/60),r=t-i*60,n.setHours(i),n.setMinutes(r),this.IsDateAvailable(n)&&this.Box.appendChild(this.CreateTimeBox(n))};TimePicker.prototype.CreateTimeBox=function(n){var r=this.IsDateSelected(n),t=document.createElement("div"),i,u;t.className=r?"ActivatedBoxTimer":"ActiveBox";t.className+=" RoundBorders";t.style.padding="5px";t.style.paddingLeft="10px";t.style.margin="2px";t.style.marginRight="8px";var f=n.getHours(),e=n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),o=f+":"+e;return t.appendChild(document.createTextNode(o)),r&&(this.SelectedBox=t),i=this,u=n.CreateClone(),t.onclick=function(){i.Reference.SetDate(u);i.End()},t};TimePicker.prototype.Start=function(){var n,t;this.Reference.InputBox.style.zIndex="100";this.CreatePageCover();n=document.createElement("div");AddCssClass(n,"PickerBox");n.style.height="200px";n.style.overflow="auto";t=new LayerCoordinates(this.ParentElement);n.style.top=t.Top+t.Height+3+"px";n.style.left=t.Left+"px";n.style.width=t.Width+"px";document.body.appendChild(n);this.Box=n;this.FillTimes()};TimePicker.prototype.End=function(){this.PageCover.parentNode.removeChild(this.PageCover);this.Box.parentNode.removeChild(this.Box);this.Reference.InputBox.style.zIndex="";this.Reference.OnPickerEnded()};TimePicker.prototype.CreatePageCover=function(){var n=CreateImage(GraphicsBasePath+"transparent.png"),t;n.style.position="absolute";n.style.top="0px";n.style.left="0px";n.style.width="100%";n.style.height="100%";document.body.appendChild(n);this.PageCover=n;t=this;n.onclick=function(){t.End()}};TimePicker.prototype.IsDateAvailable=function(n){return this.Reference.IsDateAvailable(n)};TimePicker.prototype.IsDateSelected=function(n){var t=!1;return this.CurrentValue&&(t=n.getHours()==this.CurrentValue.getHours()&&n.getMinutes()==this.CurrentValue.getMinutes()),t};DropdownPicker.prototype.Rebuild=function(){for(var t,i,n=0;n<this.Boxes.length;n++)t=this.Boxes[n],t.Min=this.MinTime.CreateClone(),t.Max=this.MaxTime.CreateClone();for(n=0;n<this.Boxes.length;n++)if(t=this.Boxes[n],i=t.Rebuild(),!i&&t.Next){t.Next.Hide();break}};DropdownPicker.prototype.AllDateFilled=function(){for(var t,n=0;n<this.Boxes.length;n++)if(t=this.Boxes[n],isComplete=t.IsDefined(),!isComplete)return!1;return!0};DropdownPicker.prototype.BoxUpdated=function(){for(var r,t=!1,n=this.MinTime.CreateClone(),i=0;i<this.Boxes.length;i++)if(r=this.Boxes[i],t=r.IsDefined(),t)n=r.ModifyTime(n);else break;t?this.SetTime(n):n=new Date(0,0);this.OnChangeCallback&&this.OnChangeCallback(n)};DropdownPicker.prototype.PresetTime=function(n,t){for(var r,i=0;i<t.length;i++)r=t[i],r.PortionValue=r.GetTimePortion(n)};DropdownPicker.prototype.Create=function(){var r=document.createElement("div"),n,t,u,i,f;for(AddCssClass(r,"TimeDropdownContainer"),n=[],this.Boxes=n,n.push(this.CreateYearElement()),n.push(this.CreateMonthElement()),n.push(this.CreateDayElement()),this.NoTime||n.push(this.CreateTimeElement()),t=1;t<n.length;t++)n[t].Previous=n[t-1],n[t-1].Next=n[t];for(t=0;t<n.length;t++)u=n[t],u.BuildBox(),r.appendChild(u.Element);return i=this.CurrentTime.CreateClone(),i<this.MinTime?(f=n[0],i=f.ModifyTime(i,f.GetTimePortion(this.MinTime))):this.PresetTime(i,n),n[0].Rebuild(i),r};DropdownPicker.prototype.CreateTimeElement=function(){for(var t=[],i=function(n){return("00"+n).substr(-2,2)},n=0;n<1440;n=n+this.MinutesInterval){var r=n==0?n:Math.floor(n/60),f=n-r*60,e=i(r)+":"+i(f),o={Title:e,Value:n};t.push(o)}var u=this,s=function(n){u.SetTime(n)};return new TimePortionBox(this.CurrentTime,TimePortionBox.Time,s,this.TimeTitle,t,this.MinTime,this.MaxTime,function(){u.BoxUpdated()})};DropdownPicker.prototype.CreateDayElement=function(){for(var i,t=[],n=1;n<=31;n++)i={Title:n.toString(),Value:n.toString()},t.push(i);var r=this,u=function(n){r.SetTime(n)};return new TimePortionBox(this.CurrentTime,TimePortionBox.Day,u,this.DayTitle,t,this.MinTime,this.MaxTime,function(){r.BoxUpdated()})};DropdownPicker.prototype.CreateMonthElement=function(){for(var i,t=[],n=1;n<=12;n++)i={Title:n.toString(),Value:(n-1).toString()},t.push(i);var r=this,u=function(n){r.SetTime(n)};return new TimePortionBox(this.CurrentTime,TimePortionBox.Month,u,this.MonthTitle,t,this.MinTime,this.MaxTime,function(){r.BoxUpdated()})};DropdownPicker.prototype.CreateYearElement=function(){for(var i,t=[],n=1901;n<2061;n++)i={Title:n.toString(),Value:n.toString()},t.push(i);var r=this,u=function(n){r.SetTime(n)};return new TimePortionBox(this.CurrentTime,TimePortionBox.Year,u,this.YearTitle,t,this.MinTime,this.MaxTime,function(){r.BoxUpdated()})};DropdownPicker.prototype.SetTime=function(n){this.CurrentTime.setTime(n.getTime())};DropdownPicker.prototype.OnChange=function(n){if(!IsDate(n))throw new Error("Invalid argument: newTime is not a Date type");this.OnChangeCallback&&typeof this.OnChangeCallback=="function"&&this.OnChangeCallback(n)};TimePortionBox.SetTimePortionFuncs=[function(n,t){n.setFullYear(t)},function(n,t){n.setDate(1);n.setMonth(t)},function(n,t){n.setDate(t)},function(n,t){n.setHours(0);n.setMinutes(t)}];TimePortionBox.GetTimePortionFuncs=[function(n){return n.getFullYear()},function(n){return n.getMonth()},function(n){return n.getDate()},function(n){return n.getHours()*60+n.getMinutes()}];TimePortionBox.prototype.ModifyTime=function(n,t){var i=n.CreateClone(),r=IsDefined(t)?t:this.PortionValue;return TimePortionBox.SetTimePortionFuncs[this.Portion](i,r),i};TimePortionBox.prototype.GetTimePortion=function(n){return TimePortionBox.GetTimePortionFuncs[this.Portion](n)};TimePortionBox.prototype.BuildBox=function(){var n=document.createElement("select"),t;AddCssClass(n,"Listbox");AddCssClass(n,"form-control");t=this;n.onchange=function(){t.OnChange(n.options[n.selectedIndex].value)};this.Element=n};TimePortionBox.prototype.IsDefined=function(){return this.PortionValue!=null};TimePortionBox.prototype.OnChange=function(n){var t;n===""||n==null?(this.PortionValue=null,t=new Date(0,0)):(this.PortionValue=n*1,t=this.ModifyTime(this.Time,this.PortionValue));this.SetTime(t);this.Rebuild();this.UpdateCallback()};TimePortionBox.prototype.Rebuild=function(){var t,i,n;for(this.ClearOptions(),t=this.CreateOptions(),i=t.length==1,n=0;n<t.length;n++)t[n].selected&&(i=!0),this.Element.options[n]=t[n];return this.Show(),i?this.Next&&(this.Next.Rebuild(),this.Next.Show()):(this.PortionValue=null,this.Next&&this.Next.Hide()),i};TimePortionBox.prototype.Hide=function(){this.Element.style.visibility="hidden";this.Next&&this.Next.Hide()};TimePortionBox.prototype.Show=function(){this.Element.style.visibility=""};TimePortionBox.prototype.PreviousBelowMax=function(n){var i=!1,t,r,u;if(this.Portion>0)for(t=0;t<this.Portion;t++)if(r=TimePortionBox.GetTimePortionFuncs[t](n),u=TimePortionBox.GetTimePortionFuncs[t](this.Max),r<u){i=!0;break}return i};TimePortionBox.prototype.PreviousAboveMin=function(){for(var t=!1,n=this.Previous,i,r;n;){if(i=n.PortionValue,r=TimePortionBox.GetTimePortionFuncs[n.Portion](this.Min),i>r){t=!0;break}n=n.Previous}return t};TimePortionBox.prototype.CreateOptions=function(){var s=this.Items.length,u,t,i,r,e,o;if(u=this.Portion===0?this.Min.CreateClone():this.Time<this.Min?this.Min.CreateClone():this.Time.CreateClone(),this.Portion===2)var f=this.Previous.PortionValue,n=this.Previous.Previous.PortionValue,l=this.Max.getMonth(),h=this.Max.getFullYear(),a=this.Max.getDate(),v=this.Min.getMonth(),c=this.Min.getFullYear(),y=this.Min.getDate(),p=n>c||n==c&&f>v,w=n<h||n==h&&f<l,b=p?1:y,k=w?this.LastDayOfMonth(n,f+1):a;else var d=this.PreviousBelowMax(u),g=this.PreviousAboveMin(u),b=g?this.Items[0].Value*1:this.GetTimePortion(this.Min),k=d?this.Items[s-1].Value*1:this.GetTimePortion(this.Max);for(t=[],i=0;i<s;i++)r=this.Items[i].Value*1,r>=b&&r<=k&&(e=this.Items[i],e.Selected=this.PortionValue===r,t.push(e));return o=[],t.length==1&&(this.PortionValue=t[0].Value*1),this.CreateOptionsFromItems(o,t),o};TimePortionBox.prototype.LastDayOfMonth=function(n,t){return new Date(new Date(n,t,1)-1).getDate()};TimePortionBox.prototype.CreateOptionsFromItems=function(n,t){var r,u,i;for(t.length>1&&(i=new Option(this.DefaultValue,"",!0,!1),i.text=this.DefaultValue,i.value="",n.push(i)),r=0;r<t.length;r++)u=t[r],i=new Option(u.Title.toString(),u.Value.toString()),i.selected=u.Selected,n.push(i)};TimePortionBox.prototype.ClearOptions=function(){for(var i=this.Element.options.length,t,n=0;n<i;n++)t=this.Element.options[0],this.Element.removeChild(t)};TimePortionBox.Year=0;TimePortionBox.Month=1;TimePortionBox.Day=2;TimePortionBox.Time=3;SeatElement.InheritsFrom(ElementBase);SeatElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};SeatElement.prototype.InitializeMe=function(){var n=this.FindParentCanvas(),t=document.createElement("div");n.appendChild(t)};SeatElement.prototype.FindParentCanvas=function(){for(var t=null,n=this.Parent;n;){if(n.IsFloor){t=n.GetCanvas();break}n=n.Parent}return t};EmbeddedReportElement.InheritsFrom(ElementBase);EmbeddedReportElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);t=new ReportDeserializer(n,"./Content/",this.IsDesignMode);this.ListBuilder=new ListBuilder(t,this);i=this.IsDesignMode;this.ScrollInto=n.getAttribute("scroll_into")};EmbeddedReportElement.prototype.InitializeMe=function(){var i=document.createElement("div"),e,t,o,r,n,u,f;if(AddCssClass(i,"EmbeddedReport"),e=this.GetParentBody(),e.appendChild(i),this.Root=i,t=document.createElement("div"),i.appendChild(t),this.Body=t,t.id=this.Id,this.ListBuilder.IsEmpty||(o=this.ListBuilder.ConstructList(),t.appendChild(o)),this.ScrollInto!==null){for(r=!1,n=this;!r&&n!==null;)n=n.Parent,n!==null&&(r=n.MyClassName=="FormTemplateElement"?!0:!1);u=n!==null?n.GetDescendantByName(this.ScrollInto):null;u!==null&&(f=document.getElementById(u.Id),f!==null&&f.scrollIntoView({block:"center"}))}this.EnableInteraction()};ReportDeserializer.prototype.DeserializeRows=function(n,t){for(var i,f=n.selectNodes(t+"Rows/Row"),u=0;u<f.length;u++){var e=f[u],o=[],s=e.selectNodes("./Column");for(i=0;i<s.length;i++){var r=s[i],h=r==null||r.firstChild==null?"":r.firstChild.nodeValue,c={Value:h,Url:r.getAttribute("url")};o.push(c)}this.Rows.push({Id:e.getAttribute("id"),Columns:o})}};ReportDeserializer.prototype.DeserializeColumns=function(n,t){for(var r=n.selectNodes(t+"Columns/Column"),u,i=0;i<r.length;i++)u=GetCDataValue(r[i],"Title"),this.Columns.push({Title:u})};ListBuilder.prototype.ConstructList=function(){var t=document.createElement("div"),n;return AddCssClass(t,"TableContainer"),n=new Table,this.ConstructHeader(n),this.ConstructRows(n),t.appendChild(n.Element),t};ListBuilder.prototype.ConstructHeader=function(n){for(var r,i,u=n.AddRow(),t=0;t<this.Columns.length;t++)r=this.Columns[t],i=u.AddCell().Element,AddCssClass(i,"ColumnHead"),i.appendChild(document.createTextNode(r.Title))};ListBuilder.prototype.ConstructRows=function(n){for(var e,r,u,f,t,o,i=0;i<this.Rows.length;i++)for(e=n.AddRow(),AddCssClass(e.Element,"ListRow"),r=this.Rows[i],u=0;u<r.Columns.length;u++)f=r.Columns[u],t=e.AddCell().Element,AddCssClass(t,"ListBrowserCell"),t.EventTracker=new EventTracking(null,t),o=this.Connector,f.Url?function(n){var i=function(){window.open(n,"_blank")};t.EventTracker.AddCallbackFunction("click",i)}(f.Url):function(n){var i=function(t,i,r){o.OpenEntryMenu&&o.OpenEntryMenu(n,i,r)};t.EventTracker.AddCallbackFunction("click",i)}(r.Id),t.appendChild(document.createTextNode(f.Value))};FormConnectorElement.InheritsFrom(ElementBase);FormConnectorElement.prototype.GetXmlNodeData=function(n){var t,i,r,u;ElementBase.prototype.GetXmlNodeData.call(this,n);t=n.selectSingleNode("CreateTargetMacro");t&&(this.CreateTargetButton=new IconButtonElement(this,t.firstChild),this.CreateTargetButton.Caption=GetCDataValue(n,"CreateTargetCaption"),this.CreateTargetButton.Icon=ActiveIconArchive.Get(AddIconName),this.CreateTargetButton.IsInline=!1,this.CreateTargetButton.IsDesignMode=this.IsDesignMode);t=n.selectSingleNode("SearchTargetMacro");t&&(this.SearchTargetButton=new IconButtonElement(this,t.firstChild),this.SearchTargetButton.Caption=GetCDataValue(n,"SearchTargetCaption"),this.SearchTargetButton.Icon=ActiveIconArchive.Get(SearchIconName),this.SearchTargetButton.IsInline=!1,this.SearchTargetButton.IsDesignMode=this.IsDesignMode);t=n.selectSingleNode("ExportMacro");t&&(this.ExportButton=new IconButtonElement(this,t.firstChild),this.ExportButton.Caption=GetCDataValue(n,"ExportCaption"),this.ExportButton.Icon=ActiveIconArchive.Get(ExcelIconName),this.ExportButton.IsInline=!1,this.ExportButton.IsDesignMode=this.IsDesignMode);i=n.selectSingleNode("JunctionMenu");i&&(this.JunctionMenu=new ContextMenu(this,i.firstChild,!0),this.JunctionMenu.CreateChildNodes(i.firstChild),this.JunctionMenu.InitializeMe(),this.JunctionMenu.InitializeChildNodes());r=n.selectSingleNode("EditEntryMacro");r&&(this.EditEntryMacro=new MacroElement(this,r.firstChild));this.IsRequired=n.getAttribute("required")==="true";this.IsRequired&&(this.RequiredValidIcon=ActiveIconArchive.Get(RequiredFieldValidIconName),this.RequiredInvalidIcon=ActiveIconArchive.Get(RequiredFieldInvalidIconName));this.ScrollInto=n.getAttribute("scroll_into");u=new ReportDeserializer(n,"./Connections/");this.ConnectionsListBuilder=new ListBuilder(u,this)};FormConnectorElement.prototype.PostInitialized=function(){if(this.IsRequired){AddCssClass(this.Root,"has-feedback");var n=document.createElement("i");AddCssClass(n,"form-control-feedback icon-large Icon icon-star-6");this.RequiredIcon=n;this.ButtonBody.appendChild(n);this.UpdateRequirementIndicatorResponsive()}};FormConnectorElement.prototype.HasContent=function(){return!this.ConnectionsListBuilder.IsEmpty};FormConnectorElement.prototype.UpdateRequirementIndicatorResponsive=function(){if(this.IsRequired){RemoveCssClass(this.Root,"has-success");RemoveCssClass(this.Root,"has-warning");RemoveCssClass(this.Root,"has-error");var t=this.Container,n=this.HasContent();n?(AddCssClass(this.Root,"has-success"),AddCssClass(this.RequiredIcon,"has-success")):RemoveCssClass(this.RequiredIcon,"has-success")}};FormConnectorElement.prototype.UpdateRequirementIndicator=function(){if(this.IsRequired){if(window.BrixResponsive===!0){this.UpdateRequirementIndicatorResponsive();return}var n=this.Body,t=this.HasContent();t?(RemoveCssClass(n,"RequirementAbsent"),AddCssClass(n,"RequirementChecked"),RemoveCssClass(this.RequiredIcon,"Absent"),AddCssClass(this.RequiredIcon,"Checked")):(RemoveCssClass(n,"RequirementChecked"),AddCssClass(n,"RequirementAbsent"),RemoveCssClass(this.RequiredIcon,"Checked"),AddCssClass(this.RequiredIcon,"Absent"))}};FormConnectorElement.prototype.OpenEntryMenu=function(n,t,i){this.CurrentCoordinates=new Position2D(t,i);var r=function(t){return t.MyClassName==="MenuMacro"&&t.Macro.AddClientArgument(WorkflowValueName.ChildBlock,n),OnEachResult.Continue};return this.JunctionMenu&&(this.JunctionMenu.OnEach(r),this.JunctionMenu.CreateMenu(t,i)),this.EditEntryMacro&&(this.ContextLeft=t,this.ContextTop=i,this.EditEntryMacro.ClearClientArguments(),this.EditEntryMacro.AddClientArgument(WorkflowValueName.ChildBlock,n),this.EditEntryMacro.PerformAction()),!1};FormConnectorElement.prototype.GetContextCoordinates=function(){var n,t;return this.CurrentCoordinates?(n={},n.Left=this.CurrentCoordinates.X,n.Top=this.CurrentCoordinates.Y-10,n.Height=20,n.Width=100,n.Bottom=n.Top+n.Height,n.Right=n.Left+n.Width):(t=this.GetBodyElement(),n=new LayerCoordinates(t)),n};FormConnectorElement.prototype.InitializeMe=function(){var t=document.createElement("div"),e,i,o,r,n,u,f;if(AddCssClass(t,"FormConnector"),AddCssClass(t,"form-group"),e=this.GetParentBody(),e.appendChild(t),this.Root=t,i=document.createElement("div"),t.appendChild(i),this.Body=i,i.id=this.Id,this.ConnectionsListBuilder.IsEmpty||(o=this.ConnectionsListBuilder.ConstructList(),i.appendChild(o)),this.ButtonBody=document.createElement("div"),AddCssClass(this.ButtonBody,"ConnectorButtons"),AddCssClass(this.ButtonBody,"ControlCell"),this.IsRequired&&AddCssClass(this.ButtonBody,"ConnectorButtonsRequired"),this.Body.appendChild(this.ButtonBody),this.CreateTargetButton&&this.CreateTargetButton.InitializeMe(),this.SearchTargetButton&&this.SearchTargetButton.InitializeMe(),this.ExportButton&&this.ExportButton.InitializeMe(),this.ScrollInto!==null){for(r=!1,n=this;!r&&n!==null;)n=n.Parent,n!==null&&(r=n.MyClassName=="FormTemplateElement"?!0:!1);u=n!==null?n.GetDescendantByName(this.ScrollInto):null;u!==null&&(f=document.getElementById(u.Id),f!==null&&f.scrollIntoView({block:"center"}))}this.EnableInteraction()};FormConnectorElement.prototype.AddButton=function(n){this.ButtonBody.appendChild(n.Body)};ReservationManagerElement.InheritsFrom(ElementBase);ReservationManagerElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.Caption=GetCDataValue(n,"ManagerCaption");this.FullResourceCaption=GetCDataValue(n,"FullResourceCaption");this.HideFullResources=n.getAttribute("hideFullResources")==="true";this.IsRequired=n.getAttribute("required")==="true";this.IsRequired&&(this.RequiredValidIcon=ActiveIconArchive.Get(RequiredFieldValidIconName),this.RequiredInvalidIcon=ActiveIconArchive.Get(RequiredFieldInvalidIconName));this.FreeAmount=n.getAttribute("free_amount")==="true";this.SingleOnly=n.getAttribute("single_only")==="true";this.ShowAmount=n.getAttribute("show_amount")==="true";this.ShowAmount&&(this.RemainingCaption=GetCDataValue(n,"RemainingCaption"));t=new ResourcesDeserializer(n,this.FreeAmount);t.FullResourceCaption=this.FullResourceCaption;t.HideFullResources=this.HideFullResources;i=this;this.ResourceListBuilder=new ResourceListBuilder(t,this.FreeAmount,this.SingleOnly,i);this.ScrollInto=n.getAttribute("scroll_into")};ReservationManagerElement.prototype.InitializeMe=function(){var i=document.createElement("fieldset"),o,t,r,u,n,f,e;if(AddCssClass(i,"FormConnector"),AddCssClass(i,"form-group-reservation-manager"),o=this.GetParentBody(),o.appendChild(i),this.Root=i,t=document.createElement("div"),i.appendChild(t),this.Body=t,t.id=this.Id,this.ButtonBody=document.createElement("div"),AddCssClass(this.ButtonBody,"ConnectorButtons"),this.IsRequired&&AddCssClass(this.ButtonBody,"ConnectorButtonsRequired"),this.Body.appendChild(this.ButtonBody),this.Caption.trim()===""&&t.appendChild(document.createElement("br")),r=document.createElement("legend"),AddCssClass(r,"Topside"),t.appendChild(r),r.appendChild(document.createTextNode(this.Caption)),this.ScrollInto!==null){for(u=!1,n=this;!u&&n!==null;)n=n.Parent,n!==null&&(u=n.MyClassName=="FormTemplateElement"?!0:!1);f=n!==null?n.GetDescendantByName(this.ScrollInto):null;f!==null&&(e=document.getElementById(f.Id),e!==null&&e.scrollIntoView({block:"center"}))}this.BuildList();this.EnableInteraction()};ReservationManagerElement.prototype.PostInitialized=function(){if(this.IsRequired){AddCssClass(this.Root,"has-feedback");var n=document.createElement("i");AddCssClass(n,"form-control-feedback icon-large Icon icon-star-6");this.RequiredIcon=n;this.ButtonBody.appendChild(n);this.UpdateRequirementIndicator()}};ReservationManagerElement.prototype.UpdateRequirementIndicator=function(){var n,i,r;if(this.IsRequired){RemoveCssClass(this.Root,"has-success");RemoveCssClass(this.Root,"has-warning");RemoveCssClass(this.Root,"has-error");this.RemoveMessage();var f=this.Container,u=this.HasContent(),t=!1;if(u){for(n=0;n<this.ResourceListBuilder.Entries.length;n++)i=this.ResourceListBuilder.Entries[n].GetValue(),r=i.split(".")[1],r>0&&(t=!0);t?(AddCssClass(this.Root,"has-success"),AddCssClass(this.RequiredIcon,"has-success")):RemoveCssClass(this.RequiredIcon,"has-success")}else RemoveCssClass(this.RequiredIcon,"has-success")}};ReservationManagerElement.prototype.HasContent=function(){return this.ResourceListBuilder.Entries.length>0};ReservationManagerElement.prototype.GetValuesAsQuery=function(n){var i,t,u,r;if(this.ResourceListBuilder){for(i=[],t=0;t<this.ResourceListBuilder.Entries.length;t++)u=this.ResourceListBuilder.Entries[t],r=u.GetValue(),r&&i.push(r);n.Add(this.Name,i.join(","))}};ReservationManagerElement.prototype.BuildList=function(){if(this.ResourcesElement&&(this.ResourcesElement.parentNode.removeChild(this.ResourcesElement),this.UpdateRequirementIndicator()),this.ResourceListBuilder.IsEmpty)this.ResourcesElement=null;else{var n=this.ResourceListBuilder.ConstructList();this.Body.appendChild(n);this.ResourcesElement=n}};ReservationManagerElement.prototype.OnUpdated=function(){var n=this.GetDependencies();n.length>0&&this.Events.CallEvent("ondependencyupdate",n.join(","),name||this.Name,this.Parent.Name);this.UpdateRequirementIndicator();this.HasVisibilityDependencies&&this.Events.CallEvent("onchanged",name||this.Name,this.Parent.Name)};ReservationManagerElement.prototype.OnChange=function(){if(this.ResourcesElement&&this.ResourcesElement.parentNode.removeChild(this.ResourcesElement),this.ResourceListBuilder.IsEmpty)this.ResourcesElement=null;else{var n=this.ResourceListBuilder.ConstructList();this.Body.appendChild(n);this.ResourcesElement=n}};ReservationManagerElement.prototype.ContentReloader=function(n){var t,i;this.RemoveMessage();this.UpdateRequirementIndicator();this.FullResourceCaption=GetCDataValue(n,"FullResourceCaption");this.HideFullResources=n.getAttribute("hideFullResources")=="true";t=new ResourcesDeserializer(n);t.FullResourceCaption=this.FullResourceCaption;t.HideFullResources=this.HideFullResources;i=this;this.ResourceListBuilder=new ResourceListBuilder(t,this.FreeAmount,this.SingleOnly,i);this.BuildList()};ResourcesDeserializer.prototype.DeserializeRows=function(n){for(var i,u,s,f=n.selectNodes("./Resources/Rows/Row"),r=0;r<f.length;r++){var t=f[r],e=[],o=t.selectNodes("./Column");for(i=0;i<o.length;i++)u=o[i],s=u==null?"":u.firstChild.nodeValue,e.push({Value:s});this.Rows.push({Id:t.getAttribute("id"),Columns:e,AvailableAmount:new Number(t.getAttribute("amount")).valueOf(),CurrentAmount:new Number(t.getAttribute("my_amount")||0).valueOf(),PresetAmount:new Number(t.getAttribute("preset_amount")||0).valueOf()})}};ResourcesDeserializer.prototype.DeserializeColumns=function(n){for(var i=n.selectNodes("./Resources/Columns/Column"),r,t=0;t<i.length;t++)r=GetCDataValue(i[t],"Title"),this.Columns.push({Title:r})};ResourceListBuilder.prototype.ConstructList=function(){var t=document.createElement("div"),n;return AddCssClass(t,"TableContainer"),n=new Table,this.ConstructHeader(n),this.ConstructRows(n),t.appendChild(n.Element),t};ResourceListBuilder.prototype.ConstructHeader=function(n){for(var u,i=n.AddRow(),t,r=0;r<this.Columns.length;r++)u=this.Columns[r],t=i.AddCell().Element,AddCssClass(t,"ColumnHead"),t.appendChild(document.createTextNode(u.Title));this.ReservationManager.ShowAmount&&(t=i.AddCell().Element,AddCssClass(t,"ColumnHead"),t.appendChild(document.createTextNode(this.ReservationManager.RemainingCaption)));t=i.AddCell().Element;AddCssClass(t,"ColumnHead");t.appendChild(document.createTextNode(" "))};ResourceListBuilder.prototype.ConstructRows=function(n){var u,i,r,t,f,e;for(this.FreeRadio=[],u=0;u<this.Rows.length;u++)if(i=this.Rows[u],i.AvailableAmount>0||!this.HideFullResources){for(r=n.AddRow(),AddCssClass(r.Element,"ListRow"),f=0;f<i.Columns.length;f++)e=i.Columns[f],t=r.AddCell().Element,AddCssClass(t,"ListBrowserCell"),t.appendChild(document.createTextNode(e.Value));this.ReservationManager.ShowAmount&&(t=r.AddCell().Element,t.appendChild(document.createTextNode(i.AvailableAmount)));t=r.AddCell().Element;this.BuildAmount(t,i)}};ResourceListBuilder.prototype.BuildAmount=function(n,t){var i,r;t.AvailableAmount>0&&t.AvailableAmount>=t.PresetAmount?(i=this.BuildAmountPicker(t),r=function(){return t.Id+"."+i.GetValue()},this.Entries.push({GetValue:r})):i=document.createTextNode(this.FullResourceCaption);n.appendChild(i)};ResourceListBuilder.prototype.BuildAmountPicker=function(n){return this.FreeAmount?this.BuildTextbox(n):this.BuildCheckbox(n)};ResourceListBuilder.prototype.BuildTextbox=function(n){var r=this,i,t=CreateInput("");return t.IsVisible=!0,i=this.SingleOnly?this.SingleChoiceWrapper(n,t):t,SetupNumericInput(t,0,n.AvailableAmount,1,null,function(){r.ReservationManager.OnUpdated()}),t.value=n.CurrentAmount,t.GetValue=function(){return this.IsVisible?this.GetValidNumericValue():0},i};ResourceListBuilder.prototype.SingleChoiceWrapper=function(n,t){var f="rm"+this.UniqueId,i=CreateInput(f,n.CurrentAmount>0),u,r;return i.type="radio",i.PartnerInput=t,i.checked||(t.IsVisible=!1,t.style.display="none"),u=this,i.onclick=function(){var t,n;for(u.ReservationManager.RemoveMessage(),t=0;t<u.FreeRadio.length;t++)n=u.FreeRadio[t],n==this?(n.PartnerInput.IsVisible=!0,n.PartnerInput.style.display=""):(n.PartnerInput.IsVisible=!1,n.PartnerInput.style.display="none");u.ReservationManager.OnUpdated()},this.FreeRadio.push(i),r=document.createElement("div"),r.appendChild(i),r.appendChild(t),r.Input=t,r.GetValue=function(){return this.Input.GetValue()},r};ResourceListBuilder.prototype.BuildCheckbox=function(n){var t=CreateInput("rm"+this.UniqueId,n.CurrentAmount>0),i;return t.type=this.SingleOnly?"radio":"checkbox",t.value=n.CurrentAmount,t.PresetAmount=n.PresetAmount,t.GetValue=function(){return this.checked?this.PresetAmount:0},i=this,t.onclick=function(){i.ReservationManager.RemoveMessage();i.ReservationManager.OnUpdated()},t};ResourceListBuilder.prototype.BuildListbox=function(n){var t=document.createElement("select");AddCssClass(t,"Listbox");AddCssClass(t,"Amount");for(var i=-1,u=0,f=!1,e=function(n,i){var r=document.createElement("option");r.value=n;r.text=i||n;try{t.add(r,t.options[null])}catch(u){t.add(r,null)}return r},r=0;i<n.AvailableAmount;)if(i=GetNextAmountValue(i,n.AvailableAmount),!f&&i>n.CurrentAmount&&(e(n.CurrentAmount),u=r,f=!0),i==n.CurrentAmount&&(u=r,f=!0),e(i),r++,r>100)break;return t.selectedIndex=u,n.PickerElement=t,t.GetValue=function(){return this.options[this.selectedIndex].value},t};PopOverElement.InheritsFrom(ElementBase);PopOverElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};PopOverElement.prototype.InitializeMe=function(){this.Parent.PopOverContainer||ThrowException('The parent element "'+this.Parent.MyClassName+'" has not defined a PopOverContainer');this.Box=this.CreateBox();this.Parent.PopOverContainer.SetPopOverElement(this,this.Box)};PopOverElement.prototype.GetContextCoordinates=function(){var n=null,t;return this.Parent&&this.Parent.GetContextCoordinates?n=this.Parent.GetContextCoordinates():(t=this.GetBodyElement(),n=new LayerCoordinates(t)),n};PopOverElement.prototype.Show=function(n){n.appendChild(this.Box)};PopOverElement.prototype.CreateBox=function(){var n=document.createElement("ul");return AddCssClass(n,"dropdown-menu animated fadeIn"),n.id=this.Id,n};PopOverElement.prototype.Hide=function(){this.Box.parentNode.removeChild(this.Box);this.Box=null};PopOverItemElement.InheritsFrom(ElementBase);PopOverItemElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.IsSeparator=n.getAttribute("separator")=="true";this.IsSelected=n.getAttribute("selected")=="true";this.Url=n.getAttribute("url");this.IsSeparator||(this.Title=GetCDataValue(n,"Title"));this.Icon=ActiveIconArchive.GetFromNode(n);this.Count=n.getAttribute("count");this.Color=n.getAttribute("icon_color")};PopOverItemElement.prototype.GetContextCoordinates=function(){var n=null,t;return this.Parent&&this.Parent.GetContextCoordinates?n=this.Parent.GetContextCoordinates():(t=this.GetBodyElement(),n=new LayerCoordinates(t)),n};PopOverItemElement.prototype.SetCounter=function(n){typeof n!="undefined"&&(this.Count=n);for(var t=this.CounterBody;t.firstChild;)t.removeChild(t.firstChild);n?(t.appendChild(document.createTextNode(n)),t.style.display=""):t.style.display="none"};PopOverItemElement.prototype.InitializeMe=function(){var e=this,n=document.createElement("li"),r,t,i,f;if(n.setAttribute("role","presentation"),n.id=this.Id,this.IsSelected&&AddCssClass(n,"Selected"),this.Body=n,r=this.GetParentBody(),r.appendChild(n),this.IsSeparator)n.setAttribute("role","separator"),AddCssClass(n,"divider");else{if(t=document.createElement("a"),t.setAttribute("role","menuitem"),n.appendChild(t),this.PopOverContainer=new PopOverItemElement.PopoverContainer(n,t),this.Icon&&(i=this.Icon.Create(),this.Color&&(i.style.color=this.Color),t.appendChild(i),t.appendChild(document.createTextNode(" "))),t.appendChild(document.createTextNode(this.Title)),this.EventTracker=new EventTracking(null,n),this.IsDragable){AddCssClass(n,"Dragable");var u=function(n){for(var t=e.Parent;t;)t.PopOverContainer&&n(t.PopOverContainer.ContainerBody),t=t.Parent},o=function(){u(function(n){AddCssClass(n,"PopupMenuDragging")})},s=function(){u(function(n){RemoveCssClass(n,"PopupMenuDragging")})};DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription,o,s)}this.Url?(f=this,t.onclick=function(){window.open(f.Url,"_blank")}):this.EventTracker.AddCallback("click",this,"OnClick")}};PopOverItemElement.PopoverContainer=function(n,t){this.ContainerBody=n;this.TwistBody=t;this.SetPopOverElement=function(n,i){var r=this.ContainerBody,u=document.createElement("span");AddCssClass(u,"caret-right");t.appendChild(document.createTextNode(" "));t.appendChild(u);AddCssClass(r,"dropdown-submenu");i.setAttribute("role","menu");r.appendChild(i);$(r).ready(function(){$(r).dropdown()})}};PopOverItemElement.prototype.OnClick=function(n,t,i){this.Events.CallEvent("onclick",t,i)};PopOverContainer.prototype.SetPopOverElement=function(n,t){AddCssClass(this.ContainerBody,"PopupMenu");AddCssClass(t,"FloatingBox");n.Parent.MyClassName=="PopOverItemElement"?(AddCssClass(t,"SubMenu"),this.TwistBody&&AddCssClass(this.TwistBody,"TwistRightInside")):(AddCssClass(t,"Down"),this.TwistBody&&AddCssClass(this.TwistBody,"TwistDownInside"));this.ContainerBody.appendChild(t)};PopOverContainer.prototype.OnOver=function(){this.PopOverElement.Show(this.ContainerBody)};PopOverContainer.prototype.OnOut=function(){this.PopOverElement.Hide()};WorkspaceWindowElement.InheritsFrom(ElementBase);WorkspaceWindowElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Buttons=[];this.ColorScheme=new ColorScheme(n.selectSingleNode("ColorScheme"));this.MinimumWidth=new Number(n.getAttribute("min_width")||"0");this.MinimumHeight=new Number(n.getAttribute("min_height")||"0");this.Moveable=!1;this.Closeable=!1;this.ActionCallbackKey=n.getAttribute("action_callback")};WorkspaceWindowElement.prototype.IsDialog=function(){return!1};WorkspaceWindowElement.prototype.SetBodyTransparency=function(n){var t=this.ColorScheme.Background,i=100-n,r=t.CreateCodeWithAlphaChannel(i/100);this.Root.style.backgroundColor=r};WorkspaceWindowElement.prototype.AdjustSize=function(n){this.MinimumHeight=n.Height;this.OnResize()};WorkspaceWindowElement.prototype.GetBodyTopOffset=function(){return 40};WorkspaceWindowElement.prototype.GetBodyBottomOffset=function(){return 50};WorkspaceWindowElement.prototype.OnResize=function(){if(!window.BrixResponsive&&this.Root!=null){this.Body.style.minWidth=this.MinimumWidth+"px";this.Body.style.minHeight=this.MinimumHeight+"px";var n=new LayerSize(this.Root);this.Height=n.Height;this.Width=n.Width;ElementBase.prototype.OnResize.call(this)}};WorkspaceWindowElement.prototype.GetOuterSize=function(){var n=new LayerSize(this.Root);return new Size(n.Width,n.Height)};WorkspaceWindowElement.prototype.GetInnerSize=function(){var n=new LayerSize(this.Body);return new Size(n.Width,n.Height)};WorkspaceWindowElement.prototype.RegisterAsCurrent=function(){BRIX.WindowStack.push(this);window.CurrentWindow=this};WorkspaceWindowElement.prototype.UnRegisterAsCurrent=function(){BRIX.WindowStack.pop();window.CurrentWindow===this&&(window.CurrentWindow=null)};WorkspaceWindowElement.prototype.InitializeMe=function(){var n,i,t;this.RegisterAsCurrent();n=document.createElement("div");AddCssClass(n,"Window");AddCssClass(n,"WindowBase");AddCssClass(n,"EmbeddedWindow");AddCssClass(n,"WindowNormal");this.Root=n;this.BodyColorNode=this.Root;n.id=this.Id+"_root";i=this.GetParentBody();i.appendChild(n);this.AddBodyColor(this.Root);t=document.createElement("div");AddCssClass(t,"BreadcrumbsContainer");this.HeaderBody=t;this.Root.appendChild(t);this.SetupContentAreas();window.scrollTo&&window.scrollTo(0,0)};WorkspaceWindowElement.prototype.SetupContentAreas=function(){var t=document.createElement("div"),n;AddCssClass(t,"Body");this.Body=t;this.Root.appendChild(t);n=document.createElement("div");AddCssClass(n,"Footer");this.Footer=n;this.Root.appendChild(n)};WorkspaceWindowElement.prototype.AddBodyColor=function(){var n=this.ColorScheme.Background,t=IsDefined(this.Opacity)?n.CreateCodeWithAlphaChannel(this.Opacity/10):n.Code();this.BodyColorNode.style.backgroundColor=t};WorkspaceWindowElement.prototype.BeforeDestroyed=function(){this.UnRegisterAsCurrent()};WorkspaceWindowElement.prototype.AddButton=function(n){n.IsImportant&&this.Footer.firstChild?this.Footer.insertBefore(n.Body,this.Footer.firstChild):this.Footer.appendChild(n.Body);this.Buttons.push(n)};WorkspaceWindowElement.prototype.DnDHoverReactionOn=function(){var n=this.GetBodyElement();AddCssClass(n,"WindowDndHoverReaction")};WorkspaceWindowElement.prototype.DnDHoverReactionOff=function(){var n=this.GetBodyElement();RemoveCssClass(n,"WindowDndHoverReaction")};WorkspaceWindowElement.prototype.ShowLoadingInProgress=function(){};WorkspaceWindowElement.prototype.HideLoadingInProgress=function(){};WindowElement.InheritsFrom(ElementBase);WindowElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Buttons=[];this.UseInnerBorders=!1;this.ColorScheme=new ColorScheme(n.selectSingleNode("ColorScheme"));this.MinimumWidth=new Number(n.getAttribute("min_width")||"0");this.MinimumHeight=new Number(n.getAttribute("min_height")||"0");this.Preserve.IsDialog=!0;this.Moveable=!1;var t=n.selectSingleNode("OnCloseMacro");t?(this.OnCloseMacro=new MacroElement(this,t.firstChild),this.Closeable=!0,this.CloseIcon=ActiveIconArchive.GetFromNode(n)):this.Closeable=!1;this.ActionCallbackKey=n.getAttribute("action_callback")};WindowElement.prototype.IsDialog=function(){return this.Preserve.IsDialog};WindowElement.prototype.SetBodyTransparency=function(n){SetTransparency(this.BodyColorNode,n)};WindowElement.prototype.AdjustSize=function(n){this.MinimumHeight=n.Height;this.OnResize()};WindowElement.prototype.GetBodyTopOffset=function(){return 40};WindowElement.prototype.GetBodyBottomOffset=function(){return 50};WindowElement.prototype.OnResize=function(){var n,t,i,r;window.BrixResponsive||this.Root!=null&&(this.Body.style.minWidth=this.MinimumWidth+"px",this.Body.style.minHeight=this.MinimumHeight+"px",n=new LayerSize(this.Root),t=new LayerSize(document.body),this.Body.style.maxHeight=t.Height-200+"px",i=Math.round(t.Height/2-n.Height/2),i<0&&(i=0),r=Math.round(t.Width/2-n.Width/2),r<0&&(r=0),this.Root.style.top=i+"px",this.Root.style.left=r+"px",this.Height=n.Height,this.Width=n.Width,ElementBase.prototype.OnResize.call(this))};WindowElement.prototype.GetOuterSize=function(){var n=new LayerSize(this.Root);return new Size(n.Width,n.Height)};WindowElement.prototype.GetInnerSize=function(){var n=new LayerSize(this.Body);return new Size(n.Width,n.Height)};WindowElement.prototype.RegisterAsCurrent=function(){BRIX.WindowStack.push(this);window.CurrentWindow=this};WindowElement.prototype.UnRegisterAsCurrent=function(){BRIX.WindowStack.pop();window.CurrentWindow===this&&(window.CurrentWindow=null)};WindowElement.prototype.InitializeMe=function(){var n,i,t;this.RegisterAsCurrent();n=document.createElement("div");AddCssClass(n,"Window animated fadeIn");AddCssClass(n,"WindowBase");AddCssClass(n,"DialogWindow");AddCssClass(n,"WindowNormal");this.Root=n;n.id=this.Id+"_root";i=this.GetParentBody();i.appendChild(n);this.AddBodyColor(this.Root);t=document.createElement("div");AddCssClass(t,"BreadcrumbsContainer");this.HeaderBody=t;this.Root.appendChild(t);this.SetupContentAreas();this.Closeable&&this.BuildCloseButton()};WindowElement.prototype.BuildCloseButton=function(){var n=document.createElement("div");this.EventTracker=new EventTracking(null,n);this.EventTracker.AddCallback("click",this,"OnClose",!1);AddCssClass(n,"Close");n.appendChild(this.CloseIcon.Create());this.Root.appendChild(n)};WindowElement.prototype.OnClose=function(){this.OnCloseMacro&&this.OnCloseMacro.PerformAction()};WindowElement.prototype.SetupContentAreas=function(){var t=document.createElement("div"),n;AddCssClass(t,"Body");this.Body=t;this.Root.appendChild(t);n=document.createElement("div");AddCssClass(n,"Footer");this.Footer=n;this.Root.appendChild(n)};WindowElement.prototype.AddBodyColor=function(n){var t=new Color(this.ColorScheme.Background.Code()),i=IsDefined(this.Opacity)?this.Opacity/10:1;this.ColorScheme.Background.IsTransparent||(n.style.backgroundColor="rgba("+t.Red+", "+t.Green+", "+t.Blue+", "+i+")");return};WindowElement.prototype.BeforeDestroyed=function(){this.UnRegisterAsCurrent()};WindowElement.prototype.Close=function(){var n=FindPageOfDomElement(this.Root);n?n.Close():this.Parent.RemoveChild(this)};WindowElement.prototype.AddButton=function(n){n.IsImportant&&this.Footer.firstChild?this.Footer.insertBefore(n.Body,this.Footer.firstChild):this.Footer.appendChild(n.Body);this.Buttons.push(n)};WindowElement.prototype.DnDHoverReactionOn=function(){var n=this.GetBodyElement();AddCssClass(n,"WindowDndHoverReaction")};WindowElement.prototype.DnDHoverReactionOff=function(){var n=this.GetBodyElement();RemoveCssClass(n,"WindowDndHoverReaction")};WindowElement.prototype.UrlFailed=function(){throw new Error("Window failed to load url");};WindowElement.prototype.LoadUrl=function(n){var t=null,i;return n&&(this.AjaxUrl=n),this.AjaxUrl&&(i=this.AjaxUrl,i+=i.indexOf("?")==-1?"?":"",t=requestIndex.GetRequest(MakeHttpRequest(i+"&"+WorkflowValueName.ElementId+"="+this.Id+"&"+WorkflowValueName.CreatedElement+"="+this.Id,ElementNodeXmlFailedToLoad,!0,"GET",ElementNodeXmlFailedToLoad)),t.SetReturnMethod(this,"ReloadElementFromNode"),t.SetFailureMethod(this,"UrlFailed")),this.LastRequest=t,t};WindowElement.prototype.ShowLoadingInProgress=function(){var t,n;this.Body&&!this.LoadingAnimation&&(t=new LayerSize(this.Body),this.LoadingDimmer=document.createElement("div"),this.LoadingDimmer.style.position="absolute",this.LoadingDimmer.style.top="0px",this.LoadingDimmer.style.left="0px",this.LoadingDimmer.style.width="100%",this.LoadingDimmer.style.height="100%",this.LoadingDimmer.style.background="transparent url("+GraphicsBasePath+"transparent.png)",this.Body.appendChild(this.LoadingDimmer),n=document.createElement("div"),n=document.createElement("div"),n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="100%",n.style.height="100%",n.style.background="transparent url("+GraphicsBasePath+"loading2.gif) no-repeat center center",this.Body.appendChild(n),this.LoadingAnimation=n)};WindowElement.prototype.HideLoadingInProgress=function(){this.LoadingDimmer&&(this.LoadingDimmer.parentNode.removeChild(this.LoadingDimmer),this.LoadingDimmer=null,delete this.LoadingDimmer,this.LoadingAnimation.parentNode.removeChild(this.LoadingAnimation),this.LoadingAnimation=null,delete this.LoadingAnimation)};ContextWindowElement.InheritsFrom(WindowElement);ContextWindowElement.prototype.GetXmlNodeData=function(n){var t,i,r;WindowElement.prototype.GetXmlNodeData.call(this,n);this.IsCssDivider=!0;t=n.selectSingleNode("ConfirmMacro");t&&(this.ConfirmMacro=new MacroElement(this,t.firstChild));t=n.selectSingleNode("CancelMacro");t&&(this.CancelMacro=new MacroElement(this,t.firstChild));this.Preserve.ContextElementId=n.getAttribute(WorkflowValueName.ContextElementId);this.Preserve.ContextElementId||(i=n.getAttribute(WorkflowValueName.ContextElementName),i&&(r=ElementIndex.GetLastByName(i),r&&(this.Preserve.ContextElementId=r.Id)));this.Preserve.HasContextElement=this.Preserve.ContextElementId!=null;this.Preserve.IsDialog=!0};ContextWindowElement.prototype.Floor=null;ContextWindowElement.prototype.Box=null;ContextWindowElement.prototype.BoxSide="";ContextWindowElement.prototype.LastBoxSide="";ContextWindowElement.prototype.Close=function(){this.Parent.Remove()};ContextWindowElement.prototype.OnResize=function(){this.Preserve.HasContextElement?this.PositionBySubject():this.PositionCenter();ElementBase.prototype.OnResize.call(this)};ContextWindowElement.prototype.PositionCenter=function(){var i=new LayerSize(this.Box),n=new LayerCoordinates(document.body),r=(n.Right-n.Left)/2+n.Left,u=(n.Bottom-n.Top)/2+n.Top,f=Math.round(r-i.Width/2),t=Math.round(u-i.Height/2),e;t<0&&(t=0);e=0;this.Box.style.top=t+"px";this.Box.style.left=f+"px"};ContextWindowElement.prototype.PositionBySubject=function(){var n=this.GetSubjectDimensions(),e={Height:$(window).height(),Width:$(window).width()},h=new LayerSize(this.Box),o=this.GetSuitableHorizontalPlacement(n,e,h),s=this.GetSuitableVerticalPlacement(n,e,h),c=Math.round(n.Top+Math.round(n.Height/2)),l=-20,t=this.CurrentArrowClass,a,v,y;t&&RemoveCssClass(this.Box,t);var r=c+l,i=e.Height-(c-l),u=n.Right,f=e.Width-n.Left;f<0&&(f=0);o=="middle"&&(n.Left+h.Width>e.Width?(u=null,f=0):(u=n.Left,f=null));o=="right"&&s=="bottom"?(t="OnRightBottom",i=null,f=null):o=="left"&&s=="bottom"?(t="OnLeftBottom",i=null,u=null):o=="right"&&s=="top"?(t="OnRightTop",f=null,r=null):o=="left"&&s=="top"?(t="OnLeftTop",r=null,u=null):o=="middle"&&s=="top"?(t="OnMiddleTop",r=null,i=e.Height-n.Top):o=="middle"&&s=="bottom"?(t="OnMiddleBottom",r=n.Top+n.Height,i=null):(a=e.Width/2,v=e.Height/2,u=Math.round(a-h.Width/2),r=Math.round(v-h.Height/2),u<0&&(u=0),r<0&&(r=0),i=null,f=null);AddCssClass(this.Box,t);this.CurrentArrowClass=t;i!=null&&i<0&&(y=0,i=0);this.Box.style.top=r!=null?r+"px":"";this.Box.style.left=u!=null?u+"px":"";this.Box.style.bottom=i!=null?i+"px":"";this.Box.style.right=f!=null?f+"px":""};ContextWindowElement.prototype.GetSuitableHorizontalPlacement=function(n,t,i){return n.Right+i.Width<t.Width?"right":n.Left-i.Width>0?"left":"middle"};ContextWindowElement.prototype.GetSuitableVerticalPlacement=function(n,t,i){return n.Bottom+i.Height<t.Height?"bottom":n.Top-i.Height>0?"top":"middle"};ContextWindowElement.prototype.GetBodyElement=function(){return this.Body};ContextWindowElement.prototype.GetRootElement=function(){return this.Box};ContextWindowElement.prototype.OnKeyPress=function(n){n==27&&this.OnClose()};ContextWindowElement.prototype.InitializeMe=function(){if(this.RegisterAsCurrent(),this.CreateBox(),this.CreateBody(),this.CreateFooter(),this.Closeable){var n='<div class="btn btn-default type="button" onclick="ElementIndex.Get(&quot;'+this.Id+'&quot;).OnClose();"><i class="icon-close icon-large Icon" style="margin-right: 5px;"><\/i><\/button>';$(this.Footer).append(n)}};ContextWindowElement.prototype.OnConfirm=function(){this.ConfirmMacro&&this.ConfirmMacro.PerformAction()};ContextWindowElement.prototype.GetSubjectDimensions=function(){var n=ElementIndex.Get(this.Preserve.ContextElementId),t,i;return n.GetContextCoordinates?t=n.GetContextCoordinates():(i=n.GetBodyElement(),t=new LayerCoordinates(i)),t};ContextWindowElement.prototype.CreateBox=function(){var n=document.createElement("div"),t;AddCssClass(n,"ContextWindowBox");this.Box=n;this.Root=this.Box;t=this.Parent.GetBodyElement();t.appendChild(n)};ContextWindowElement.prototype.CreateBody=function(){var n=document.createElement("div");AddCssClass(n,"ContextWindowBody animated fadeIn");AddCssClass(n,"WindowBase");n.style.minWidth=this.MinimumWidth+"px";n.style.minHeight=this.MinimumHeight+"px";n.id=this.Id;this.Body=n;this.HeaderBody=n;this.Root.appendChild(n)};ContextWindowElement.prototype.CreateFooter=function(){var n=document.createElement("div");AddCssClass(n,"Footer");this.Footer=n;this.Box.appendChild(n)};ContextWindowElement.prototype.CreateFloor=function(){var n=document.createElement("div");AddCssClass(n,"ContextWindowFloor");this.Floor=n;document.body.appendChild(n)};ContextWindowElement.prototype.Destroy=function(){this.Floor&&this.Floor.parentNode.removeChild(this.Floor);ElementBase.prototype.Destroy.call(this)};ContextWindowElement.prototype.AddButton=function(n){this.Footer.style.display="block";this.Footer.appendChild(n.Body);this.Buttons.push(n)};MacroCallbackIndex.prototype.UpdateActivityIndicator=function(){for(var f=!1,e=this.Index.values(),u=0;u<e.length;u++)if(e[u].MacroElement.FocusWithServer){f=!0;break}var i=document.getElementById("indicator"),n=document.getElementById("loading_indicator"),t=document.getElementById("ready_indicator"),r=0;f&&!this.ErrorState==!0?(n||(window.clearTimeout(r),n=document.createElement("meta"),n.id="loading_indicator",n.name="loading_indicator",document.head.insertBefore(n,document.head.firstChild),i=document.createElement("div"),i.className="LoadingIndicatorBackdrop Loading",i.id="indicator",document.body.appendChild(i),r=window.setTimeout(function(){AddCssClass(i,"FadeIn")},500)),t&&t.parentNode.removeChild(t)):(n&&(n.parentNode.removeChild(n),r&&(window.clearTimeout(r),r=0),i.parentNode.removeChild(i)),t||(t=document.createElement("meta"),t.id="ready_indicator",t.name="ready_indicator",document.head.insertBefore(t,document.head.firstChild)))};MacroCallbackIndex.prototype.MacroResponse=function(n,t){var i=this.Index.get(n),r,e,o,f,u,s;if(!i)throw new Error("The macro keyed '"+n+"' is no longer running on this client");if(r=GetXmlRootNode(t),i.InstanceKey=i.InstanceKey||r.getAttribute(WorkflowValueName.MacroInstance),i.MacroElement.FocusWithServer=!1,i.MacroElement.Relation&&(i.MacroElement.Relation.FocusWithServer=!1),e=r.getAttribute(BRIX.MacroStorageParameter),BRIX.MacroStorage[i.InstanceKey]=e,o=r.getAttribute("unauthenticated")=="true",o){window.location.reload();return}f=r.getAttribute("pausesequence")=="true";i.IsPaused=f;i.MacroElement.PerformClientAction(r,i);i.MacroElement.GetArgumentsNodeData(r,i.MacroElement);u=i.MacroElement.TriggerMacro;u&&u.OnResponse&&u.OnResponse();s=r.getAttribute("continued")!="true";s?(i.MacroElement.Callback&&i.MacroElement.Callback(r,i),u&&u.HideLoadingInProgress(),i.MacroElement.ClearClientArguments(),this.RemoveMacro(n,t),i.MacroElement.CallbackMacro&&i.MacroElement.CallbackMacro.PerformAction()):(i.InstanceKey=r.getAttribute(WorkflowValueName.MacroInstance),f?(i.MacroElement.Feedback&&i.MacroElement.Feedback(r,i),i.MacroElement.OnPause&&i.MacroElement.OnPause(r,null,i.MacroElement),u&&u.HideLoadingInProgress(),i.DelayedTrigggerAction&&(i.DelayedTrigggerAction(),i.DelayedTrigggerAction=null)):(i.MacroElement.Feedback&&i.MacroElement.Feedback(r,i),i.MacroElement.PerformAction()));this.UpdateActivityIndicator()};MacroCallbackIndex.prototype.CancelMacroByInstance=function(n){var t=this.GetMacroByInstanceKey(n);t&&this.CancelMacro(t.Key)};MacroCallbackIndex.prototype.CancelMacro=function(n){var i=this.GetActiveMacro(n),t,r;i!=null&&(t=new QueryParameters,t.Add(WorkflowValueName.MacroInstance,i.InstanceKey),t.Add(WorkflowValueName.CancelMacro,"true"),r=i.MacroElement.GetMacroUrl(),r+=t.GetQuery(),MakeHttpRequest(r),this.RemoveMacro(n))};MacroCallbackIndex.prototype.GetActiveMacro=function(n){return this.Index.get(n)};MacroCallbackIndex.prototype.GetMacroByInstanceKey=function(n){for(var i,r=null,u=this.Index.values(),t=0;t<u.length;t++)if(i=u[t],i.InstanceKey==n){r=i;break}return r};MacroCallbackIndex.prototype.GetRootMacroByRelation=function(n){for(var r,t=null,u=this.Index.values(),i=0;i<u.length;i++)if(r=u[i],r.InstanceKey==n.RootInstanceKey){t=r;break}return t==null?this.Index.get(n.RunningMacroKey):t};MacroCallbackIndex.prototype.GetActiveMacro=function(n){return this.Index.get("_i"+n.Id)};MacroCallbackIndex.prototype.IsMacroActive=function(n){return this.Index.containsKey("_i"+n.Id)};MacroCallbackIndex.prototype.RemoveMacro=function(n){this.Index.remove(n);this.UpdateActivityIndicator()};MacroCallbackIndex.prototype.AddMacro=function(n){var t=new MacroCallbackEntry(n);return this.Index.put(t.Key,t),this.UpdateActivityIndicator(),t};window.CurrentMacroCallbackIndex||(window.CurrentMacroCallbackIndex=new MacroCallbackIndex);ClientResponseParameterName="_client_response_param";ClientOperations.prototype.InvalidReport=function(n){for(var i=n.selectNodes("./Element"),t=0;t<i.length;t++){var r=i[t],f=r.getAttribute("name"),e=GetCDataValue(r,"Message"),u=ElementIndex.GetFirstByName(f);u&&u.MarkAsInvalid(e)}};ClientOperations.ExecuteCallback=function(n,t){for(var u,i=window,f=n.split("."),r=0;r<f.length;r++){if(u=i[f[r]],!IsDefined(u))return!1;i=u}return typeof i!="function"?!1:(i(t),!0)};ClientOperations.SetCallback=function(n,t){for(var r=window,i=n.split("."),u=0;u<i.length-1;u++){if(!IsDefined(r[i[u]]))return!1;r=r[i[u]]}return r[i[i.length-1]]=t,!0};ClientOperations.prototype.PerformOperations=function(n){for(var t,o,d,g,c,nt,v,y,tt,it,p,w,b,k,h,e,l,i,s,r,f,u,ct=this,a=0;a<this.Operations.length;a++){t=this.Operations[a];o=t.GetContentNode();f=o?o.firstChild:null;switch(t.Type){case"UIAction":d=JSON.parse(GetCDataValue(o,"json"));BRIX.UIAction.Run(d);break;case"SetHash":g=t.GetAttribute("hash");BRIX.Utilities.Location.SetHash(g);break;case"ClientCall":var rt=t.GetAttribute(ClientResponseParameterName),ut=t.GetAttribute(WorkflowValueName.Content),ft=BRIX.Crypt.Base64.Decode(ut);ClientOperations.ExecuteCallback(rt,ft);break;case"SignOut":BRIX.SignOut();break;case"ForceLanguage":window.ForcedLanguage=o.getAttribute(WorkflowValueName.Language);break;case"Login":PromptLogin(f,o.getAttribute("failed")==="true");break;case"InvalidReport":this.InvalidReport(f);break;case"UpdateVisibility":c=new VisibilityUpdater(f);c.ApplyChanges();break;case"UpdateButtons":c=new ButtonsUpdater(f);c.ApplyChanges();break;case"RelayToElement":if(l=t.GetAttribute(WorkflowValueName.RelayElementId),l)i=ElementIndex.Get(l);else if(h=t.GetAttribute(WorkflowValueName.RelayElementName),h)if(r=ElementIndex.GetByName(h),r.length===1)i=r[0];else if(r.length===0)i=null;else throw new Error("Unexpected number of possible elements");else if(nt=t.GetAttribute(WorkflowValueName.ElementClass),r=ElementIndex.GetByClassName(nt),r.length===1)i=r[0];else if(r.length===0)i=null;else throw new Error("Unexpected number of possible elements");if(!i)try{i=this.GetRequestedElement(t,n)}catch(lt){i=null}i&&i.RelayedResponse(f);break;case"RunMacro":window.Page.RunAdHocMacro(f);break;case"GetSelectionOnElementType":for(r=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass)),v=t.GetAttribute(ClientResponseParameterName),n.MacroElement.AddClientArgument(v,""),y=new QueryParameters,e=0;e<r.length;e++)r[e].GetSelectionAsQuery(y,v);y.Parameters.each(function(t,i){n.MacroElement.AddClientArgument(t,i)});break;case"UpdateElementContext":for(tt=t.GetAttribute(WorkflowValueName.Block),r=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass)),e=0;e<r.length;e++)r[e].UpdateContext(tt);break;case"OpenNavigatorTab":it=ElementIndex.Get(t.GetAttribute(WorkflowValueName.ElementId)||n[WorkflowValueName.CallingElement]);it.OpenTab(f);break;case"OpenUrl":var et=t.GetAttribute(WorkflowValueName.Url),ot=t.GetAttribute("method"),st=t.GetAttribute("parameters"),ht=t.GetAttribute("target");OpenUrlOperation(et,ot,st,ht);break;case"UnfoldWorkspace":i=GetDashboard();i.ShowWorkspaceFold(!1);break;case"ClearWorkspace":i=GetDashboard();i.ClearWorkspace();break;case"NewElement":u=null;switch(t.PreferedOpenTarget){case"Replace":u=this.GetRequestedElement(t,n);u.ReloadElementFromNode(f);break;case"WorkspaceFold":i=GetDashboard();i.ReplaceWorkspaceFold(o);break;case"DashboardWorkspace":i=GetDashboard();u=i.ReplaceWorkspace(f);n[WorkflowValueName.CreatedElement]=u.Id;break;case"DashboardToolbar":i=GetDashboard();i.ShowWorkspaceFold(!1);u=i.ReplaceToolbar(f);n[WorkflowValueName.CreatedElement]=u.Id;break;case"DashboardNavigator":case"DashboardContextBoard":u=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass))[0];u.ReloadElementFromNode(f);n[WorkflowValueName.CreatedElement]=u.Id;break;case"Dashboard":i=this.GetRequestedElement(t,n);i.ReloadElementFromNode(f);u=i.FirstChild;n[WorkflowValueName.CreatedElement]=u.Id;break;case"Dialog":u=window.Page.OpenDialogFromXml(f);n[WorkflowValueName.CreatedElement]=u.Id;n.Feedback(o.getAttribute("element_feedback"),u.Id);break;case"Workspace":u=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass))[0];u.ReloadElementFromNode(f);n[WorkflowValueName.CreatedElement]=u.Id}u&&(p=t.OperationNode.getAttribute("_associated_macro_instance"),p&&(u.AssociatedMacroKey=p));break;case"CloseWindow":w=this.GetRequestedElement(t,n);w&&w.Close();break;case"UpdateByElementId":s=ElementIndex.Get(t.GetAttribute(WorkflowValueName.ElementId)||n[WorkflowValueName.CallingElement]);s&&(s.ReloadElementFromNode(f),n.AddLoadedElementId(s.Id),window.Page.OnResize());break;case"UpdateElementContentById":s=ElementIndex.Get(t.GetAttribute(WorkflowValueName.ElementId)||n[WorkflowValueName.CallingElement]);s&&(s.UpdateContent(f),window.Page.OnResize());break;case"UpdateByElementName":h=t.GetAttribute(WorkflowValueName.ElementName);r=ElementIndex.GetByName(h);this.ReloadElementsFromNode(f,r);break;case"UpdateByElementType":r=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass));this.ReloadElementsFromNode(f,r);break;case"OpenSelectedContext":r=ElementIndex.GetByClassName(t.GetAttribute(WorkflowValueName.ElementClass));r[0].OpenSelectedItem();break;case"ScrollInto":r=ElementIndex.GetByName(t.GetAttribute(WorkflowValueName.ScrollInto));b=r[0];b!=null&&(k=document.getElementById(b.Id),k!==null&&k.scrollIntoView({block:"center"}));break;default:ThrowException('Undefined operation type "'+t.Type+'"')}}};ClientOperations.prototype.GetRequestedElement=function(n,t){var e=n.GetAttribute(WorkflowValueName.ElementName),r=n.GetAttribute(WorkflowValueName.ElementId),u=t[WorkflowValueName.CallingElement],f=n.GetAttribute(WorkflowValueName.ElementClass),i=ElementIndex.GetFirstByName(e);return!i&&f&&(i=ElementIndex.GetByClassName(f)[0]),!i&&(r||u)&&(i=ElementIndex.Get(r||u)),i||ThrowException("The requested element could not be located",this),i};ClientOperations.prototype.ReloadElementsFromNode=function(n,t){t.ForEach(function(t,i){i.ReloadElementFromNode(n)})};ClientOperation.prototype.GetAttribute=function(n){var t=this.OperationNode.selectSingleNode('Attribute[@name="'+n+'"]');return IsDefined(t)?t.firstChild.textContent:""};ClientOperation.prototype.GetContentNode=function(){return this.OperationNode.selectSingleNode(ClientOperationContentNodeName)};MacroElement.InheritsFrom(ElementBase);MacroElement.prototype.LoadingInProgress=!1;MacroElement.prototype.Degeneralize=function(n){this.Guid=n.guid;this.GetArgumentsNodeDataJson(n);this.RunsInBackground=n.runs_in_background=="true";var t=n.Relation;t&&(this.Relation={},this.Relation.RunningMacroKey=t.callback_key,this.Relation.RootInstanceKey=t.root_instance_key,this.Relation.TrackValue=t[WorkflowValueName.SequenceTrack],this.Relation.TrackValueType=t[WorkflowValueName.SequenceTrackType]);n.Callback&&(n.Callback.IsJSON=!0,this.CallbackMacro=new MacroElement(this,n.Callback))};MacroElement.prototype.InitializeMembers=function(){};MacroElement.prototype.GetXmlNodeData=function(n){var u,e,i,r,t,f;if(IsDefined(n)&&n.IsJSON===!0&&BRIX.Utilities.MakeXmlNodeCompatible(n),ElementBase.prototype.GetXmlNodeData.call(this,n),this.InitializeMembers(),this.CallbackMacro=null,this.StartArguments=new Hashtable,this.SuppliedArguments=new Hashtable,this.ClientArguments=new Hashtable,this.Relation=null,n.IsJSON===!0){this.Degeneralize(n);return}if(u=GetCDataValue(n,"json"),u){e=JSON.parse(u);this.Degeneralize(e);return}if(!this.Guid&&(this.GetArgumentsNodeData(n),this.RunsInBackground=n.getAttribute("runs_in_background")=="true",n)){for(this.Guid=n.getAttribute("guid"),i=0;i<n.attributes.length;i++)r=n.attributes[i].name,r.slice(0,1)=="_"&&this.SuppliedArguments.put(r,n.getAttribute(r));t=n.selectSingleNode("./Relation");t&&(this.Relation={},this.Relation.RunningMacroKey=t.getAttribute("callback_key"),this.Relation.RootInstanceKey=t.getAttribute("root_instance_key"),this.Relation.TrackValue=t.getAttribute(WorkflowValueName.SequenceTrack),this.Relation.TrackValueType=t.getAttribute(WorkflowValueName.SequenceTrackType));f=n.selectSingleNode("./Callback");f&&(this.CallbackMacro=new MacroElement(this,f.firstChild))}};MacroElement.prototype.InitializeMe=function(){};MacroElement.prototype.AppendCallbackMacro=function(n){this.CallbackMacro?this.CallbackMacro.AppendCallbackMacro(n):this.CallbackMacro=n};MacroElement.prototype.AddClientArgument=function(n,t){t!=null&&this.ClientArguments.put(n,t)};MacroElement.prototype.RemoveClientArgument=function(n){var t=!1;return this.ClientArguments&&this.ClientArguments.containsKey(n)&&(this.ClientArguments.remove(n),t=!0),t};MacroElement.prototype.ClearClientArguments=function(){this.ClientArguments=new Hashtable};MacroElement.prototype.GetArgumentsNodeDataJson=function(n){var r,t,i,u;if(n&&(r="StartArguments",t=n.Arguments,IsDefined(t)&&t.length>0))for(this[r]=new Hashtable,i=0;i<t.length;i++)u=t[i],this[r].put(u.name,u.value)};MacroElement.prototype.GetArgumentsNodeData=function(n){var t;if(n&&(t="StartArguments",args=n.selectNodes("./Arguments/Argument"),args.length>0))for(this[t]=new Hashtable,i=0;i<args.length;i++){var r=args[i],u=r.getAttribute("name"),f=r.firstChild?r.firstChild.nodeValue:"";this[t].put(u,f)}};MacroElement.prototype.GetAllRelevantElements=function(){var n=[],t=FindTopWindow();return t&&t.AppendChildElements(n),n};MacroElement.prototype.PrePerformProcessing=function(n){this.UnprocessedElements=this.GetAllRelevantElements(n);this.RelativeMacro=n;this.PrePerformProcess()};MacroElement.prototype.PrePerformProcess=function(){var n=0,t;elements=this.UnprocessedElements;this.UnprocessedElements.ForEach(function(t,i){i.IsReadyToBeProcessed()?elements.slice(t,1):n++});n==0?(this.RunMacro(this.RelativeMacro),this.RelativeMacro=null,this.UnprocessedElements=null):(t=this,this.ProcessingTimeoutId=window.setTimeout(function(){t.PrePerformProcess()},200))};MacroElement.prototype.PerformAction=function(n,t,i){var f=!1,r,u;if(this.FocusWithServer)f=!1;else if(this.Relation){if(r=window.CurrentMacroCallbackIndex.GetRootMacroByRelation(this.Relation),!r)throw new Error("The macro you are trying to run has already been completed");u=r.MacroElement;this.OnPause&&(u.OnPause=this.OnPause);this.Callback&&(u.Callback=this.Callback);u.CopyArguments(this);r.IsPaused&&(u.AddClientArgument(WorkflowValueName.ResumeFromPause,"true"),r.IsPaused=!1);f=u.PerformAction(n,this);f&&i&&(r.DelayedTrigggerAction=i)}else this.FocusWithServer=!0,this.PrePerformProcessing(t),f=!0;return f};MacroElement.prototype.CopyArguments=function(n){IsDefined(this.ClientArguments)||this.ClearClientArguments();this.ClearClientArguments();this.ClientArguments.putAll(n.ClientArguments);this.ClientArguments.putAll(n.StartArguments);this.ClientArguments.putAll(n.SuppliedArguments)};MacroElement.prototype.CheckForContextParameters=function(n,t){var u={},r,i;for(t&&t.OnEach(function(t){return t.IncludeContextParameters&&!u[t.Id]&&(u[t.Id]=!0,t.IncludeContextParameters(n)),OnEachResult.Continue}),r=this.Parent;r;){for(i=r.FirstChild;i;)i.IncludeContextParameters&&!u[i.Id]&&(u[i.Id]=!0,i.IncludeContextParameters(n)),i=i.NextSibling;if(r.BreakContext)break;r=r.Parent}};MacroElement.prototype.RunMacro=function(n){var t,i,r;this.TriggerMacro=n||this;t=CreateMacroCallback(this);i=this.CollectParameters(n,t);i.Add(BRIX.MacroStorageParameter,BRIX.MacroStorage[t.InstanceKey]);this.CheckForContextParameters(i);this.RemoveClientArgument(WorkflowValueName.ResumeFromPause);r=i.GetDictionary();this.SendRequest(r,t.Key)};MacroElement.prototype.RunByGuid=function(n,t){this.Guid=n;this.IsFocusWithServer=!0;var i=CreateMacroCallback(this);this.RemoveClientArgument(WorkflowValueName.ResumeFromPause);this.SendRequest(t,i.Key)};MacroElement.prototype.SendRequest=function(n,t){if(!this.Guid)throw Error("Missing guid");if(!window.ReadOnlyMode){window.CurrentMacroCallbackIndex.UpdateActivityIndicator();var r=MacroBasePath+this.Guid,u=n,i=this,f=window.app?app.dataModel.getAccessToken():null;$.ajax(r,{data:u,success:function(n,r,u){var f=u.responseXML;f&&f.documentElement&&f.documentElement.nodeName=="error"?(i.FocusWithServer=!1,i.HandleError(f.documentElement)):window.CurrentMacroCallbackIndex.MacroResponse(t,f)},error:function(n){i.FocusWithServer=!1;var t=n.responseXML;t&&t.documentElement&&t.documentElement.nodeName=="error"?(i.FocusWithServer=!1,i.HandleError(t.documentElement)):n.statusCode().status&&alert("Sorry, something went wrong")},headers:{Authorization:"Bearer "+f},dataType:"xml",charset:"utf-8",type:"POST"})}};MacroElement.prototype.HandleError=function(n){var t,i,r,u;if(window.CurrentMacroCallbackIndex.ErrorState=!0,window.CurrentMacroCallbackIndex.UpdateActivityIndicator(),t=n.getAttribute("action"),t=="redirect"){app.dataModel.setAccessToken("");i=n.getAttribute("redirect");window.location=i;return}if(t==="getmore")try{r="id="+n.getAttribute("reference")+"&dump="+encodeURIComponent(document.documentElement.innerHTML);$.ajax(RootPath+"ErrorDump",{data:r,success:function(){},error:function(){},charset:"utf-8",type:"POST"})}catch(f){}u=BRIX.CreateModal({BodyBuilder:function(t){content=$("<div><p>"+n.textContent+"<\/p><\/div>");t.appendChild(content[0])},Size:"small",Closeable:!0});u.Open()};MacroElement.prototype.GetMacroUrl=function(){return this.Guid||ThrowException("Missing GUID"),MacroBasePath+this.Guid+"?"};MacroElement.prototype.CollectParameters=function(n,t){var i=new QueryParameters,u,e,r,f;return window.ForcedLanguage&&i.Add("language",window.ForcedLanguage),i.Add(WorkflowValueName.CreatedElement,t[WorkflowValueName.CreatedElement]),t[WorkflowValueName.CreatedElement]=null,delete t[WorkflowValueName.CreatedElement],t.FeedbackKey&&(i.Add(t.FeedbackKey,t.FeedbackValue),t.FeedbackKey=null,t.FeedbackValue=null),u=this.RelativeMacro?this.RelativeMacro.Parent:this.Parent,IsDefined(u)&&i.Add(WorkflowValueName.TriggerElementId,u.Id),i.Add(WorkflowValueName.MacroCallbackKey,t.Key),e=this.GetCallingElement(),i.Add(WorkflowValueName.MacroInstance,t.InstanceKey),n&&(i.Add(WorkflowValueName.SequenceTrack,n.Relation.TrackValue),i.Add(WorkflowValueName.SequenceTrackType,n.Relation.TrackValueType)),i.AddParameters(this.StartArguments),i.AddParameters(this.ClientArguments),i.AddParameters(this.SuppliedArguments),r=FindTopWindow(),r?(r.GetFieldValuesAsQuery(i),this.CheckForContextParameters(i,r)):(f=ElementIndex.Find(function(n){return n.IsDashboard}),f&&f.GetFieldValuesAsQuery(i)),i};MacroElement.prototype.PerformClientAction=function(n,t){var i=new ClientOperations(n);i.PerformOperations(t)};MacroElement.prototype.GetCallingElement=function(){var n=null;return this.Parent&&(n=this.Parent.GetCallingElement?this.Parent.GetCallingElement():this.Parent),n};MacroElement.prototype.GetFunctionPointer=function(){var n=window[this.FunctionName];if(!n)throw new Error('The method "'+this.FunctionName+'" used by the action is not defined');return n};MacroElement.prototype.ShowLoadingInProgress=function(){if(!this.RunsInBackground&&!this.LoadingInProgress){var n=GetSuitableParentForProgressBar(this);n&&(n.ShowLoadingInProgress(),this.LoadingInProgress=!0)}};MacroElement.prototype.HideLoadingInProgress=function(){if(this.LoadingInProgress){var n=GetSuitableParentForProgressBar(this);n&&(n.HideLoadingInProgress(),this.LoadingInProgress=!1)}};ButtonElement.InheritsFrom(MacroElement);ButtonElement.prototype.GetXmlNodeData=function(n){MacroElement.prototype.GetXmlNodeData.call(this,n);this.Url=n.getAttribute("url");this.Caption=GetCDataValue(n,"Caption");this.IsSelected=n.getAttribute("selected")=="true";this.IsInline=n.getAttribute("inline")=="true";this.IsNonCritical=n.getAttribute("noncritical")=="true";this.IsImportant=n.getAttribute("important")=="true";this.IsDestructive=n.getAttribute("destructive")=="true";this.IsFixed=n.getAttribute("fixed")=="true";this.Badge=n.getAttribute("badge")};ButtonElement.prototype.SetVisibilty=function(n){this.IsHidden=!n;this.Body&&(this.Body.style.display=n?"":"none")};ButtonElement.prototype.InitializeMe=function(){var u=this.Url||this.Guid,n=document.createElement("div"),r,t,i;n.setAttribute("type","button");n.setAttribute("tabindex","0");this.IsHidden&&(n.style.display="none");this.IsNonCritical&&AddCssClass(n,"NonCritical");AddCssClass(n,"btn");this.IsSelected&&AddCssClass(n,"btn-success");this.IsInline;this.IsImportant&&(AddCssClass(n,"btn-primary"),AddCssClass(n,"btn-important"));this.IsImplortant||this.IsSelected||AddCssClass(n,"btn-default");r=n;this.TextNode=r;this.SetButtonContent(r);this.Badge&&(n.appendChild(document.createTextNode(" ")),t=document.createElement("span"),AddCssClass(t,"badge"),t.appendChild(document.createTextNode(this.Badge)),n.appendChild(t));n.id=this.Id;this.Body=n;this.AddBodyNode();this.PopOverContainer=new ButtonElement.PopoverContainer(n,this.TextNode);this.IsDesignMode||(this.Url?(i=this.Url,this.Body.onclick=function(){i=="/"?window.location=i:window.open(i,"_blank")}):(this.EventTracker=new EventTracking(null,n),this.EventTracker.AddCallback("click",this,"OnClick",!0),this.EventTracker.AddCallback("key press",this,"OnKeyPress",!0)));this.IsDragable&&DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription);this.EnableInteraction()};ButtonElement.PopoverContainer=function(n,t){this.ContainerBody=n;this.TwistBody=t;this.SetPopOverElement=function(n,t){var i=this.ContainerBody,u=document.createElement("span"),r;AddCssClass(u,"caret");i.appendChild(document.createTextNode(" "));i.appendChild(u);r=document.createElement("div");AddCssClass(r,"btn-group");i.parentNode.insertBefore(r,i);i.parentNode.removeChild(i);r.appendChild(i);AddCssClass(i,"dropdown-toggle");i.setAttribute("data-toggle","dropdown");i.setAttribute("aria-haspopup","true");i.setAttribute("aria-expanded","false");t.setAttribute("role","menu");t.setAttribute("aria-labelledby",i.id);r.appendChild(t);$(i).ready(function(){$(i).dropdown()})}};ButtonElement.prototype.GetContextCoordinates=function(){return new LayerCoordinates(this.Body)};ButtonElement.prototype.OnClick=function(n,t,i){this.Events.CallEvent("onclick",t,i);this.Guid&&(this.AddClientArgument(WorkflowValueName.ContextElementId,this.Id),this.PerformAction())};ButtonElement.prototype.OnKeyPress=function(n,t,i){this.Events.CallEvent("onkeypress",t,i);this.Guid&&(n===13||n===32)&&(this.AddClientArgument(WorkflowValueName.ContextElementId,this.Id),this.PerformAction())};ButtonElement.prototype.SetButtonContent=function(n){var t=document.createElement("span");AddCssClass(t,"text");t.appendChild(document.createTextNode(this.Caption));n.appendChild(t)};ButtonElement.prototype.AddBodyNode=function(){if(this.IsInline){var n=this.GetParentBody();n.appendChild(this.Body)}else this.FindParentButtonContainer().AddButton(this)};ButtonElement.prototype.FindParentButtonContainer=function(){for(var n=this.Parent;n;){if(n.IsButtonContainer)break;n=n.Parent}return n};ButtonElement.prototype.OnValuePicked=function(n){return this.Events.CallEvent("onopened",n,this.Name,this.Parent.Name),!1};IconButtonElement.InheritsFrom(ButtonElement);IconButtonElement.prototype.GetXmlNodeData=function(n){ButtonElement.prototype.GetXmlNodeData.call(this,n);this.PreferedIconSize=16;this.Icon=ActiveIconArchive.GetFromNode(n,this.PreferedIconSize)};IconButtonElement.prototype.GetSize=function(){var n={};return n.Width=this.Icon.Width+this.Margin*2,n.Height=this.Icon.Height+this.Margin*2,n};IconButtonElement.prototype.SetButtonContent=function(n){var i=this.BuildIcon(),t;n.appendChild(i);t=document.createElement("span");AddCssClass(t,"text");t.appendChild(document.createTextNode(this.Caption));n.appendChild(t)};IconButtonElement.prototype.BuildBody=function(){var n=document.createElement("div");return n.type="button",n.style.position="relative",n.style.display="inline-block",n.className="Button",n};IconButtonElement.prototype.BuildIcon=function(){var n=this.Icon.Create(null,null,!0);return this.Caption&&(n.style.marginRight="5px"),n};MenuButtonElement.InheritsFrom(ElementBase);MenuButtonElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.PreferedIconSize=16;this.Caption=GetCDataValue(n,"Caption");this.IsInline=n.getAttribute("inline")=="true";this.Icon=ActiveIconArchive.GetFromNode(n,this.PreferedIconSize)};MenuButtonElement.prototype.GetHighlightBackgroundImage=function(){IconButtonElement.prototype.IconButtonElement.call(this)};MenuButtonElement.prototype.GetSize=function(){return IconButtonElement.prototype.GetSize.call(this)};MenuButtonElement.prototype.InitializeMe=function(){IconButtonElement.prototype.InitializeMe.call(this)};MenuButtonElement.prototype.SetButtonContent=function(n){IconButtonElement.prototype.SetButtonContent.call(this,n)};MenuButtonElement.prototype.OnOver=function(){IconButtonElement.prototype.OnOver.call(this)};MenuButtonElement.prototype.OnOut=function(){IconButtonElement.prototype.OnOut.call(this)};MenuButtonElement.prototype.BuildBody=function(){return IconButtonElement.prototype.BuildBody.call(this)};MenuButtonElement.prototype.BuildIcon=function(){return IconButtonElement.prototype.BuildIcon.call(this)};MenuButtonElement.prototype.BuildHighlight=function(){return IconButtonElement.prototype.BuildHighlight.call(this)};MenuButtonElement.prototype.BuildCaption=function(){return IconButtonElement.prototype.BuildCaption.call(this)};MenuButtonElement.prototype.AddBodyNode=function(){return ButtonElement.prototype.AddBodyNode.call(this)};MenuButtonElement.prototype.FindParentButtonContainer=function(){return ButtonElement.prototype.FindParentButtonContainer.call(this)};MenuButtonElement.prototype.OnClick=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};ThumbnailButtonElement.InheritsFrom(ButtonElement);ThumbnailButtonElement.prototype.GetXmlNodeData=function(n){ButtonElement.prototype.GetXmlNodeData.call(this,n);this.Url=n.getAttribute("url");var t=(n.getAttribute("size")||"medium").toLowerCase();this.ThumbSize=t=="small"?32:t=="large"?256:128};ThumbnailButtonElement.prototype.GetSize=function(){var n={};return n.Width=this.ThumbSize+this.Margin*2,n.Height=n.Width,n};ThumbnailButtonElement.prototype.InitializeMe=function(){this.BuildBody();this.BuildHighlight();this.BuildPlaceholder();this.LoadToBackground();this.EventTracker=new EventTracking(null,this.Body);this.EventTracker.AddCallback("click",this,"OnClick");this.EventTracker.AddCallback("mouse over",this,"OnOver");this.EventTracker.AddCallback("mouse out",this,"OnOut");this.IsDragable&&DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription)};ThumbnailButtonElement.prototype.LoadToBackground=function(){this.Image=new Image;this.Image.src=this.Url;var n=this;this.Image.onload=function(){n.LoadToForeground()}};ThumbnailButtonElement.prototype.LoadToForeground=function(){var n,t,i,r;this.RemovePlaceholder();this.Image.style.position="absolute";n=new Size(this.Image.width,this.Image.height);n.Width>this.ThumbSize&&n.Height>this.ThumbSize&&(n.Width>n.Height?(i=this.ThumbSize,t=n.Width/(n.Height/this.ThumbSize)):(i=n.Height/(n.Width/this.ThumbSize),t=this.ThumbSize),n.Width=t,n.Height=i,this.Image.style.width=n.Width+"px",this.Image.style.height=n.Height+"px");r=this.ThumbSize/2;this.Image.style.top=Math.round(r-n.Height/2)+"px";this.Image.style.left=Math.round(r-n.Width/2)+"px";this.Body.insertBefore(this.Image,this.Highlight)};ThumbnailButtonElement.prototype.BuildBody=function(){var n=document.createElement("div");n.style.position="relative";n.style.display="inline-block";n.style.overflow="hidden";n.style.width=this.ThumbSize+"px";n.style.height=this.ThumbSize+"px";n.style.background="white url("+GraphicsBasePath+"transparancy.png)";n.style.border="1px solid black";n.style.margin=this.Margin+"px";n.style.textAlign="center";this.Parent.GetBodyElement().appendChild(n);this.Body=n};ThumbnailButtonElement.prototype.RemovePlaceholder=function(){this.PlaceHolder.parentNode.removeChild(this.PlaceHolder);this.PlaceHolder=null};ThumbnailButtonElement.prototype.BuildPlaceholder=function(){var n=CreateImage(GraphicsBasePath+"loading2.gif");n.style.position="absolute";n.style.top="50%";n.style.left="50%";n.style.marginTop="-5px";n.style.marginLeft="-8px";this.Body.appendChild(n);this.PlaceHolder=n};ThumbnailButtonElement.prototype.BuildHighlight=function(){var n=CreateImage(GraphicsBasePath+"transparent.png");n.style.position="absolute";n.style.top="0px";n.style.left="0px";n.style.height=this.ThumbSize+"px";n.style.width=this.ThumbSize+"px";n.style.cursor="pointer";this.Highlight=n;SetOpacity(n,5);this.Body.appendChild(this.Highlight)};ThumbnailButtonElement.prototype.OnOver=function(){this.Highlight.style.backgroundColor="white"};ThumbnailButtonElement.prototype.OnOut=function(){this.Highlight.style.backgroundColor="transparent"};ThumbnailButtonElement.prototype.OnClick=function(n,t,i){this.Events.CallEvent("onclick",t,i);this.Guid&&this.PerformAction()};DragBox.prototype.HoveringInOnValidContainer=function(){this.IsHovered=!0};DragBox.prototype.HoveringOutFromValidContainer=function(){this.IsHovered=!1};DragBox.prototype.BeginDrag=function(n,t){this.CreateBox();this.Move(n,t)};DragBox.prototype.EndDrag=function(){this.Body&&(this.Body.parentNode.removeChild(this.Body),this.Body=null)};DragBox.prototype.Move=function(n,t){var i=n+20,r=t-15;this.Body.style.left=i+"px";this.Body.style.top=r+"px"};DragBox.prototype.CreateBox=function(){var n=document.createElement("div"),i,t;AddCssClass(n,"DnDBox");AddCssClass(n,"TopLeftArrow");i=this.Description.Icon.Create(null,!0);AddCssClass(i,"DnDBoxIcon");n.appendChild(i);t=document.createElement("div");AddCssClass(t,"DnDBoxTitle");AddCssClass(t,"TitleText");t.appendChild(document.createTextNode(this.Description.Headline));n.appendChild(t);this.Body=n;document.body.appendChild(n)};DnDContainerElementAttributes.prototype.IsTypeAllowed=function(n){var t=!1,e,r,u,i,c,l;for(e in this.Areas){r=this.Areas[e];for(u in r)if(r[u].Type==n.Type||u.slice(5)==n.Class){t=!0;break}if(t)break}if(t)for(i=0;i<this.Rejections.length;i++){var f=this.Rejections[i],o=f.indexOf("_"),s=f.slice(0,o),h=f.slice(o+1);if(s=="type"){if(h==n.Class){t=!1;break}}else if(s=="abstracttype"&&(c=new window[n.Class],l=c.IsInheritedFrom(h),l)){t=!1;break}}return t};DnDContainerElementAttributes.prototype.IsTypeValid=function(n,t,i){var r=this.ParentElement.GetAreaOfPosition(t,i),u=this.GetAllowance(n,r);return u?!0:!1};DnDContainerElementAttributes.prototype.GetAllowance=function(n,t,i){var u=null,r,f;if(typeof t!="string")throw new Error("Debug");if(r=null,t=="All")for(f in this.Areas){r=this.Areas[f];break}else r=this.Areas[t];if(r&&(u=r[n]||r["type_"+i]),!r)throw new Error("Dropped on an invalid area");return u};DnDContainerElementAttributes.prototype.GetMacroByType=function(n,t){var i=this.GetAllowance(n.Type,t,n.Class);return i.Macro};IsDropableOverValidContainerHelper.prototype.FinishHovering=function(){for(var n,t=0;t<this.Containers.length;t++)n=this.Containers[t],n.DnDHoverReactionOff(),n.IsHovered&&n.DnDHoverOut();return null};IsDropableOverValidContainerHelper.prototype.GetAnyHoveredContainer=function(n,t){for(var i,f,u=null,r=this.Containers.length-1;r>=0;r--)if(i=this.Containers[r],i.IsWithinPosition(n,t)&&(f=i.DnDContainerAttributes.GetAllowance(this.DragableDescription.Type,"All",this.DragableDescription.Class),f)){u=i;break}return u};GlobalMouseTrackingIndex={};GlobalMouseTrackingIndex.Index=0;GlobalMouseTrackingIndex.Trackers={};GlobalMouseTrackingIndex.Add=function(n){this.Trackers[this.Index]=n;var t=this.Index;return this.Index++,t};EventTracking.prototype.RemoveAllCallbacks=function(){for(var t,i,n=0;n<this.Handles.length;n++)t=this.Handles[n].split("."),i=this.Events[t[0]],i.Remove(t[1])};EventTracking.prototype.RemoveCallback=function(n){var t=n.split("."),i=this.Events[t[0]];i.Remove(t[1])};EventTracking.prototype.AddCallback=function(n,t,i,r,u,f,e){if(!this.Events[n])throw new Error("Undefined event type '"+n+"'");if((n=="mouse over"||n=="mouse out")&&r)throw new Error("Bubbling prevention is not supported for this event type");var s=this.Events[n],o=n+"."+s.Add(t,i,r||!1,u,f,e);return this.Handles[this.Handles.length]=o,o};EventTracking.prototype.AddCallbackFunction=function(n,t,i){if(!this.Events[n])throw new Error("Undefined event type '"+n+"'");if((n=="mouse over"||n=="mouse out")&&i)throw new Error("Bubbling prevention is not supported for this event type");var u=this.Events[n],r=n+"."+u.AddFunction(t,i||!1);return this.Handles[this.Handles.length]=r,r};EventTracking.prototype.RunCallbacks=function(n,t,i,r){var s=this.Events[n],o=!0,f=[],h,e,u;for(h in s.Callbacks)f[f.length]=s.Callbacks[h];for(e=f.length-1;e>=0;e--)if(u=f[e],u.CallbackFunctionName?(u.Parameter1&&(t.Parameter1=u.Parameter1),u.Parameter2&&(t.Parameter2=u.Parameter2),u.Parameter3&&(t.Parameter3=u.Parameter3),o=u.CallbackResidens[u.CallbackFunctionName](t,i,r)):u.CallbackFunction&&(o=u.CallbackFunction(t,i,r)),u.PreventBubbling){StopPropagation(t);break}return o};EventTracking.prototype.OnMouseOut=function(n){this.TimerHandle&&window.clearTimeout(this.TimerHandle);var t=this.GlobalIndex,i=n||event;this.TimerHandle=window.setTimeout(function(){var n=GlobalMouseTrackingIndex.Trackers[t];n.MouseOut(i)},10)};EventTracking.prototype.MouseOut=function(n){if(this.IsMouseOver)return this.IsMouseOver=!1,this.RunCallbacks("mouse out",n)};testX=0;EventTracking.prototype.OnMouseOver=function(n){this.TimerHandle&&window.clearTimeout(this.TimerHandle);var t=this.GlobalIndex,i=n||event;this.TimerHandle=window.setTimeout(function(){var n=GlobalMouseTrackingIndex.Trackers[t];n.MouseOver(i)},10)};EventTracking.prototype.MouseOver=function(n){if(!this.IsMouseOver)return this.IsMouseOver=!0,this.RunCallbacks("mouse over",n)};EventTracking.prototype.OnMouseMove=function(n){var t=new EventInfo(n);return this.MouseMove(n,t.Left,t.Top)};EventTracking.prototype.MouseMove=function(n,t,i){return this.RunCallbacks("mouse move",n,t,i)};EventTracking.prototype.OnMouseDown=function(n){var t=new EventInfo(n);return this.MouseDown(n,t.Left,t.Top)};EventTracking.prototype.MouseDown=function(n,t,i){return this.RunCallbacks("mouse down",n,t,i)};EventTracking.prototype.OnMouseUp=function(n){var t=new EventInfo(n);return this.MouseUp(n,t.Left,t.Top)};EventTracking.prototype.MouseUp=function(n,t,i){return this.RunCallbacks("mouse up",n,t,i)};EventTracking.prototype.OnResize=function(n){return this.Resize(n)};EventTracking.prototype.Resize=function(n){return this.RunCallbacks("resize",n)};EventTracking.prototype.OnClick=function(n){var t=new EventInfo(n);return this.Click(n,t.Left,t.Top)};EventTracking.prototype.Click=function(n,t,i){return this.RunCallbacks("click",n,t,i)};EventTracking.prototype.OnDoubleClick=function(n){return this.DoubleClick(n)};EventTracking.prototype.DoubleClick=function(n){return this.RunCallbacks("double click",n)};EventTracking.prototype.OnKeyPress=function(n){return this.KeyPress(n)};EventTracking.prototype.KeyPress=function(n){return this.RunCallbacks("key press",n.keyCode||n.which)};EventTracking.prototype.OnKeyDown=function(n){return this.KeyDown(n)};EventTracking.prototype.KeyDown=function(n){return this.RunCallbacks("key down",n.keyCode||n.which)};EventTracking.prototype.OnKeyUp=function(n){return this.KeyUp(n)};EventTracking.prototype.KeyUp=function(n){return this.RunCallbacks("key up",n.keyCode||n.which)};EventTracking.prototype.OnContextMenu=function(n){var t=new EventInfo(n);return this.ContextMenu(n,t.Left,t.Top)};EventTracking.prototype.ContextMenu=function(n,t,i){return this.RunCallbacks("context menu",n,t,i)};EventTracking.prototype.OnFocus=function(n){return this.Focus(n)};EventTracking.prototype.Focus=function(n){return this.RunCallbacks("focus",n)};EventTracking.prototype.OnBlur=function(n){return this.Blur(n)};EventTracking.prototype.Blur=function(n){return this.RunCallbacks("blur",n)};EventTracking.prototype.OnChange=function(n){return this.Change(n)};EventTracking.prototype.Change=function(n){return this.RunCallbacks("change",n)};EventCallbacks.prototype.RegisterEvent=function(){var n=this.Tracker.Element?this.Tracker.Element:document.getElementById(this.Tracker.ElementId);n.Tracker=this.Tracker;var t=this.Tracker,i=this.TrackerEventName,r=function(n){n==null&&(n=window.event);var r=t[i](n);return r!=!0&&r!=!1&&(r=!0),r};n[this.BrowserEventName]=r};EventCallbacks.prototype.UnRegisterEvent=function(){var n=this.Tracker.Element?this.Tracker.Element:document.getElementById(this.Tracker.ElementId);n.Tracker=null;n[this.BrowserEventName]=null};EventCallbacks.prototype.Add=function(n,t,i,r,u,f){var o,e;return this.CallbackCount==0&&this.RegisterEvent(),o="h"+this.HandleIndex,this.HandleIndex++,e={},e.CallbackResidens=n,e.CallbackFunctionName=t,e.PreventBubbling=i,e.Parameter1=r,e.Parameter2=u,e.Parameter3=f,this.Callbacks[o]=e,this.CallbackCount++,o};EventCallbacks.prototype.AddFunction=function(n,t){var r,i;return this.CallbackCount==0&&this.RegisterEvent(),r="h"+this.HandleIndex,this.HandleIndex++,i={},i.CallbackFunction=n,i.PreventBubbling=t,this.Callbacks[r]=i,this.CallbackCount++,r};EventCallbacks.prototype.Remove=function(n){this.Callbacks[n]&&(delete this.Callbacks[n],this.CallbackCount--,this.CallbackCount==0&&this.UnRegisterEvent())};EventCollection.prototype.HaveEvent=function(n){for(var r,i=!1,t=0;t<this.Events.length;t++)if(r=this.Events[t],r.Trigger.Name==n){i=!0;break}return i};EventCollection.prototype.CallEvent=function(n,t,i,r,u){for(var e,s=0,o=[],f=0;f<this.Events.length;f++)e=this.Events[f],e.Trigger.Name==n&&(o.push(e),s++);if(o.length==0){u&&u();return}for(f=0;f<o.length;f++)e=o[f],e.Action.Perform(t,i,r,function(){s--;s==0&&u&&u()})};EventCollection.prototype.GetEventByActionType=function(n){for(var i,r=null,t=0;t<this.Events.length;t++)if(i=this.Events[t],i.Action.Type==n){r=i;break}return r};EventCollection.prototype.LoadEvents=function(n){for(var r,i=n.selectNodes("Event"),t=0;t<i.length;t++)r=i[t],this.Events[this.Events.length]=new CustomEvent(this.ParentElement,r)};ActionTypes={PickValue:"pick_value",CallMacro:"macro",SelectSource:"select_source",OpenContextMenu:"open_context_menu",SelectOperator:"select_operator",Select:"select",Deselect:"deselect",ColorPicker:"color_picker",UpdateVisibilities:"update_visibilities",Expand:"expand",Collapse:"collapse",UpdateButtons:"update_buttons"};EventAction.prototype.Perform=function(n,t,i,r){switch(this.Type){case ActionTypes.Expand:this.Parent.Parent.OnExpand();r();break;case ActionTypes.Collapse:this.Parent.Parent.OnCollapse();r();break;case ActionTypes.UpdateVisibilities:this.UpdateVisibilities(r);break;case ActionTypes.UpdateButtons:this.UpdateButtons(r);break;case ActionTypes.PickValue:this.PickValue();r();break;case ActionTypes.CallMacro:this.CallMacro(n,t,i,r);break;case ActionTypes.SelectSource:this.CallOpenContextMenu(n,t,i);r();break;case ActionTypes.OpenContextMenu:this.CallOpenParentContextMenu(n,t,i);r();break;case ActionTypes.SelectOperator:this.CallOpenContextMenu(n,t,i);r();break;case ActionTypes.Select:this.CallSelect();r();break;case ActionTypes.Deselect:this.CallDeselect();r();break;case ActionTypes.ColorPicker:this.CallColorPicker();r();break;default:r()}};EventAction.prototype.UpdateVisibilities=function(n){for(var t=this.Parent,i=null;t;){if(t.IsButtonContainer&&(i=t),t.IsVisibilityRoot)break;t=t.Parent}t||ThrowException("No suitable visibility root found");t.UpdateVisibilities(i,n)};EventAction.prototype.UpdateButtons=function(n){for(var t=this.Parent,i=null;t;){if(t.IsButtonContainer&&(i=t),t.IsVisibilityRoot)break;t=t.Parent}t||ThrowException("No suitable visibility root found");t.UpdateButtons(i,n)};EventAction.prototype.PickValue=function(){for(var n=this.Parent;n&&typeof n.OnValuePicked!="function";)n=n.Parent;return n||ThrowException("No suitable parent found"),n.OnValuePicked(this.Value),!1};EventAction.prototype.CallOpenContextMenu=function(n,t){return this.ContextMenu.CreateMenu(n,t),!1};EventAction.prototype.CallOpenParentContextMenu=function(n,t){return this.Parent.ContextMenu.CreateMenu(n,t),!1};EventAction.prototype.CallMacro=function(n,t,i,r){this.CallableMacro&&(this.CallbackArgumentName1&&n&&this.CallableMacro.AddClientArgument(this.CallbackArgumentName1,encodeURIComponent(n)),this.CallbackArgumentName2&&t&&this.CallableMacro.AddClientArgument(this.CallbackArgumentName2,encodeURIComponent(t)),this.CallbackArgumentName3&&i&&this.CallableMacro.AddClientArgument(this.CallbackArgumentName3,encodeURIComponent(i)),this.CallableMacro.PerformAction(null,null,r))};EventAction.prototype.CallColorPicker=function(){var n=this,t=function(t){n.ColorChanged(t)},i=function(t){n.ColorSaved(t)},r=new ColorPickerHelper(t,i,this.Color,this.ColorReset,this.ColorResetText);r.Build(this.Parent)};EventAction.prototype.ColorChanged=function(n){this.Parent.SetColor&&this.Parent.SetColor(n);var t=this.GetCorrespondingElements(this.NameOrId);t.ForEach(function(t,i){i.SetColor&&i.SetColor(n)})};EventAction.prototype.ColorSaved=function(n){var t=this.CallbackArgumentName1;this.SaveMacro.AddClientArgument(t,n.replace("#",""));this.SaveMacro.PerformAction()};EventAction.prototype.CallSelect=function(){var n=this.GetCorrespondingElements(this.NameOrId);n.ForEach(function(n,t){t.Select()})};EventAction.prototype.CallDeselect=function(){var n=this.GetCorrespondingElements(this.NameOrId);n.ForEach(function(n,t){t.Deselect()})};EventAction.prototype.GetCorrespondingElements=function(n){var t=[],i=n?ElementIndex.Get(n):null;return i?t.push(i):t=ElementIndex.GetByName(n),t};TableElement.InheritsFrom(DataElement);TableElement.prototype.GetXmlNodeData=function(n){DataElement.prototype.GetXmlNodeData.call(this,n);this.Table=null;this.RowComponentName="TableRowElement"};TableElement.prototype.GetRows=function(){for(var t=[],n=this.FirstChild;n;)n.MyClassName==this.RowComponentName&&(t[t.length]=n),n=n.NextSibling;return t};TableElement.prototype.DeselectRows=function(n,t){for(var i,u=this.GetRows(),r=0;r<u.length;r++)i=u[r],i.Selected&&i.Id!=n&&i.Id!=t&&i.Deselect()};TableElement.prototype.InitializeMe=function(){this.Table=new Table;this.Body=this.Parent.GetBodyElement();this.Body.appendChild(this.Table.Element);this.Body.id=this.Id;var n=window.Page;n&&(this.EventTracker=new EventTracking(n.GetBodyElement().id))};TableElement.prototype.FloodSelect=function(n){var r,t,i;if(this.CurrentRow&&(this.DeselectRows(this.CurrentRow.Id,n.Id),r=function(t,i,r){for(var f=[],e=!1,u=i[t];u;){if(u.Id==n.Id){e=!0;break}else r.MyClassName==u.MyClassName&&f.push(u);u=u[t]}return e?f:null},t=r("NextSibling",this.CurrentRow,n),t||(t=r("PreviousSibling",this.CurrentRow,n)),t))for(i=0;i<t.length;i++)t[i].Select()};TableElement.prototype.OnKeyDown=function(n){n==ESCKEY&&this.OnDelete()};TableElement.prototype.OnDelete=function(){for(var t,i=this.GetRows(),n=0;n<i.length;n++)t=i[n],t.Selected&&t.OnDelete()};TableElement.prototype.GetFieldValue=function(){for(var i,n=[],r=this.GetRows(),t=0;t<r.length;t++)i=r[t],i.Selected&&(n[n.length]=i.Name);return encodeURIComponent(n.join(","))};TableCellElement.InheritsFrom(DataElement);TableCellElement.prototype.ConstructCellName=function(n,t){return n.Name+"."+t.Name};TableCellElement.prototype.GetValuesAsQuery=function(n){this.IsEditable&&DataElement.prototype.GetValuesAsQuery.call(this,n)};TableCellElement.prototype.GetXmlNodeData=function(n){DataElement.prototype.GetXmlNodeData.call(this,n);this.RowName=n.getAttribute("row");this.ColumnName=n.getAttribute("column");this.ValuePlaceholder=n.getAttribute("ValuePlaceholder")||"";this.Value=GetCDataValue(n,"Value")||"";this.IsSelected=n.getAttribute("selected")=="true";this.IsDisabled=n.getAttribute("disabled")=="true";this.IsOneLine=n.getAttribute("oneline")=="true";this.IsEditable=n.getAttribute("editable")=="true";this.IsHeader=n.getAttribute("isheader")=="true";this.ContentType=n.getAttribute("content_type");this.IsTextType=this.ContentType==DataTableCellContentType.Text;this.IsNumeric=this.ContentType==DataTableCellContentType.Numeric;this.IsDateTime=this.ContentType==DataTableCellContentType.DateTime;var t=n.selectSingleNode("ContextMenu");t&&(this.ContextMenu=new ContextMenu(this,t),this.ContextMenu.CreateChildNodes(t))};TableCellElement.prototype.OnValuePicked=function(n){return this.Events.CallEvent("onopened",n,this.Name,this.Parent.Name),!1};TableCellElement.prototype.InitializeMe=function(){if(!this.Parent.Row)throw new Error("Invalid parent. Must contain a Table Row");var n=this.Parent.Row.AddCell();AddCssClass(n.Element,"TableCell");this.IsSelected&&AddCssClass(n.Element,"Selected");this.IsDisabled&&AddCssClass(n.Element,"Disabled");this.CellBody=n.Element;this.IsHeader&&AddCssClass(n.Element,"ColumnHead");(this.IsTextType||this.IsNumeric||this.IsDateTime)&&this.BuildTextContent(n.Element);this.IsOneLine&&(n.Element.style.whiteSpace="nowrap");n.Element.id=this.Id;this.TableCell=n.Element;this.InputCell=n.Element;this.EventTracker=new EventTracking(this.TableCell.id);this.EventTracker.AddCallback("click",this,"OnCellClicked");this.EventTracker.AddCallback("mouse over",this,"OnOver");this.EventTracker.AddCallback("mouse out",this,"OnOut")};TableCellElement.prototype.OnCellClicked=function(n,t,i){this.ContextMenu&&this.ContextMenu.CreateMenu(t,i);this.Events.CallEvent("onclick",t,i)};TableCellElement.prototype.OnOut=function(){};TableCellElement.prototype.OnOver=function(){};TableCellElement.prototype.BuildTextContent=function(){var t,i,n;this.IsEditable?(t=new TextboxElement(this,new FakeXml("node")),t.Name=this.Id+"_input",this.AppendChild(t),t.Value=this.Value):this.Value&&(i=this.Value?this.Value:"-",n=document.createElement("div"),n.appendChild(document.createTextNode(i)),n.style.display="inline-block",n.style.verticalAlign="middle",this.CellBody.appendChild(n))};TableRowElement.InheritsFrom(ElementBase);TableRowElement.prototype.AddCell=function(n){this.Cells[n.Name]=n};TableRowElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Cells={};this.Name=n.getAttribute("name");this.TableTransparency=this.Parent.Transparency;this.Style=n.getAttribute("style");this.StyleIsEven=this.Style=="even";this.StyleIsOdd=this.Style=="odd";this.StyleIsFade=this.Style=="fade";this.StyleIsNormal=!(this.StyleIsEven||this.StyleIsOdd);this.SetRowStyle();this.IsSelectable=n.getAttribute("is_selectable")=="true";var t=n.selectSingleNode("DeleteMacro");t&&(this.DeleteMacro=new MacroElement(this,t.firstChild));this.ScrollInto=n.getAttribute("scroll_into_listoption")};TableRowElement.prototype.InitializeMe=function(){var t,n,i,r;if(this.LastSpaceModification=0,!this.Parent.Table)throw new Error("Invalid parent. Must contain a Table");if(this.Row=this.Parent.Table.AddRow(),this.Body=this.Row.Element,AddCssClass(this.Body,"TableRow"),this.Body.id=this.Id,this.StyleIsFade&&AddCssClass(this.Body,"Fade"),this.EventTracker=new EventTracking(this.Body.id),this.IsSelectable&&this.SetupSelectableRow(),this.IsDragable&&DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription),this.ScrollInto!==null){for(t=!1,n=this;!t&&n!==null;)n=n.Parent,n!==null&&(t=n.MyClassName=="TableElement"?!0:!1);i=n!==null?n.GetDescendantByName(this.ScrollInto):null;i!==null&&(r=document.getElementById(i.Id),r!==null&&r.scrollIntoView({block:"center"}))}};TableRowElement.prototype.SetRowStyle=function(){this.StyleIsEven?this.ColorDeselected="#FFFFFF":this.StyleIsOdd&&(this.ColorDeselected="#E8E8E8")};TableRowElement.prototype.SetupSelectableRow=function(){this.EventTracker.AddCallback("mouse over",this,"OnMouseOver");this.EventTracker.AddCallback("mouse out",this,"OnMouseOut");this.EventTracker.AddCallback("click",this,"OnMouseClick",!0);this.EventTracker.AddCallback("double click",this,"OnOpen",!0)};TableRowElement.prototype.OnOpen=function(){this.Events.CallEvent("onopen")};TableRowElement.prototype.OnDelete=function(){this.DeleteMacro&&this.DeleteMacro.PerformAction()};TableRowElement.prototype.OnMouseOver=function(){this.HighlightOn()};TableRowElement.prototype.OnMouseOut=function(){this.HighlightOff()};TableRowElement.prototype.OnMouseClick=function(){this.Selected&&!1?(window.Page.IsKeyDown(CTRLKEY)||this.Parent.DeselectRows(),this.Deselect()):this.Select();RemoveSelection()};TableRowElement.prototype.Select=function(){window.Page.IsKeyDown(SHIFTKEY)?this.Parent.FloodSelect(this):window.Page.IsKeyDown(CTRLKEY)||this.Parent.DeselectRows();window.Page.IsKeyDown(SHIFTKEY)&&this.Parent.CurrentRow||(this.Parent.CurrentRow=this);AddCssClass(this.Body,"Selected");this.Selected=!0};TableRowElement.prototype.Deselect=function(){this.Parent.CurrentRow&&this.Parent.CurrentRow.Id==this.Id&&(this.Parent.CurrentRow=null);RemoveCssClass(this.Body,"Selected");this.Selected=!1};TableRowElement.prototype.HighlightOn=function(){AddCssClass(this.Body,"Highlight")};TableRowElement.prototype.HighlightOff=function(){RemoveCssClass(this.Body,"Highlight")};TableRowElement.prototype.DnDHoverIn=function(){ElementBase.prototype.DnDHoverIn.call(this)};TableRowElement.prototype.DnDHoverOut=function(){ElementBase.prototype.DnDHoverOut.call(this)};TableRowElement.prototype.MakeRoomAbove=function(){this.TargetVerticalTransition!=this.HoverPadding&&(this.TargetVerticalTransition=this.HoverPadding,this.VerticalTransition())};TableRowElement.prototype.RemoveRoomAbove=function(){this.TargetVerticalTransition!=this.NormalPadding&&(this.TargetVerticalTransition=this.NormalPadding,this.VerticalTransition())};TableRowElement.prototype.SetVerticalSpacing=function(n){var t,i;for(this.LastSpaceModification=spaceChange,t=this.FirstChild;t;)t.MyClassName=="TableCellElement"&&(i=t,i.TableCell.style.paddingTop=n+"px"),t=t.NextSibling};TableRowElement.prototype.VerticalTransition=function(){var n=!1,t=this.CurrentVerticalTransition;this.CurrentVerticalTransition>this.TargetVerticalTransition?(this.CurrentVerticalTransition-=this.VerticalTransitionSpeed,this.CurrentVerticalTransition<this.TargetVerticalTransition&&(this.CurrentVerticalTransition=this.TargetVerticalTransition),n=!0):this.CurrentVerticalTransition<this.TargetVerticalTransition&&(this.CurrentVerticalTransition+=this.VerticalTransitionSpeed,this.CurrentVerticalTransition>this.TargetVerticalTransition&&(this.CurrentVerticalTransition=this.TargetVerticalTransition),n=!0);n&&(this.SetVerticalSpacing(this.CurrentVerticalTransition,t),window.setTimeout('var element=ElementIndex.Get("'+this.Id+'", true); if(element) element.VerticalTransition();',10))};TableRowElement.prototype.RequiredExtraSpace=function(){return this.IsDragAndDropContainer?this.HoverPadding-this.NormalPadding:0};TableColumn.prototype.AddCell=function(n){this.Cells[n.Name]=n};MenuItem.InheritsFrom(ElementBase);MenuItem.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.ExpandRight=!1;this.Caption=GetCDataValue(n,"Caption")||"";this.IsSelected=n.getAttribute("selected")=="true";this.IsDisabled=n.getAttribute("disabled")=="true";var t=n.selectSingleNode("Icon");t&&(this.Icon=ActiveIconArchive.GetFromNode(t,this.IconSize))};MenuItem.prototype.BuildMenuItem=function(){this.Body=this.CreateBody();this.Body.appendChild(this.CreateIcon());this.Body.appendChild(document.createTextNode(this.Caption));this.Parent.Box.appendChild(this.Body);this.EventTracker=new EventTracking(null,this.Body);this.EventTracker.AddCallback("click",this,"OnClick",!1);var n=this;this.Body.onmouseover=function(){n.OnHover()};this.Body.onmouseout=function(){n.OnExit()}};MenuItem.prototype.OnClick=function(){};MenuItem.prototype.OnHover=function(){var t=this.MyClassName,n;if(this.Parent.MyClassName=="ContextMenu")if(this.MyClassName=="Menu")this.ExpandMenu();else for(n=this.Parent.FirstChild;n;)n.MyClassName=="Menu"&&n.IsExpanded&&n.CloseMenu(),n=n.NextSibling};MenuItem.prototype.OnExit=function(){};MenuItem.prototype.Build=function(){throw new Error("This method must be overriden");};MenuItem.prototype.CloseMenu=function(){this.Parent.CloseMenu()};MenuItem.prototype.InitializeMe=function(){};MenuItem.prototype.CreateBody=function(){var n=document.createElement("a");return AddCssClass(n,"ListItem"),AddCssClass(n,"MenuItem"),AddCssClass(n,"Hoverable"),this.IsSelected&&AddCssClass(n,"Selected"),this.IsDisabled&&AddCssClass(n,"Disabled"),n.id=this.Id,n};MenuItem.prototype.CreateIcon=function(){return this.Icon.Create()};MenuItem.prototype.GetRootMenu=function(){for(var n=this;n&&!n.IsRootMenu;)n=n.Parent;return n};MenuMacro.InheritsFrom(MenuItem);MenuMacro.prototype.GetXmlNodeData=function(n){MenuItem.prototype.GetXmlNodeData.call(this,n);var t=n.selectSingleNode("./Macro");if(!t)throw new Error("This menu item must have a macro associated with it");this.Macro=new MacroElement(this,t.firstChild)};MenuMacro.prototype.OnClick=function(){this.Macro.AddClientArgument(WorkflowValueName.ContextElementId,this.GetRootMenu().RelatedElementId);this.Macro.PerformAction();this.GetRootMenu().CloseMenu()};MenuMacro.prototype.CloseMenu=function(){this.Body.parentNode.removeChild(this.Body);this.Body=null};EventMenuItem.InheritsFrom(MenuItem);EventMenuItem.prototype.GetXmlNodeData=function(n){MenuItem.prototype.GetXmlNodeData.call(this,n)};EventMenuItem.prototype.OnClick=function(){MenuItem.prototype.OnClick.call(this);this.Events.CallEvent("onclick");this.Events.CallEvent("onselect");this.GetRootMenu().CloseMenu()};EventMenuItem.prototype.CloseMenu=function(){this.Body.parentNode.removeChild(this.Body);this.Body=null};Menu.InheritsFrom(MenuItem);Menu.prototype.GetXmlNodeData=function(n){MenuItem.prototype.GetXmlNodeData.call(this,n);this.IsExpanded=!1};Menu.prototype.SetRelatedElement=function(n){this.RelatedElementId=n.Id};Menu.prototype.OnClick=function(){MenuItem.prototype.OnClick.call(this);this.ExpandMenu()};Menu.prototype.OnHover=function(){MenuItem.prototype.OnHover.call(this);this.ExpandMenu()};Menu.prototype.OnExit=function(){MenuItem.prototype.OnExit.call(this)};Menu.prototype.CloseMenu=function(){if(this.IsExpanded){for(var n=this.FirstChild;n;)n.CloseMenu(),n=n.NextSibling;this.RemoveBox();this.IsExpanded=!1}};Menu.prototype.CloseSiblings=function(){for(var n=this.Parent.FirstChild;n;)n!=this&&n.MyClassName==this.MyClassName&&n.CloseMenu(),n=n.NextSibling};Menu.prototype.ExpandMenu=function(n,t){if(!this.IsExpanded){this.CloseSiblings();this.BuildBox();for(var i=this.FirstChild;i;)i.BuildMenuItem(),i=i.NextSibling;this.PlaceBox(n,t-15);this.BoxSize=new LayerCoordinates(this.Box);this.IsExpanded=!0}};Menu.prototype.BuildBox=function(){var n=document.createElement("div"),t;AddCssClass(n,"FloatingBox animated fadeIn");AddCssClass(n,"MenuBox");AddCssClass(n,"TopLeftArrow");t=this.GetRootMenu();t.Floor.appendChild(n);this.Box=n};Menu.prototype.PlaceBox=function(){var t=new LayerSize(document.body),n=new LayerCoordinates(this.Body),i=new LayerSize(this.Box),r=n.Top+i.Height>t.Height?t.Height-i.Height:n.Top;this.Box.style.top=r+"px";this.ExpandRight=n.Right+i.Width>=t.Width;this.ExpandRight?this.Box.style.right=t.Width-n.Left+"px":this.Box.style.left=n.Right+"px"};Menu.prototype.RemoveBox=function(){this.Box.parentNode.removeChild(this.Box);this.Box=null};ContextMenu.InheritsFrom(Menu);ContextMenu.prototype.GetXmlNodeData=function(n){Menu.prototype.GetXmlNodeData.call(this,n);this.IsManualMenu||(this.Parent.ContextMenu=this);this.SetRelatedElement(this.Parent)};ContextMenu.prototype.CreateMenu=function(n,t,i){var r=document.documentElement,u=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),f=(window.pageYOffset||r.scrollTop)-(r.clientTop||0);this.OnCloseCallback=i;this.CreateFloor();this.Floor.style.top=f+"px";this.Floor.style.left=u+"px";this.CreateDimmer();this.ExpandMenu(n,t)};ContextMenu.prototype.PlaceBox=function(n,t){var i=new LayerSize(document.body),r=new LayerSize(this.Box),u=r.Width+n>i.Width?i.Width-r.Width:n,t=t+r.Height>i.Height?i.Height-r.Height:t;this.Box.style.top=t+"px";this.Box.style.left=u+"px"};ContextMenu.prototype.HideMenu=function(){this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.CreateDimmer=function(){this.Dimmer=CreateDimmerElement();this.Dimmer.id=this.Id+"_dimmer";this.Floor.appendChild(this.Dimmer);this.EventTracker=new EventTracking(this.Dimmer.id);this.EventTracker.AddCallback("click",this,"CloseMenu",!1)};ContextMenu.prototype.RemoveDimmer=function(){this.Dimmer&&(this.Dimmer.parentNode.removeChild(this.Dimmer),this.Dimmer=null)};ContextMenu.prototype.CloseMenu=function(){this.OnCloseCallback&&(this.OnCloseCallback(),this.OnCloseCallback=null);Menu.prototype.CloseMenu.call(this);this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.Destroy=function(){this.Parent.ContextMenu=null;this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.CreateFloor=function(){var n=document.createElement("div");n.id=this.Id+"_floor";n.style.position="absolute";n.style.top="0px";n.style.height="100%";n.style.left="0px";n.style.width="100%";n.style.overflow="hidden";n.style.zIndex="2";this.Floor=n;document.body.appendChild(n)};ContextMenu.prototype.RemoveFloor=function(){this.Floor&&(this.Floor.parentNode.removeChild(this.Floor),this.Floor=null)};TemplateElement.InheritsFrom(ElementBase);TemplateElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Floor=this.GetFloorElement();this.Transparency=new Number(n.getAttribute("transparency")||0);this.Coordinates=new Coordinates;this.Coordinates.Deserialize(n);this.Floor.AbsPosConversion&&this.Coordinates.ConvertToUnits(this.Floor.AbsPosConversion.ToPixels);this.Coordinates.Size.Height<0&&(this.Coordinates.Size.Height=16,this.Coordinates.Update());this.Coordinates.Size.Width<0&&(this.Coordinates.Size.Width=16,this.Coordinates.Update());var t=n.selectSingleNode("UpdateCoordinates");t&&(this.UpdateCoordinatesMacro=new MacroElement(this,t.firstChild));this.Resizable=n.getAttribute("resizable")=="true";this.ProportionsLocked=n.getAttribute("proportions_locked")=="true";this.IsSelected=!1;this.Modificator=null;this.IsMovable=!0};TemplateElement.prototype.Reveal=function(){var r=this.Body,u=function(){return IsDefined(this.Body)},n=100,t=this.Transparency,i;SetTransparency(r,n);i=function(f,e){u()||(n-=f,SetTransparency(r,n<t?t:n),n>t&&window.setTimeout(function(){i(f,e)},e))};i(5,100)};TemplateElement.prototype.GetOutputCoordinates=function(){return this.Coordinates};TemplateElement.prototype.UpdateCoordinates=function(){var n,arguments,t;if(this.UpdateCoordinatesMacro){n=this.GetOutputCoordinates().Copy();n.ConvertToUnits(this.Floor.AbsPosConversion.FromPixels);arguments=n.Serialize();for(t in arguments)this.UpdateCoordinatesMacro.AddClientArgument(t,arguments[t]);this.UpdateCoordinatesMacro.PerformAction()}};TemplateElement.prototype.AdjustCoordinatesBeforeUpdate=function(){};TemplateElement.prototype.HighlightOn=function(){this.Modificator=new ElementModificator(this.Floor.Overlay,this)};TemplateElement.prototype.GetModificatorCoordinates=function(){return this.Coordinates.Copy()};TemplateElement.prototype.HighlightOff=function(){this.Modificator.Remove();this.Modificator=null};TemplateElement.prototype.BeforeDestroyed=function(){this.Modificator&&(this.Modificator.Remove(),this.Modificator=null)};TemplateElement.prototype.Select=function(){this.IsSelected||(this.HighlightOn(),this.IsSelected=!0)};TemplateElement.prototype.OnResize=function(){this.IsSelected&&(this.Deselect(),this.Select());ElementBase.prototype.OnResize.call(this)};TemplateElement.prototype.Deselect=function(){this.IsSelected&&(this.HighlightOff(),this.IsSelected=!1)};TemplateElement.prototype.GetFloorElement=function(){for(var n=this.Parent;n;){if(n.IsAbsPosFloor)break;n=n.Parent}return n||(n=this.Parent),n};TemplateElement.prototype.DnDHoverIn=function(){this.IsHovered=!0};TemplateElement.prototype.DnDHoverOut=function(){this.IsHovered=!1};PoweredByElement.InheritsFrom(TemplateElement);PoweredByElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n)};PoweredByElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body,!0);TemplateElement.prototype.OnResize.call(this)};PoweredByElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;AddCssClass(n,"PoweredBy");n.id=this.Id;t=new Image;t.src=GraphicsBasePath+"poweredby_axaco_air.png";t.alt="Powered by Axaco Air";n.appendChild(t);this.Body=n;this.Floor.GetBodyElement().appendChild(n);SetTransparency(this.Body,this.Transparency);this.Coordinates.SetDomCoordinates(this.Body,!0)};LanguageElement.InheritsFrom(TemplateElement);LanguageElement.prototype.GetXmlNodeData=function(n){var r,u,i;for(TemplateElement.prototype.GetXmlNodeData.call(this,n),r=n.selectNodes("./Language"),u=[],i=0;i<r.length;i++){var t=r[i],f=t.selectSingleNode("./LanguageMacro"),e={Name:t.getAttribute("name"),Macro:f?new MacroElement(this,f.firstChild):null,Selected:t.getAttribute("selected")||!1,Flag:t.getAttribute("flag"),Code:t.getAttribute("code")};u.push(e)}this.Languages=u;this.InvertFlags=n.getAttribute("invert_flags")||!1};LanguageElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body,!0);TemplateElement.prototype.OnResize.call(this)};LanguageElement.prototype.BuildLanguage=function(n,t){var r=document.createElement("div"),f=n.Name,i,u;n.Selected?document.documentElement.lang=ConvertToISO(n.Code):r.onclick=function(){window.ForcedLanguage=n.Code;n.Macro.PerformAction()};AddCssClass(r,"Language");i=new Image;u=GraphicsBasePath+"flags/24/";i.src=u+n.Flag+".png";i.alt=n.Name;i.title=n.Name;AddCssClass(i,"Flag");this.InvertFlags?AddCssClass(i,n.Selected?"Unselected":"Selected"):AddCssClass(i,n.Selected?"Selected":"Unselected");r.appendChild(i);t.appendChild(r)};LanguageElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t,i;for(n.id=this.Id,this.Body=n,AddCssClass(n,"Languages"),SetTransparency(this.Body,this.Transparency),this.Floor.GetBodyElement().appendChild(n),t=0;t<this.Languages.length;t++)this.BuildLanguage(this.Languages[t],n);i=new LayerSize(n);this.Coordinates.Size.Width=i.Width;this.Coordinates.Size.Height=i.Height;this.Coordinates.SetDomCoordinates(this.Body,!0)};EditorFloorElement.InheritsFrom(ElementBase);EditorFloorElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.ForPrinting=n.getAttribute("for_printing")=="true";this.IsScrollable=n.getAttribute("is_scrollable")=="true";this.IsEmailTemplate=n.getAttribute("is_emailtemplate")=="true";t=function(n){return n};this.ForPrinting?(this.PaperWidth=n.getAttribute("paper_width")*1,this.PaperHeight=n.getAttribute("paper_height")*1,this.Margins=40,i=n.getAttribute("absposunit")=="Millimeters",this.AbsPosConversion={FromPixels:i?MillimetersFromPixels:t,ToPixels:i?MillimetersToPixels:t,Unit:i?"Millimeters":null}):(this.Margins=0,this.AbsPosConversion={FromPixels:t,ToPixels:t,Unit:null});this.IsFloor=!0;this.IsCssDivider=!0};EditorFloorElement.prototype.DropElementOnMe=function(n,t,i,r){var u=this.AbsPosConversion?this.AbsPosConversion.FromPixels:null,f=this.AbsPosConversion?this.AbsPosConversion.Unit:null;ElementBase.prototype.DropElementOnMe.call(this,n,t,i,r,u,f)};EditorFloorElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t,i;AddCssClass(n,"EditorFloor");AddCssClass(n,"PublicPage");this.IsEmailTemplate&&AddCssClass(n,"EmailTemplateWorkspace");n.style.left=this.Margins+"px";n.style.top=this.Margins+"px";this.ForPrinting&&(t=MillimetersToPixels(this.PaperWidth),i=MillimetersToPixels(this.PaperHeight),n.style.width=t+"px",n.style.height=i+"px",AddCssClass(n,"EditorPaper"),this.IsScrollable||AddCssClass(n,"EditorNoOverflow"));n.id=this.Id;this.Parent.GetBodyElement().appendChild(n);this.IsDesignMode&&this.SetTransparentOverlay()};EditorFloorElement.prototype.GetCanvas=function(){return this.Canvas};EditorFloorElement.prototype.SetTransparentOverlay=function(){var n,t;this.RemoveOverlay();this.Overlay=this.CreateOverlay();n=CreateImage(GraphicsBasePath+"transparent.png");n.style.width="100%";n.style.height="100%";this.Overlay.appendChild(n);t=this.Parent.GetBodyElement();this.Parent.GetBodyElement().appendChild(this.Overlay)};EditorFloorElement.prototype.CreateOverlay=function(){this.RemoveOverlay();var n=document.createElement("div");return n.style.position="absolute",n.id=this.Id+"_overlay",n.style.top="0px",n.style.left="0px",n.style.width="100%",n.style.height="100%",n};EditorFloorElement.prototype.CleanUp=function(){this.RemoveOverlay()};EditorFloorElement.prototype.RemoveOverlay=function(){this.Overlay&&(this.Overlay.parentNode.removeChild(this.Overlay),this.Overlay=null)};EditorFloorElement.prototype.DnDHoverIn=function(){this.IsHovered=!0};EditorFloorElement.prototype.DnDHoverOut=function(){this.IsHovered=!1};ColorTemplateElement.InheritsFrom(TemplateElement);ColorTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);this.Color=new Color(n.getAttribute("color"),"ffffff")};ColorTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;n.style.position="absolute";n.style.top="0px";n.style.left="0px";n.style.width="100%";n.style.height="100%";n.style.backgroundColor=this.Color.Code();n.ondragstart!=="undefined"&&(document.ondragstart=function(n){return n&&(n.defaultPrevented=!0),!1});this.Body=n;this.Floor.GetBodyElement().appendChild(n)};ColorTemplateElement.prototype.SetColor=function(n){this.Color=n;this.Body.style.backgroundColor=n};ColorTemplateElement.prototype.HighlightOn=function(){};ColorTemplateElement.prototype.HighlightOff=function(){};FormTemplateElement.InheritsFrom(TemplateElement);FormTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);this.ResizableVertical=!0;this.ResizableHorizontal=!1};FormTemplateElement.prototype.SetColor=function(n){var t=this.GetMyWindow();t.BodyColorNode.style.backgroundColor=n};FormTemplateElement.prototype.GetMyWindow=function(){var t=null,n;if(this.MyWindow)t=this.MyWindow;else{for(n=this.FirstChild;n;){if(n.IsWindow){t=n;break}n=n.NextSibling}this.MyWindow=t}return t};FormTemplateElement.prototype.GetModificatorCoordinates=function(){var t=this.GetMyWindow(),n=TemplateElement.prototype.GetModificatorCoordinates.call(this);return n.Position.MoveIncrementally(0,t.GetBodyTopOffset()),n};FormTemplateElement.prototype.AdjustCoordinatesBeforeUpdate=function(n){var t=this.GetMyWindow();n.Position.Y-=t.GetBodyTopOffset()};FormTemplateElement.prototype.OnResize=function(){var n=this.GetMyWindow(),t=n.GetInnerSize();this.Coordinates.Size.Width=t.Width;this.Coordinates.SetDomCoordinates(this.Body,!0,!0);n.AdjustSize(this.Coordinates.Size);TemplateElement.prototype.OnResize.call(this)};FormTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;AddCssClass(n,"FormBody");this.Floor.GetBodyElement().appendChild(n);this.Body=n};FormTemplateElement.prototype.PostInitialized=function(){var n=this.GetMyWindow();if(!n)throw new Error("The form does not have a window");n.SetBodyTransparency(this.Transparency);this.OnResize()};ImageTemplateElement.InheritsFrom(TemplateElement);ImageTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);this.Image=new ImageProperty(n)};ImageTemplateElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body);TemplateElement.prototype.OnResize.call(this)};ImageTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;n.style.position="absolute";this.Body=n;this.Floor.GetBodyElement().appendChild(n);AddCssClass(n,this.Name);this.Coordinates.ConvertToUnits(this.Floor.AbsPosConversion.ToPixels);this.Image.FileDefined?this.CreateImage(n):this.CreateDefaultImage(n);SetTransparency(this.Body,this.Transparency);this.Coordinates.SetDomCoordinates(this.Body)};ImageTemplateElement.prototype.CreateImage=function(n){var t=CreateImage(this.Image.Url);t.style.position="absolute";t.style.top="0px";t.style.left="0px";t.style.width=this.Coordinates.Size.Width+"px";t.style.height=this.Coordinates.Size.Height+"px";n.appendChild(t)};ImageTemplateElement.prototype.CreateDefaultImage=function(n){var t=CreateImage(GraphicsBasePath+"backgrounds/dark_bright.png");t.style.position="absolute";t.style.top="0px";t.style.left="0px";t.style.width="100%";t.style.height="100%";SetOpacity(t,5);n.appendChild(t)};TextTemplateElement.InheritsFrom(TemplateElement);TextTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);this.Html=FullTrim(GetCDataValue(n,"Html"));this.ResizableVertical=!0;this.ResizableHorizontal=!0};TextTemplateElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body);TemplateElement.prototype.OnResize.call(this)};TextTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;this.Body=n;this.Floor.GetBodyElement().appendChild(n);AddCssClass(n,"HtmlContent");n.innerHTML=this.IsDesignMode&&(this.Html.length==0||this.Html=="<p>")?"...":this.Html;AddCssClass(n,"HtmlBody_Absolute");SetTransparency(this.Body,this.Transparency);this.Coordinates.SetDomCoordinates(this.Body)};BackgroundTemplateElement.InheritsFrom(ImageTemplateElement);BackgroundTemplateElement.prototype.HighlightOn=function(){var t=this.GetBodyElement(),n=document.createElement("div");n.style.position="absolute";n.style.top="0px";n.style.left="0px";n.style.height="100%";n.style.width="100%";n.style.backgroundColor="green";SetOpacity(n,2);t.appendChild(n);this.Highlight=n};BackgroundTemplateElement.prototype.HighlightOff=function(){this.Highlight.parentNode.removeChild(this.Highlight);this.Highlight=null};QrCodeTemplateElement.InheritsFrom(TemplateElement);QrCodeTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);this.Data=n.getAttribute("data")};QrCodeTemplateElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body);TemplateElement.prototype.OnResize.call(this)};QrCodeTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;n.style.position="absolute";this.Body=n;this.Floor.GetBodyElement().appendChild(n);AddCssClass(n,this.Name);this.Coordinates.ConvertToUnits(this.Floor.AbsPosConversion.ToPixels);this.CreateImage(n);SetTransparency(this.Body,this.Transparency);this.Coordinates.SetDomCoordinates(this.Body)};QrCodeTemplateElement.prototype.CreateImage=function(n){var i=this.Coordinates.Size,t=CreateImage("/qr?data="+this.Data);t.style.position="absolute";t.style.top="0px";t.style.left="0px";t.style.width=this.Coordinates.Size.Width+"px";t.style.height=this.Coordinates.Size.Height+"px";n.appendChild(t)};ColorPickerHelper.prototype.Close=function(){this.Modal.Close();this.SaveCallback(this.Color)};ColorPickerHelper.prototype.UpdateColor=function(n){this.Color=n;this.ChangeCallback.call(this,n)};ColorPickerHelper.prototype.Build=function(){var n=this,t=BRIX.CreateModal({BodyBuilder:function(t){n.BodyBuilder(t)},FooterBuilder:function(t){n.FooterBuilder(t)},Size:"small",Closeable:!0});t.Open();this.Modal=t};ColorPickerHelper.prototype.BodyBuilder=function(n){var t=this,i=GetNewId();content=$('<p id="'+i+'" style="display:inline-block"><\/div><input type="text" value="#'+this.Color+'" class="form-control" />');n.appendChild(content[0]);window.setTimeout(function(){var n=$("#"+i);n.colorpicker({customClass:"colorpicker-2x",sliders:{saturation:{maxLeft:200,maxTop:200},hue:{maxTop:200},alpha:{maxTop:200}},container:!0,inline:!0,format:"hex"});n.colorpicker().on("changeColor",function(n){t.Color=n.color.toHex();t.ChangeCallback(t.Color)});t.Picker=n},10)};ColorPickerHelper.prototype.FooterBuilder=function(n){var r=this,i=document.createElement("button"),t;AddCssClass(i,"btn");i.appendChild(ActiveIconArchive.Get(UndoIconName).Create());i.onclick=function(){r.Picker.colorpicker("setValue",r.ResetColor)};n.appendChild(i);t=document.createElement("button");AddCssClass(t,"btn btn-primary");t.appendChild(ActiveIconArchive.Get(ConfirmIconName).Create());t.onclick=function(){r.Close()};n.appendChild(t)};FileProperty.prototype.Initialize=function(n){var t=n?n.selectSingleNode("File"):null;t?(this.FileDefined=!0,this.FileName=t.getAttribute("name"),this.Url=t.getAttribute("url"),this.Size=t.getAttribute("size")):(this.FileDefined=!1,this.FileName="",this.Url="",this.Size="")};ImageProperty.InheritsFrom(FileProperty);ImageProperty.prototype.Initialize=function(n){FileProperty.prototype.Initialize.call(this,n);var t=n?n.selectSingleNode("File"):null;t?(this.Width=t.getAttribute("width"),this.Height=t.getAttribute("height"),this.Width=isNaN(this.Width)?0:new Number(this.Width),this.Height=isNaN(this.Height)?0:new Number(this.Height)):(this.Width=0,this.Height=0)};ReportBrowserElement.InheritsFrom(ElementBase);ReportBrowserElement.prototype.GetXmlNodeData=function(n){if(IsDefined(n)&&n.IsJSON===!0&&BRIX.Utilities.MakeXmlNodeCompatible(n),ElementBase.prototype.GetXmlNodeData.call(this,n),this.CurrentSelections=[],n.IsJSON===!0){this.Degeneralize(n);return}this.Title=GetCDataValue(n,"Title");this.GroupsTitle=GetCDataValue(n,"GroupsTitle");this.NoColumns=n.getAttribute("no_columns")=="true";this.AllIsSelected=n.getAttribute("select_all")=="true";this.HideEditButtonsGroup=n.getAttribute("hide_edit_buttons_group")=="true";this.HideMessages=n.getAttribute("hide_messages")=="true";this.IsClosedGroupsPanel=n.getAttribute("group_panel_closed")=="true";this.ReportHasGroups=n.getAttribute("report_has_groups")=="true";var t=n.selectSingleNode("BrowserMacro");t&&(this.BrowserMacro=new MacroElement(this,t.firstChild))};ReportBrowserElement.prototype.Degeneralize=function(n){this.Title=n.Title;this.GroupsTitle=n.GroupsTitle;this.NoColumns=n.no_columns==="true";this.AllIsSelected=n.select_all==="true";this.HideEditButtonsGroup=n.hide_edit_buttons_group==="true";this.HideMessages=n.hide_messages==="true";this.IsClosedGroupsPanel=n.group_panel_closed==="true";this.ReportHasGroups=n.report_has_groups==="true";var t=n.BrowserMacro;t&&(this.BrowserMacro=new MacroElement(this,t))};ReportBrowserElement.prototype.GetValuesAsQuery=function(){};ReportBrowserElement.prototype.IncludeContextParameters=function(n){var t=this.Name?this.Name+"_":"",r,i;if(this.CurrentGroup&&this.CurrentGroup.AddSelectionParameters(n,t),this.CurrentSelections.length>0){function u(n,t){return n.rowIndex<t.rowIndex?-1:n.rowIndex>t.rowIndex?1:0}this.CurrentSelections.sort(u);r=this.CurrentSelections.map(function(n){return n.entryId});i=r.join(",")}else i=this.CurrentSelections.join(",");i.length>0&&n.Update(t+WorkflowValueName.Selections,"[strings]"+i);n.Update(t+WorkflowValueName.SelectAll,""+this.AllIsSelected);n.Update(t+WorkflowValueName.SelectedReportCount,""+ReportCommons.SelectedReportCount)};ReportBrowserElement.prototype.ClearSelections=function(){this.CurrentSelections=[]};ReportBrowserElement.prototype.InitializeMe=function(){this.IsSelectingGroupValue=!1;this.IsSelectingColumnValue=!1;this.ContentHeadHeight=30;this.ContentFootHeight=0;this.GroupsHeadHeight=this.ContentHeadHeight;this.GroupsFootHeight=this.ContentFootHeight;this.GroupHeight=24;this.IsGroupSectionOpen=!1;this.ContentHeadSection=null;this.ContentFootSection=null;this.ContentSection=null;this.TableSection=null;this.FirstGroup=null;this.LastGroup=null;this.CurrentColumnName="";this.BuildBrowserBody();this.BuildContentSection();this.BuildTableSection();this.BrowserMacro.AddClientArgument(WorkflowValueName.ReportId,this.Id);this.BrowserMacro.PerformAction();this.IsClosedGroupsPanel&&this.HideGroups()};ReportBrowserElement.prototype.BuildBrowserBody=function(){var n=document.createElement("div"),t,i;AddCssClass(n,"ReportBody");n.id=this.Id;t=this.FindAncestor(function(n){return n.IsWindow});t&&t.IsDialog()&&(n.style.height=t.MinimumHeight+"px");i=this.Parent.GetBodyElement();i.appendChild(n);this.BrowserBody=n};ReportBrowserElement.prototype.OnToggleGroups=function(){this.GroupsExpanded?(this.HideGroups(),this.CollapseWorkspaceMacro.PerformAction(),this.IsClosedGroupsPanel=!0):(this.ExpandWorkspaceMacro.PerformAction(),this.IsClosedGroupsPanel=!1)};ReportBrowserElement.prototype.GetBodyElement=function(){return this.TableSection};ReportBrowserElement.prototype.RelayedResponse=function(n){var u=this,r=[],t,i;for(this.CurrentCell=null,t=n.firstChild;t!=null;)t.nodeName=="Groups"&&this.InitializeGroups(t),t.nodeName=="UpdateRow"&&this.UpdateRow(t),t.nodeName=="RowContent"?this.LoadRows(t):t.nodeName=="ExpandWorkspace"?this.ExpandWorkspaceMacro=new MacroElement(this,t.firstChild):t.nodeName=="CollapseWorkspace"?this.CollapseWorkspaceMacro=new MacroElement(this,t.firstChild):t.nodeName=="CalendarContent"?this.LoadCalendar(t):t.nodeName=="SubEntries"?this.LoadSubEntries(t):t.nodeName=="AddColumn"?this.AddColumnMacro=new MacroElement(this,t.firstChild):t.nodeName=="AddGroup"?this.AddGroupMacro=new MacroElement(this,t.firstChild):t.nodeName=="OpenEntry"?this.OpenEntryMacro=new MacroElement(this,t.firstChild):t.nodeName=="ExpandEntry"?this.ExpandEntryMacro=new MacroElement(this,t.firstChild):t.nodeName=="ExpandGroup"?this.ExpandGroupMacro=new MacroElement(this,t.firstChild):t.nodeName=="CollapseGroup"?this.CollapseGroupMacro=new MacroElement(this,t.firstChild):t.nodeName=="RemoveGroup"?this.RemoveGroupMacro=new MacroElement(this,t.firstChild):t.nodeName=="NavNext"?this.NavigateNextMacro=new MacroElement(this,t.firstChild):t.nodeName=="Search"?this.OnSearchMacro=new MacroElement(this,t.firstChild):t.nodeName=="SortColumn"?this.SortColumnMacro=new MacroElement(this,t.firstChild):t.nodeName=="ValuePickerMenu"?(this.ValuePickerMenu=new ContextMenu(this,t.firstChild),this.ValuePickerMenu.CreateChildNodes(t.firstChild),this.ValuePickerMenu.InitializeMe(),this.ValuePickerMenu.InitializeChildNodes()):t.nodeName=="MoveColumn"&&(this.MoveColumnMacro=new MacroElement(this,t.firstChild)),t=t.nextSibling;for(i=0;i<r.length;i++)r[i]()};ReportBrowserElement.prototype.AreGroupsEditable=function(){return this.AddGroupMacro||this.RemoveGroupMacro};ReportBrowserElement.prototype.OnAddGroup=function(n,t,i){this.CurrentCell=null;this.IsSelectingGroupValue=!0;this.IsSelectingColumnValue=!1;this.CurrentCoordinates=new Position2D(t,i);this.AddGroupMacro.PerformAction()};ReportBrowserElement.prototype.OnRemoveGroup=function(){this.CurrentCell=null;this.RemoveGroupMacro.PerformAction()};ReportBrowserElement.prototype.OnNavigateNext=function(){var n,t;return this.CurrentCell=null,n=!1,this.NavigateNextMacro&&(this.SelectedGroup&&this.SelectedGroup.AddSelectionArguments(this.NavigateNextMacro),t=this.CalculateNextOffset(),this.NavigateNextMacro.AddClientArgument(WorkflowValueName.Offset,t),this.NavigateNextMacro.PerformAction()&&(n=!0,this.IsLoadingContent=!0)),n};ReportBrowserElement.prototype.CalculateNextOffset=function(){var t=this.NextContentOffset,n;return this.LoadedCategories<=1?n=this.LoadedEntriesTotal:(n=this.LoadedEntriesTotal-this.LoadedEntriesInCategory,n=this.LoadedEntriesInCategory+(this.LoadedCategories-1)*1e6),n};ReportBrowserElement.prototype.OnNavigatePrevious=function(){this.CurrentCell=null;this.SelectedGroup&&this.SelectedGroup.AddSelectionArguments(this.NavigateNextMacro);this.NavigateNextMacro.AddClientArgument(WorkflowValueName.Offset,this.PreviousContentOffset);this.NavigateNextMacro.PerformAction()};ReportBrowserElement.prototype.OnValuePicked=function(n){var t;this.IsSelectingGroupValue?t=this.AddGroupMacro:this.IsSelectingColumnValue&&(t=this.AddColumnMacro,t.AddClientArgument(WorkflowValueName.ElementName,this.CurrentColumnName),this.SelectedGroup&&this.SelectedGroup.AddSelectionArguments(t));t.AddClientArgument(WorkflowValueName.PickedValue,n);t.PerformAction()};ReportBrowserElement.prototype.OnExpandEntry=function(n){this.CurrentCell=null;var i=n.Parameter1,r=n.Parameter2,t=n.Parameter3;t.IsExpanded?(this.CloseSubEntries(t),t.IsExpanded=!1):(t.IsExpanded=!0,this.ExpandEntryMacro.ClearClientArguments(),this.ExpandEntryMacro.AddClientArgument(WorkflowValueName.ReportEntry,i),this.ExpandEntryMacro.AddClientArgument(WorkflowValueName.ReportAdditionalInfo,r),this.ExpandEntryMacro.PerformAction())};ReportBrowserElement.prototype.OnExpandGroup=function(n){this.CurrentGroup=n;this.CurrentCell=null;this.CalendarElement?this.OpenCalendarGroup(n):(this.ExpandGroupMacro.ClearClientArguments(),n.AddSelectionArguments(this.ExpandGroupMacro),this.ExpandGroupMacro.PerformAction())};ReportBrowserElement.prototype.OnCollapseGroup=function(n){var t=n.Parent;IsDefined(t)||(t=this.FirstGroup);this.CurrentGroup=t;this.CurrentCell=null;this.CalendarElement?this.CloseCalendarGroup(n):(this.CollapseGroupMacro.ClearClientArguments(),this.CurrentGroup&&this.CurrentGroup.AddSelectionArguments(this.CollapseGroupMacro),this.CollapseGroupMacro.PerformAction())};ReportBrowserElement.prototype.OnAddColumn=function(n,t,i){this.CurrentCell=null;this.IsSelectingGroupValue=!1;this.IsSelectingColumnValue=!0;this.CurrentColumnName="";this.ValuePickerMenu.CreateMenu(t,i)};ReportBrowserElement.prototype.OnSort=function(n){this.CurrentCell=null;var i=n.currentTarget.ColumnName,t=this.SortColumnMacro;t.AddClientArgument(WorkflowValueName.ElementName,i);this.SelectedGroup&&this.SelectedGroup.AddSelectionArguments(t);t.PerformAction()};ReportBrowserElement.prototype.OnColumnContextMenu=function(n,t,i){return n.currentTarget.ContextMenu&&(this.CurrentCell=null,this.IsSelectingGroupValue=!1,this.IsSelectingColumnValue=!0,this.CurrentColumnName=n.currentTarget.ColumnName,this.CurrentCoordinates=new Position2D(t,i),n.currentTarget.ContextMenu.CreateMenu(t,i)),!1};ReportBrowserElement.prototype.OnOpenEntry=function(n){var t=n.Parameter2;this.CurrentCell=t;this.OpenEntryMacro.AddClientArgument(WorkflowValueName.ReportId,this.Id);this.OpenEntryMacro.AddClientArgument(WorkflowValueName.ReportEntry,"[block]"+n.Parameter1);t&&this.OpenEntryMacro.AddClientArgument(WorkflowValueName.Source,t.Source);this.OpenEntryMacro.AddClientArgument(WorkflowValueName.Offset,this.ContentOffset);this.OpenEntryMacro.PerformAction()};ReportBrowserElement.prototype.GetContextCoordinates=function(){var n,t;return this.CurrentCell?(n=new LayerCoordinates(this.CurrentCell),this.CurrentCoordinates=null):this.CurrentCoordinates?(n={},n.Left=this.CurrentCoordinates.X,n.Top=this.CurrentCoordinates.Y-10,n.Height=20,n.Width=100,n.Bottom=n.Top+n.Height,n.Right=n.Left+n.Width):(t=this.GetBodyElement(),n=new LayerCoordinates(t)),n};ReportBrowserElement.prototype.OnSelectAll=function(){for(var n,u=this.ContentTable.Element,t=u.getElementsByTagName("tr"),r=0,i=0;i<t.length;i++)n=t[i],n.IsSelected||r++,n.CheckIcon&&this.SelectEntry(n);this.AllIsSelected=r==t.length?!0:!1};ReportBrowserElement.prototype.OnSelectEntry=function(n){this.SelectEntry(n.Parameter1)};ReportBrowserElement.prototype.SelectEntry=function(n){var r=n.EntryId,u=n.rowIndex,f="ListRowSelected",i,t;for(n.IsSelected?(n.CheckIcon.ChangeIcon(n.CheckIcon.UncheckedName),RemoveCssClass(n,f),this.AllIsSelected=!1):(this.AllIsSelected=!1,n.CheckIcon.ChangeIcon(n.CheckIcon.CheckedName),AddCssClass(n,f)),n.IsSelected=!n.IsSelected,i=!1,t=0;t<this.CurrentSelections.length;t++)if(this.CurrentSelections[t].entryId==r&&this.CurrentSelections[t].rowIndex==u){this.CurrentSelections.splice(t,1);i=!0;break}i||(this.CurrentSelections[this.CurrentSelections.length]={entryId:r,rowIndex:u})};ReportBrowserElement.prototype.LoadCalendar=function(n){var i=n.firstChild,t=this.CreateInstance(i),r=this.Find(function(n){return n.MyClassName==t.MyClassName});r&&r.Remove();this.AppendChild(t);t.ElementNodeInterface&&t.CreateChildNodes(i);t.Initialize();this.ContentSection.style.visibility="";this.CalendarElement=t};ReportBrowserElement.prototype.OpenCalendarGroup=function(n){var t=n.GetSelectionArray();this.CalendarElement.ApplySubFilter(t)};ReportBrowserElement.prototype.CloseCalendarGroup=function(n){var t=n.GetSelectionArray(!0);this.CalendarElement.ApplySubFilter(t)};ReportBrowserElement.prototype.LoadRows=function(n){this.ColumnSourceIndex={};this.IsEditable=n.getAttribute("editable")=="true";this.ContentOffset=(n.getAttribute("offset")||"0")*1;this.NextContentOffset=(n.getAttribute("next_offset")||"0")*1;this.PreviousContentOffset=(n.getAttribute("previous_offset")||"0")*1;this.IsHiddenGroupToggle=n.getAttribute("hide_group_toggle")=="true";this.ContentOffset===0&&(this.BuildTable(),this.ColumnSettings=this.BuildColumnHeads(n),this.ClearTable());this.ContentSection.style.visibility="";!this.ContentTable;this.BuildContentRows(n,this.ColumnSettings);this.HideWaiting();this.IsLoadingContent=!1;var t=this;window.setTimeout(function(){t.AttemptContinousLoading()},100)};ReportBrowserElement.prototype.OnScroll=function(){var t=this.ContentTable,n;if(t&&t.Header){var r=this.TableSection,u=r.scrollTop,i=t.Header.getElementsByTagName("th");for(n=0;n<i.length;n++)i[n].style.top=u+"px";this.AttemptContinousLoading()}};ReportBrowserElement.prototype.ClearTable=function(){(this.LastEntryId=null,this.RowShiftIndex=0,this.LoadedCategories=0,this.LoadedEntriesTotal=0,this.LoadedEntriesInCategory=0,this.ClearSelections(),this.ContentTable)&&this.ContentTable.Clear()};ReportBrowserElement.prototype.UpdateRow=function(n){var r=n.firstChild,u=r.getAttribute("id"),s=r.getAttribute("additional_id")||"",e=this.Id+"_"+u+"_"+s,i=document.getElementById(e),t,f,o;i&&(i.id=e+"_old",t=this.ContentTable.AddRow(),t.Element.id=e,t.Element.EntryId=u,t.Element.parentNode.removeChild(t.Element),i.parentNode.insertBefore(t.Element,i),i.parentNode.removeChild(i),f=t.AddCell().Element,AddCssClass(f,"ListBrowserControlCell"),this.BuildRowSelectControl(f,u,t.Element),this.HideMessages||(o=r.selectSingleNode("SubCategories"),o&&this.BuildSubCategories(f,o,u,t.Element)),this.BuildColumns(t,r,this.ColumnSettings),t.AddCell())};ReportBrowserElement.prototype.BuildContentRows=function(n,t){for(var r,i,f,l,s,h=n.selectNodes("Rows/Row"),o=0;o<h.length;o++){r=h[o];i=this.ContentTable.AddRow();i.IsCategory=r.getAttribute("category")||!1;var u=r.getAttribute("id")||"",c=r.getAttribute("additional_id")||"",e=u===this.LastEntryId;i.IsChild=e;i.IsTestMode=r.getAttribute("testMode")||"";i.IsTestMode==="true"&&AddCssClass(i.Element,"TestMode");this.LastEntryId=u;e||i.IsCategory||this.RowShiftIndex++;AddCssClass(i.Element,"ListRow");i.IsCategory?(e||(this.LoadedEntriesInCategory=0),this.LoadedCategories++,AddCssClass(i.Element,"CategoryListRow")):(e||(this.LoadedEntriesTotal++,this.LoadedEntriesInCategory++),AddCssClass(i.Element,this.RowShiftIndex%2==1?"EvenListRow":"OddListRow"));i.Element.id=this.Id+"_"+u+"_"+c;i.Element.EntryId=u;f=i.AddCell().Element;i.IsCategory?(l=GetCDataValue(r,"Category"),f.appendChild(document.createTextNode(l)),AddCssClass(f,"ListBrowserCell")):e||(AddCssClass(f,"ListBrowserControlCell"),this.BuildRowSelectControl(f,u,i.Element),this.HideMessages||(s=r.selectSingleNode("SubCategories"),s&&this.BuildSubCategories(f,s,u,c,i.Element)));this.BuildColumns(i,r,t);i.AddCell()}};ReportBrowserElement.prototype.BuildTable=function(){this.ContentTable&&(this.ContentTable.Element.parentNode.removeChild(this.ContentTable.Element),this.ContentTable=null);this.ContentTable=new Table;this.TableSection.appendChild(this.ContentTable.Element)};ReportBrowserElement.prototype.AttemptContinousLoading=function(){var n=this.TableSection,t;if(n){var i=this.ContentTable.Element.clientHeight,r=n.clientHeight,u=n.scrollTop,f=i-(r+u),e=f<20,o=this.NextContentOffset>0;e&&o&&!this.IsLoadingContent&&(this.OnNavigateNext()?this.ShowWaiting():(t=this,window.setTimeout(function(){try{t.AttemptContinousLoading()}catch(n){}},100)))}};ReportBrowserElement.prototype.ShowWaiting=function(){var n=this.WaitingElement;n||(n=new Image,AddCssClass(n,"Spinner"),n.src=LoadingImagePath,this.WaitingElement=n,this.TableSection.appendChild(n))};ReportBrowserElement.prototype.HideWaiting=function(){var n=this.WaitingElement;this.WaitingElement&&(this.WaitingElement.parentNode.removeChild(this.WaitingElement),this.WaitingElement=null)};ReportBrowserElement.prototype.BuildTableSection=function(){var t=document.createElement("div"),n,i;this.GroupsSection=t;this.ContentSection.appendChild(t);n=document.createElement("div");i=this;n.onscroll=function(){i.OnScroll()};this.TableSection&&this.TableSection.parentNode.removeChild(this.TableSection);this.TableSection=n;this.ReportHasGroups?(AddCssClass(t,"col-md-3 col-lg-3"),AddCssClass(n,"col-md-9 col-lg-9"),AddCssClass(t,"ScrollableReportSection")):AddCssClass(n,"col-md-12");AddCssClass(n,"ScrollableReportSection");this.ContentSection.appendChild(this.TableSection)};ReportBrowserElement.prototype.BuildContentSection=function(){var n=document.createElement("div");AddCssClass(n,"ContentRoot");AddCssClass(n,"row");n.style.visibility="hidden";MakeUnselectable(n);this.ContentSection=n;this.BrowserBody.appendChild(this.ContentSection)};ReportBrowserElement.prototype.BuildColumns=function(n,t,i){for(var r,o,f,s,l,h=t.getAttribute("colors"),c=t.selectNodes("Column"),e=0;e<c.length;e++){r=n.AddCell().Element;h&&(f=new Color(h.split(",")[0]),n.Element.style.setProperty("background-color",f.CreateCodeWithAlphaChannel(.5),"important"));var u=c[e],a=u.getAttribute("isnum")=="true",v=u.getAttribute("redundant")=="true";v||(o=GetCDataValue(u,"Value"),r.appendChild(document.createTextNode(o)),AddCssClass(r,"ListBrowserCell"),a&&AddCssClass(r,"NumericCell"),n.IsCategory||(f=i[e].Color,!f.IsTransparent&&o&&(r.style.backgroundColor=f.CreateCodeWithAlphaChannel(.2)),s=u.getAttribute("url"),s?function(n){var t=function(){window.open(n,"_blank")};r.EventTracker=new EventTracking(null,r);r.EventTracker.AddCallbackFunction("click",t)}(s):(r.Source=this.ColumnSourceIndex[u.getAttribute("name")]||"",l=u.getAttribute(WorkflowValueName.ReportEntry)||n.Element.EntryId,r.EventTracker=new EventTracking(null,r),r.EventTracker.AddCallback("click",this,"OnOpenEntry",!0,l,r))))}};ReportBrowserElement.prototype.BuildRowSelectControl=function(n,t,i){var u=UncheckedIcon,f=CheckedIcon,r=ActiveIconArchive.Get(u).Create();r.UncheckedName=u;r.CheckedName=f;r.EventTracker=new EventTracking(null,r);r.EventTracker.AddCallback("click",this,"OnSelectEntry",!0,i);n.appendChild(r);i.CheckIcon=r;AddCssClass(r,"ClickableIcon")};ReportBrowserElement.prototype.BuildSubCategories=function(n,t,i,r,u){var l=this,c=t.getAttribute("isExpandable")=="true"?!0:!1,f,o,s,e,h;for(c&&(f=ActiveIconArchive.Get(ExpandIconName).Create(),f.ExpandName=ExpandIconName,f.CollapseName=CollapseIconName,u.ExpandIcon=f,AddCssClass(f,"ClickableIcon"),f.EventTracker=new EventTracking(null,f),f.EventTracker.AddCallback("click",this,"OnExpandEntry",!1,i,r,n.parentNode),n.appendChild(f)),o=t.selectNodes("Category"),s=function(t){var f=GetCDataValue(t,"Name"),l=(t.getAttribute("count")||"0")*1,e=l>0?" ("+l+")":"",o=ActiveIconArchive.Get(t.getAttribute("icon")).Create(),u,s,r,h,a,c,i;o.title=f+e;u=null;s=t.getAttribute("aug_icon");s&&(u=ActiveIconArchive.Get(s).Create(),u.title=f+e);r=null;h=t.getAttribute("additional_icon");h&&(a=t.getAttribute("additional_icon_color"),r=ActiveIconArchive.Get(h).Create(),r.title=f+e,r.style.color=a);c=t.getAttribute("icon_color");c&&(o.style.color=c);i=document.createElement("span");i.title=f+e;AddCssClass(i,"IconGroup");i.appendChild(o);u&&i.appendChild(u);r&&i.appendChild(r);n.appendChild(i)},e=0;e<o.length;e++)h=o[e],s(h)};ReportBrowserElement.prototype.BuildColumnHeads=function(n){var l=[],f=this.ContentTable.AddHeaderRow(),r,i,h,e,t,o,s,c,a;for(AddCssClass(f.Element,"FixedHeader"),this.PropertiesColumnHead=f.AddCell().Element,this.PropertiesColumnHead.style.zIndex="1",this.PropertiesColumnHead.style.verticalAlign="middle",this.PropertiesColumnHead.style.paddingTop="0px",this.PropertiesColumnHead.style.paddingBottom="0px",AddCssClass(this.PropertiesColumnHead,"HeaderToolbar"),AddCssClass(this.PropertiesColumnHead,"ColumnHead"),r=ActiveIconArchive.Get("icon-stack-checkmark").Create(),this.PropertiesColumnHead.appendChild(r),AddCssClass(r,"ClickableIcon"),r.style.marginLeft="0px",r.EventTracker=new EventTracking(null,r),r.EventTracker.AddCallback("click",this,"OnSelectAll"),this.IsHiddenGroupToggle?(this.HideGroups(),this.CollapseWorkspaceMacro.PerformAction(),this.IsClosedGroupsPanel=!0):(i=ActiveIconArchive.Get(GroupsIconName).Create(),this.ReportHasGroups&&(i.style.color=GREENCOLOR),this.PropertiesColumnHead.appendChild(i),AddCssClass(i,"ClickableIcon"),i.style.marginLeft="0px",i.EventTracker=new EventTracking(null,i),i.EventTracker.AddCallback("click",this,"OnToggleGroups")),h=n.selectNodes("./Columns/Column"),e=0;e<h.length;e++){var u=h[e],v=GetCDataValue(u,"Title"),y=u.getAttribute("name");this.ColumnSourceIndex[y]=u.getAttribute("source");t=f.AddCell().Element;AddCssClass(t,"HeaderToolbar");AddCssClass(t,"ColumnHead");o=document.createElement("span");o.appendChild(document.createTextNode(v));o.style.display="inline-block";t.appendChild(o);s=u.selectSingleNode("./ContextMenu");s&&(t.ContextMenu=new ContextMenu(this,s.firstChild),t.ContextMenu.CreateChildNodes(s.firstChild),t.ContextMenu.InitializeMe(),t.ContextMenu.InitializeChildNodes());c=u.getAttribute("sort");c&&this.AddSortIcon(t,c);t.ColumnName=u.getAttribute("name");this.IsEditable&&(t.draggable=!0);t.parent=this;t.EventTracker=new EventTracking(null,t);t.EventTracker.AddCallback("click",this,"OnColumnContextMenu");a=new Color(u.getAttribute("color"),"transparent");l.push({Color:a})}return this.BuildAppendColumn(f),this.SetupDraggableCols(),l};ReportBrowserElement.prototype.SetupDraggableCols=function(){var n=document.querySelectorAll("[draggable=true]");[].forEach.call(n,function(n){n.addEventListener("dragstart",handleDragStart,!1);n.addEventListener("dragenter",handleDragEnter,!1);n.addEventListener("dragover",handleDragOver,!1);n.addEventListener("dragleave",handleDragLeave,!1);n.addEventListener("drop",handleDrop,!1);n.addEventListener("dragend",handleDragEnd,!1)})};srcDragElem=null;ReportBrowserElement.prototype.BuildAppendColumn=function(n){var t=n.AddCell().Element;AddCssClass(t,"HeaderToolbar");AddCssClass(t,"ColumnHead");t.style.paddingTop="0px";t.style.paddingBottom="0px";t.style.width="100%"};ReportBrowserElement.prototype.AddSortIcon=function(n,t){var r=ActiveIconArchive.Get(t=="ascending"?SortAscendingIcon:SortDescendingIcon),i=r.Create();i.style.marginLeft="5px";n.appendChild(i)};ReportBrowserElement.prototype.LoadSubEntries=function(n){var k=n.getAttribute("entry"),t=document.getElementById(this.Id+"_"+k),o,r,p,u,h,c,f,l,a,v,e,i;if(t.IsExpanded){this.CloseSubEntries(t);o=n.selectNodes("./Entry");t.ExpandIcon.ChangeIcon(t.ExpandIcon.CollapseName);for(var d=t.nextSibling,g=t.parentNode,y=0,s=t.firstChild;s;)y++,s=s.nextSibling;for(r=document.createElement("tr"),r.IsSubEntry=!0,g.insertBefore(r,d),p=document.createElement("td"),r.appendChild(p),u=document.createElement("td"),u.setAttribute("colspan",y-1),AddCssClass(u,"ListReportSubEntries"),r.appendChild(u),h=document.createElement("table"),c=document.createElement("tbody"),h.appendChild(c),u.appendChild(h),f=0;f<o.length;f++){l=document.createElement("tr");c.appendChild(l);var w=o[f],a=null,b=w.selectSingleNode("./EditorMacro");for(b&&(a=new MacroElement(this,b.firstChild)),v=w.selectNodes("./Value"),e=0;e<v.length;e++)i=document.createElement("td"),l.appendChild(i),a&&(AddCssClass(i,"ListBrowserCell"),i.BrowserMacro=a,i.onclick=function(){this.BrowserMacro.PerformAction()}),this.BuildSubEntryValue(i,v[e])}}};ReportBrowserElement.prototype.BuildSubEntryValue=function(n,t){var o=t.getAttribute("type"),f=GetCDataValue(t),i,r,u,e;switch(o){case"string":case"date":n.appendChild(document.createTextNode(f));break;case"icon":i=ActiveIconArchive.Get(f).Create();r=t.getAttribute("color");r&&(i.style.color=r);n.appendChild(i);break;case"element":u=new ElementBase;u.GetBodyElement=function(){return n};e=u.CreateChildNode(t.firstChild);e.Initialize()}};ReportBrowserElement.prototype.CloseSubEntries=function(n){var t,i,r,u;for(n.ExpandIcon.ChangeIcon(n.ExpandIcon.ExpandName),t=n.nextSibling,i=[];t;){if(!t.IsSubEntry)break;i[i.length]=t;t=t.nextSibling}for(r=0;r<i.length;r++)u=i[r],u.parentNode.removeChild(u)};ReportBrowserElement.prototype.InitializeGroups=function(n){var r=n.firstChild==null;if(!r||!0){var t=n.getAttribute("parent"),u=t?t.split(","):[],f=u.pop(),i=this.GetGroup(f);i?this.LoadGroups(i,n):(this.ShowGroupsFold(!0),this.ClearGroups(),this.GroupsTableSection=this.GroupsSection,this.BuildGroupsFootSection(this.GroupsTableSection),this.LoadGroups(this,n));this.IsClosedGroupsPanel&&this.HideGroups()}};ReportBrowserElement.prototype.ShowGroupsFold=function(n){n?(RemoveCssClass(this.GroupsSection,"col-md-3"),RemoveCssClass(this.GroupsSection,"col-lg-3"),RemoveCssClass(this.GroupsSection,"ScrollableReportSection"),RemoveCssClass(this.TableSection,"col-md-9"),RemoveCssClass(this.TableSection,"col-lg-9"),AddCssClass(this.GroupsSection,"col-md-3 col-lg-3"),RemoveCssClass(this.TableSection,"col-md-12"),AddCssClass(this.TableSection,"col-md-9 col-lg-9")):(RemoveCssClass(this.GroupsSection,"col-md-3"),RemoveCssClass(this.GroupsSection,"col-lg-3"),RemoveCssClass(this.GroupsSection,"ScrollableReportSection"),RemoveCssClass(this.TableSection,"col-md-9"),RemoveCssClass(this.TableSection,"col-lg-9"),AddCssClass(this.TableSection,"col-md-12"))};ReportBrowserElement.prototype.HideGroups=function(){this.ClearGroups();this.ShowGroupsFold(!1)};ReportBrowserElement.prototype.LoadGroups=function(n,t){var f,i,r,e,u;for(this.GroupsExpanded=!0,f=n.GroupsTableSection,i=t.selectNodes("Group"),n!=this&&i.length>0&&(n.Expanded=!0),r=0;r<i.length;r++)e=i[r],u=this.BuildGroup(e),n.AddGroup(u),u.Build(),f.appendChild(u.Body)};ReportBrowserElement.prototype.ClearGroups=function(){var n,t;for(this.GroupsExpanded=!1,this.FirstGroup=null,this.LastGroup=null,n=this.GroupsTableSection?this.GroupsTableSection.firstChild:null;n;)t=n.nextSibling,n.parentNode.removeChild(n),n=t};ReportBrowserElement.prototype.GetGroup=function(n){for(var i=null,t=this.FirstGroup;t;){if(t.Id==n){i=t;break}if(i=t.GetGroup(n),i)break;t=t.NextSibling}return i};ReportBrowserElement.prototype.AddGroup=function(n){this.LastGroup?(n.PreviousSibling=this.LastGroup,this.LastGroup.NextSibling=n):this.FirstGroup=n;this.LastGroup=n};ReportBrowserElement.prototype.BuildGroup=function(n){return new ListGroup(this,n,this.GroupHeight)};ListGroup.prototype.Build=function(){this.Body=document.createElement("div");AddCssClass(this.Body,"ReportGroupRoot");this.ContentSection=document.createElement("div");this.Body.appendChild(this.ContentSection);this.InitializeContent();this.GroupsTableSection=document.createElement("div");this.Body.appendChild(this.GroupsTableSection);this.InitializeEvents()};ListGroup.prototype.AppendChild=AppendChild;ListGroup.prototype.RemoveChild=RemoveChild;ListGroup.prototype.MakeSelected=function(){this.Browser.SelectedGroup&&this.Browser.SelectedGroup.MakeDeselected();this.Browser.SelectedGroup=this;AddCssClass(this.ContentSection,"ListRowSelected");ReportCommons.SelectedReportCount=this.Count};ListGroup.prototype.MakeDeselected=function(){RemoveCssClass(this.ContentSection,"ListRowSelected");this.Browser.SelectedGroup=null};ListGroup.prototype.InitializeContent=function(){AddCssClass(this.ContentSection,"ListRow");AddCssClass(this.ContentSection,"Content");this.CreateIndention();var n=document.createElement("span");n.appendChild(document.createTextNode("("+this.Count+") "+this.Title));this.TitleSection=n;this.ContentSection.appendChild(n);this.Expandable&&this.SetIcon(this.CollapsedIconName)};ListGroup.prototype.InitializeEvents=function(){this.EventTracker=new EventTracking(null,this.ContentSection);this.EventTracker.AddCallback("click",this,"OnToggleExpansion")};ListGroup.prototype.OnToggleExpansion=function(){this.MakeSelected();this.FirstGroup&&this.Expandable?(this.ClearGroups(),this.Browser.OnCollapseGroup(this),this.SetIcon(this.CollapsedIconName)):(this.Expandable&&this.SetIcon(this.ExpandedIconName),this.Browser.OnExpandGroup(this))};ListGroup.prototype.CreateIndention=function(){for(var t=0,i=this.Parent,n;i;)t++,i=i.Parent;t>0&&(n=document.createElement("div"),AddCssClass(n,"Indent"),AddCssClass(n,"Indent"+t),this.ContentSection.appendChild(n))};ListGroup.prototype.SetIcon=function(n){this.Icon&&this.Icon.parentNode.removeChild(this.Icon);this.IconControl=ActiveIconArchive.Get(n,this.IconSize);this.Icon=this.IconControl.Create(null,!1,!0);this.Icon.style.marginRight="10px";this.ContentSection.insertBefore(this.Icon,this.TitleSection)};ListGroup.prototype.ClearGroups=function(){var n,t;for(this.FirstGroup=null,this.LastGroup=null,n=this.GroupsTableSection.firstChild;n;)t=n.nextSibling,n.parentNode.removeChild(n),n=t};ListGroup.prototype.AddSelectionArguments=function(n){for(var i=this.GetSelectionArray(),t=0;t<i.length;t++)n.AddClientArgument(i[t].Key,i[t].Value)};ListGroup.prototype.AddSelectionParameters=function(n,t){for(var u,r=this.GetSelectionArray(),i=0;i<r.length;i++)u=t+r[i].Key,n.ContainsKey(u)||n.Add(t+r[i].Key,r[i].Value)};ListGroup.prototype.GetSelectionArray=function(n){var u=function(n,t){this.Key=n;this.Value=encodeURIComponent(t)},i=[],t,r;for(i.push(new u("group_id",this.Id)),t=this,r=0;t;)r++,t=t.Parent;for(t=this;t;)r--,i.push(new u("group_name_"+r,t.Name)),i.push(new u("group_value_"+r,t.Value)),t=t.Parent;return n&&i.push(new u("group_collapse","true")),i};ListGroup.prototype.AddGroup=function(n){n.Parent=this;this.LastGroup?(n.PreviousSibling=this.LastGroup,this.LastGroup.NextSibling=n):this.FirstGroup=n;this.LastGroup=n};ListGroup.prototype.GetGroup=function(n){for(var i=null,t=this.FirstGroup;t;){if(t.Id==n){i=t;break}else if(i=t.GetGroup(n),i)break;t=t.NextSibling}return i};ReportBrowserElement.prototype.BuildGroupsFootSection=function(n){var t=document.createElement("div");AddCssClass(t,"ColumnHead");this.GroupsFootSection=t;n.appendChild(this.GroupsFootSection);this.HideEditButtonsGroup||this.AreGroupsEditable()&&(this.BuildAddGroupButton(),this.BuildRemoveGroupButton())};ReportBrowserElement.prototype.BuildAddGroupButton=function(){var n=this.BuildGroupButton(AddIconName,"OnAddGroup",!0,!1);this.AddGroupButton=n};ReportBrowserElement.prototype.BuildRemoveGroupButton=function(){var n=this.BuildGroupButton(RemoveIconName,"OnRemoveGroup",!1,!0);this.AddGroupButton=n};ReportBrowserElement.prototype.BuildGroupButton=function(n,t,i,r){var f=5,e=ActiveIconArchive.Get(n),u=e.Create();return AddCssClass(u,"ClickableIcon"),r&&(u.style.position="absolute",u.style.top=f+"px",u.style.right=f*2+"px"),this.GroupsFootSection.appendChild(u),u.EventTracker=new EventTracking(null,u),u.EventTracker.AddCallback("click",this,t),u};DashboardElement.InheritsFrom(ElementBase);DashboardElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};DashboardElement.prototype.InitializeMe=function(){this.RemoveOldElements();this.BuildRootElement();this.BuildPrimaryNavigatorArea();this.Root.appendNewElementIdClass("div","WrapperSecondaryNavigatorWorkspace","Wrapper");this.Root.WrapperSecondaryNavigatorWorkspace.appendNewElementIdClass("div","WrapperSecondaryNavigator","");this.Root.WrapperSecondaryNavigatorWorkspace.WrapperSecondaryNavigator.appendNewElementIdClass("div","SecondaryNavigator","SecondaryNavigator");this.SecondaryNavigatorBody=this.Root.WrapperSecondaryNavigatorWorkspace.WrapperSecondaryNavigator.SecondaryNavigator;this.Root.WrapperSecondaryNavigatorWorkspace.appendNewElementIdClass("div","WrapperButtonCollapse","Wrapper");this.Root.WrapperSecondaryNavigatorWorkspace.WrapperButtonCollapse.appendNewElementIdClass("button","ButtonCollapse","ButtonCollapse icon-arrow-left");this.SettingsCollapseButton(this.Root.WrapperSecondaryNavigatorWorkspace.WrapperButtonCollapse.ButtonCollapse);this.BuildWorkspace()};DashboardElement.prototype.SettingsCollapseButton=function(n){n.setAttribute("toggle","true");n.addEventListener("click",function(){$("#SecondaryNavigator").toggleClass("active");$("#WorkspaceContainer").toggleClass("active");$("#ButtonCollapse").toggleClass("active");$("#ButtonCollapse").toggleClass("icon-arrow-left");$("#ButtonCollapse").toggleClass("icon-arrow-right-2")})};DashboardElement.prototype.RemoveOldElements=function(){var n=document.getElementById("DashboardContainer");n&&n.parentNode.removeChild(n)};DashboardElement.prototype.BuildRootElement=function(){var i=this.Parent.GetBodyElement(),n=document.createElement("div"),t;n.id="DashboardContainer";AddCssClass(n,"container-fluid");t=document.createElement("div");AddCssClass(t,"row");i.appendChild(n);n.appendChild(t);this.Root=t};DashboardElement.prototype.BuildPrimaryNavigatorArea=function(){var t=document.createElement("div"),n;AddCssClass(t,"PrimaryNavigator col-sm-12");this.PrimaryNavigatorBody=t;this.Root.appendChild(t);n=document.createElement("div");AddCssClass(n,"UserControlContainer");this.Root.appendChild(n);this.UserControlBody=n};DashboardElement.prototype.BuildWorkspace=function(){this.BuildWorkspaceContainer();this.BuildWorkspaceToolbarArea();this.BuildWorkspaceBody()};DashboardElement.prototype.BuildWorkspaceContainer=function(){var n=document.createElement("div");n.id="WorkspaceContainer";AddCssClass(n,"WorkspaceContainer col-md-9 col-sm-9 col-xs-12");this.WorkspaceContainer=n;this.Root.WrapperSecondaryNavigatorWorkspace.appendChild(n)};DashboardElement.prototype.BuildWorkspaceToolbarArea=function(){var n=document.createElement("div");AddCssClass(n,"WorkspaceToolbar");this.ToolbarBody=n;this.WorkspaceContainer.appendChild(n)};DashboardElement.prototype.BuildWorkspaceBody=function(){var t=document.createElement("div"),n;AddCssClass(t,"WorkspaceFold");this.WorkspaceFold=t;this.WorkspaceContainer.appendChild(t);n=document.createElement("div");AddCssClass(n,"WorkspaceBody");this.WorkspaceBody=n;this.Body=n;this.WorkspaceContainer.appendChild(n);this.ShowWorkspaceFold(!1)};DashboardElement.prototype.GetBodyElement=function(n){return n?n.IsWorkspaceFold?this.WorkspaceFold:this.WorkspaceBody:this.WorkspaceBody};DashboardElement.prototype.ShowWorkspaceFold=function(n){this.RemoveWorkspaceFoldContent();AddCssClass(this.WorkspaceFold,n?"FoldExpanded":"FoldCollapsed");AddCssClass(this.WorkspaceBody,n?"BodyCollapsed":"BodyExpanded");RemoveCssClass(this.WorkspaceFold,n?"FoldCollapsed":"FoldExpanded");RemoveCssClass(this.WorkspaceBody,n?"BodyExpanded":"BodyCollapsed")};DashboardElement.prototype.AppendToWorkspaceFold=function(n){n.Parent!=this&&this.AppendChild(n);n.IsWorkspaceFold=!0;n.Initialize()};DashboardElement.prototype.ReplaceWorkspaceFold=function(n){var i,t;if(this.ShowWorkspaceFold(!0),this.RemoveWorkspaceFoldContent(),n)for(i=this.CreateChildNodes(n),t=0;t<i.length;t++)this.AppendToWorkspaceFold(i[t]);this.OnResize()};DashboardElement.prototype.RemoveWorkspaceFoldContent=function(){for(var n=this.FirstChild,t;n;)t=n.NextSibling,n.IsWorkspaceFold&&n.Remove(),n=t;for(n=this.WorkspaceFold.firstChild;n;)t=n.nextSibling,this.WorkspaceFold.removeChild(n),n=t};DashboardElement.prototype.ReplaceWorkspace=function(n){this.RemoveWorkspaceElement();var t=this.CreateChildNode(n);return t.IsDashboardElement&&ThrowException("Cannot be a dashboard element"),t.Initialize(),this.OnResize(),t};DashboardElement.prototype.ReplaceToolbar=function(n){this.RemoveToolbarElement();var t=this.CreateChildNode(n);return t.IsToolbarElement||ThrowException("Element must be a toolbar"),t.Initialize(),this.OnResize(),t};DashboardElement.prototype.RemoveToolbarElement=function(){for(var n=this.FirstChild,t;n;)t=n.NextSibling,n.IsToolbarElement&&n.Remove(),n=t};DashboardElement.prototype.ClearWorkspace=function(){this.RemoveToolbarElement();this.RemoveWorkspaceElement()};DashboardElement.prototype.RemoveWorkspaceElement=function(){for(var n=this.FirstChild,t;n;)t=n.NextSibling,n.IsDashboardElement||(n.AssociatedMacroKey&&window.CurrentMacroCallbackIndex.CancelMacroByInstance(n.AssociatedMacroKey),n.Remove()),n=t};ToolbarElement.InheritsFrom(ElementBase);ToolbarElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.IsFoldable=n.getAttribute("foldable")=="true";this.IsFoldable&&(this.IsFolded=n.getAttribute("folded")=="true",this.ExpandButton=this.CreateChildNode(n.selectSingleNode("./OnExpandMacro").firstChild),this.CollapseButton=this.CreateChildNode(n.selectSingleNode("./OnCollapseMacro").firstChild))};ToolbarElement.prototype.AddButton=function(n){var t=this.BuildButtonWrapper(n.Body);this.Body.appendChild(t)};ToolbarElement.prototype.BuildButtonWrapper=function(n){return n};ToolbarElement.prototype.InitializeMe=function(){var n=this.Parent.ToolbarBody||this.GetParentBody();this.BuildButtonsArea(n);this.IsFoldable&&(this.BuildFoldSpace(),this.SetFolded(this.IsFolded));this.BuildGraphics()};ToolbarElement.prototype.BuildGraphics=function(){this.FirstChild?(AddCssClass(this.Body,"btn-group"),AddCssClass(this.Body,"Toolbar"),RemoveCssClass(this.Body,"HiddenToolbar")):(RemoveCssClass(this.Body,"btn-group"),AddCssClass(this.Body,"HiddenToolbar"),RemoveCssClass(this.Body,"Toolbar"))};ToolbarElement.prototype.BuildButtonsArea=function(n){var t=document.createElement("div");t.id=this.Id;this.Body=t;n.appendChild(t)};ToolbarElement.prototype.OnExpand=function(){this.SetFolded(!0)};ToolbarElement.prototype.OnCollapse=function(){this.SetFolded(!1)};ToolbarElement.prototype.SetFolded=function(n){this.IsFolded=n;n?AddCssClass(this.Body,"FoldedSpace"):RemoveCssClass(this.Body,"FoldedSpace");this.ExpandButton.SetVisibilty(!this.IsFolded);this.CollapseButton.SetVisibilty(this.IsFolded)};ToolbarElement.prototype.BuildFoldSpace=function(){var n=document.createElement("div");AddCssClass(n,"FoldSpace");this.FoldSpace=n};ToolboxEntryElement.InheritsFrom(ElementBase);ToolboxEntryElement.prototype.GetXmlNodeData=function(n){this.IsSelected=!1;this.IsToolboxElement=!0;this.IsDashboardElement=!0;ElementBase.prototype.GetXmlNodeData.call(this,n);this.Icon=ActiveIconArchive.GetFromNode(n);var t=n.selectSingleNode("ColorIndicator");this.ColorIndicator=t?new Color(t.getAttribute("color"),"000000"):null;this.Selectable=n.getAttribute("selectable")=="true";this.IsHeadline=n.getAttribute("headline")=="true";this.IsSelected=n.getAttribute("selected")=="true";this.LeadsBackward=n.getAttribute("leads_backward")=="true";this.LeadsForward=n.getAttribute("leads_forward")=="true";this.Caption=GetCDataValue(n,"Caption");this.Indent=n.getAttribute("indentation")>=0?n.getAttribute("indentation"):0;this.ScrollInto=n.getAttribute("scroll_into_listoption")};ToolboxEntryElement.prototype.InitializeMe=function(){var n,f,i,t,r,u;if(this.IsHeadline?(n=document.createElement("div"),AddCssClass(n,"ToolboxEntryHead")):n=document.createElement("a"),AddCssClass(n,"ToolboxEntry"),this.IsSelected?AddCssClass(n,"SelectedToolboxEntry"):AddCssClass(n,"UnselectedToolboxEntry"),this.LeadsBackward&&AddCssClass(n,"LeadsBackward"),this.LeadsForward&&AddCssClass(n,"LeadsForward"),n.id=this.Id,f=this.GetParentBody(),f.appendChild(n),this.Body=n,n.style.marginLeft=this.Indent+"px",this.IsHeadline?n.appendChild(this.CreateCaption()):(this.InsertIcon(),n.appendChild(this.CreateCaption())),this.ColorIndicator&&(this.ColorBox=this.CreateColorBox(),n.appendChild(this.ColorBox)),this.EventTracker=new EventTracking(null,n),this.IsHeadline||this.EventTracker.AddCallback("click",this,"OnClicked"),this.ContextMenu&&this.BuildContextMenu(),this.ScrollInto!==null){for(i=!1,t=this;!i&&t!==null;)t=t.Parent,t!==null&&(i=t.MyClassName=="ContainerColumnElement"?!0:!1);r=t!==null?t.GetDescendantByName(this.ScrollInto):null;r!==null&&(u=document.getElementById(r.Id),u!==null&&u.scrollIntoView({block:"center"}))}};ToolboxEntryElement.prototype.BuildContextMenu=function(){var n=document.createElement("div"),t,i;AddCssClass(n,"MenuControl");t=this.ContextMenu.Icon?this.ContextMenu.Icon:ActiveIconArchive.Get("icon-cog");i=t.Create();n.appendChild(i);n.EventTracker=new EventTracking(null,n);this.Body.appendChild(n);n.EventTracker.AddCallback("click",this,"ShowContextMenu",!0)};ToolboxEntryElement.prototype.InsertIcon=function(){if(this.Icon!=null){var n=this.Icon.Create(null,!1,!0);n.style.margin="5px";this.Body.appendChild(n)}};ToolboxEntryElement.prototype.BeforeDestroyed=function(){this.IsSelected&&this.Deselect()};ToolboxEntryElement.prototype.OnClicked=function(){this.Events.CallEvent("onclick");this.Selectable&&this.ToggleSelection()};ToolboxEntryElement.prototype.ToggleSelection=function(){this.IsSelected?this.Deselect():this.Select()};ToolboxEntryElement.prototype.SetColor=function(n){this.ColorBox.style.backgroundColor=n};ToolboxEntryElement.prototype.Select=function(){this.ColorIndicator||this.IsSelected||(AddCssClass(this.Body,"SelectedToolboxEntry"),RemoveCssClass(this.Body,"UnselectedToolboxEntry"),this.IsSelected=!0,this.DeselectSiblings(),this.Events.CallEvent("onselect"))};ToolboxEntryElement.prototype.Deselect=function(){this.IsSelected&&(AddCssClass(this.Body,"UnselectedToolboxEntry"),RemoveCssClass(this.Body,"SelectedToolboxEntry"),this.IsSelected=!1,this.Events.CallEvent("ondeselect"))};ToolboxEntryElement.prototype.DeselectSiblings=function(){for(var n=this.Parent.FirstChild,t,i;n;)t=n.MyClassName==this.MyClassName,i=n.Id==this.Id,t&&!i&&n.Deselect(),n=n.NextSibling};ToolboxEntryElement.prototype.CreateColorBox=function(){var n=document.createElement("div");return AddCssClass(n,"ColorBox"),n.style.backgroundColor=this.ColorIndicator.Code(),n.style.marginLeft="10px",n};ToolboxEntryElement.prototype.CreateCaption=function(){var n=document.createElement("span");return n.appendChild(document.createTextNode(this.Caption)),n};ToolboxEntryElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};UserControlElement.InheritsFrom(ElementBase);UserControlElement.prototype.GetXmlNodeData=function(n){var t;t=n.selectSingleNode("UpdaterMacro");this.UpdaterMacro=t?new MacroElement(this,t.firstChild):null;this.Name=n.getAttribute("name");this.PendingTickets=n.getAttribute("pending_tickets");this.UserIcon=ActiveIconArchive.Get("icon-user")};UserControlElement.prototype.RelayedResponse=function(n){var i=n.getAttribute("cases"),t,r;i!=this.PendingTickets&&(this.PendingTickets=i,this.CounterBody&&this.CounterBody.parentNode.removeChild(this.CounterBody),t=document.createElement("span"),this.CounterBody=t,AddCssClass(t,"Counter"),t.appendChild(document.createTextNode(i)),this.ContentBody.appendChild(t),r=this.GetDescendantByName("support"),r.SetCounter&&r.SetCounter(i))};UserControlElement.prototype.InitializeMe=function(){var f=this.Parent.UserControlBody,n=document.createElement("div"),t,e,r,i,u;this.Body=n;f.appendChild(n);AddCssClass(n,"UserControlBody");e=this;r=function(n,t,i){var u=document.createElement("span"),r;return u.appendChild(document.createTextNode(t)),AddCssClass(n,"Section"),r=document.createElement("span"),AddCssClass(r,"Content"),n.appendChild(r),r.appendChild(i.Create()),r.appendChild(u),u};t=document.createElement("div");n.appendChild(t);i=r(t,this.Name,this.UserIcon,this.PendingTickets);this.ContentBody=i;this.PopOverContainer=new PopOverContainer(t,i);this.UpdaterMacro&&(u=this.UpdaterMacro,window.setTimeout(function(){u.PerformAction()},100))};BreadcrumbElement.InheritsFrom(ElementBase);BreadcrumbElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Title=GetCDataValue(n,"Title");this.IsSelected=n.getAttribute("selected")=="true";this.IsDisabled=n.getAttribute("disabled")=="true";this.IsEndOfPath=n.getAttribute("endofpath")=="true";this.Icon=ActiveIconArchive.GetFromNode(n)};BreadcrumbElement.prototype.BuildMessageContainer=function(){var n=document.createElement("div"),t;return AddCssClass(n,"InvalidElementMessageContainer"),AddCssClass(n,"Breadcrumb"),this.MessageContainer=n,t=new LayerCoordinates(this.Body),n.style.top=t.Top-20+"px",n.style.left=t.Left+"px",n.style.height=t.Height+"px",document.body.appendChild(n),n};BreadcrumbElement.prototype.InitializeMe=function(){var n=document.createElement("li"),t=document.createElement("a"),i,r,u;t.appendChild(document.createTextNode(this.Title));this.Title||this.Parent.Integrated||(i=new Image,i.src=GraphicsBasePath+"axaco_air.png",t.appendChild(i));n.appendChild(t);this.IsSelected?AddCssClass(n,"Active"):this.NextSibling&&!this.NextSibling.NextSibling&&AddCssClass(n,"Previous");this.IsEndOfPath&&(AddCssClass(n,"EndOfPath"),BreadcrumbElement.prototype.totalListWidth());this.IsDisabled&&(AddCssClass(n,"Disabled"),BreadcrumbElement.prototype.totalListWidth());n.id=this.Id;this.Body=n;this.Icon&&(r=this.Icon.Create(),this.Title&&(r.style.marginRight="5px"),n.appendChild(r));u=this.Parent.GetBodyElement();u.appendChild(n);this.EventTracker=new EventTracking(null,this.Body);this.EventTracker.AddCallback("click",this,"OnSelect");this.EnableInteraction()};BreadcrumbElement.prototype.OnSelect=function(n,t,i){this.IsSelected||this.Events.CallEvent("onselect",t,i)};BreadcrumbElement.prototype.DnDHoverReactionOn=function(){};BreadcrumbElement.prototype.DnDHoverReactionOff=function(){};BreadcrumbNavigatorElement.InheritsFrom(ElementBase);BreadcrumbNavigatorElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Integrated=n.getAttribute("integrated")=="true";this.BreadcrumbHidden=n.getAttribute("breadcrumb_hidden")=="true"};BreadcrumbNavigatorElement.prototype.InitializeMe=function(){var n=document.createElement("div"),r=document.createElement("ul"),i,t;n.appendChild(r);n.id=this.Id;AddCssClass(n,"Breadcrumb");this.Integrated?AddCssClass(n,"IntegratedBreadcrumb"):AddCssClass(n,"StandAloneBreadcrumb");this.BreadcrumbHidden&&AddCssClass(n,"BreadcrumbHidden");AddCssClass(n,"BreadcrumbAnim");i=this.GetLastChildByClass("BreadcrumbElement");i&&i.IsSelected&&AddCssClass(n,"LastBreadcrumbSelected");this.Root=n;this.Body=r;t=this.Parent.PrimaryNavigatorBody||this.Parent.HeaderBody;t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)};NavigatorElement.InheritsFrom(ElementBase);NavigatorElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};NavigatorElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.id=this.Id;AddCssClass(n,"Navigator");this.Body=n;t=this.Parent.NavigatorBody;t.appendChild(n)};NavigatorItem.prototype.Initialize=function(n,t){var r,i;this.Element=n;this.Title=GetCDataValue(t,"Title");this.IsSelected=t.getAttribute("selected")=="true";this.Count=t.getAttribute("count");this.Status=t.getAttribute("status");this.Color=t.getAttribute("color");this.Icon=ActiveIconArchive.GetFromNode(t);this.ClickedOnce=!1;r=t.selectSingleNode("./ContextMenu");r&&(this.ContextMenu=new ContextMenu(n,r),this.ContextMenu.CreateChildNodes(r));i=t.selectSingleNode("./NavigateMacro");i&&(this.SelectContextMacro=new MacroElement(n,i.firstChild));i=t.selectSingleNode("./OnSelectMacro");i&&(this.OnSelectMacro=new MacroElement(n,i.firstChild));this.LoadItems(n,t)};NavigatorItem.prototype.AddItem=NavigatorItemAdd;NavigatorItem.prototype.LoadItems=function(n,t){for(var u,r=t.selectNodes("./NavigatorItem"),i=0;i<r.length;i++)u=new NavigatorItem(n,r[i]),this.AddItem(u)};NavigatorItem.prototype.BuildElement=function(n){var t=document.createElement("div"),e,r,i,o,f,u;for(this.Body=t,e=document.createElement("span"),AddCssClass(e,"Decoration"),t.appendChild(e),r=this.Icon.Create(),AddCssClass(r,"NavIcon"),this.Color&&(r.style.color=this.Color),t.appendChild(r),i=document.createElement("div"),AddCssClass(i,"Content"),this.Status&&this.Status=="DeletedForm"&&AddCssClass(i,"Deleted"),t.appendChild(i),o=this,i.onclick=function(){o.OnClick()},r.onclick=function(){o.OnClick()},f=document.createElement("span"),f.setAttribute("title",this.Title),f.appendChild(document.createTextNode(this.Title)),i.appendChild(f),this.Count&&this.SetupCounter(t,i),this.ContextMenu&&this.BuildContextMenu(t),this.SetClasses(t),n.appendChild(t),u=this.FirstChild;u;)u.BuildElement(t),u=u.NextSibling};NavigatorItem.prototype.SetupCounter=function(n,t){AddCssClass(n,"HasCounter");var i=document.createElement("div");AddCssClass(i,"Counter");i.appendChild(document.createTextNode(this.Count));t.appendChild(i)};NavigatorItem.prototype.BuildContextMenu=function(n){var t=this.ContextMenu.Icon.Create();AddCssClass(t,"NavigatorItemMenu");t.EventTracker=new EventTracking(null,t);n.appendChild(t);t.EventTracker.AddCallback("click",this,"ShowContextMenu",!0)};NavigatorItem.prototype.SetClasses=function(n){AddCssClass(n,"SubItem");this.IsSelected&&(AddCssClass(n,"SubItemSelected"),ReportCommons.SelectedReportCount=this.Count)};NavigatorItem.prototype.OnClick=function(){$(".SubItemSelected").removeClass("SubItemSelected");this.Body.addClass("SubItemSelected");this.OnSelectMacro&&(this.ClickedOnce===!0&&(this.OnSelectMacro.AddClientArgument(WorkflowValueName.ResumeFromPause,"true"),this.OnSelectMacro.AddClientArgument(WorkflowValueName.SequenceTrack,"UpdateAll")),this.OnSelectMacro.PerformAction());this.SelectContextMacro&&(this.ClickedOnce===!0&&(this.SelectContextMacro.AddClientArgument(WorkflowValueName.ResumeFromPause,"true"),this.SelectContextMacro.AddClientArgument(WorkflowValueName.SequenceTrack,"Update")),this.SelectContextMacro.PerformAction());this.ClickedOnce=!0};NavigatorItem.prototype.ShowContextMenu=function(n,t,i){return this.Element.ContextLeft=t,this.Element.ContextTop=i,this.ContextMenu.CreateMenu(t,i),!1};ContextBarElement.InheritsFrom(ElementBase);ContextBarElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Items={};this.Items.AddItem=NavigatorItemAdd;this.LoadItems(n);this.ContextTop=0;this.ContextLeft=0;this.LanguageCode=n.getAttribute("languageCode")};ContextBarElement.prototype.LoadItems=function(n){for(var r,i=n.selectNodes("./Items/NavigatorItem"),t=0;t<i.length;t++)r=new ContextItem(this,i[t]),this.Items.AddItem(r)};ContextBarElement.prototype.InitializeMe=function(){var n=document.createElement("div"),i,t;for(n.id=this.Id,AddCssClass(n,"ContextItems"),this.Body=n,i=this.Parent.SecondaryNavigatorBody,t=this.Items.FirstChild;t;)t.BuildElement(n),t=t.NextSibling;BreadcrumbElement.prototype.totalListWidth();i.appendChild(n);document.documentElement.lang=ConvertToISO(this.LanguageCode)};ContextBarElement.prototype.GetContextCoordinates=function(){var n=this;return{Top:n.ContextTop,Left:n.ContextLeft,Width:16,Height:16,Right:n.ContextLeft+16,Bottom:n.ContextTop+16}};ContextBarElement.prototype.RelayedResponse=function(contentNode){var counts=JSON.parse(contentNode.getAttribute("counts")),newTitle;this.UpdateCounters(counts);newTitle=contentNode.getAttribute("titleScript");eval(newTitle)};ContextBarElement.prototype.UpdateCounters=function(n){var t=_.filter(n,function(n){return n!=0}),i=$(".Counter");t.length===i.length&&_.each(t,function(n,t){i[t].textContent=n})};ContextItem.InheritsFrom(NavigatorItem);ContextItem.prototype.SetClasses=function(n){AddCssClass(n,"ContextItem");this.IsSelected&&AddCssClass(n,"ContextItemSelected")};TreeBranchElement.InheritsFrom(ElementBase);TreeBranchElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.Title=GetCDataValue(n,"Title");this.Icon=ActiveIconArchive.GetFromNode(n);t=n.selectSingleNode("ContextMenu");t&&(this.ContextMenu=new ContextMenu(this,t),this.ContextMenu.CreateChildNodes(t));i=n.selectSingleNode("OnExpand");this.ExpandMacro=i?new MacroElement(this,i.firstChild):null;this.IsExpandable=this.ExpandMacro!=null;this.IndicatorBoard=new IndicatorBoard(n)};TreeBranchElement.prototype.InitializeMe=function(){var r=document.createElement("div"),u,n,i,t,f;r.id=this.Id;this.Body=r;AddCssClass(r,"BranchContainer");u=this.GetParentBody();u.appendChild(r);n=document.createElement("p");r.appendChild(n);this.Content=n;AddCssClass(n,"TreeBranchItem");this.SetIndention(n);this.Icon&&(i=this.Icon.Create(),this.IsExpandable&&(AddCssClass(i,"ClickableIcon"),i.EventTracker=new EventTracking(null,i),i.EventTracker.AddCallback("click",this,"OnActivate")),n.appendChild(i));t=document.createElement("span");t.appendChild(document.createTextNode(this.Title));this.IsExpandable&&(t.EventTracker=new EventTracking(null,t),t.EventTracker.AddCallback("click",this,"OnActivate"),AddCssClass(t,"Clickable"));n.appendChild(t);f=this.IndicatorBoard.Build();n.appendChild(f);this.BuildPropertiesControl(n)};TreeBranchElement.prototype.BuildPropertiesControl=function(n){if(this.Events.HaveEvent("onclick")||this.Events.HaveEvent("onopen")||this.ContextMenu){var t=ActiveIconArchive.Get(SettingsIcon).Create();AddCssClass(t,"ClickableIcon");t.EventTracker=new EventTracking(null,t);t.EventTracker.AddCallback("click",this,"OnProperties");n.appendChild(t)}};TreeBranchElement.prototype.OnProperties=function(n,t,i){return this.Events.CallEvent("onopen",t,i),this.Events.CallEvent("onclick",t,i),this.ContextMenu&&this.ContextMenu.CreateMenu(t,i),!1};TreeBranchElement.prototype.OnActivate=function(){var n=this.HasChildBranch();n?this.Collapse():this.IsExpandable&&this.Expand()};TreeBranchElement.prototype.Expand=function(){this.ExpandMacro.AddClientArgument(WorkflowValueName.RelayElementId,this.Id);this.ExpandMacro.PerformAction()};TreeBranchElement.prototype.Collapse=function(){for(var n=this.FirstChild,t;n;)t=n.NextSibling,n.Remove(),n=t};TreeBranchElement.prototype.RelayedResponse=function(n){for(var i=this.CreateChildNodes(n),t=0;t<i.length;t++)i[t].Initialize()};TreeBranchElement.prototype.HasChildBranch=function(){for(var t=!1,n=this.FirstChild;n;){if(n.MyClassName==this.MyClassName){t=!0;break}n=n.NextSibling}return t};TreeBranchElement.prototype.SetIndention=function(n){for(var r=0,i=this.Parent,t;i&&i.MyClassName==this.MyClassName;)r++,i=i.Parent;r>0||!0?(t=document.createElement("div"),this.IsExpandable?(this.HasChildBranch()&&AddCssClass(t,"IndentExpanded"),AddCssClass(t,"IndentExpandable")):AddCssClass(t,"IndentEndpoint"),AddCssClass(t,"Indent"),AddCssClass(t,"Indent"+r),n.appendChild(t),this.IndentNode=t):this.IndentNode=null};TreeBranchElement.prototype.BuildTreeControl=function(n,t){var i=ActiveIconArchive.Get(n).Create(),r,u;AddCssClass(i,"ClickableIcon");this.TreeControl=i;r=this;i.onclick=function(){t.call(r)};u=this.IndentNode?this.IndentNode.nextSibling:this.Content.firstChild;this.Content.insertBefore(i,u)};ReceiptElement.InheritsFrom(ElementBase);ReceiptElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.ReceiptElementRedirectUrl=n.getAttribute("redirectURL")};ReceiptElement.prototype.InitializeMe=function(){window.location.href=this.ReceiptElementRedirectUrl};ReceiptElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};AllotmentManagerElement.InheritsFrom(ElementBase);AllotmentManagerElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);var t=n.selectSingleNode("ManagerMacro");t&&(this.ManageButton=new IconButtonElement(this,t.firstChild),this.ManageButton.Caption=GetCDataValue(n,"ManagerCaption"),this.ManageButton.Icon=ActiveIconArchive.Get(SettingsIcon),this.ManageButton.IsInline=!0,this.ManageButton.IsDesignMode=this.IsDesignMode);this.ScrollInto=n.getAttribute("scroll_into")};AllotmentManagerElement.prototype.InitializeMe=function(){var t=document.createElement("div"),e,i,r,n,u,f;if(AddCssClass(t,"FormConnector"),e=this.GetParentBody(),e.appendChild(t),this.Root=t,i=document.createElement("div"),t.appendChild(i),this.Body=i,i.id=this.Id,this.ManageButton&&this.ManageButton.InitializeMe(),this.ScrollInto!==null){for(r=!1,n=this;!r&&n!==null;)n=n.Parent,n!==null&&(r=n.MyClassName=="FormTemplateElement"?!0:!1);u=n!==null?n.GetDescendantByName(this.ScrollInto):null;u!==null&&(f=document.getElementById(u.Id),f!==null&&f.scrollIntoView({block:"center"}))}this.EnableInteraction()};ResourceListElement.InheritsFrom(ElementBase);ResourceListElement.prototype.GetXmlNodeData=function(n){var i,t;for(ElementBase.prototype.GetXmlNodeData.call(this,n),this.Text=GetCDataValue(n,"Text"),this.IntendedUsage=n.getAttribute("intended_usage"),this.DescriptionTitle=GetCDataValue(n,"./Content/Header/Description")||"Header",this.IsFreeAmount=n.getAttribute("free_amount")=="true",this.ShowAvailability=!1,this.IsFreeAmount&&(this.AmountTitle=GetCDataValue(n,"./AmountTitle"),this.AvailabilityTitle=GetCDataValue(n,"./AvailabilityTitle")),this.Entries=[],i=n.selectNodes("./Content/Resources/Resource"),t=0;t<i.length;t++)this.Entries.push(new ResourceEntry(this,i[t]))};ResourceListElement.prototype.GetValuesAsQuery=function(n){for(var i,r=[],t=0;t<this.Entries.length;t++)i=this.Entries[t].GetValue(),i&&r.push(i);n.Add(this.Name,r.join(","))};ResourceListElement.prototype.ContentReloader=function(n){var i,t;for(this.ClearEntries(),i=n.selectNodes("Content/Resources/Resource"),t=0;t<i.length;t++)this.Entries.push(new ResourceEntry(this,i[t]));this.BuildEntries(this.Table)};ResourceListElement.prototype.ClearEntries=function(){for(var n=0;n<this.Entries.length;n++)this.Entries[n].Destroy();this.Entries=[]};ResourceListElement.prototype.InitializeMe=function(){var r=this.Parent.GetBodyElement(),t=document.createElement("div"),n,i;AddCssClass(t,"ResourcePickerContainer");this.Root=t;r.appendChild(t);n=new Table;this.Table=n;AddCssClass(n.Element,"ResourceList");this.BuildHeader(n);this.BuildEntries(n);i=n.Element;i.id=this.Id;t.appendChild(i);this.Body=i;this.IsDragable&&(this.InitializeTracker(),this.DragAndDropHandle=DragableElementSetupHelper(this.EventTracker,this,this.DragableDescription));this.ContextMenu&&(this.InitializeTracker(),this.EventTracker.AddCallback("click",this,"ShowContextMenu",!1))};ResourceListElement.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(null,this.Root))};ResourceListElement.prototype.CorrespondsToName=function(n){var i=n.indexOf("_"),t,r;return i==-1?t=this.Name==n:(r=n.slice(i+1),t=this.Name==r),t};ResourceListElement.prototype.BuildEntries=function(n){for(var i,t=0;t<this.Entries.length;t++)i=this.Entries[t],i.Build(n)};ResourceListElement.prototype.BuildHeader=function(n){var i=n.AddRow(),t=i.AddHeaderCell(),r=t.Element;r.appendChild(document.createTextNode(this.DescriptionTitle));this.IsFreeAmount&&(t=i.AddHeaderCell(),t.Element.appendChild(document.createTextNode(this.AmountTitle)));this.ShowAvailability&&(t=i.AddHeaderCell(),t.Element.appendChild(document.createTextNode(this.AvailabilityTitle)))};ResourceListElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};ResourceEntry.prototype.Destroy=function(){this.TableRow.parentNode.removeChild(this.TableRow);this.TableRow=null};ResourceEntry.prototype.Build=function(n){var t=n.AddRow();this.TableRow=t.Element;this.BuildDescription(t);this.Parent.IsFreeAmount&&this.BuildAmount(t);this.Parent.ShowAvailability&&this.BuildAvailableAmount(t)};ResourceEntry.prototype.GetValue=function(){var t="",i,n;return this.Parent.IsFreeAmount&&this.SelectedElement&&(i=this.SelectElement.options[this.SelectElement.selectedIndex],n=i.value,n>0&&(t=this.Id+"."+n)),t};ResourceEntry.prototype.BuildDescription=function(n){var t=n.AddCell().Element;t.style.padding="5px";t.innerHTML=this.Description};ResourceEntry.prototype.BuildAmount=function(n){var i=n.AddCell().Element,t;i.style.padding="5px";this.AvailableAmount>0?(t=this.BuildAmountPicker(),this.SelectedElement=t):t=document.createTextNode("-");i.appendChild(t)};ResourceEntry.prototype.BuildAvailableAmount=function(n){var t=n.AddCell().Element;t.style.padding="5px";t.appendChild(document.createTextNode(this.AvailableAmount))};ResourceEntry.prototype.BuildAmountPicker=function(){var n=document.createElement("select");AddCssClass(n,"Listbox");AddCssClass(n,"Amount");this.SelectElement=n;for(var t=-1,r=0,u=!1,f=function(t,i){var r=document.createElement("option");r.value=t;r.text=i||t;try{n.add(r,n.options[null])}catch(u){n.add(r,null)}return r},i=0;t<this.AvailableAmount;)if(t=GetNextAmountValue(t,this.AvailableAmount),!u&&t>this.CurrentAmount&&(f(this.CurrentAmount),r=i,u=!0),t==this.CurrentAmount&&(r=i,u=!0),f(t),i++,i>100)break;return n.selectedIndex=r,n};CalendarElement.InheritsFrom(ElementBase);CalendarElement.prototype.GetXmlNodeData=function(n){var r,t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.Entries=[];this.HeaderHeight=0;this.Title=GetCDataValue(n,"Title");this.DefaultView="month";this.SubFilters=[];this.Format=n.getAttribute("date_format");this.Date=DateTimeParser(n.getAttribute("date"),this.Format);this.Start=DateTimeParser(n.getAttribute("start"),this.Format);this.End=DateTimeParser(n.getAttribute("end"),this.Format);this.WeekdayNames=n.getAttribute("weekday_names").split(",");this.MonthNames=n.getAttribute("month_names").split(",");this.AddIcon=ActiveIconArchive.GetFromNode(n.selectSingleNode("./AddIcon"));r=n.selectSingleNode("Loader");this.ViewLoader=new MacroElement(this,r.firstChild);this.ReportHasGroups=n.getAttribute("report_has_groups")=="true";t=n.selectSingleNode("OnAddEntry");t&&(this.AddEntry=new MacroElement(this,t.firstChild));i=n.selectSingleNode("OnEditEntry");i&&(this.EditEntry=new MacroElement(this,i.firstChild));this.CanAddEntry=this.AddEntry!=null};CalendarElement.prototype.OnResize=function(){this.View&&this.View.OnResize();ElementBase.prototype.OnResize.call(this)};CalendarElement.prototype.SetView=function(n){var t=n.Parameter1,i=n.Parameter2||this.View.Date;this.AddSubFilterArguments(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,t);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(i,this.Format));this.ViewLoader.PerformAction()};CalendarElement.prototype.GetView=function(n){var i=n.getAttribute("name"),t;if(i=="month")t=new MonthCalendarView(this,n);else if(i=="day")t=new DayCalendarView(this,n);else if(i=="week")t=new WeekCalendarView(this,n);else throw new Exception("Not implemented");return t.Deserialize(n),t};CalendarElement.prototype.RelayedResponse=function(n){this.View&&this.View.Destroy();this.IsEditable=n.getAttribute("editable")=="true";var t=n.selectSingleNode("./View");this.View=this.GetView(t);this.BuildHeader();this.View.Build()};CalendarElement.prototype.LoadCalendar=function(){var n=this,t=function(){n.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,n.Id);n.AddSubFilterArguments(n.ViewLoader);n.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,n.DefaultView);n.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(n.Date,n.Format));n.ViewLoader.PerformAction()},i=this.ViewLoader.Relation,r;i?(r=window.CurrentMacroCallbackIndex.GetRootMacroByRelation(i),n=this,r.DelayedTrigggerAction=t):t()};CalendarElement.prototype.InitializeMe=function(){var i=this.GetParentBody(),n=document.createElement("div"),t;AddCssClass(n,"CalendarContainer");i.appendChild(n);this.Root=n;t=document.createElement("div");AddCssClass(t,"Calendar");n.appendChild(t);this.Body=t;n.style.minHeight="400px"};CalendarElement.prototype.PostInitialized=function(){this.LoadCalendar()};CalendarElement.prototype.OnEditEntry=function(n,t,i,r){var u=null;u=this.EditEntry;u&&(this.ContextLeft=t,this.ContextTop=i,u.ClearClientArguments(),u.AddClientArgument(WorkflowValueName.ReportEntry,r),u.PerformAction())};CalendarElement.prototype.OnAddEntry=function(n,t,i){var r=n.Parameter1;this.ContextLeft=t;this.ContextTop=i;this.AddEntry.ClearClientArguments();this.AddEntry.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.AddSubFilterArguments(this.ViewLoader);this.AddEntry.AddClientArgument(WorkflowValueName.CalendarView,this.DefaultView);this.AddEntry.AddClientArgument(WorkflowValueName.Date,DateTimeToString(this.Date,this.Format));this.AddEntry.AddClientArgument(WorkflowValueName.EntryDate,DateTimeToString(r,this.Format));this.AddEntry.PerformAction()};CalendarElement.prototype.GetContextCoordinates=function(){var n=new Size(5,5),t=new Position2D(this.ContextLeft,this.ContextTop);return new Coordinates(t,n)};CalendarElement.prototype.BuildContentArea=function(){var n=document.createElement("div");AddCssClass(n,"ContentArea");this.Body.appendChild(n);this.ContentArea=n};CalendarElement.prototype.BuildHeader=function(){this.HeaderBody&&(this.HeaderBody.parentNode.removeChild(this.HeaderBody),this.HeaderBody=null);var n=document.createElement("div");AddCssClass(n,"Header");AddCssClass(n,"HeaderToolbar");this.Body.appendChild(n);this.BuildNavigation(n);this.BuildHierarchy(n);this.HeaderBody=n;this.HeaderHeight=new LayerSize(n).Height};CalendarElement.prototype.BuildNavigation=function(n){var t=ActiveIconArchive.Get(GroupsIconName).Create(),i,u,r;this.ReportHasGroups&&(t.style.color=GREENCOLOR);n.appendChild(t);AddCssClass(t,"ClickableIcon");t.style.marginLeft="0px";t.EventTracker=new EventTracking(null,t);t.EventTracker.AddCallback("click",this.Parent,"OnToggleGroups");i=this.View.BackwardIcon.Create();AddCssClass(i,"ClickableIcon");n.appendChild(i);i.EventTracker=new EventTracking(null,i);i.EventTracker.AddCallback("click",this,"NavigateDate",!1,this.View.NavBackward);u=document.createElement("span");u.appendChild(document.createTextNode(this.View.DateText));n.appendChild(u);r=this.View.ForwardIcon.Create();AddCssClass(r,"ClickableIcon");n.appendChild(r);r.EventTracker=new EventTracking(null,r);r.EventTracker.AddCallback("click",this,"NavigateDate",!1,this.View.NavForward);this.AddListboxNavigators(n)};CalendarElement.prototype.AddListboxNavigators=function(n){this.View.Name==="week"?this.BuildWeekListboxNavigators(n):this.BuildCommonMonthDayListboxNavigators(n);this.View.Name==="day"&&this.BuildDayListboxNavigators(n)};CalendarElement.prototype.BuildWeekListboxNavigators=function(n){var u=document.createElement("select"),c=this,e,r,o,s,h,t;this.EventTracker=new EventTracking(null,u);this.EventTracker.AddCallbackFunction("change",function(){c.ChangeYearKeepWeek(u.options[u.selectedIndex].value)});AddCssClass(u,"Listbox");var l=this.View.MinDate.getFullYear(),a=this.View.MaxDate.getFullYear(),f=this.View.Date;for(f.AddDays(3),e=f.getFullYear(),i=l;i<=a;i++)t=document.createElement("option"),t.value=i,t.text=i,t.value==e&&(t.selected=!0),u.appendChild(t);for(n.appendChild(u),r=document.createElement("select"),o=this,this.EventTracker=new EventTracking(null,r),this.EventTracker.AddCallbackFunction("change",function(){o.ChangeWeek(r.options[r.selectedIndex].value)}),AddCssClass(r,"Listbox"),s=WeeksInYear(this.View.Date.getFullYear()),h=GetWeekNumber(this.View.Date)[1],i=1;i<=s;i++)t=document.createElement("option"),t.value=i,t.text=this.View.AcronHelperText+" "+i,t.value==h&&(t.selected=!0),r.appendChild(t);n.appendChild(r)};CalendarElement.prototype.BuildCommonMonthDayListboxNavigators=function(n){var u=document.createElement("select"),o=this,r,f,e,t;this.EventTracker=new EventTracking(null,u);this.EventTracker.AddCallbackFunction("change",function(){o.ChangeYear(u.options[u.selectedIndex].value)});AddCssClass(u,"Listbox");var s=this.View.MinDate.getFullYear(),h=this.View.MaxDate.getFullYear(),c=this.View.Date.getFullYear();for(i=s;i<=h;i++)t=document.createElement("option"),t.value=i,t.text=i,t.value==c&&(t.selected=!0),u.appendChild(t);for(n.appendChild(u),r=document.createElement("select"),f=this,this.EventTracker=new EventTracking(null,r),this.EventTracker.AddCallbackFunction("change",function(){f.ChangeMonth(r.options[r.selectedIndex].value)}),AddCssClass(r,"Listbox"),e=this.View.Date.getMonth(),i=0;i<12;i++)t=document.createElement("option"),t.value=i,t.text=this.MonthNames[i],t.value==e&&(t.selected=!0),r.appendChild(t);n.appendChild(r)};CalendarElement.prototype.BuildDayListboxNavigators=function(n){var t=document.createElement("select"),e=this,u,f,r;for(this.EventTracker=new EventTracking(null,t),this.EventTracker.AddCallbackFunction("change",function(){e.ChangeDay(t.options[t.selectedIndex].value)}),AddCssClass(t,"Listbox"),u=DaysInMonth(this.View.Date.getMonth(),this.View.Date.getFullYear()),f=this.View.Date.getDate(),i=1;i<=u;i++)r=document.createElement("option"),r.value=i,r.text=i,r.value==f&&(r.selected=!0),t.appendChild(r);n.appendChild(t)};CalendarElement.prototype.ChangeDay=function(n){var i=n,t=this.View.Date;t.setDate(i);this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(t,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.ChangeMonth=function(n){var i=n,t=this.View.Date,r=DayToBeSetInMonth(i,t);t.setDate(1);t.setMonth(i);t.setDate(r);this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(t,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.ChangeYearKeepWeek=function(n){var t=n,i=this.View.Date,r=DayToKeepWeekInYear(t,i);this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(r,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.ChangeWeek=function(n){var t=n,i=this.View.Date.getFullYear(),r=GetDateOfISOWeek(t,i);this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(r,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.ChangeYear=function(n){var i=n,t=this.View.Date,r=DayToBeSetInYear(i,t);t.setDate(r);t.setFullYear(i);this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(t,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.NavigateDate=function(n){var t=n.Parameter1;this.ViewLoader.ClearClientArguments();this.ApplyReportReference(this.ViewLoader);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarId,this.Id);this.ViewLoader.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);this.ViewLoader.AddClientArgument(WorkflowValueName.Date,DateTimeToString(t,this.Format));this.ViewLoader.AddClientArgument(WorkflowValueName.DateNavigation,"navigation");this.ViewLoader.PerformAction()};CalendarElement.prototype.ApplySubFilter=function(n){var t=this.ViewLoader;this.SubFilters=n;this.ViewLoader.ClearClientArguments();this.AddSubFilterArguments(t);this.ApplyReportReference(t);t.AddClientArgument(WorkflowValueName.CalendarId,this.Id);t.AddClientArgument(WorkflowValueName.CalendarView,this.View.Name);t.AddClientArgument(WorkflowValueName.Date,DateTimeToString(this.View.Date,this.Format));t.PerformAction()};CalendarElement.prototype.ApplyReportReference=function(n){this.Parent.MyClassName=="ReportBrowserElement"&&n.AddClientArgument(WorkflowValueName.ReportId,this.Parent.Id)};CalendarElement.prototype.AddSubFilterArguments=function(n){for(var i,t=0;t<this.SubFilters.length;t++)i=this.SubFilters[t],n.AddClientArgument(i.Key,i.Value)};CalendarElement.prototype.BuildHierarchy=function(n){var r=document.createElement("div"),i,f,u,t;for(AddCssClass(r,"CalendarHierarchyContainer"),n.appendChild(r),i=0;i<this.View.Hierarchy.length;i++)f=this.View.Hierarchy[i],i>0&&(u=document.createElement("span"),AddCssClass(u,"Separator"),u.appendChild(document.createTextNode(":")),r.appendChild(u)),t=document.createElement("span"),AddCssClass(t,"Title"),AddCssClass(t,"ClickableText"),t.appendChild(document.createTextNode(f.Title)),t.EventTracker=new EventTracking(null,t),t.EventTracker.AddCallback("click",this,"SetView",!1,f.Name),r.appendChild(t)};CalendarElement.prototype.InitializeTracker=function(){this.EventTracker||(this.EventTracker=new EventTracking(this.Body.id))};CalendarSectionArranger.prototype.GetAvailableSections=function(n,t,i){for(var u=1,r=n+1;r<this.Sections.length;r++){if(this.Sections[r].IsSpanOccupied(t,i))break;u++}return u};CalendarSectionArranger.prototype.GetSuitableSection=function(n,t){var i=this.FindAvailableSection(n,t);return i||(i=this.AddSection()),i.OccupySpan(n,t),i};CalendarSectionArranger.prototype.FindAvailableSection=function(n,t){for(var r,u=null,i=0;i<this.Sections.length;i++)if(r=this.Sections[i],!r.IsSpanOccupied(n,t)){u=r;break}return u};CalendarSectionArranger.prototype.AddSection=function(){var n=new CalendarSection(this.LineCount,this.Sections.length);return this.Sections.push(n),n};CalendarView.prototype.LoadSections=function(n){for(var r,i=n.selectNodes("./Sections/Section"),t=0;t<i.length;t++)r=i[t].firstChild?i[t].firstChild.nodeValue:" ",this.Sections.push(r)};CalendarView.prototype.Destroy=function(){this.ContentBody&&(this.ContentBody.parentNode.removeChild(this.ContentBody),this.ContentHead.parentNode.removeChild(this.ContentHead),this.ContentBody=null,this.ContentColumns=null)};CalendarView.prototype.DestroyContent=function(){for(var i=[],t,n=0;n<this.ContentColumns.length;n++)for(t=this.ContentColumns[n].firstChild;t;)i.push(t),t=t.nextSibling;for(n=0;n<i.length;n++)i[n].parentNode.removeChild(i[n])};CalendarView.prototype.Deserialize=function(n){var r,u,o,f,t,e,i;for(this.LoadSections(n),this.ContentSections=this.Sections.length,this.Name=n.getAttribute("name"),this.BackwardIcon=ActiveIconArchive.GetFromNode(n.selectSingleNode("BackwardIcon")),this.ForwardIcon=ActiveIconArchive.GetFromNode(n.selectSingleNode("ForwardIcon")),this.NavBackward=DateTimeParser(n.getAttribute("nav_backward"),this.Calendar.Format),this.NavForward=DateTimeParser(n.getAttribute("nav_forward"),this.Calendar.Format),this.MaxDate=DateTimeParser(n.getAttribute("maxDate"),this.Calendar.Format),this.MinDate=DateTimeParser(n.getAttribute("minDate"),this.Calendar.Format),r=n.selectSingleNode("nav_fastbackward"),r&&(this.NavFastBackward=DateTimeParser(r,this.Calendar.Format),this.NavFastForward=DateTimeParser(n.getAttribute("nav_fastforward"),this.Calendar.Format),this.FastBackwardIcon=ActiveIconArchive.GetFromNode(n.selectSingleNode("FastBackwardIcon")),this.FastForwardIcon=ActiveIconArchive.GetFromNode(n.selectSingleNode("FastForwardIcon"))),this.DateText=n.getAttribute("date_text"),this.AcronHelperText=n.getAttribute("acron_helper"),this.Date=DateTimeParser(n.getAttribute("start"),this.Calendar.Format),this.Entries=[],u=n.selectNodes("./Entries/Entry"),t=0;t<u.length;t++)o=new CalendarEntry(this.Calendar,u[t]),this.Entries[this.Entries.length]=o;for(this.Hierarchy=[],f=n.selectNodes("./Hierarchy/HierarchyNode"),t=0;t<f.length;t++)e=f[t],i={},i.Name=e.getAttribute("name"),i.Title=e.getAttribute("title"),this.Hierarchy.push(i)};CalendarView.prototype.Build=function(){this.Destroy();this.IndexWidth=45;this.ScrollbarOffset=this.Scrollable?GetScrollBarSize():0;this.ContentColumns=[];this.BuildContentHead(this.Calendar.Body);this.BuildIndexColumnHead(this.IndexHeadSection);this.BuildDayColumnHeads(this.ContentHeadSection,this.ContentSections);this.HeaderHeight=new LayerSize(this.ContentHead).Height;this.BuildContentBody(this.Calendar.Body);this.BuildIndexSection(this.ContentBody);this.BuildContentSection(this.ContentBody);this.OnResize();this.BuildIndex(this.IndexSection);this.BuildContentColumns(this.ContentSection,this.FixedContentSection||this.ContentSections);this.BuildContent()};CalendarView.prototype.OnResize=function(){var t=new LayerSize(this.Calendar.Body),i=t.Width-this.IndexWidth,n;this.IndexHeadSection.style.width=this.IndexWidth+"px";this.ContentHeadSection.style.width=i+"px";this.ContentHeight=t.Height-this.Calendar.HeaderHeight-this.HeaderHeight;this.ContentBody.style.height=this.ContentHeight+"px";this.ContentSection.style.width=t.Width-this.IndexWidth-this.ScrollbarOffset-1+"px";this.PassedFirstResize?(n=this,this.RebuildHandle&&window.clearTimeout(this.RebuildHandle),this.RebuildHandle=window.setTimeout(function(){n.RebuildHandle=null;n.DestroyContent();n.BuildContent()},50)):this.PassedFirstResize=!0};CalendarView.prototype.BuildContentHead=function(n){var t=document.createElement("div"),i,r;AddCssClass(t,"ContentHead");n.appendChild(t);this.ContentHead=t;i=document.createElement("div");AddCssClass(i,"IndexHeadSection");t.appendChild(i);this.IndexHeadSection=i;r=document.createElement("div");AddCssClass(r,"ContentHeadSection");t.appendChild(r);this.ContentHeadSection=r};CalendarView.prototype.BuildContentBody=function(n){var t=document.createElement("div");AddCssClass(t,"ContentBody");this.Scrollable||(t.style.overflow="hidden");n.appendChild(t);this.ContentBody=t};CalendarView.prototype.BuildContentColumns=function(n,t){for(var i,r=0;r<t;r++)i=document.createElement("div"),i.style.position="absolute",i.style.top="0px",AddCssClass(i,"Day"),n.appendChild(i),i.style.width=100/t+"%",i.style.left=100/t*r+"%",i.style.height="100%",this.ContentColumns.push(i)};CalendarView.prototype.BuildIndexColumnHead=function(n){var t=document.createElement("div");AddCssClass(t,"HeaderToolbar");AddCssClass(t,"ColumnHead");t.appendChild(document.createTextNode(" "));t.style.width="100%";n.appendChild(t)};CalendarView.prototype.BuildDayColumnHeads=function(n,t){for(var f,i,e,o,r=this.Date.CreateClone(),u=0;u<t;u++)f=this.Sections[u],i=document.createElement("div"),AddCssClass(i,"HeaderToolbar"),AddCssClass(i,"ColumnHead"),i.style.width=100/t+"%",(this.Name=="week"||this.Name=="month")&&(i.style.textAlign="center"),this.Name!="week"?i.appendChild(document.createTextNode(f)):(e=f.substring(0,3),i.appendChild(document.createTextNode(e)),i.appendChild(document.createTextNode(" ")),i.appendChild(document.createTextNode(r.getDate()+"/"+r.GetFullMonth()))),n.appendChild(i),this.Calendar.CanAddEntry&&this.Name!="month"&&(this.CreateAddEntryControl(i,r),t>1&&(AddCssClass(i,"ClickableColumn"),i.EventTracker=new EventTracking(null,i),o=r.CreateClone(),i.EventTracker.AddCallback("click",this.Calendar,"SetView",!0,"day",o))),r.setDate(r.getDate()+1)};CalendarView.prototype.CreateAddEntryControl=function(n,t){var i=CreateClickableIcon(this.Calendar.AddIcon,this.Calendar,"OnAddEntry",t);n.appendChild(i)};CalendarView.prototype.BuildIndexSection=function(n){var t=document.createElement("div");AddCssClass(t,"IndexSection");t.style.width=this.IndexWidth+"px";n.appendChild(t);this.IndexSection=t};CalendarView.prototype.BuildContentSection=function(n){var t=document.createElement("div");AddCssClass(t,"ContentSection");t.style.width=this.IndexWidth+"px";n.appendChild(t);t.style.left=this.IndexWidth+"px";this.ContentSection=t};MonthCalendarView.InheritsFrom(CalendarView);MonthCalendarView.prototype.BuildIndex=function(){};MonthCalendarView.prototype.BuildContentContainer=function(){var n=document.createElement("div");this.Body.appendChild(n);n.style.position="relative";this.ContentContainer=n};MonthCalendarView.prototype.BuildContent=function(){var c=this.ContentColumns[0],t=new CalendarController(this.Date),i=this,e,s,h;i.CellIndex={};var u=t.GetWeeks(),r=0,f=0;this.BodyHeight=new LayerSize(this.ContentBody).Height;for(var l=function(n,t){var r=document.createElement("div"),u;AddCssClass(r,"Week");u=n.GetWeek();r.appendChild(document.createTextNode(u));r.EventTracker=new EventTracking(null,r);r.EventTracker.AddCallback("click",i.Calendar,"SetView",!0,"week",n.CreateClone());t.appendChild(r)},o,a=function(n,t){var e=document.createElement("div"),o,s;return c.appendChild(e),AddCssClass(e,"CalendarCell"),AddCssClass(e,"CalendarCell"+u+"Weeks"),r==1?AddCssClass(e,"CalendarCellFirstWeek"):r==u?AddCssClass(e,"CalendarCellLastWeek"):AddCssClass(e,"CalendarCellMiddleWeek"),n.IsStartOfWeek()?AddCssClass(e,"CalendarCellFirstWeekday"):n.IsEndOfWeek()?AddCssClass(e,"CalendarCellLastWeekday"):AddCssClass(e,"CalendarCellMiddleWeekday"),e.style.top=100/u*(r-1)+"%",e.style.left=100/7*(n.GetWeekday()-1)+"%",i.CellIndex["d"+n.getMonth()+"."+n.getDate()]=e,t&&(o=document.createElement("div"),o.EventTracker=new EventTracking(null,o),o.EventTracker.AddCallback("click",i.Calendar,"SetView",!0,"day",n.CreateClone()),o.style.zIndex=1,AddCssClass(o,"CellHeader"),e.appendChild(o),s=n.getDate(),o.appendChild(document.createTextNode(s)),f==0&&(f=o.getBoundingClientRect().height),i.Calendar.CanAddEntry&&i.CreateAddEntryControl(o,n)),e},n=t.GetCurrentDate();t.IsInsideCalendar(n);)e=n.IsStartOfWeek(),s=n.IsEndOfWeek(),e&&r++,cell=a(n,t.IsInsideMonth(n)),e&&(l(n,cell),o=n),t.StepForward(),n=t.GetCurrentDate(),s&&(h=f/this.ContentHeight,this.BuildEntriesOfWeek(new DateSpan(o,n),r-1,u,h))};MonthCalendarView.prototype.BuildEntriesOfWeek=function(n,t,i,r){for(var c=Math.round(n.GetDays()),s=new CalendarSectionArranger(c),h=[],w=function(n,t,i,r,u,f){this.From=n;this.To=t;this.SectionIndex=i;this.Entry=r;this.Span=0;this.StartsOutside=u;this.EndsOutside=f},o,f,p,e,u=0;u<this.Entries.length;u++)if(o=this.Entries[u],f=new DateSpan(o.Start,o.End),f.End.setSeconds(-1),f.IsRangeWithin(n)){var l=n.RangeStartOutside(f),a=n.RangeEndOutside(f),v=l?0:f.Start.GetWeekday()-1,y=a?c:f.End.GetWeekday(),b=s.GetSuitableSection(v,y),e=new w(v,y,b.Index,o,l,a);h.push(e)}for(p=s.Sections.length,u=0;u<h.length;u++)e=h[u],e.Span=s.GetAvailableSections(e.SectionIndex,e.From,e.To),this.BuildWeekEntry(e,p,t,i,r)};MonthCalendarView.prototype.BuildWeekEntry=function(n,t,i,r,u){var e=t<3?3:t,f=document.createElement("div"),s,h;f.style.position="absolute";this.ContentColumns[0].appendChild(f);var c=r*e,w=u*r,o=(1/c-u/e)*100,l=i*e+n.SectionIndex,a=l*o+u*(i+1)*100,v=n.From==0?0:n.From/7*100,y=(n.To-n.From)/7*100,p=n.Span*o;f.style.top=a+"%";f.style.left=v+"%";f.style.height=p+"%";f.style.width=y+"%";s=this.Calendar;h=function(t,i,r){s.OnEditEntry(t,i,r,n.Entry.Resource)};f.EventTracker=new EventTracking(null,f);f.EventTracker.AddCallbackFunction("click",h,!0);this.AddEntryContent(f,n,i,r)};MonthCalendarView.prototype.AddEntryContent=function(n,t,i,r){var u=t.Entry,f=document.createElement("p"),o,e,s;AddCssClass(f,"Title");AddCssClass(n,"Box");AddCssClass(n,"MonthBox");t.StartsOutside||AddCssClass(n,"BoxClosedStart");t.EndsOutside||AddCssClass(n,"BoxClosedEnd");o=t.From>=4?"left":i<r/2?"below":"above";u.Tooltip.Build(n,o);f.appendChild(document.createTextNode(u.Title));u.Count&&(e=document.createElement("div"),AddCssClass(e,"Counter"),e.appendChild(document.createTextNode(u.Count)),f.appendChild(e));n.style.backgroundColor=u.BgColor;n.style.color=u.TextColor;n.appendChild(f);s=new LayerSize(f)};MonthCalendarView.prototype.AssociateEntryElements=function(n){for(var r,t=n,i=0;i<n.length;i++)r=n[i],r.onmouseover=function(){for(var n=0;n<t.length;n++)AddCssClass(t[n],"Hover")},r.onmouseout=function(){for(var n=0;n<t.length;n++)RemoveCssClass(t[n],"Hover")}};DayCalendarView.InheritsFrom(CalendarView);DayCalendarView.prototype.BuildContent=function(){for(var n=0;n<this.ContentColumns.length;n++)this.BuildHourCells(this.ContentColumns[n]);var t=this.Date,i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1,0,0,0,0);for(n=0;n<this.ContentColumns.length;n++)this.BuildEntries(n,i,r),this.AdjustDateForNextColumn(i),this.AdjustDateForNextColumn(r)};DayCalendarView.prototype.AdjustDateForNextColumn=function(){};DayCalendarView.prototype.GetEntriesWithinRange=function(n,t,i){for(var r,f=[],u=0;u<this.Entries.length;u++)r=this.Entries[u],r.SectionGroup==i&&r.Start<t&&r.End>n&&f.push(r);return f};DayCalendarView.prototype.SetupEntryProperties=function(n,t,i,r){for(var h,u,o=function(n){var t=(n.getHours()*60+n.getMinutes())/30;return Math.floor(t)},f=0;f<n.length;f++){var u=n[f],s=u.Start<i,e=u.End>r;u.RowFrom=s?0:o(u.Start);u.RowTo=e?48:u.End.valueOf()===r.valueOf()?48:o(u.End);u.RowFrom==u.RowTo&&u.RowTo++;e&&(e=e);u.IsStartOutside=s;u.IsEndOutside=e;h=t.GetSuitableSection(u.RowFrom,u.RowTo);u.SectionIndex=h.Index}for(f=0;f<n.length;f++)u=n[f],u.Span=t.GetAvailableSections(u.SectionIndex,u.RowFrom,u.RowTo)};DayCalendarView.prototype.BuildEntries=function(n,t,i){var s=this.ContentColumns[n],f=new CalendarSectionArranger(48),u=this.GetEntriesWithinRange(t,i,n),e,r,o;for(this.SetupEntryProperties(u,f,t,i),e=f.Sections.length,r=0;r<u.length;r++)o=u[r],this.BuildBox(s,o,e)};DayCalendarView.prototype.BuildBox=function(n,t,i){var r=document.createElement("div"),o,s,h,u,f,e;n.appendChild(r);AddCssClass(r,"Box");AddCssClass(r,"DayBox");t.RowTo-t.RowFrom==1&&AddCssClass(r,"Narrow");t.IsStartOutside||AddCssClass(r,"BoxBeginning");t.IsEndOutside||AddCssClass(r,"BoxEnd");t.IsPending&&AddCssClass(r,"Pending");r.style.position="absolute";r.style.width=t.Span/i*100+"%";r.style.top=t.RowFrom*20+"px";r.style.left=t.SectionIndex==0?"0%":t.SectionIndex/i*100+"%";r.style.height=(t.RowTo-t.RowFrom)*20+"px";r.style.backgroundColor=t.BgColor;r.style.color=t.TextColor;o=this.GetTooltipPosition(t);t.Tooltip.Build(r,o);s=this.Calendar;h=function(n,i,r){s.OnEditEntry(n,i,r,t.Resource)};r.EventTracker=new EventTracking(null,r);r.EventTracker.AddCallbackFunction("click",h,!0);u=document.createElement("p");AddCssClass(u,"Title");u.appendChild(document.createTextNode(t.Title));f=document.createElement("div");f.appendChild(document.createTextNode(" "));AddCssClass(f,t.IsStartOutside?"ContBeginning":"Beginning");r.appendChild(f);r.appendChild(u);e=document.createElement("div");e.appendChild(document.createTextNode(" "));AddCssClass(e,t.IsEndOutside?"ContEnd":"End");r.appendChild(e)};DayCalendarView.prototype.GetTooltipPosition=function(n){return this.Name=="day"?n.SectionGroup>0&&n.SectionGroup>=this.ContentSections/2||n.SectionGroup==0&&n.SectionIndex>=this.Entries.length/2?"left":n.RowFrom>0?"above":"below":n.Start.GetWeekday()>4?"left":n.RowFrom>0?"above":"below"};DayCalendarView.prototype.BuildHourCells=function(n){for(var i,t=0;t<48;t++)i=document.createElement("div"),AddCssClass(i,"DayHourCell"),n.appendChild(i)};DayCalendarView.prototype.BuildIndex=function(n){for(var i,r,u,t=0;t<24;t++)i=document.createElement("div"),AddCssClass(i,"DayHourCell"),AddCssClass(i,"DayHourHead"),n.appendChild(i),r=document.createElement("span"),AddCssClass(r,"Hours"),r.appendChild(document.createTextNode(t<10?"0"+t:t)),i.appendChild(r),u=document.createElement("span"),AddCssClass(u,"Minutes"),u.appendChild(document.createTextNode("00")),i.appendChild(u)};WeekCalendarView.InheritsFrom(DayCalendarView);WeekCalendarView.prototype.GetEntriesWithinRange=function(n,t){for(var i,u=[],r=0;r<this.Entries.length;r++)i=this.Entries[r],i.Start<t&&i.End>n&&u.push(i);return u};WeekCalendarView.prototype.AdjustDateForNextColumn=function(n){n.setDate(n.getDate()+1)};QrCodeElement.InheritsFrom(ElementBase);QrCodeElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Data=n.getAttribute("data");this.Height=n.getAttribute("height");this.Width=n.getAttribute("width");this.ScrollInto=n.getAttribute("scroll_into")};QrCodeElement.prototype.InitializeMe=function(){var t=document.createElement("div"),i,n,r,u;if(t.id=this.Id,t.style.position="relative",this.Body=t,this.Parent.GetBodyElement().appendChild(t),this.CreateImage(t),this.ContextMenu&&(this.EventTracker=new EventTracking(this.Body.id),this.ContextMenuHandle=this.EventTracker.AddCallback("click",this,"ShowContextMenu")),this.ScrollInto!==null){for(i=!1,n=this;!i&&n!==null;)n=n.Parent,n!==null&&(i=n.MyClassName=="FormTemplateElement"?!0:!1);r=n!==null?n.GetDescendantByName(this.ScrollInto):null;r!==null&&(u=document.getElementById(r.Id),u!==null&&u.scrollIntoView({block:"center"}))}};QrCodeElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};QrCodeElement.prototype.CreateImage=function(n){var t=CreateImage("/qr?data="+this.Data);t.style.position="relative";t.height=this.Height;t.style.height=this.Height;t.width=this.Width;t.style.width=this.Width;n.appendChild(t)};PaperElement.InheritsFrom(ElementBase);PaperElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);var t=n.getAttribute("orientation")=="Portrait",i=n.getAttribute("width")||10,r=n.getAttribute("height")||10;this.Width=MillimetersToPixels(t?i:r);this.Height=MillimetersToPixels(t?r:i);this.AbsPosConversion={FromPixels:MillimetersToPixels,ToPixels:MillimetersToPixels}};PaperElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.style.display="block";n.style.position="relative";n.style.width=this.Width+"px";n.style.height=this.Height+"px";n.style.pageBreakAfter="always";n.id=this.Id;t=this.GetParentBody();t.appendChild(n);this.Body=n};PagePreviewElement.InheritsFrom(ElementBase);PagePreviewElement.prototype.GetValuesAsQuery=function(n){if(this.Name){var t={Size:this.Paper,Orientation:this.Orientation==this.PORTRAIT?"Portrait":"Landscape",Borders:this.BordersOn,CuttingMarks:this.CuttingMarks,SpacingVertical:this.SpacingVertical,SpacingHorizontal:this.SpacingHorizontal,Margins:{Left:this.Margins[this.LEFT].Value,Right:this.Margins[this.RIGHT].Value,Top:this.Margins[this.TOP].Value,Bottom:this.Margins[this.BOTTOM].Value}},i=JSON.stringify(t);n.Add(this.Name,i)}};PagePreviewElement.prototype.Rotate=function(){this.Orientation=this.Orientation==this.PORTRAIT?this.LANDSCAPE:this.PORTRAIT;var n=this.MediaWidth;this.MediaWidth=this.MediaHeight;this.MediaHeight=n;this.UpdateLayout()};PagePreviewElement.prototype.UpdateLayout=function(){for(var n,u,r,t,i;this.PreviewBody.firstChild;)this.PreviewBody.removeChild(this.PreviewBody.firstChild);if(n={W:this.Scale(this.MediaWidth),H:this.Scale(this.MediaHeight),L:this.Scale(this.Margins[this.LEFT].Value),R:this.Scale(this.Margins[this.RIGHT].Value),T:this.Scale(this.Margins[this.TOP].Value),B:this.Scale(this.Margins[this.BOTTOM].Value)},u=this.CreateMedia(n),this.HasArea){r={W:this.Scale(this.AreaWidth),H:this.Scale(this.AreaHeight)};t=1;do i=this.FindAreaPosition(n,r,t),(i.Fits||t==1)&&this.CreateArea(n,r,i),t++;while(i.Fits)}this.PreviewBody.appendChild(u)};PagePreviewElement.prototype.CreateArea=function(n,t,i){var r=document.createElement("div");if(AddCssClass(r,"Area"),this.BordersOn&&AddCssClass(r,"Borders"),i.Fits?AddCssClass(r,"Valid"):AddCssClass(r,"Invalid"),r.style.top=i.Top+"px",r.style.left=i.Left+"px",r.style.width=t.W+"px",r.style.height=t.H+"px",this.CuttingMarks){var u=10,f=function(r){var f=document.createElement("div");AddCssClass(f,"MarkH");f.style.top=r+"px";f.style.left=i.Left-u+"px";f.style.width=t.W+u*2+"px";n.Element.appendChild(f)},e=function(r){var f=document.createElement("div");AddCssClass(f,"MarkV");f.style.left=r+"px";f.style.top=i.Top-u+"px";f.style.height=t.H+u*2+"px";n.Element.appendChild(f)};f(i.Top);f(i.Top+t.H);e(i.Left);e(i.Left+t.W)}n.Element.appendChild(r)};PagePreviewElement.prototype.FindAreaPosition=function(n,t,i){for(var v=n.T,y=n.L,p=n.W-n.R-n.L,w=n.H-n.B-n.T,e=this.SpacingVertical,o=this.SpacingHorizontal,s=t.W,h=t.H,r={Fits:!1,Top:v,Left:y},c=function(n,t,i){return t*n+i*(n-1)},l=function(n,t,i){return t*(n-1)+i*(n-1)},a=0,f=1,u;c(f,h,e)<=w;){for(u=1;c(u,s,o)<=p;){if(a++,a==i){r.Fits=!0;r.Top=l(f,h,e)+n.T;r.Left=l(u,s,o)+n.L;break}u++}if(r.Fits)break;f++}return r};PagePreviewElement.prototype.CreateMedia=function(n){var t=document.createElement("div");AddCssClass(t,"Media");n.Element=t;t.style.width=n.W+"px";t.style.height=n.H+"px";var i=function(n,t){t.onfocus=function(){AddCssClass(n,"Highlight")};t.onblur=function(){RemoveCssClass(n,"Highlight")}},r=function(r,u){var f=document.createElement("div");AddCssClass(f,"MarginH");f.style.top=r+"px";f.style.left=n.L+"px";f.style.width=n.W-n.L-n.R+"px";t.appendChild(f);i(f,u)},u=function(r,u){var f=document.createElement("div");AddCssClass(f,"MarginV");f.style.left=r+"px";f.style.top=n.T+"px";f.style.height=n.H-n.T-n.B+"px";t.appendChild(f);i(f,u)};return n.L!=0&&u(n.L,this.MarginControls[this.LEFT]),n.R!=0&&u(n.W-n.R,this.MarginControls[this.RIGHT]),n.T!=0&&r(n.T,this.MarginControls[this.TOP]),n.B!=0&&r(n.H-n.B,this.MarginControls[this.BOTTOM]),t};PagePreviewElement.prototype.Scale=function(n){return n*this.SCALE};PagePreviewElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);this.AreaWidth=(n.getAttribute("area_width")||90)*1;this.AreaHeight=(n.getAttribute("area_height")||55)*1;this.HasArea=this.AreaWidth!==-1&&this.AreaHeight!==-1;t=function(n){this.Value=new Number(n).valueOf()};this.RotateCaption=n.getAttribute("rotate")||"Rotate";this.Margins=[new t(n.getAttribute("margin_left")||0),new t(n.getAttribute("margin_right")||0),new t(n.getAttribute("margin_top")||0),new t(n.getAttribute("margin_bottom")||0)];this.MarginCaps=[n.getAttribute("ml_cap"),n.getAttribute("mr_cap"),n.getAttribute("mt_cap"),n.getAttribute("mb_cap")];this.Paper=n.getAttribute("paper");this.HasArea&&(this.SpacingVertical=(n.getAttribute("spacing_vertical")||0)*1,this.SpacingHorizontal=(n.getAttribute("spacing_horizontal")||0)*1,this.SpacingVerticalCaption=n.getAttribute("spacing_vertical_caption")||"Vertical spacing",this.SpacingHorizontalCaption=n.getAttribute("spacing_horizontal_caption")||"Horizontal spacing",this.BordersOn=n.getAttribute("borders")=="true",this.BordersCaption=n.getAttribute("borders_caption")||"Borders",this.CuttingMarks=n.getAttribute("cutting_marks")=="true",this.CuttingMarksCaption=n.getAttribute("cutting_marks_caption")||"Cutting marks");this.Orientation=n.getAttribute("orientation")=="Portrait"?this.PORTRAIT:this.LANDSCAPE;i=(n.getAttribute("media_width")||210)*1;r=(n.getAttribute("media_height")||297)*1;this.MediaWidth=this.Orientation==this.PORTRAIT?i:r;this.MediaHeight=this.Orientation==this.PORTRAIT?r:i;this.MarginControls=[null,null,null,null]};PagePreviewElement.prototype.InitializeMe=function(){var t=this.GetParentBody(),n;this.Root=document.createElement("div");t.appendChild(this.Root);AddCssClass(this.Root,"row");AddCssClass(this.Root,"BadgeMediaEditor");n=document.createElement("div");AddCssClass(n,"col-sm-6");AddCssClass(n,"form");this.Root.appendChild(n);this.Body=n;this.CreateMarginFields();this.HasArea&&(this.CreateSpacingFields(),this.CreateBorderControl(),this.CreateMarksControl());this.CreateRotateButton();this.PreviewBody=document.createElement("div");AddCssClass(n,"col-sm-6");this.Root.appendChild(this.PreviewBody);AddCssClass(this.PreviewBody,"Preview");this.UpdateLayout();this.ContextMenu&&(this.InitializeTracker(),this.EventTracker.AddCallback("context menu",this,"ShowContextMenu",!1))};PagePreviewElement.prototype.CreateBorderControl=function(){var n=this,t=function(){return n.CreateCheckInput(n.BordersOn,function(t){n.BordersOn=t;n.UpdateLayout()})},i=this.CreateCheckSet(this.BordersCaption,t);this.Body.appendChild(i)};PagePreviewElement.prototype.CreateMarksControl=function(){var n=this,t=function(){return n.CreateCheckInput(n.CuttingMarks,function(t){n.CuttingMarks=t;n.UpdateLayout()})},i=this.CreateCheckSet(this.CuttingMarksCaption,t);this.Body.appendChild(i)};PagePreviewElement.prototype.CreateRotateButton=function(){var n=document.createElement("button"),t,i;n.setAttribute("type","button");AddCssClass(n,"btn btn-default");t=ActiveIconArchive.Get(RotateIconName).Create();n.appendChild(t);n.appendChild(document.createTextNode(" "+this.RotateCaption));i=this;n.onclick=function(){i.Rotate()};this.Body.appendChild(n)};PagePreviewElement.prototype.CreateMarginFields=function(){for(var t=this,i=this.Margins,r=this.MarginControls,n=0;n<this.Margins.length;n++){var u=function(n){return function(i){n.Value=i;t.UpdateLayout()}},f=function(){var f=t.CreateNumInput(i[n].Value,u(i[n]),"mm");return r[n]=f,f},e=this.CreateFieldSet(this.MarginCaps[n],f);this.Body.appendChild(e)}};PagePreviewElement.prototype.CreateSpacingFields=function(){var t=this,n=function(){var i=n.prototype.Field;return t.CreateNumInput(t[i],function(n){t[i]=n;t.UpdateLayout()},"mm")},i;n.prototype.Field="SpacingHorizontal";i=this.CreateFieldSet(this.SpacingHorizontalCaption,n);this.Body.appendChild(i);n.prototype.Field="SpacingVertical";i=this.CreateFieldSet(this.SpacingVerticalCaption,n);this.Body.appendChild(i)};PagePreviewElement.prototype.CreateCheckSet=function(n,t){var r=document.createElement("div"),i,u;return AddCssClass(r,"checkbox"),i=document.createElement("label"),r.appendChild(i),u=t(),i.appendChild(u),i.appendChild(document.createTextNode(" "+n)),r};PagePreviewElement.prototype.CreateFieldSet=function(n,t,i){var r=document.createElement("div"),u,f,s,e,o;return AddCssClass(r,"form-group"),u=document.createElement("label"),u.appendChild(document.createTextNode(n)),AddCssClass(u,"col-xs-4"),r.appendChild(u),f=document.createElement("div"),AddCssClass(f,"col-xs-6"),r.appendChild(f),s=t(),f.appendChild(s),i&&(AddCssClass(r,"has-feedback"),e=document.createElement("span"),AddCssClass(e,"form-control-feedback"),e.appendChild(document.createTextNode(i))),o=document.createElement("div"),AddCssClass(o,"col-xs-2"),r.appendChild(o),r};PagePreviewElement.prototype.CreateNumInput=function(n,t,i){var u=document.createElement("div"),r,f;return AddCssClass(u,"input-group"),r=CreateInput(""),u.appendChild(r),r.value=n,SetupNumericInput(r,0,255,1,null,function(){t(r.value)}),AddCssClass(r,"form-control"),i&&(f=document.createElement("span"),u.appendChild(f),AddCssClass(f,"input-group-addon"),f.appendChild(document.createTextNode(i))),u};PagePreviewElement.prototype.CreateCheckInput=function(n,t){var i=CreateInput("",n);return i.type="checkbox",i.checked=n,i.onclick=function(){t(i.checked)},i};PagePreviewElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};AuthorListElement.InheritsFrom(ElementBase);AuthorListElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.FontName=n.getAttribute("font_name");this.FontSize=n.getAttribute("font_size");var t=function(t){for(var f,e,u=[],r=n.selectNodes(t),i=0;i<r.length;i++)f=r[i].getAttribute("name"),e=r[i].getAttribute("index"),u.push({Name:f,Index:e});return u};this.Authors=t("./Authors/Item");this.Affiliations=t("./Affiliations/Item")};AuthorListElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.style.position="relative";n.id=this.Id;t=this.Parent.GetBodyElement();t.appendChild(n);this.Body=n;this.BuildAuthors();this.BuildAffiliations();this.EnableInteraction()};AuthorListElement.prototype.BuildAuthors=function(){var i=this.Authors,t=document.createElement("p"),n,r,u,f;for(this.SetFont(t),AddCssClass(t,"HtmlContent"),AddCssClass(t,"Authors"),n=0;n<i.length;n++)r=i[n].Name,n>0&&(r=(n==i.length-1?" and ":", ")+r),t.appendChild(document.createTextNode(r)),u=i[n].Index,u&&(f=document.createElement("sup"),f.appendChild(document.createTextNode(u)),t.appendChild(f));this.Body.appendChild(t)};AuthorListElement.prototype.SetFont=function(n){n.style.fontFamily=this.FontName;n.style.fontSize=this.FontSize+"pt"};AuthorListElement.prototype.BuildAffiliations=function(){var i=this.Affiliations,n=document.createElement("p"),t,u,f,r;for(this.SetFont(n),AddCssClass(n,"HtmlContent"),AddCssClass(n,"Affiliations"),t=0;t<i.length;t++)u=i[t].Name,f=i[t].Index,t>0&&n.appendChild(document.createElement("br")),r=document.createElement("sup"),r.appendChild(document.createTextNode(f)),n.appendChild(r),n.appendChild(document.createTextNode(u));this.Body.appendChild(n)};TextFromElsewhereElement.InheritsFrom(ElementBase);TextFromElsewhereElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.Html=FullTrim(GetCDataValue(n,"Html"));this.FontName=n.getAttribute("font_name");this.FontSize=n.getAttribute("font_size");this.Alignment=n.getAttribute("alignment");this.ScrollInto=n.getAttribute("scroll_into")};TextFromElsewhereElement.prototype.InitializeMe=function(){var t=document.createElement("div"),i,e,r,n,u,f;if(t.style.position="relative",t.id=this.Id,AddCssClass(t,"HtmlContent"),i=document.createElement("p"),i.style.fontFamily=this.FontName,i.style.fontSize=this.FontSize+"pt",i.style.textAlign=this.Alignment=="Justified"?"justify":this.Alignment.toLowerCase(),i.innerHTML=this.IsDesignMode&&(this.Html.length==0||this.Html=="<p>")?"...":this.Html,t.appendChild(i),e=this.Parent.GetBodyElement(),e.appendChild(t),this.Body=t,this.ScrollInto!==null){for(r=!1,n=this;!r&&n!==null;)n=n.Parent,n!==null&&(r=n.MyClassName=="FormTemplateElement"?!0:!1);u=n!==null?n.GetDescendantByName(this.ScrollInto):null;u!==null&&(f=document.getElementById(u.Id),f!==null&&f.scrollIntoView({block:"center"}))}this.EnableInteraction()};DocumentPreviewElement.InheritsFrom(ElementBase);DocumentPreviewElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);t=n.selectSingleNode("./PreviewMacro");this.PreviewMacro=new MacroElement(this,t.firstChild);t=n.selectSingleNode("./UpdateMacro");this.PreviewButton=new IconButtonElement(this,t.firstChild);this.PreviewButton.Caption=GetCDataValue(n,"Caption");this.PreviewButton.Icon=ActiveIconArchive.Get(PreviewIconName);this.PreviewButton.IsInline=!0;this.PreviewButton.IsDesignMode=this.IsDesignMode;i=this;r=function(){i.PreviewMacro.PerformAction()};this.PreviewButton.OnResponse=r};DocumentPreviewElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.style.position="relative";n.id=this.Id;this.Body=n;t=this.Parent.GetBodyElement();t.appendChild(n);this.PreviewButton.InitializeMe();this.EnableInteraction()};DocumentPageCountElement.InheritsFrom(ElementBase);DocumentPageCountElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);t=this;this.Caption=GetCDataValue(n,"Caption");this.MaxPages=(n.getAttribute("max_pages")||0)*1;i=n.selectSingleNode("./UpdateCounterMacro");this.UpdateMacro=new MacroElement(this,i.firstChild);i=n.selectSingleNode("./UpdateFormMacro");this.UpdateButton=new IconButtonElement(this,i.firstChild);this.UpdateButton.Icon=ActiveIconArchive.Get(RefreshIconName);this.UpdateButton.IsInline=!0;this.UpdateButton.IsDesignMode=this.IsDesignMode;r=function(){t.UpdateMacro.PerformAction()};this.UpdateButton.OnResponse=r;this.UpdateButton.OnClick=function(){t.SetWaiting();t.UpdateButton.PerformAction()}};DocumentPageCountElement.prototype.RelayedResponse=function(n){var t=(n.getAttribute("count")||0)*1;this.SetCount(t)};DocumentPageCountElement.prototype.SetCount=function(n){this.MaxPages>0&&n>this.MaxPages?AddCssClass(this.VariableContainer,"CounterInvalid"):RemoveCssClass(this.VariableContainer,"CounterInvalid");this.CountContainer.innerHTML=this.MaxPages?n+"/"+this.MaxPages:n;this.Spinner.style.display="none"};DocumentPageCountElement.prototype.SetWaiting=function(){this.CountContainer.innerHTML="";this.Spinner.style.display=""};DocumentPageCountElement.prototype.InitializeMe=function(){var n=document.createElement("div"),i,t;n.style.position="relative";n.id=this.Id;AddCssClass(n,"Caption");this.Body=n;i=this.Parent.GetBodyElement();i.appendChild(n);t=document.createElement("span");t.appendChild(document.createTextNode(this.Caption+" "));this.VariableContainer=document.createElement("span");AddCssClass(this.VariableContainer,"Counter");this.CountContainer=document.createElement("span");this.Spinner=new Image;this.Spinner.src=LoadingImagePath;this.VariableContainer.appendChild(this.CountContainer);this.VariableContainer.appendChild(this.Spinner);t.appendChild(this.VariableContainer);n.appendChild(t);this.UpdateButton.InitializeMe();this.EnableInteraction()};DocumentPageCountElement.prototype.PostInitialized=function(){if(this.IsDesignMode)this.SetCount(0);else{var n=this;window.setTimeout(function(){n.UpdateMacro.PerformAction()},100)}};HtmlEditorElement.InheritsFrom(ElementBase);HtmlEditorElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.HtmlFilter=n.getAttribute("html_filter");t=n.getAttribute("filter_def");this.FilterDef=JSON.parse(t);this.Html=FullTrim(GetCDataValue(n,"Html"));i=n.selectSingleNode("./PickerMacro");this.VariablePickerMacro=new MacroElement(this,i.firstChild);this.LoadLinks(n);this.IsSourceMode=!1;this.BackgroundColor=!0;this.CharacterCounter=n.getAttribute("char_counter")=="true";this.CharacterCounter&&(this.CharactersText=n.getAttribute("characters_text"));this.HideTableShadowLines=n.getAttribute("hide_table_lines")=="true"};HtmlEditorElement.prototype.LoadLinks=function(n){var u,r,t,i,f;for(this.Links=[],u=function(n,t){this.Url=n;this.Title=t;this.Description=t+"("+n+")"},r=n.selectNodes("./Links/Link"),t=0;t<r.length;t++)i=r[t],i.firstChild&&(f=GetHttpsRootUrl()+"/"+i.getAttribute("url"),this.Links.push(new u(f,i.firstChild.nodeValue)));this.LinksTitle="Links"};HtmlEditorElement.prototype.InsertSystemLink=function(n,t){var i=document.createElement("a"),r;i.href=t.Url;i.appendChild(document.createTextNode(t.Title));i.target="_blank";r=new CKEDITOR.dom.element(i);n.insertElement(r)};HtmlEditorElement.prototype.GetSystemLinks=function(){return this.Links};HtmlEditorElement.prototype.GetValuesAsQuery=function(n){var t;if(this.ContentChanged){if(this.IsSourceMode&&(this.Html=this.Editor.getData()),t=this.Html,this.IsTextOnlyMode=="True"){var i=new RegExp("<(?!\\/?span)[^>]+>","g"),r=new RegExp("\n","g"),u=new RegExp("&nbsp;","g");t=t.replace(i,"");t=t.replace(r,"");t=t.replace(u," ")}n.Add(this.Name,t)}};HtmlEditorElement.prototype.RelayedResponse=function(n){var i,r;if(this.CKEditor){var u=$(n).attr("value"),f=GetCDataValue(n),t=document.createElement("span");t.className="AirSource";t.setAttribute("airsource",u);t.setAttribute("contenteditable","false");t.appendChild(document.createTextNode(f));i=new CKEDITOR.dom.element(t);this.CKEditor.insertElement(i);r=document.createTextNode(" ");i=new CKEDITOR.dom.element(r);this.CKEditor.insertElement(i)}};HtmlEditorElement.prototype.PickVariable=function(n){this.CKEditor=n;this.VariablePickerMacro.PerformAction()};HtmlEditorElement.prototype.BuildCKEditorMenu=function(n){var i=new CKEditorMenuInjection(n),t=this.GetNextChildByClass("Menu");t&&i.InjectSourcePicker(t)};HtmlEditorElement.prototype.GetContextCoordinates=function(){var n,t;return this.CkMouseX&&this.CkMouseY?n={Left:this.CkMouseX,Right:this.CkMouseX+20,Top:this.CkMouseY,Bottom:this.CkMouseY+20}:(t=this.Parent.GetBodyElement(),n=new LayerCoordinates(t)),n};HtmlEditorElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.id=this.Id;AddCssClass(n,"HtmlContent");AddCssClass(n,"HtmlEditor");n.innerHTML=this.Html;t=this.Parent.GetBodyElement();t.appendChild(n);this.Body=n;this.StartEdit(n)};HtmlEditorElement.prototype.StartEdit=function(n){var i=this,r=new CKEditorHelper(n,this),u,f,t;for(d in this.FilterDef)u=this.FilterDef[d],f=(this.HtmlFilter&u)!=0,r.Allow[d]=f;t=r.StartCKEditFrame(null,function(){});t.on("change",function(){i.ContentChanged=!0;i.Html=this.getData()});t.on("mode",function(){i.IsSourceMode=t.mode=="source";i.IsSourceMode&&(i.ContentChanged=!0)});t.CharactersText=this.CharactersText;this.Editor=t};BoolAlgebraElement.InheritsFrom(ElementBase);BoolAlgebraElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.SubjectTitle=GetCDataValue(n,"SubjectTitle");this.IsPositive=n.getAttribute("positive")=="true";this.PositiveTitle=GetCDataValue(n,"PositiveTitle");this.NegativeTitle=GetCDataValue(n,"NegativeTitle");this.Table=new AlgebraTable(this,n);t=n.selectSingleNode("OnAddMacro");this.OnAddMacro=new MacroElement(this,t.firstChild);i=n.selectSingleNode("OnEditMacro");this.OnEditMacro=new MacroElement(this,i.firstChild)};BoolAlgebraElement.prototype.InitializeMe=function(){var n=this.Parent.GetBodyElement();this.Table.Create(n)};BoolAlgebraElement.prototype.ShowContextMenu=function(n,t,i){return this.ContextMenu.CreateMenu(t,i),!1};BoolAlgebraElement.prototype.OnAddNode=function(n,t,i,r,u){this.ContextLeft=t;this.ContextTop=i;this.OnAddMacro.ClearClientArguments();r&&this.OnAddMacro.AddClientArgument(WorkflowValueName.Node,"[string]"+r);u&&this.OnAddMacro.AddClientArgument(WorkflowValueName.ParentNode,"[string]"+u);this.OnAddMacro.PerformAction()};BoolAlgebraElement.prototype.GetContextCoordinates=function(){var n=new Size(5,5),t=new Position2D(this.ContextLeft,this.ContextTop);return new Coordinates(t,n)};BoolNode.Width=80;BoolNode.ConcreteHeight=70;BoolNode.VirtualHeight=38;BoolNode.VirtualAnd="and";BoolNode.VirtualOr="or";BoolNode.VerticalSpace=20;BoolNode.HorizontalSpace=60;BoolNode.prototype.GetDepth=function(n){var t=this.FirstChild,i,r;for(n||(n=0),i=n;t;)r=t.GetDepth(n+1),r>i&&(i=r),t=t.NextSibling;return i};BoolNode.prototype.Arrange=function(n,t){var r=n,u,i;for(this.IsRoot||(u=t.GetTop(this.RowIndex),this.Move(r,u,t),r+=this.Width),i=this.FirstChild;i;)i.Arrange(r+BoolNode.HorizontalSpace,t),i=i.NextSibling};BoolNode.prototype.Create=function(n,t){var i,r;for(this.IsRoot?this.FirstChild&&t.AddRow(this.FirstChild.Height+BoolNode.VerticalSpace,!0):(i=document.createElement("div"),n.appendChild(i),AddCssClass(i,"AlgebraBox"),AddCssClass(i,this.IsVirtual?"VirtualBox":"ConcreteBox"),i.style.height=this.Height+"px",i.style.width=this.Width+"px",this.EventTracker=new EventTracking(null,i),this.EventTracker.AddCallback("click",this,"OnClick"),this.IsVirtual?i.appendChild(ActiveIconArchive.Get(AddIconName).Create()):this.CreateBoxContent(i),this.Box=i),r=this.FirstChild;r;)r.RowIndex=t.GetCurrentIndex(),r.Create(n,t),r=r.NextSibling,r&&t.AddRow(r.Height+BoolNode.VerticalSpace,!r.IsVirtual)};BoolNode.prototype.CreateBoxContent=function(n){var r=document.createElement("div"),t,i;AddCssClass(r,"Content");AddCssClass(r,"Source");r.appendChild(document.createTextNode(this.Source));n.appendChild(r);t=document.createElement("div");AddCssClass(t,"Content");AddCssClass(t,"Operator");t.appendChild(document.createTextNode(this.Operator));n.appendChild(t);i=document.createElement("div");AddCssClass(i,"Content");AddCssClass(i,"Value");i.appendChild(document.createTextNode(this.Value));n.appendChild(i)};BoolNode.prototype.OnClick=function(n,t,i){this.IsVirtual;this.Element.OnAddNode(n,t,i,this.Id,this.ParentId)};BoolNode.prototype.Move=function(n,t,i){var o=i.GetRowHeight(this.RowIndex)-this.Height,l=o==0?0:o/2,h,c;this.Left=n;this.Top=t+l;this.Box.style.left=this.Left+"px";this.Box.style.top=this.Top+"px";var e=this.Parent.Left+this.Parent.Width,s=this.PreviousSibling!=null,u=i.IsRowConcrete(this.RowIndex),f=this.Box.parentNode,r=s?e+(n-e)/2:e,t=this.Top+this.Height/2;this.DrawLine(r,t,n,t,f,u);s&&(h=this.PreviousSibling.Top+Math.ceil(this.PreviousSibling.Height/2),this.DrawLine(r,h,r,t,f,u));this.FirstChild||(n=n+this.Width,c=new LayerSize(f),r=n+c.Width-n,this.DrawLine(n,t,r,t,f,u,u))};BoolNode.prototype.DrawLine=function(n,t,i,r,u,f,e){var o=document.createElement("div"),s;AddCssClass(o,"Line");e&&AddCssClass(o,"EndOfLine");f||AddCssClass(o,"VirtualLine");u.appendChild(o);s=t!=r;s?(AddCssClass(o,"VerticalLine"),o.style.top=t+0+"px",o.style.left=n+"px",o.style.height=r-t-0+"px"):(o.style.top=t+"px",o.style.left=n+"px",o.style.width=i-n+"px")};BoolNode.prototype.AppendChild=function(n){this.Children++;this.LastChild?(n.PreviousSibling=this.LastChild,this.LastChild.NextSibling=n,this.LastChild=n):(this.FirstChild=n,this.LastChild=n);n.Parent=this};BoolNode.prototype.LoadChildren=function(n){for(var t,i=n.selectNodes("./BoolNode"),r=0;r<i.length;r++)this.AppendChild(new BoolNode(this.Element,i[r]));i.length==0?(t=new BoolNode(this.Element,null,BoolNode.VirtualAnd),this.AppendChild(t)):(t=new BoolNode(this.Element,null,BoolNode.VirtualOr),this.AppendChild(t));t.ParentId=this.Id};TreeArranger.prototype.AddRow=function(n,t){var i={Height:n,IsConcrete:t==!0};this.Rows.push(i)};TreeArranger.prototype.CountRows=function(){return this.Rows.length};TreeArranger.prototype.GetCurrentIndex=function(){return this.Rows.length-1};TreeArranger.prototype.IsRowConcrete=function(n){return this.Rows[n].IsConcrete};TreeArranger.prototype.GetRowHeight=function(n){return this.Rows[n].Height};TreeArranger.prototype.GetTop=function(n){for(var i=0,t=0;t<n;t++)i+=this.Rows[t].Height;return i};TreeArranger.prototype.GetHeight=function(){for(var t=0,n=0;n<this.Rows.length;n++)t+=this.Rows[n].Height;return t};AlgebraTable.prototype.Create=function(n){var i=document.createElement("div"),r,t,u,e,s,o,f;return this.Root=i,AddCssClass(i,"AlgebraContainer"),n.appendChild(i),r=document.createElement("div"),AddCssClass(r,"SideContent"),AddCssClass(r,"LeftContent"),i.appendChild(r),r.appendChild(document.createTextNode(this.Element.SubjectTitle)),t=document.createElement("div"),i.appendChild(t),u=document.createElement("div"),AddCssClass(u,"SideContent"),AddCssClass(u,"RightContent"),i.appendChild(u),u.appendChild(document.createTextNode(this.Element.IsPositive?this.Element.PositiveTitle:this.Element.NegativeTitle)),e=new TreeArranger,this.RootNode.Create(t,e),s=this.RootNode.GetDepth(),o=BoolNode.Width*s+BoolNode.HorizontalSpace*(s+1),o<300&&(o=300),f=e.GetHeight(),f<200&&(f=200),r.style.height=f+"px",u.style.height=f+"px",t.style.width=o+"px",t.style.height=f+"px",AddCssClass(t,"AlgebraTable"),this.Body=t,this.RootNode.Arrange(0,e),t};VisibilityUpdater.prototype.ApplyChanges=function(){this.ProcessHidden(this.HiddenNodes);this.ProcessVisible(this.VisibleNodes);this.ButtonsNode&&this.ProcessButtons(this.ButtonsNode)};VisibilityUpdater.prototype.ProcessButtons=function(n){var o=n.getAttribute("container"),t=ElementIndex.Get(o),i,u,r,e,f;if(t){if(t.Buttons){for(i=0;i<t.Buttons.length;i++)t.Buttons[i].IsFixed||t.Buttons[i].Remove();t.Buttons=[]}for(u=n.selectNodes("./*"),r=0;r<u.length;r++)e=u[r],f=t.CreateInstance(e),t.AppendChild(f),f.Initialize()}};VisibilityUpdater.prototype.ProcessVisible=function(n){for(var u,i=0;i<n.length;i++){var t=n[i],r=t.getAttribute("name"),f=t.getAttribute("subOption");f?this.ElementOptionExists(r,f)?this.UpdateElementOption(t):this.ShowElementOption(t):this.ElementExists(r)?t.firstChild.localName=="ContainerColumnElement"&&(u=this.FindElement(this.RootElement,r),u&&u.ReinitializeClass()):this.ShowElement(t)}};VisibilityUpdater.prototype.UpdateElementOption=function(n){var u=n.getAttribute("name"),e=n.getAttribute("subOption"),f=n.getAttribute("selected")=="true"||!1,o=n.getAttribute("disabled")=="true"||!1,i=u?this.FindElement(this.RootElement,u):null,r,t;if(i)for(r=0;r<i.Options.length;r++)if(t=i.Options[r],t.Value==e){t.Selected!=f&&(t.Selected=f,t.Disabled=o,i.RebuildOptions());break}};VisibilityUpdater.prototype.ShowElementOption=function(n){var f=n.getAttribute("name"),t=f?this.FindElement(this.RootElement,f):null,i,r,u;i=n.getAttribute("previous_siblings");r=i?this.FindFirstElementOption(t,i.split(",")):null;i=n.getAttribute("next_siblings");u=i?this.FindFirstElementOption(t,i.split(",")):null;t||(t=r?r.Parent:u?u.Parent:null);t&&t.AddOption(n,r,u)};VisibilityUpdater.prototype.FindFirstElementOption=function(n,t){var r=null,i;if(n!=null)for(i=0;i<t.length;i++)if(r=n.FindOptionElement(t[i]),r)break;return r};VisibilityUpdater.prototype.ShowElement=function(n){var o=n.getAttribute("parent"),i=o?this.FindElement(this.RootElement,o):null,r,u,f,e,t;r=n.getAttribute("previous_siblings");u=r?this.FindFirstElement(i||this.RootElement,r.split(",")):null;r=n.getAttribute("next_siblings");f=r?this.FindFirstElement(i||this.RootElement,r.split(",")):null;i||(i=u?u.Parent:f?f.Parent:null);i&&(e=n.firstChild,t=i.CreateInstance(e),u?(i.InsertAfter(t,u),t.MyClassName=="ContainerColumnElement"&&u.MyClassName=="ContainerColumnElement"&&this.RefreshPreviousSiblingsCss(t)):f?i.InsertBefore(t,f):i.AppendChild(t),t.ElementNodeInterface&&t.CreateChildNodes(e),t.Initialize(),this.SetDOMPosition(t),this.UpdateAlignment(t),t.Reveal())};VisibilityUpdater.prototype.RefreshPreviousSiblingsCss=function(n){for(var t=n.PreviousSibling,i=n;t;)t.NextSibling||(t.NextSibling=i),t.ReinitializeClass(),t.Reveal(),i=t,t=t.PreviousSibling};VisibilityUpdater.prototype.UpdateAlignment=function(n){n.Parent.AlignElements&&n.Parent.AlignElements()};VisibilityUpdater.prototype.SetDOMPosition=function(n){if(n.NextSibling){for(var i=n.GetRootElement(),r=i.parentNode,t=n.NextSibling.GetRootElement();t&&t.parentNode!=r;)t=t.parentNode;i.parentNode.removeChild(i);r.insertBefore(i,t)}};VisibilityUpdater.prototype.FindFirstElement=function(n,t){for(var i=null,r=0;r<t.length;r++)if(i=this.FindElement(n,t[r]),i)break;return i};VisibilityUpdater.prototype.FindElement=function(n,t){var i=null,r=function(n){var r;return n.Name==t?(i=n,r=OnEachResult.BreakTree):r=OnEachResult.Continue,r};return n.OnEach(r),i};VisibilityUpdater.prototype.ElementExists=function(n){var t=!1,i=function(i){return i.Name==n&&(t=!0),t?OnEachResult.BreakTree:OnEachResult.Continue};return this.RootElement.OnEach(i),t};VisibilityUpdater.prototype.ElementOptionExists=function(n,t){var i=!1,r=function(r){return r.Name==n&&r.FindOptionElement(t)&&(i=!0),i?OnEachResult.BreakTree:OnEachResult.Continue};return this.RootElement.OnEach(r),i};VisibilityUpdater.prototype.ProcessHidden=function(n){for(var i,r,t=0;t<n.length;t++)i=n[t].getAttribute("subOption"),r=n[t].getAttribute("name"),i?this.HideOption(r,i):this.HideElements(r)};VisibilityUpdater.prototype.HideElements=function(n){var t=function(t){return t.Name==n&&t.FadeAway(),OnEachResult.Continue};this.RootElement.OnEach(t)};VisibilityUpdater.prototype.HideOption=function(n,t){var i=function(i){return i.Name==n&&i.HideOption(t),OnEachResult.Continue};this.RootElement.OnEach(i)};ButtonsUpdater.prototype.ApplyChanges=function(){this.ButtonsNode&&this.ProcessButtons(this.ButtonsNode)};ButtonsUpdater.prototype.ProcessButtons=function(n){var o=n.getAttribute("container"),t=ElementIndex.Get(o),i,u,r,e,f;if(t){if(t.Buttons){for(i=0;i<t.Buttons.length;i++)t.Buttons[i].IsFixed||t.Buttons[i].Remove();t.Buttons=[]}for(u=n.selectNodes("./*"),r=0;r<u.length;r++)e=u[r],f=t.CreateInstance(e),t.AppendChild(f),f.Initialize()}};SearchElement.InheritsFrom(ElementBase);SearchElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);var t=n.selectSingleNode("./OnSearchMacro");t&&(this.OnSearchMacro=new MacroElement(this,t.firstChild))};SearchElement.prototype.InitializeMe=function(){var n=document.createElement("div"),f=this.GetParentBody(),e,t,u,i,r;f.appendChild(n);e=this.Parent;t=CreateInput(this.Id+"_inp");t.type="text";t.maxLength=20;n.appendChild(t);this.Parent.IsToolbarElement?(AddCssClass(n,"form-group has-feedback"),AddCssClass(t,"form-control"),AddCssClass(n,"btn-group"),$(n).append('<span class="glyphicon glyphicon-search form-control-feedback"><\/span>')):(AddCssClass(n,"SearchBox"),u=ActiveIconArchive.Get(SearchIconName).Create(),n.appendChild(u));i=this;r=function(){var n=i.OnSearchMacro||i.Parent.OnSearchMacro;n.AddClientArgument(i.Name,encodeURIComponent(t.value));n.PerformAction()};this.EventTracker=new EventTracking(null,t);this.EventTracker.AddCallbackFunction("key up",function(n){n===13&&r()},!0);this.EventTracker.AddCallbackFunction("change",r,!0);this.Body=n};HtmlThumbnailElement.InheritsFrom(ElementBase);HtmlThumbnailElement.prototype.GetXmlNodeData=function(n){var t,i,r,u,f;ElementBase.prototype.GetXmlNodeData.call(this,n);this.Html=FullTrim(GetCDataValue(n,"Html"));t=n.selectSingleNode("./size");i=t.getAttribute("unit")=="Millimeters";this.UnitIsMM=i;var e=n.getAttribute("margin_top")*1,o=n.getAttribute("margin_bottom")*1,s=n.getAttribute("margin_left")*1,h=n.getAttribute("margin_right")*1;this.MarginTop=e;this.MarginBottom=o;this.MarginLeft=s;this.MarginRight=h;r=t.getAttribute("width")*1;u=t.getAttribute("height")*1;this.OriginalWidth=r;this.OriginalHeight=u;this.Scale=n.getAttribute("scale");this.SmallScale=MillimetersFromPixels(256);this.MediumScale=MillimetersFromPixels(512);this.LargeScale=MillimetersFromPixels(800);f=new LayerSize(document.body);this.MaxScale=MillimetersFromPixels(f.Height);this.IsExpanded=!1};HtmlThumbnailElement.prototype.SetScale=function(n,t,i){var u,o,s,i;u=i=="Small"?this.SmallScale:i=="Medium"?this.MediumScale:i=="Large"?this.LargeScale:this.MaxScale;var f=u/this.OriginalWidth,e=u/this.OriginalHeight,r=e<f?e:f;r>1&&(r=1);o=this.OriginalWidth*r;s=this.OriginalHeight*r;n.style.width=o+"mm";n.style.height=s+"mm";i="scale("+r+")";t.style.transform=i};HtmlThumbnailElement.prototype.ToggleExpand=function(){var n,f,t;if(this.IsExpanded)this.ExpandedBody.parentNode.removeChild(this.ExpandedBody),this.ExpandedBody=null,this.IsExpanded=!1;else{n=document.createElement("div");n.style.position="absolute";n.style.top="10px";n.style.left="10px";n.style.zIndex="100";f=this.CreateThumbnail(n,"Max");document.body.appendChild(n);this.ExpandedBody=n;var r=new LayerSize(n),u=new LayerSize(document.body),i=Math.round(u.Height/2-r.Height/2);i<0&&(i=0);t=Math.round(u.Width/2-r.Width/2);t<0&&(t=0);n.style.top=i+"px";n.style.left=t+"px";this.IsExpanded=!0}};HtmlThumbnailElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t,i;n.style.position="relative";n.id=this.Id;this.Body=n;t=this.CreateThumbnail(n,this.Scale);this.Content=t;i=this.Parent.GetBodyElement();i.appendChild(n);this.EnableInteraction()};HtmlThumbnailElement.prototype.CreateThumbnail=function(n,t){var i,r,u;return AddCssClass(n,"HtmlThumbnailContainer"),i=document.createElement("div"),r=this.UnitIsMM?"mm":"px",i.style.paddingLeft=this.MarginLeft+r,i.style.paddingTop=this.MarginTop+r,i.style.paddingBottom=this.MarginBottom+r,i.style.paddingRight=this.MarginRight+r,i.style.width=this.OriginalWidth+"mm",i.style.height=this.OriginalHeight+"mm",i.style.transformOrigin="0 0",u=this,i.onclick=function(){u.ToggleExpand()},this.SetScale(n,i,t),AddCssClass(i,"HtmlThumbnail"),i.innerHTML=this.Html,n.appendChild(i),i};DIBSElement.InheritsFrom(ElementBase);DIBSElement.prototype.GetXmlNodeData=function(n){var t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);this.LanguageCode=n.getAttribute("language_code");this.MerchantId=n.getAttribute("merchant");this.Amount=n.getAttribute("amount");this.Account=n.getAttribute("account");this.Currency=n.getAttribute("currency");this.MD5=n.getAttribute("md5");this.OrderId=n.getAttribute("orderid");this.AcceptUrl=n.getAttribute("accepturl");this.CallbackUrl=n.getAttribute("callbackurl");this.CancelUrl=n.getAttribute("cancelurl");this.TestMode=n.getAttribute("testmode");t=GetCDataValue(n,"content");this.Content=JSON.parse(t);i=GetCDataValue(n,"delivery");this.Delivery=JSON.parse(i)};DIBSElement.prototype.InitializeMe=function(){var n=document.createElement("form"),t;n.method="POST";n.action="https://payment.architrade.com/paymentweb/start.action";this.AddFormValue(n,"lang",this.LanguageCode);this.AddFormValue(n,"merchant",this.MerchantId);this.Account&&this.AddFormValue(n,"account",this.Account);this.AddFormValue(n,"decorator","responsive");this.AddFormValue(n,"amount",this.Amount);this.AddFormValue(n,"currency",this.Currency);this.AddFormValue(n,"orderid",this.OrderId);this.AddFormValue(n,"accepturl",this.AcceptUrl);this.AddFormValue(n,"callbackurl",this.CallbackUrl);this.AddFormValue(n,"cancelurl",this.CancelUrl);this.AddFormValue(n,"md5",this.MD5);this.AddFormValue(n,"capturenow","foo");this.TestMode&&this.AddFormValue(n,"test","foo");this.AddFormValue(n,"color","blue");this.CreateOrderInfo(n);this.CreateDeliveryInfo(n);t=this.Parent.GetBodyElement();t.appendChild(n);n.submit()};DIBSElement.prototype.CreateDeliveryInfo=function(n){for(var t,r=this.Delivery,u=1,i=0;i<r.Lines.length;i++)t=r.Lines[i],t.Value&&(this.AddFormValue(n,"delivery"+u+"."+t.Title,t.Value),u++)};DIBSElement.prototype.CreateOrderInfo=function(n){var u,t,i,r;for(this.BuildOrderInfoHeader(n),u=this.Content,t=0;t<u.Lines.length;t++)i=t+1,r=u.Lines[t],this.AddFormValue(n,"ordline"+i+"-1",r.Title),this.AddFormValue(n,"ordline"+i+"-2",r.AtPriceInclVat),this.AddFormValue(n,"ordline"+i+"-3",r.Quantity),this.AddFormValue(n,"ordline"+i+"-4",r.PriceInclVat)};DIBSElement.prototype.BuildOrderInfoHeader=function(n){var t=this.Content;this.AddFormValue(n,"ordline0-1",t.Headers.Title);this.AddFormValue(n,"ordline0-2",t.Headers.AtPriceInclVat);this.AddFormValue(n,"ordline0-3",t.Headers.Quantity);this.AddFormValue(n,"ordline0-4",t.Headers.PriceInclVat)};DIBSElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};ShoppingCartElement.InheritsFrom(ElementBase);ShoppingCartElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);var t=GetCDataValue(n,"content");this.Content=t?JSON.parse(t):null};ShoppingCartElement.prototype.ContentReloader=function(n){if(this.Body){this.Table&&this.Body.removeChild(this.Table.Element);var t=GetCDataValue(n,"content");this.Content=JSON.parse(t);ShoppingCartElement.prototype.BuildContents.call(this,this.Content)}};ShoppingCartElement.prototype.BuildContents=function(n){var f=function(t){for(var f=0;f<n.Lines.length;f++){var e=t.AddRow(),r=n.Lines[f],i,u=function(){var n=e.AddCell();return AddCssClass(n.Element,"NoWrap"),n};n.Settings.ShowArticleName&&(i=u(),i.SetHtml(r.Title));n.Settings.ShowArticleAlias&&(i=u(),i.SetHtml(r.Alias));n.Settings.ShowArticleNumber&&(i=u(),i.SetHtml(r.Number));n.Settings.ShowAtPrice&&(i=u(),i.SetHtml(r.AtPrice),AddCssClass(i.Element,"Numeric"));n.Settings.ShowAtPriceInclVat&&(i=u(),i.SetHtml(r.AtPriceInclVat),AddCssClass(i.Element,"Numeric"));n.Settings.ShowQuantity&&(i=u(),i.SetHtml(r.Quantity),AddCssClass(i.Element,"Numeric"));n.Settings.ShowVatPercent&&(i=u(),i.SetHtml(r.Vat),AddCssClass(i.Element,"Numeric"));n.Settings.ShowPriceExVat&&(i=u(),i.SetHtml(r.Price),AddCssClass(i.Element,"Numeric"));n.Settings.ShowPriceIncVat&&(i=u(),i.SetHtml(r.PriceInclVat),AddCssClass(i.Element,"Numeric"))}},e=function(t){var r=t.AddHeaderRow(),i=function(){var n=r.AddHeaderCell();return AddCssClass(n.Element,"NoWrap"),n};return n.Settings.ShowArticleName&&i().SetHtml(n.Headers.Title),n.Settings.ShowArticleAlias&&i().SetHtml(n.Headers.Alias),n.Settings.ShowArticleNumber&&i().SetHtml(n.Headers.Number),n.Settings.ShowAtPrice&&i().SetHtml(n.Headers.AtPrice),n.Settings.ShowAtPriceInclVat&&i().SetHtml(n.Headers.AtPriceInclVat),n.Settings.ShowQuantity&&i().SetHtml(n.Headers.Quantity),n.Settings.ShowVatPercent&&i().SetHtml(n.Headers.Vat),n.Settings.ShowPriceExVat&&i().SetHtml(n.Headers.Price),n.Settings.ShowPriceIncVat&&i().SetHtml(n.Headers.PriceInclVat),r.Cells.length},t=new Table,o=e(t),r,u,i;for(f(t),r=t.AddRow(),u=0;u<o-1;u++)r.AddCell();i=r.AddCell();AddCssClass(i.Element,"Numeric");AddCssClass(i.Element,"ValueHighlight");i.SetHtml(n.Sum);this.Body.appendChild(t.Element);this.Table=t};ShoppingCartElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;n.id=this.Id;t=this.GetParentBody();t.appendChild(n);this.Body=n;AddCssClass(n,"ShoppingCart");AddCssClass(n,"TableContainer");this.Content!==null&&this.BuildContents(this.Content);this.EnableInteraction()};ShoppingCartTemplateElement.InheritsFrom(TemplateElement);ShoppingCartTemplateElement.prototype.GetXmlNodeData=function(n){TemplateElement.prototype.GetXmlNodeData.call(this,n);var t=GetCDataValue(n,"content");this.Content=JSON.parse(t)};ShoppingCartTemplateElement.prototype.ContentReloader=function(n){ShoppingCartElement.prototype.ContentReloader.call(this,n)};ShoppingCartTemplateElement.prototype.OnResize=function(){this.Body&&this.Coordinates.SetDomCoordinates(this.Body);TemplateElement.prototype.OnResize.call(this)};ShoppingCartTemplateElement.prototype.InitializeMe=function(){var n=document.createElement("div");n.id=this.Id;n.style.position="absolute";this.Body=n;this.Floor.GetBodyElement().appendChild(n);AddCssClass(n,this.Name);this.Coordinates.ConvertToUnits(this.Floor.AbsPosConversion.ToPixels);AddCssClass(n,"ShoppingCart");AddCssClass(n,"TableContainer");SetTransparency(this.Body,this.Transparency);ShoppingCartElement.prototype.BuildContents.call(this,this.Content);this.Coordinates.SetDomCoordinates(this.Body)};PayExElement.InheritsFrom(ElementBase);PayExElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.PayExRedirectURL=n.getAttribute("redirectURL")};PayExElement.prototype.InitializeMe=function(){window.location.href=this.PayExRedirectURL};PayExElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};SwedbankPayElement.InheritsFrom(ElementBase);SwedbankPayElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.SwedbankPayRedirectURL=n.getAttribute("redirectURL")};SwedbankPayElement.prototype.InitializeMe=function(){window.location.href=this.SwedbankPayRedirectURL};SwedbankPayElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};NetsEasyElement.InheritsFrom(ElementBase);NetsEasyElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.NetsEasyRedirectUrl=n.getAttribute("redirectURL")};NetsEasyElement.prototype.InitializeMe=function(){window.location.href=this.NetsEasyRedirectUrl};NetsEasyElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};NetaxeptElement.InheritsFrom(ElementBase);NetaxeptElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.NetAxeptRedirectUrl=n.getAttribute("redirectURL")};NetaxeptElement.prototype.InitializeMe=function(){window.location.href=this.NetAxeptRedirectUrl};NetaxeptElement.prototype.AddFormValue=function(n,t,i){var r=CreateInput(t);r.type="hidden";r.value=i;n.appendChild(r)};ComponentPickerElement.InheritsFrom(ElementBase);ComponentPickerElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);t=n.selectSingleNode("SelectMacro");this.SelectMacro=new MacroElement(this,t.firstChild);i=GetCDataValue(n,"Index");r=JSON.parse(i);this.Index=r.Index;this.CanvasIndex=0};ComponentPickerElement.prototype.InitializeMe=function(){var n=this;FabricInitialization(function(){n.BuildPicker()})};ComponentPickerElement.prototype.BuildPicker=function(){var n=document.createElement("div"),t,i,r,u;for(AddCssClass(n,"container"),n.id=this.Id,this.Parent.GetBodyElement().appendChild(n),t=document.createElement("div"),n.appendChild(t),AddCssClass(t,"panel-group"),i=document.createElement("div"),t.appendChild(i),AddCssClass(i,"panel panel-default"),this.PanelIndex=0,r=0;r<this.Index.length;r++)u=this.Index[r],this.BuildCategory(i,u)};ComponentPickerElement.prototype.BuildCategory=function(n,t){var e="cppanel"+this.Id+"_"+this.PanelIndex++,u=document.createElement("div"),f,i,r;n.appendChild(u);AddCssClass(u,"panel-heading");f=document.createElement("h4");u.appendChild(f);AddCssClass(f,"panel-title");i=document.createElement("a");u.appendChild(i);i.setAttribute("data-toggle","collapse");i.setAttribute("href","#"+e);i.appendChild(document.createTextNode(t.Category));r=document.createElement("div");n.appendChild(r);AddCssClass(r,"panel-collapse collapse");r.id=e;this.BuildComponentsList(r,t.Components)};ComponentPickerElement.prototype.BuildComponentsList=function(n,t){for(var o,s,y,r,i,l,a,h=4,u=0,f,c=t.length/h,p=Math.ceil(c),v=p==c?0:Math.floor(c),w=t.length-v,e=0;e<t.length;e++)o=t[e],u==0&&(f=document.createElement("div"),n.appendChild(f),AddCssClass(f,"row")),s=document.createElement("div"),f.appendChild(s),y=e>=w?12/v:12/h,AddCssClass(s,"col-sm-"+y),r=document.createElement("div"),s.appendChild(r),AddCssClass(r,"ComponentPickerItem"),i=document.createElement("a"),r.appendChild(i),i.setAttribute("href","#"),i.ComponentId=o.Id,l=this,i.onclick=function(){l.SelectMacro.AddClientArgument("_component_id",this.ComponentId);l.SelectMacro.PerformAction()},this.CreateThumbnail(i,o),a=document.createElement("p"),a.appendChild(document.createTextNode(o.Name)),r.appendChild(a),u++,u==h&&(u=0)};ComponentPickerElement.prototype.CreateThumbnail=function(n,t){var e=100,r=document.createElement("canvas"),o,f,u;for(r.id="canvas_"+this.Id+"_"+this.CanvasIndex++,r.width=e,r.height=e,AddCssClass(r,"DesignerCanvas"),n.appendChild(r),o=new fabric.StaticCanvas(r.id),f=[],u=0;u<t.Items.length;u++){var l=t.Items[u],s=DesignerItemController.Get(l,!0),h=s.Build();h.DesignerController=s;f.push(h)}var i=new fabric.Group(f),a=i.width>i.height?i.width:i.height,c=100/a;return i.setScaleX(c),i.setScaleY(c),i.top=0,i.left=0,o.add(i),AddCssClass(r,"img-thumbnail"),r};ComponentEnumerator.prototype.OpenCategory=function(n){this.ClearActiveItems();var t=[];this.ScanData(t,function(t){return t.Category==n});this.CurrentCategory=n;this.ActiveItems=t;this.ActiveItems.toString=function(){return this.Number.toString()};this.Open();this.Categories.length>1&&this.BuildCategoryPicker()};ComponentEnumerator.prototype.Open=function(){this.BuildItems();this.SetupEvents();this.BuildScroller();this.OnOpenCallback&&this.OnOpenCallback(this.ActiveItems)};ComponentEnumerator.prototype.BuildCategoryPicker=function(){var n=document.createElement("select"),t,r,f,i,u,e,s,o;for(AddCssClass(n,"CanvasSelect"),t=0;t<this.Categories.length;t++)r=this.Categories[t],n.options[t]=new Option(r,r),n.options[t].selected=r==this.CurrentCategory;f=this;n.onchange=function(){var t=n.options[n.selectedIndex].value;f.OpenCategory(t)};i=this.Canvas.lowerCanvasEl.parentNode;u=i.parentNode;i.nextSibling?u.insertBefore(n,i.nextSibling):u.appendChild(n);e=new LayerSize(n);s=new LayerPosition(i);n.style.top=this.Margins+"px";o=this.Canvas.width-this.Margins-e.Width;n.style.left=o+"px"};ComponentEnumerator.prototype.BuildScroller=function(){var t,n;if(this.Scroller&&(this.Canvas.remove(this.Scroller),delete this.Scroller),this.IsScrolled){var i=this.Canvas.height-this.Margins+this.MarginTop,u=this.ActiveItems.length*(this.Size+this.Margins)-this.Margins+this.MarginTop,r=u<=i?i:i*(i/u);r<this.Size&&(r=this.Size);t=new fabric.Rect({fill:this.Color,width:this.ScrollWidth,height:r,stroke:1,rx:4,ry:4,originX:"left",originY:"top",top:this.MarginTop,left:this.Canvas.width-this.ScrollWidth-this.Margins,lockMovementX:!0,hasControls:!1,hasBorders:!1,hoverCursor:"ns-resize"});this.Scroller=t;this.Canvas.add(t);n=this;t.on("moving",function(){var e=n.Margins,u=n.Canvas.height-r-n.Margins,f=t.getTop(),i=0;f>u?(t.setTop(u),i=1):f<n.MarginTop?(t.setTop(n.MarginTop),i=0):i=(f-n.MarginTop)/(u-n.MarginTop);n.ScrollTo(i)})}};ComponentEnumerator.prototype.ScrollTo=function(n){var t,i,r;for(this.Scroll=n,t=0;t<this.ActiveItems.length;t++)i=this.ActiveItems[t],i.IsMoving||(r=this.GetItemTop(t),i.Object.setTop(r),i.Object.setCoords())};ComponentEnumerator.prototype.ClearActiveItems=function(){var n,t;for(this.OnCloseCallback&&this.OnCloseCallback(this.ActiveItems),n=0;n<this.ActiveItems.length;n++)t=this.ActiveItems[n],t.Object&&this.Canvas.remove(t.Object),delete t.Object;this.ActiveItems=[]};ComponentEnumerator.prototype.ClearSelections=function(){for(var t,n=0;n<this.ActiveItems.length;n++)t=this.ActiveItems[n],this.HighlightOff(t.Object)};ComponentEnumerator.prototype.TryAutoScroll=function(){var n;!this.IsScrolled};ComponentEnumerator.prototype.SetupEvents=function(){var n=this;this.Canvas.on("object:moving",function(t){var i=t.target,r;i.NumberingItem?(i.NumberingItem.IsMoving=!0,n.TryAutoScroll(i),n.OnMovingItem(i)):i.IsNumberingGroup&&(r=i.forEachObject(function(n){n.NumberingItem.IsMoving=!0}),n.TryAutoScroll(i),n.OnMovingGroup(i))});this.Canvas.on("object:modified",function(t){var i,r;n.InsertLine&&(n.Canvas.remove(n.InsertLine),delete n.InsertLine);i=t.target;i.NumberingItem?(r=t.target,n.OnItemMoved(r)):i.IsNumberingGroup&&n.OnGroupMoved(i)});this.Canvas.on("before:selection:cleared",function(t){var i=t.target;i.IsNumberingGroup?n.HighlightGroupOff(i):i.NumberingItem});this.Canvas.on("object:selected",function(t){var i=t.target,s,o,r;if(i.NumberingItem)i.bringToFront(),n.ClearSelections(),n.HighlightOn(i);else if(i.type=="group"){var e=i.getObjects(),u=[],f=[];for(r=0;r<e.length;r++)e[r].NumberingItem?u.push(e[r]):f.push(e[r]);if(s=f.length>0&&u.length>0,s){for(o=u.length<f.length?u:f,r=0;r<o.length;r++)i.removeWithUpdate(o[r]);n.Canvas.renderAll()}u.length>f.length&&(i.IsNumberingGroup=!0,i.lockMovementX=!0,i.hasControls=!1,i.hasBorders=!1,n.HighlightGroupOn(i))}})};ComponentEnumerator.prototype.SelectNumbers=function(n){var t=[],i=this;n.map(function(n){t.push(n.Object)});t.map(function(n){i.Canvas.setActiveObject(n)})};ComponentEnumerator.prototype.HighlightGroupOn=function(n){var t=this;n.forEachObject(function(n){t.HighlightOn(n)})};ComponentEnumerator.prototype.HighlightGroupOff=function(n){var t=this;n.forEachObject(function(n){t.HighlightOff(n)})};ComponentEnumerator.prototype.HighlightOn=function(n){var t=n.getObjects()[0];t.fill=this.HighlightColor};ComponentEnumerator.prototype.HighlightOff=function(n){var t=n.getObjects()[0];t.fill=this.Color};ComponentEnumerator.prototype.OnGroupMoved=function(n){var u=n.getTop(),r,t,i;for(this.HighlightGroupOff(n),r=n.getObjects(),this.Canvas.discardActiveGroup(),t=[],i=0;i<r.length;i++)t.push(r[i].NumberingItem);t.sort(function(n,t){return n.Object.Index<t.Object.Index?-1:n.Object.Index>t.Object.Index?1:0});this.MoveItems(u,t)};ComponentEnumerator.prototype.OnItemMoved=function(n){var t=n.getTop();this.MoveItems(t,[n.NumberingItem])};ComponentEnumerator.prototype.MoveItems=function(n,t){var e=this.ActiveItems[0].Number,o=this.ActiveItems.length,u=this.GetIndexAtPos(n),f,r,i;for(u>this.ActiveItems.length&&(u=this.ActiveItems.length),i=0;i<t.length;i++)t[i].IsMoving=!1,f=t[i].Object,this.ActiveItems.splice(f.Index-i,1),f.Index<u&&u--;for(r=this.ActiveItems.slice(0,u),i=0;i<t.length;i++)r.push(t[i]);for(r.push.apply(r,this.ActiveItems.slice(u,this.ActiveItems.length)),i=0;i<r.length;i++)r[i].Object.Index=i;this.ActiveItems=r;this.ScrollTo(this.Scroll);this.ReArrangeNumbers(e)};ComponentEnumerator.prototype.ReArrangeNumbers=function(n){var t=n,i=[],r=this;this.ActiveItems.map(function(n){n.Number!=t&&(n.OldNum=n.Number,n.Number=t,i.push(n),r.HighlightNumberChange(n));t++});this.OnChangeCallback&&this.OnChangeCallback(i)};ComponentEnumerator.prototype.HighlightNumberChange=function(n){var t=this.Canvas,u=300,o=this,r=n.OldNum,i=this.Size/1,f=r>n.Number?"+="+i:"-="+i,e=r<n.Number?"+="+i:"-="+i;n.Object.TextObject.animate("top",f,{onChange:t.renderAll.bind(t),duration:u,easing:fabric.util.ease.easeOut,onComplete:function(){r&&(delete n.OldNum,n.Object.TextObject.setText(n.Number.toString()));n.Object.TextObject.animate("top",e,{onChange:t.renderAll.bind(t),duration:u})}})};ComponentEnumerator.prototype.OnMovingItem=function(n){var t=this.InsertLine,i=this.IsScrolled?this.ScrollWidth+this.Margins:0;t||(t=new fabric.Line([this.Canvas.width-this.Margins*3-this.Size-i,100,this.Canvas.width-i,100],{fill:"green",stroke:"green",strokeWidth:2,selectable:!1}),this.InsertLine=t,this.Canvas.add(t));var u=n.getTop(),f=Math.round((u-this.MarginTop+this.Size/2)/(this.Size+this.Margins)),r=f*(this.Size+this.Margins)+this.MarginTop-this.Margins/2;t.set({y1:r,y2:r});this.Canvas.renderAll()};ComponentEnumerator.prototype.OnMovingGroup=function(n){this.OnMovingItem(n)};ComponentEnumerator.prototype.GetIndexAtPos=function(n){var t=this.OffScreenHeight*this.Scroll,i=(n+t-this.MarginTop+this.Size/2)/(this.Size+this.Margins);return Math.round(i)};ComponentEnumerator.prototype.GetItemTop=function(n){var t=this.MarginTop+n*(this.Size+this.Margins),i;return this.Scroll==0?t:(i=this.OffScreenHeight*this.Scroll,t-i)};ComponentEnumerator.prototype.UpdateVisibility=function(n){var t=n.getTop(n),i=t<-this.Size||t>this.Canvas.height;n.setVisible(!i)};ComponentEnumerator.prototype.UpdateTotalHeight=function(){var n=this.ActiveItems.length*(this.Size+this.Margins),t=this.Canvas.height-(this.Margins+this.MarginTop);this.TotalHeight=n;this.OffScreenHeight=n-t;this.IsScrolled=n>t;this.OffScreenHeight=this.IsScrolled?n-t:0};ComponentEnumerator.prototype.BuildItems=function(){var f,i,n;for(this.UpdateTotalHeight(),f=this.IsScrolled?this.ScrollWidth+this.Margins:0,i=this,n=0;n<this.ActiveItems.length;n++){var r=this.ActiveItems[n],e=new fabric.Rect({fill:i.Color,width:this.Size,height:this.Size,stroke:1,rx:8,ry:8,originX:"center",originY:"center"}),u=new fabric.Text(r.Number.toString(),{fontSize:this.NumSize,fontFamily:"Verdana",originX:"center",originY:"center",fill:i.TextColor}),t=new fabric.Group([e,u],{top:0,left:i.Canvas.width-this.Margins-this.Size-f,hasRotatingPoint:!1,hasControls:!1,lockMovementX:!0,opacity:.8});t.TextObject=u;t.setTop(this.GetItemTop(n));this.Canvas.add(t);r.Object=t;t.Index=n;r.SetNumber=function(n){u.setText(n.toString())};t.NumberingItem=r}};ComponentEnumerator.prototype.ScanData=function(n,t){var i=function(r){for(var u,f=0;f<r.length;f++)u=r[f],t(u)&&n.push(u),u.Items&&i(u.Items)};i(this.Data);n.sort(function(n,t){return n.Number<t.Number?-1:n.Number>t.Number?1:0})};CanvasController={ScaleFactor:1.2};CanvasController.Resizing=function(n,t,i){var r=null,f=null,u=function(){var u=new LayerSize(t),e;(f!==i.ZoomLevel||u.Height!==r.Height||u.Width!==r.Width)&&(e=i.ZoomLevel>1?i.ZoomLevel:1,n.setWidth(Math.round(u.Width*e)-50),n.setHeight(Math.round(u.Height*e)-50),r=u);AirSpaceBooking.DropFocus();CanvasController.SizeToFitContent(n)};return u(),window.addEventListener("resize",function(){u()},!1),u};CanvasController.SizeToFitContent=function(n){var r=0,t,i,u,f;return oY=0,t=0,i=0,n.forEachObject(function(n){var u=n.getBoundingRect(),f;(u.left+u.width>r||u.top+u.height>oY)&&(r=u.left+u.width,oY=u.top+u.height,f=CanvasController.GetObjectGlobalRect(n),t=f.left+f.width,i=f.top+f.height)}),u=n.getWidth(),f=n.getHeight(),u<t&&n.setWidth(t),f<i&&n.setHeight(i),!0};CanvasController.IsDropAllowed=function(){return!0};CanvasController.OnFirstItem=function(n,t,i){var r=function(n){for(var u,e,f=0;f<n.length;f++)if(u=n[f],i?i(u):!0)return e=u.Properties.SubItems?r(u.Properties.SubItems,t,i):null,e||u;return null},u=r(n);return u?(t(u),!0):!1};CanvasController.OnEachItem=function(n,t,i){var r=function(n){for(var u,f=0;f<n.length;f++)u=n[f],(i?i(u):!0)&&(t(u),u.Properties.SubItems&&r(u.Properties.SubItems,t,i))};return r(n)};CanvasController.GetObjectGlobalUnrotatedRect=function(n){var u=fabric.util.multiplyTransformMatrices,t=n.getBoundingRect(),e=[1,0,0,1,t.left,t.top],o=n._calcRotateMatrix(),s=n._calcDimensionsTransformMatrix(n.skewX,n.skewY,!0),i=n.group?n.group.calcTransformMatrix():[1,0,0,1,0,0],r,f;return i=u(i,e),i=u(i,o),i=u(i,s),r=fabric.util.qrDecompose(i),t.left=r.translateX,t.top=r.translateY,f=n.group?{x:r.scaleX,y:r.scaleY}:{x:1,y:1},t.width*=f.x,t.height*=f.y,t};CanvasController.GetObjectGlobalRect=function(n){var t=CanvasController.GetObjectGlobalUnrotatedRect(n),i=n.group?n.group.angle:0;return i===0?t:CanvasController.RotateRect(t,i,{x:t.left,y:t.top})};CanvasController.RotatePoint=function(n,t,i){var u=new fabric.Point(i.left,i.top),f=fabric.util.degreesToRadians(t),r=fabric.util.rotatePoint(new fabric.Point(n.left,n.top),u,f);return{left:r.x,top:r.y}};CanvasController.RotateRect=function(n,t,i){var r=new fabric.Point(i.x,i.y),u=fabric.util.degreesToRadians(t),f=fabric.util.rotatePoint(new fabric.Point(n.left,n.top),r,u),e=fabric.util.rotatePoint(new fabric.Point(n.left+n.width,n.top),r,u),o=fabric.util.rotatePoint(new fabric.Point(n.left,n.top+n.height),r,u),s=fabric.util.rotatePoint(new fabric.Point(n.left+n.width,n.top+n.height),r,u);return CanvasController.CalcDimensions(f,e,o,s)};CanvasController.CalcDimensions=function(n,t,i,r){var f=fabric.util.array.min,e=fabric.util.array.max,u=[n,t,i,r],o=f(u,"x"),s=f(u,"y"),h=e(u,"x"),c=e(u,"y");return{width:h-o,height:c-s,left:o,top:s}};CanvasController.IsWithin=function(n,t){var f=n.Controller.CanvasItem,i=CanvasController.GetObjectGlobalRect(f),r=t.X,u=t.Y;return r>i.left&&u>i.top&&r<i.left+i.width&&u<i.top+i.height?!0:!1};CanvasController.Zoom=function(n,t){for(var i,u=n.Canvas,f=u.getObjects(),r=0;r<f.length;r++)if(i=f[r],i.DesignerController){var e=i.scaleX,o=i.scaleY,s=i.left,h=i.top,c=s/e,l=h/o,a=c*t,v=l*t;i.scaleX=t;i.scaleY=t;i.left=a;i.top=v;i.setCoords();i.DesignerController.OnScaled&&i.DesignerController.OnScaled(t)}n.OnResizeCallback();u.renderAll()};CanvasController.ZoomIn=function(n){n.ZoomLevel*=CanvasController.ScaleFactor;BRIX.Storage.Set(n.ZoomStorage,n.ZoomLevel);CanvasController.Zoom(n,n.ZoomLevel)};CanvasController.ZoomOut=function(n){n.ZoomLevel/=CanvasController.ScaleFactor;BRIX.Storage.Set(n.ZoomStorage,n.ZoomLevel);CanvasController.Zoom(n,n.ZoomLevel)};CanvasController.CreateButton=function(n,t){var i=document.createElement("button"),r;return AddCssClass(i,"CanvasButton"),t.LayoutContainer.appendChild(i),n&&(r=document.createElement("div"),AddCssClass(r,"Decor"),AddCssClass(r,n),i.appendChild(r)),t.HasSidebar&&AddCssClass(i,"CanvasButtonWithSidebar"),i};CanvasController.CreateButtonZoomOut=function(n){var t=this.CreateButton("ZoomOut",n);t.onclick=function(){CanvasController.ZoomOut(n)}};CanvasController.CreateButtonZoomIn=function(n){var t=this.CreateButton("ZoomIn",n);t.onclick=function(){CanvasController.ZoomIn(n)}};CanvasController.CreateButtonMoreGrid=function(n){var t=this.CreateButton("MoreGrid",n)};CanvasController.CreateButtonLessGrid=function(n){var t=this.CreateButton("LessGrid",n)};DesignerElement.InheritsFrom(ElementBase);DesignerElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);t=n.selectSingleNode("UpdateMacro");this.UpdateMacro=new MacroElement(this,t.firstChild);i=GetCDataValue(n,"Items");r=JSON.parse(i);this.Items=r.Items;this.Presets={ScrollLeft:n.getAttribute("scroll_left")||"0",ScrollTop:n.getAttribute("scroll_top")||"0"};this.AdHocEditing=n.getAttribute("adHocEditing")==="true";this.AdHocEditing&&(t=n.selectSingleNode("AdHocEditMacro"),this.AdHocEditMacro=new MacroElement(this,t.firstChild));this.ZoomStorage=this.Name;this.ZoomLevel=(BRIX.Storage.Get(this.ZoomStorage)||1)*1};DesignerElement.prototype.DisableAdHocEditing=function(){if(this.AdHocNode){var n=this.AdHocNode;this.AdHocNode=null;n.parentNode.removeChild(n)}};DesignerElement.prototype.EnableAdHocEditing=function(n){var r=GetDashboard().Find(function(n){return n.MyClassName==="ToolbarElement"}),t=BRIX.Markup(["btn-group","Toolbar"]);this.AdHocNode=t;var u=function(n,t){var i=BRIX.Markup(["btn","btn-default"]),r;return i.type="button",i.appendChild(ActiveIconArchive.Get(t).Create()),r=BRIX.Markup("text","span"),r.appendChild(document.createTextNode(n)),i.appendChild(r),i},f=this,i=u("Delete",DeleteIconName);t.appendChild(i);i.onclick=function(){f.DeleteItem(n)};r.Body.parentNode.appendChild(t)};DesignerElement.prototype.DeleteItem=function(n){var i,r,t;if(IsDefined(n.DesignerController))i={Items:[{Id:n.DesignerController.Item.Id,Order:"Delete"}]};else{for(r=[],t=0;t<n._objects.length;t++)r.push({Id:n._objects[t].DesignerController.Item.Id,Order:"Delete"});i={Items:r}}this.SendUpdate(i,this.AdHocEditMacro)};DesignerElement.prototype.InitializeMe=function(){var n=this;FabricInitialization(function(){n.BuildDesigner()})};DesignerElement.prototype.DnDHoverIn=function(){};DesignerElement.prototype.DnDHoverOut=function(){};DesignerElement.prototype.DropElementOnMe=function(n,t,i,r){var u=this,f=function(n){return n/u.ZoomLevel};ElementBase.prototype.DropElementOnMe.call(this,n,t,i+this.Body.scrollLeft,r+this.Body.scrollTop,f,null,this.Body.scrollLeft,this.Body.scrollTop)};DesignerElement.prototype.OnItemUpdated=function(n){for(var u,i={Items:[]},r={Items:[]},t=0;t<n.Items.length;t++)n.Items[t].Id.indexOf(".")===-1?i.Items.push(n.Items[t]):r.Items.push(n.Items[t]);i.Items.length>0&&r.Items.length>0?(u=this,this.SendUpdate(i,this.UpdateMacro,function(){u.SendUpdate(r,u.AdHocEditMacro)})):(this.SendUpdate(i,this.UpdateMacro),this.SendUpdate(r,this.AdHocEditMacro))};DesignerElement.prototype.SendUpdate=function(n,t,i){if(n.Items.length!==0){var r=JSON.stringify(n);t.AddClientArgument("_itemproperties",r);IsDefined(i)&&(t.OnPause=function(n,r,u){u.OnPause=null;t.OnPause=null;i(n,r,u)});t.AddClientArgument("_scroll_left",this.Body.scrollLeft);t.AddClientArgument("_scroll_top",this.Body.scrollTop);t.PerformAction()}};DesignerElement.prototype.CleanUp=function(){var n,i,t;if(this.DisableAdHocEditing(),this.LayoutContainer)for(n=this.LayoutContainer.getElementsByClassName("CanvasButton"),i=n.length,t=0;t<i;t++)n[0].parentNode.removeChild(n[0])};DesignerElement.prototype.BuildViewControls=function(){CanvasController.CreateButtonZoomIn(this);CanvasController.CreateButtonZoomOut(this)};DesignerElement.prototype.BuildDesigner=function(){var r=document.createElement("div"),f,t,n,u,h,i;for(AddCssClass(r,"DesignerContainer"),r.id=this.Id,this.Body=r,this.LayoutContainer=this.Parent.GetBodyElement(),this.LayoutContainer.appendChild(r),f=document.createElement("canvas"),f.id="canvas_"+this.Id,AddCssClass(f,"DesignerCanvas"),r.appendChild(f),t=new fabric.Canvas(f.id),this.Canvas=t,n=this,i=0;i<this.Items.length;i++){var e=this.Items[i],o=DesignerItemController.Get(e,this,DesignerItemController.DesignMode),s=o.Build();t.add(s)}t.on("object:modified",function(t){var u=null,r=[],i;t.target.DesignerController?r.push(t.target):t.target.type=="group"&&(u=t.target,t.target.getObjects().map(function(n){n.DesignerController&&r.push(n)}));i={Items:[]};r.map(function(t){var r=n.GetObjectUpdateProperties(t,u);Array.prototype.push.apply(i.Items,r)});i.Items.length>0&&n.OnItemUpdated(i)});this.GroupSelected=!1;u=!1;t.on("selection:cleared",function(){n.DisableAdHocEditing();n.GroupSelected=!1;u=!1});if(this.AdHocEditing)t.on("mouse:down",function(t){n.GroupSelected&&(u?n.MakeSubSelection(t.target.DesignerController,t.e)&&(n.GroupSelected=!1,u=!1):u=!0)});t.on("object:selected",function(t){n.SelectObject(t.target);u=!1});t.on("selection:created",function(n){var t=n.target;t.originX="left";t.originY="top";t.lockScalingX=!0;t.lockScalingY=!0;t.setControlVisible("bl",!1);t.setControlVisible("br",!1);t.setControlVisible("mb",!1);t.setControlVisible("ml",!1);t.setControlVisible("mr",!1);t.setControlVisible("mt",!1);t.setControlVisible("tl",!1);t.setControlVisible("tr",!1);t.on("modified",function(){})});if(this.OnResizeCallback=CanvasController.Resizing(t,r,this),h=r,this.Enums){for(this.Enumerator=new ComponentEnumerator(t,this.Enums,function(t){n.OnEnumOpen(t)},function(t){n.OnEnumClose(t)},function(t){n.OnEnumUpdate(t)}),i=0;i<this.Items.length;i++)DesignerItemController.SetupEnumMode(this.Items[i].Controller,function(t){n.Enumerator.SelectNumbers([t])});this.Enumerator.OpenCategory(this.Enumerator.Categories[this.Enumerator.Categories.length-1])}CanvasController.Zoom(this,this.ZoomLevel);this.BuildViewControls();this.Body.scrollLeft=this.Presets.ScrollLeft;this.Body.scrollTop=this.Presets.ScrollTop};DesignerElement.prototype.GetObjectUpdateProperties=function(n){var r=[],e=this,o,s,h,u,f,a;if(n.OriginalGroup){var t=n.OriginalGroup,i=CanvasController.GetObjectGlobalRect(t),p=n.group?n.group.angle:0;if(o=n.left,s=n.top,h=n.angle,t.angle!==0){i.left-=(t.width*t.scaleX-i.width)/2;i.top-=(t.height*t.scaleY-i.height)/2;var v={left:n.left-i.left,top:n.top-i.top},c=t.getCenterPoint(),y={left:c.x-i.left,top:c.y-i.top},l=CanvasController.RotatePoint(v,-t.angle,y);n.left=l.left;n.top=l.top;n.angle-=t.angle}else n.left=n.left-i.left,n.top=n.top-i.top,n.angle-=t.angle;u=e.GetModifiedGroupProperties(t);IsDefined(u)&&r.push(u)}return f=n.DesignerController.Transformer,f&&f(e.ZoomLevel),a=DesignerItemController.GetProperties(n),r.push(a),n.OriginalGroup&&(n.left=o,n.top=s,n.angle=h),r};DesignerElement.prototype.GetModifiedGroupProperties=function(n){var t=this.GetModifiedGroupRect(),i=DesignerItemController.GetProperties(n);return i.Pos.Left=Math.round((t.left+Math.round(t.width/2))/this.ZoomLevel),i.Pos.Top=Math.round((t.top+Math.round(t.height/2))/this.ZoomLevel),i};DesignerElement.prototype.GetModifiedGroupRect=function(){for(var t,r,u,f=this.DesolvedGroupInfo.Objects,n={left:1e5,top:1e5,right:0,bottom:0},i=0;i<f.length;i++)t=CanvasController.GetObjectGlobalRect(f[i]),t.left<n.left&&(n.left=t.left),t.top<n.top&&(n.top=t.top),r=t.left+t.width,u=t.top+t.height,r>n.right&&(n.right=r),u>n.bottom&&(n.bottom=u);return n.height=n.bottom-n.top,n.width=n.right-n.left,n};DesignerElement.prototype.EndSubSelection=function(){var n,t,i,r;if(this.DesolvedGroupInfo){if(n=this.DesolvedGroupInfo.Item.CanvasItem,!IsDefined(n.canvas)){this.DesolvedGroupInfo=null;return}for(t=this.DesolvedGroupInfo.Objects,i=new fabric.Group(t.slice(0)),i.hasControls=n.hasControls,r=0;r<t.length;r++)n.canvas.remove(t[r]),i.add(t[r]);n.canvas.add(i);this.DesolvedGroupInfo.Item.CanvasItem=i;this.DesolvedGroupInfo=null}};DesignerElement.prototype.CloneObject=function(n,t){if(n.constructor.async===!0)n.clone(function(n){t(n)});else{var i=n.clone();t(i)}};DesignerElement.prototype.MakeSubSelection=function(n,t){var s=this,u,h,i,e,l,o;for(this.EndSubSelection(),u=n.Item.Properties.SubItems,h=DesignerItemController.GetMousePosition(t,s.Body,!0),i=0;i<u.length;i++)if(u[i].Type==="component"&&CanvasController.IsWithin(u[i],h)){var f=u[i],c=f.Controller.Container.Canvas,r=n.CanvasItem.getObjects();for(n.CanvasItem._restoreObjectsState(),c.remove(n.CanvasItem),this.DesolvedGroupInfo={Item:n,Objects:[]},e=null,l=r.length,o=0;o<l;o++)this.CloneObject(r[0],function(t){s.DesolvedGroupInfo.Objects.push(t);r[0]===f.Controller.CanvasItem&&(e=t);t.DesignerController=r[0].DesignerController;r[0].DesignerController.CanvasItem=t;t.OriginalGroup=n.CanvasItem;c.add(t)}),n.CanvasItem.remove(r[0]);return f.Controller.Container.Canvas.setActiveObject(e,t),!0}return!1};DesignerElement.prototype.SelectObject=function(n){var i=this,t;i.AdHocEditing&&(i.DisableAdHocEditing(),i.EnableAdHocEditing(n));n.DesignerController&&n.type==="group"&&(i.GroupSelected=!0,t=n,t.lockScalingX=!0,t.lockScalingY=!0,t.setControlVisible("bl",!1),t.setControlVisible("br",!1),t.setControlVisible("mb",!1),t.setControlVisible("ml",!1),t.setControlVisible("mr",!1),t.setControlVisible("mt",!1),t.setControlVisible("tl",!1),t.setControlVisible("tr",!1))};DesignerElement.prototype.RoundAngle=function(n){var t=n,u,f,i,r;if(t===0||t===360)return 0;for(u=2.5,f=45,t=(t/360-Math.floor(t/360))*360,i=0;i<=360/f;i++)if(r=i*f,t>r-u&&t<r+u)return r;return n};DesignerItemController={DesignMode:1,WorkMode:2,PresentationMode:3,SnapResolution:1,GetMousePosition:function(n,t,i){n=n||window.event;StandardizeEventMousePos(n);var u=new LayerPosition(t),r={X:n.pageX-u.Left,Y:n.pageY-u.Top};return i===!0&&(r.X+=t.scrollLeft,r.Y+=t.scrollTop),r},SnapCoordinate:function(n){return Math.round(n/this.SnapResolution)*this.SnapResolution},UniformPosition:function(n){this.UniformSide(n,"left","width");this.UniformSide(n,"top","height")},UniformSide:function(n,t,i){var r=Math.round(n[t]-Math.round(n[i])/2),u=IsDefined(n.originalState)&&IsDefined(n.originalState[t])?Math.round(n.originalState[t]-n.originalState[i]/2):null;r!==u&&(n[t]=DesignerItemController.SnapCoordinate(r)+Math.round(n[i])/2)},UniformSize:function(n){this.UniformDim(n,"left","width");this.UniformDim(n,"top","height")},UniformDim:function(n,t,i){var r,u,f;n[i]!==(IsDefined(n.originalState)?n.originalState[i]:null)&&(r=n[t]-n[i]/2,u=r+n[i],n[i]=DesignerItemController.SnapCoordinate(u)-r,f=r-(n[t]-n[i]/2),n[t]=n[t]+f)},GetCanvas:function(n){if(IsDefined(n.canvas))return n.canvas;if(IsDefined(n.group))return DesignerItemController.GetCanvas(n.group);throw Error("Could not locate canvas");},SetupEnumMode:function(n,t){var i,r;if((n.CanvasItem.hasControls=!1,n.CanvasItem.selectable=!1,n.Item.Type=="component")&&(n.UpdateNumber=function(n){this.EnumText.setText(n.toString())},n.StartEnum=function(i){var u=new fabric.Circle({fill:"#fff",radius:20,originX:"center",originY:"center",stroke:2,shadow:"rgba(0,0,0,0.4) 5px 5px 7px"}),f,r;n.CanvasItem.add(u);f=DesignerItemController.GetCanvas(n.CanvasItem);f.on("mouse:down",function(r){r.target&&r.target==n.CanvasItem&&t(i)});r=new fabric.Text(i.Number.toString(),{fontSize:16,angle:-n.CanvasItem.angle,fontFamily:"Verdana",originX:"center",originY:"center",fill:"#000"});n.CanvasItem.add(r);n.CanvasItem.hoverCursor="pointer";n.EnumBox=u;n.EnumText=r;n.IsEnumerating=!0},n.EndEnum=function(){n.IsEnumerating=!1;n.EnumBox&&(n.CanvasItem.remove(n.EnumBox),delete n.EnumBox);n.EnumText&&(n.CanvasItem.remove(n.EnumText),delete n.EnumText)},i=n.Item.Properties.SubItems,i))for(r=0;r<i.length;r++)DesignerItemController.SetupEnumMode(i[r].Controller,t)},Get:function(n,t,i){var r=null;if(n.Type=="rectangle")r=new RectangleController(n);else if(n.Type=="circle")r=new CircleController(n);else if(n.Type=="component")r=new ComponentController(n);else throw new Error("Unsupported item: "+n.Type);return r.Mode=i||this.PresentationMode,n.Controller=r,r.Container=t,r},SetProperties:function(n,t){t.DesignerController=n.Controller;t.top=n.Pos.Top;t.left=n.Pos.Left;t.angle=n.Angle;t.originX=t.originY="center";n.type!="group"&&(t.stroke="black",t.strokeWidth=1)},TransformGroupPos:function(n){var r=n.group,t=CanvasController.GetObjectGlobalRect(n),i=function(n,t,i){return n/1+t/i/2};return{angle:n.getAngle()+r.getAngle(),left:i(t.left,t.width,n.scaleX),top:i(t.top,t.height,n.scaleY)}},GetProperties:function(n){var t=n.DesignerController,r=t.Container,i,u,f;return i=n.group?this.TransformGroupPos(n):{top:n.top,left:n.left,angle:n.angle},IsDefined(t.ComponentOffset)&&(i.top+=t.ComponentOffset.Y*r.ZoomLevel,i.left+=t.ComponentOffset.X*r.ZoomLevel),u={Top:Math.round(i.top/r.ZoomLevel),Left:Math.round(i.left/r.ZoomLevel)},f={Id:t.Item.Id,Type:t.Item.Type,Angle:i.angle,Pos:u,Properties:t.GetControllerProperties(r.ZoomLevel)},f}};EnumerationElement.InheritsFrom(ElementBase);EnumerationElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);macroNode=n.selectSingleNode("EnumUpdateMacro");this.EnumUpdateMacro=macroNode?new MacroElement(this,macroNode.firstChild):this.UpdateMacro;this.SerialMode=n.getAttribute("mode")==="Serial";var t=GetCDataValue(n,"Items"),i=JSON.parse(t);this.Items=i.Items;this.Category=n.getAttribute("category");this.EnumerationStore=JSON.parse(GetCDataValue(n,"Enums")||"{}");this.InitializeEnum();this.ZoomStorage=this.Name;this.ZoomLevel=(BRIX.Storage.Get(this.ZoomStorage)||1)*1};EnumerationElement.prototype.InitializeEnum=function(){var n=this.Category,t=[],r=function(n,t){var i='<ul class="list-group BadgeList">',r=t.slice();return r.push(n),r.map(function(n){i+='<li class="list-group-item"><span class="badge">'+n.Number+"<\/span>"+n.Category+"<\/li>"}),i+="<\/ul>"},i=function(u,f){(f=f||[],IsDefined(u.Items))&&u.Items.map(function(e){var h,o,s;(e.Category===n||n==null&&f.length==0)&&(h=r(e,f),o=new AirSpaceBooking(null,e.Id,e.Number,h,"#69c"),o.Draggable=!0,o.DropPayload=e.Id,o.ParentItemId=u.Id,o.RelatedItem=e,t.push(o));s=f.slice();s.push(e);i(e,s)})};i(this.EnumerationStore);this.Enums=t};EnumerationElement.prototype.FindFromStore=function(n){var t=function(i){for(var u,f,r=0;r<i.Items.length;r++){if(u=i.Items[r],u.Id==n)return u;if(f=t(u),f)return f}return null};return t(this.EnumerationStore)};EnumerationElement.prototype.InitializeMe=function(){var n=this;FabricInitialization(function(){n.BuildDesigner()})};EnumerationElement.prototype.DnDHoverIn=function(){};EnumerationElement.prototype.DnDHoverOut=function(){};EnumerationElement.prototype.SwitchNumbers=function(n,t){var i,r;return n===t?!1:!this.SerialMode&&(n.length!=t.length||(i=n.lastIndexOf("."),i>-1&&n.substr(0,i)!==t.substr(0,i)))?!1:(r={Order:"Switch",Switch:{A:n,B:t}},this.SwitchNumbersOnEnums(n,t),this.SendUpdate(r,this.EnumUpdateMacro),!0)};EnumerationElement.prototype.SwitchNumbersOnEnums=function(n,t){var i=this,e=function(n){for(var t=0;t<i.Enums.length;t++)if(i.Enum[t].ItemId===n)return i.Enum[t];throw new Error("Could not find item");},r=this.FindFromStore(n),u=this.FindFromStore(t),f=u.Number;u.Number=r.Number;r.Number=f;this.Enums.map(function(n){n.Remove()});this.InitializeEnum();this.InitializeBookings()};EnumerationElement.prototype.SendUpdate=function(n,t){var i=JSON.stringify(n);t.AddClientArgument("_itemproperties",i);t.PerformAction()};EnumerationElement.prototype.BuildViewControls=function(){CanvasController.CreateButtonZoomIn(this);CanvasController.CreateButtonZoomOut(this)};EnumerationElement.prototype.CleanUp=function(){for(var n=this.LayoutContainer.getElementsByClassName("CanvasButton"),i=n.length,t=0;t<i;t++)n[0].parentNode.removeChild(n[0])};EnumerationElement.prototype.BuildDesigner=function(){var n=document.createElement("div"),t,i,u,r;for(AddCssClass(n,"DesignerContainer"),n.id=this.Id,this.Body=n,this.LayoutContainer=this.Parent.GetBodyElement(),this.LayoutContainer.appendChild(n),t=document.createElement("canvas"),t.id="canvas_"+this.Id,AddCssClass(t,"DesignerCanvas"),n.appendChild(t),i=new fabric.Canvas(t.id),this.Canvas=i,u=this,i.renderOnAddRemove=!1,r=0;r<this.Items.length;r++){var f=this.Items[r],e=DesignerItemController.Get(f,this,DesignerItemController.WorkMode),o=e.Build();i.add(o)}this.OnResizeCallback=CanvasController.Resizing(i,n,this);CanvasController.Zoom(this,this.ZoomLevel);this.SetupComponentEvents(n);this.BuildViewControls();this.InitializeBookings()};EnumerationElement.prototype.SetupComponentEvents=function(n){var t=this,i=function(n){for(var r,i=0;i<t.Enums.length;i++)if(r=t.Enums[i].ItemId,r.length>n.Id.length){if(n.Id===r.substring(0,n.Id.length))return!0}else if(r===n.Id)return!0;return!1};n.ondragover=function(n){n.preventDefault()};n.ondragenter=function(n){n.preventDefault()};n.ondrop=function(n){var r=n.dataTransfer.getData("text"),u;r.substring(0,9)=="airspace:"&&(u=DesignerItemController.GetMousePosition(n,t.Body,!0),CanvasController.OnFirstItem(t.Items,function(n){var i=r.substring(9);t.SwitchNumbers(i,n.Id)},function(n){return n.Type=="component"&&i(n)&&CanvasController.IsWithin(n,u)}))}};EnumerationElement.prototype.InitializeBookings=function(){var t=this,n=function(){return[]};AirSpaceBooking.Initialize(this.Items,this.Enums,this.ZoomLevel,this.Body,n)};LayoutElement.InheritsFrom(ElementBase);LayoutElement.prototype.GetXmlNodeData=function(n){var r,u,i,t;ElementBase.prototype.GetXmlNodeData.call(this,n);this.IsDroppable=!1;r=GetCDataValue(n,"Items");u=JSON.parse(r);this.Items=u.Items;i={};CanvasController.OnEachItem(this.Items,function(n){i[n.Id]=n});this.ItemIndex=i;this.GetContentData(n);this.DistributionParameter=n.getAttribute("dist_param");t=n.selectSingleNode("DistributeMacro");this.DistributeMacro=new MacroElement(this,t.firstChild);t=n.selectSingleNode("DistributionRulesMacro");this.DistributionRulesMacro=new MacroElement(this,t.firstChild);t=n.selectSingleNode("RemoveMacro");this.RemoveMacro=new MacroElement(this,t.firstChild);this.RemoveParameter=n.getAttribute("remove_param");this.RemoveCaption=GetCDataValue(n,"RemoveCaption");this.HasWorkspace=!1;this.ZoomStorage=n.getAttribute("zoom_key");this.ZoomLevel=(BRIX.Storage.Get(this.ZoomStorage)||1)*1};LayoutElement.prototype.OnRemoveBooking=function(n){var t={CallbackId:this.Id,Booking:n.BookingId},i=JSON.stringify(t);this.RemoveMacro.AddClientArgument(this.RemoveParameter,i);this.RemoveMacro.PerformAction()};LayoutElement.prototype.RelayedResponse=function(n){this.Bookings.map(function(n){n.Remove()});this.GetContentData(n);this.WorkspaceController.Rebuild(this.Workspace);this.InitializeBookings()};LayoutElement.prototype.GetContentData=function(n){var o=GetCDataValue(n,"Bookings"),u=JSON.parse(o).Bookings,i,t,r,s,f,e;for(this.Bookings=[],i=0;i<u.length;i++)t=u[i],r=new AirSpaceBooking(t.Booking.Id,t.ItemId,t.Booking.Title,t.Booking.Details,t.Booking.Color),r.Draggable=!0,s=this.ItemIndex[t.ItemId],r.DropPayload='{"Action":"Move", "Item":"'+t.ItemId+'"}',this.Bookings.push(r);f=GetCDataValue(n,"Workspace");e=JSON.parse(f);this.Workspace=e.Bookings};LayoutElement.prototype.OnMove=function(n,t){var i={CallbackId:this.Id,Action:"move",From:n,To:t},r=JSON.stringify(i);this.DistributeMacro.AddClientArgument(this.DistributionParameter,r);this.DistributeMacro.PerformAction()};LayoutElement.prototype.OnDistribute=function(n,t){var i={CallbackId:this.Id,Action:"add",To:t?t.Id:"",Bookings:n.Ids},r=JSON.stringify(i);this.DistributeMacro.AddClientArgument(this.DistributionParameter,r);this.DistributeMacro.PerformAction()};LayoutElement.prototype.InitializeMe=function(){var n=this;FabricInitialization(function(){n.BuildDesigner()})};LayoutElement.prototype.BuildViewControls=function(){CanvasController.CreateButtonZoomIn(this);CanvasController.CreateButtonZoomOut(this)};LayoutElement.prototype.BuildDesigner=function(){var r=document.createElement("div"),i,n,u,t,e,f;for(AddCssClass(r,"AirSpaceFloor"),r.id=this.Id,this.Root=r,this.Parent.GetBodyElement().appendChild(r),i=document.createElement("div"),AddCssClass(i,"row"),AddCssClass(i,"DividedLayout"),this.LayoutContainer=i,r.appendChild(i),n=document.createElement("div"),AddCssClass(n,"DesignerContainer"),AddCssClass(n,"col-md-12"),i.appendChild(n),this.Body=n,u=document.createElement("canvas"),u.id="canvas_"+this.Id,AddCssClass(u,"DesignerCanvas"),n.appendChild(u),t=new fabric.Canvas(u.id),t.stateful=!1,t.renderOnAddRemove=!1,this.Canvas=t,e=this,f=0;f<this.Items.length;f++){var o=this.Items[f],s=DesignerItemController.Get(o,this,DesignerItemController.WorkMode),h=s.Build();t.add(h)}this.OnResizeCallback=CanvasController.Resizing(t,n,this);CanvasController.Zoom(this,this.ZoomLevel);this.BuildViewControls();this.SetupComponentEvents(n);this.InitializeWorkspace();this.InitializeBookings();t.on("mouse:out",function(){var t=BRIX.LastCanvasHover,n;t&&(n=t.DesignerController,n.OnOut&&n.OnOut(n.Item),BRIX.LastCanvasHover=null)})};LayoutElement.prototype.InitializeBookings=function(){var n=this,t=function(t){return[{Caption:n.RemoveCaption,Action:function(){n.OnRemoveBooking(t)},Icon:DeleteIconName}]};AirSpaceBooking.Initialize(this.Items,this.Bookings,this.ZoomLevel,this.Body,t);this.Canvas.renderAll()};LayoutElement.prototype.SetupComponentEvents=function(n){var t=this,i=null;CanvasController.OnEachItem(this.Items,function(n){n.Controller.OnOver=function(n){n.Controller.Highlight(!0)};n.Controller.OnOut=function(n){n.Controller.Highlight(!1)}},function(n){return n.Type=="component"});n.ondragover=function(n){var u=DesignerItemController.GetMousePosition(n,t.Body,!0),r=null;CanvasController.OnFirstItem(t.Items,function(n){r=n},function(n){return n.Type=="component"&&CanvasController.IsWithin(n,u)});r?i!==r&&(i&&i.Controller.Highlight(!1),r.Controller.Highlight(!0),i=r):i&&(i.Controller.Highlight(!1),i=null);n.preventDefault()};n.ondragenter=function(n){!t.IsDroppable;n.preventDefault()};n.ondrop=function(n){var u=n.dataTransfer.getData("text");if(u.substring(0,9)=="airspace:"){var r=JSON.parse(u.substring(9)),f=DesignerItemController.GetMousePosition(n,t.Body,!0),e=CanvasController.OnFirstItem(t.Items,function(n){n.Controller.Highlight(!1);r.Action==="Move"?t.OnMove(r.Item,n.Id):t.OnDistribute(r,n)},function(n){return n.Type==="component"?CanvasController.IsWithin(n,f):n.Type=="component"&&CanvasController.IsWithin(n,f)});e||(r.Action==="Move"?t.OnMove(r.Item,null):t.OnDistribute(r,null));i=null}}};LayoutElement.prototype.OnDragging=function(n){var t=this,i;(!1||this.IsDroppable)&&(i=DesignerItemController.GetMousePosition(n,t.Body,!0),CanvasController.OnFirstItem(t.Items,function(t){t.Controller.OnMouseOver({e:n,target:t.Controller.CanvasItem})},function(n){return n.Type=="component"&&CanvasController.IsWithin(n,i)}))};LayoutElement.prototype.InitializeWorkspace=function(){var t=document.createElement("div"),i,n;AddCssClass(t,"row");AddCssClass(t,"DividedWorkspace");this.Root.appendChild(t);i=document.createElement("div");AddCssClass(i,"col-md-12");t.appendChild(i);n=this;this.WorkspaceController=new AirWorkspace(this.Workspace,function(){n.DistributionRulesMacro.PerformAction()},function(){n.IsDroppable=!0},function(){n.IsDroppable=!1},function(t){n.OnDragging(t)});this.WorkspaceController.Build(i)};LayoutElement.prototype.DnDHoverIn=function(){};LayoutElement.prototype.DnDHoverOut=function(){};AirSpaceBooking.DropFocus=function(){IsDefined(BRIX.LastAirSpaceBooking)&&(BRIX.LastAirSpaceBooking.Popup.IsOpen||BRIX.LastAirSpaceBooking.Popup.Hide(),BRIX.LastAirSpaceBooking=null)};AirSpaceBooking.prototype.OnMouseOver=function(){IsDefined(BRIX.LastAirSpaceBooking)&&BRIX.LastAirSpaceBooking!==this&&AirSpaceBooking.DropFocus();var n=CanvasController.GetObjectGlobalRect(this.CanvasObject);this.Draggable&&(this.Popup.Draggable=!0,this.Popup.DraggableContent="airspace:"+this.DropPayload);this.PopupOutHandle&&window.clearTimeout(this.PopupOutHandle);this.Popup.Show(n,this.CanvasContainer);BRIX.LastAirSpaceBooking=this};AirSpaceBooking.prototype.OnMouseOut=function(){return};AirSpaceBooking.prototype.OnScaled=function(n,t){this.UpdateTransform(t)};AirSpaceBooking.prototype.Remove=function(){var n,i,t;if(this.Item)for(n=[],this.Item.Controller.OnScaledCallbacks.map(function(t,i){t.Tag==="booking"&&n.push(i)}),i=n.length,t=0;t<i;t++)this.Item.Controller.OnScaledCallbacks.splice(n.pop(),1);this.CanvasObject.canvas.remove(this.CanvasObject);this.CanvasObject=null};AirSpaceBooking.FontFamily="Verdana";AirSpaceBooking.FontSize=14;AirSpaceBooking.prototype.CreateObject=function(n){var r=AirSpaceBooking.FontSize,u=this.Title.split("\n").length,f=AirSpaceBooking.FontSize/2,o=AirSpaceBooking.GetTextWidth(n,this.Title),s=this.Color.CreateCodeWithAlphaChannel(.6),e=new fabric.Rect({top:0,left:0,width:o+f*2,height:r*u+5*(u-1)+f*2,originX:"center",originY:"center",stroke:"black",strokeWidth:1,fill:s}),t,i;return e.setShadow({color:"rgba(0,0,0,0.6)",blur:5,offsetX:3,offsetY:3,opacity:.6,fillShadow:!0,strokeShadow:!0}),t=new fabric.Text(this.Title,{left:0,top:0,fontSize:r,fontFamily:AirSpaceBooking.FontFamily,originX:"center",originY:"center"}),t.setColor("#000"),t.setShadow({color:"rgba(255,255,255,0.6)",blur:8,offsetX:1,offsetY:1,opacity:.6,fillShadow:!0,strokeShadow:!0}),i=new fabric.Group([e,t],{originX:"center",originY:"center"}),i.hasControls=!1,i.selectable=!1,i};AirSpaceBooking.prototype.UpdateTransform=function(n){n=n||1;n>1&&(n=1);var r=this.Item.Controller.CanvasItem,i=CanvasController.GetObjectGlobalRect(r),t=this.CanvasObject;t.set("scaleX",n);t.set("scaleY",n);t.setLeft(i.left+i.width/2);t.setTop(i.top+i.height/2);t.setCoords()};AirSpaceBooking.GetTextWidth=function(n,t){var r,i,u;return this.Context||(this.Context=n.getContext("2d")),r=this.Context,r.font=AirSpaceBooking.FontSize+"px "+AirSpaceBooking.FontFamily,i=0,u=t.split("\n"),u.map(function(n){var t=r.measureText(n).width;t>i&&(i=t)}),i};AirSpaceBooking.Initialize=function(n,t,i,r,u){var f,e=function(n,t){for(var i,u,r=0;r<n.length;r++){if(i=n[r],i.Id===t)return i;if(u=i.Properties.SubItems?e(i.Properties.SubItems,t):null,u)return u}return null},o=[],s;if(t.map(function(t){var s=e(n,t.ItemId),l,h,c;s&&(t.Popup.MapFunctions=function(){return u(t)},t.CanvasContainer=r,l=s.Controller.CanvasItem,f=l.canvas,h=t.CreateObject(f,u),t.CanvasObject=h,h.AirBooking=t,t.Item=s,t.UpdateTransform(i),o.push(h),c=function(n,i){t.OnScaled(n,i)},c.Tag="booking",s.Controller.OnScaledCallbacks.push(c))}),r.addEventListener("scroll",function(){AirSpaceBooking.DropFocus()},!1),f){s=f.renderOnAddRemove;f.renderOnAddRemove=!1;o.map(function(n){f.add(n)});f.renderOnAddRemove=s;f.renderAll();f.on("mouse:over",function(n){n.target&&n.target.AirBooking&&n.target.AirBooking.OnMouseOver()});f.on("mouse:out",function(n){n.target&&n.target.AirBooking&&n.target.AirBooking.OnMouseOut()})}};AirSpacePopup.prototype.BuildToolbarHtml=function(n){var i=function(n){n.DomId="btn_"+GetNewId();var t=n.Icon?ActiveIconArchive.Get(n.Icon).Create().outerHTML+" ":"";return'<button type="button" id="'+n.DomId+'" class="btn btn-default btn-md">'+t+n.Caption+"<\/button>"},t=[];return n.map(function(n){t.push(i(n))}),'<div class="btn-group-vertical" role="group">'+t.join("")+"<\/div>"};AirSpacePopup.prototype.SetupDraggable=function(n){var t=this;n.setAttribute("draggable","true");n.style.backgroundColor="rgba(255, 255, 255, 0.2)";n.ondragstart=function(i){n.style.backgroundColor="rgba(255, 255, 255, 0.5)";n.style.border="2px dotted green";i.dataTransfer.setData("text",t.DraggableContent)};n.ondragend=function(){n.style.backgroundColor="";n.style.border=""}};BRIX.Debug=0;AirSpacePopup.prototype.Show=function(n,t){var r,i,f,u,e,o;this.GhostContainer||(r=this,i=document.createElement("div"),i.style.position="absolute",i.style.cursor=this.Draggable?"move":"pointer",this.Draggable&&this.SetupDraggable(i),f=this.MapFunctions?this.MapFunctions(this):[],u=new LayerPosition(t),u.Top-=t.scrollTop,u.Left-=t.scrollLeft,i.style.top=n.top+u.Top-4+"px",i.style.left=n.left+u.Left-4+"px",i.style.width=n.width+8+"px",i.style.height=n.height+8+"px",i.id="asbkn_"+GetNewId(),document.body.appendChild(i),$(i).attr("data-toggle","popover"),$(i).attr("title",this.Title+'<button type="button" id="close" class="close" onclick="$(&quot;#'+i.id+'&quot;).popover(&quot;hide&quot;);">&times;<\/button>'),$(i).attr("data-trigger","manual"),$(i).attr("data-placement","auto"),$(i).attr("data-toggle","popover"),f.length>0?(e=this.BuildToolbarHtml(f),o='<div class="popover AirSpaceBooking"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><div class="popover-footer">'+e+"<\/div><\/div>",$(i).popover({html:!0,content:this.Html,template:o})):$(i).popover({html:!0,content:this.Html}),$(i).popover(),$(i).click(function(){t.LastPopover&&t.LastPopover!==r&&t.LastPopover.Hide();r.IsOpen?r.Hide():($(i).popover("show"),r.IsOpen=!0,f.map(function(n){var t=document.getElementById(n.DomId);$(t).click(function(){n.Action();r.Hide()})}),t.LastPopover=r)}),this.GhostContainer=i)};AirSpacePopup.prototype.Hide=function(){this.GhostContainer&&($(this.GhostContainer).popover("destroy"),this.GhostContainer.parentNode.removeChild(this.GhostContainer),this.GhostContainer=null);this.IsOpen=!1};AirWorkspace.prototype.Rebuild=function(n){for(var t=this.PanelContent,i=t.firstChild;i;)t.removeChild(i),i=t.firstChild;this.Bookings=n;this.BuildBookingControls();this.SelectionUpdated()};AirWorkspace.prototype.Build=function(n){this.Container=n;var t=document.createElement("div");AddCssClass(t,"panel panel-default");this.Container.appendChild(t);this.PanelHead=document.createElement("div");AddCssClass(this.PanelHead,"panel-heading");t.appendChild(this.PanelHead);this.PanelContent=document.createElement("div");AddCssClass(this.PanelContent,"panel-body");t.appendChild(this.PanelContent);this.BuildToolbar();this.BuildBookingControls()};AirWorkspace.prototype.BuildToolbar=function(){var i=document.createElement("div"),n,t,r,u,f;AddCssClass(i,"btn-toolbar");i.setAttribute("role","toolbar");this.PanelHead.appendChild(i);this.Toolbar=i;n=document.createElement("div");AddCssClass(n,"btn-group");n.setAttribute("role","group");this.Toolbar.appendChild(n);this.ToolbarSelectionGroup=n;t=document.createElement("div");AddCssClass(t,"btn-group");t.setAttribute("role","group");this.Toolbar.appendChild(t);this.ToolbarRulesGroup=t;r=this;u=this.CreateButton(SelectAllIconName,"Select all",function(){r.SelectAll()});this.ToolbarSelectionGroup.appendChild(u);this.BuildMoveButton();f=this.CreateButton(DistributionRulesIconName,"Rules",function(){r.SetRules()});this.ToolbarRulesGroup.appendChild(f)};AirWorkspace.prototype.BuildMoveButton=function(){var t=this,n=this.CreateButton(MoveIconName,"0",function(){}),i;n.setAttribute("draggable","true");i=function(){var n=[],i=t.GetCheckboxes();return i.map(function(t){var r=i[t];r.checked&&n.push(r.value)}),n};n.ondragstart=function(n){var r=i(),u=JSON.stringify({Ids:r});n.dataTransfer.setData("text","airspace:"+u);t.OnDragStartCallback&&t.OnDragStartCallback(n)};n.ondragend=function(n){t.OnDragEndCallback&&t.OnDragEndCallback(n)};this.OnDraggingCallback&&(n.ondrag=function(n){t.OnDraggingCallback(n)});AddCssClass(n,"disabled");this.MoveallButton=n;this.ToolbarSelectionGroup.appendChild(n)};AirWorkspace.prototype.SelectAll=function(){for(var t=this.GetCheckboxes(),n=0;n<t.length;n++)t[n].checked=!t[n].checked;this.SelectionUpdated()};AirWorkspace.prototype.SelectionUpdated=function(){for(var i=this.GetCheckboxes(),n=0,t=0;t<i.length;t++)i[t].checked&&n++;n>0?(RemoveCssClass(this.MoveallButton,"disabled"),AddCssClass(this.MoveallButton,"btn-primary"),AddCssClass(this.MoveallButton,"MoveAllButtonActive")):(AddCssClass(this.MoveallButton,"disabled"),RemoveCssClass(this.MoveallButton,"btn-primary"),RemoveCssClass(this.MoveallButton,"MoveAllButtonActive"));this.MoveallButton.TextNode.nodeValue=n};AirWorkspace.prototype.GetCheckboxes=function(){return $(this.Container).find("[name='"+this.CheckboxName+"']")};AirWorkspace.prototype.CreateButton=function(n,t,i){var r=document.createElement("button"),f,u;return r.setAttribute("type","button"),AddCssClass(r,"btn btn-default btn-md"),f=new FontIcon(n).Create(),r.appendChild(f),u=document.createTextNode(t),r.TextNode=u,r.appendChild(document.createTextNode(" ")),r.appendChild(u),r.onclick=i,r};AirWorkspace.prototype.GetBookingRows=function(n){for(var t=this.Bookings.slice(),r=[],i,u;t.length>0;)i=t.length>=n?n:t.length,u=t.slice(0,i),t=t.slice(i),r.push(u);return r};AirWorkspace.prototype.BuildBookingControls=function(){for(var t,f,n,e,i,c=this.PanelContent,o=this.GetBookingRows(4),r=0,s=0,u=0;u<o.length;u++){t=document.createElement("div");AddCssClass(t,"row");c.appendChild(t);f=o[u];n=f.length;n>r?r=n:n=r;var a=12/n,h=Math.floor(12/n),l=(12/n-h)/2;for(e=0;e<f.length;e++)i=document.createElement("div"),AddCssClass(i,"col-md-"+h+" col-md-offset-"+l),t.appendChild(i),this.BuildBookingControl(this.Bookings[s],i),s++}};AirWorkspace.prototype.BuildBookingControl=function(n,t){var r=this,u=document.createElement("div"),i,e,o,f,s;u.setAttribute("draggable","true");AddCssClass(u,"checkbox-inline");t.appendChild(u);u.ondragstart=function(t){var i=JSON.stringify({Ids:[n.Id]});t.dataTransfer.setData("text","airspace:"+i);r.OnDragStartCallback&&r.OnDragStartCallback()};u.ondragend=function(){r.OnDragEndCallback&&r.OnDragEndCallback()};this.OnDraggingCallback&&(u.ondrag=function(n){r.OnDraggingCallback(n)});i=ActiveIconArchive.Get(InfoIconName).Create("pointer");i.id="wks_"+GetNewId();n.Color&&(e=new Color(n.Color),i.style.color=e.IsTransparent||e.Code()=="#ffffff"?"#000":e.Code());t.appendChild(i);$(i).attr("data-trigger","manual");$(i).attr("data-toggle","popover");$(i).attr("data-placement","auto");$(i).attr("title",n.Title+'<button type="button" id="close" class="close" onclick="$(&quot;#'+i.id+'&quot;).popover(&quot;hide&quot;);">&times;<\/button>');$(i).popover({html:!0,content:n.Details});$(i).popover();$(i).click(function(){r.LastPopover&&r.LastPopover!==i&&$(r.LastPopover).popover("hide");$(i).popover("toggle");r.LastPopover=i});o=document.createElement("label");u.appendChild(o);f=document.createElement("input");f.onclick=function(){r.SelectionUpdated()};f.setAttribute("name",this.CheckboxName);f.setAttribute("type","checkbox");f.setAttribute("value",n.Id);o.appendChild(f);s=DecodeHtml(n.Title);o.appendChild(document.createTextNode(s))};ChartDesignerElement.InheritsFrom(ElementBase);ChartDesignerElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.ChartKey=n.getAttribute("chart_key");this.ChartDesignerKey=n.getAttribute("chart_designer_key");this.SeatsIOLang=n.getAttribute("chart_language");this.ShowDraft=n.getAttribute("show_draft")==="true"};ChartDesignerElement.prototype.InitializeMe=function(){var r=this.GetParentBody(this),n=document.createElement("div"),t,i;n.id=this.Id;AddCssClass(n,"AirSeatsChart");r.appendChild(n);t=document.createElement("div");t.id="idSeatsChart";AddCssClass(t,"AirSeatsChart");n.appendChild(t);i=new seatsio.SeatingChartDesigner({v2:!0,divId:"idSeatsChart",designerKey:this.ChartDesignerKey,chartKey:this.ChartKey,language:this.SeatsIOLang,openDraftDrawing:this.ShowDraft});i.render()};EventAssignerElement.InheritsFrom(ElementBase);EventAssignerElement.prototype.GetXmlNodeData=function(n){var t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);this.GetContentData(n);this.ChartEventKey=n.getAttribute("chart_event_key");this.PublicKey=n.getAttribute("public_key");this.SeatsIOLang=n.getAttribute("chart_event_language");this.AssignMode=n.getAttribute("assign_mode");this.ShowingMode=n.getAttribute("showing_mode");t=n.selectSingleNode("AssignClicAndClicMacro");this.AssignClicAndClicMacro=new MacroElement(this,t.firstChild);this.ClicAndClicInfoParameter=n.getAttribute("assignclicandclic_param");i=n.selectSingleNode("AssignConfirmButtonMacro");this.AssignConfirmButtonMacro=new MacroElement(this,i.firstChild);this.AssignConfirmInfoParameter=n.getAttribute("assignconfirm_param");r=n.selectSingleNode("ReleaseBookingsSeatsMacro");this.ReleaseBookingsSeatsMacro=new MacroElement(this,r.firstChild);this.ReleaseBookingsSeatsParameter=n.getAttribute("release_param");this.ReleaseCaption=n.getAttribute("release_text")||"Release";this.ConfirmCaption=n.getAttribute("confirm_text")||"Confirm"};EventAssignerElement.prototype.GetContentData=function(n){var o=GetCDataValue(n,"Bookings"),r=JSON.parse(o).Bookings,i,f,e;for(this.Bookings=[],i=0;i<r.length;i++){var t=r[i],u=new AirSpaceBooking(t.Booking.Id,t.ItemId,t.Booking.Title,t.Booking.Details,t.Booking.Color),s=this.ItemIndex[t.ItemId];u.DropPayload='{"Action":"Move", "Item":"'+t.ItemId+'"}';this.Bookings.push(u)}f=GetCDataValue(n,"Workspace");e=JSON.parse(f);this.Workspace=e.Bookings};EventAssignerElement.prototype.InitializeMe=function(){var e=this.GetParentBody(this),i=document.createElement("div"),t,r,n,u,f;i.id=this.Id;AddCssClass(i,"AirSeatsChart");e.appendChild(i);t=document.createElement("div");t.id="idBookings";AddCssClass(t,"col-md-3");AddCssClass(t,"SeatsBookingsColumn");i.appendChild(t);r=document.createElement("div");AddCssClass(r,"col-md-12");AddCssClass(r,"SeatsBookingsColumn");t.appendChild(r);n=this;this.WorkspaceController=new AirSeatsWorkspace(this.Workspace,function(){n.DistributionRulesMacro.PerformAction()},function(){for(var t=0,u=[],f,i,r,e,o,t=0;t<n.WorkspaceController.SeatsSelected.length;t++)f={SeatBlockId:0,SeatId:n.WorkspaceController.SeatsSelected[t].seatId,SeatLabel:n.WorkspaceController.SeatsSelected[t].label,SeatUUID:n.WorkspaceController.SeatsSelected[t].uuid,SeatCategory:n.WorkspaceController.SeatsSelected[t].category==null?"":n.WorkspaceController.SeatsSelected[t].category.label,SeatIsInGeneralAdmission:n.WorkspaceController.SeatsSelected[t].objectType=="GeneralAdmissionArea"},u.push(f);for(i=[],r=[],t=0;t<n.WorkspaceController.BookingsSelected.length;t++)i.push(n.WorkspaceController.BookingsSelected[t].key),r.push(n.WorkspaceController.BookingsSelected[t].title);e={SeatsInfo:u,BookingIds:i,BookingTitles:r};o=JSON.stringify(e);n.ReleaseBookingsSeatsMacro.AddClientArgument(n.ReleaseBookingsSeatsParameter,o);n.ReleaseBookingsSeatsMacro.PerformAction()},function(){for(var t=0,u=[],f,i,r,e,o,t=0;t<n.WorkspaceController.SeatsSelected.length;t++)f={SeatBlockId:0,SeatId:n.WorkspaceController.SeatsSelected[t].seatId,SeatLabel:n.WorkspaceController.SeatsSelected[t].label,SeatUUID:n.WorkspaceController.SeatsSelected[t].uuid,SeatCategory:n.WorkspaceController.SeatsSelected[t].category==null?"":n.WorkspaceController.SeatsSelected[t].category.label,SeatIsInGeneralAdmission:n.WorkspaceController.SeatsSelected[t].objectType=="GeneralAdmissionArea"},u.push(f);for(i=[],r=[],t=0;t<n.WorkspaceController.BookingsSelected.length;t++)i.push(n.WorkspaceController.BookingsSelected[t].key),r.push(n.WorkspaceController.BookingsSelected[t].title);e={SeatsInfo:u,BookingIds:i,BookingTitles:r};o=JSON.stringify(e);n.AssignConfirmButtonMacro.AddClientArgument(n.AssignConfirmInfoParameter,o);n.AssignConfirmButtonMacro.PerformAction()},this.ShowingMode!=="not_seated",this.AssignMode==="confirm_button",this.AssignMode==="clic_and_clic",function(){var t={CallbackId:n.Id,Action:"add",SeatId:n.WorkspaceController.SeatsSelected[0].seatId,SeatLabel:n.WorkspaceController.SeatsSelected[0].label,SeatUUID:n.WorkspaceController.SeatsSelected[0].uuid,SeatCategory:n.WorkspaceController.SeatsSelected[0].category==null?"":n.WorkspaceController.SeatsSelected[0].category.label,SeatIsInGeneralAdmission:n.WorkspaceController.SeatsSelected[0].objectType=="GeneralAdmissionArea",BookingId:n.WorkspaceController.BookingsSelected[0].key,BookingTitle:n.WorkspaceController.BookingsSelected[0].title},i=JSON.stringify(t);n.AssignClicAndClicMacro.AddClientArgument(n.ClicAndClicInfoParameter,i);n.AssignClicAndClicMacro.PerformAction()},function(t){n.SeatChart.findObject(t,function(n){n.pulse();setTimeout(function(){n.unpulse()},2200)},function(){console.log("not found")})},this.ReleaseCaption,this.ConfirmCaption);this.WorkspaceController.Build(r);u=document.createElement("div");u.id="idtestingEvent";AddCssClass(u,"AirSeatsChart");AddCssClass(u,"col-md-9");i.appendChild(u);f=new seatsio.SeatingChart({divId:"idtestingEvent",publicKey:this.PublicKey,event:this.ChartEventKey,language:this.SeatsIOLang,onObjectSelected:function(t){n.AddSeat(t)},onObjectDeselected:function(t){n.RemoveSeat(t)},tooltipInfo:function(n){if(n.extraData&&n.extraData.name)return n.extraData.name},objectLabel:function(n){return n.type!=="seat"?n.label:n.labels.own},objectColor:function(n,t){if(n.status=="booked"){function i(n){var f=n,t,i,u,e;return n.match(/^rgb/)?(n=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/),t=n[1],i=n[2],u=n[3]):(n=+("0x"+n.slice(1).replace(n.length<5&&/./g,"$&$&")),t=n>>16,i=n>>8&255,u=n&255),e=Math.sqrt(.299*t*t+.587*i*i+.114*u*u),e>127.5?r(f,-.5):r(f,.5)}function r(n,t){n=String(n).replace(/[^0-9a-f]/gi,"");n.length<6&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]);t=t||0;for(var u="#",i,r=0;r<3;r++)i=parseInt(n.substr(r*2,2),16),i=Math.round(Math.min(Math.max(0,i+i*t),255)).toString(16),u+=("00"+i).substr(i.length);return u}return n.category?i(n.category.color):i(t)}return t}});this.SeatChart=f;f.render()};EventAssignerElement.prototype.AddSeat=function(n){var t=this,r,u,f,i;t.AssignMode==="clic_and_clic"?t.WorkspaceController.BookingsSelected.length===0?t.WorkspaceController.SeatsSelected.length===1?(r=t.WorkspaceController.SeatsSelected[0],r.deselect(),t.WorkspaceController.SeatsSelected.splice(0,1),t.WorkspaceController.SeatsSelected.push(n)):t.WorkspaceController.SeatsSelected.push(n):t.WorkspaceController.BookingsSelected.length===1?(u={CallbackId:this.Id,Action:"add",SeatId:n.seatId,SeatLabel:n.label,SeatUUID:n.uuid,SeatCategory:n.category==null?"":n.category.label,SeatIsInGeneralAdmission:n.objectType=="GeneralAdmissionArea",BookingId:t.WorkspaceController.BookingsSelected[0].key,BookingTitle:t.WorkspaceController.BookingsSelected[0].title},f=JSON.stringify(u),this.AssignClicAndClicMacro.AddClientArgument(this.ClicAndClicInfoParameter,f),this.AssignClicAndClicMacro.PerformAction()):window.alert("error"):t.AssignMode==="confirm_button"?(i=t.WorkspaceController.SeatsSelected.map(function(n){return n.uuid}).indexOf(n.uuid),i!==-1&&t.WorkspaceController.SeatsSelected.splice(i,1),t.WorkspaceController.SeatsSelected.push(n)):(i=t.WorkspaceController.SeatsSelected.map(function(n){return n.uuid}).indexOf(n.uuid),i!==-1&&t.WorkspaceController.SeatsSelected.splice(i,1),t.WorkspaceController.SeatsSelected.push(n))};EventAssignerElement.prototype.RemoveSeat=function(n){var t=this,i=t.WorkspaceController.SeatsSelected.map(function(n){return n.uuid}).indexOf(n.uuid);i!==-1&&t.WorkspaceController.SeatsSelected.splice(i,1)};AirSeatsBooking.DropFocus=function(){IsDefined(BRIX.LastAirSpaceBooking)&&(BRIX.LastAirSpaceBooking.Popup.IsOpen||BRIX.LastAirSpaceBooking.Popup.Hide(),BRIX.LastAirSpaceBooking=null)};AirSeatsBooking.prototype.OnMouseOver=function(){IsDefined(BRIX.LastAirSpaceBooking)&&BRIX.LastAirSpaceBooking!==this&&AirSeatsBooking.DropFocus();var n=CanvasController.GetObjectGlobalRect(this.CanvasObject);this.Draggable&&(this.Popup.Draggable=!0,this.Popup.DraggableContent="airspace:"+this.DropPayload);this.PopupOutHandle&&window.clearTimeout(this.PopupOutHandle);this.Popup.Show(n,this.CanvasContainer);BRIX.LastAirSpaceBooking=this};AirSeatsBooking.prototype.OnMouseOut=function(){return};AirSeatsBooking.prototype.OnScaled=function(n,t){this.UpdateTransform(t)};AirSeatsBooking.prototype.Remove=function(){var n,i,t;if(this.Item)for(n=[],this.Item.Controller.OnScaledCallbacks.map(function(t,i){t.Tag==="booking"&&n.push(i)}),i=n.length,t=0;t<i;t++)this.Item.Controller.OnScaledCallbacks.splice(n.pop(),1);this.CanvasObject.canvas.remove(this.CanvasObject);this.CanvasObject=null};AirSeatsBooking.FontFamily="Verdana";AirSeatsBooking.FontSize=14;AirSeatsBooking.prototype.CreateObject=function(n){var r=AirSeatsBooking.FontSize,u=this.Title.split("\n").length,f=AirSeatsBooking.FontSize/2,o=AirSeatsBooking.GetTextWidth(n,this.Title),s=this.Color.CreateCodeWithAlphaChannel(.6),e=new fabric.Rect({top:0,left:0,width:o+f*2,height:r*u+5*(u-1)+f*2,originX:"center",originY:"center",stroke:"black",strokeWidth:1,fill:s}),t,i;return e.setShadow({color:"rgba(0,0,0,0.6)",blur:5,offsetX:3,offsetY:3,opacity:.6,fillShadow:!0,strokeShadow:!0}),t=new fabric.Text(this.Title,{left:0,top:0,fontSize:r,fontFamily:AirSpaceBooking.FontFamily,originX:"center",originY:"center"}),t.setColor("#000"),t.setShadow({color:"rgba(255,255,255,0.6)",blur:8,offsetX:1,offsetY:1,opacity:.6,fillShadow:!0,strokeShadow:!0}),i=new fabric.Group([e,t],{originX:"center",originY:"center"}),i.hasControls=!1,i.selectable=!1,i};AirSeatsBooking.prototype.UpdateTransform=function(n){n=n||1;n>1&&(n=1);var r=this.Item.Controller.CanvasItem,i=CanvasController.GetObjectGlobalRect(r),t=this.CanvasObject;t.set("scaleX",n);t.set("scaleY",n);t.setLeft(i.left+i.width/2);t.setTop(i.top+i.height/2);t.setCoords()};AirSeatsBooking.GetTextWidth=function(n,t){var r,i,u;return this.Context||(this.Context=n.getContext("2d")),r=this.Context,r.font=AirSeatsBooking.FontSize+"px "+AirSeatsBooking.FontFamily,i=0,u=t.split("\n"),u.map(function(n){var t=r.measureText(n).width;t>i&&(i=t)}),i};AirSeatsBooking.Initialize=function(n,t,i,r,u){var f,e=function(n,t){for(var i,u,r=0;r<n.length;r++){if(i=n[r],i.Id===t)return i;if(u=i.Properties.SubItems?e(i.Properties.SubItems,t):null,u)return u}return null},o=[],s;if(t.map(function(t){var s=e(n,t.ItemId),l,h,c;s&&(t.Popup.MapFunctions=function(){return u(t)},t.CanvasContainer=r,l=s.Controller.CanvasItem,f=l.canvas,h=t.CreateObject(f,u),t.CanvasObject=h,h.AirBooking=t,t.Item=s,t.UpdateTransform(i),o.push(h),c=function(n,i){t.OnScaled(n,i)},c.Tag="booking",s.Controller.OnScaledCallbacks.push(c))}),r.addEventListener("scroll",function(){AirSeatsBooking.DropFocus()},!1),f){s=f.renderOnAddRemove;f.renderOnAddRemove=!1;o.map(function(n){f.add(n)});f.renderOnAddRemove=s;f.renderAll();f.on("mouse:over",function(n){n.target&&n.target.AirBooking&&n.target.AirBooking.OnMouseOver()});f.on("mouse:out",function(n){n.target&&n.target.AirBooking&&n.target.AirBooking.OnMouseOut()})}};AirSeatsWorkspace.prototype.Rebuild=function(n){for(var t=this.PanelContent,i=t.firstChild;i;)t.removeChild(i),i=t.firstChild;this.Bookings=n;this.BuildBookingControls();this.SelectionUpdated()};AirSeatsWorkspace.prototype.Build=function(n){this.Container=n;var t=document.createElement("div");AddCssClass(t,"panel panel-default");this.Container.appendChild(t);this.PanelHead=document.createElement("div");AddCssClass(this.PanelHead,"panel-heading");t.appendChild(this.PanelHead);this.PanelContent=document.createElement("div");AddCssClass(this.PanelContent,"panel-body");t.appendChild(this.PanelContent);this.BuildToolbar();this.BuildBookingControls()};AirSeatsWorkspace.prototype.BuildToolbar=function(){var t=document.createElement("div"),n,i,r,u;AddCssClass(t,"btn-toolbar");t.setAttribute("role","toolbar");this.PanelHead.appendChild(t);this.Toolbar=t;n=document.createElement("div");AddCssClass(n,"btn-group");n.setAttribute("role","group");this.Toolbar.appendChild(n);this.ToolbarToolsGroup=n;i=this;this.ShowReleaseButton&&(r=this.CreateButton3(ReleaseIconName,this.ReleaseCaption,function(){i.Release()}),this.ToolbarToolsGroup.appendChild(r));this.ShowConfirmAssignButton&&(u=this.CreateButton3(ConfirmAssignIconName,this.ConfirmCaption,function(){i.ConfirmAssign()}),this.ToolbarToolsGroup.appendChild(u))};AirSeatsWorkspace.prototype.SelectAll=function(){for(var t=this.GetCheckboxes(),n=0;n<t.length;n++)t[n].checked=!t[n].checked;this.SelectionUpdated()};AirSeatsWorkspace.prototype.SelectionUpdated=function(){var t=this.GetCheckboxes(),i,r,n,u;if(this.ClicAndClicEnabled)if(this.SeatsSelected.length===0)if(this.BookingsSelected.length===0)for(n=0;n<t.length;n++)t[n].checked&&this.BookingsSelected.push({key:t[n].value,title:t[n].parentElement.textContent});else if(this.BookingsSelected.length===1)for(i=this.BookingsSelected.pop(),n=0;n<t.length;n++)t[n].checked&&(t[n].value!==i.key?this.BookingsSelected.push({key:t[n].value,title:t[n].parentElement.textContent}):t[n].checked=!1);else window.alert("error");else if(this.SeatsSelected.length===1){for(n=0;n<t.length;n++)if(t[n].checked){this.BookingsSelected.push({key:t[n].value,title:t[n].parentElement.textContent});break}this.ClicAndClic()}else window.alert("error");else for(r=0,n=0;n<t.length;n++)t[n].checked?(r++,FindWithAttr(this.BookingsSelected,"key",t[n].value)===-1&&this.BookingsSelected.push({key:t[n].value,title:t[n].parentElement.textContent})):t[n].checked||FindWithAttr(this.BookingsSelected,"key",t[n].value)!==-1&&(u=FindWithAttr(this.BookingsSelected,"key",t[n].value),this.BookingsSelected.splice(u,1))};AirSeatsWorkspace.prototype.GetCheckboxes=function(){return $(this.Container).find("[name='"+this.CheckboxName+"']")};AirSeatsWorkspace.prototype.CreateButton3=function(n,t,i){var r=document.createElement("button"),f,u;return r.setAttribute("type","button"),AddCssClass(r,"btn btn-default btn-md"),f=new FontIcon(n).Create(),r.appendChild(f),u=document.createTextNode(t),r.TextNode=u,r.appendChild(document.createTextNode(" ")),r.appendChild(u),r.onclick=i,r};AirSeatsWorkspace.prototype.CreateButton=function(n,t){var i=document.createElement("button"),r;return i.setAttribute("type","button"),AddCssClass(i,"btn btn-default btn-md"),r=document.createTextNode(n),i.TextNode=r,i.appendChild(document.createTextNode(" ")),i.appendChild(r),i.onclick=t,i};AirSeatsWorkspace.prototype.GetBookingRows=function(n){for(var t=this.Bookings.slice(),r=[],i,u;t.length>0;)i=t.length>=n?n:t.length,u=t.slice(0,i),t=t.slice(i),r.push(u);return r};AirSeatsWorkspace.prototype.BuildBookingControls=function(){for(var t,f,n,e,i,c=this.PanelContent,o=this.GetBookingRows(1),r=0,s=0,u=0;u<o.length;u++){t=document.createElement("div");AddCssClass(t,"row");c.appendChild(t);f=o[u];n=f.length;n>r?r=n:n=r;var a=12/n,h=Math.floor(12/n),l=(12/n-h)/2;for(e=0;e<f.length;e++)i=document.createElement("div"),AddCssClass(i,"col-md-"+h+" col-md-offset-"+l),t.appendChild(i),this.BuildBookingControl(this.Bookings[s],i),s++}};AirSeatsWorkspace.prototype.BuildBookingControl=function(n,t){var u=this,h,c,o,i,e,r,s,f,l;if(n.IsCategory){h="{095F560F-99B0-4850-BF6B-9ED5E2FB63F9}";c=n.CategoryTitle.split(h);c.forEach(a);function a(n,i){var r=document.createElement("div"),u,f;AddCssClass(r,"SeatsCategory");r.style.marginLeft=i*10+"px";t.appendChild(r);u=document.createElement("label");u.style.textIndent="5px";r.appendChild(u);f=DecodeHtml(n);u.appendChild(document.createTextNode(f))}}else o=document.createElement("div"),AddCssClass(o,"checkbox-inline"),t.appendChild(o),i=ActiveIconArchive.Get(InfoIconName).Create("pointer"),i.id="wks_"+GetNewId(),n.Color&&(r=new Color(n.Color),i.style.color=r.IsTransparent||r.Code()=="#ffffff"?"#000":r.Code()),t.appendChild(i),$(i).attr("data-trigger","manual"),$(i).attr("data-toggle","popover"),$(i).attr("data-placement","right"),$(i).attr("title",n.Title+'<button type="button" id="close" class="close" onclick="$(&quot;#'+i.id+'&quot;).popover(&quot;hide&quot;);">&times;<\/button>'),$(i).popover({html:!0,content:n.Details}),$(i).popover(),$(i).click(function(){u.LastPopover&&u.LastPopover!==i&&$(u.LastPopover).popover("hide");$(i).popover("toggle");u.LastPopover=i}),n.SeatId!==""&&(e=ActiveIconArchive.Get(PositionIconName).Create("pointer"),e.id="wks_pulse_"+GetNewId(),n.Color&&(r=new Color(n.Color),e.style.color=r.IsTransparent||r.Code()=="#ffffff"?"#000":r.Code()),t.appendChild(e),$(e).click(function(){var t=n.SeatId;u.ShowSeat(t)})),s=document.createElement("label"),o.appendChild(s),f=document.createElement("input"),f.onclick=function(){u.SelectionUpdated()},f.setAttribute("name",this.CheckboxName),f.setAttribute("type","checkbox"),f.setAttribute("value",n.Id),s.appendChild(f),l=DecodeHtml(n.Title),s.appendChild(document.createTextNode(l))};BRIX.Bootstrap={CreateLabel:function(n){var t=document.createElement("span");return AddCssClass(t,"label"),AddCssClass(t,"label-"+n.Context.Style),t.appendChild(document.createTextNode(n.Text)),t},CreateCaption:function(n,t){if(n.appendChild(document.createTextNode(t.Text)),t.Badge){n.appendChild(document.createTextNode(" "));var i=document.createElement("span");AddCssClass(i,"badge");i.appendChild(document.createTextNode(t.Badge));n.appendChild(i)}}};GridRowElement.InheritsFrom(ElementBase);GridRowElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};GridRowElement.prototype.InitializeMe=function(){this.Body=document.createElement("div");AddCssClass(this.Body,"row");this.Body.id=this.Id;var n=this.Parent.GetBodyElement();n.appendChild(this.Body)};GridColumnElement.InheritsFrom(ElementBase);GridColumnElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n);this.IconLeft=n.getAttribute("icon_left");this.IconRight=n.getAttribute("icon_right")};GridColumnElement.prototype.ColumnSize=function(){for(var r=0,i=0,e=this.Parent,n=e.FirstChild,u=0,t,f;n;)n.MyClassName==this.MyClassName&&(n.Id===this.Id&&(r=u+1),i++),n=n.NextSibling,u++;return t=Math.floor(12/i),f=12-t*i,f>=r?t+1:t};GridColumnElement.prototype.InitializeMe=function(){var i,n,t,r;this.Body=document.createElement("div");i=this.ColumnSize();AddCssClass(this.Body,"col-xs-"+i);this.Body.id=this.Id;this.IconLeft&&(n=ActiveIconArchive.Get(this.IconLeft).Create(),this.Body.appendChild(n),AddCssClass(n,"pull-left"));this.IconRight&&(t=ActiveIconArchive.Get(this.IconRight).Create(),this.Body.appendChild(t),AddCssClass(t,"pull-right"));r=this.Parent.GetBodyElement();r.appendChild(this.Body)};TabGroupElement.InheritsFrom(ElementBase);TabGroupElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};TabGroupElement.prototype.InitializeMe=function(){this.Root=document.createElement("div");this.Root.id=this.Id;var n=this.Parent.GetBodyElement();n.appendChild(this.Root);this.TabContainer=document.createElement("ul");AddCssClass(this.TabContainer,"nav nav-tabs");this.Root.appendChild(this.TabContainer);this.Body=document.createElement("div");AddCssClass(this.Body,"tab-content");this.Root.appendChild(this.Body)};TabElement.InheritsFrom(ElementBase);TabElement.prototype.GetXmlNodeData=function(n){var u,t,i,r;ElementBase.prototype.GetXmlNodeData.call(this,n);u=GetCDataValue(n,"json");t=JSON.parse(u);for(i in t)this[i]=t[i];this.isActive=n.getAttribute("isActive")==="true";r=n.selectSingleNode("UpdateTabValueMacro");r&&(this.UpdateTabValueMacro=new MacroElement(this,r.firstChild));this.identifier=n.getAttribute("identifier")};TabElement.prototype.InitializeMe=function(){var i,t,r,u,n;if(!this.Parent.TabContainer)throw new Error("Invalid parent. Must be a tab container");for(i=!1,t=this.Parent.FirstChild,r=0;r<this.Parent.ChildCount;r++)t.MyClassName===this.MyClassName&&t.isActive===!0&&(i=!0),t=t.NextSibling;i===!1&&this.Parent.FirstChild===this&&(this.isActive=!0);this.Tab=document.createElement("li");this.isActive===!0&&AddCssClass(this.Tab,"active");this.Parent.TabContainer.appendChild(this.Tab);u=this;n=document.createElement("a");BRIX.Bootstrap.CreateCaption(n,this.Caption);n.setAttribute("data-toggle","tab");n.setAttribute("href","#"+this.Id);n.onclick=function(){$(this).tab("show");u.UpdateTabValue()};this.Tab.appendChild(n);this.Root=document.createElement("div");this.Root.id=this.Id;AddCssClass(this.Root,"tab-pane fade");this.isActive===!0&&AddCssClass(this.Root,"in active");this.Parent.Body.appendChild(this.Root);this.Body=document.createElement("div");this.Root.appendChild(this.Body)};TabElement.prototype.CleanUp=function(){this.tab&&(this.Tab.parentNode.removeChild(this.Tab),this.Tab=null)};TabElement.prototype.UpdateTabValue=function(){this.UpdateTabValue&&(this.identifier==="primary"?(this.UpdateTabValueMacro.AddClientArgument("primary_isActive",!0),this.UpdateTabValueMacro.AddClientArgument("secondary_isActive",!1)):this.identifier==="secondary"&&(this.UpdateTabValueMacro.AddClientArgument("secondary_isActive",!0),this.UpdateTabValueMacro.AddClientArgument("primary_isActive",!1)),this.UpdateTabValueMacro.PerformAction())};PanelGroupElement.InheritsFrom(ElementBase);PanelGroupElement.prototype.GetXmlNodeData=function(n){ElementBase.prototype.GetXmlNodeData.call(this,n)};PanelGroupElement.prototype.InitializeMe=function(){this.Body=document.createElement("div");AddCssClass(this.Body,"panel-group");this.Body.id=this.Id;var n=this.Parent.GetBodyElement();n.appendChild(this.Body)};PanelElement.InheritsFrom(ElementBase);PanelElement.prototype.GetXmlNodeData=function(n){var r,t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);r=GetCDataValue(n,"json");t=JSON.parse(r);for(i in t)this[i]=t[i];this.HeadingElement="h5";this.ContainerId="cont_"+this.Id;BRIX.Memory.current_panel&&BRIX.Memory.current_panel===this.Name&&(this.Collapsed=!1)};PanelElement.prototype.InitializeMe=function(){var n=document.createElement("div"),t;AddCssClass(n,"panel");AddCssClass(n,"panel-"+this.Context.Style);this.BuildHeading(n);this.BuildBody(n);this.Root=n;this.Root.id=this.Id;t=this.Parent.GetBodyElement(this);t.appendChild(this.Root)};PanelElement.prototype.Expand=function(){var n=$("#"+this.Id+">.collapse");n&&n.collapse("show")};PanelElement.prototype.BuildBody=function(n){var t=document.createElement("div"),i;n.appendChild(t);this.Container=t;t.id=this.ContainerId;this.Collapsed?AddCssClass(t,"panel-collapse collapse"):AddCssClass(t,"panel-collapse collapse in");i=document.createElement("div");t.appendChild(i);this.Body=i;AddCssClass(i,"panel-body")};PanelElement.prototype.BuildHeading=function(n){var o=this,r=document.createElement("div"),u,f,s,i,e,t,h,c;if(AddCssClass(r,"panel-heading"),n.appendChild(r),this.Heading.Tag)for(u=document.createElement(this.HeadingElement),r.appendChild(u),AddCssClass(u,"panel-title pull-right"),f=document.createElement("small"),u.appendChild(f),s=this.Heading.Tag.split("\n"),i=0;i<s.length;i++)i>0&&f.appendChild(document.createElement("br")),f.appendChild(document.createTextNode(s[i]));e=document.createElement(this.HeadingElement);r.appendChild(e);this.Collapsible?(t=document.createElement("a"),t.setAttribute("data-toggle","collapse"),t.onclick=function(){o.Name&&(BRIX.Memory.current_panel=o.Name);$("#"+o.ContainerId).collapse("toggle")}):t=document.createElement("span");this.Heading.Icon&&(h=ActiveIconArchive.Get(this.Heading.Icon).Create(),t.appendChild(h),t.appendChild(document.createTextNode(" ")));BRIX.Bootstrap.CreateCaption(t,this.Heading.Caption);e.appendChild(t);this.Heading.Label&&(c=BRIX.Bootstrap.CreateLabel(this.Heading.Label),e.appendChild(c))};ProgressElement.InheritsFrom(ElementBase);ProgressElement.prototype.GetXmlNodeData=function(n){var r,t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);r=GetCDataValue(n,"json");t=JSON.parse(r);for(i in t)this[i]=t[i]};ProgressElement.prototype.InitializeMe=function(){var i,t,n,r;this.Root=document.createElement("div");this.Root.id=this.Id;i=this.Parent.GetBodyElement();i.appendChild(this.Root);AddCssClass(this.Root,"progress");t=Math.round(this.Progress*100);n=document.createElement("div");AddCssClass(n,"progress-bar");n.setAttribute("role","progressbar");n.style.width=t+"%";n.appendChild(document.createTextNode(t+"%"));this.Root.appendChild(n);this.Bar=n;r=this;this.ProcessHandle=window.setTimeout(function(){r.UpdateProgress()},700)};ProgressElement.prototype.BeforeDestroyed=function(){this.ProcessHandle&&window.clearTimeout(this.ProcessHandle)};ProgressElement.prototype.UpdateProgress=function(){var t=this,n,i;this.ProcessHandle=null;n=this.Find(function(n){return n.MyClassName=="MacroElement"});n&&(i=n.PerformAction(),i||(t.ProcessHandle=window.setTimeout(function(){t.UpdateProgress()},1e3)))};BsTableElement.InheritsFrom(ElementBase);BsTableElement.prototype.GetXmlNodeData=function(n){var u,i,t,r,f;for(ElementBase.prototype.GetXmlNodeData.call(this,n),u=GetCDataValue(n,"Json"),this.Data=JSON.parse(u),i=n.selectNodes("./buffer"),this.ElementBuffer=[],this.CellIndex={},t=0;t<i.length;t++)r=i[t],f=this.CreateChildNode(r.firstChild),this.ElementBuffer.push({Id:(r.getAttribute("id")||0)*1,Element:f.Id});this.ScrollInto=n.getAttribute("scroll_into_listoption")};BsTableElement.prototype.GetBodyElement=function(n){var t,i,r;if(n==null)return this.Root;for(t=null,i=0;i<this.ElementBuffer.length;i++)if(r=this.ElementBuffer[i],r.Element===n.Id&&this.CellIndex[r.Id]){t=this.CellIndex[r.Id];break}if(t)return t};BsTableElement.prototype.InitializeMe=function(){var n=document.createElement("table"),t;n.id=this.Id;AddCssClass(n,"table");this.Data.Style.indexOf("Bordered")!=-1&&AddCssClass(n,"table-bordered");this.Data.Style.indexOf("Striped")!=-1&&AddCssClass(n,"table-striped");this.Root=n;t=this.Parent.GetBodyElement();t.appendChild(n);this.Data.Header&&this.BuildSection(n,this.Data.Header,"thead",!0);this.Data.Body&&this.BuildSection(n,this.Data.Body,"tbody");this.Data.Footer&&this.BuildSection(n,this.Data.Footer,"tfoot")};BsTableElement.prototype.PostInitialized=function(){if(this.ScrollInto!==null){var n=document.getElementById(this.ScrollInto);n!==null&&n.scrollIntoView({block:"center"})}};BsTableElement.prototype.BuildSection=function(n,t,i,r){var f=document.createElement(i),u,e;for(n.appendChild(f),u=0;u<t.Rows.length;u++)e=t.Rows[u],this.BuildRow(f,e,r)};BsTableElement.prototype.BuildRow=function(n,t,i){var r=document.createElement("tr"),u,f;for(t.Context&&AddCssClass(r,t.Context.Style),t.Id&&(r.id=t.Id),n.appendChild(r),u=0;u<t.Cells.length;u++)f=t.Cells[u],this.BuildCell(r,f,i)};BsTableElement.prototype.BuildCell=function(n,t,i){var r=document.createElement(i?"th":"td"),u,f;for(t.ColSpan!==1&&r.setAttribute("colspan",t.ColSpan),n.appendChild(r),IsDefined(t.Text)&&r.appendChild(document.createTextNode(t.Text)),IsDefined(t.Html)&&$(r).append(t.Html),u=0;u<t.Elements.length;u++)f=t.Elements[u],this.CellIndex[f*1]=r};BRIX.Conditions={};BRIX.Conditions.Callback={};BRIX.Conditions.CreateLineContainer=function(){var n=document.createElement("div"),t;return AddCssClass(n,"navbar"),AddCssClass(n,"navbar-default"),t=document.createElement("div"),n.appendChild(t),{Root:n,Body:t}};BRIX.Conditions.CreateValueBox=function(n,t,i,r){var u;if(i.Options)u=BRIX.Conditions.Helpers.CreateListbox(n,i.Options,r);else if(i.Datatype=="string")u=BRIX.Conditions.Helpers.CreateInput(n,r||"",BRIX.Inputs.CreateTextInput);else if(i.Datatype=="num")u=BRIX.Conditions.Helpers.CreateInput(n,r||"0",BRIX.Inputs.CreateNumericInput);else if(i.Datatype=="datetime")u=BRIX.Conditions.Helpers.CreateDatepicker(t,n,r);else throw new Error('Unsupported type "'+i.Datatype+'"');return{Root:u}};BRIX.Conditions.Helpers={};BRIX.Conditions.Helpers.CreateDatepicker=function(n,t,i){var f=new Date,u,r,e;return f.setFullYear(f.getFullYear()-2),u=new Date,u.setFullYear(u.getFullYear()+30),IsDefined(i)?r=DateTimeParser(i,n.DateTimeFormat):(r=new Date,r.setMinutes(0,0,0)),e=new DropdownPicker(f,u,r,30,function(i){t(DateTimeToString(i,n.DateTimeFormat))},n.Dictionary.year,n.Dictionary.month,n.Dictionary.day,n.Dictionary.time),t(DateTimeToString(r,n.DateTimeFormat)),e.Create()};BRIX.Conditions.Helpers.CreateListbox=function(n,t,i){var o=BRIX.Markup("input-group"),r=document.createElement("select"),u,f,e;for(AddCssClass(r,"form-control"),o.appendChild(r),f=0;f<t.length;f++)e=t[f],u=document.createElement("option"),u.value=e.Value,u.innerHTML=e.Title,r.appendChild(u),u.value.toString()===i&&(u.selected=!0);return n&&(r.onchange=function(){n(r.options[r.selectedIndex].value)}),r.onchange(),r};BRIX.Conditions.Helpers.CreateInput=function(n,t,i){var r=i("",IsDefined(t)?t:"");return AddCssClass(r,"form-control"),n&&(r.onchange=function(){n(r.value)}),n(r.value),r};BRIX.Conditions.CreateOperatorBox=function(n,t,i,r){var u=document.createElement("select"),e,o,f;AddCssClass(u,"form-control");for(e in i.Operators)o=i.Operators[e],f=document.createElement("option"),f.value=e,f.innerHTML=o,u.appendChild(f),f.value===r&&(f.selected=!0);return n&&(u.onchange=function(){n(u.options[u.selectedIndex].value)}),{Root:u,Input:u}};BRIX.Conditions.CreateSourceBox=function(n,t,i,r){var a=t.Sources,l=BRIX.Markup("input-group"),u=document.createElement("select"),f,s,h,o,c,e;IsDefined(i)||(f=document.createElement("option"),f.innerHTML="- "+t.Dictionary.select+" -",u.appendChild(f));AddCssClass(u,"form-control");l.appendChild(u);for(s in a)for(h=a[s],o=0;o<h.length;o++)f=document.createElement("option"),f.value=h[o].Source,f.innerHTML=(s?s+" - ":"")+h[o].Title,u.appendChild(f),f.value===(i?i.Source:null)&&(f.selected=!0);return n&&(u.onchange=function(){var i=t.FindSource(u.options[u.selectedIndex].value);n(u,i)}),c=document.createElement("div"),AddCssClass(c,"input-group-btn"),l.appendChild(c),e=document.createElement("button"),AddCssClass(e,"btn btn-default"),e.innerHTML="<i class='glyphicon glyphicon-search'><\/i>",c.appendChild(e),ClientOperations.SetCallback(t.CallbackCancel,function(){r.Show()}),ClientOperations.SetCallback(t.CallbackSetSource,function(n){var i=JSON.parse(n);t.AddSource(i);f=document.createElement("option");f.value=i.Source;f.innerHTML=i.Title;u.appendChild(f);u.selectedIndex=u.options.length-1;u.onchange();r.Show()}),e.onclick=function(){return r.Hide(),t.SourceLookup.PerformAction(),!1},{Root:l,Input:u,Button:e}};ConditionEditorElement.InheritsFrom(ElementBase);ConditionEditorElement.prototype.GetXmlNodeData=function(n){var u,i,r,t;ElementBase.prototype.GetXmlNodeData.call(this,n);u=GetCDataValue(n,"json");i=JSON.parse(u);for(r in i)this[r]=i[r];t=this;this.Properties.FindSource=function(n){var r=i.Properties.Sources,u,t;for(u in r)for(t=0;t<r[u].length;t++)if(r[u][t].Source===n)return r[u][t];return null};this.Properties.AddSource=function(n){t.Properties.FindSource(n.Source)||(IsDefined(t.Properties.Sources[""])||(t.Properties.Sources[""]=[]),t.Properties.Sources[""].push(n))};this.SourceLookup&&(this.SourceLookup.IsJSON=!0,this.Properties.SourceLookup=new MacroElement(this,this.SourceLookup));IsDefined(this.Properties.Conditions)||(this.Properties.Conditions=[])};ConditionEditorElement.prototype.GetValuesAsQuery=function(n){var t=this,i,r,u;this.Properties.Conditions.length>0&&(i={Conditions:this.Properties.Conditions,IsIncluding:this.Properties.IsIncluding},r=function(n){var f,i,u;for(IsDefined(n.Left)&&(f=t.Properties.FindSource(n.Left.Source),i=BoolEditor.FindOption(f,n.Right.Value),IsDefined(i)&&IsDefined(i.AltEntity)&&(n.Option=i)),u=0;u<n.Conditions.length;u++)r(n.Conditions[u])},t.HasOnHide()&&(i[t.Properties.OnHide.ClearOnHideParameter]=t.Properties.OnHide.ClearOnHide),r(i),u=JSON.stringify(i),n.Add(this.Name,u))};ConditionEditorElement.prototype.InitializeMe=function(){var t=this,n=document.createElement("div"),i,r,u;AddCssClass(n,"ConditionEditor");n.id=this.Id;this.Root=n;i=this.Parent.GetBodyElement(this);i.appendChild(this.Root);this.HasOnMet()&&(this.OnMetGroup=this.BuildOnMetGroup(),this.OnMetGroup.style.display="none",n.appendChild(this.OnMetGroup));this.HasOnHide()&&(this.OnHideGroup=this.BuildOnHideGroup(),this.OnHideGroup.style.display="none",n.appendChild(this.OnHideGroup));r=function(t){n.insertBefore(t,n.firstChild)};u=function(n){t.HasOnMet()&&(t.OnMetGroup.style.display=n?"":"none");t.HasOnHide()&&(t.OnHideGroup.style.display=n?"":"none")};this.Editor=BoolEditor.Create(this.Properties.Conditions,this.Properties,r,u)};ConditionEditorElement.prototype.HasOnMet=function(){return IsDefined(this.Properties.OnMet)};ConditionEditorElement.prototype.HasOnHide=function(){return IsDefined(this.Properties.OnHide)};ConditionEditorElement.prototype.BuildOnHideGroup=function(){var i=this,n=BRIX.Markup(),r=BRIX.Markup("","h4"),t;return r.appendChild(document.createTextNode(this.Properties.OnHide.WhenHiddenCaption)),n.appendChild(r),t=function(t,i){var r=BRIX.Markup(["btn"],"button");return r.appendChild(ActiveIconArchive.Get(t).Create()),r.appendChild(document.createTextNode(" "+i)),n.appendChild(r),r},leaveButton=t(ConfirmIconName,this.Properties.OnHide.LeaveCaption),deleteButton=t(DeleteIconName,this.Properties.OnHide.DeleteCaption),leaveButton.onclick=function(){AddCssClass(deleteButton,"btn-default");RemoveCssClass(deleteButton,"btn-danger");RemoveCssClass(deleteButton,"active");RemoveCssClass(deleteButton,"Excluding");AddCssClass(leaveButton,"btn-success");AddCssClass(leaveButton,"active");AddCssClass(leaveButton,"Including");i.Properties.OnHide.ClearOnHide=!1},deleteButton.onclick=function(){AddCssClass(leaveButton,"btn-default");RemoveCssClass(leaveButton,"btn-success");RemoveCssClass(leaveButton,"active");RemoveCssClass(leaveButton,"Including");AddCssClass(deleteButton,"btn-danger");AddCssClass(deleteButton,"active");AddCssClass(deleteButton,"Excluding");i.Properties.OnHide.ClearOnHide=!0},this.Properties.OnHide.ClearOnHide?deleteButton.onclick():leaveButton.onclick(),n};ConditionEditorElement.prototype.BuildOnMetGroup=function(){var i=this,r=BRIX.Markup(),f=BRIX.Markup("","h4"),n,t,u;return f.appendChild(document.createTextNode(this.Properties.OnMet.WhenConditionsAreMet)),r.appendChild(f),u=function(n,t){var i=BRIX.Markup(["btn"],"button");return i.appendChild(ActiveIconArchive.Get(n).Create()),i.appendChild(document.createTextNode(" "+t)),r.appendChild(i),i},n=u(VisibleIconName,this.Properties.OnMet.Including),t=u(HiddenIconName,this.Properties.OnMet.Excluding),n.onclick=function(){AddCssClass(t,"btn-default");RemoveCssClass(t,"btn-danger");RemoveCssClass(t,"active");RemoveCssClass(t,"Excluding");AddCssClass(n,"btn-success");AddCssClass(n,"active");AddCssClass(n,"Including");i.Properties.IsIncluding=!0;i.Editor&&i.Editor.Rebuild()},t.onclick=function(){AddCssClass(n,"btn-default");RemoveCssClass(n,"btn-success");RemoveCssClass(n,"active");RemoveCssClass(n,"Including");AddCssClass(t,"btn-danger");AddCssClass(t,"active");AddCssClass(t,"Excluding");i.Properties.IsIncluding=!1;i.Editor&&i.Editor.Rebuild()},this.Properties.IsIncluding?n.onclick():t.onclick(),r};ConditionEditorScope.prototype.Build=function(n){var t=this.CreateWell(),i,r,u;n.appendChild(t);this.Container=t;i=document.createElement("h5");i.appendChild(document.createTextNode(this.Properties.Dictionary.conditions));t.appendChild(i);r=this.CreateWell();t.appendChild(r);u=this.CreateNewCondition();r.appendChild(u)};ConditionEditorScope.prototype.CreateCondition=function(){};ConditionEditorScope.prototype.CreateNewCondition=function(){var r=this,n=BRIX.Conditions.CreateLineContainer(),u=function(t,i){r.AddCondition(i,n);t.selectedIndex=0},t=BRIX.Conditions.CreateSourceBox(u,this.Properties),i=document.createElement("option");return i.innerHTML="- "+this.Properties.Dictionary.select+" -",t.Input.insertBefore(i,t.Input.firstChild),n.Body.appendChild(t.Root),n.Root};ConditionEditorScope.prototype.AddCondition=function(n,t){var r={Conditions:[],Left:n.Source,Operator:"equals",Right:{}},i,u;this.Scope.Conditions.push(r);i=this.CreateWell();t.Root.parentNode.insertBefore(i,t.Root);u=new ScopeCondition(i,this.Properties,r);u.Build()};ConditionEditorScope.prototype.CreateWell=function(){var n=document.createElement("div");return AddCssClass(n,"well"),n};ConditionEditorScope.prototype.CreateOperatorBox=function(){};BoolEditor={ClassChartRoot:"BoolChart",ClassAdd:"Add",ClassAnd:"And",ClassAndRight:"AndRight",ClassOr:"Or",ClassOrUp:"OrUp",ClassOrDown:"OrDown",ClassConnector:"Connector",ClassRow:"Row",ClassNode:"Node",ClassBlock:"Block",ClassBox:"Box",ClassNew:"New",ClassTerminator:"Terminator",ClassIcon:"TerminatorIcon",ClassChartColumns:function(n){return"Col"+(n>6?"Max":n)},NewMap:function(){return{Map:[],FindFreeY:function(n,t){for(var i,r=0;r<this.Map.length;r++)i=this.Map[r],i.Node&&i.X>=n&&i.Y>=t&&(t=i.Y+1);return t},Add:function(n,t,i,r){var u={X:n,Y:t,Node:i,Path:r};return this.Map.push(u),u},IsOr:function(n){return!(n.Path[0]===n.X-1&&n.Path[1]==n.Y)},Find:function(n,t){for(var i=0;i<this.Map.length;i++)if(this.Map[i].X===n&&this.Map[i].Y===t)return this.Map[i];return null},Connect:function(n,t){var r=this.Map,u=function(n,t){for(var u,i=0;i<r.length;i++)if(u=r[i],u.X===n&&u.Y===t)return u;return null},i=u(n,t);if(i)for(i.OrDown=!0;i;)t++,i=u(n,t),i?i.OrDown=!0:this.Map.push({X:n,Y:t,AndRight:!0,OrUp:!0});else this.Map.push({X:n,Y:t,And:!0})}}},Create:function(n,t,i,r){var u={};return u.DeleteCondition=function(n){var t=function(i){for(var u,f,r=0;r<i.Conditions.length;r++){if(u=i.Conditions[r],u==n){for(i.Conditions.splice(r,1),f=0;f<u.Conditions.length;f++)i.Conditions.push(u.Conditions[f]);return!0}if(t(u))return!0}};t(this)},u.Conditions=n||[],u.Properties=t,u.Rebuild=function(){var f,n,e,t;for(u.ChartRoot&&u.ChartRoot.parentNode.removeChild(u.ChartRoot),f=BoolEditor.ClassChartColumns(BoolEditor.CalcMaxHorizontalBlocks(u.Conditions)),u.ChartRoot=BRIX.Markup([BoolEditor.ClassChartRoot,f]),n=BoolEditor.NewMap(),e=[-1,0],t=0;t<u.Conditions.length;t++)BoolEditor.MapNodes(u.Conditions[t],n,e,0,0);BoolEditor.CreateJoints(n);BoolEditor.CreateMap(u,n);i(u.ChartRoot);r(u.Conditions.length>0)},u.Rebuild(),u},CreateJoints:function(n){for(var r,f,t,u,e=n.Map.slice(),i=0;i<e.length;i++){var t=e[i],s=t.X-t.Path[0],h=t.Y-t.Path[1],o=!n.IsOr(t);if(o)n.Add(t.X-.5,t.Y).And=!0;else if(!t.IsNewOr&&t.Y>0){for(u=n.Add(t.X-.5,t.Y),u.AndRight=!0,u.OrUp=!0,r=t.Y-1,f=n.Find(t.X-.5,r);!f&&r>0;)n.Add(t.X-.5,r).Or=!0,r--,f=n.Find(t.X-.5,r);f&&(f.OrDown=!0)}}for(i=0;i<e.length;i++)t=e[i],t.IsNewOr&&(t.X-=.5,u=n.Find(t.X,t.Y-1),u.OrDown=!0)},CreateMap:function(n,t){var r=null,o=0,s=0,f,i,u,e,h,l,a,c;if(t.Map.length>0){for(f=0;f<100;f++)for(i=-.5;i<100;i=i+.5)u=t.Find(i,f),u&&(i>o&&(o=i),f>s&&(s=f));for(f=0;f<=s;f++){for(h=!0,i=-.5;i<=o;i=i+.5)u=t.Find(i,f),i===-.5&&(r=BRIX.Markup(BoolEditor.ClassRow),n.ChartRoot.appendChild(r)),l=i!==Math.round(i),l?u?u.IsNewOr?(a=BoolEditor.MakeNewBox(n,u,!1,!0),r.appendChild(a)):r.appendChild(this.Connect(u)):(e=BRIX.Markup(BoolEditor.ClassConnector),r.appendChild(e)):(e=BRIX.Markup(BoolEditor.ClassBlock),u!==null&&(AddCssClass(e,BoolEditor.ClassNode),c=BRIX.Markup(BoolEditor.ClassBox),BoolEditor.RepresentCondition(n,u.Node,c),e.appendChild(c),h=!1),r.appendChild(e)),u&&u.Terminator&&(r.appendChild(BoolEditor.MakeNewBox(n,u,!0,!1)),r.appendChild(BoolEditor.MakeTerminator(n)));h&&AddCssClass(r,"Small")}}r=BRIX.Markup(BoolEditor.ClassRow);n.ChartRoot.appendChild(r);r.appendChild(BoolEditor.MakeNewBox(n,null,!1,!1))},MapNodes:function(n,t,i,r,u){var s,f=t.FindFreeY(r,u),c=[r,f],l=t.Add(r,f,n,i),o=f,h,e;if(n.Conditions.length===0)l.Terminator=!0;else{for(e=0;e<n.Conditions.length;e++)h=n.Conditions[e],o=BoolEditor.MapNodes(h,t,c,r+1,f);s=t.Add(r+1,o+1,n,[r,o]);s.IsNewOr=!0}return f},MakeNewBox:function(n,t,i,r){var u=BRIX.Markup([BoolEditor.ClassNew,BoolEditor.ClassBlock]),f,e;return i?(AddCssClass(u,"NewAnd"),u.appendChild(BRIX.Markup(BoolEditor.ClassAnd))):r?(AddCssClass(u,"NewOr"),u.appendChild(BRIX.Markup(BoolEditor.ClassOrUp)),u.appendChild(BRIX.Markup(BoolEditor.ClassAnd))):(AddCssClass(u,"NewOr"),u.appendChild(BRIX.Markup(BoolEditor.ClassAnd))),f=BRIX.Markup(BoolEditor.ClassBox),f.ParentNode=t?t.Node:n,f.onclick=function(){BoolEditor.AddCondition(n,this.ParentNode)},u.appendChild(f),n.Conditions.length===0?(e=n.Properties.Dictionary.condition,AddCssClass(f,"FirstCondition")):e=i?n.Properties.Dictionary.and:n.Properties.Dictionary.or,f.appendChild(document.createTextNode(e)),u},MakeTerminator:function(n){var r=n.Properties.IsIncluding,t=BRIX.Markup([BoolEditor.ClassTerminator,r?"Including":"Excluding"]),i;return t.appendChild(BRIX.Markup(BoolEditor.ClassAnd)),i=BRIX.Markup(BoolEditor.ClassIcon),i.appendChild(ActiveIconArchive.Get(r?VisibleIconName:HiddenIconName).Create()),t.appendChild(i),t},Connect:function(n){var t=BRIX.Markup(BoolEditor.ClassConnector);return n.And&&t.appendChild(BRIX.Markup(BoolEditor.ClassAnd)),n.AndRight&&t.appendChild(BRIX.Markup(BoolEditor.ClassAndRight)),n.Or&&t.appendChild(BRIX.Markup(BoolEditor.ClassOr)),n.OrUp&&t.appendChild(BRIX.Markup(BoolEditor.ClassOrUp)),n.OrDown&&t.appendChild(BRIX.Markup(BoolEditor.ClassOrDown)),n.Add&&t.appendChild(BRIX.Markup(BoolEditor.ClassAdd)),t},CalcMaxHorizontalBlocks:function(n){var t,i,r;return t=function(n,i){for(var f,r=i,u=0;u<n.Conditions.length;u++)f=t(n.Conditions[u],i+1),f>r&&(r=f);return r},i={Conditions:n},r=t(i,0),r}};BoolEditor.AddCondition=function(n,t){BoolEditor.ShowConditionDialog(n,null,function(i,r,u,f){var e={Left:i,Operator:r,Right:{Value:u},Conditions:[],Option:f};t.Conditions.push(e);n.Rebuild()})};BoolEditor.EditCondition=function(n,t){var i=function(i,r,u){t.Left=i;t.Operator=r;t.Right={Value:u};n.Rebuild()},r=function(){n.DeleteCondition(t);n.Rebuild()};BoolEditor.ShowConditionDialog(n,t,i,r)};BoolEditor.ShowConditionDialog=function(n,t,i,r){var e,f,h=IsDefined(t),u=BRIX.Markup(["btn","btn-primary","btn-important","disabled"]),o,s;u.setAttribute("type","button");u.appendChild(ActiveIconArchive.Get(CheckmarkIcon).Create());o=function(n){n?(RemoveCssClass(u,"disabled"),u.onclick=function(){var n=e();i(n.Source,n.Operator,n.Value,n.Option);f.Close()}):(AddCssClass(u,"disabled"),u.onclick=null)};s={Title:n.Properties.Dictionary.condition,BodyBuilder:function(i){e=BoolEditor.BuildConditionEditor(f,o,i,n,t)},FooterBuilder:function(n){if(h){var t=BRIX.Markup(["btn","btn-danger","pull-left"]);t.setAttribute("type","button");t.appendChild(ActiveIconArchive.Get(DeleteIconName).Create());t.onclick=function(){r();f.Close()};n.appendChild(t)}n.appendChild(u)},Closeable:!0};f=BRIX.CreateModal(s);f.Open();IsDefined(e().Source)&&o(!0)};BoolEditor.BuildConditionEditor=function(n,t,i,r,u,f,e){var o=f?f:u?r.Properties.FindSource(u.Left.Source):null,h=u?u.Right.Value:null,c=e?e:u?u.Operator:null,l=function(){return{Source:o,Operator:c,Value:h,Option:BoolEditor.FindOption(o,h)}},a=function(){return l()},k=function(u,f){i.innerHTML="";var e=BoolEditor.BuildConditionEditor(n,t,i,r,null,f,"equals");l=function(){return e()};t(!0)},s=document.createElement("form"),v,y,p,w,b;return(i.appendChild(s),v=BRIX.Conditions.CreateSourceBox(k,r.Properties,o,n),s.appendChild(v.Root),!o)?a:(s.appendChild(document.createElement("br")),y=function(n){c=n},p=BRIX.Conditions.CreateOperatorBox(y,r.Properties,o,c),s.appendChild(p.Root),s.appendChild(document.createElement("br")),w=function(n){h=n},b=BRIX.Conditions.CreateValueBox(w,r.Properties,o,h),s.appendChild(b.Root),a)};BoolEditor.RepresentCondition=function(n,t,i){var e=BRIX.Markup("Representation"),r=BRIX.Markup("Mid","span"),u,f;e.appendChild(r);var o=n.Properties.FindSource(t.Left.Source),h=o.Operators[t.Operator],s=BRIX.Markup("Left","span");s.appendChild(document.createTextNode(t.Left.Title));r.appendChild(s);r.appendChild(document.createTextNode(" "));u=BRIX.Markup(["Operator",t.Operator.replace(" ","")],"span");u.appendChild(document.createTextNode(h));r.appendChild(u);r.appendChild(document.createTextNode(" "));f=BRIX.Markup("Right","span");f.appendChild(document.createTextNode(BoolEditor.RepresentValue(o,t.Right.Value)));r.appendChild(f);i.appendChild(e);i.onclick=function(){BoolEditor.EditCondition(n,t)}};BoolEditor.FindOption=function(n,t){var r,i;if(n&&n.Options){for(r=null,i=0;i<n.Options.length;i++)if(n.Options[i].Value.toString()===t){r=n.Options[i];break}return r}return null};BoolEditor.RepresentValue=function(n,t){var i=BoolEditor.FindOption(n,t);return i?i.Title:IsDefined(t)?t:""};BoolEditor.Service=function(){};ScopeCondition.prototype.Build=function(){var n=BRIX.Conditions.CreateLineContainer(),t,i,r,u;this.Container.appendChild(n.Body);t=function(){};i=BRIX.Conditions.CreateSourceBox(t,this.Properties,this.Condition.Left);n.Body.appendChild(i.Root);r=BRIX.Conditions.CreateOperatorBox(null,this.Properties,this.Condition.Left,this.Condition.Operator);n.Body.appendChild(r.Root);u=BRIX.Conditions.CreateValueBox(null,this.Properties,this.Condition.Left,this.Condition.Right);n.Body.appendChild(u.Root)};TimeoutElement.InheritsFrom(ElementBase);TimeoutElement.prototype.GetXmlNodeData=function(n){var r,t,i;ElementBase.prototype.GetXmlNodeData.call(this,n);r=GetCDataValue(n,"json");t=JSON.parse(r);for(i in t)this[i]=t[i]};TimeoutElement.prototype.InitializeMe=function(){var n=this,i,t,u,r;if(this.Expires)u=DateTimeParser(this.Expires,"yyyy-MM-dd HH:mm:ss.fff"),r=function(){BRIX.Utilities.NTP.GetDate(function(t){var i=u-t;i<=0?n.OnTimeout():(n.UpdateTimers(i),n.UpdateHandle=window.setTimeout(r,1e3))})},BRIX.Utilities.NTP.GetDate(function(){r()});else for(i=ElementIndex.FindAll(function(t){return t.MyClassName===n.MyClassName&&t.Id===n.Id}),t=0;t<i.length;t++)i[t].Cancel()};TimeoutElement.prototype.Cancel=function(){this.Cancelled=!0;this.UpdateHandle&&window.clearTimeout(this.UpdateHandle);this.WriteToTimers(this.Id,"");this.Remove()};TimeoutElement.prototype.WriteToTimers=function(n,t){$("span[class='BRIX.countdown'][id='"+n+"']").each(function(n,i){i.innerText=t})};TimeoutElement.prototype.UpdateTimers=function(n){var t=function(n){var r=parseInt(n%1e3/100),t=parseInt(n/1e3%60),i=parseInt(n/6e4%60);return i=i<10?"0"+i:i,t=t<10?"0"+t:t,i+":"+t},i=t(n);this.WriteToTimers(this.Id,i)};TimeoutElement.prototype.OnTimeout=function(){var n=this,t;n.UpdateTimers(0);t=BRIX.CreateModal({BodyBuilder:function(t){content=$("<div><p>"+n.Message+"<\/p><\/div>");t.appendChild(content[0])},Size:"small",Closeable:!0});t.Open()};ContextMenu.InheritsFrom(Menu);ContextMenu.prototype.GetXmlNodeData=function(n){Menu.prototype.GetXmlNodeData.call(this,n);this.IsManualMenu||(this.Parent.ContextMenu=this);this.SetRelatedElement(this.Parent)};ContextMenu.prototype.CreateMenu=function(n,t,i){var r=document.documentElement,u=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),f=(window.pageYOffset||r.scrollTop)-(r.clientTop||0);this.OnCloseCallback=i;this.CreateFloor();this.Floor.style.top=f+"px";this.Floor.style.left=u+"px";this.CreateDimmer();this.ExpandMenu(n,t)};ContextMenu.prototype.PlaceBox=function(n,t){var i=new LayerSize(document.body),r=new LayerSize(this.Box),u=r.Width+n>i.Width?i.Width-r.Width:n,t=t+r.Height>i.Height?i.Height-r.Height:t;this.Box.style.top=t+"px";this.Box.style.left=u+"px"};ContextMenu.prototype.HideMenu=function(){this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.CreateDimmer=function(){this.Dimmer=CreateDimmerElement();this.Dimmer.id=this.Id+"_dimmer";this.Floor.appendChild(this.Dimmer);this.EventTracker=new EventTracking(this.Dimmer.id);this.EventTracker.AddCallback("click",this,"CloseMenu",!1)};ContextMenu.prototype.RemoveDimmer=function(){this.Dimmer&&(this.Dimmer.parentNode.removeChild(this.Dimmer),this.Dimmer=null)};ContextMenu.prototype.CloseMenu=function(){this.OnCloseCallback&&(this.OnCloseCallback(),this.OnCloseCallback=null);Menu.prototype.CloseMenu.call(this);this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.Destroy=function(){this.Parent.ContextMenu=null;this.RemoveDimmer();this.RemoveFloor()};ContextMenu.prototype.CreateFloor=function(){var n=document.createElement("div");n.id=this.Id+"_floor";n.style.position="fixed";n.style.top="0px";n.style.height="100%";n.style.left="0px";n.style.width="100%";n.style.overflow="hidden";n.style.zIndex="20";this.Floor=n;document.body.appendChild(n)};ContextMenu.prototype.RemoveFloor=function(){this.Floor&&(this.Floor.parentNode.removeChild(this.Floor),this.Floor=null)},function(n){function i(n,t){if(!(n.originalEvent.touches.length>1)){n.preventDefault();var i=n.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null);n.target.dispatchEvent(r)}}if(n.support.touch="ontouchend"in document,n.support.touch){var t=n.ui.mouse.prototype,u=t._mouseInit,f=t._mouseDestroy,r;t._touchStart=function(n){var t=this;!r&&t._mouseCapture(n.originalEvent.changedTouches[0])&&(r=!0,t._touchMoved=!1,i(n,"mouseover"),i(n,"mousemove"),i(n,"mousedown"))};t._touchMove=function(n){r&&(this._touchMoved=!0,i(n,"mousemove"))};t._touchEnd=function(n){r&&(i(n,"mouseup"),i(n,"mouseout"),this._touchMoved||i(n,"click"),r=!1)};t._mouseInit=function(){var t=this;t.element.bind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")});u.call(t)};t._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:n.proxy(t,"_touchStart"),touchmove:n.proxy(t,"_touchMove"),touchend:n.proxy(t,"_touchEnd")});f.call(t)}}}(jQuery);BreadcrumbElement.prototype.totalListWidth=function(){$(".StandAloneBreadcrumb ul").each(function(){this.style.width=$(this).outerWidth()+25+"px"});$(".IntegratedBreadcrumb ul").each(function(){this.style.width=$(this).outerWidth()+25+"px"})};BRIX.CreateModal=function(n){var t={Title:IsDefined(n.Title)?n.Title:null,TitleBuilder:IsFunction(n.TitleBuilder)?option.TitleBuilder:null,Body:IsDefined(n.Body)?n.Body:null,BodyBuilder:IsFunction(n.BodyBuilder)?n.BodyBuilder:null,Footer:IsDefined(n.Footer)?n.Footer:null,FooterBuilder:IsFunction(n.FooterBuilder)?n.FooterBuilder:null,Closeable:IsDefined(n.Closeable)?n.Closeable===!0:!0,Id:GetNewId(),Size:n.Size||"medium"},r=t.Closeable?$('<button type="button" class="close" data-dismiss="modal">&times;<\/button>')[0]:null,u=IsFunction(t.TitleBuilder)||IsDefined(t.Title),f=IsFunction(t.BodyBuilder)||IsDefined(t.Body),e=IsFunction(t.FooterBuilder)||IsDefined(t.Footer),i,o=function(){var n,o,s,h,c,l;i=document.createElement("div");i.id=t.Id;AddCssClass(i,"modal fade");$(i).attr("role","dialog");n=document.createElement("div");AddCssClass(n,"modal-dialog");t.Size==="small"?AddCssClass(n,"modal-sm"):t.Size==="large"&&AddCssClass(n,"modal-lg");i.appendChild(n);o=document.createElement("div");AddCssClass(o,"modal-content");n.appendChild(o);u&&(s=document.createElement("div"),AddCssClass(s,"modal-header"),o.appendChild(s),t.Closeable&&s.appendChild(r),IsFunction(t.TitleBuilder)&&t.TitleBuilder(s),IsDefined(t.Title)&&s.appendChild($("<h4>"+t.Title+"<\/h4>")[0]));f&&(h=document.createElement("div"),AddCssClass(h,"modal-body"),o.appendChild(h),!u&&t.Closeable&&h.appendChild(r),IsFunction(t.BodyBuilder)&&t.BodyBuilder(h),IsDefined(t.Body)&&h.appendChild($("<div>"+t.Body+"<\/div>")[0]));e&&(c=document.createElement("div"),AddCssClass(c,"modal-footer"),o.appendChild(c),IsFunction(t.FooterBuilder)&&t.FooterBuilder(c),IsDefined(t.Footer)&&c.appendChild($("<div>"+t.Footer+"<\/div>")[0]));l=BRIX.CreateModal.GetContainer();l.appendChild(i);$("#"+t.Id).modal()};return t.Open=o,t.Hide=function(){$("#"+t.Id).modal("hide")},t.Show=function(){$("#"+t.Id).modal("show")},t.Close=function(){$("#"+t.Id).modal("hide");window.setTimeout(function(){i.parentNode.removeChild(i)},50)},t};BRIX.CreateModal.GetContainer=function(){if(IsDefined(BRIX.CreateModal.Container))return BRIX.CreateModal.Container;var n=document.createElement("div");return BRIX.CreateModal.Container=n,AddCssClass(n,"container"),n.id="ModalContainer",document.body.appendChild(n),n};!function(n){"use strict";"object"==typeof exports?module.exports=n(window.jQuery):"function"==typeof define&&define.amd?define(["jquery"],n):window.jQuery&&!window.jQuery.fn.colorpicker&&n(window.jQuery)}(function(n){"use strict";var t=function(t,i){this.value={h:0,s:0,b:0,a:1};this.origFormat=null;i&&n.extend(this.colors,i);t&&(void 0!==t.toLowerCase?(t+="",this.setColor(t)):void 0!==t.h&&(this.value=t))},r,i;t.prototype={constructor:t,colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",transparent:"transparent"},_sanitizeNumber:function(n){return"number"==typeof n?n:isNaN(n)||null===n||""===n||void 0===n?1:void 0!==n.toLowerCase?parseFloat(n):1},isTransparent:function(n){return n?(n=n.toLowerCase().trim(),"transparent"===n||n.match(/#?00000000/)||n.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/)):!1},rgbaIsTransparent:function(n){return 0===n.r&&0===n.g&&0===n.b&&0===n.a},setColor:function(n){n=n.toLowerCase().trim();n&&(this.value=this.isTransparent(n)?{h:0,s:0,b:0,a:0}:this.stringToHSB(n)||{h:0,s:0,b:0,a:1})},stringToHSB:function(t){var u,i,r;return t=t.toLowerCase(),"undefined"!=typeof this.colors[t]&&(t=this.colors[t],u="alias"),i=this,r=!1,n.each(this.stringParsers,function(n,f){var o=f.re.exec(t),e=o&&f.parse.apply(i,[o]),s=u||f.format||"rgba";return e?(r=s.match(/hsla?/)?i.RGBtoHSB.apply(i,i.HSLtoRGB.apply(i,e)):i.RGBtoHSB.apply(i,e),i.origFormat=s,!1):!0}),r},setHue:function(n){this.value.h=1-n},setSaturation:function(n){this.value.s=n},setBrightness:function(n){this.value.b=1-n},setAlpha:function(n){this.value.a=parseInt(100*(1-n),10)/100},toRGB:function(n,t,i,r){n||(n=this.value.h,t=this.value.s,i=this.value.b);n*=360;var e,o,s,f,u;return n=n%360/60,u=i*t,f=u*(1-Math.abs(n%2-1)),e=o=s=i-u,n=~~n,e+=[u,f,0,0,f,u][n],o+=[f,u,u,f,0,0][n],s+=[0,0,f,u,u,f][n],{r:Math.round(255*e),g:Math.round(255*o),b:Math.round(255*s),a:r||this.value.a}},toHex:function(n,t,i,r){var u=this.toRGB(n,t,i,r);return this.rgbaIsTransparent(u)?"transparent":"#"+(16777216|parseInt(u.r)<<16|parseInt(u.g)<<8|parseInt(u.b)).toString(16).substr(1)},toHSL:function(n,t,i,r){n=n||this.value.h;t=t||this.value.s;i=i||this.value.b;r=r||this.value.a;var e=n,u=(2-t)*i,f=t*i;return f/=u>0&&1>=u?u:2-u,u/=2,f>1&&(f=1),{h:isNaN(e)?0:e,s:isNaN(f)?0:f,l:isNaN(u)?0:u,a:isNaN(r)?0:r}},toAlias:function(n,t,i,r){var f=this.toHex(n,t,i,r);for(var u in this.colors)if(this.colors[u]===f)return u;return!1},RGBtoHSB:function(n,t,i,r){n/=255;t/=255;i/=255;var e,o,f,u;return f=Math.max(n,t,i),u=f-Math.min(n,t,i),e=0===u?null:f===n?(t-i)/u:f===t?(i-n)/u+2:(n-t)/u+4,e=(e+360)%6/6,o=0===u?0:u/f,{h:this._sanitizeNumber(e),s:o,b:f,a:this._sanitizeNumber(r)}},HueToRGB:function(n,t,i){return 0>i?i+=1:i>1&&(i-=1),1>6*i?n+(t-n)*i*6:1>2*i?t:2>3*i?n+(t-n)*(2/3-i)*6:n},HSLtoRGB:function(n,t,i,r){var u;0>t&&(t=0);u=.5>=i?i*(1+t):i+t-i*t;var f=2*i-u,e=n+1/3,o=n,s=n-1/3,h=Math.round(255*this.HueToRGB(f,u,e)),c=Math.round(255*this.HueToRGB(f,u,o)),l=Math.round(255*this.HueToRGB(f,u,s));return[h,c,l,this._sanitizeNumber(r)]},toString:function(n){n=n||"rgba";var t=!1;switch(n){case"rgb":return t=this.toRGB(),this.rgbaIsTransparent(t)?"transparent":"rgb("+t.r+","+t.g+","+t.b+")";case"rgba":return t=this.toRGB(),"rgba("+t.r+","+t.g+","+t.b+","+t.a+")";case"hsl":return t=this.toHSL(),"hsl("+Math.round(360*t.h)+","+Math.round(100*t.s)+"%,"+Math.round(100*t.l)+"%)";case"hsla":return t=this.toHSL(),"hsla("+Math.round(360*t.h)+","+Math.round(100*t.s)+"%,"+Math.round(100*t.l)+"%,"+t.a+")";case"hex":return this.toHex();case"alias":return this.toAlias()||this.toHex();default:return t}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(n){return[n[1],n[2],n[3],1]}},{re:/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(n){return[2.55*n[1],2.55*n[2],2.55*n[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(n){return[n[1],n[2],n[3],n[4]]}},{re:/rgba\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(n){return[2.55*n[1],2.55*n[2],2.55*n[3],n[4]]}},{re:/hsl\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(n){return[n[1]/360,n[2]/100,n[3]/100,n[4]]}},{re:/hsla\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(n){return[n[1]/360,n[2]/100,n[3]/100,n[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(n){return[parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(n){return[parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),1]}}],colorNameToHex:function(n){return"undefined"!=typeof this.colors[n.toLowerCase()]?this.colors[n.toLowerCase()]:!1}};r={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'<div class="colorpicker dropdown-menu"><div class="colorpicker-saturation"><i><b><\/b><\/i><\/div><div class="colorpicker-hue"><i><\/i><\/div><div class="colorpicker-alpha"><i><\/i><\/div><div class="colorpicker-color"><div /><\/div><div class="colorpicker-selectors"><\/div><\/div>',align:"right",customClass:null,colorSelectors:null};i=function(i,u){if(this.element=n(i).addClass("colorpicker-element"),this.options=n.extend(!0,{},r,this.element.data(),u),this.component=this.options.component,this.component=this.component!==!1?this.element.find(this.component):!1,this.component&&0===this.component.length&&(this.component=!1),this.container=this.options.container===!0?this.element:this.options.container,this.container=this.container!==!1?n(this.container):!1,this.input=this.element.is("input")?this.element:this.options.input?this.element.find(this.options.input):!1,this.input&&0===this.input.length&&(this.input=!1),this.color=new t(this.options.color!==!1?this.options.color:this.getValue(),this.options.colorSelectors),this.format=this.options.format!==!1?this.options.format:this.color.origFormat,this.picker=n(this.options.template),this.options.customClass&&this.picker.addClass(this.options.customClass),this.options.inline?this.picker.addClass("colorpicker-inline colorpicker-visible"):this.picker.addClass("colorpicker-hidden"),this.options.horizontal&&this.picker.addClass("colorpicker-horizontal"),("rgba"===this.format||"hsla"===this.format||this.options.format===!1)&&this.picker.addClass("colorpicker-with-alpha"),"right"===this.options.align&&this.picker.addClass("colorpicker-right"),this.options.colorSelectors){var f=this;n.each(this.options.colorSelectors,function(t,i){var r=n("<i />").css("background-color",i).data("class",t);r.click(function(){f.setValue(n(this).css("background-color"))});f.picker.find(".colorpicker-selectors").append(r)});this.picker.find(".colorpicker-selectors").show()}this.picker.on("mousedown.colorpicker touchstart.colorpicker",n.proxy(this.mousedown,this));this.picker.appendTo(this.container?this.container:n("body"));this.input!==!1&&(this.input.on({"keyup.colorpicker":n.proxy(this.keyup,this)}),this.input.on({"change.colorpicker":n.proxy(this.change,this)}),this.component===!1&&this.element.on({"focus.colorpicker":n.proxy(this.show,this)}),this.options.inline===!1&&this.element.on({"focusout.colorpicker":n.proxy(this.hide,this)}));this.component!==!1&&this.component.on({"click.colorpicker":n.proxy(this.show,this)});this.input===!1&&this.component===!1&&this.element.on({"click.colorpicker":n.proxy(this.show,this)});this.input!==!1&&this.component!==!1&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":n.proxy(this.show,this),"focus.colorpicker":n.proxy(this.show,this)});this.update();n(n.proxy(function(){this.element.trigger("create")},this))};i.Color=t;i.prototype={constructor:i,destroy:function(){this.picker.remove();this.element.removeData("colorpicker").off(".colorpicker");this.input!==!1&&this.input.off(".colorpicker");this.component!==!1&&this.component.off(".colorpicker");this.element.removeClass("colorpicker-element");this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==!1||this.options.container)return!1;var i=this.container&&this.container[0]!==document.body?"position":"offset",n=this.component||this.element,t=n[i]();"right"===this.options.align&&(t.left-=this.picker.outerWidth()-n.outerWidth());this.picker.css({top:t.top+n.outerHeight(),left:t.left})},show:function(t){return this.isDisabled()?!1:(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),n(window).on("resize.colorpicker",n.proxy(this.reposition,this)),!t||this.hasInput()&&"color"!==this.input.attr("type")||t.stopPropagation&&t.preventDefault&&(t.stopPropagation(),t.preventDefault()),this.options.inline===!1&&n(window.document).on({"mousedown.colorpicker":n.proxy(this.hide,this)}),void this.element.trigger({type:"showPicker",color:this.color}))},hide:function(){this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible");n(window).off("resize.colorpicker",this.reposition);n(document).off({"mousedown.colorpicker":this.hide});this.update();this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(n){return n=n||this.color.toString(this.format),this.element.data("color",n),n},updateInput:function(n){if(n=n||this.color.toString(this.format),this.input!==!1){if(this.options.colorSelectors){var r=new t(n,this.options.colorSelectors),i=r.toAlias();"undefined"!=typeof this.options.colorSelectors[i]&&(n=i)}this.input.prop("value",n)}return n},updatePicker:function(n){void 0!==n&&(this.color=new t(n,this.options.colorSelectors));var i=this.options.horizontal===!1?this.options.sliders:this.options.slidersHorz,r=this.picker.find("i");if(0!==r.length)return(this.options.horizontal===!1?(i=this.options.sliders,r.eq(1).css("top",i.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",i.alpha.maxTop*(1-this.color.value.a))):(i=this.options.slidersHorz,r.eq(1).css("left",i.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",i.alpha.maxLeft*(1-this.color.value.a))),r.eq(0).css({top:i.saturation.maxTop-this.color.value.b*i.saturation.maxTop,left:this.color.value.s*i.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex()),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(this.format)),n)},updateComponent:function(n){if(n=n||this.color.toString(this.format),this.component!==!1){var t=this.component.find("i").eq(0);t.length>0?t.css({backgroundColor:n}):this.component.css({backgroundColor:n})}return n},update:function(n){var t;return(this.getValue(!1)!==!1||n===!0)&&(t=this.updateComponent(),this.updateInput(t),this.updateData(t),this.updatePicker()),t},setValue:function(n){this.color=new t(n,this.options.colorSelectors);this.update(!0);this.element.trigger({type:"changeColor",color:this.color,value:n})},getValue:function(n){n=void 0===n?"#000000":n;var t;return t=this.hasInput()?this.input.val():this.element.data("color"),(void 0===t||""===t||null===t)&&(t=n),t},hasInput:function(){return this.input!==!1},isDisabled:function(){return this.hasInput()?this.input.prop("disabled")===!0:!1},disable:function(){return this.hasInput()?(this.input.prop("disabled",!0),this.element.trigger({type:"disable",color:this.color,value:this.getValue()}),!0):!1},enable:function(){return this.hasInput()?(this.input.prop("disabled",!1),this.element.trigger({type:"enable",color:this.color,value:this.getValue()}),!0):!1},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(t){var u;t.pageX||t.pageY||!t.originalEvent||(t.pageX=t.originalEvent.touches[0].pageX,t.pageY=t.originalEvent.touches[0].pageY);t.stopPropagation();t.preventDefault();var f=n(t.target),i=f.closest("div"),r=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!i.is(".colorpicker")){if(i.is(".colorpicker-saturation"))this.currentSlider=n.extend({},r.saturation);else if(i.is(".colorpicker-hue"))this.currentSlider=n.extend({},r.hue);else{if(!i.is(".colorpicker-alpha"))return!1;this.currentSlider=n.extend({},r.alpha)}u=i.offset();this.currentSlider.guide=i.find("i")[0].style;this.currentSlider.left=t.pageX-u.left;this.currentSlider.top=t.pageY-u.top;this.mousePointer={left:t.pageX,top:t.pageY};n(document).on({"mousemove.colorpicker":n.proxy(this.mousemove,this),"touchmove.colorpicker":n.proxy(this.mousemove,this),"mouseup.colorpicker":n.proxy(this.mouseup,this),"touchend.colorpicker":n.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(n){n.pageX||n.pageY||!n.originalEvent||(n.pageX=n.originalEvent.touches[0].pageX,n.pageY=n.originalEvent.touches[0].pageY);n.stopPropagation();n.preventDefault();var t=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((n.pageX||this.mousePointer.left)-this.mousePointer.left))),i=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((n.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=t+"px",this.currentSlider.guide.top=i+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,t/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,i/this.currentSlider.maxTop),"setAlpha"===this.currentSlider.callTop&&this.options.format===!1&&(1!==this.color.value.a?(this.format="rgba",this.color.origFormat="rgba"):(this.format="hex",this.color.origFormat="hex")),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(t){return t.stopPropagation(),t.preventDefault(),n(document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},change:function(n){this.keyup(n)},keyup:function(n){38===n.keyCode?(this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0)):40===n.keyCode?(this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0)):(this.color=new t(this.input.val(),this.options.colorSelectors),this.color.origFormat&&this.options.format===!1&&(this.format=this.color.origFormat),this.getValue(!1)!==!1&&(this.updateData(),this.updateComponent(),this.updatePicker()));this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})}};n.colorpicker=i;n.fn.colorpicker=function(t){var r,u=arguments,f=this.each(function(){var e=n(this),f=e.data("colorpicker"),o="object"==typeof t?t:{};f||"string"==typeof t?"string"==typeof t&&(r=f[t].apply(f,Array.prototype.slice.call(u,1))):e.data("colorpicker",new i(this,o))});return"getValue"===t?r:f};n.fn.colorpicker.constructor=i})